Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LookupAssetBalances

Hierarchy

Index

Constructors

Properties

intDecoding: IntDecoding
query: Record<string, any>

JSONRequest Methods

  • do(headers?: Record<string, any>): Promise<Record<string, any>>
  • Execute the request.

    Parameters

    • headers: Record<string, any> = {}

      Additional headers to send in the request. Optional.

    Returns Promise<Record<string, any>>

    A promise which resolves to the response data.

  • prepare(body: Uint8Array | Record<string, any>): Record<string, any>
  • Prepare a JSON response before returning it.

    Use this method to change and restructure response data as needed after receiving it from the do() method.

    Parameters

    • body: Uint8Array | Record<string, any>

      Response body received

    Returns Record<string, any>

  • Configure how integers in this request's JSON response will be decoded.

    The options are:

    • "default": Integers will be decoded according to JSON.parse, meaning they will all be Numbers and any values greater than Number.MAX_SAFE_INTEGER will lose precision.
    • "safe": All integers will be decoded as Numbers, but if any values are greater than Number.MAX_SAFE_INTEGER an error will be thrown.
    • "mixed": Integers will be decoded as Numbers if they are less than or equal to Number.MAX_SAFE_INTEGER, otherwise they will be decoded as BigInts.
    • "bigint": All integers will be decoded as BigInts.

    Parameters

    • method: IntDecoding

      The method to use when parsing the response for this request. Must be one of "default", "safe", "mixed", or "bigint".

    Returns LookupAssetBalances

Other Methods

  • path(): string

query Methods

  • Include all items including closed accounts, deleted applications, destroyed assets, opted-out asset holdings, and closed-out application localstates.

    Example 1

    const assetId = 163650;
    const assetBalances = await indexerClient
    .lookupAssetBalances(assetId)
    .includeAll(false)
    .do();

    Example 2

    const assetId = 163650;
    const assetBalances = await indexerClient
    .lookupAssetBalances(assetId)
    .includeAll()
    .do();

    Parameters

    • value: boolean = true

    Returns LookupAssetBalances

  • Specify the next page of results.

    Example

    const assetId = 163650;
    const maxResults = 20;

    const assetBalancesPage1 = await indexerClient
    .lookupAssetBalances(assetId)
    .limit(maxResults)
    .do();

    const assetBalancesPage2 = await indexerClient
    .lookupAssetBalances(assetId)
    .limit(maxResults)
    .nextToken(assetBalancesPage1["next-token"])
    .do();

    Parameters

    • nextToken: string

      provided by the previous results.

    Returns LookupAssetBalances

Generated using TypeDoc