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

    Fetches NFTs and kiosk data from Sui through the low-level AftermathApi.

    Every fetch method performs gRPC network I/O through the object and dynamic field helpers. NFT reads request Display data and return only objects that can be rendered by NftsApiCasting; missing Display output is filtered out. Construct this class only with an AftermathApi that has the required NFT package addresses.

    Index
    • Creates an NFT API for a configured low-level provider.

      Parameters

      • api: AftermathApi

        The AftermathApi that supplies the gRPC object and dynamic field readers. Its addresses.nfts value must include packages.mystenTransferPolicy.

      Returns NftsApi

      Error when the provider has no NFT addresses.

    addresses: NftsAddresses

    NFT package addresses used to derive the personal-kiosk type.

    objectTypes: { personalKioskCap: string }

    Fully qualified Move types used by the NFT readers.

    Type Declaration

    • personalKioskCap: string

      The personal-kiosk owner-cap type derived from addresses.

    • Fetches and casts kiosk owner caps from a list of object IDs.

      This method performs gRPC object-batch reads. It selects the regular or personal-kiosk caster from each object's Move type and drops per-object errors handled by the underlying batch reader.

      Parameters

      • inputs: { kioskOwnerCapIds: string[] }

        The owner-cap object IDs to fetch.

      Returns Promise<KioskOwnerCapObject[]>

      Cast kiosk owner caps for objects returned by gRPC.

      Errors from a batch request or a caster.

    • Loads the NFTs for each kiosk represented by owner caps.

      This method performs gRPC dynamic-field and object reads by calling fetchNftsInKiosk once for each cap. The returned kiosks preserve the input cap order. isPersonal is true only when the cap's objectType equals objectTypes.personalKioskCap.

      Parameters

      • inputs: { kioskOwnerCaps: KioskOwnerCapObject[] }

        The kiosk owner-cap objects to materialize.

      Returns Promise<KioskObject[]>

      One kiosk object per input cap, including its NFT list.

      Errors from any kiosk NFT fetch.

    • Fetches owner caps by ID and materializes their kiosks.

      This method performs gRPC object, dynamic-field, and NFT Display reads by composing fetchKioskOwnerCaps and fetchKiosks.

      Parameters

      • inputs: { kioskOwnerCapIds: string[] }

        The regular or personal-kiosk owner-cap object IDs.

      Returns Promise<KioskObject[]>

      The materialized kiosk objects in owner-cap order.

      Errors from the underlying gRPC reads or casters.

    • Fetches and casts a batch of NFT object IDs.

      This method performs gRPC object reads in batches of at most 50 IDs and requests Display output. Missing object responses and objects that do not have usable Display fields are omitted from the returned array.

      Parameters

      • inputs: { objectIds: string[] }

        The Sui object IDs to fetch.

      Returns Promise<Nft[]>

      Renderable NFTs for the successfully fetched IDs.

      Errors from the gRPC object reader or NFT caster.

    • Fetches renderable NFTs stored in a kiosk's dynamic fields.

      This method performs paginated gRPC dynamic-field reads and then fetches the referenced objects with Display output. The dynamic-field helper consumes all pages before the NFT object batch is loaded.

      Parameters

      • inputs: { kioskObjectId: string }

        The kiosk object ID used as the dynamic-field parent.

      Returns Promise<Nft[]>

      Renderable NFTs found in the kiosk.

      Errors from dynamic-field, object, or NFT casting operations.

    • Fetches regular and personal-kiosk owner caps owned by a wallet.

      This method performs two paginated gRPC owned-object queries: one for 0x2::kiosk::KioskOwnerCap and one for the derived personal-kiosk cap type. The returned array concatenates the regular-cap results before the personal-cap results.

      Parameters

      • inputs: { walletAddress: string }

        The owner's Sui address.

      Returns Promise<KioskOwnerCapObject[]>

      Kiosk owner caps owned by the wallet.

      Errors from either gRPC owned-object query or its casters.

    • Fetches all kiosks owned by a wallet and loads their NFTs.

      This method performs paginated gRPC owned-object reads followed by dynamic field and NFT object reads for each kiosk. It includes both regular and personal kiosks and marks each result with isPersonal.

      Parameters

      • inputs: { walletAddress: string }

        The wallet address whose kiosk owner caps are queried.

      Returns Promise<KioskObject[]>

      The wallet's kiosks and their renderable NFTs.

      import { AftermathApi } from "aftermath-ts-sdk";

      declare const aftermathApi: AftermathApi;
      const kiosks = await aftermathApi.Nfts().fetchOwnedKiosks({
      walletAddress: "0x00000000000000000000000000000000000000000000000000000000000000aa",
      });

      Errors from owned-object, dynamic-field, or NFT object reads.

    • Fetches renderable NFTs owned by a wallet address.

      This method performs paginated gRPC object reads through Objects().fetchOwnedObjects and requests Display output. Objects without Display data, with Display errors, or with no non-empty display field are omitted by the caster.

      Parameters

      • inputs: { walletAddress: string }

        The owner's Sui address.

      Returns Promise<Nft[]>

      Renderable NFTs in the order returned by the object reader.

      Errors from the gRPC object reader or NFT caster.