UNPKG

@uniswap/smart-wallet-sdk

Version:

⚒️ An SDK for building applications with smart wallets on Uniswap

44 lines (43 loc) 2 kB
import { ChainId } from '@uniswap/sdk-core'; import { ModeType } from './constants'; import { Call, MethodParameters, ExecuteOptions } from './types'; /** * Main SDK class for interacting with Uniswap smart wallet contracts */ export declare class SmartWallet { /** * Creates method parameters for a UserOperation to be executed through a smart wallet * @dev Compatible with EntryPoint versions v0.7.0 and v0.8.0 (not v0.6.0) * * @param calls Array of calls to encode * @param options Basic options for the execution * @returns Method parameters with userOp calldata and value */ static encodeUserOp(calls: Call[], options?: ExecuteOptions): MethodParameters; /** * Creates method parameters for executing a simple batch of calls through a smart wallet * @param calls Array of calls to encode * @param options Basic options for the execution * @returns Method parameters with calldata and value */ static encodeBatchedCall(calls: Call[], options?: ExecuteOptions): MethodParameters; /** * ERC7821 compatible entrypoint for executing batched calls through the contract * @deprecated use encodeBatchedCall instead unless you need to use the ERC7821 entrypoint */ static encodeERC7821BatchedCall(calls: Call[], options?: ExecuteOptions): MethodParameters; /** * Creates a call to execute a method through a smart wallet * @dev can be refactored to return a Transaction object as well * @param methodParameters The method parameters to execute * @param chainId The chain ID for the smart wallet * @returns The call to execute */ static createExecute(methodParameters: MethodParameters, chainId: ChainId): Call; /** * Get the mode type from the options */ static getModeFromOptions(options: ExecuteOptions): ModeType; /** Internal methods */ protected static _encodeERC7821Execute(mode: ModeType, data: `0x${string}`): `0x${string}`; }