Skip to content

Commit

Permalink
change nonce management
Browse files Browse the repository at this point in the history
  • Loading branch information
rappix committed Aug 6, 2024
1 parent 3f2fcb9 commit 08ca86d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,14 @@ export async function submitExtrinsic(
};
return resolve(response);
}

const nonce = await polkadotApi.rpc.system.accountNextIndex(account.address);

// @ts-ignore
await polkadotApi.tx[pallet][call](...params)
.signAndSend(
account,
{ nonce: -1 },
{ nonce: nonce },
({ status, events = [], dispatchError }) => {
if (dispatchError) {
// for module errors, we have the section indexed, lookup
Expand Down

0 comments on commit 08ca86d

Please sign in to comment.