Stream data on-chain
Basic usage
import {Streamnote} from "blocknote"
const options = {
title: "",
mime: "text/plain"
getPayloadTransactionId: (payload_transaction_id) => {
// Return the payload_transaction_id.
// It is required for those who want to read to the stream.
console.log("stream id: "+payload_transaction_id);
},
onFinish: (result) => { console.log("finish", result); }
}
const sender_mnemonic = "gorilla shiver hood theory letter absorb arctic ...";
const stream = new Streamnote(sender_mnemonic, options);
stream.send("some data to stream, can be utf8, arrayBuffer or uint8array");
stream.send("send some more data");
stream.send("and a bit more");
stream.stop(); // Ends the stream.Constructor
Name
Description
Type
Options
Name
Description
Type
Default
Methods
send
Parameters
Name
Description
Type
Return
stop
Return
Last updated