Skip to main content

LendingMarket

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

Class: LendingMarket

A class to represent a depositable position

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new LendingMarket(__namedParameters, signer?, walletAddress?)

Parameters

NameType
__namedParametersLendingMarketInstantionInfo
signer?Signer
walletAddress?string

Overrides

DepositablePosition.constructor

Defined in

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

Properties

_apy

Private Optional _apy: number

Defined in

packages/sdk-core/src/Earn/LendingMarket.ts:48


_chainId

Private _chainId: ChainId

Defined in

packages/sdk-core/src/Earn/LendingMarket.ts:46


_id

Private _id: number

Defined in

packages/sdk-core/src/Earn/LendingMarket.ts:45


_lendingMarketType

Private _lendingMarketType: LendingMarketType

Defined in

packages/sdk-core/src/Earn/LendingMarket.ts:44


_protocol

Private _protocol: string

Defined in

packages/sdk-core/src/Earn/LendingMarket.ts:47


_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/LendingMarket.ts:51


_tvl

Private Optional _tvl: number

Defined in

packages/sdk-core/src/Earn/LendingMarket.ts:49


_valueOfDeposit

Private Optional _valueOfDeposit: number

Defined in

packages/sdk-core/src/Earn/LendingMarket.ts:50


_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/LendingMarket.ts:52

Accessors

apy

get apy(): undefined | number

Returns

undefined | number

Defined in

packages/sdk-core/src/Earn/LendingMarket.ts:82


chainId

get chainId(): ChainId

Returns

ChainId

Defined in

packages/sdk-core/src/Earn/LendingMarket.ts:94


depositToken

get depositToken(): Token

Returns

Token

Defined in

packages/sdk-core/src/Earn/LendingMarket.ts:98


depositValueInLocalCurrency

get depositValueInLocalCurrency(): undefined | number

Returns

undefined | number

Defined in

packages/sdk-core/src/Earn/LendingMarket.ts:114


id

get id(): number

Returns

number

Defined in

packages/sdk-core/src/Earn/LendingMarket.ts:90


protocol

get protocol(): string

Returns

string

Defined in

packages/sdk-core/src/Earn/LendingMarket.ts:118


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/LendingMarket.ts:110


tvl

get tvl(): undefined | number

Returns

undefined | number

Defined in

packages/sdk-core/src/Earn/LendingMarket.ts:102


type

get type(): LendingMarketType

Returns

LendingMarketType

Defined in

packages/sdk-core/src/Earn/LendingMarket.ts:86


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/LendingMarket.ts:106

Methods

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/LendingMarket.ts:187


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


formatDepositUrl

formatDepositUrl(): string

Returns

string

Overrides

DepositablePosition.formatDepositUrl

Defined in

packages/sdk-core/src/Earn/LendingMarket.ts:184


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/LendingMarket.ts:185


getDepositAddress

Protected getDepositAddress(): string

Returns

string

Inherited from

DepositablePosition.getDepositAddress

Defined in

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


toJSON

toJSON(): LendingMarketApiFullResponse

Returns

LendingMarketApiFullResponse

A JSON representation of the depositable position

Overrides

DepositablePosition.toJSON

Defined in

packages/sdk-core/src/Earn/LendingMarket.ts:164


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?): LendingMarket

Parameters

NameType
__namedParametersLendingMarketApiFullResponse
signer?Signer
walletAddress?string

Returns

LendingMarket

Defined in

packages/sdk-core/src/Earn/LendingMarket.ts:122