Creates a new Auth instance for token-based rate limit increases.
Optionalconfig: CallerConfig
Optional caller configuration, including network and access token.
Admin-only: Creates a new auth account with specific rate limits for a given
accountWalletAddress. The walletAddress performing this action must have
admin privileges, or the call will fail. Use this to create custom sub-accounts
with limited scope or usage rates.
Contains:
walletAddress: The admin's wallet addresssignMessageCallback: The admin's signing callbackaccountName: A short name or identifier for the accountaccountWalletAddress: The Sui address representing this sub-accountrateLimits: An array specifying the rate limits (method-based) for the sub-accountA promise resolving to true if successful, otherwise throws or returns false.
Initializes the auth system by fetching an access token for the provided wallet address. After obtaining the token, it automatically schedules periodic refresh calls until stopped.
An object containing the user's walletAddress and a signMessageCallback function
for cryptographically signing messages.
A function that, when called, cancels further token refresh attempts.
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
Authclass manages creation and refreshing of access tokens to obtain higher rate limits on the Aftermath API. It includes methods to initialize authorization either by a direct callback-based approach or by importing a local Sui keystore. Optionally, administrative functions are provided for creating specialized auth accounts.Example