AccountSequenceManager

class AccountSequenceManager(val accountAddress: AccountAddress, fetchSequenceNumber: suspend (AccountAddress) -> AptosResult<ULong>)

Concurrency-safe reservation of a sender's Aptos sequence numbers.

Constructors

Link copied to clipboard
constructor(accountAddress: AccountAddress, fetchSequenceNumber: suspend (AccountAddress) -> AptosResult<ULong>)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
suspend fun invalidate()

Forces the next reservation to fetch chain state again.

Link copied to clipboard
suspend fun peek(): ULong?

Returns the next locally available number, or null before initialization.

Link copied to clipboard
suspend fun reserve(): AptosResult<ULong>

Reserves one sequence number, fetching chain state on the first reservation.

Link copied to clipboard

Replaces local state with the current on-chain sequence number.