Skip to main content

Non-Blocking Transactions

For Developers who want to build use cases that require a higher throughput, then 2D nonces are essential. For example: A user may want to make four independent transactions. With only a 1D nonce, a user would have to wait for each transaction to get on-chain before sending the next one to the mempool. In Non-Blocking such a user can build each User Operation using nonces from keys 0, 1, 2, and 3. All four transactions can then be submitted at once without blocking each other. This can be an approve, unstake, withdraw and transfer transaction in one User Operation. The executeBatch() method is used.

To utilize this feature, simply pass the TxOptions with useNonceSequence: true. Setting this flag activates the NonceManager, which increments the nonce automatically. Additionally, you have the option to pass a custom nonce key, for example, customNonceKey: BigInt.from(10).

const tokenAddress = "YOUR_TOKEN";
const to = "RECEIVER_ADDRESS";
const amount = parseEther("0.001");
const data = Uint8Array.from([]);
await fuseSDK.transferToken(
tokenAddress,
to,
amount,
data,
{
useNonceSequence: true,
}
);

await fuseSDK.transferToken(
tokenAddress,
to,
amount,
data,
{
useNonceSequence: true,
customNonceKey: 231,
}
);