Creates an instance of the UiPoolDataProvider client.
The Aptos blockchain provider.
Optional
signer: Ed25519AccountOptional Ed25519 account signer.
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.Fetches and returns the reserves data and base currency data.
A promise that resolves to an object containing reserves data and base currency data.
The reserves data includes:
The base currency data includes:
Retrieves the list of reserve accounts.
This method calls the getReservesList
function on the uiPoolDataProviderContract
and returns an array of AccountAddress
objects.
A promise that resolves to an array of AccountAddress
objects.
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 reserve data for a specific user.
The address of the user whose reserve data is being retrieved.
A promise that resolves to an object containing the user's reserves data and eMode category ID.
The returned object has the following structure:
userReserves
: An array of objects representing the user's reserves. Each object contains:
underlyingAsset
: The address of the underlying asset.scaledATokenBalance
: The scaled balance of A tokens.usageAsCollateralEnabledOnUser
: A boolean indicating if the asset is being used as collateral by the user.scaledVariableDebt
: The scaled variable debt of the user.decimals
: The number of decimals for the asset.userEmodeCategoryId
: The eMode category ID of the user.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 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 UiPoolDataProviderClient
using the default signer.
The AptosProvider
instance to be used for creating the client.
A new instance of UiPoolDataProviderClient
initialized with the provided AptosProvider
.
The
UiPoolDataProviderClient
class provides methods to interact with the UI Pool Data Provider contract on the Aptos blockchain. It extends theAptosContractWrapperBaseClass
and includes functionalities for retrieving pool-related data in a format suitable for UI applications, including reserve data, user reserve data, and base currency information within the AAVE protocol.Remarks
This client is designed to work with the UI Pool Data Provider contract and provides a high-level API for accessing pool-related data in a format optimized for user interfaces. The client can be instantiated in two ways:
Example
Param: provider
The AptosProvider instance used to interact with the Aptos blockchain.
Param: signer
Optional Ed25519Account signer for transaction signing.