Class IndexerClient

Provides methods for retrieving data from Aptos Indexer. For more detailed Queries specification see https://cloud.hasura.io/public/graphiql?endpoint=https://indexer.mainnet.aptoslabs.com/v1/graphql

Hierarchy

Constructors

Properties

endpoint: string

Methods

  • Queries an account coin data

    Returns

    GetAccountCoinsDataQuery response type

    Parameters

    • ownerAddress: MaybeHexString

      Owner address

    • Optional options: PaginationArgs

    Returns Promise<GetAccountCoinsDataQuery>

  • Queries an Aptos account's NFTs by owner address

    Returns

    GetAccountCurrentTokensQuery response type

    Parameters

    • ownerAddress: MaybeHexString

      Hex-encoded 32 byte Aptos account address

    • Optional options: PaginationArgs

    Returns Promise<GetAccountCurrentTokensQuery>

  • Gets the count of tokens owned by an account

    Returns

    AccountTokensCountQuery response type

    Parameters

    Returns Promise<GetAccountTokensCountQuery>

  • Gets the count of transactions submitted by an account

    Returns

    GetAccountTransactionsCountQuery response type

    Parameters

    Returns Promise<GetAccountTransactionsCountQuery>

  • Queries an account transactions data

    Returns

    GetAccountTransactionsDataQuery response type

    Parameters

    Returns Promise<GetAccountTransactionsDataQuery>

  • Queries a collection address.

    Returns

    the collection address

    Parameters

    • creatorAddress: MaybeHexString

      the collection creator address

    • collectionName: string

      the collection name

    • Optional extraArgs: {
          tokenStandard?: TokenStandard;
      }
      • Optional tokenStandard?: TokenStandard

    Returns Promise<string>

  • Queries data of a specific collection by the collection creator address and the collection name.

    if, for some reason, a creator account has 2 collections with the same name in v1 and v2, can pass an optional tokenStandard parameter to query a specific standard

    Returns

    GetCollectionDataQuery response type

    Parameters

    • creatorAddress: MaybeHexString

      the collection creator address

    • collectionName: string

      the collection name

    • Optional extraArgs: {
          options?: PaginationArgs;
          tokenStandard?: TokenStandard;
      }
      • Optional options?: PaginationArgs
      • Optional tokenStandard?: TokenStandard

    Returns Promise<GetCollectionDataQuery>

  • Queries for all collections that an account has tokens for.

    Returns

    GetCollectionsWithOwnedTokensQuery response type

    Parameters

    • ownerAddress: MaybeHexString

      the account address that owns the tokens

    • Optional extraArgs: {
          options?: PaginationArgs;
          tokenStandard?: TokenStandard;
      }
      • Optional options?: PaginationArgs
      • Optional tokenStandard?: TokenStandard

    Returns Promise<GetCollectionsWithOwnedTokensQuery>

  • Queries delegated staking activities

    Returns

    GetDelegatedStakingActivitiesQuery response type

    Parameters

    Returns Promise<GetDelegatedStakingActivitiesQuery>

  • Queries Indexer Ledger Info

    Returns

    GetLedgerInfoQuery response type

    Returns Promise<GetIndexerLedgerInfoQuery>

  • Queries current number of delegators in a pool

    Returns

    GetNumberOfDelegatorsQuery response type

    Parameters

    Returns Promise<GetNumberOfDelegatorsQuery>

  • Queries account's current owned tokens. This query returns all tokens (v1 and v2 standards) an account owns, including NFTs, fungible, soulbound, etc. If you want to get only the token from a specific standrd, you can pass an optional tokenStandard param

    Example

    An example of how to pass a specific token standard

    {
    tokenStandard:"v2"
    }

    Returns

    GetOwnedTokensQuery response type

    Parameters

    • ownerAddress: MaybeHexString

      The token owner address we want to get the tokens for

    • Optional extraArgs: {
          options?: PaginationArgs;
          tokenStandard?: TokenStandard;
      }
      • Optional options?: PaginationArgs
      • Optional tokenStandard?: TokenStandard

    Returns Promise<GetOwnedTokensQuery>

  • Queries a token activities by token id hash

    Returns

    GetTokenActivitiesQuery response type

    Parameters

    • idHash: string

      token id hash

    • Optional options: PaginationArgs

    Returns Promise<GetTokenActivitiesQuery>

  • Gets the count of token's activities

    Returns

    GetTokenActivitiesCountQuery response type

    Parameters

    • tokenId: string

      Token ID

    Returns Promise<GetTokenActivitiesCountQuery>

  • Queries token data

    Returns

    GetTokenDataQuery response type

    Parameters

    • tokenId: string

      Token ID

    Returns Promise<GetTokenDataQuery>

  • Queries all tokens of a specific collection that an account owns by the collection address

    Returns

    GetTokenOwnedFromCollectionQuery response type

    Parameters

    • ownerAddress: MaybeHexString

      owner address that owns the tokens

    • collectionAddress: string

      the collection address

    • Optional extraArgs: {
          options?: PaginationArgs;
          tokenStandard?: TokenStandard;
      }
      • Optional options?: PaginationArgs
      • Optional tokenStandard?: TokenStandard

    Returns Promise<GetTokenOwnedFromCollectionQuery>

  • Queries all tokens of a specific collection that an account owns by the collection name and collection creator address

    Returns

    GetTokenOwnedFromCollectionQuery response type

    Parameters

    • ownerAddress: MaybeHexString

      owner address that owns the tokens

    • collectionName: string

      the collection name

    • creatorAddress: MaybeHexString

      the collection creator address

    • Optional extraArgs: {
          options?: PaginationArgs;
          tokenStandard?: TokenStandard;
      }
      • Optional options?: PaginationArgs
      • Optional tokenStandard?: TokenStandard

    Returns Promise<GetTokenOwnedFromCollectionQuery>

  • Queries token owners data

    Returns

    GetTokenOwnersDataQuery response type

    Parameters

    • tokenId: string

      Token ID

    • propertyVersion: number

      Property version

    Returns Promise<GetTokenOwnersDataQuery>

  • Queries top user transactions

    Returns

    GetTopUserTransactionsQuery response type

    Parameters

    • limit: number

    Returns Promise<GetTopUserTransactionsQuery>

  • Queries top user transactions

    Returns

    GetUserTransactionsQuery response type

    Parameters

    • Optional startVersion: number
    • Optional options: PaginationArgs

    Returns Promise<GetUserTransactionsQuery>

  • Builds a axios client call to fetch data from Aptos Indexer.

    Type Parameters

    • T

    Parameters

    • graphqlQuery: GraphqlQuery

      A GraphQL query to pass in the data axios call.

    Returns Promise<T>

  • Indexer only accepts address in the long format, i.e a 66 chars long -> 0x<64 chars> This method makes sure address is 66 chars long.

    Parameters

    • address: string

    Returns void

Generated using TypeDoc