LendingMarket
@node-fi/sdk-core / Exports / LendingMarket
Class: LendingMarket
A class to represent a depositable position
Hierarchy
↳
LendingMarket
Table of contents
Constructors
Properties
- _apy
- _chainId
- _id
- _lendingMarketType
- _protocol
- _signer
- _totalDeposited
- _tvl
- _valueOfDeposit
- _walletAddress
- _walletDeposited
Accessors
- apy
- chainId
- depositToken
- depositValueInLocalCurrency
- id
- protocol
- receiptToken
- signer
- totalDeposited
- tvl
- type
- walletAddress
- walletDeposited
Methods
- balanceOfMulticall
- canDirectlySwap
- connect
- deposit
- formatDepositUrl
- formatExecuteDeposit
- formatExecuteWithdrawal
- formatWithdrawUrl
- getDepositAddress
- toJSON
- withdraw
- parseJson
Constructors
constructor
• new LendingMarket(__namedParameters
, signer?
, walletAddress?
)
Parameters
Name | Type |
---|---|
__namedParameters | LendingMarketInstantionInfo |
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
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
Name | Type | Description |
---|---|---|
owner | string | The 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
Name | Type | Description |
---|---|---|
signer? | Signer | Ethersjs signer |
walletAddress? | string | Wallet address |
Returns
void
Inherited from
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
Name | Type | Description |
---|---|---|
inputToken | string | Token to trade to the depositable position |
inputAmount | BigintIsh | Amount 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
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
Name | Type |
---|---|
txn | TransactionRequest |
_inputToken | string |
_inputAmount | JSBI |
Returns
Inherited from
DepositablePosition.formatExecuteDeposit
Defined in
packages/sdk-core/src/Earn/DepositablePosition.ts:163
formatExecuteWithdrawal
▸ formatExecuteWithdrawal(txn
, _inputAmount
): Object
Parameters
Name | Type |
---|---|
txn | TransactionRequest |
_inputAmount | JSBI |
Returns
Object
Name | Type |
---|---|
description | string |
execute | (signer : undefined | Signer ) => Promise <TransactionResponse > |
transaction | TransactionRequest |
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
A JSON representation of the depositable position
Overrides
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
Name | Type | Description |
---|---|---|
amount | BigNumberish | TokenAmount | Amount of depositable position to withdraw |
destinationToken | string | Token | Token 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
Defined in
packages/sdk-core/src/Earn/DepositablePosition.ts:237
parseJson
▸ Static
parseJson(__namedParameters
, signer?
, walletAddress?
): LendingMarket
Parameters
Name | Type |
---|---|
__namedParameters | LendingMarketApiFullResponse |
signer? | Signer |
walletAddress? | string |