Skip to content

Commit

Permalink
[fix] - Use BigInt for nonce calculation in transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Ivanov committed Aug 6, 2024
1 parent 589734a commit 0d39ff2
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 0d39ff2

Please sign in to comment.