@tangle.js/anchors
Version:
Anchoring messages to the Tangle. Powered by IOTA Streams
34 lines (33 loc) • 1 kB
TypeScript
import { Subscriber } from "@tangle.js/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;
authorPk: 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: Subscriber;
authorPk: string;
}>;
}