# `getNextNonce`

Returns the right nonce to propose a new transaction right after the last pending transaction.

## Usage


<Tabs items={['example.ts', 'setup.ts']}>
  <Tabs.Tab>
    ```typescript
    import { apiKit } from './setup.ts'

    const safeAddress = '0x...'

    const nextNonce = await apiKit.getNextNonce(safeAddress)
    ```
  </Tabs.Tab>
  <Tabs.Tab>
    ```typescript
    import SafeApiKit from '@safe-global/api-kit'

    // How to get an Api key => http://docs.safe.global/core-api/how-to-use-api-keys
    export const apiKit = new SafeApiKit({
      chainId: 1n, // Mainnet
      apiKey: 'YOUR_API_KEY'
    })
    ```
  </Tabs.Tab>
</Tabs>


## Returns

`Promise<number>`

The right nonce to propose a new transaction after the last pending transaction.

## Parameters

### `safeAddress`

- **Type:** `string`

The Safe address.

```typescript focus=2
const nextNonce = await apiKit.getNextNonce(
  '0x...'
)
```
