Sigil documentation
ReferenceRust referencesigil-wallet

sigil-wallet · nonce

Source declarations, signatures and documentation for nonce.

Source: sigil/node/sigil-wallet/src/nonce.rs. SHA-256: e9112dd2c1276a59f44954858361abeff90e07d1a19279eeb02d8dc3a551ce7d.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

nonce::NonceManager

Manages per-account transaction nonces.

Queries a Sigil node's sigil_getAccountNonce RPC method for the on-chain nonce, then tracks increments locally so that multiple transactions can be built in a single session without round-tripping to the node for every one.

#[derive(Debug)]
pub struct NonceManager {

}

Source line: 19.

nonce::NonceManager::new

Create a new nonce manager targeting the given RPC endpoint.

pub fn new(rpc_url: &str) -> Self;

Source line: 28.

nonce::NonceManager::next_nonce

Return the next nonce for did, querying the node if not cached.

After a successful call the internal cache is incremented, so the next call for the same DID will return nonce + 1 without a network round-trip.

pub async fn next_nonce(&mut self, did: &str) -> WalletResult<u64>;

Source line: 40.

nonce::NonceManager::invalidate

Remove a DID from the local cache.

Call this after a transaction fails or is rejected so that the next call to [next_nonce] will re-query the node for the authoritative nonce value.

pub fn invalidate(&mut self, did: &str);

Source line: 57.

On this page