Function query

  • Name

    query

    Summary

    Generic function to make a chain query.

    Example


    // you can query without any args
    const data = await query('balances', 'totalIssuance');

    // or you can pass args parameters to the storage query
    const data = await query('system', 'account', ['5GesFQSwhmuMKAHcDrfm21Z5xrq6kW93C1ch2Xosq1rXx2Eh']);

    Returns

    Result of the query storage call

    Parameters

    • module: string

      The section required to make the chain query (eg. "system")

    • call: string

      The call depending on the section (eg. "account")

    • args: any[] = []

      Array of args for the call

    • Optional callback: ((result: any) => void)

      Callback function to enable subscription, if not given, no subscription will be made

        • (result: any): void
        • Parameters

          • result: any

          Returns void

    Returns Promise<Codec>

Generated using TypeDoc