import type { NetworkClientId, NetworkController, NetworkClient, BlockTracker, Provider, NetworkControllerStateChangeEvent } from '@metamask/network-controller'; import type { NonceLock, NonceTracker } from '@metamask/nonce-tracker'; import type { Hex } from '@metamask/utils'; import type { PendingTransactionTracker } from './PendingTransactionTracker.js'; export type MultichainTrackingHelperOptions = { findNetworkClientIdByChainId: NetworkController['findNetworkClientIdByChainId']; getNetworkClientById: NetworkController['getNetworkClientById']; getNetworkClientRegistry: NetworkController['getNetworkClientRegistry']; removePendingTransactionTrackerListeners: (pendingTransactionTracker: PendingTransactionTracker) => void; createNonceTracker: (opts: { provider: Provider; blockTracker: BlockTracker; chainId: Hex; }) => NonceTracker; createPendingTransactionTracker: (opts: { blockTracker: BlockTracker; networkClientId: NetworkClientId; }) => PendingTransactionTracker; onNetworkStateChange: (listener: (...payload: NetworkControllerStateChangeEvent['payload']) => void) => void; onInitialized: () => void; }; export declare class MultichainTrackingHelper { #private; constructor({ findNetworkClientIdByChainId, getNetworkClientById, getNetworkClientRegistry, removePendingTransactionTrackerListeners, createNonceTracker, createPendingTransactionTracker, onNetworkStateChange, onInitialized, }: MultichainTrackingHelperOptions); has(networkClientId: NetworkClientId): boolean; /** * Gets the mutex intended to guard the nonceTracker for a particular chainId and key . * * @param opts - The options object. * @param opts.chainId - The hex chainId. * @param opts.key - The hex address (or constant) pertaining to the chainId * @returns Mutex instance for the given chainId and key pair */ acquireNonceLockForChainIdKey({ chainId, key, }: { chainId: Hex; key?: string; }): Promise<() => void>; /** * Gets the next nonce according to the nonce-tracker. * Ensure `releaseLock` is called once processing of the `nonce` value is complete. * * @param address - The hex string address for the transaction. * @param networkClientId - The network client ID for the transaction, used to fetch the correct nonce tracker. * @returns object with the `nextNonce` `nonceDetails`, and the releaseLock. */ getNonceLock(address: string, networkClientId: NetworkClientId): Promise; checkForPendingTransactionAndStartPolling: () => void; stopAllTracking(): void; getNetworkClient({ chainId, networkClientId: requestNetworkClientId, }: { chainId?: Hex; networkClientId?: NetworkClientId; }): NetworkClient & { id: NetworkClientId; }; } //# sourceMappingURL=MultichainTrackingHelper.d.ts.map