DepositablePosition
@node-fi/sdk-core / Exports / DepositablePosition
Class: DepositablePosition
A class to represent a depositable position
Hierarchy
DepositablePosition
Implements
Table of contents
Constructors
Properties
Accessors
Methods
- balanceOfMulticall
- canDirectlySwap
- connect
- deposit
- formatExecuteDeposit
- formatExecuteWithdrawal
- getDepositAddress
- toJSON
- withdraw
Constructors
constructor
• new DepositablePosition(_receiptToken
, _signer?
, _walletAddress?
)
Parameters
Name | Type |
---|---|
_receiptToken | Token |
_signer? | Signer |
_walletAddress? | string |
Defined in
packages/sdk-core/src/Earn/DepositablePosition.ts:101
Properties
_receiptToken
• Private
_receiptToken: Token
Defined in
packages/sdk-core/src/Earn/DepositablePosition.ts:102
_signer
• Protected
Optional
_signer: Signer
Defined in
packages/sdk-core/src/Earn/DepositablePosition.ts:103
_walletAddress
• Protected
Optional
_walletAddress: string
Defined in
packages/sdk-core/src/Earn/DepositablePosition.ts:104
formatDepositUrl
• Abstract
formatDepositUrl: () => string
Type declaration
▸ (): string
Returns
string
Defined in
packages/sdk-core/src/Earn/DepositablePosition.ts:158
formatWithdrawUrl
• Abstract
formatWithdrawUrl: () => string
Type declaration
▸ (): string
Returns
string
Defined in
packages/sdk-core/src/Earn/DepositablePosition.ts:159
Accessors
receiptToken
• get
receiptToken(): Token
The token that is received when depositing into this position
Returns
Token
Defined in
packages/sdk-core/src/Earn/DepositablePosition.ts:110
signer
• get
signer(): undefined
| Signer
The signer used to sign transactions
Returns
undefined
| Signer
Defined in
packages/sdk-core/src/Earn/DepositablePosition.ts:117
walletAddress
• get
walletAddress(): undefined
| string
The address of the wallet that is connected to the signer
Returns
undefined
| string
Defined in
packages/sdk-core/src/Earn/DepositablePosition.ts:124
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
Defined in
packages/sdk-core/src/Earn/DepositablePosition.ts:154
canDirectlySwap
▸ Abstract
canDirectlySwap(): boolean
Returns
boolean
Defined in
packages/sdk-core/src/Earn/DepositablePosition.ts:310
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
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
Implementation of
IDepositablePosition.deposit
Defined in
packages/sdk-core/src/Earn/DepositablePosition.ts:190
formatExecuteDeposit
▸ formatExecuteDeposit(txn
, _inputToken
, _inputAmount
): TransactionStep
Parameters
Name | Type |
---|---|
txn | TransactionRequest |
_inputToken | string |
_inputAmount | JSBI |
Returns
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 |
Defined in
packages/sdk-core/src/Earn/DepositablePosition.ts:175
getDepositAddress
▸ Protected
getDepositAddress(): string
Returns
string
Defined in
packages/sdk-core/src/Earn/DepositablePosition.ts:161
toJSON
▸ toJSON(): Omit
<SerializedDepositablePostion
, "_type"
>
Returns
Omit
<SerializedDepositablePostion
, "_type"
>
A JSON representation of the depositable position
Defined in
packages/sdk-core/src/Earn/DepositablePosition.ts:132
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
Implementation of
IDepositablePosition.withdraw