Creates an instance of RewardsControllerClient.
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"]
).
Claims all rewards for a user
Vector of asset addresses
The address to which rewards are transferred
The address of the rewards controller
The transaction response containing a tuple of reward addresses and their corresponding amounts
Claims all rewards on behalf of a user
Vector of asset addresses
The address of the user
The address to which rewards are transferred
The address of the rewards controller
The transaction response containing a tuple of reward addresses and their corresponding amounts
Claims all rewards and transfers them to the caller
Vector of asset addresses
The address of the rewards controller
The transaction response containing a tuple of reward addresses and their corresponding amounts
Claims rewards for a user
Vector of asset addresses
The amount of rewards to claim
The address to which rewards are transferred
The address of the reward
The address of the rewards controller
The transaction response containing the amount of rewards claimed
Claims rewards on behalf of a user
Vector of asset addresses
The amount of rewards to claim
The address of the user
The address to which rewards are transferred
The address of the reward
The address of the rewards controller
The transaction response containing the amount of rewards claimed
Claims rewards and transfers them to the caller
Vector of asset addresses
The amount of rewards to claim
The address of the reward
The address of the rewards controller
The transaction response containing the amount of rewards claimed
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.
Gets all rewards for a user across multiple assets.
Array of asset addresses to check rewards for.
The address of the user.
The address of the rewards controller.
A promise that resolves to a tuple containing: - Array of reward token addresses - Array of corresponding reward amounts as u256 values If no rewards controller data exists, returns [[], []].
Gets the number of decimals for a specific asset.
The address of the asset.
The address of the rewards controller.
A promise that resolves to the number of decimals as a number.
Gets the asset index for a specific asset and reward.
The address of the asset.
The address of the reward token.
The address of the rewards controller.
A promise that resolves to a tuple containing the current asset index and new asset index as u256 values. If no rewards data exists, returns [0, 0].
Gets the claimer for a user
The user address
The address of the rewards controller
The claimer address if one exists
Gets the distribution end timestamp for a specific asset and reward.
The address of the asset.
The address of the reward token.
The address of the rewards controller.
A promise that resolves to the distribution end timestamp as a u256 value.
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.Gets the pull rewards transfer strategy for a reward
The reward address
The address of the rewards controller
The pull rewards transfer strategy if one exists
Gets all rewards for a specific asset.
The address of the asset.
The address of the rewards controller.
A promise that resolves to an array of reward token addresses. If no rewards data exists for the asset, returns an empty array.
Retrieves the global reward data for a given asset and reward token from the Rewards Controller contract.
The address of the asset for which to fetch reward data.
The address of the reward token.
The address of the rewards controller.
A promise that resolves to a RewardData
object containing the global reward data. The usersData
field will be an empty map.
Gets all available rewards from the rewards controller.
The address of the rewards controller.
A promise that resolves to an array of reward token addresses. If no rewards controller data exists, returns an empty array.
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.
Gets the total accrued rewards for a specific user and reward across all assets.
The address of the user.
The address of the reward token.
The address of the rewards controller.
A promise that resolves to the total accrued rewards as a u256 value. If no rewards controller data exists, returns 0.
Gets the user asset index for a specific user, asset, and reward.
The address of the user.
The address of the asset.
The address of the reward token.
The address of the rewards controller.
A promise that resolves to the user's asset index as a u256 value.
Gets user data for a specific asset, reward, and user.
The address of the asset.
The address of the reward token.
The address of the user.
The address of the rewards controller.
A promise that resolves to a UserData object containing the user's index and accrued rewards as u256 values. If no user data exists, returns {index: 0n, accrued: 0n}.
Gets the total rewards for a user across multiple assets for a specific reward token.
Array of asset addresses to check rewards for.
The address of the user.
The address of the reward token.
The address of the rewards controller.
A promise that resolves to the total rewards as a u256 value.
Looks up asset data for a specific asset
The address of the rewards controller
The asset data if it exists
Looks up rewards data for a specific asset and reward.
The address of the asset.
The address of the reward token.
The address of the rewards controller.
A promise that resolves to an object containing: - assetData: Asset configuration data - rewardData: Reward configuration data Both fields will be undefined if their respective data doesn't exist.
Gets the address of the rewards controller
The address of the rewards controller
Gets the rewards controller object
The rewards controller object
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 RewardsControllerClient using the default signer from the provided AptosProvider.
The AptosProvider instance to use for creating the RewardsControllerClient.
A new instance of RewardsControllerClient.
The
RewardsControllerClient
class provides methods to interact with the Rewards Controller contract on the Aptos blockchain. It extends theAptosContractWrapperBaseClass
and includes functionalities for managing rewards, claiming rewards, and retrieving reward-related data within the AAVE protocol.Remarks
This client is designed to work with the Rewards Controller contract and provides a high-level API for reward operations. 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.