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

    The Sui class provides utilities to fetch core Sui chain information, such as the system state. It also exposes a set of constant addresses related to the Sui network package IDs.

    Hierarchy (View Summary)

    Index

    An optional AftermathApi instance for advanced transaction building or data fetching.

    config: CallerConfig

    The mutable configuration used for subsequent requests.

    constants: {
        addresses: {
            suiClockId: string;
            suiPackageId: string;
            suiSystemStateId: string;
            zero: string;
        };
    } = ...

    Static constants containing important addresses on the Sui network:

    • zero: The zero address (commonly used as a null placeholder).
    • suiPackageId: The package ID for the Sui system package.
    • suiSystemStateId: The object ID for the Sui system state.
    • suiClockId: The object ID for the Sui on-chain clock.
    • Fetches the Sui system state summary object, which contains details about the current epoch, validator set, and other protocol-level data.

      Returns Promise<SuiSystemStateSummary>

      A promise that resolves to a SuiSystemStateSummary instance.

      const afSdk = await Aftermath.create({ network: "MAINNET" });

      const sui = afSdk.Sui();

      const systemState = await sui.getSystemState();
      console.log(systemState.epoch, systemState.validators);
    • 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.