Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LookupAccountTransactions

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 LookupAccountTransactions

Other Methods

  • path(): string

query Methods

  • Filtered results should have an amount greater than this value, as int, representing microAlgos, unless an asset-id is provided, in which case units are in the asset's units.

    Example 1

    const minBalance = 300000;
    const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
    const accountTxns = await indexerClient
    .lookupAccountTransactions(address)
    .currencyGreaterThan(minBalance - 1)
    .do();

    Example 2

    const assetID = 163650;
    const minBalance = 300000;
    const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
    const accountTxns = await indexerClient
    .lookupAccountTransactions(address)
    .assetID(assetID)
    .currencyGreaterThan(minBalance - 1)
    .do();
    remarks

    If you are looking for transactions with the currency amount greater than 0, simply construct the query without currencyGreaterThan because it doesn't accept -1, and passing the 0 currency-greater-than value would exclude transactions with a 0 amount.

    Parameters

    • greater: number

    Returns LookupAccountTransactions

  • Filtered results should have an amount less than this value, as int, representing microAlgos, unless an asset-id is provided, in which case units are in the asset's units.

    Example 1

    const maxBalance = 500000;
    const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
    const accountTxns = await indexerClient
    .lookupAccountTransactions(address)
    .currencyLessThan(maxBalance + 1)
    .do();

    Example 2

    const assetID = 163650;
    const maxBalance = 500000;
    const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
    const accountTxns = await indexerClient
    .lookupAccountTransactions(address)
    .assetID(assetID)
    .currencyLessThan(maxBalance + 1)
    .do();

    Parameters

    • lesser: number

    Returns LookupAccountTransactions

  • The next page of results. Use the next token provided by the previous results.

    Example

    const maxResults = 25;
    const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";

    const accountTxnsPage1 = await indexerClient
    .lookupAccountTransactions(address)
    .limit(maxResults)
    .do();

    const accountTxnsPage2 = await indexerClient
    .lookupAccountTransactions(address)
    .limit(maxResults)
    .nextToken(accountTxnsPage1["next-token"])
    .do();

    Parameters

    • nextToken: string

      provided by the previous results.

    Returns LookupAccountTransactions

  • Specifies a prefix which must be contained in the note field.

    Example

    const notePrefixBase64Encoded = "Y3JlYXRl";
    const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
    const accountTxns = await indexerClient
    .lookupAccountTransactions(address)
    .notePrefix(notePrefixBase64Encoded)
    .do();

    Parameters

    • prefix: string | Uint8Array

      base64 string or uint8array

    Returns LookupAccountTransactions

  • Lookup the specific transaction by ID.

    Example

    const txId = "MEUOC4RQJB23CQZRFRKYEI6WBO73VTTPST5A7B3S5OKBUY6LFUDA";
    const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
    const accountTxns = await indexerClient
    .lookupAccountTransactions(address)
    .txid(txId)
    .do();
    remarks

    Alternatively, use indexerClient.lookupTransactionByID(txnId).do()

    Parameters

    • txid: string

    Returns LookupAccountTransactions

Generated using TypeDoc