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

    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.

    Hierarchy (View Summary)

    Index
    config: CallerConfig

    The mutable configuration used for subsequent requests.

    constants: {} = {}

    Reserved referral configuration constants. This object is currently empty.

    • 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.

      Parameters

      • inputs: { refCode: string }

        Referral code to include in the legacy message.

      Returns { action: string; date: number; ref_code: string }

      { action: "CREATE_REFERRAL", ref_code: inputs.refCode, date }, where date is the current Unix time in seconds.

      af-fe no longer accepts this per-action message. Sign UserData.createTermsAndConditionsMessage and pass refCode in the createReferralLink body instead.

    • 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.

      Parameters

      • inputs: { refCode: string }

        Referral code to include in the legacy message.

      Returns { action: string; date: number; ref_code: string }

      { action: "LINK_REFERRAL", ref_code: inputs.refCode, date }, where date is the current Unix time in seconds.

      af-fe no longer accepts this per-action message. Sign UserData.createTermsAndConditionsMessage and pass refCode in the setReferrer body instead.

    • 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.