A class to query all Object related queries on Aptos.

Hierarchy (view full)

Object

  • Creates an instance of the Aptos client with the provided configuration. This allows interaction with the Aptos blockchain using the specified settings.

    Parameters

    • config: AptosConfig

      The configuration settings for the Aptos client.

    Returns AptosObject

    import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";

    async function runExample() {
    // Create a configuration for the Aptos client
    const config = new AptosConfig({
    network: Network.TESTNET, // Specify the desired network
    nodeUrl: "https://testnet.aptos.dev", // Replace with your node URL
    });

    // Create an instance of the Aptos client
    const aptos = new Aptos(config);

    console.log("Aptos client created successfully", aptos);
    }
    runExample().catch(console.error);
  • Fetches the object data based on the specified object address.

    Parameters

    • args: {
          minimumLedgerVersion?: AnyNumber;
          objectAddress: AccountAddressInput;
          options?: PaginationArgs & OrderByArg<{
              allow_ungated_transfer: boolean;
              is_deleted: boolean;
              last_guid_creation_num: any;
              last_transaction_version: any;
              object_address: string;
              owner_address: string;
              state_key_hash: string;
          }>;
      }
      • OptionalminimumLedgerVersion?: AnyNumber

        Optional minimum ledger version to wait for.

      • objectAddress: AccountAddressInput

        The object address to retrieve data for.

      • Optionaloptions?: PaginationArgs & OrderByArg<{
            allow_ungated_transfer: boolean;
            is_deleted: boolean;
            last_guid_creation_num: any;
            last_transaction_version: any;
            object_address: string;
            owner_address: string;
            state_key_hash: string;
        }>

        Optional configuration options for pagination and ordering.

    Returns Promise<{
        allow_ungated_transfer: boolean;
        is_deleted: boolean;
        last_guid_creation_num: any;
        last_transaction_version: any;
        object_address: string;
        owner_address: string;
        state_key_hash: string;
    }>

    The object data corresponding to the provided address.

    import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";

    const config = new AptosConfig({ network: Network.TESTNET });
    const aptos = new Aptos(config);

    async function runExample() {
    // Fetching object data by object address
    const objectData = await aptos.getObjectDataByObjectAddress({
    objectAddress: "0x1", // replace with a real object address
    });

    console.log(objectData);
    }
    runExample().catch(console.error);

Properties

config: AptosConfig

The configuration settings for the Aptos client.

MMNEPVFCICPMFPCPTTAAATR