UNPKG

@jmcanterafonseca-iota/anchoring-channels

Version:

Powered by IOTA Streams, Anchor Channels is an easy to be used library that allows to anchor messages to the Tangle.

30 lines (29 loc) 931 B
import { Subscriber } from "@jmcanterafonseca-iota/iota_streams_wasm"; import { IBindChannelRequest } from "../models/IBindChannelRequest"; /** * Service to interact with IOTA Streams Channels * */ export default class ChannelService { /** * Creates a new Channel * @param node The node on which the channel is created * @param seed The channel's seed * * @returns The address of the channel created and the announce message ID * */ static createChannel(node: string, seed: string): Promise<{ channelAddress: string; announceMsgID: string; }>; /** * Binds to a channel by creating the corresponding IOTA Streams Subscriber and reading * the announce message * * @param request The channel details * * @returns IOTA Streams Subscriber object */ static bindToChannel(request: IBindChannelRequest): Promise<Subscriber>; }