Creates a gas-pool facade.
Optionalconfig: CallerConfig
Optional caller configuration, such as the network and access token.
Optionalapi: AftermathApi
Optional provider used to serialize transactions supplied to gas-pool endpoints.
Optional ReadonlyapiOptional provider used to serialize transactions supplied to gas-pool endpoints.
The mutable configuration used for subsequent requests.
Builds a transaction to create a new gas pool for the given wallet.
When deferShare is true, the response includes gasPoolArg and
sharePolicyArg so you can compose additional commands (e.g. deposit,
grant) before calling getShareTx to finalize.
Wallet address to create the gas pool for.
Optional initial deposit amount in MIST.
When true, returns args without sharing yet.
Optional transaction to extend.
Optionaltx?: TransactionOptional transaction to extend.
tx plus optional gasPoolArg and sharePolicyArg when deferred.
Builds a transaction to deposit into the gas pool.
Supports SUI and non-SUI deposits. For non-SUI deposits, the input coin is swapped into SUI via the Aftermath router before depositing.
Wallet address submitting the deposit.
Whether to build the transaction for sponsored gas. Defaults to false.
Coin type to deposit. Defaults to SUI.
Amount to deposit (required when sourcing from wallet or for non-SUI).
PTB coin argument to use as input (if omitted, sourced from wallet).
Slippage tolerance for non-SUI swaps (defaults to 0.01).
Optional gas pool argument from a previously-built PTB command.
Optional transaction to extend.
Optionaltx?: TransactionOptional transaction to extend.
SdkTransactionResponse with tx.
Builds a transaction to grant another wallet access to the gas pool.
Owner wallet address.
Wallet address to grant access to.
Optional gas pool argument from a previously-built PTB command.
Optional transaction to extend.
Optionaltx?: TransactionOptional transaction to extend.
SdkTransactionResponse with tx.
Fetches the gas pool details for a given wallet address.
ApiGasPoolBody containing the wallet address.
ApiGasPoolResponse containing pool ID, balance, and whitelisted addresses.
Builds a transaction to revoke another wallet's access to the gas pool.
Owner wallet address.
Wallet address to revoke access from.
Optional transaction to extend.
Optionaltx?: TransactionOptional transaction to extend.
SdkTransactionResponse with tx.
Builds a transaction to share a gas pool that was created with deferShare: true.
Use this after composing additional commands (deposit, grant, etc.) with
the gasPoolArg returned by getCreateTx.
Gas pool argument from a deferred create.
Share policy argument from a deferred create.
Optional transaction to extend.
Optionaltx?: TransactionOptional transaction to extend.
SdkTransactionResponse with tx.
Requests a gas-pool-sponsored transaction. Returns a complete transaction
with the gas payment and epoch bound attached, the sponsor's signature, and
the digest both signatures commit to — the caller signs transaction as the
sender and submits it together with sponsorSignature.
Wallet address requesting the sponsorship.
Base64 of the signed SPONSOR_GAS auth message.
Signature over bytes.
Optional transaction to sponsor (appended as a tx kind).
Optionaltx?: TransactionOptional transaction to sponsor (appended as a tx kind).
ApiGasPoolSponsorResponse.
Builds a transaction to withdraw SUI from the gas pool.
When deferTransfer is true, the withdrawn coin is not transferred.
Instead, withdrawnCoinArg is returned for further PTB composition.
Wallet address submitting the withdrawal.
Amount of SUI to withdraw in MIST.
Optional recipient (defaults to walletAddress).
When true, returns the withdrawn coin arg instead of transferring.
Optional gas pool argument from a previously-built PTB command.
Optional transaction to extend.
Optionaltx?: TransactionOptional transaction to extend.
tx plus optional withdrawnCoinArg when deferred.
StaticapiReturns the canonical Aftermath API host for a Sui network.
To target a custom or local host, pass baseUrl in CallerConfig to the
constructor instead.
The Sui network whose host to return.
The network's HTTPS or local HTTP API host.
StaticdefaultReturns the canonical Sui fullnode URL for a network.
The network whose fullnode URL to return. undefined
defaults to mainnet.
The network's fullnode URL.
The
GasPoolsclass provides methods for interacting with shared gas pool endpoints on the Aftermath platform. This includes querying pool details and building transactions for creating, depositing into, withdrawing from, sponsoring, granting access to, and revoking access from gas pools.Example