Lock a previously-reserved nonce
This method is invoked differently, depending on how reservation was done:
// An ID was provided during reservation
lock({ reservedFor: "<ID>" });
// Otherwise, lock by address and supply the ID now
lock({ address, lockedBy: "<ID>" })
ID
OptionallockedBy?: stringID
ID
Locked nonces must be released.
Ideally this should be invoked in a finally logic to ensure it
is executed regardless of errors.
ID
Reserve a nonce for later locking.
If it is not locked in the reservation period, it is released back into the pool.
Remember to sign the transaction that includes this nonce, with the nonce authority via sign
OptionalexpiresAt?: DateHow long the reservation is valid for. Default: 5 minutes
The ID of what will be using the nonce, or alternatively
<domain>[.<domain model>][.<purpose>], e.g. SWAP, or
DEPOSIT.US_CASH.MINT
The latter is informational only and won't be used in code logic.
Convinience method to lock a nonce, without prior reservation
A pool of Solana nonce accounts, used for durable transactions
A nonce is reserved for a period of time. During this time, it can be locked for usage and will remain locked indefinitely until released. If a nonce is not locked within the reservation period, it return to the pool.
This service can be used in two ways:
a) We know who will be locking the nonce at reservation time:
b) We do not know the ID of locker upfront:
In this scenario, you have to carry forward the nonce address in code so it can be supplied to
lock().ATTENTION: If you are using this service in an application, please ensure
fillSolanaNoncePoolWorkflowis added to the same worker where the durable transaction will be executed