Iolend
In this section, we will introduce the Iolend SDK interfaces, which provide developers with a convenient and efficient way to interact with the Iolend protocol. These interfaces cover various aspects of the protocol, including deposit, withdraw, borrow, and repay. They are designed to be used easily and flexibly.
The following section will introduce the interfaces related to the Iolend protocol, which can be accessed through the api.protocols.iolend.
prefix.
Deposit
The following code defines interfaces and functions related to the Iolend deposit logic:
Types
DepositParams: A type that represents the input parameters for the Iolend deposit logic
DepositFields: A type that represents the fields required for the Iolend deposit logic.
DepositLogic: An interface that extends the
Logic
interface and represents the Iolend deposit logic. It includes therid
, andfields
properties.
Functions
getDepositTokenList(chainId: number): An asynchronous function that retrieves the list of tokens supported by the Iolend deposit logic on the specified
chainId
.getDepositQuotation(chainId: number, params: DepositParams): An asynchronous function that retrieves a quotation for depositing assets on the Iolend protocol with the specified
params
object on the specifiedchainId
.newDepositLogic(fields: DepositFields): A function that creates the Iolend deposit logic data with the given
fields
object.
Example Code
Withdraw
The following code defines interfaces and functions related to the Iolend withdraw logic:
Types
WithdrawParams: A type that represents the input parameters for the Iolend withdraw logic
WithdrawFields: A type that represents the fields required for the Iolend withdraw logic.
WithdrawLogic: An interface that extends the
Logic
interface and represents the Iolend withdraw logic. It includes therid
, andfields
properties.
Functions
getWithdrawTokenList(chainId: number): An asynchronous function that retrieves the list of tokens supported by the Iolend withdraw logic on the specified
chainId
.getWithdrawQuotation(chainId: number, params: WithdrawParams): An asynchronous function that retrieves a quotation for withdrawing assets from the Iolend protocol with the specified
params
object on the specifiedchainId
.newWithdrawLogic(fields: WithdrawFields): A function that creates Iolend withdraw logic data with the given
fields
object.
Example Code
Borrow
The following code defines interfaces and functions related to the Iolend borrow logic:
Types
BorrowFields: A type that represents the fields required for the Iolend borrow logic.
BorrowLogic: An interface that extends the Logic interface and represents the Iolend borrow logic. It includes the
rid
, andfields
properties.
Functions
getBorrowTokenList(chainId: number): An asynchronous function that retrieves the list of tokens supported by the Iolend borrow logic on the specified chainId.
newBorrowLogic(fields: BorrowFields): A function that creates the Iolend borrow logic data with the given fields object.
Example Code
Repay
The following code defines interfaces and functions related to the Iolend repay logic:
Types
RepayParams: A type that represents the input parameters for the Iolend repay logic
RepayFields: A type that represents the fields required for the Iolend repay logic.
RepayLogic: An interface that extends the
Logic
interface and represents the Iolend repay logic. It includes therid
, andfields
properties.
Functions
getRepayTokenList(chainId: number): An asynchronous function that retrieves the list of tokens supported by the Iolend repay logic on the specified
chainId
.getRepayQuotation(chainId: number, params: RepayParams): A function that retrieves a quotation for repaying a loan using the specified parameters and Iolend protocol on the specified chain.
newRepayLogic(fields: RepayFields): A function that creates the Iolend repay logic data with the given
fields
object.
Example Code
Last updated