aftermath-ts-sdk - v3.3.3
    Preparing search index...

    Provides HTTP access to reward points, reward history, claimable balances, expected rewards, and claim transaction builders.

    Read methods request data from the configured Aftermath API. The claim method also converts the API's serialized transaction response into a Sui Transaction; it does not sign or execute that transaction.

    Hierarchy (View Summary)

    Index

    Optional provider used to serialize a caller-supplied claim transaction.

    config: CallerConfig

    The mutable configuration used for subsequent requests.

    • Requests a reward-claim transaction and restores it as a Sui Transaction.

      If tx is supplied, this method serializes only its TransactionKind via AftermathApi.Transactions().fetchBase64TxKindFromTx and sends that txKind to the API. If tx is omitted, the request can still succeed with a backend-generated transaction. When the response includes a sponsorSignature, the returned bytes are parsed as a full transaction; otherwise they are parsed as a transaction kind. The returned transaction is not signed or executed by this method.

      Parameters

      • inputs: {
            coinTypes?: string[];
            recipientAddress?: string;
            tx?: Transaction;
            walletAddress: string;
        }

        Wallet address, optional coin filters, recipient, and an optional transaction to extend.

      Returns Promise<Omit<ApiRewardsClaimRequestTxResponse, "txKind"> & { tx: Transaction }>

      The parsed claim transaction and any backend sponsor signature.

      AftermathTransportError when the API request or response fails.

      Error when a supplied transaction cannot be serialized or the response cannot be restored as a Sui transaction.

    • Preview a single account's expected rewards for an epoch, broken down by domain (trading, referral, AFLP, integrator) plus totals. Backed by the newer rewards/expected-rewards endpoint. Provide exactly one of address or accountId; omit epoch for the current epoch.

      This method performs an HTTP request. Account IDs are decimal strings so that values larger than JavaScript's safe integer range remain exact.

      Parameters

      Returns Promise<ApiRewardsExpectedRewardsResponse>

      The selected epoch, total reward values, and domain breakdown.

      AftermathTransportError when the API request or response fails.

    • Fetches one page of the wallet's reward history.

      Pass cursor from the previous response to request the next page. The API documents a default page size of 20 and a maximum of 100 entries. Amounts in each history entry are returned as bigint values in the coin's smallest units.

      Parameters

      Returns Promise<ApiRewardsGetHistoryResponse>

      History entries and pagination metadata.

      AftermathTransportError when the API request or response fails.

    • Returns the canonical Aftermath API host for a Sui network.

      To target a custom or local host, pass baseUrl in CallerConfig to the constructor instead.

      Parameters

      • network: SuiNetwork

        The Sui network whose host to return.

      Returns string

      The network's HTTPS or local HTTP API host.