Options
All
  • Public
  • Public/Protected
  • All
Menu

Class VaultInterface<T>

Type parameters

Hierarchy

  • ServiceInterface<T>
    • VaultInterface

Index

Constructors

Properties

cachedFetcherGet: CachedFetcher<Vault[]> = ...
cachedFetcherGetDynamic: CachedFetcher<VaultDynamic[]> = ...
cachedFetcherTokens: CachedFetcher<Token[]> = ...
chainId: 1 | 10 | 250 | 1337 | 42161
ctx: Context
events: Emittery<Record<string, unknown>, Record<string, unknown> & OmnipresentEventData, never>
yearn: Yearn<T>

Methods

  • approveDeposit(accountAddress: string, vaultAddress: string, tokenAddress: string, amount?: string, gasless?: boolean, overrides?: CallOverrides): Promise<TransactionResponse>
  • Approve the token amount to allow to be used for deposits

    Parameters

    • accountAddress: string
    • vaultAddress: string
    • tokenAddress: string
    • Optional amount: string
    • Optional gasless: boolean
    • Optional overrides: CallOverrides

    Returns Promise<TransactionResponse>

    TransactionResponse

  • approveWithdraw(accountAddress: string, vaultAddress: string, tokenAddress: string, amount?: string, gasless?: boolean, overrides?: CallOverrides): Promise<TransactionResponse>
  • Approve the token amount to allow to be used for withdraw

    Parameters

    • accountAddress: string
    • vaultAddress: string
    • tokenAddress: string
    • Optional amount: string
    • Optional gasless: boolean
    • Optional overrides: CallOverrides

    Returns Promise<TransactionResponse>

    TransactionResponse

  • balances(address: string, overrides?: CallOverrides): Promise<Balance[]>
  • Get all yearn vault's underlying token balances for a particular address.

    Parameters

    • address: string
    • Optional overrides: CallOverrides

    Returns Promise<Balance[]>

  • deposit(vault: string, token: string, amount: string, account: string, options?: ZapOptions, overrides?: CallOverrides): Promise<TransactionResponse>
  • Deposit into a yearn vault

    Parameters

    • vault: string
    • token: string
    • amount: string
    • account: string
    • options: ZapOptions = {}
    • overrides: CallOverrides = {}

    Returns Promise<TransactionResponse>

    transaction

  • gaslessDeposit(__namedParameters: { accountAddress: string; feeAmount: string; tokenAddress: string; tokenAmount: string; vaultAddress: string; vaultAmount: string }): Promise<string>
  • Gasless Deposit into a yearn vault

    Parameters

    • __namedParameters: { accountAddress: string; feeAmount: string; tokenAddress: string; tokenAmount: string; vaultAddress: string; vaultAmount: string }
      • accountAddress: string
      • feeAmount: string
      • tokenAddress: string
      • tokenAmount: string
      • vaultAddress: string
      • vaultAmount: string

    Returns Promise<string>

    orderId

  • gaslessWithdraw(__namedParameters: { accountAddress: string; feeAmount: string; tokenAddress: string; tokenAmount: string; vaultAddress: string; vaultAmount: string }): Promise<string>
  • Gasless Withdraw into a yearn vault

    Parameters

    • __namedParameters: { accountAddress: string; feeAmount: string; tokenAddress: string; tokenAmount: string; vaultAddress: string; vaultAmount: string }
      • accountAddress: string
      • feeAmount: string
      • tokenAddress: string
      • tokenAmount: string
      • vaultAddress: string
      • vaultAmount: string

    Returns Promise<string>

    orderId

  • get(addresses?: string[], overrides?: CallOverrides): Promise<Vault[]>
  • Get all yearn vaults.

    Parameters

    • Optional addresses: string[]

      filter, if not provided all positions are returned

    • Optional overrides: CallOverrides

    Returns Promise<Vault[]>

  • getDepositAllowance(accountAddress: string, vaultAddress: string, tokenAddress: string, gasless?: boolean): Promise<TokenAllowance>
  • Fetch the token amount that has been allowed to be used for deposits

    Parameters

    • accountAddress: string
    • vaultAddress: string
    • tokenAddress: string
    • Optional gasless: boolean

    Returns Promise<TokenAllowance>

    TokenAllowance

  • getDepositContractAddress(vaultAddress: string, tokenAddress: string, gasless?: boolean): Promise<string>
  • Parameters

    • vaultAddress: string
    • tokenAddress: string
    • Optional gasless: boolean

    Returns Promise<string>

  • getExpectedTransactionOutcome(__namedParameters: { accountAddress: string; gasless?: boolean; slippageTolerance?: number; sourceTokenAddress: string; sourceTokenAmount: string; targetTokenAddress: string; transactionType: "DEPOSIT" | "WITHDRAW" }): Promise<TransactionOutcome>
  • Get the expected outcome of a transaction

    Parameters

    • __namedParameters: { accountAddress: string; gasless?: boolean; slippageTolerance?: number; sourceTokenAddress: string; sourceTokenAmount: string; targetTokenAddress: string; transactionType: "DEPOSIT" | "WITHDRAW" }
      • accountAddress: string
      • Optional gasless?: boolean
      • Optional slippageTolerance?: number
      • sourceTokenAddress: string
      • sourceTokenAmount: string
      • targetTokenAddress: string
      • transactionType: "DEPOSIT" | "WITHDRAW"

    Returns Promise<TransactionOutcome>

    TransactionOutcome

  • getInfo(vaultAddress: string): Promise<VaultInfo>
  • Fetches information a vault in a single call

    Parameters

    • vaultAddress: string

      the vault to query's address

    Returns Promise<VaultInfo>

    a VaultInfo object which includes various information about a vault, for example, its name and total assets

  • getStatic(addresses?: string[], overrides?: CallOverrides): Promise<VaultStatic[]>
  • Get static part of yearn vaults.

    Parameters

    • Optional addresses: string[]

      filter, if not provided all positions are returned

    • Optional overrides: CallOverrides

    Returns Promise<VaultStatic[]>

  • getWithdrawAllowance(accountAddress: string, vaultAddress: string, tokenAddress: string, gasless?: boolean): Promise<TokenAllowance>
  • Fetch the token amount that has been allowed to be used for withdraw

    Parameters

    • accountAddress: string
    • vaultAddress: string
    • tokenAddress: string
    • Optional gasless: boolean

    Returns Promise<TokenAllowance>

    TokenAllowance

  • getWithdrawContractAddress(vaultAddress: string, tokenAddress: string, gasless?: boolean): Promise<string>
  • Parameters

    • vaultAddress: string
    • tokenAddress: string
    • Optional gasless: boolean

    Returns Promise<string>

  • isUnderlyingToken(vaultAddress: string, tokenAddress: string): Promise<boolean>
  • isZappingIntoPickleJar(__namedParameters: { vault: string }): boolean
  • makeEmptyApy(): Apy
  • Get the Vault User Metadata for a particular address.

    Parameters

    • address: string
    • Optional addresses: string[]

      filter, if provided only those addresses' Vault User Metadata are returned

    Returns Promise<VaultUserMetadata[]>

  • populateApproveDeposit(accountAddress: string, vaultAddress: string, tokenAddress: string, amount?: string, gasless?: boolean, overrides?: CallOverrides): Promise<PopulatedTransaction>
  • Parameters

    • accountAddress: string
    • vaultAddress: string
    • tokenAddress: string
    • Optional amount: string
    • Optional gasless: boolean
    • Optional overrides: CallOverrides

    Returns Promise<PopulatedTransaction>

  • populateApproveWithdraw(accountAddress: string, vaultAddress: string, tokenAddress: string, amount?: string, gasless?: boolean, overrides?: CallOverrides): Promise<PopulatedTransaction>
  • Parameters

    • accountAddress: string
    • vaultAddress: string
    • tokenAddress: string
    • Optional amount: string
    • Optional gasless: boolean
    • Optional overrides: CallOverrides

    Returns Promise<PopulatedTransaction>

  • populateDepositTransaction(__namedParameters: { account: string; amount: string; options: ZapOptions; overrides: CallOverrides; token: string; vault: string }): Promise<TransactionRequest>
  • Parameters

    • __namedParameters: { account: string; amount: string; options: ZapOptions; overrides: CallOverrides; token: string; vault: string }
      • account: string
      • amount: string
      • options: ZapOptions
      • overrides: CallOverrides
      • token: string
      • vault: string

    Returns Promise<TransactionRequest>

  • populateWithdrawTransaction(__namedParameters: { account: string; amount: string; options: WithdrawOptions; overrides: CallOverrides; token: string; vault: string }): Promise<TransactionRequest>
  • Parameters

    • __namedParameters: { account: string; amount: string; options: WithdrawOptions; overrides: CallOverrides; token: string; vault: string }
      • account: string
      • amount: string
      • options: WithdrawOptions
      • overrides: CallOverrides
      • token: string
      • vault: string

    Returns Promise<TransactionRequest>

  • positionsOf(address: string, addresses?: string[], overrides?: CallOverrides): Promise<Position[]>
  • Get yearn vault positions for a particular address.

    Parameters

    • address: string
    • Optional addresses: string[]

      filter, if not provided all positions are returned

    • Optional overrides: CallOverrides

    Returns Promise<Position[]>

  • shouldUsePartnerService(vault: string): boolean
  • tokens(overrides?: CallOverrides): Promise<Token[]>
  • withdraw(vault: string, token: string, amount: string, account: string, options?: WithdrawOptions, overrides?: CallOverrides): Promise<TransactionResponse>
  • Withdraw from a yearn vault.

    Parameters

    • vault: string
    • token: string
    • amount: string
    • account: string
    • options: WithdrawOptions = {}
    • overrides: CallOverrides = {}

    Returns Promise<TransactionResponse>

    transaction

  • zapIn(vault: string, token: string, amount: string, account: string, options?: ZapOptions, _zapProtocol?: ZapProtocol, _overrides?: CallOverrides): Promise<TransactionRequest>

Generated using TypeDoc