Creates an instance of CoreClient.
The AptosProvider instance to interact with the Aptos blockchain.
Optional
signer: Ed25519AccountOptional Ed25519Account instance used for signing transactions.
Borrows a specified amount of an asset on behalf of a user.
The address of the asset to borrow.
The amount of the asset to borrow.
The interest rate mode (e.g., stable or variable).
The referral code for the transaction.
The address of the user on whose behalf the asset is borrowed.
A promise that resolves to the response of the committed transaction.
Builds a transaction for the specified user, function, and arguments.
The account address of the user initiating the transaction.
The identifier of the Move function to be called.
An array of arguments for the entry function.
A promise that resolves to a SimpleTransaction object.
Calls a view method on the Aptos blockchain.
The identifier of the function to call.
The arguments to pass to the function.
Optional generic type arguments for the function (e.g. ["0x1::aptos_coin::AptosCoin"]
).
Funds an account with a specified amount.
The address of the account to be funded.
The amount to fund the account with, in bigint.
A promise that resolves to a UserTransactionResponse.
Retrieves the Aptos balance of a specified account.
The Ed25519 account object.
The address of the account to retrieve the balance for.
Optional
versionToWaitFor: bigint(Optional) The specific version to wait for before retrieving the balance.
A promise that resolves to the balance of the account in bigint.
Retrieves events associated with a specific account.
The address of the account to retrieve events for.
The maximum number of events to retrieve.
A promise that resolves to an array of event objects, each containing:
account_address
: The address of the account.creation_number
: The creation number of the event.data
: The data associated with the event.event_index
: The index of the event.sequence_number
: The sequence number of the event.transaction_block_height
: The block height of the transaction.transaction_version
: The version of the transaction.type
: The type of the event.indexed_type
: The indexed type of the event.Retrieves the current Ed25519Account signer.
The current signer.
Retrieves the events associated with a given transaction hash.
The hash of the transaction to retrieve events for.
A promise that resolves to an array of objects containing the event data.
Retrieves the account data for a specific user.
The address of the user's account.
A promise that resolves to an object containing the user's account data:
totalCollateralBase
: The total collateral in base units.totalDebtBase
: The total debt in base units.availableBorrowsBase
: The available amount for borrowing in base units.currentLiquidationThreshold
: The current liquidation threshold in base units.ltv
: The loan-to-value ratio in base units.healthFactor
: The health factor in base units.Executes a liquidation call on the Aave protocol.
The address of the collateral asset.
The address of the debt asset.
The address of the user whose position is being liquidated.
The amount of debt to cover in the liquidation.
A boolean indicating whether to receive aTokens as collateral.
A promise that resolves to a CommittedTransactionResponse
object.
Repays a borrowed amount for a specific asset.
The address of the asset to repay.
The amount to repay, specified as a bigint.
The interest rate mode (e.g., stable or variable).
The address of the account on whose behalf the repayment is made.
A promise that resolves to a CommittedTransactionResponse.
Repays a loan using aTokens.
The address of the asset to repay.
The amount of the asset to repay, in bigint.
The interest rate mode (e.g., stable or variable).
A promise that resolves to a CommittedTransactionResponse.
Sends a transaction and awaits the response.
The ID of the Move function to be called.
An array of arguments for the entry function.
A promise that resolves to the committed transaction response.
Sets the signer for the client.
The Ed25519 account to be used as the signer.
Sets whether a user should use a specific reserve as collateral.
The address of the asset to be used as collateral.
A boolean indicating whether to use the asset as collateral.
A promise that resolves to a CommittedTransactionResponse.
Supplies a specified amount of an asset on behalf of a given account.
The address of the fungible asset to supply.
The amount of the fungible asset to supply, represented as a bigint.
The address of the account on whose behalf the asset is being supplied.
A referral code for tracking referrals.
A promise that resolves to a CommittedTransactionResponse.
Supplies a specified amount of a coin on behalf of a given account.
The type of the coin to supply.
The amount of the coin to supply, represented as a bigint.
The address of the account on whose behalf the asset is being supplied.
A referral code for tracking referrals.
A promise that resolves to a CommittedTransactionResponse.
Withdraws a specified amount of an asset to a given account address.
The address of the asset to withdraw.
The amount of the asset to withdraw, represented as a bigint.
The account address to which the asset will be withdrawn.
A promise that resolves to a CommittedTransactionResponse once the transaction is committed.
Sets the signer to the module signer and returns the current instance.
The current instance with the module signer set.
Sets the signer for the current instance using the provided Ed25519 account.
The Ed25519 account to be used as the signer.
The current instance with the signer set.
Static
buildCreates an instance of CoreClient using the default signer from the provided AptosProvider.
The AptosProvider instance to use for creating the CoreClient.
A new instance of CoreClient.
The
CoreClient
class provides methods to interact with the Aave protocol on the Aptos blockchain. It extends theAptosContractWrapperBaseClass
and includes functionalities for supplying, borrowing, repaying, and managing assets within the Aave protocol.Remarks
This client is designed to work with the core Aave protocol contracts and provides a high-level API for supply, borrow, and liquidation operations. The client can be instantiated in two ways:
Example