import type { AccountsControllerAccountAddedEvent, AccountsControllerAccountRemovedEvent, AccountsControllerListMultichainAccountsAction } from "@metamask/accounts-controller"; import { BaseController, type ControllerGetStateAction, type ControllerStateChangeEvent, type RestrictedControllerMessenger } from "@metamask/base-controller"; import { type Transaction } from "@metamask/keyring-api"; import type { HandleSnapRequest } from "@metamask/snaps-controllers"; declare const controllerName = "MultichainTransactionsController"; /** * PaginationOptions * * Represents options for paginating transaction results * limit - The maximum number of transactions to return * next - The cursor for the next page of transactions, or null if there is no next page */ export type PaginationOptions = { limit: number; next?: string | null; }; /** * State used by the {@link MultichainTransactionsController} to cache account transactions. */ export type MultichainTransactionsControllerState = { nonEvmTransactions: { [accountId: string]: TransactionStateEntry; }; }; /** * Constructs the default {@link MultichainTransactionsController} state. * * @returns The default {@link MultichainTransactionsController} state. */ export declare function getDefaultMultichainTransactionsControllerState(): MultichainTransactionsControllerState; /** * Returns the state of the {@link MultichainTransactionsController}. */ export type MultichainTransactionsControllerGetStateAction = ControllerGetStateAction; /** * Updates the transactions of all supported accounts. */ export type MultichainTransactionsControllerListTransactionsAction = { type: `${typeof controllerName}:updateTransactions`; handler: MultichainTransactionsController['updateTransactions']; }; /** * Event emitted when the state of the {@link MultichainTransactionsController} changes. */ export type MultichainTransactionsControllerStateChange = ControllerStateChangeEvent; /** * Actions exposed by the {@link MultichainTransactionsController}. */ export type MultichainTransactionsControllerActions = MultichainTransactionsControllerGetStateAction | MultichainTransactionsControllerListTransactionsAction; /** * Events emitted by {@link MultichainTransactionsController}. */ export type MultichainTransactionsControllerEvents = MultichainTransactionsControllerStateChange; /** * Messenger type for the MultichainTransactionsController. */ export type MultichainTransactionsControllerMessenger = RestrictedControllerMessenger; /** * Actions that this controller is allowed to call. */ export type AllowedActions = HandleSnapRequest | AccountsControllerListMultichainAccountsAction; /** * Events that this controller is allowed to subscribe. */ export type AllowedEvents = AccountsControllerAccountAddedEvent | AccountsControllerAccountRemovedEvent; /** * The state of transactions for a specific account. */ export type TransactionStateEntry = { transactions: Transaction[]; next: string | null; lastUpdated: number; }; /** * The MultichainTransactionsController is responsible for fetching and caching account * transactions for non-EVM accounts. */ export declare class MultichainTransactionsController extends BaseController { #private; constructor({ messenger, state, }: { messenger: MultichainTransactionsControllerMessenger; state?: Partial; }); /** * Updates transactions for a specific account * * @param accountId - The ID of the account to get transactions for. */ updateTransactionsForAccount(accountId: string): Promise; /** * Updates the transactions of all supported accounts. This method doesn't return * anything, but it updates the state of the controller. */ updateTransactions(): Promise; /** * Starts the polling process. */ start(): void; /** * Stops the polling process. */ stop(): void; } export {}; //# sourceMappingURL=MultichainTransactionsController.d.mts.map