import type { Abi, ContractFunctionArgs, ContractFunctionName, GetValue, Hex } from 'viem'; import type { TypedResponse } from './response.js'; import type { UnionWiden, Widen } from './utils.js'; export type ChainNamespace = 'eip155'; /** * Current supported chain IDs: * - 10: Optimism * - 8453: Base * - 7777777: Zora */ export type ChainIdEip155 = 10 | 8453 | 7777777; export type TransactionParameters = { /** A CAIP-2 Chain ID to identify the transaction network. */ chainId: `${ChainNamespace}:${ChainIdEip155}`; } & EthSendTransactionSchema; export type TransactionResponse = Pick & EthSendTransactionSchema; export type EthSendTransactionSchema = { /** A method ID to identify the type of transaction request. */ method: 'eth_sendTransaction'; /** Transaction calldata. */ params: EthSendTransactionParameters; }; export type EthSendTransactionParameters = { /** Contract ABI. */ abi?: Abi | undefined; /** Transaction calldata. */ data?: Hex | undefined; /** Transaction target address. */ to: Hex; /** Value to send with transaction (in wei). */ value?: quantity; }; export type TransactionResponseFn = (parameters: parameters) => TypedResponse; export type SendTransactionParameters = Pick & EthSendTransactionParameters; export type ContractTransactionParameters = ContractFunctionName, args extends ContractFunctionArgs = ContractFunctionArgs, allFunctionNames = ContractFunctionName, allArgs = ContractFunctionArgs> = Pick & { /** Contract ABI. */ abi: abi; /** Contract function arguments. */ args?: (abi extends Abi ? UnionWiden : never) | allArgs | undefined; /** Contract function name to invoke. */ functionName: allFunctionNames | (functionName extends allFunctionNames ? functionName : never); } & (readonly [] extends allArgs ? {} : { args: Widen; }) & GetValue; export type ContractTransactionResponseFn = , args extends ContractFunctionArgs>(response: ContractTransactionParameters) => TypedResponse; //# sourceMappingURL=transaction.d.ts.map