/** * Manages nonces for concurrent transactions. * * Prevents nonce collisions when sending multiple transactions in parallel * by caching nonces in memory and incrementing them locally. * * @internal Used by {@link TransactionBuilder}; not typically needed directly. */ export declare class NonceManager { private nonces; private fetching; /** * Get the next nonce for an account and public key * * Fetches from blockchain on first call, then increments locally. * Handles concurrent calls gracefully by deduplicating fetches. * * @param accountId - Account ID to get nonce for * @param publicKey - Public key to get nonce for * @param fetchFromBlockchain - Callback to fetch current nonce from blockchain * @returns Next nonce to use for transaction */ getNextNonce(accountId: string, publicKey: string, fetchFromBlockchain: () => Promise): Promise; /** * Invalidate cached nonce for an account and public key * * Call this when an InvalidNonceError occurs to force a fresh fetch * from the blockchain on the next transaction. * * @param accountId - Account ID to invalidate * @param publicKey - Public key to invalidate */ invalidate(accountId: string, publicKey: string): void; /** * Update the cached nonce to a known value and return the next nonce to use. * * Use this when you receive an InvalidNonce error with `akNonce` - * instead of invalidating and refetching, directly set the nonce * to avoid thundering herd on retry. * * @param accountId - Account ID * @param publicKey - Public key string (e.g., "ed25519:...") * @param currentNonce - The current nonce on chain (akNonce from error) * @returns The next nonce to use (currentNonce + 1, or higher if cache is ahead) */ updateAndGetNext(accountId: string, publicKey: string, currentNonce: bigint): bigint; /** * Clear all cached nonces */ clear(): void; } //# sourceMappingURL=nonce-manager.d.ts.map