Options
All
  • Public
  • Public/Protected
  • All
Menu

@yfi/sdk

Welcome to the Yearn SDK documentation.

Yearn namespace

Yearn is a wrapper for all the services and interfaces of the SDK.

Interfaces

Services

SDK is divided in services representing the different data sources for yearn products and the access method used to read / write from them.

  • LensService: provides access to yearn's assets and user position.

-→ RegistryV2Adapter: adapter of V2 vaults.

Peer dependencies

SDK requires several dependencies from the ethers.js project.

Index

Enumerations

Classes

Interfaces

Type aliases

Functions

Type aliases

Address: string

Type alias for an address type.

Addressable: { address: Address }

Type for anything that has an address property.

Type declaration

AliasMap<T>: TypedMap<T, Alias>

Type parameters

ApyMap<T>: TypedMap<T, Apy | undefined>

Type parameters

Asset<T>: AssetStatic<T> & AssetDynamic<T> & { typeId: T }

Union of both AssetStatic and AssetDynamic parts.

dev

{ typeId: T } is included in the union to make Metadata[T] work.

Type parameters

BalancesMap<T>: TypedMap<T, Balance[]>

Type parameters

ChainId: keyof typeof Chains
DepositOptions: ZapOptions
Gauge: Asset<"GAUGE">
GaugeDynamic: AssetDynamic<"GAUGE">
GaugeStatic: AssetStatic<"GAUGE">
GenericAsset: Asset<"VAULT_V1"> | Asset<"VAULT_V2"> | Asset<"VOTING_ESCROW"> | Asset<"GAUGE">

Possible assets that lens can return.

Icon: string | undefined

An URL pointing to an image/png file.

IconMap<T>: TypedMap<T, Icon>

Type parameters

Integer: string

Type alias for a stringified big number. SDK tries to be bignumber-lib agnostic so integer values are returned as strings.

Locale: "de" | "el" | "en" | "es" | "fr" | "hi" | "id" | "ja" | "pt" | "ru" | "tr" | "vi" | "zh"

Accepted locales.

Localization: Partial<Record<Locale, LocalizedProperties>>
Metadata: { GAUGE: GaugeMetadata; VAULT_V1: VaultMetadata; VAULT_V2: VaultMetadata; VOTING_ESCROW: VotingEscrowMetadata }

Key Value representation of metadata names and types. Used mainly to provide correct type-guards for asset types.

Type declaration

Milliseconds: number
Seconds: number

Time aliases

TokenDataSource: "vaults" | "zapper" | "portals" | "labs" | "sdk" | "votingEscrows" | "gauges"
TypeId: keyof Metadata

Union type of all the existing Metadata types.

TypedMap<K, V>: { [ key in K]: V }

Utility type to describe a map of predefined keys with the same value.

Type parameters

  • K: string | number | symbol

  • V

Unit: string

Utility type to help distinguish Integers that represents an already normalized value with the corresponding decimals from their Integer form.

Usdc: string

Utility type to help distinguish Integers that represent a USDC (6 dec) value.

Vault: VaultV1 | VaultV2
VaultV1: Asset<"VAULT_V1">
VaultV1Dynamic: AssetDynamic<"VAULT_V1">
VaultV1Static: AssetStatic<"VAULT_V1">
VaultV2: Asset<"VAULT_V2">
VaultV2Dynamic: AssetDynamic<"VAULT_V2">
VaultV2Static: AssetStatic<"VAULT_V2">
VotingEscrow: Asset<"VOTING_ESCROW">
VotingEscrowDynamic: AssetDynamic<"VOTING_ESCROW">
VotingEscrowStatic: AssetStatic<"VOTING_ESCROW">
VotingEscrowTransactionType: "LOCK" | "ADD" | "EXTEND"
Weeks: number
WriteTransactionResult<P>: Promise<P extends WillPopulate ? PopulatedTransaction : TransactionResponse>

Result to use on transactions with write contract functionality

Type parameters

  • P

ZapInWith: keyof Token["supported"]
ZapOutWith: keyof Token["supported"]
ZappableVault: { address: Address; decimals: Integer; metadata: { pricePerShare: Integer; zapInWith?: string; zapOutWith?: string }; token: Address } & PartialDeep<Vault>

Functions

  • getZapInDetails(__namedParameters: ZapInArgs): ZapInDetails
  • Parameters

    • __namedParameters: ZapInArgs

    Returns ZapInDetails

  • getZapOutDetails(__namedParameters: ZapOutArgs): ZapOutDetails
  • Parameters

    • __namedParameters: ZapOutArgs

    Returns ZapOutDetails

Generated using TypeDoc