Create an aggregate key

Call the .Publish function to create an aggregate of a key-value pair for an account.

Returns

A Promise<void> that resolves to an undefined.

Usage & Example

import { aggregate } from 'aleph-sdk-ts'
import { StorageEngine } from "aleph-sdk-ts/messages/message"

(async () => {
  await aggregate.Publish({
    account: account,
    key: 'test_key',
    content: {'a': 1, 'b': 2 },
    channel: "TEST",
    storageEngine: StorageEngine.STORAGE,
    inlineRequested: true,
    APIServer: "https://api2.aleph.im"
  })
})();

Required parameters

ParameterDescription

account - Account

Sender's account to use for signing.

key - string

Key to mutate

content - object

The value content object to save for the key. Must be of the following format:

{k_1: v_1, k_2: v_2}

channel - string

Channel of the message. Ideally, an application would decide and use one channel.

storageEngine - StorageEngine

Storage engine to use, either Aleph storage or IPFS.

Possible values: StorageEngine.STORAGE or StorageEngine.IPFS

inlineRequested - boolean

APIServer - string

The API server endpoint used to carry the request to the Aleph's network

Last updated