From 5db9b636cb426da7787a6dafaea30c18e3c9008e Mon Sep 17 00:00:00 2001 From: Andy Haynes Date: Mon, 23 Sep 2024 13:47:28 -0700 Subject: [PATCH] fix: default nonce lookup finality --- .../transactions/composers/signed_transaction_composer.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/client/src/transactions/composers/signed_transaction_composer.ts b/packages/client/src/transactions/composers/signed_transaction_composer.ts index 7fd4b03f8..1d7b067cd 100644 --- a/packages/client/src/transactions/composers/signed_transaction_composer.ts +++ b/packages/client/src/transactions/composers/signed_transaction_composer.ts @@ -93,7 +93,11 @@ export class SignedTransactionComposer extends TransactionComposer { async signAndSend(blockReference: BlockReference = { finality: 'final' }) { const deps = { rpcProvider: this.rpcProvider, signer: this.signer }; const blockHash = this.blockHash || (await this.rpcProvider.block(blockReference))?.header?.hash; - const signerNonce = this.nonce || (await getSignerNonce({ account: this.sender, blockReference, deps }) + 1n); + const signerNonce = this.nonce || (await getSignerNonce({ + account: this.sender, + blockReference: { finality: 'optimistic' }, + deps, + }) + 1n); const { signedTransaction } = await this.toSignedTransaction({ nonce: signerNonce,