Retrieve the profile key

Returns

Retrieves the aggregate for the address with the key "profile" and returns the content value if an aggregate is found. Otherwise, returns null.

Usage

import { aggregates } from 'aleph-js'
await aggregates.fetch_profile(address)

Required parameters

address - string

Chain address the Aggregate was created for.

Optional parameters

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

aggregates.fetch_profile(key,{api_server: "https://api2.aleph.im"})

  • api_server - string

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

    Target API server

Example

If you have previously created an aggregate with the key "profile", you would query it as followed:

RETRIEVE AGGREGATE WITH KEY PROFILE
import { aggregates } from 'aleph-js'

await aleph.aggregates.fetch_profile(account.address)

Aleph returns the content for the "profile" key and the address queried if one is found.

RESPONSE
// Example response

{ username: 'tallboy' }

Last updated