import type { Hex } from '@metamask/utils'; import type { Transaction as NonceTrackerTransaction } from 'nonce-tracker/dist/NonceTracker'; import type { GasPriceValue, FeeMarketEIP1559Values } from './TransactionController'; import type { Transaction, TransactionMeta, TransactionStatus } from './types'; export declare const ESTIMATE_GAS_ERROR = "eth_estimateGas rpc method error"; /** * Normalizes properties on a Transaction object. * * @param transaction - Transaction object to normalize. * @returns Normalized Transaction object. */ export declare function normalizeTransaction(transaction: Transaction): Transaction; /** * Validates a Transaction object for required properties and throws in * the event of any validation error. * * @param transaction - Transaction object to validate. */ export declare function validateTransaction(transaction: Transaction): void; /** * Checks if a transaction is EIP-1559 by checking for the existence of * maxFeePerGas and maxPriorityFeePerGas within its parameters. * * @param transaction - Transaction object to add. * @returns Boolean that is true if the transaction is EIP-1559 (has maxFeePerGas and maxPriorityFeePerGas), otherwise returns false. */ export declare const isEIP1559Transaction: (transaction: Transaction) => boolean; export declare const validateGasValues: (gasValues: GasPriceValue | FeeMarketEIP1559Values) => void; export declare const isFeeMarketEIP1559Values: (gasValues?: GasPriceValue | FeeMarketEIP1559Values | undefined) => gasValues is FeeMarketEIP1559Values; export declare const isGasPriceValue: (gasValues?: GasPriceValue | FeeMarketEIP1559Values | undefined) => gasValues is GasPriceValue; export declare const getIncreasedPriceHex: (value: number, rate: number) => string; export declare const getIncreasedPriceFromExisting: (value: string | undefined, rate: number) => string; /** * Validates that the proposed value is greater than or equal to the minimum value. * * @param proposed - The proposed value. * @param min - The minimum value. * @returns The proposed value. * @throws Will throw if the proposed value is too low. */ export declare function validateMinimumIncrease(proposed: string, min: string): string; /** * Helper function to filter and format transactions for the nonce tracker. * * @param fromAddress - Address of the account from which the transactions to filter from are sent. * @param transactionStatus - Status of the transactions for which to filter. * @param transactions - Array of transactionMeta objects that have been prefiltered. * @returns Array of transactions formatted for the nonce tracker. */ export declare function getAndFormatTransactionsForNonceTracker(fromAddress: string, transactionStatus: TransactionStatus, transactions: TransactionMeta[]): NonceTrackerTransaction[]; /** * Checks whether a given transaction matches the specified network or chain ID. * This function is used to determine if a transaction is relevant to the current network or chain. * * @param transaction - The transaction metadata to check. * @param chainId - The chain ID of the current network. * @param networkId - The network ID of the current network. * @returns A boolean value indicating whether the transaction matches the current network or chain ID. */ export declare function transactionMatchesNetwork(transaction: TransactionMeta, chainId: Hex, networkId: string | null): boolean; //# sourceMappingURL=utils.d.ts.map