UNPKG

@yfi/sdk

Version:

Interaction framework for the yearn protocol

43 lines (42 loc) 1.84 kB
import { ChainId } from "../chain"; import { ServiceInterface } from "../common"; import { Address, Integer, SimulationOptions, TransactionOutcome } from "../types"; export declare type DepositArgs = { from: Address; sellToken: Address; amount: Integer; toVault: Address; options: SimulationOptions; }; /** * [[SimulationInterface]] allows the simulation of ethereum transactions using Tenderly's api. * This allows us to know information before executing a transaction on mainnet. * For example it can simulate how much slippage is likely to be experienced when withdrawing from a vault, * or how many underlying tokens the user will receive upon withdrawing share tokens. */ export declare class SimulationInterface<T extends ChainId> extends ServiceInterface<T> { private simulationExecutor; deposit(from: Address, sellToken: Address, amount: Integer, toVault: Address, options?: SimulationOptions): Promise<TransactionOutcome>; private handleDirectSimulationDeposit; withdraw(from: Address, fromVault: Address, amount: Integer, toToken: Address, options?: SimulationOptions): Promise<TransactionOutcome>; private getWithdrawApprovalData; private directDeposit; private getEncodedInputData; private getActionableAddress; private depositNeedsApproving; private zapIn; private directWithdraw; private zapOut; private shouldUsePartnerService; private getZapperZapInApprovalData; private getZapperZapInSimulationArgs; private approve; private getApprovalData; private getVaultContract; private handleZapInSimulationDeposit; private isUnderlyingToken; private getZappableVault; private getZapProtocol; private getZapperZapOutSimulationArgs; private handleZapOutSimulation; }