import { UnsignedTransaction } from "@ethersproject/transactions"; import { StdFee } from "@keplr-wallet/types"; import { Any } from "@keplr-wallet/proto-types/google/protobuf/any"; import { Msg } from "@keplr-wallet/types"; import { SwapV2HistoryData } from "../recent-send-history"; export { SwapProvider, SwapV2HistoryData, IBCSwapMinimalTrackingData, } from "../recent-send-history"; export declare enum BackgroundTxStatus { PENDING = "pending", CONFIRMED = "confirmed", FAILED = "failed", BLOCKED = "blocked" } export declare enum BackgroundTxType { EVM = "evm", COSMOS = "cosmos" } interface BackgroundTxBase { readonly chainId: string; status: BackgroundTxStatus; feeType?: BackgroundTxFeeType; feeCurrencyDenom?: string; signedTx?: string; txHash?: string; error?: string; } export type EVMBackgroundTxFeeType = BackgroundTxFeeType | "custom"; interface EVMBackgroundTxBase extends Omit { feeType?: EVMBackgroundTxFeeType; } export interface EVMBackgroundTx extends EVMBackgroundTxBase { readonly type: BackgroundTxType.EVM; txData: UnsignedTransaction; customPriorityFee?: string; customGasPrice?: string; } export interface CosmosBackgroundTx extends BackgroundTxBase { readonly type: BackgroundTxType.COSMOS; txData: { aminoMsgs?: Msg[]; protoMsgs: Any[]; rlpTypes?: Record>; fee?: StdFee; memo?: string; }; } export type BackgroundTx = EVMBackgroundTx | CosmosBackgroundTx; export declare enum TxExecutionStatus { PENDING = "pending", PROCESSING = "processing", BLOCKED = "blocked", COMPLETED = "completed", FAILED = "failed" } export declare enum TxExecutionType { UNDEFINED = "undefined", SWAP_V2 = "swap-v2" } export type BackgroundTxFeeType = "low" | "average" | "high"; export interface TxExecutionBase { readonly id: string; status: TxExecutionStatus; readonly vaultId: string; readonly txs: BackgroundTx[]; txIndex: number; executableChainIds: string[]; readonly timestamp: number; readonly preventAutoSign: boolean; readonly historyTxIndex?: number; } export interface UndefinedTxExecution extends TxExecutionBase { readonly type: TxExecutionType.UNDEFINED; historyData?: never; } export interface SwapV2TxExecution extends TxExecutionBase { readonly type: TxExecutionType.SWAP_V2; historyData?: SwapV2HistoryData; historyId?: string; } export type ExecutionTypeToHistoryData = { [TxExecutionType.SWAP_V2]: SwapV2HistoryData; [TxExecutionType.UNDEFINED]: undefined; }; export type TxExecution = UndefinedTxExecution | SwapV2TxExecution; export type TxExecutionEvent = { type: "executable"; executionId: string; executableChainIds: string[]; } | { type: "remove"; executionId: string; }; /** * Result of executing a single pending transaction. * Used to batch state updates and reduce autorun triggers. */ export interface PendingTxExecutionResult { status: BackgroundTxStatus; txHash?: string; error?: string; } /** * Result of executing a single transaction. * Used to batch state updates and reduce autorun triggers. */ export interface TxExecutionResult { status: TxExecutionStatus; error?: string; }