Creates an instance of OracleClient.
The Aptos blockchain provider.
Optional
signer: Ed25519AccountOptional Ed25519 account signer.
Removes the custom prices for a batch of assets from the oracle contract.
An array of account addresses representing the assets whose custom prices are to be removed.
A promise that resolves to a CommittedTransactionResponse
indicating the result of the transaction.
Removes the feed IDs for a batch of assets from the oracle contract.
An array of account addresses representing the assets whose feed IDs are to be removed.
A promise that resolves to a CommittedTransactionResponse
indicating the result of the transaction.
Sets the custom prices for a batch of assets in the oracle contract.
An array of account addresses representing the assets.
An array of bigints representing the custom prices of the assets.
A promise that resolves to a CommittedTransactionResponse.
Sets the feed IDs for a batch of assets in the oracle contract.
An array of account addresses representing the assets.
An array of Uint8Array representing the feed IDs for the assets.
A promise that resolves to a CommittedTransactionResponse.
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 the price of a specified asset.
The address of the asset for which the price is being requested.
A promise that resolves to the price of the asset as a bigint.
Retrieves the oracle asset price decimals.
A promise that resolves to the asset price decimals of the oracle.
Retrieves the prices of the specified assets.
An array of account addresses representing the assets.
A promise that resolves to an array of bigints, each representing the price of an asset.
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 oracle address from the oracle contract.
A promise that resolves to the oracle address.
Retrieves the price cap of a specified asset.
The address of the asset for which the price cap is being requested.
A promise that resolves to the price cap of the asset as a bigint.
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.
Returns if an asset price is capped or not.
The address of the asset for which we are checking if there is a cap.
A promise that resolves to a boolean.
Removes the custom price associated with a given asset.
The address of the asset for which the custom price should be removed.
A promise that resolves to the response of the committed transaction.
Removes the feed ID associated with a given asset.
The address of the asset for which the feed ID should be removed.
A promise that resolves to the response of the committed transaction.
Removes a price cap stable adapter for a given asset.
The account address of the asset for which the stable price adapter is being remved.
A promise that resolves to a CommittedTransactionResponse once the transaction is committed.
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 a custom price for a given asset.
The account address of the asset for which the feed ID is being set.
The custom price of the asset.
A promise that resolves to a CommittedTransactionResponse once the transaction is committed.
Sets the feed ID for a given asset in the oracle contract.
The account address of the asset for which the feed ID is being set.
The feed ID to be associated with the asset, represented as a Uint8Array.
A promise that resolves to a CommittedTransactionResponse once the transaction is committed.
Sets a price cap stable adapter for a given asset.
The account address of the asset for which the stable price adapter is being set.
The price cap.
A promise that resolves to a CommittedTransactionResponse once the transaction is committed.
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 OracleClient using the default signer from the provided AptosProvider.
The AptosProvider instance to use for creating the OracleClient.
A new instance of OracleClient.
The
OracleClient
class provides methods to interact with the oracle contract on the Aptos blockchain. It extends theAptosContractWrapperBaseClass
and includes functionalities to retrieve and set asset prices, manage feed IDs, and obtain oracle-related addresses.Remarks
This client is designed to work with the oracle contracts and provides a high-level API for price feed 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.