From 0d39ff26ba62f0aedbeebe3a7244bcfaa9fec076 Mon Sep 17 00:00:00 2001 From: Pavel Ivanov Date: Tue, 6 Aug 2024 14:26:08 +0300 Subject: [PATCH] [fix] - Use BigInt for nonce calculation in transactions --- packages/my-near-wallet/src/lib/my-near-wallet.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/my-near-wallet/src/lib/my-near-wallet.ts b/packages/my-near-wallet/src/lib/my-near-wallet.ts index 5a3721567..5ac291a8d 100644 --- a/packages/my-near-wallet/src/lib/my-near-wallet.ts +++ b/packages/my-near-wallet/src/lib/my-near-wallet.ts @@ -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) );