Skip to content

Commit

Permalink
Merge pull request #1163 from LimeChain/fix-my-near-wallet-nonce
Browse files Browse the repository at this point in the history
fix: [fix] - Use BigInt for nonce calculation in transactions
  • Loading branch information
Pavel Ivanov authored Aug 6, 2024
2 parents 589734a + 0d39ff2 commit b3fee4b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/my-near-wallet/src/lib/my-near-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ const MyNearWallet: WalletBehaviourFactory<

const block = await provider.block({ finality: "final" });

const nonce = accessKey.access_key.nonce + BigInt(index + 1);

return nearAPI.transactions.createTransaction(
account.accountId,
nearAPI.utils.PublicKey.from(accessKey.public_key),
transaction.receiverId,
accessKey.access_key.nonce + index + 1,
nonce,
actions,
nearAPI.utils.serialize.base_decode(block.header.hash)
);
Expand Down

0 comments on commit b3fee4b

Please sign in to comment.