Skip to main content

DepositablePosition

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

Class: DepositablePosition

A class to represent a depositable position

Hierarchy

Implements

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new DepositablePosition(_receiptToken, _signer?, _walletAddress?)

Parameters

NameType
_receiptTokenToken
_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

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

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

NameTypeDescription
signer?SignerEthersjs signer
walletAddress?stringWallet 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

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

Implementation of

IDepositablePosition.deposit

Defined in

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


formatExecuteDeposit

formatExecuteDeposit(txn, _inputToken, _inputAmount): TransactionStep

Parameters

NameType
txnTransactionRequest
_inputTokenstring
_inputAmountJSBI

Returns

TransactionStep

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

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

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

Implementation of

IDepositablePosition.withdraw

Defined in

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