import type { Hex } from '@metamask/utils'; import { TransactionType } from '../types.js'; import type { TransactionBatchRequest, TransactionParams } from '../types.js'; export declare enum ErrorCode { DuplicateBundleId = 5720, BundleTooLarge = 5740, RejectedUpgrade = 5750 } /** * Validates whether a transaction initiated by a specific 'from' address is permitted by the origin. * * @param options - Options bag. * @param options.data - The data included in the transaction. * @param options.from - The address from which the transaction is initiated. * @param options.internalAccounts - The internal accounts added to the wallet. * @param options.isInternal - Whether the transaction was added by trusted internal MetaMask code. * @param options.origin - The origin or source of the transaction. * @param options.permittedAddresses - The permitted accounts for the given origin. * @param options.selectedAddress - The currently selected Ethereum address in the wallet. * @param options.txParams - The transaction parameters. * @param options.type - The transaction type. * @throws Throws an error if the transaction is not permitted. */ export declare function validateTransactionOrigin({ data, from, internalAccounts, isInternal, origin, permittedAddresses, txParams, type, }: { data?: string; from: string; internalAccounts?: string[]; isInternal?: boolean; origin?: string; permittedAddresses?: string[]; selectedAddress?: string; txParams: TransactionParams; type?: TransactionType; }): Promise; /** * Validates the transaction params for required properties and throws in * the event of any validation error. * * @param txParams - Transaction params object to validate. * @param isEIP1559Compatible - whether or not the current network supports EIP-1559 transactions. * @param chainId - The chain ID of the transaction. */ export declare function validateTxParams(txParams: TransactionParams, isEIP1559Compatible?: boolean, chainId?: Hex): void; /** * Validates the recipient address in a transaction's parameters. * * @param to - The to property to validate. * @throws Throws an error if the recipient address is invalid. */ export declare function validateParamTo(to?: string): void; /** * Validates a transaction batch request. * * @param options - Options bag. * @param options.internalAccounts - The internal accounts added to the wallet. * @param options.isInternal - Whether the batch was added by trusted internal MetaMask code. * @param options.request - The batch request object. * @param options.sizeLimit - The maximum number of calls allowed in a batch request. */ export declare function validateBatchRequest({ internalAccounts, isInternal, request, sizeLimit, }: { internalAccounts: string[]; isInternal?: boolean; request: TransactionBatchRequest; sizeLimit: number; }): void; //# sourceMappingURL=validation.d.ts.map