UNPKG

@cometh/connect-core-sdk

Version:
875 lines (859 loc) 37.4 kB
import * as viem from 'viem'; import { PrivateKeyAccount, Address, Transport, Chain, PublicClient, LocalAccount, Hex, UnionPartialBy, Client, SendTransactionParameters, Hash, Abi, ContractFunctionName, ContractFunctionArgs, WriteContractParameters, TypedData, RpcSchema, BundlerRpcSchema, PublicClientConfig, Account, EIP1193Provider, SignableMessage, TypedDataDefinition, BaseError } from 'viem'; import { Prettify } from 'viem/types/utils'; import { ToSafeSmartAccountReturnType } from 'permissionless/accounts'; import { UserOperation, SmartAccount, SendUserOperationParameters, BundlerActions, PaymasterActions } from 'viem/account-abstraction'; import { SmartAccountClientConfig } from 'permissionless'; import { Prettify as Prettify$1 } from 'viem/chains'; import { signMessage, signTypedData } from 'permissionless/actions/smartAccount'; declare const ENTRYPOINT_ADDRESS_V07 = "0x0000000071727De22E5E9d8BAf0edAc6f37da032"; type Signer = PrivateKeyAccount; type SafeContractParams = { safeProxyFactoryAddress: Address; safeSingletonAddress: Address; multisendAddress: Address; setUpContractAddress: Address; fallbackHandler?: Address; safe4337ModuleAddress?: Address; }; type ComethSafeSmartAccount = ToSafeSmartAccountReturnType<"0.7"> & { signerAddress: Address; safeContractParams: SafeContractParams; publicClient?: PublicClient; }; type createSafeSmartAccountParameters = Prettify<{ chain: Chain; signer: Signer; safeContractConfig?: SafeContractParams; publicClient?: PublicClient; smartAccountAddress?: Address; }>; /** * Create a Safe smart account */ declare function createSafeSmartAccount<TTransport extends Transport = Transport, TChain extends Chain = Chain>({ chain, publicClient, smartAccountAddress, safeContractConfig, signer, }: createSafeSmartAccountParameters): Promise<ComethSafeSmartAccount>; type SafeSigner<Name extends string = string> = LocalAccount<Name> & { getStubSignature(): Promise<Hex>; signUserOperation: (parameters: UnionPartialBy<UserOperation, "sender"> & { chainId?: number | undefined; }) => Promise<Hex>; }; /** * Creates, signs, and sends a new transaction to the network. * This function also allows you to sponsor this transaction if sender is a smartAccount * * - Docs: https://viem.sh/docs/actions/wallet/sendTransaction.html * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/sending-transactions * - JSON-RPC Methods: * - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) * - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) * * @param client - Client to use * @param parameters - {@link SendTransactionParameters} * @returns The [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. * * @example * import { createWalletClient, custom } from 'viem' * import { mainnet } from 'viem/chains' * import { sendTransaction } from 'viem/wallet' * * const client = createWalletClient({ * chain: mainnet, * transport: custom(window.ethereum), * }) * const hash = await sendTransaction(client, { * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', * value: 1000000000000000000n, * }) * * @example * // Account Hoisting * import { createWalletClient, http } from 'viem' * import { privateKeyToAccount } from 'viem/accounts' * import { mainnet } from 'viem/chains' * import { sendTransaction } from 'viem/wallet' * * const client = createWalletClient({ * account: privateKeyToAccount('0x…'), * chain: mainnet, * transport: http(), * }) * const hash = await sendTransaction(client, { * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', * value: 1000000000000000000n, * }) */ declare function sendTransaction<account extends SmartAccount | undefined, chain extends Chain | undefined, accountOverride extends SmartAccount | undefined = undefined, chainOverride extends Chain | undefined = Chain | undefined, calls extends readonly unknown[] = readonly unknown[]>(client: Client<Transport, chain, account>, args: SendTransactionParameters<chain, account, chainOverride> | SendUserOperationParameters<account, accountOverride, calls>): Promise<Hash>; declare function writeContract<TChain extends Chain | undefined, TAccount extends SmartAccount | undefined, const TAbi extends Abi | readonly unknown[], TFunctionName extends ContractFunctionName<TAbi, "nonpayable" | "payable"> = ContractFunctionName<TAbi, "nonpayable" | "payable">, TArgs extends ContractFunctionArgs<TAbi, "nonpayable" | "payable", TFunctionName> = ContractFunctionArgs<TAbi, "nonpayable" | "payable", TFunctionName>, TChainOverride extends Chain | undefined = undefined>(client: Client<Transport, TChain, TAccount>, { abi, address, args, dataSuffix, functionName, ...request }: WriteContractParameters<TAbi, TFunctionName, TArgs, TChain, TAccount, TChainOverride>): Promise<Hash>; type SmartAccountActions<TChain extends Chain | undefined = Chain | undefined, TSmartAccount extends SmartAccount | undefined = SmartAccount | undefined> = { /** * Creates, signs, and sends a new transaction to the network. * This function also allows you to sponsor this transaction if sender is a smartAccount * * - Docs: https://viem.sh/docs/actions/wallet/sendTransaction.html * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/sending-transactions * - JSON-RPC Methods: * - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) * - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) * * @param args - {@link SendTransactionParameters} * @returns The [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. {@link SendTransactionReturnType} * * @example * import { createWalletClient, custom } from 'viem' * import { mainnet } from 'viem/chains' * * const client = createWalletClient({ * chain: mainnet, * transport: custom(window.ethereum), * }) * const hash = await client.sendTransaction({ * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', * value: 1000000000000000000n, * }) * * @example * // Account Hoisting * import { createWalletClient, http } from 'viem' * import { privateKeyToAccount } from 'viem/accounts' * import { mainnet } from 'viem/chains' * * const client = createWalletClient({ * account: privateKeyToAccount('0x…'), * chain: mainnet, * transport: http(), * }) * const hash = await client.sendTransaction({ * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', * value: 1000000000000000000n, * }) */ sendTransaction: <TChainOverride extends Chain | undefined = undefined, accountOverride extends SmartAccount | undefined = undefined, calls extends readonly unknown[] = readonly unknown[]>(args: Parameters<typeof sendTransaction<TSmartAccount, TChain, accountOverride, TChainOverride, calls>>[1]) => Promise<Hash>; /** * Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. * * - Docs: https://viem.sh/docs/actions/wallet/signMessage.html * - JSON-RPC Methods: * - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data.html#personal-sign) * - Local Accounts: Signs locally. No JSON-RPC request. * * With the calculated signature, you can: * - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage.html) to verify the signature, * - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress.html) to recover the signing address from a signature. * * @param args - {@link SignMessageParameters} * @returns The signed message. {@link SignMessageReturnType} * * @example * import { createWalletClient, custom } from 'viem' * import { mainnet } from 'viem/chains' * * const client = createWalletClient({ * chain: mainnet, * transport: custom(window.ethereum), * }) * const signature = await client.signMessage({ * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', * message: 'hello world', * }) * * @example * // Account Hoisting * import { createWalletClient, http } from 'viem' * import { privateKeyToAccount } from 'viem/accounts' * import { mainnet } from 'viem/chains' * * const client = createWalletClient({ * account: privateKeyToAccount('0x…'), * chain: mainnet, * transport: http(), * }) * const signature = await client.signMessage({ * message: 'hello world', * }) */ signMessage: (args: Parameters<typeof signMessage<TSmartAccount>>[1]) => ReturnType<typeof signMessage<TSmartAccount>>; /** * Signs typed data and calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. * * - Docs: https://viem.sh/docs/actions/wallet/signTypedData.html * - JSON-RPC Methods: * - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data.html#signtypeddata-v4) * - Local Accounts: Signs locally. No JSON-RPC request. * * @param client - Client to use * @param args - {@link SignTypedDataParameters} * @returns The signed data. {@link SignTypedDataReturnType} * * @example * import { createWalletClient, custom } from 'viem' * import { mainnet } from 'viem/chains' * * const client = createWalletClient({ * chain: mainnet, * transport: custom(window.ethereum), * }) * const signature = await client.signTypedData({ * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', * domain: { * name: 'Ether Mail', * version: '1', * chainId: 1, * verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', * }, * types: { * Person: [ * { name: 'name', type: 'string' }, * { name: 'wallet', type: 'address' }, * ], * Mail: [ * { name: 'from', type: 'Person' }, * { name: 'to', type: 'Person' }, * { name: 'contents', type: 'string' }, * ], * }, * primaryType: 'Mail', * message: { * from: { * name: 'Cow', * wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', * }, * to: { * name: 'Bob', * wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', * }, * contents: 'Hello, Bob!', * }, * }) * * @example * // Account Hoisting * import { createWalletClient, http } from 'viem' * import { privateKeyToAccount } from 'viem/accounts' * import { mainnet } from 'viem/chains' * * const client = createWalletClient({ * account: privateKeyToAccount('0x…'), * chain: mainnet, * transport: http(), * }) * const signature = await client.signTypedData({ * domain: { * name: 'Ether Mail', * version: '1', * chainId: 1, * verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', * }, * types: { * Person: [ * { name: 'name', type: 'string' }, * { name: 'wallet', type: 'address' }, * ], * Mail: [ * { name: 'from', type: 'Person' }, * { name: 'to', type: 'Person' }, * { name: 'contents', type: 'string' }, * ], * }, * primaryType: 'Mail', * message: { * from: { * name: 'Cow', * wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', * }, * to: { * name: 'Bob', * wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', * }, * contents: 'Hello, Bob!', * }, * }) */ signTypedData: <const TTypedData extends TypedData | { [key: string]: unknown; }, TPrimaryType extends string>(args: Parameters<typeof signTypedData<TTypedData, TPrimaryType, TSmartAccount>>[1]) => ReturnType<typeof signTypedData<TTypedData, TPrimaryType, TSmartAccount>>; /** * Executes a write function on a contract. * This function also allows you to sponsor this transaction if sender is a smartAccount * * - Docs: https://viem.sh/docs/contract/writeContract.html * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts * * A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms.html) is needed to be broadcast in order to change the state. * * Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet.html) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). * * __Warning: The `write` internally sends a transaction it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract.html#usage) before you execute it.__ * * @param args - {@link WriteContractParameters} * @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms.html#hash). {@link WriteContractReturnType} * * @example * import { createWalletClient, custom, parseAbi } from 'viem' * import { mainnet } from 'viem/chains' * * const client = createWalletClient({ * chain: mainnet, * transport: custom(window.ethereum), * }) * const hash = await client.writeContract({ * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', * abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), * functionName: 'mint', * args: [69420], * }) * * @example * // With Validation * import { createWalletClient, custom, parseAbi } from 'viem' * import { mainnet } from 'viem/chains' * * const client = createWalletClient({ * chain: mainnet, * transport: custom(window.ethereum), * }) * const { request } = await client.simulateContract({ * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', * abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), * functionName: 'mint', * args: [69420], * } * const hash = await client.writeContract(request) */ writeContract: <const TAbi extends Abi | readonly unknown[], TFunctionName extends ContractFunctionName<TAbi, "nonpayable" | "payable"> = ContractFunctionName<TAbi, "nonpayable" | "payable">, TArgs extends ContractFunctionArgs<TAbi, "nonpayable" | "payable", TFunctionName> = ContractFunctionArgs<TAbi, "nonpayable" | "payable", TFunctionName>, TChainOverride extends Chain | undefined = undefined>(args: WriteContractParameters<TAbi, TFunctionName, TArgs, TChain, TSmartAccount, TChainOverride>) => ReturnType<typeof writeContract<TChain, TSmartAccount, TAbi, TFunctionName, TArgs, TChainOverride>>; }; type ComethClientActions<TChain extends Chain | undefined = Chain | undefined, TSmartAccount extends ComethSafeSmartAccount | undefined = ComethSafeSmartAccount | undefined> = SmartAccountActions<TChain, TSmartAccount> & { setFallbackTo7579: () => Promise<Hex>; is7579Installed: () => Promise<boolean>; }; type ComethAccountClientActions<chain extends Chain | undefined = Chain | undefined, account extends ComethSafeSmartAccount | undefined = ComethSafeSmartAccount | undefined> = ComethClientActions<chain, account>; type SmartAccountClient<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends ComethSafeSmartAccount | undefined = ComethSafeSmartAccount | undefined, client extends Client | undefined = Client | undefined, rpcSchema extends RpcSchema | undefined = undefined> = Prettify$1<Client<transport, chain extends Chain ? chain : client extends Client<any, infer chain> ? chain : undefined, account, rpcSchema extends RpcSchema ? [...BundlerRpcSchema, ...rpcSchema] : BundlerRpcSchema, BundlerActions<account> & ComethClientActions<chain, account>>>; type ComethSmartAccountClient<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends ComethSafeSmartAccount | undefined = ComethSafeSmartAccount | undefined, client extends Client | undefined = Client | undefined, rpcSchema extends RpcSchema | undefined = undefined> = Prettify$1<Client<transport, chain extends Chain ? chain : client extends Client<any, infer chain> ? chain : undefined, account, rpcSchema extends RpcSchema ? [...BundlerRpcSchema, ...rpcSchema] : BundlerRpcSchema, BundlerActions<account> & ComethAccountClientActions<chain, account>>>; declare function createSmartAccountClient<transport extends Transport, chain extends Chain | undefined = undefined, account extends ComethSafeSmartAccount | undefined = ComethSafeSmartAccount | undefined, client extends Client | undefined = undefined, rpcSchema extends RpcSchema | undefined = undefined>(parameters: SmartAccountClientConfig<transport, chain, account, client, rpcSchema>): ComethSmartAccountClient<transport, chain, account, client>; /** * RPC interface that's used for the cometh paymaster communication */ type ComethPaymasterRpcSchema = [ { Method: "pm_sponsorUserOperation"; Parameters: [userOperation: UserOperation<"0.7">, EntryPoint: Address]; ReturnType: { callGasLimit: Hex; verificationGasLimit: Hex; preVerificationGas: Hex; paymasterPostOpGasLimit: Hex; paymasterVerificationGasLimit: Hex; }; } ]; type ComethPaymasterClient = Client<Transport, Chain | undefined, Account | undefined, ComethPaymasterRpcSchema, ComethPaymasterClientActions & PaymasterActions>; type ComethPaymasterClientActions = { /** * Returns maxFeePerGas & maxPriorityFeePerGas required to sponsor a userOperation. */ getUserOperationGasPrice: () => Promise<{ maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; }>; }; declare const createComethPaymasterClient: <transport extends Transport = Transport, chain extends Chain | undefined = undefined>(parameters: PublicClientConfig<transport, chain> & { publicClient?: PublicClient; }) => ComethPaymasterClient; declare const providerToSmartAccountSigner: (provider: EIP1193Provider, params?: { signerAddress: Hex; }) => Promise<{ address: `0x${string}`; type: string; source: string; publicKey: `0x${string}`; signMessage: ({ message, }: { message: SignableMessage; }) => Promise<Hex>; signTypedData<const TTypedData extends Record<string, unknown> | { [x: string]: readonly viem.TypedDataParameter[]; [x: `string[${string}]`]: undefined; [x: `function[${string}]`]: undefined; [x: `address[${string}]`]: undefined; [x: `uint256[${string}]`]: undefined; [x: `bytes[${string}]`]: undefined; [x: `uint128[${string}]`]: undefined; [x: `uint48[${string}]`]: undefined; [x: `bool[${string}]`]: undefined; [x: `bytes1[${string}]`]: undefined; [x: `bytes2[${string}]`]: undefined; [x: `bytes3[${string}]`]: undefined; [x: `bytes4[${string}]`]: undefined; [x: `bytes5[${string}]`]: undefined; [x: `bytes6[${string}]`]: undefined; [x: `bytes7[${string}]`]: undefined; [x: `bytes8[${string}]`]: undefined; [x: `bytes9[${string}]`]: undefined; [x: `bytes10[${string}]`]: undefined; [x: `bytes11[${string}]`]: undefined; [x: `bytes12[${string}]`]: undefined; [x: `bytes13[${string}]`]: undefined; [x: `bytes14[${string}]`]: undefined; [x: `bytes15[${string}]`]: undefined; [x: `bytes16[${string}]`]: undefined; [x: `bytes17[${string}]`]: undefined; [x: `bytes18[${string}]`]: undefined; [x: `bytes19[${string}]`]: undefined; [x: `bytes20[${string}]`]: undefined; [x: `bytes21[${string}]`]: undefined; [x: `bytes22[${string}]`]: undefined; [x: `bytes23[${string}]`]: undefined; [x: `bytes24[${string}]`]: undefined; [x: `bytes25[${string}]`]: undefined; [x: `bytes26[${string}]`]: undefined; [x: `bytes27[${string}]`]: undefined; [x: `bytes28[${string}]`]: undefined; [x: `bytes29[${string}]`]: undefined; [x: `bytes30[${string}]`]: undefined; [x: `bytes31[${string}]`]: undefined; [x: `bytes32[${string}]`]: undefined; [x: `int[${string}]`]: undefined; [x: `int8[${string}]`]: undefined; [x: `int16[${string}]`]: undefined; [x: `int24[${string}]`]: undefined; [x: `int32[${string}]`]: undefined; [x: `int40[${string}]`]: undefined; [x: `int48[${string}]`]: undefined; [x: `int56[${string}]`]: undefined; [x: `int64[${string}]`]: undefined; [x: `int72[${string}]`]: undefined; [x: `int80[${string}]`]: undefined; [x: `int88[${string}]`]: undefined; [x: `int96[${string}]`]: undefined; [x: `int104[${string}]`]: undefined; [x: `int112[${string}]`]: undefined; [x: `int120[${string}]`]: undefined; [x: `int128[${string}]`]: undefined; [x: `int136[${string}]`]: undefined; [x: `int144[${string}]`]: undefined; [x: `int152[${string}]`]: undefined; [x: `int160[${string}]`]: undefined; [x: `int168[${string}]`]: undefined; [x: `int176[${string}]`]: undefined; [x: `int184[${string}]`]: undefined; [x: `int192[${string}]`]: undefined; [x: `int200[${string}]`]: undefined; [x: `int208[${string}]`]: undefined; [x: `int216[${string}]`]: undefined; [x: `int224[${string}]`]: undefined; [x: `int232[${string}]`]: undefined; [x: `int240[${string}]`]: undefined; [x: `int248[${string}]`]: undefined; [x: `int256[${string}]`]: undefined; [x: `uint[${string}]`]: undefined; [x: `uint8[${string}]`]: undefined; [x: `uint16[${string}]`]: undefined; [x: `uint24[${string}]`]: undefined; [x: `uint32[${string}]`]: undefined; [x: `uint40[${string}]`]: undefined; [x: `uint56[${string}]`]: undefined; [x: `uint64[${string}]`]: undefined; [x: `uint72[${string}]`]: undefined; [x: `uint80[${string}]`]: undefined; [x: `uint88[${string}]`]: undefined; [x: `uint96[${string}]`]: undefined; [x: `uint104[${string}]`]: undefined; [x: `uint112[${string}]`]: undefined; [x: `uint120[${string}]`]: undefined; [x: `uint136[${string}]`]: undefined; [x: `uint144[${string}]`]: undefined; [x: `uint152[${string}]`]: undefined; [x: `uint160[${string}]`]: undefined; [x: `uint168[${string}]`]: undefined; [x: `uint176[${string}]`]: undefined; [x: `uint184[${string}]`]: undefined; [x: `uint192[${string}]`]: undefined; [x: `uint200[${string}]`]: undefined; [x: `uint208[${string}]`]: undefined; [x: `uint216[${string}]`]: undefined; [x: `uint224[${string}]`]: undefined; [x: `uint232[${string}]`]: undefined; [x: `uint240[${string}]`]: undefined; [x: `uint248[${string}]`]: undefined; string?: undefined; address?: undefined; uint256?: undefined; bytes?: undefined; uint128?: undefined; uint48?: undefined; bool?: undefined; bytes1?: undefined; bytes2?: undefined; bytes3?: undefined; bytes4?: undefined; bytes5?: undefined; bytes6?: undefined; bytes7?: undefined; bytes8?: undefined; bytes9?: undefined; bytes10?: undefined; bytes11?: undefined; bytes12?: undefined; bytes13?: undefined; bytes14?: undefined; bytes15?: undefined; bytes16?: undefined; bytes17?: undefined; bytes18?: undefined; bytes19?: undefined; bytes20?: undefined; bytes21?: undefined; bytes22?: undefined; bytes23?: undefined; bytes24?: undefined; bytes25?: undefined; bytes26?: undefined; bytes27?: undefined; bytes28?: undefined; bytes29?: undefined; bytes30?: undefined; bytes31?: undefined; bytes32?: undefined; int8?: undefined; int16?: undefined; int24?: undefined; int32?: undefined; int40?: undefined; int48?: undefined; int56?: undefined; int64?: undefined; int72?: undefined; int80?: undefined; int88?: undefined; int96?: undefined; int104?: undefined; int112?: undefined; int120?: undefined; int128?: undefined; int136?: undefined; int144?: undefined; int152?: undefined; int160?: undefined; int168?: undefined; int176?: undefined; int184?: undefined; int192?: undefined; int200?: undefined; int208?: undefined; int216?: undefined; int224?: undefined; int232?: undefined; int240?: undefined; int248?: undefined; int256?: undefined; uint8?: undefined; uint16?: undefined; uint24?: undefined; uint32?: undefined; uint40?: undefined; uint56?: undefined; uint64?: undefined; uint72?: undefined; uint80?: undefined; uint88?: undefined; uint96?: undefined; uint104?: undefined; uint112?: undefined; uint120?: undefined; uint136?: undefined; uint144?: undefined; uint152?: undefined; uint160?: undefined; uint168?: undefined; uint176?: undefined; uint184?: undefined; uint192?: undefined; uint200?: undefined; uint208?: undefined; uint216?: undefined; uint224?: undefined; uint232?: undefined; uint240?: undefined; uint248?: undefined; }, TPrimaryType extends "EIP712Domain" | keyof TTypedData = keyof TTypedData>(typedData: TypedDataDefinition<TTypedData, TPrimaryType, TTypedData extends { [x: string]: readonly viem.TypedDataParameter[]; [x: `string[${string}]`]: undefined; [x: `function[${string}]`]: undefined; [x: `address[${string}]`]: undefined; [x: `uint256[${string}]`]: undefined; [x: `bytes[${string}]`]: undefined; [x: `uint128[${string}]`]: undefined; [x: `uint48[${string}]`]: undefined; [x: `bool[${string}]`]: undefined; [x: `bytes1[${string}]`]: undefined; [x: `bytes2[${string}]`]: undefined; [x: `bytes3[${string}]`]: undefined; [x: `bytes4[${string}]`]: undefined; [x: `bytes5[${string}]`]: undefined; [x: `bytes6[${string}]`]: undefined; [x: `bytes7[${string}]`]: undefined; [x: `bytes8[${string}]`]: undefined; [x: `bytes9[${string}]`]: undefined; [x: `bytes10[${string}]`]: undefined; [x: `bytes11[${string}]`]: undefined; [x: `bytes12[${string}]`]: undefined; [x: `bytes13[${string}]`]: undefined; [x: `bytes14[${string}]`]: undefined; [x: `bytes15[${string}]`]: undefined; [x: `bytes16[${string}]`]: undefined; [x: `bytes17[${string}]`]: undefined; [x: `bytes18[${string}]`]: undefined; [x: `bytes19[${string}]`]: undefined; [x: `bytes20[${string}]`]: undefined; [x: `bytes21[${string}]`]: undefined; [x: `bytes22[${string}]`]: undefined; [x: `bytes23[${string}]`]: undefined; [x: `bytes24[${string}]`]: undefined; [x: `bytes25[${string}]`]: undefined; [x: `bytes26[${string}]`]: undefined; [x: `bytes27[${string}]`]: undefined; [x: `bytes28[${string}]`]: undefined; [x: `bytes29[${string}]`]: undefined; [x: `bytes30[${string}]`]: undefined; [x: `bytes31[${string}]`]: undefined; [x: `bytes32[${string}]`]: undefined; [x: `int[${string}]`]: undefined; [x: `int8[${string}]`]: undefined; [x: `int16[${string}]`]: undefined; [x: `int24[${string}]`]: undefined; [x: `int32[${string}]`]: undefined; [x: `int40[${string}]`]: undefined; [x: `int48[${string}]`]: undefined; [x: `int56[${string}]`]: undefined; [x: `int64[${string}]`]: undefined; [x: `int72[${string}]`]: undefined; [x: `int80[${string}]`]: undefined; [x: `int88[${string}]`]: undefined; [x: `int96[${string}]`]: undefined; [x: `int104[${string}]`]: undefined; [x: `int112[${string}]`]: undefined; [x: `int120[${string}]`]: undefined; [x: `int128[${string}]`]: undefined; [x: `int136[${string}]`]: undefined; [x: `int144[${string}]`]: undefined; [x: `int152[${string}]`]: undefined; [x: `int160[${string}]`]: undefined; [x: `int168[${string}]`]: undefined; [x: `int176[${string}]`]: undefined; [x: `int184[${string}]`]: undefined; [x: `int192[${string}]`]: undefined; [x: `int200[${string}]`]: undefined; [x: `int208[${string}]`]: undefined; [x: `int216[${string}]`]: undefined; [x: `int224[${string}]`]: undefined; [x: `int232[${string}]`]: undefined; [x: `int240[${string}]`]: undefined; [x: `int248[${string}]`]: undefined; [x: `int256[${string}]`]: undefined; [x: `uint[${string}]`]: undefined; [x: `uint8[${string}]`]: undefined; [x: `uint16[${string}]`]: undefined; [x: `uint24[${string}]`]: undefined; [x: `uint32[${string}]`]: undefined; [x: `uint40[${string}]`]: undefined; [x: `uint56[${string}]`]: undefined; [x: `uint64[${string}]`]: undefined; [x: `uint72[${string}]`]: undefined; [x: `uint80[${string}]`]: undefined; [x: `uint88[${string}]`]: undefined; [x: `uint96[${string}]`]: undefined; [x: `uint104[${string}]`]: undefined; [x: `uint112[${string}]`]: undefined; [x: `uint120[${string}]`]: undefined; [x: `uint136[${string}]`]: undefined; [x: `uint144[${string}]`]: undefined; [x: `uint152[${string}]`]: undefined; [x: `uint160[${string}]`]: undefined; [x: `uint168[${string}]`]: undefined; [x: `uint176[${string}]`]: undefined; [x: `uint184[${string}]`]: undefined; [x: `uint192[${string}]`]: undefined; [x: `uint200[${string}]`]: undefined; [x: `uint208[${string}]`]: undefined; [x: `uint216[${string}]`]: undefined; [x: `uint224[${string}]`]: undefined; [x: `uint232[${string}]`]: undefined; [x: `uint240[${string}]`]: undefined; [x: `uint248[${string}]`]: undefined; string?: undefined; address?: undefined; uint256?: undefined; bytes?: undefined; uint128?: undefined; uint48?: undefined; bool?: undefined; bytes1?: undefined; bytes2?: undefined; bytes3?: undefined; bytes4?: undefined; bytes5?: undefined; bytes6?: undefined; bytes7?: undefined; bytes8?: undefined; bytes9?: undefined; bytes10?: undefined; bytes11?: undefined; bytes12?: undefined; bytes13?: undefined; bytes14?: undefined; bytes15?: undefined; bytes16?: undefined; bytes17?: undefined; bytes18?: undefined; bytes19?: undefined; bytes20?: undefined; bytes21?: undefined; bytes22?: undefined; bytes23?: undefined; bytes24?: undefined; bytes25?: undefined; bytes26?: undefined; bytes27?: undefined; bytes28?: undefined; bytes29?: undefined; bytes30?: undefined; bytes31?: undefined; bytes32?: undefined; int8?: undefined; int16?: undefined; int24?: undefined; int32?: undefined; int40?: undefined; int48?: undefined; int56?: undefined; int64?: undefined; int72?: undefined; int80?: undefined; int88?: undefined; int96?: undefined; int104?: undefined; int112?: undefined; int120?: undefined; int128?: undefined; int136?: undefined; int144?: undefined; int152?: undefined; int160?: undefined; int168?: undefined; int176?: undefined; int184?: undefined; int192?: undefined; int200?: undefined; int208?: undefined; int216?: undefined; int224?: undefined; int232?: undefined; int240?: undefined; int248?: undefined; int256?: undefined; uint8?: undefined; uint16?: undefined; uint24?: undefined; uint32?: undefined; uint40?: undefined; uint56?: undefined; uint64?: undefined; uint72?: undefined; uint80?: undefined; uint88?: undefined; uint96?: undefined; uint104?: undefined; uint112?: undefined; uint120?: undefined; uint136?: undefined; uint144?: undefined; uint152?: undefined; uint160?: undefined; uint168?: undefined; uint176?: undefined; uint184?: undefined; uint192?: undefined; uint200?: undefined; uint208?: undefined; uint216?: undefined; uint224?: undefined; uint232?: undefined; uint240?: undefined; uint248?: undefined; } ? keyof TTypedData : string>): Promise<`0x${string}`>; }>; type CallType = "call" | "delegatecall" | "batchcall"; type ExecutionMode<callType extends CallType> = { type: callType; revertOnError?: boolean; selector?: `0x${string}`; context?: `0x${string}`; }; /** * Wallet Errors **/ declare class WalletNotConnectedError extends Error { constructor(); } /** * Adaptor Errors **/ declare class FallbackAlreadySetError extends Error { constructor(); } /** * Safe Smart Account Errors **/ declare class SafeNotDeployedError extends Error { constructor(); } declare class SmartAccountAddressNotFoundError extends Error { constructor(); } declare class OwnerToRemoveIsNotSafeOwnerError extends Error { constructor(ownerToRemove: string); } declare class RemoveOwnerOnUndeployedSafeError extends Error { constructor(); } declare class MethodNotSupportedError extends BaseError { constructor(); } declare class BatchCallModeNotSupportedError extends Error { constructor(mode: ExecutionMode<CallType>); } declare class NoCallsToEncodeError extends Error { constructor(); } declare class InvalidCallDataError extends Error { constructor(); } declare class InvalidAccountAddressError extends Error { constructor(); } declare class InvalidSmartAccountClientError extends Error { constructor(); } /** * Signature Errors **/ declare class InvalidSignatureError extends Error { constructor(); } declare class CannotSignForAddressError extends Error { constructor(); } /** * Transactions Errors **/ declare class MissingToAddressError extends BaseError { constructor(); } /** * Utils Errors **/ declare class InvalidParamsError extends Error { constructor(message: string); } export { BatchCallModeNotSupportedError, CannotSignForAddressError, type ComethSafeSmartAccount, type ComethSmartAccountClient, ENTRYPOINT_ADDRESS_V07, FallbackAlreadySetError, InvalidAccountAddressError, InvalidCallDataError, InvalidParamsError, InvalidSignatureError, InvalidSmartAccountClientError, MethodNotSupportedError, MissingToAddressError, NoCallsToEncodeError, OwnerToRemoveIsNotSafeOwnerError, RemoveOwnerOnUndeployedSafeError, SafeNotDeployedError, type SafeSigner, SmartAccountAddressNotFoundError, type SmartAccountClient, WalletNotConnectedError, createComethPaymasterClient, createSafeSmartAccount, type createSafeSmartAccountParameters, createSmartAccountClient, providerToSmartAccountSigner };