import { BigNumber, ethers, Transaction } from 'ethers'; import { BridgeNetworkConfig } from './networks'; import { TransactionReceipt, TransactionResponse } from '@ethersproject/abstract-provider/src.ts'; import { Provider } from '@ethersproject/abstract-provider'; import { ChildTransactionReceipt, EthDepositMessageStatus, ParentToChildMessageStatus } from '@arbitrum/sdk'; export type SignerOrProviderOrRpc = ethers.Signer | ethers.providers.Provider | string; export interface BridgeReceipt { description: string; receipt: TransactionReceipt; } export interface BridgeTransferParams { txHash: string; destinationNetworkChainId: number; originNetworkChainId: number; originSignerOrProviderOrRpc?: SignerOrProviderOrRpc; destinationSignerOrProviderOrRpc?: SignerOrProviderOrRpc; } export interface BridgeTransferInfo { txHash: string; transferType: BridgeTransferType; timestamp?: number; to?: string; amount?: BigNumber; tokenDestinationAddress?: string; tokenOriginAddress?: string; tokenSymbol?: string; isDeposit: boolean; originNetworkChainId: number; destinationNetworkChainId: number; originName: string; destinationName: string; initTxExplorerUrl: string; } export declare enum BridgeTransferType { WITHDRAW_ERC20 = 0, WITHDRAW_GAS = 1, DEPOSIT_ERC20 = 2, DEPOSIT_GAS = 3, DEPOSIT_ERC20_TO_GAS = 4, DEPOSIT_CCTP = 5, WITHDRAW_CCTP = 6 } export declare enum BridgeTransferStatus { WITHDRAW_UNCONFIRMED = 0, WITHDRAW_CONFIRMED = 1, WITHDRAW_EXECUTED = 2, DEPOSIT_ERC20_NOT_YET_CREATED = 3, DEPOSIT_ERC20_CREATION_FAILED = 4, DEPOSIT_ERC20_FUNDS_DEPOSITED_ON_CHILD = 5, DEPOSIT_ERC20_REDEEMED = 6, DEPOSIT_ERC20_EXPIRED = 7, DEPOSIT_GAS_PENDING = 8, DEPOSIT_GAS_DEPOSITED = 9, CCTP_PENDING = 10, CCTP_COMPLETE = 11, CCTP_REDEEMED = 12 } export declare class BridgeTransfer { readonly originNetworkChainId: number; readonly destinationNetworkChainId: number; readonly txHash: string; readonly isDeposit: boolean; readonly receipts: BridgeReceipt[]; readonly isCompleted: boolean; readonly tokenSymbol: string; readonly originName: string; readonly destinationName: string; readonly value: BigNumber; readonly explorerLink: string; protected childTransactionReceipt: ChildTransactionReceipt | undefined; protected readonly originProvider: Provider; protected readonly destinationProvider: Provider; protected readonly destinationNetwork: BridgeNetworkConfig; /** * Constructs a new instance of the BridgeTransfer class. * * @param {Object} params - The parameters for the constructor. * @param {string} params.txHash - The transaction hash for the bridge transfer. * @param {number} params.destinationNetworkChainId - The chain ID of the destination network. * @param {number} params.originNetworkChainId - The chain ID of the origin network. * @param {SignerOrProviderOrRpc} [params.originSignerOrProviderOrRpc] - Optional signer, provider, or RPC string for the origin network. * @param {SignerOrProviderOrRpc} [params.destinationSignerOrProviderOrRpc] - Optional signer, provider, or RPC string for the destination network. * * @throws {UnsupportedNetworkError} If the origin or destination network is unsupported. * * @property {number} originNetworkChainId - The chain ID of the origin network. * @property {number} destinationNetworkChainId - The chain ID of the destination network. * @property {string} txHash - The transaction hash being tracked for the bridge transfer. * @property {boolean} isDeposit - Determines whether this transfer is a deposit (from parent to child chain). * @property {Provider} originProvider - The provider for the origin network. * @property {Provider} destinationProvider - The provider for the destination network. * @property {string} originName - The name of the origin network. * @property {string} destinationName - The name of the destination network. * @property {string} explorerLink - A URL to the transaction explorer for the origin network. * @property {BridgeNetworkConfig} destinationNetwork - Configuration object for the destination network. */ constructor({ txHash, destinationNetworkChainId, originNetworkChainId, originSignerOrProviderOrRpc, destinationSignerOrProviderOrRpc, }: BridgeTransferParams); getStatus(): Promise<{ messageStatus: EthDepositMessageStatus; ETA: number | undefined; childTxReceipt: any; status: BridgeTransferStatus; completionTxHash: any; completionExplorerLink: string; } | { messageStatus: ParentToChildMessageStatus; ETA: number | undefined; childTxReceipt: any; status: BridgeTransferStatus; completionTxHash: any; completionExplorerLink: string; } | { ETA: number | undefined; status: BridgeTransferStatus; }>; getTransferTypeAndInputs(tx: Transaction): { transferType: BridgeTransferType; decodedInputs: ethers.utils.TransactionDescription; }; getInfo(_tx?: TransactionResponse): Promise; getTransactionInputs(): Promise<{ txDateTime: Date; to: any; amount: any; tokenAddress: any; tokenSymbol: string | undefined; amountFormatted: string; }>; execute(signer: ethers.Signer): Promise; getDepositStatus(): Promise<{ messageStatus: EthDepositMessageStatus; ETA: number | undefined; childTxReceipt: any; status: BridgeTransferStatus; completionTxHash: any; completionExplorerLink: string; } | { status: BridgeTransferStatus; ETA: number | undefined; messageStatus?: undefined; childTxReceipt?: undefined; completionTxHash?: undefined; completionExplorerLink?: undefined; } | { messageStatus: ParentToChildMessageStatus; ETA: number | undefined; childTxReceipt: any; status: BridgeTransferStatus; completionTxHash: any; completionExplorerLink: string; }>; isCctp(): boolean; }