import { KVStore } from "@keplr-wallet/common"; import { ChainsService } from "../chains"; import { KeyRingCosmosService } from "../keyring-cosmos"; import { KeyRingEthereumService } from "../keyring-ethereum"; import { AnalyticsService } from "../analytics"; import { RecentSendHistoryService } from "../recent-send-history"; import { BackgroundTxService } from "../tx"; import { BackgroundTxEthereumService } from "../tx-ethereum"; import { Env } from "@keplr-wallet/router"; import { TxExecution, TxExecutionType, BackgroundTx, BackgroundTxStatus, ExecutionTypeToHistoryData, TxExecutionResult, PendingTxExecutionResult, IBCSwapMinimalTrackingData } from "./types"; import { EventBusSubscriber } from "@keplr-wallet/common"; import { TxExecutionEvent } from "./types"; export declare class BackgroundTxExecutorService { protected readonly kvStore: KVStore; protected readonly chainsService: ChainsService; protected readonly keyRingCosmosService: KeyRingCosmosService; protected readonly keyRingEthereumService: KeyRingEthereumService; protected readonly backgroundTxService: BackgroundTxService; protected readonly backgroundTxEthereumService: BackgroundTxEthereumService; protected readonly analyticsService: AnalyticsService; protected readonly recentSendHistoryService: RecentSendHistoryService; protected readonly subscriber: EventBusSubscriber; protected recentTxExecutionSeq: number; protected readonly recentTxExecutionMap: Map; constructor(kvStore: KVStore, chainsService: ChainsService, keyRingCosmosService: KeyRingCosmosService, keyRingEthereumService: KeyRingEthereumService, backgroundTxService: BackgroundTxService, backgroundTxEthereumService: BackgroundTxEthereumService, analyticsService: AnalyticsService, recentSendHistoryService: RecentSendHistoryService, subscriber: EventBusSubscriber); init(): Promise; protected handleTxExecutionEvent(event: TxExecutionEvent): void; recordAndExecuteTxs(env: Env, vaultId: string, type: T, txs: (BackgroundTx & { status: BackgroundTxStatus.PENDING | BackgroundTxStatus.CONFIRMED; })[], executableChainIds: string[], historyData?: T extends TxExecutionType.UNDEFINED ? undefined : ExecutionTypeToHistoryData[T], historyTxIndex?: number): Promise; /** * Execute blocked transactions by execution id and transaction index */ resumeTx(env: Env, id: string, txIndex: number, signedTx: string, ibcSwapData?: IBCSwapMinimalTrackingData): Promise; protected executeTxs(id: string, options?: { txIndex?: number; signedTx?: string; ibcSwapData?: IBCSwapMinimalTrackingData; }): Promise; /** * Execute a pending transaction without modifying observable state. * Returns the result which should be applied by the caller using runInAction. * This reduces autorun trigger count by batching state updates. */ protected executePendingTx(vaultId: string, tx: BackgroundTx, executableChainIds: string[], preventAutoSign: boolean, providedSignedTx?: string): Promise; protected signTx(vaultId: string, tx: BackgroundTx): Promise; private signEvmTx; private signCosmosTx; protected broadcastTx(tx: BackgroundTx): Promise; private broadcastEvmTx; private broadcastCosmosTx; protected traceTx(tx: BackgroundTx): Promise; private traceEvmTx; private traceCosmosTx; private queryTxByRestFallback; /** * Find the index of the most recent confirmed transaction with executable chain ids. * Returns -1 if not found. */ private findHistoryTxIndex; protected recordHistoryIfNeeded(execution: TxExecution): void; getRecentTxExecutions(): TxExecution[]; getTxExecution(id: string): TxExecution | undefined; protected removeTxExecution(id: string): void; protected cleanupOldExecutions(): void; private recordSwapV2HistoryErrorIfNeeded; private clearSwapV2HistoryBackgroundExecutionIdIfNeeded; }