Aeon Client
The Aeon Client provides allows to interact with the Aeon smart contracts on Sui. This includes fetching of required parameters, gas sponsoring and simulating transactions across multiple blockchain networks. Using theAeonClient, you can synchronously queue various transaction operations. The AeonClient.build() method then asynchronously executes required fetches for each operation and assembles a final transaction block (TXB).
Core Components and Flow
The typical workflow involves initializing the client, queuing one or more operations, building the transaction payload, and finally signing it. This process is designed to be flexible, allowing you to chain multiple simulation or preparation calls together before committing to the build step.-
Initialize
AeonClient: Create an instance ofAeonClient. You can configure it with your self-hosted Aeon backend endpoint and the sui network type. -
Queue Simulation or Preparation Operations: Use the
client.simulate("chain-type", {...params})method for transaction simulations orclient.prepareSigning({...params})for preparing transactions for signing. These methods are synchronous and designed to be chainable. Each call adds an operation to an internal queue within theAeonClientinstance and returns the client itself, allowing you to link multiple calls fluently. Chaining Example: -
Build and Process: Call
await client.build(). This asynchronous method takes all the queued operations and:- Sends requests to the configured simulation URL for each queued simulation operation. For prepare signing, gas info and other chain specific parameters are fetched.
- Collects the results (e.g., simulation outcomes like balance changes, gas estimates, or prepared transaction data) from the backend.
- Assembles a final transaction block (TXB), a batch of transactions, based on these results.
-
Sign with
AeonSigner: The result fromclient.build()(which contains the assembled transaction data or signable payloads) is then passed to the appropriate methods ofAeonSignerfor cryptographic signing.
prepareSigning page (for preparation operations) for detailed parameters for the respective client methods.