Creates a referrals HTTP client.
Optionalconfig: CallerConfig
Optional network, API host, access token, and API path.
The mutable configuration used for subsequent requests.
Static ReadonlyconstantsReserved referral configuration constants. This object is currently empty.
Creates a referral link for the authenticated wallet.
This method sends the referral code in the request body together with the signed authentication fields.
Wallet address, signed authentication data, and new code.
The created code, owner address, creation timestamp in milliseconds, and backend status.
Builds the legacy per-action message for creating a referral link.
The returned object is local data and does not make a network request. The
current API authenticates with the exact string from
UserData.createTermsAndConditionsMessage() and receives refCode in the
createReferralLink body.
Referral code to include in the legacy message.
{ action: "CREATE_REFERRAL", ref_code: inputs.refCode, date },
where date is the current Unix time in seconds.
Fetches the referral code linked to a wallet.
A JSON null linked code or timestamp is returned to the caller as
undefined.
Wallet address and the bytes and signature of the signed authentication message.
The queried address, linked code, and link timestamp when present.
Fetches the referral code owned by a wallet.
The API receives the signed authentication fields in inputs. A JSON
null referral code is returned to the caller as undefined.
Wallet address and the bytes and signature of the signed authentication message.
The queried address and its referral code, if one exists.
Fetches the referees linked to a referral code.
Use limit to bound the returned page and offset to skip that many
referees. The response's totalCount is the count before pagination.
Referral code and optional page size and offset.
One page of referees and the total count for the code.
Checks whether a referral code is available for use.
Referral code to check.
The checked code and isAvailable, where true means that the
code is available and false means that it is already taken.
Links the authenticated wallet to an existing referral code.
Wallet address, signed authentication data, and code to link.
The referee address, linked code, creation timestamp in milliseconds, and backend status.
Builds the legacy per-action message for linking a referral code.
The returned object is local data and does not make a network request. The
current API authenticates with the exact string from
UserData.createTermsAndConditionsMessage() and receives refCode in the
setReferrer body.
Referral code to include in the legacy message.
{ action: "LINK_REFERRAL", ref_code: inputs.refCode, date },
where date is the current Unix time in seconds.
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.
Provides HTTP access to Aftermath referral codes and referral relationships.
Read and write methods send POST requests to the configured referrals API. Authenticated methods require the wallet address, signed message bytes, and matching signature in their input body.