UNPKG

@charterlabs/permissionless

Version:

A utility library for working with ERC-4337

26 lines 1.58 kB
import { type Account, type Address, type Assign, type Chain, type Client, type LocalAccount, type OneOf, type Transport, type WalletClient } from "viem"; import { type SmartAccount, type SmartAccountImplementation, entryPoint06Abi, entryPoint07Abi } from "viem/account-abstraction"; import { type EthereumProvider } from "../../utils/toOwner"; export type ToSimpleSmartAccountParameters<entryPointVersion extends "0.6" | "0.7"> = { client: Client; owner: OneOf<EthereumProvider | WalletClient<Transport, Chain | undefined, Account> | LocalAccount>; factoryAddress?: Address; entryPoint?: { address: Address; version: entryPointVersion; }; index?: bigint; address?: Address; nonceKey?: bigint; }; export type SimpleSmartAccountImplementation<entryPointVersion extends "0.6" | "0.7" = "0.7"> = Assign<SmartAccountImplementation<entryPointVersion extends "0.6" ? typeof entryPoint06Abi : typeof entryPoint07Abi, entryPointVersion>, { sign: NonNullable<SmartAccountImplementation["sign"]>; }>; export type ToSimpleSmartAccountReturnType<entryPointVersion extends "0.6" | "0.7" = "0.7"> = SmartAccount<SimpleSmartAccountImplementation<entryPointVersion>>; /** * @description Creates an Simple Account from a private key. * * @returns A Private Key Simple Account. */ export declare function toSimpleSmartAccount<entryPointVersion extends "0.6" | "0.7">(parameters: ToSimpleSmartAccountParameters<entryPointVersion>): Promise<ToSimpleSmartAccountReturnType<entryPointVersion>>; //# sourceMappingURL=toSimpleSmartAccount.d.ts.map