Broadcast Message

Sign Message & Broadcast

Message, account and api_server are required.

import { signature } from "aleph-sdk-ts/messages/create";

(async() => {
  await signature.SignAndBroadcast({
    message: message_to_broadcast,
    account: account,
    APIServer: api_url
  })
})()

Required parameters

ParameterDescription

message - object

Message to broadcast

account - Account

Account to sign the message

APIServer - string

Target API server

message object should have the following structure:

{
  _id?: MongoDBID;
  chain: ChainType;
  sender: string;
  type: MessageType;
  channel: string;
  confirmations?: MessageConfirmation[];
  confirmed: boolean;
  signature: string;
  size: number;
  time: number;
  item_type: StorageEngine | "INLINE";
  item_content: string;
  hash_type?: string;
  item_hash: string;
  content?: {address: string, time: number;};
}

Optional parameters

None

Last updated