es/tx/tx.js
async function getAccountNonce (accountId, nonce) {
  if (nonce) return nonce
  const { nonce: accountNonce } = await this.api.getAccountByPubkey(accountId).catch(() => ({ nonce: 0 }))
  return accountNonce + 1
}
async function getAccountNonce (accountId, nonce) {
  if (nonce) return nonce
  const { nonce: accountNonce } = await this.api.getAccountByPubkey(accountId).catch(() => ({ nonce: 0 }))
  return accountNonce + 1
}
async function getAccountNonce ( accountId , nonce ) { if ( nonce ) return nonce const { nonce : accountNonce } = await this . api . getAccountByPubkey ( accountId ) . catch ( ( ) => ( { nonce : 0 } ) ) return accountNonce + 1 }
Get the next nonce to be used for a transaction for an account

@param {string} accountId
@param {number} nonce
@return {number} Next Nonce
Get the next nonce to be used for a transaction for an account