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

    Provides high-level reads for NFT AMM markets and creates market facades for pricing, NFT reads, and transaction construction.

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

    const sdk = await Aftermath.create({ network: "MAINNET" });
    const market = await sdk.NftAmm().getMarket({
    objectId: "0x<market-object-id>",
    });

    Hierarchy (View Summary)

    Index
    • Creates an NFT AMM facade without making a request.

      The optional api is stored for callers that construct the facade with a low-level provider. Requests still require a configured API host through config.

      Parameters

      • Optionalconfig: CallerConfig

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

      • Optionalapi: AftermathApi

        Optional AftermathApi used by NFT AMM transaction helpers.

      Returns NftAmm

    Optional AftermathApi used by NFT AMM transaction helpers.

    config: CallerConfig

    The mutable configuration used for subsequent requests.

    constants: {} = {}

    Reserved NFT AMM constants. No public constants are defined currently.

    • Fetches every NFT AMM market exposed by the Aftermath API.

      Returns Promise<NftAmmMarket[]>

      All returned market facades.

      AftermathTransportError when the HTTP request or JSON response fails.

      Error when the facade has no API host configured.

    • Fetches one NFT AMM market and wraps the response in an NftAmmMarket.

      This method performs an HTTP GET through the configured Aftermath API. The returned facade contains the market and pool data needed for local calculations. In the current implementation, this method passes config but not the facade's optional api to NftAmmMarket, so transaction and NFT-table methods on the returned object throw if it has no API instance.

      Parameters

      • inputs: { objectId: string }

        The market's on-chain object ID.

      Returns Promise<NftAmmMarket>

      The fetched market facade.

      AftermathTransportError when the HTTP request or JSON response fails.

      Error when the facade has no API host configured.

    • Fetches several NFT AMM markets concurrently and wraps each response.

      Each ID is requested through getMarket, so the method performs one HTTP request per ID and preserves the input order in the returned array.

      Parameters

      • inputs: { objectIds: string[] }

        The on-chain market object IDs to fetch.

      Returns Promise<NftAmmMarket[]>

      The market facades in the same order as inputs.objectIds.

      AftermathTransportError when any market request fails.

      Error when the facade has no API host configured.

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