Skip to main content

YieldFarmSynthetix

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

Class: YieldFarmSynthetix

A class to represent a depositable position

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new YieldFarmSynthetix(__namedParameters, signer?, walletAddress?)

Parameters

NameType
__namedParametersYieldFarmInstantionInfo
signer?Signer
walletAddress?string

Inherited from

YieldFarm.constructor

Defined in

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

Properties

_signer

Protected Optional _signer: Signer

Inherited from

YieldFarm._signer

Defined in

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


_walletAddress

Protected Optional _walletAddress: string

Inherited from

YieldFarm._walletAddress

Defined in

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


getDepositAddress

Protected getDepositAddress: () => string

Type declaration

▸ (): string

Returns

string

Overrides

YieldFarm.getDepositAddress

Defined in

packages/sdk-core/src/Earn/YieldFarmSynthetix.ts:10

Accessors

apr

get apr(): undefined | number

Returns

undefined | number

Inherited from

YieldFarm.apr

Defined in

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


chainId

get chainId(): ChainId

Returns

ChainId

Inherited from

YieldFarm.chainId

Defined in

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


depositToken

get depositToken(): Token

Returns

Token

Inherited from

YieldFarm.depositToken

Defined in

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


depositValueInLocalCurrency

get depositValueInLocalCurrency(): undefined | number

Returns

undefined | number

Inherited from

YieldFarm.depositValueInLocalCurrency

Defined in

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


id

get id(): number

Returns

number

Inherited from

YieldFarm.id

Defined in

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


name

get name(): undefined | string

Returns

undefined | string

Inherited from

YieldFarm.name

Defined in

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


protocol

get protocol(): string

Returns

string

Inherited from

YieldFarm.protocol

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

YieldFarm.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

YieldFarm.signer

Defined in

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


totalDeposited

get totalDeposited(): TokenAmount

Returns

TokenAmount

Inherited from

YieldFarm.totalDeposited

Defined in

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


tvl

get tvl(): undefined | number

Returns

undefined | number

Inherited from

YieldFarm.tvl

Defined in

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


type

get type(): YieldFarmType

Returns

YieldFarmType

Inherited from

YieldFarm.type

Defined in

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


underlyingTokens

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

Returns

undefined | string[] | Token[]

Inherited from

YieldFarm.underlyingTokens

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

YieldFarm.walletAddress

Defined in

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


walletDeposited

get walletDeposited(): undefined | TokenAmount

Returns

undefined | TokenAmount

Inherited from

YieldFarm.walletDeposited

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 }[]

Inherited from

YieldFarm.additionalTransactionsForDeposit

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

YieldFarm.balanceOfMulticall

Defined in

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


canDirectlySwap

canDirectlySwap(): boolean

Returns

boolean

Inherited from

YieldFarm.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

YieldFarm.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

YieldFarm.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 }>

Inherited from

YieldFarm.fetchClaimableTokens

Defined in

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


formatDepositUrl

formatDepositUrl(): string

Returns

string

Inherited from

YieldFarm.formatDepositUrl

Defined in

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


formatExecuteDeposit

formatExecuteDeposit(txn): TransactionStep

Parameters

NameType
txnTransactionRequest

Returns

TransactionStep

Overrides

YieldFarm.formatExecuteDeposit

Defined in

packages/sdk-core/src/Earn/YieldFarmSynthetix.ts:13


formatExecuteWithdrawal

formatExecuteWithdrawal(txn, inputAmount): TransactionStep

Parameters

NameType
txnTransactionRequest
inputAmountJSBI

Returns

TransactionStep

Overrides

YieldFarm.formatExecuteWithdrawal

Defined in

packages/sdk-core/src/Earn/YieldFarmSynthetix.ts:54


formatWithdrawUrl

formatWithdrawUrl(): string

Returns

string

Inherited from

YieldFarm.formatWithdrawUrl

Defined in

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


toJSON

toJSON(): YieldFarmApiFullResponse

Returns

YieldFarmApiFullResponse

A JSON representation of the depositable position

Inherited from

YieldFarm.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

YieldFarm.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

Inherited from

YieldFarm.parseJson

Defined in

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