UNPKG

ulysses-sdk

Version:

An sdk for interacting with the Ulysses contracts

47 lines (46 loc) 1.99 kB
import { Interface } from '@ethersproject/abi'; import { IMulticallCall, IPayableCall } from '../../types/encodingTypes'; import { IWithdrawERC20Params, IWithdrawNativeParams } from '../../types/virtualAccountTypes'; /** * Represents a virtual account and helps to interact with it. */ export declare abstract class VirtualAccount { static readonly INTERFACE: Interface; private constructor(); /** * Aggregate calls ensuring each call is successful * @param calls list of calls to aggregate */ static encodeMulticall(calls: IMulticallCall[]): string; /** * Aggregate calls with a msg value (gas value) ensuring each call is successful * @param calls list of payable calls to aggregate */ static encodePayableCall(calls: IPayableCall[]): string; /** * Aggregate calls ensuring each call is successful * @param calls list of calls to aggregate */ static encodeMulticallWithCompression(calls: IMulticallCall[]): string; /** * Aggregate calls with a msg value (gas value) ensuring each call is successful * @param calls list of payable calls to aggregate */ static encodePayableCallWithCompression(calls: IPayableCall[]): string; /** * Withdraws native tokens from the VirtualAccount * @param params number corresponding to amount of native tokens to withdraw */ static encodeWithdrawNative(params: IWithdrawNativeParams): string; /** * Withdraws ERC20 tokens from the VirtualAccount * @param params IWithdrawERC20Params{ token: string, amount: number } - token address and amonunt to withdraw. */ static encodeWithdrawERC20(params: IWithdrawERC20Params): string; /** * Withdraws ERC721 tokens from the VirtualAccount * @param token token address to withdraw * @param tokenId tokenId to withdraw */ static encodeWithdrawERC721(token: string, tokenId: number): string; }