import type { Hex } from '@metamask/utils'; /** * @type TransactionMeta * * TransactionMeta representation * @property baseFeePerGas - Base fee of the block as a hex value, introduced in EIP-1559. * @property error - Synthesized error information for failed transactions. * @property id - Generated UUID associated with this transaction. * @property networkID - Network code as per EIP-155 for this transaction. * @property origin - Origin this transaction was sent from. * @property deviceConfirmedOn - string to indicate what device the transaction was confirmed. * @property rawTransaction - Hex representation of the underlying transaction. * @property status - String status of this transaction. * @property time - Timestamp associated with this transaction. * @property toSmartContract - Whether transaction recipient is a smart contract. * @property transaction - Underlying Transaction object. * @property txReceipt - Transaction receipt. * @property transactionHash - Hash of a successful transaction. * @property blockNumber - Number of the block where the transaction has been included. */ export declare type TransactionMeta = ({ status: Exclude; } & TransactionMetaBase) | ({ status: TransactionStatus.failed; error: Error; } & TransactionMetaBase); declare type TransactionMetaBase = { baseFeePerGas?: Hex; blockNumber?: string; chainId?: Hex; deviceConfirmedOn?: WalletDevice; id: string; isTransfer?: boolean; networkID?: string; origin?: string; rawTransaction?: string; time: number; toSmartContract?: boolean; transaction: Transaction; transactionHash?: string; transferInformation?: { contractAddress: string; decimals: number; symbol: string; }; verifiedOnBlockchain?: boolean; txReceipt?: TransactionReceipt; }; /** * The status of the transaction. Each status represents the state of the transaction internally * in the wallet. Some of these correspond with the state of the transaction on the network, but * some are wallet-specific. */ export declare enum TransactionStatus { approved = "approved", cancelled = "cancelled", confirmed = "confirmed", failed = "failed", rejected = "rejected", signed = "signed", submitted = "submitted", unapproved = "unapproved" } /** * Options for wallet device. */ export declare enum WalletDevice { MM_MOBILE = "metamask_mobile", MM_EXTENSION = "metamask_extension", OTHER = "other_device" } /** * @type Transaction * * Transaction representation * @property chainId - Network ID as per EIP-155 * @property data - Data to pass with this transaction * @property from - Address to send this transaction from * @property gas - Gas to send with this transaction * @property gasPrice - Price of gas with this transaction * @property gasUsed - Gas used in the transaction * @property nonce - Unique number to prevent replay attacks * @property to - Address to send this transaction to * @property value - Value associated with this transaction */ export interface Transaction { chainId?: Hex; data?: string; from: string; gas?: string; gasPrice?: string; gasUsed?: string; nonce?: string; to?: string; value?: string; maxFeePerGas?: string; maxPriorityFeePerGas?: string; estimatedBaseFee?: string; estimateGasError?: string; } /** * Standard data concerning a transaction processed by the blockchain. */ export interface TransactionReceipt { /** * The block hash of the block that this transaction was included in. */ blockHash?: string; /** * The block number of the block that this transaction was included in. */ blockNumber?: string; /** * Effective gas price the transaction was charged at. */ effectiveGasPrice?: string; /** * Gas used in the transaction. */ gasUsed?: string; /** * Total used gas in hex. */ l1Fee?: string; /** * All the logs emitted by this transaction. */ logs?: Log[]; /** * The status of the transaction. */ status?: string; /** * The index of this transaction in the list of transactions included in the block this transaction was mined in. */ transactionIndex?: number; } /** * Represents an event that has been included in a transaction using the EVM `LOG` opcode. */ export interface Log { /** * Address of the contract that generated log. */ address?: string; /** * List of topics for log. */ topics?: string; } /** * The configuration required to fetch transaction data from a RemoteTransactionSource. */ export interface RemoteTransactionSourceRequest { /** * The address of the account to fetch transactions for. */ address: string; /** * API key if required by the remote source. */ apiKey?: string; /** * The chainId of the current network. */ currentChainId: Hex; /** * The networkId of the current network. */ currentNetworkId: string; /** * Block number to start fetching transactions from. */ fromBlock?: number; /** * Maximum number of transactions to retrieve. */ limit?: number; } /** * An object capable of fetching transaction data from a remote source. * Used by the IncomingTransactionHelper to retrieve remote transaction data. */ export interface RemoteTransactionSource { isSupportedNetwork: (chainId: Hex, networkId: string) => boolean; fetchTransactions: (request: RemoteTransactionSourceRequest) => Promise; } export {}; //# sourceMappingURL=types.d.ts.map