Skip to content

Commit

Permalink
fix: default nonce lookup finality
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-haynes committed Sep 23, 2024
1 parent 93e6a31 commit 5db9b63
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ export class SignedTransactionComposer extends TransactionComposer {
async signAndSend<T extends SerializedReturnValue>(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,
Expand Down

0 comments on commit 5db9b63

Please sign in to comment.