Skip to main content

YieldFarm

@node-fi/sdk-core / Exports / YieldFarm

Class: YieldFarm

A class to represent a depositable position

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new YieldFarm(__namedParameters, signer?, walletAddress?)

Parameters

NameType
__namedParametersYieldFarmInstantionInfo
signer?Signer
walletAddress?string

Overrides

DepositablePosition.constructor

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:69

Properties

_apr

Private Optional _apr: number

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:62


_chainId

Private _chainId: ChainId

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:59


_farmType

Private _farmType: YieldFarmType

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:57


_id

Private _id: number

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:58


_name

Private Optional _name: string

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:67


_protocol

Private _protocol: string

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:60


_signer

Protected Optional _signer: Signer

Inherited from

DepositablePosition._signer

Defined in

packages/sdk-core/src/Earn/DepositablePosition.ts:103


_totalDeposited

Private _totalDeposited: TokenAmount

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:65


_tvl

Private Optional _tvl: number

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:63


_underlying

Private Optional _underlying: string[] | Token[]

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:61


_valueOfDeposit

Private Optional _valueOfDeposit: number

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:64


_walletAddress

Protected Optional _walletAddress: string

Inherited from

DepositablePosition._walletAddress

Defined in

packages/sdk-core/src/Earn/DepositablePosition.ts:104


_walletDeposited

Private Optional _walletDeposited: TokenAmount

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:66

Accessors

apr

get apr(): undefined | number

Returns

undefined | number

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:104


chainId

get chainId(): ChainId

Returns

ChainId

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:116


depositToken

get depositToken(): Token

Returns

Token

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:120


depositValueInLocalCurrency

get depositValueInLocalCurrency(): undefined | number

Returns

undefined | number

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:136


id

get id(): number

Returns

number

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:112


name

get name(): undefined | string

Returns

undefined | string

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:100


protocol

get protocol(): string

Returns

string

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:140


receiptToken

get receiptToken(): Token

The token that is received when depositing into this position

Returns

Token

Inherited from

DepositablePosition.receiptToken

Defined in

packages/sdk-core/src/Earn/DepositablePosition.ts:110


signer

get signer(): undefined | Signer

The signer used to sign transactions

Returns

undefined | Signer

Inherited from

DepositablePosition.signer

Defined in

packages/sdk-core/src/Earn/DepositablePosition.ts:117


totalDeposited

get totalDeposited(): TokenAmount

Returns

TokenAmount

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:132


tvl

get tvl(): undefined | number

Returns

undefined | number

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:124


type

get type(): YieldFarmType

Returns

YieldFarmType

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:108


underlyingTokens

get underlyingTokens(): undefined | string[] | Token[]

Returns

undefined | string[] | Token[]

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:144


walletAddress

get walletAddress(): undefined | string

The address of the wallet that is connected to the signer

Returns

undefined | string

Inherited from

DepositablePosition.walletAddress

Defined in

packages/sdk-core/src/Earn/DepositablePosition.ts:124


walletDeposited

get walletDeposited(): undefined | TokenAmount

Returns

undefined | TokenAmount

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:128

Methods

additionalTransactionsForDeposit

additionalTransactionsForDeposit(_): { data: string ; gas: string ; to: string }[]

Parameters

NameType
_DepositTransactionDetails

Returns

{ data: string ; gas: string ; to: string }[]

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:196


balanceOfMulticall

balanceOfMulticall(owner): Readonly<{ call: Readonly<CallStruct> ; parseReturn: (returnData: string) => JSBI }>

Parameters

NameTypeDescription
ownerstringThe wallet address to check the balance of

Returns

Readonly<{ call: Readonly<CallStruct> ; parseReturn: (returnData: string) => JSBI }>

Multicall payload that can be executed to get the balance of the owner

Inherited from

DepositablePosition.balanceOfMulticall

Defined in

packages/sdk-core/src/Earn/DepositablePosition.ts:154


canDirectlySwap

canDirectlySwap(): boolean

Returns

boolean

Overrides

DepositablePosition.canDirectlySwap

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:192


connect

connect(signer?, walletAddress?): void

Description

Connects the depositable position to a signer and wallet address

Parameters

NameTypeDescription
signer?SignerEthersjs signer
walletAddress?stringWallet address

Returns

void

Inherited from

DepositablePosition.connect

Defined in

packages/sdk-core/src/Earn/DepositablePosition.ts:144


deposit

deposit(inputToken, inputAmount, opts?): Promise<{ approvalTarget?: string ; execute?: TransactionStep ; expectedOutput: TokenAmount ; minimumOutput: TokenAmount ; transaction?: TransactionRequest }>

Parameters

NameTypeDescription
inputTokenstringToken to trade to the depositable position
inputAmountBigintIshAmount of input token to trade
opts?Partial<MinimaOptions>Optional parameters for minima

Returns

Promise<{ approvalTarget?: string ; execute?: TransactionStep ; expectedOutput: TokenAmount ; minimumOutput: TokenAmount ; transaction?: TransactionRequest }>

The expected output amount, minimum output amount, transaction to execute, approval target, and execute function

Inherited from

DepositablePosition.deposit

Defined in

packages/sdk-core/src/Earn/DepositablePosition.ts:190


fetchClaimableTokens

fetchClaimableTokens(includeTransaction?, addressOverride?): Promise<{ amount: number[] ; token: string[] ; transaction?: { data: string ; to: string } ; valueInLocalCurrency: number } | { amount: number[] ; execute: TransactionStep ; token: string[] ; transaction?: { data: string ; to: string } ; valueInLocalCurrency: number }>

Parameters

NameType
includeTransaction?boolean
addressOverride?string

Returns

Promise<{ amount: number[] ; token: string[] ; transaction?: { data: string ; to: string } ; valueInLocalCurrency: number } | { amount: number[] ; execute: TransactionStep ; token: string[] ; transaction?: { data: string ; to: string } ; valueInLocalCurrency: number }>

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:148


formatDepositUrl

formatDepositUrl(): string

Returns

string

Overrides

DepositablePosition.formatDepositUrl

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:189


formatExecuteDeposit

formatExecuteDeposit(txn, _inputToken, _inputAmount): TransactionStep

Parameters

NameType
txnTransactionRequest
_inputTokenstring
_inputAmountJSBI

Returns

TransactionStep

Inherited from

DepositablePosition.formatExecuteDeposit

Defined in

packages/sdk-core/src/Earn/DepositablePosition.ts:163


formatExecuteWithdrawal

formatExecuteWithdrawal(txn, _inputAmount): Object

Parameters

NameType
txnTransactionRequest
_inputAmountJSBI

Returns

Object

NameType
descriptionstring
execute(signer: undefined | Signer) => Promise<TransactionResponse>
transactionTransactionRequest

Inherited from

DepositablePosition.formatExecuteWithdrawal

Defined in

packages/sdk-core/src/Earn/DepositablePosition.ts:175


formatWithdrawUrl

formatWithdrawUrl(): string

Returns

string

Overrides

DepositablePosition.formatWithdrawUrl

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:190


getDepositAddress

Protected getDepositAddress(): string

Returns

string

Inherited from

DepositablePosition.getDepositAddress

Defined in

packages/sdk-core/src/Earn/DepositablePosition.ts:161


toJSON

toJSON(): YieldFarmApiFullResponse

Returns

YieldFarmApiFullResponse

A JSON representation of the depositable position

Overrides

DepositablePosition.toJSON

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:204


withdraw

withdraw(amount, destinationToken, opts?): Promise<{ approvalTarget?: string ; execute?: TransactionStep ; expectedOutput: JSBI | TokenAmount ; minimumOutput: JSBI | TokenAmount ; paths: string[] ; transaction?: TransactionRequest }>

Parameters

NameTypeDescription
amountBigNumberish | TokenAmountAmount of depositable position to withdraw
destinationTokenstring | TokenToken to trade to
opts?Partial<MinimaOptions>Optional parameters for minima

Returns

Promise<{ approvalTarget?: string ; execute?: TransactionStep ; expectedOutput: JSBI | TokenAmount ; minimumOutput: JSBI | TokenAmount ; paths: string[] ; transaction?: TransactionRequest }>

The expected output amount, minimum output amount, transaction to execute, approval target, and execute function

Inherited from

DepositablePosition.withdraw

Defined in

packages/sdk-core/src/Earn/DepositablePosition.ts:237


parseJson

Static parseJson(__namedParameters, signer?, walletAddress?): YieldFarm

Parameters

NameType
__namedParametersYieldFarmApiFullResponse
signer?Signer
walletAddress?string

Returns

YieldFarm

Defined in

packages/sdk-core/src/Earn/YieldFarm.ts:225