@bombearn/sdk
Version:
Interaction framework for the yearn protocol
49 lines (48 loc) • 2.36 kB
TypeScript
import { CallOverrides } from "@ethersproject/contracts";
import { ChainId } from "../chain";
import { ServiceInterface } from "../common";
import { Address, DepositOptions, 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>;
_deposit(vault: Address, token: Address, amount: Integer, account: Address, options?: DepositOptions, overrides?: CallOverrides): Promise<TransactionOutcome>;
private parseDepositSimulationOutcome;
private parseSimulationTargetTokenAmount;
withdraw(from: Address, fromVault: Address, amount: Integer, toToken: Address, options?: SimulationOptions): Promise<TransactionOutcome>;
_withdraw(vault: Address, token: Address, amount: Integer, account: Address, options?: DepositOptions, overrides?: CallOverrides): Promise<TransactionOutcome>;
private parseWithdrawSimulationOutcome;
private handleDirectSimulationDeposit;
private directDeposit;
private getEncodedInputData;
private getActionableAddress;
private depositNeedsApproving;
private zapIn;
private getWithdrawApprovalData;
private directWithdraw;
private zapOut;
private shouldUsePartnerService;
private getZapInApprovalData;
private getZapInSimulationArgs;
private approve;
private getApprovalData;
private getVaultContract;
private handleZapInSimulationDeposit;
private isUnderlyingToken;
private getZappableVault;
private getZapProtocol;
private getZapOutSimulationArgs;
private handleZapOutSimulation;
}