List all keys & values

Returns

A list of aggregate keys and corresponding values found for the address.

Up to 1,000 results will be returned.

Usage

import { aggregates } from 'aleph-js'

await aggregates.fetch(address)

// Or with an optional object of additional parameters
await aggregates.fetch(address, {keys: ["my_key"]})

Required parameters

Optional parameters

In addition to the required parameters above, an object of optional parameters can be passed following the address parameter like so:

aggregates.fetch(address,{api_server: "https://api2.aleph.im"})

  • api_server - string

    Default: "https://api1.aleph.im"

    Target API server

  • keys - array

    Default: null

    If none are passed, all keys and their content found for the address will be returned.

    If some are passed, only the key value pairs with those keys will be returned for the address_._

Example

RETRIEVE AGGREGATE
import { aggregates } from 'aleph-js'

await aggregates.fetch(account.address)

In this example, all key-value pairs for the address are returned.

RESPONSE
// If an aggregates are found for the address
// The key-value pairs are returned
{ mykey: { a: 3, b: 2, c: 5 }, 
  mysecondkey: { a: 1, d:6 } 
}

// If none are found - null is returned
null

Last updated