UNPKG

@settlemint/sdk-viem

Version:

Viem (TypeScript Interface for Ethereum) module for SettleMint SDK

1,043 lines (1,042 loc) • 210 kB
/* SettleMint Viem SDK - Web3 Optimized */ import * as viem0 from "viem"; import { Chain, Client, Hex, HttpTransportConfig } from "viem"; import { z } from "zod"; //#region src/custom-actions/anvil/anvil-set-balance.d.ts /** * Parameters for setting the balance of a wallet. */ type AnvilSetBalanceParameters = [wallet: string, balance: Hex]; /** * Set the balance of a wallet in the Anvil test environment. * @param client - The viem client to use for the request. * @returns An object with a anvilSetBalance method. */ declare function anvilSetBalance(client: Client): { /** * Sets the balance of a wallet. * @param args - The parameters for setting the balance. * @returns A promise that resolves to the result of the balance setting operation. */ anvilSetBalance(args: AnvilSetBalanceParameters): Promise<unknown>; }; //#endregion //#region src/custom-actions/eth-sign.action.d.ts /** * Parameters for signing data with a wallet. */ interface EthSignParameters { /** The wallet address to sign the data with. */ userWalletAddress: string; /** The data to sign. */ data: string; } /** * Creates a wallet action for the given client. * @param client - The viem client to use for the request. * @returns An object with a createWallet method. */ declare function ethSign(client: Client): { /** * Signs data with a wallet. * @param args - The parameters for signing data with a wallet. * @returns A promise that resolves to signed data response. */ ethSign(args: EthSignParameters): Promise<string>; }; //#endregion //#region src/custom-actions/verify-wallet-verification-challenge.action.d.ts /** * Represents either a wallet address string or an object containing wallet address and optional verification ID. */ type AddressOrObject<Extra = {}> = string | ({ userWalletAddress: string; verificationId?: string; } & Extra); /** * Represents either a wallet address string, an object containing wallet address and optional verification ID or a challenge ID. */ type AddressOrObjectWithChallengeId = AddressOrObject | { /** ID of the challenge to verify against */ challengeId: string; }; /** * Parameters for verifying a wallet verification challenge. */ interface VerifyWalletVerificationChallengeParameters { /** The wallet address or object containing wallet address and optional verification ID. */ addressOrObject: AddressOrObjectWithChallengeId; /** The response to the verification challenge. */ challengeResponse: string; } /** * Result of a wallet verification challenge. */ interface VerificationResult { /** Whether the verification was successful. */ verified: boolean; } /** * Response from verifying a wallet verification challenge. */ type VerifyWalletVerificationChallengeResponse = VerificationResult[]; /** * Creates a wallet verification challenge verification action for the given client. * @param client - The viem client to use for the request. * @returns An object with a verifyWalletVerificationChallenge method. */ declare function verifyWalletVerificationChallenge(client: Client): { /** * Verifies a wallet verification challenge. * @param args - The parameters for verifying the challenge. * @returns A promise that resolves to an array of verification results. */ verifyWalletVerificationChallenge(args: VerifyWalletVerificationChallengeParameters): Promise<VerifyWalletVerificationChallengeResponse>; }; //#endregion //#region src/custom-actions/types/wallet-verification.enum.d.ts /** * Types of wallet verification methods supported by the system. * Used to identify different verification mechanisms when creating or managing wallet verifications. */ declare enum WalletVerificationType { /** PIN code verification method */ PINCODE = "PINCODE", /** One-Time Password verification method */ OTP = "OTP", /** Secret recovery codes verification method */ SECRET_CODES = "SECRET_CODES", } /** * Supported hash algorithms for One-Time Password (OTP) verification. * These algorithms determine the cryptographic function used to generate OTP codes. */ declare enum OTPAlgorithm { /** SHA-1 hash algorithm */ SHA1 = "SHA1", /** SHA-224 hash algorithm */ SHA224 = "SHA224", /** SHA-256 hash algorithm */ SHA256 = "SHA256", /** SHA-384 hash algorithm */ SHA384 = "SHA384", /** SHA-512 hash algorithm */ SHA512 = "SHA512", /** SHA3-224 hash algorithm */ SHA3_224 = "SHA3-224", /** SHA3-256 hash algorithm */ SHA3_256 = "SHA3-256", /** SHA3-384 hash algorithm */ SHA3_384 = "SHA3-384", /** SHA3-512 hash algorithm */ SHA3_512 = "SHA3-512", } //#endregion //#region src/custom-actions/types/wallet-verification-challenge.d.ts /** * Represents a wallet verification challenge. */ interface WalletVerificationChallenge<ChallengeData> { /** The unique identifier of the challenge. */ id: string; /** The name of the challenge. */ name: string; /** The verification ID. */ verificationId: string; /** The type of verification required. */ verificationType: WalletVerificationType; /** The challenge parameters specific to the verification type. */ challenge: ChallengeData; } //#endregion //#region src/custom-actions/create-wallet-verification-challenges.action.d.ts /** * Parameters for creating wallet verification challenges. */ interface CreateWalletVerificationChallengesParameters { /** The wallet address or object containing wallet address and optional verification ID. */ addressOrObject: AddressOrObject<{ amount?: number; }>; } /** * Response from creating wallet verification challenges. */ type CreateWalletVerificationChallengesResponse = Omit<WalletVerificationChallenge<Record<string, string>>, "verificationId">[]; /** * Creates a wallet verification challenges action for the given client. * @param client - The viem client to use for the request. * @returns An object with a createWalletVerificationChallenges method. */ declare function createWalletVerificationChallenges(client: Client): { /** * Creates verification challenges for a wallet. * @param args - The parameters for creating the challenges. * @returns A promise that resolves to an array of wallet verification challenges. */ createWalletVerificationChallenges(args: CreateWalletVerificationChallengesParameters): Promise<CreateWalletVerificationChallengesResponse>; }; //#endregion //#region src/custom-actions/create-wallet-verification-challenge.action.d.ts /** * Parameters for creating wallet verification challenges. */ interface CreateWalletVerificationChallengeParameters { /** The wallet address. */ userWalletAddress: string; /** The verification ID. */ verificationId: string; } /** * Data specific to a wallet verification challenge. */ interface WalletVerificationChallengeData { /** Optional salt for PINCODE verification type. */ salt?: string; /** Optional secret for PINCODE verification type. */ secret?: string; } /** * Response from creating wallet verification challenge. */ type CreateWalletVerificationChallengeResponse = WalletVerificationChallenge<WalletVerificationChallengeData>; /** * Creates a wallet verification challenge action for the given client. * @param client - The viem client to use for the request. * @returns An object with a createWalletVerificationChallenge method. */ declare function createWalletVerificationChallenge(client: Client): { /** * Creates a verification challenge for a wallet. * @param args - The parameters for creating the challenge. * @returns A promise that resolves to a wallet verification challenge. */ createWalletVerificationChallenge(args: CreateWalletVerificationChallengeParameters): Promise<CreateWalletVerificationChallengeResponse>; }; //#endregion //#region src/custom-actions/delete-wallet-verification.action.d.ts /** * Parameters for deleting a wallet verification. */ interface DeleteWalletVerificationParameters { /** The wallet address for which to delete the verification. */ userWalletAddress: string; /** The unique identifier of the verification to delete. */ verificationId: string; } /** * Response from deleting a wallet verification. */ interface DeleteWalletVerificationResponse { /** Whether the deletion was successful. */ success: boolean; } /** * Creates a wallet verification deletion action for the given client. * @param client - The viem client to use for the request. * @returns An object with a deleteWalletVerification method. */ declare function deleteWalletVerification(client: Client): { /** * Deletes a wallet verification. * @param args - The parameters for deleting the verification. * @returns A promise that resolves to an array of deletion results. */ deleteWalletVerification(args: DeleteWalletVerificationParameters): Promise<DeleteWalletVerificationResponse[]>; }; //#endregion //#region src/custom-actions/create-wallet-verification.action.d.ts /** * Base interface for wallet verification information. */ type BaseWalletVerificationInfo = { /** The name of the verification method. */ name: string; /** The type of verification method. */ verificationType: WalletVerificationType; }; /** * Information for PIN code verification. */ interface WalletPincodeVerificationInfo extends BaseWalletVerificationInfo { /** The type of verification method. */ verificationType: WalletVerificationType.PINCODE; /** The PIN code to use for verification. */ pincode: string; } /** * Information for One-Time Password (OTP) verification. */ interface WalletOTPVerificationInfo extends BaseWalletVerificationInfo { /** The type of verification method. */ verificationType: WalletVerificationType.OTP; /** The hash algorithm to use for OTP generation. */ algorithm?: OTPAlgorithm; /** The number of digits in the OTP code. */ digits?: number; /** The time period in seconds for OTP validity. */ period?: number; /** The issuer of the OTP. */ issuer?: string; } /** * Information for secret recovery codes verification. */ interface WalletSecretCodesVerificationInfo extends BaseWalletVerificationInfo { /** The type of verification method. */ verificationType: WalletVerificationType.SECRET_CODES; } /** * Union type of all possible wallet verification information types. */ type WalletVerificationInfo = WalletPincodeVerificationInfo | WalletOTPVerificationInfo | WalletSecretCodesVerificationInfo; /** * Parameters for creating a wallet verification. */ interface CreateWalletVerificationParameters { /** The wallet address for which to create the verification. */ userWalletAddress: string; /** The verification information to create. */ walletVerificationInfo: WalletVerificationInfo; } /** * Response from creating a wallet verification. */ interface CreateWalletVerificationResponse { /** The unique identifier of the verification. */ id: string; /** The name of the verification method. */ name: string; /** The type of verification method. */ verificationType: WalletVerificationType; /** Additional parameters specific to the verification type. */ parameters: Record<string, string>; } /** * Creates a wallet verification action for the given client. * @param client - The viem client to use for the request. * @returns An object with a createWalletVerification method. */ declare function createWalletVerification(client: Client): { /** * Creates a new wallet verification. * @param args - The parameters for creating the verification. * @returns A promise that resolves to an array of created wallet verification responses. */ createWalletVerification(args: CreateWalletVerificationParameters): Promise<CreateWalletVerificationResponse[]>; }; //#endregion //#region src/custom-actions/get-wallet-verifications.action.d.ts /** * Parameters for getting wallet verifications. */ interface GetWalletVerificationsParameters { /** The wallet address for which to fetch verifications. */ userWalletAddress: string; } /** * Represents a wallet verification. */ interface WalletVerification { /** The unique identifier of the verification. */ id: string; /** The name of the verification method. */ name: string; /** The type of verification method. */ verificationType: WalletVerificationType; } /** * Response from getting wallet verifications. */ type GetWalletVerificationsResponse = WalletVerification[]; /** * Creates a wallet verifications retrieval action for the given client. * @param client - The viem client to use for the request. * @returns An object with a getWalletVerifications method. */ declare function getWalletVerifications(client: Client): { /** * Gets all verifications for a wallet. * @param args - The parameters for getting the verifications. * @returns A promise that resolves to an array of wallet verifications. */ getWalletVerifications(args: GetWalletVerificationsParameters): Promise<GetWalletVerificationsResponse>; }; //#endregion //#region src/custom-actions/create-wallet.action.d.ts /** * Information about the wallet to be created. */ interface WalletInfo { /** The name of the wallet. */ name: string; /** Optional index for the wallet, walletIndex enables HD derivation paths */ walletIndex?: number; } /** * Parameters for creating a wallet. */ interface CreateWalletParameters { /** The unique name of the key vault where the wallet will be created. */ keyVaultId: string; /** Information about the wallet to be created. */ walletInfo: WalletInfo; } /** * Response from creating a wallet. */ interface CreateWalletResponse { /** The unique identifier of the wallet. */ id: string; /** The name of the wallet. */ name: string; /** The blockchain address of the wallet. */ address: string; /** The HD derivation path used to create the wallet. */ derivationPath: string; } /** * Creates a wallet action for the given client. * @param client - The viem client to use for the request. * @returns An object with a createWallet method. */ declare function createWallet(client: Client): { /** * Creates a new wallet in the specified key vault. * @param args - The parameters for creating a wallet. * @returns A promise that resolves to an array of created wallet responses. */ createWallet(args: CreateWalletParameters): Promise<CreateWalletResponse[]>; }; //#endregion //#region src/viem.d.ts /** * Schema for the viem client options. */ declare const ClientOptionsSchema: z.ZodObject<{ accessToken: z.ZodOptional<z.ZodString>; chainId: z.ZodString; chainName: z.ZodString; rpcUrl: z.ZodUnion<readonly [z.ZodString, z.ZodString]>; httpTransportConfig: z.ZodOptional<z.ZodAny>; }, z.core.$strip>; /** * Type representing the validated client options. */ type ClientOptions = Omit<z.infer<typeof ClientOptionsSchema>, "httpTransportConfig"> & { httpTransportConfig?: HttpTransportConfig; }; /** * Creates an optimized public client for blockchain read operations. * * @remarks * PERFORMANCE: Implements intelligent caching to minimize client creation overhead. * Cache hit rates of 80%+ typical in production workloads with repeated chain access. * * SECURITY: Each access token gets isolated cache entries to prevent cross-tenant data exposure. * Client instances are immutable once cached to prevent credential pollution. * * RESOURCE MANAGEMENT: 500ms polling interval balances responsiveness with server load. * 60-second timeout prevents hanging connections in unstable network conditions. * * @param options - Client configuration including chain details and authentication * @returns Cached or newly created public client with read-only blockchain access * @throws ValidationError when options don't match required schema * @throws NetworkError when RPC endpoint is unreachable during client creation * * @example * ```ts * import { getPublicClient } from '@settlemint/sdk-viem'; * * const publicClient = getPublicClient({ * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN, * chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!, * chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!, * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!, * }); * * // Get the block number * const block = await publicClient.getBlockNumber(); * console.log(block); * ``` */ declare const getPublicClient: (options: ClientOptions) => viem0.Client<viem0.HttpTransport<viem0.RpcSchema | undefined, boolean>, Chain, undefined, viem0.PublicRpcSchema, { anvilSetBalance: (args: AnvilSetBalanceParameters) => Promise<unknown>; } & viem0.PublicActions<viem0.HttpTransport<viem0.RpcSchema | undefined, boolean>, Chain>>; /** * The options for the wallet client. */ interface WalletVerificationOptions { /** * The verification id (used for HD wallets), if not provided, the challenge response will be validated against all active verifications. */ verificationId?: string; /** * The challenge id (used for HD wallets) */ challengeId?: string; /** * The challenge response (used for HD wallets) */ challengeResponse: string; } /** * Creates a factory function for wallet clients with runtime verification support. * * @remarks * DESIGN PATTERN: Returns a factory function rather than a client instance because * wallet operations require runtime verification parameters (challenge responses, etc.) * that cannot be known at factory creation time. * * SECURITY: Verification headers are injected per-operation to support: * - HD wallet challenge/response flows * - Multi-signature verification workflows * - Time-sensitive authentication tokens * * PERFORMANCE: Factory caching amortizes expensive setup (chain resolution, transport config) * while allowing runtime parameter injection for each wallet operation. * * FEATURE EXTENSIONS: Automatically extends client with SettleMint-specific wallet actions: * - Wallet creation and management * - Verification challenge handling * - Multi-factor authentication flows * * @param options - Base client configuration (chain, RPC, auth) * @returns Factory function that accepts runtime verification options * @throws ValidationError when options don't match required schema * * @example * ```ts * import { getWalletClient } from '@settlemint/sdk-viem'; * import { parseAbi } from "viem"; * * const walletClient = getWalletClient({ * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN, * chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!, * chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!, * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!, * }); * * // Get the chain id * const chainId = await walletClient().getChainId(); * console.log(chainId); * * // write to the blockchain * const transactionHash = await walletClient().writeContract({ * account: "0x0000000000000000000000000000000000000000", * address: "0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2", * abi: parseAbi(["function mint(uint32 tokenId) nonpayable"]), * functionName: "mint", * args: [69420], * }); * console.log(transactionHash); * ``` */ declare const getWalletClient: (options: ClientOptions) => (verificationOptions?: WalletVerificationOptions) => ReturnType<typeof createWalletClientWithCustomMethods>; declare const createWalletClientWithCustomMethods: (chain: ReturnType<typeof getChain>, validatedOptions: ClientOptions, verificationOptions?: WalletVerificationOptions) => viem0.Client<viem0.HttpTransport<viem0.RpcSchema | undefined, boolean>, Chain, undefined, viem0.WalletRpcSchema, { ethSign: (args: EthSignParameters) => Promise<string>; } & { verifyWalletVerificationChallenge: (args: VerifyWalletVerificationChallengeParameters) => Promise<VerifyWalletVerificationChallengeResponse>; } & { createWalletVerificationChallenges: (args: CreateWalletVerificationChallengesParameters) => Promise<CreateWalletVerificationChallengesResponse>; } & { createWalletVerificationChallenge: (args: CreateWalletVerificationChallengeParameters) => Promise<CreateWalletVerificationChallengeResponse>; } & { deleteWalletVerification: (args: DeleteWalletVerificationParameters) => Promise<DeleteWalletVerificationResponse[]>; } & { createWalletVerification: (args: CreateWalletVerificationParameters) => Promise<CreateWalletVerificationResponse[]>; } & { getWalletVerifications: (args: GetWalletVerificationsParameters) => Promise<GetWalletVerificationsResponse>; } & { createWallet: (args: CreateWalletParameters) => Promise<CreateWalletResponse[]>; } & { anvilSetBalance: (args: AnvilSetBalanceParameters) => Promise<unknown>; } & { call: (parameters: viem0.CallParameters<Chain>) => Promise<viem0.CallReturnType>; createAccessList: (parameters: viem0.CreateAccessListParameters<Chain>) => Promise<{ accessList: viem0.AccessList; gasUsed: bigint; }>; createBlockFilter: () => Promise<viem0.CreateBlockFilterReturnType>; createContractEventFilter: <const abi extends viem0.Abi | readonly unknown[], eventName extends viem0.ContractEventName<abi> | undefined, args extends viem0.MaybeExtractEventArgsFromAbi<abi, eventName> | undefined, strict extends boolean | undefined = undefined, fromBlock extends viem0.BlockNumber | viem0.BlockTag | undefined = undefined, toBlock extends viem0.BlockNumber | viem0.BlockTag | undefined = undefined>(args: viem0.CreateContractEventFilterParameters<abi, eventName, args, strict, fromBlock, toBlock>) => Promise<viem0.CreateContractEventFilterReturnType<abi, eventName, args, strict, fromBlock, toBlock>>; createEventFilter: <const abiEvent extends viem0.AbiEvent | undefined = undefined, const abiEvents extends readonly viem0.AbiEvent[] | readonly unknown[] | undefined = (abiEvent extends viem0.AbiEvent ? [abiEvent] : undefined), strict extends boolean | undefined = undefined, fromBlock extends viem0.BlockNumber | viem0.BlockTag | undefined = undefined, toBlock extends viem0.BlockNumber | viem0.BlockTag | undefined = undefined, _EventName extends string | undefined = viem0.MaybeAbiEventName<abiEvent>, _Args extends viem0.MaybeExtractEventArgsFromAbi<abiEvents, _EventName> | undefined = undefined>(args?: viem0.CreateEventFilterParameters<abiEvent, abiEvents, strict, fromBlock, toBlock, _EventName, _Args> | undefined) => Promise<viem0.CreateEventFilterReturnType<abiEvent, abiEvents, strict, fromBlock, toBlock, _EventName, _Args>>; createPendingTransactionFilter: () => Promise<viem0.CreatePendingTransactionFilterReturnType>; estimateContractGas: <chain extends Chain | undefined, const abi extends viem0.Abi | readonly unknown[], functionName extends viem0.ContractFunctionName<abi, "nonpayable" | "payable">, args extends viem0.ContractFunctionArgs<abi, "nonpayable" | "payable", functionName>>(args: viem0.EstimateContractGasParameters<abi, functionName, args, chain>) => Promise<viem0.EstimateContractGasReturnType>; estimateGas: (args: viem0.EstimateGasParameters<Chain>) => Promise<viem0.EstimateGasReturnType>; fillTransaction: <chainOverride extends Chain | undefined = undefined, accountOverride extends viem0.Account | viem0.Address | undefined = undefined>(args: viem0.FillTransactionParameters<Chain, undefined, chainOverride, accountOverride>) => Promise<viem0.FillTransactionReturnType<Chain, chainOverride>>; getBalance: (args: viem0.GetBalanceParameters) => Promise<viem0.GetBalanceReturnType>; getBlobBaseFee: () => Promise<viem0.GetBlobBaseFeeReturnType>; getBlock: <includeTransactions extends boolean = false, blockTag extends viem0.BlockTag = "latest">(args?: viem0.GetBlockParameters<includeTransactions, blockTag> | undefined) => Promise<{ number: blockTag extends "pending" ? null : bigint; hash: blockTag extends "pending" ? null : `0x${string}`; nonce: blockTag extends "pending" ? null : `0x${string}`; logsBloom: blockTag extends "pending" ? null : `0x${string}`; baseFeePerGas: bigint | null; blobGasUsed: bigint; difficulty: bigint; excessBlobGas: bigint; extraData: viem0.Hex; gasLimit: bigint; gasUsed: bigint; miner: viem0.Address; mixHash: viem0.Hash; parentBeaconBlockRoot?: `0x${string}` | undefined; parentHash: viem0.Hash; receiptsRoot: viem0.Hex; sealFields: viem0.Hex[]; sha3Uncles: viem0.Hash; size: bigint; stateRoot: viem0.Hash; timestamp: bigint; totalDifficulty: bigint | null; transactionsRoot: viem0.Hash; uncles: viem0.Hash[]; withdrawals?: viem0.Withdrawal[] | undefined | undefined; withdrawalsRoot?: `0x${string}` | undefined; transactions: includeTransactions extends true ? ({ chainId?: number | undefined; input: viem0.Hex; yParity?: undefined | undefined; from: viem0.Address; gas: bigint; hash: viem0.Hash; nonce: number; r: viem0.Hex; s: viem0.Hex; to: viem0.Address | null; typeHex: viem0.Hex | null; v: bigint; value: bigint; accessList?: undefined | undefined; authorizationList?: undefined | undefined; blobVersionedHashes?: undefined | undefined; type: "legacy"; gasPrice: bigint; maxFeePerBlobGas?: undefined | undefined; maxFeePerGas?: undefined | undefined; maxPriorityFeePerGas?: undefined | undefined; blockHash: (blockTag extends "pending" ? true : false) extends infer T ? T extends (blockTag extends "pending" ? true : false) ? T extends true ? null : `0x${string}` : never : never; blockNumber: (blockTag extends "pending" ? true : false) extends infer T_1 ? T_1 extends (blockTag extends "pending" ? true : false) ? T_1 extends true ? null : bigint : never : never; transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_2 ? T_2 extends (blockTag extends "pending" ? true : false) ? T_2 extends true ? null : number : never : never; } | { chainId: number; input: viem0.Hex; yParity: number; from: viem0.Address; gas: bigint; hash: viem0.Hash; nonce: number; r: viem0.Hex; s: viem0.Hex; to: viem0.Address | null; typeHex: viem0.Hex | null; v: bigint; value: bigint; accessList: viem0.AccessList; authorizationList?: undefined | undefined; blobVersionedHashes?: undefined | undefined; type: "eip2930"; gasPrice: bigint; maxFeePerBlobGas?: undefined | undefined; maxFeePerGas?: undefined | undefined; maxPriorityFeePerGas?: undefined | undefined; blockHash: (blockTag extends "pending" ? true : false) extends infer T_3 ? T_3 extends (blockTag extends "pending" ? true : false) ? T_3 extends true ? null : `0x${string}` : never : never; blockNumber: (blockTag extends "pending" ? true : false) extends infer T_4 ? T_4 extends (blockTag extends "pending" ? true : false) ? T_4 extends true ? null : bigint : never : never; transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_5 ? T_5 extends (blockTag extends "pending" ? true : false) ? T_5 extends true ? null : number : never : never; } | { chainId: number; input: viem0.Hex; yParity: number; from: viem0.Address; gas: bigint; hash: viem0.Hash; nonce: number; r: viem0.Hex; s: viem0.Hex; to: viem0.Address | null; typeHex: viem0.Hex | null; v: bigint; value: bigint; accessList: viem0.AccessList; authorizationList?: undefined | undefined; blobVersionedHashes?: undefined | undefined; type: "eip1559"; gasPrice?: undefined | undefined; maxFeePerBlobGas?: undefined | undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; blockHash: (blockTag extends "pending" ? true : false) extends infer T_6 ? T_6 extends (blockTag extends "pending" ? true : false) ? T_6 extends true ? null : `0x${string}` : never : never; blockNumber: (blockTag extends "pending" ? true : false) extends infer T_7 ? T_7 extends (blockTag extends "pending" ? true : false) ? T_7 extends true ? null : bigint : never : never; transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_8 ? T_8 extends (blockTag extends "pending" ? true : false) ? T_8 extends true ? null : number : never : never; } | { chainId: number; input: viem0.Hex; yParity: number; from: viem0.Address; gas: bigint; hash: viem0.Hash; nonce: number; r: viem0.Hex; s: viem0.Hex; to: viem0.Address | null; typeHex: viem0.Hex | null; v: bigint; value: bigint; accessList: viem0.AccessList; authorizationList?: undefined | undefined; blobVersionedHashes: readonly viem0.Hex[]; type: "eip4844"; gasPrice?: undefined | undefined; maxFeePerBlobGas: bigint; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; blockHash: (blockTag extends "pending" ? true : false) extends infer T_9 ? T_9 extends (blockTag extends "pending" ? true : false) ? T_9 extends true ? null : `0x${string}` : never : never; blockNumber: (blockTag extends "pending" ? true : false) extends infer T_10 ? T_10 extends (blockTag extends "pending" ? true : false) ? T_10 extends true ? null : bigint : never : never; transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_11 ? T_11 extends (blockTag extends "pending" ? true : false) ? T_11 extends true ? null : number : never : never; } | { chainId: number; input: viem0.Hex; yParity: number; from: viem0.Address; gas: bigint; hash: viem0.Hash; nonce: number; r: viem0.Hex; s: viem0.Hex; to: viem0.Address | null; typeHex: viem0.Hex | null; v: bigint; value: bigint; accessList: viem0.AccessList; authorizationList: viem0.SignedAuthorizationList; blobVersionedHashes?: undefined | undefined; type: "eip7702"; gasPrice?: undefined | undefined; maxFeePerBlobGas?: undefined | undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; blockHash: (blockTag extends "pending" ? true : false) extends infer T_12 ? T_12 extends (blockTag extends "pending" ? true : false) ? T_12 extends true ? null : `0x${string}` : never : never; blockNumber: (blockTag extends "pending" ? true : false) extends infer T_13 ? T_13 extends (blockTag extends "pending" ? true : false) ? T_13 extends true ? null : bigint : never : never; transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_14 ? T_14 extends (blockTag extends "pending" ? true : false) ? T_14 extends true ? null : number : never : never; })[] : `0x${string}`[]; }>; getBlockNumber: (args?: viem0.GetBlockNumberParameters | undefined) => Promise<viem0.GetBlockNumberReturnType>; getBlockTransactionCount: (args?: viem0.GetBlockTransactionCountParameters | undefined) => Promise<viem0.GetBlockTransactionCountReturnType>; getBytecode: (args: viem0.GetBytecodeParameters) => Promise<viem0.GetBytecodeReturnType>; getChainId: () => Promise<viem0.GetChainIdReturnType>; getCode: (args: viem0.GetBytecodeParameters) => Promise<viem0.GetBytecodeReturnType>; getContractEvents: <const abi extends viem0.Abi | readonly unknown[], eventName extends viem0.ContractEventName<abi> | undefined = undefined, strict extends boolean | undefined = undefined, fromBlock extends viem0.BlockNumber | viem0.BlockTag | undefined = undefined, toBlock extends viem0.BlockNumber | viem0.BlockTag | undefined = undefined>(args: viem0.GetContractEventsParameters<abi, eventName, strict, fromBlock, toBlock>) => Promise<viem0.GetContractEventsReturnType<abi, eventName, strict, fromBlock, toBlock>>; getEip712Domain: (args: viem0.GetEip712DomainParameters) => Promise<viem0.GetEip712DomainReturnType>; getEnsAddress: (args: viem0.GetEnsAddressParameters) => Promise<viem0.GetEnsAddressReturnType>; getEnsAvatar: (args: viem0.GetEnsAvatarParameters) => Promise<viem0.GetEnsAvatarReturnType>; getEnsName: (args: viem0.GetEnsNameParameters) => Promise<viem0.GetEnsNameReturnType>; getEnsResolver: (args: viem0.GetEnsResolverParameters) => Promise<viem0.GetEnsResolverReturnType>; getEnsText: (args: viem0.GetEnsTextParameters) => Promise<viem0.GetEnsTextReturnType>; getFeeHistory: (args: viem0.GetFeeHistoryParameters) => Promise<viem0.GetFeeHistoryReturnType>; estimateFeesPerGas: <chainOverride extends Chain | undefined = undefined, type extends viem0.FeeValuesType = "eip1559">(args?: viem0.EstimateFeesPerGasParameters<Chain, chainOverride, type> | undefined) => Promise<viem0.EstimateFeesPerGasReturnType<type>>; getFilterChanges: <filterType extends viem0.FilterType, const abi extends viem0.Abi | readonly unknown[] | undefined, eventName extends string | undefined, strict extends boolean | undefined = undefined, fromBlock extends viem0.BlockNumber | viem0.BlockTag | undefined = undefined, toBlock extends viem0.BlockNumber | viem0.BlockTag | undefined = undefined>(args: viem0.GetFilterChangesParameters<filterType, abi, eventName, strict, fromBlock, toBlock>) => Promise<viem0.GetFilterChangesReturnType<filterType, abi, eventName, strict, fromBlock, toBlock>>; getFilterLogs: <const abi extends viem0.Abi | readonly unknown[] | undefined, eventName extends string | undefined, strict extends boolean | undefined = undefined, fromBlock extends viem0.BlockNumber | viem0.BlockTag | undefined = undefined, toBlock extends viem0.BlockNumber | viem0.BlockTag | undefined = undefined>(args: viem0.GetFilterLogsParameters<abi, eventName, strict, fromBlock, toBlock>) => Promise<viem0.GetFilterLogsReturnType<abi, eventName, strict, fromBlock, toBlock>>; getGasPrice: () => Promise<viem0.GetGasPriceReturnType>; getLogs: <const abiEvent extends viem0.AbiEvent | undefined = undefined, const abiEvents extends readonly viem0.AbiEvent[] | readonly unknown[] | undefined = (abiEvent extends viem0.AbiEvent ? [abiEvent] : undefined), strict extends boolean | undefined = undefined, fromBlock extends viem0.BlockNumber | viem0.BlockTag | undefined = undefined, toBlock extends viem0.BlockNumber | viem0.BlockTag | undefined = undefined>(args?: viem0.GetLogsParameters<abiEvent, abiEvents, strict, fromBlock, toBlock> | undefined) => Promise<viem0.GetLogsReturnType<abiEvent, abiEvents, strict, fromBlock, toBlock>>; getProof: (args: viem0.GetProofParameters) => Promise<viem0.GetProofReturnType>; estimateMaxPriorityFeePerGas: <chainOverride extends Chain | undefined = undefined>(args?: { chain?: chainOverride | null | undefined; } | undefined) => Promise<viem0.EstimateMaxPriorityFeePerGasReturnType>; getStorageAt: (args: viem0.GetStorageAtParameters) => Promise<viem0.GetStorageAtReturnType>; getTransaction: <blockTag extends viem0.BlockTag = "latest">(args: viem0.GetTransactionParameters<blockTag>) => Promise<{ chainId?: number | undefined; input: viem0.Hex; yParity?: undefined | undefined; from: viem0.Address; gas: bigint; hash: viem0.Hash; nonce: number; r: viem0.Hex; s: viem0.Hex; to: viem0.Address | null; typeHex: viem0.Hex | null; v: bigint; value: bigint; accessList?: undefined | undefined; authorizationList?: undefined | undefined; blobVersionedHashes?: undefined | undefined; type: "legacy"; gasPrice: bigint; maxFeePerBlobGas?: undefined | undefined; maxFeePerGas?: undefined | undefined; maxPriorityFeePerGas?: undefined | undefined; blockHash: (blockTag extends "pending" ? true : false) extends infer T ? T extends (blockTag extends "pending" ? true : false) ? T extends true ? null : `0x${string}` : never : never; blockNumber: (blockTag extends "pending" ? true : false) extends infer T_1 ? T_1 extends (blockTag extends "pending" ? true : false) ? T_1 extends true ? null : bigint : never : never; transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_2 ? T_2 extends (blockTag extends "pending" ? true : false) ? T_2 extends true ? null : number : never : never; } | { chainId: number; input: viem0.Hex; yParity: number; from: viem0.Address; gas: bigint; hash: viem0.Hash; nonce: number; r: viem0.Hex; s: viem0.Hex; to: viem0.Address | null; typeHex: viem0.Hex | null; v: bigint; value: bigint; accessList: viem0.AccessList; authorizationList?: undefined | undefined; blobVersionedHashes?: undefined | undefined; type: "eip2930"; gasPrice: bigint; maxFeePerBlobGas?: undefined | undefined; maxFeePerGas?: undefined | undefined; maxPriorityFeePerGas?: undefined | undefined; blockHash: (blockTag extends "pending" ? true : false) extends infer T_3 ? T_3 extends (blockTag extends "pending" ? true : false) ? T_3 extends true ? null : `0x${string}` : never : never; blockNumber: (blockTag extends "pending" ? true : false) extends infer T_4 ? T_4 extends (blockTag extends "pending" ? true : false) ? T_4 extends true ? null : bigint : never : never; transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_5 ? T_5 extends (blockTag extends "pending" ? true : false) ? T_5 extends true ? null : number : never : never; } | { chainId: number; input: viem0.Hex; yParity: number; from: viem0.Address; gas: bigint; hash: viem0.Hash; nonce: number; r: viem0.Hex; s: viem0.Hex; to: viem0.Address | null; typeHex: viem0.Hex | null; v: bigint; value: bigint; accessList: viem0.AccessList; authorizationList?: undefined | undefined; blobVersionedHashes?: undefined | undefined; type: "eip1559"; gasPrice?: undefined | undefined; maxFeePerBlobGas?: undefined | undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; blockHash: (blockTag extends "pending" ? true : false) extends infer T_6 ? T_6 extends (blockTag extends "pending" ? true : false) ? T_6 extends true ? null : `0x${string}` : never : never; blockNumber: (blockTag extends "pending" ? true : false) extends infer T_7 ? T_7 extends (blockTag extends "pending" ? true : false) ? T_7 extends true ? null : bigint : never : never; transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_8 ? T_8 extends (blockTag extends "pending" ? true : false) ? T_8 extends true ? null : number : never : never; } | { chainId: number; input: viem0.Hex; yParity: number; from: viem0.Address; gas: bigint; hash: viem0.Hash; nonce: number; r: viem0.Hex; s: viem0.Hex; to: viem0.Address | null; typeHex: viem0.Hex | null; v: bigint; value: bigint; accessList: viem0.AccessList; authorizationList?: undefined | undefined; blobVersionedHashes: readonly viem0.Hex[]; type: "eip4844"; gasPrice?: undefined | undefined; maxFeePerBlobGas: bigint; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; blockHash: (blockTag extends "pending" ? true : false) extends infer T_9 ? T_9 extends (blockTag extends "pending" ? true : false) ? T_9 extends true ? null : `0x${string}` : never : never; blockNumber: (blockTag extends "pending" ? true : false) extends infer T_10 ? T_10 extends (blockTag extends "pending" ? true : false) ? T_10 extends true ? null : bigint : never : never; transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_11 ? T_11 extends (blockTag extends "pending" ? true : false) ? T_11 extends true ? null : number : never : never; } | { chainId: number; input: viem0.Hex; yParity: number; from: viem0.Address; gas: bigint; hash: viem0.Hash; nonce: number; r: viem0.Hex; s: viem0.Hex; to: viem0.Address | null; typeHex: viem0.Hex | null; v: bigint; value: bigint; accessList: viem0.AccessList; authorizationList: viem0.SignedAuthorizationList; blobVersionedHashes?: undefined | undefined; type: "eip7702"; gasPrice?: undefined | undefined; maxFeePerBlobGas?: undefined | undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; blockHash: (blockTag extends "pending" ? true : false) extends infer T_12 ? T_12 extends (blockTag extends "pending" ? true : false) ? T_12 extends true ? null : `0x${string}` : never : never; blockNumber: (blockTag extends "pending" ? true : false) extends infer T_13 ? T_13 extends (blockTag extends "pending" ? true : false) ? T_13 extends true ? null : bigint : never : never; transactionIndex: (blockTag extends "pending" ? true : false) extends infer T_14 ? T_14 extends (blockTag extends "pending" ? true : false) ? T_14 extends true ? null : number : never : never; }>; getTransactionConfirmations: (args: viem0.GetTransactionConfirmationsParameters<Chain>) => Promise<viem0.GetTransactionConfirmationsReturnType>; getTransactionCount: (args: viem0.GetTransactionCountParameters) => Promise<viem0.GetTransactionCountReturnType>; getTransactionReceipt: (args: viem0.GetTransactionReceiptParameters) => Promise<viem0.TransactionReceipt>; multicall: <const contracts extends readonly unknown[], allowFailure extends boolean = true>(args: viem0.MulticallParameters<contracts, allowFailure>) => Promise<viem0.MulticallReturnType<contracts, allowFailure>>; prepareTransactionRequest: <const request extends viem0.PrepareTransactionRequestRequest<Chain, chainOverride>, chainOverride extends Chain | undefined = undefined, accountOverride extends viem0.Account | viem0.Address | undefined = undefined>(args: viem0.PrepareTransactionRequestParameters<Chain, undefined, chainOverride, accountOverride, request>) => Promise<viem0.UnionRequiredBy<Extract<viem0.UnionOmit<viem0.ExtractChainFormatterParameters<viem0.DeriveChain<Chain, chainOverride>, "transactionRequest", viem0.TransactionRequest>, "from"> & (viem0.DeriveChain<Chain, chainOverride> extends infer T_1 ? T_1 extends viem0.DeriveChain<Chain, chainOverride> ? T_1 extends Chain ? { chain: T_1; } : { chain?: undefined; } : never : never) & (viem0.DeriveAccount<undefined, accountOverride> extends infer T_2 ? T_2 extends viem0.DeriveAccount<undefined, accountOverride> ? T_2 extends viem0.Account ? { account: T_2; from: viem0.Address; } : { account?: undefined; from?: undefined; } : never : never), viem0.IsNever<((request["type"] extends string | undefined ? request["type"] : viem0.GetTransactionType<request, (request extends { accessList?: undefined | undefined; authorizationList?: undefined | undefined; blobs?: undefined | undefined; blobVersionedHashes?: undefined | undefined; gasPrice?: bigint | undefined; sidecars?: undefined | undefined; } & viem0.FeeValuesLegacy ? "legacy" : never) | (request extends { accessList?: viem0.AccessList | undefined; authorizationList?: undefined | undefined; blobs?: undefined | undefined; blobVersionedHashes?: undefined | undefined; gasPrice?: undefined | undefined; maxFeePerBlobGas?: undefined | undefined; maxFeePerGas?: bigint | undefined; maxPriorityFeePerGas?: bigint | undefined; sidecars?: undefined | undefined; } & (viem0.OneOf<{ maxFeePerGas: viem0.FeeValuesEIP1559["maxFeePerGas"]; } | { maxPriorityFeePerGas: viem0.FeeValuesEIP1559["maxPriorityFeePerGas"]; }, viem0.FeeValuesEIP1559> & { accessList?: viem0.TransactionSerializableEIP2930["accessList"] | undefined; }) ? "eip1559" : never) | (request extends { accessList?: viem0.AccessList | undefined; authorizationList?: undefined | undefined; blobs?: undefined | undefined; blobVersionedHashes?: undefined | undefined; gasPrice?: bigint | undefined; sidecars?: undefined | undefined; maxFeePerBlobGas?: undefined | undefined; maxFeePerGas?: undefined | undefined; maxPriorityFeePerGas?: undefined | undefined; } & { accessList: viem0.TransactionSerializableEIP2930["accessList"]; } ? "eip2930" : never) | (request extends ({ accessList?: viem0.AccessList | undefined; authorizationList?: undefined | undefined; blobs?: readonly `0x${string}`[] | readonly viem0.ByteArray[] | undefined; blobVersionedHashes?: readonly `0x${string}`[] | undefined; maxFeePerBlobGas?: bigint | undefined; maxFeePerGas?: bigint | undefined; maxPriorityFeePerGas?: bigint | undefined; sidecars?: false | readonly viem0.BlobSidecar<`0x${string}`>[] | undefined; } | { accessList?: viem0.AccessList | undefined; authorizationList?: undefined | undefined; blobs?: readonly `0x${string}`[] | readonly viem0.ByteArray[] | undefined; blobVersionedHashes?: readonly `0x${string}`[] | undefined; maxFeePerBlobGas?: bigint | undefined; maxFeePerGas?: bigint | undefined; maxPriorityFeePerGas?: bigint | undefined; sidecars?: false | readonly viem0.BlobSidecar<`0x${string}`>[] | undefined; }) & (viem0.ExactPartial<viem0.FeeValuesEIP4844> & viem0.OneOf<{ blobs: viem0.TransactionSerializableEIP4844["blobs"]; } | { blobVersionedHashes: viem0.TransactionSerializableEIP4844["blobVersionedHashes"]; } | { sidecars: viem0.TransactionSerializableEIP4844["sidecars"]; }, viem0.TransactionSerializableEIP4844>) ? "eip4844" : never) | (request extends ({ accessList?: viem0.AccessList | undefined; authorizationList?: viem0.SignedAuthorizationList | undefined; blobs?: undefined | undefined; blobVersionedHashes?: undefined | undefined; gasPrice?: undefined | undefined; maxFeePerBlobGas?: undefined | undefined; maxFeePerGas?: bigint | undefined; maxPriorityFeePerGas?: bigint | undefined; sidecars?: undefined | undefined; } | { accessList?: viem0.AccessList | undefined; authorizationList?: viem0.SignedAuthorizationList | undefined; blobs?: undefined | undefined; blobVersionedHashes?: undefined | undefined; gasPrice?: undefined | undefined; maxFeePerBlobGas?: undefined | undefined; maxFeePerGas?: bigint | undefined; maxPriorityFeePerGas?: bigint | undefined; sidecars?: undefined | undefined; }) & { authorizationList: viem0.TransactionSerializableEIP7702["authorizationList"]; } ? "eip7702" : never) | (request["type"] extends string | undefined ? Extract<request["type"], string> : never)> extends "legacy" ? unknown : viem0.GetTransactionType<request, (request extends { accessList?: undefined | undefined; authorizationList?: undefined | undefined; blobs?: undefined | undefined; blobVersionedHashes?: undefined | undefined; gasPrice?: bigint | undefined; sidecars?: undefined | undefined; } & viem0.FeeValuesLegacy ? "legacy" : never) | (request extends { accessList?: viem0.AccessList | undefined; authorizationList?: undefined | undefined; blobs?: undefined | undefined; blobVersionedHashes?: undefined | undefined; gasPrice?: undefined | undefined; maxFeePerBlobGas?: undefined | undefined; maxFeePerGas?: bigint | undefined; maxPriorityFeePerGas?: bigint | undefined; sidecars?: undefined | undefined; } & (viem0.OneOf<{ maxFeePerGas: viem0.FeeValuesEIP1559["maxFeePerGas"]; } | { maxPriorityFeePerGas: viem0.FeeValuesEIP1559["maxPriorityFeePerGas"]; }, viem0.FeeValuesEIP1559> & { accessList?: viem0.TransactionSerializableEIP2930["accessList"] | undefined; }) ? "eip1559" : never) | (request extends { accessList?: viem0.AccessList | undefined; authorizationList?: undefined | undefined; blobs?: undefined | undefined; blobVersionedHashes?: undefined | undefined; gasPrice?: bigint | undefined; sidecars?: undefined | undefined; maxFeePerBlobGas?: undefined | undefined; maxFeePerGas?: undefined | undefined; maxPriorityFeePerGas?: undefined | undefined; } & { accessList: viem0.TransactionSerializableEIP2930["accessList"]; } ? "eip2930" : never) | (request extends ({ accessList?: viem0.AccessList | undefined; authorizationList?: undefined | undefined; blobs?: readonly `0x${string}`[] | readonly viem0.ByteArray[] | undefined; blobVersionedHashes?: readonly `0x${string}`[] | undefined; maxFeePerBlobGas?: bigint | undefined; maxFeePerGas?: bigint | undefined; maxPriorityFeePerGas?: bigint | undefined; sidecars?: false | readonly viem0.BlobSidecar<`0x${string}`>[] | undefined; } | { accessList?: viem0.AccessList | undefined; authorizationList?: undefined | undefined; blobs?: readonly `0x${string}`[] | readonly viem0.ByteArray[] | undefined; blobVersionedHashes?: readonly `0x${string}`[] | undefined; maxFeePerBlobGas?: bigint | undefined; maxFeePerGas?: bigint | undefined; maxPriorityFeePerGas?: bigint | undefined; sidecars?: false | readonly viem0.BlobSidecar<`0x${string}`>[] | undefined; }) & (viem0.ExactPartial<viem0.FeeValuesEIP4844> & viem0.OneOf<{ blobs: viem0.TransactionSerializableEIP4844["blobs"]; } | { blobVersionedHashes: viem0.TransactionSerializableEIP4844["blobVersionedHashes"]; } | { sidecars: viem0.TransactionSerializableEIP4844["sidecars"]; }, viem0.TransactionSerializableEIP4844>) ? "eip4844" : never) | (request extends ({ accessList?: viem0.AccessList | undefined; authorizationList?: viem0.SignedAuthorizationList | undefined; blobs?: undefined | undefined; blobVersionedHashes?: undefined | undefined; gasPrice?: undefined | undefined; maxFeePerBlobGas?: undefined | undefined; maxFeePerGas?: bigint | undefined; maxPriorityFeePerGas?: bigint | undefined; sidecars?: undefined | undefined; } | { accessList?: viem0.AccessList | undefined; authorizationList?: viem0.SignedAuthorizationList | undefined; blobs?: undefined | undefined; blobVersionedHashes?: undefined | undefined; gasPrice?: undefined | undefined; m