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

    Builds referral-vault Move calls and evaluates referral-vault inspection results.

    This low-level helper requires the referral-vault package and object addresses in the provider configuration. Use it when composing a larger transaction or when the high-level referral facade does not expose the operation you need.

    Index

    Package and object addresses used by referral-vault calls.

    • Appends a read-only Move call that returns a referrer's rebate balance.

      The Move function returns a u64; the result is not fetched until the transaction is executed or inspected.

      Parameters

      • inputs: { coinType: string; referrer: string; tx: Transaction }

        Transaction, coin type, and referrer address.

        • coinType: string

          Fully qualified coin type for the rebate balance.

        • referrer: string

          Address whose rebate balance to read.

        • tx: Transaction

          Transaction to mutate.

      Returns TransactionResult

      A transaction result handle containing the Move u64 value.

    • Inspects the rebate balance for a referrer and decodes the returned u64.

      Parameters

      • inputs: { coinType: string; referrer: string }

        Coin type and referrer address.

        • coinType: string

          Fully qualified coin type for the rebate balance.

        • referrer: string

          Address whose rebate balance to fetch.

      Returns Promise<bigint>

      The raw rebate balance as a bigint-backed Balance value.

      If the inspection transport rejects the generated transaction.

    • Inspects the referrer of an address and decodes the returned optional address.

      Parameters

      • inputs: { referee: string }

        Referee address to query.

        • referee: string

          Address whose referrer to fetch.

      Returns Promise<string | undefined>

      The referrer address, or undefined when the Move option is empty.

      If the inspection transport rejects the generated transaction or the returned bytes are not a valid BCS Option<address>.

    • Appends a read-only Move call that checks whether an address has a referrer.

      The method name preserves the SDK's historical Refferer spelling.

      Parameters

      • inputs: { referee: string; tx: Transaction }

        Transaction and referee address.

        • referee: string

          Address to check.

        • tx: Transaction

          Transaction to mutate.

      Returns TransactionResult

      A transaction result handle containing the Move bool value.

    • Appends a read-only Move call that returns the referrer of an address.

      The Move function returns Option<address>. Use an inspection helper or execute the transaction to read the value.

      Parameters

      • inputs: { referee: string; tx: Transaction }

        Transaction and referee address.

        • referee: string

          Address whose referrer to look up.

        • tx: Transaction

          Transaction to mutate.

      Returns TransactionResult

      A transaction result handle containing Option<address>.

    • Appends a Move call that records a referee's referrer.

      If the transaction sender already matches referrer, this method leaves the transaction unchanged. The method also suppresses malformed-address errors to preserve the historical SDK behavior; validate addresses before calling it when you need deterministic failure handling.

      Parameters

      • inputs: { referrer: string; tx: Transaction }

        Transaction and referrer address to record.

        • referrer: string

          Sui address of the referrer.

        • tx: Transaction

          Transaction to mutate.

      Returns TransactionResult | undefined

      The result of tx.moveCall, or undefined when the sender is the referrer or the input address cannot be encoded.

    • Appends a Move call that withdraws accrued rebate for a coin type.

      Parameters

      • inputs: { coinType: string; tx: Transaction; withTransfer?: boolean }

        Transaction, coin type, and transfer behavior.

        • coinType: string

          Fully qualified coin type whose rebate is withdrawn.

        • tx: Transaction

          Transaction to mutate.

        • OptionalwithTransfer?: boolean

          When true, transfers the withdrawn coins to the transaction sender; when omitted or false, returns the Move result.

      Returns TransactionResult

      The Move call result, which is a transaction result handle.