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

    Wraps one SuiFren object with display helpers, accessory reads, and unsigned staking or accessory transaction builders.

    isStaked and isOwned are caller-provided state flags from the fetch path. They are not live ownership checks. Transaction methods return unsigned transactions that the wallet identified by walletAddress must sign.

    Hierarchy (View Summary)

    Index
    • Creates a SuiFren wrapper without making a request.

      Parameters

      • suiFren: SuiFrenObject

        Complete SuiFren object data.

      • Optionalconfig: CallerConfig

        Optional network, API host, endpoint, or access-token configuration.

      • isStaked: boolean = false

        Whether the caller's source data marks this SuiFren as staked.

      • isOwned: boolean = false

        Whether the caller's source data marks this SuiFren as owned by the wallet.

      • Optionalapi: AftermathApi

        Optional AftermathApi required by transaction builders.

      Returns SuiFren

    Optional low-level provider used by transaction builders.

    config: CallerConfig

    The mutable configuration used for subsequent requests.

    isOwned: boolean = false

    Caller-provided ownership flag.

    isStaked: boolean = false

    Caller-provided staked-state flag.

    suiFren: SuiFrenObject

    Complete object data exposed by the wrapper.

    • Creates another wrapper around the same object and caller configuration.

      The current implementation preserves isStaked and isOwned but does not pass this wrapper's optional api to the clone. Transaction methods on the clone therefore require an API instance supplied by a different path.

      Returns SuiFren

      A new wrapper sharing the same object reference.

    • Returns the display-number slice derived from the object ID.

      The method returns suiFren.objectId.slice(-5, -1) in uppercase. It does not parse or validate the ID, so the result depends on the supplied string's length and format.

      Returns string

      The uppercased display-number slice.

    • Builds display labels for optional dynamic fields.

      The result includes a mix count and last-mixed epoch only when the source values are truthy. As a result, a stored 0n value is omitted by the current implementation.

      Returns Record<string, string>

      Present dynamic values converted to strings.

    • Fetches accessories attached to this SuiFren.

      The method performs an HTTP request through the configured caller host and sends this object's ID as the request body. It does not require the low-level AftermathApi field.

      Returns Promise<SuiFrenAccessoryObject[]>

      The accessory objects attached to this SuiFren.

      AftermathTransportError when the request or response fails.

    • Builds an unsigned transaction that adds an accessory to this SuiFren.

      The underlying builder selects the owned or staked Move variant from this wrapper's isOwned flag. The caller must supply an accessory object ID and a wallet that can use the SuiFren and accessory objects.

      Parameters

      • inputs: { accessoryId: string; walletAddress: string }

        Accessory object ID and transaction sender address.

      Returns Promise<Transaction>

      An unsigned transaction ready for signing and execution.

      Error when no AftermathApi is available.

    • Builds an unsigned transaction that removes an accessory from this SuiFren.

      The method rejects wrappers not marked isOwned before it calls the low-level builder. The supplied accessory type is passed to the Move call unchanged.

      Parameters

      • inputs: { accessoryType: string; walletAddress: string }

        Accessory type string and transaction sender address.

      Returns Promise<Transaction>

      An unsigned transaction ready for signing and execution.

      Error when this wrapper is not marked owned or no AftermathApi is available.

    • Builds an unsigned transaction that stakes this SuiFren.

      The method derives suiFrenType and suiFrenId from this wrapper and sets the supplied wallet as transaction sender. It rejects a wrapper already marked isStaked; it does not verify ownership before building.

      Parameters

      • inputs: {
            baseFee: bigint;
            feeIncrementPerMix: bigint;
            minRemainingMixesToKeep: bigint;
            walletAddress: string;
        }

        Fee settings in smallest units, minimum mixes to keep, and the signing wallet.

      Returns Promise<Transaction>

      An unsigned transaction ready for signing and execution.

      Error when isStaked is true or no AftermathApi is available.

    • Builds display-oriented property labels from the SuiFren object.

      This local operation formats birthdate as MMMM d, yyyy and converts bigint values to strings. The returned map intentionally omits the raw genes array.

      Returns Record<string, string>

      Labels and string values suitable for display.

    • Returns the inner Move type argument for this SuiFren.

      This is a local operation. It extracts the generic type used by the SuiFrens Move calls from suiFren.objectType.

      Returns string

      The inner SuiFren type argument.

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