UNPKG

@privy-io/js-sdk-core

Version:

Vanilla JS client for the Privy Auth API

30 lines 1.71 kB
import { SmartWalletType } from "@privy-io/api-types"; import { SendUserOperationParameters, SmartAccount } from "viem/account-abstraction"; import { Chain, EIP1193Provider, Hash, Hex, HttpTransport, PublicClient, SendTransactionParameters, SignMessageParameters, SignTypedDataParameters, Transport, TypedData } from "viem"; import { SmartAccountClient } from "permissionless"; //#region src/smart-wallets.d.ts type SmartWalletType$1 = SmartWalletType | 'nexus'; type Call = { readonly to?: any; readonly value?: any; readonly data?: any; }; declare const signerToSmartAccountClient: <chain extends Chain>({ owner, smartWalletType, smartWalletVersion, chain, publicClient, bundlerUrl, paymasterUrl, paymasterContext }: { owner: EIP1193Provider; smartWalletType: SmartWalletType$1; smartWalletVersion?: string; chain: chain; publicClient: PublicClient; bundlerUrl: string; paymasterUrl?: string; paymasterContext?: Record<string, any>; }) => Promise<SmartAccountClient<HttpTransport, chain>>; type SmartWalletClientType = Omit<SmartAccountClient<Transport, Chain, SmartAccount>, 'sendTransaction' | 'signMessage' | 'signTypedData'> & { sendTransaction: (args: Omit<SendTransactionParameters<Chain, SmartAccount>, 'kzg'> | SendUserOperationParameters<SmartAccount, undefined, Call[]>) => Promise<Hash>; signMessage: (args: Omit<SignMessageParameters, 'account'>) => Promise<Hex>; signTypedData: <const TTypedData extends TypedData | { [key: string]: unknown; }, TPrimaryType extends string>(args: Omit<SignTypedDataParameters<TTypedData, TPrimaryType, SmartAccount>, 'account'>) => Promise<Hex>; }; //#endregion export { Call, SmartWalletClientType, signerToSmartAccountClient };