Creates a new instance of the UserData class for interacting with user data endpoints.
Optionalconfig: CallerConfig
Optional network, API host, access token, and API path.
The mutable configuration used for subsequent requests.
Static ReadonlytermsThe single message every wallet signs once per session to prove ownership. af-fe decodes the personal-message bytes and compares this text byte for byte, so it must stay exactly this string: no JSON wrapper, action, date, or trailing whitespace.
Generates a simple message object that the user should sign to confirm their agreement with the Terms and Conditions of the service.
An object with an action property set to "SIGN_TERMS_AND_CONDITIONS".
This method does not make a network request.
af-fe no longer accepts the {action:...} wrapper and rejects
it with error 2034. Sign createTermsAndConditionsMessage instead.
Returns the canonical Terms and Conditions message to sign. Sign it as a
personal message over its UTF-8 bytes and reuse the signature for the whole
session: it is the one credential af-fe verifies for referrals, rewards,
stop/twap order datas, collateral/order history, the websocket user
subscription, and gas-pool sponsorship.
The exact string to sign. This method does not make a network request.
Builds the legacy account-creation message object locally.
This method does not make a network request. Current authenticated
requests use createTermsAndConditionsMessage() instead.
An object with action: "CREATE_USER_ACCOUNT".
Creates or updates the stored public key for a wallet through the backend. This method sends the supplied signed bytes and signature; it does not sign the message or make a transaction.
For the current authentication flow, sign the exact value returned by
createTermsAndConditionsMessage() as a personal message over its UTF-8
bytes, then pass those bytes and the resulting signature in inputs.
Wallet address, serialized signed-message bytes, and the corresponding signature.
true when the backend stores the key. false is also a valid
backend response.
Retrieves the stored user public key (if any) for a given wallet address.
An object implementing ApiUserDataPublicKeyBody, containing the user's wallet address.
A promise that resolves to a string representation of the user's public key, or undefined if none is found.
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
UserDataclass provides HTTP access to user public-key data and local helpers for the messages used by authenticated Aftermath requests.