import { PubsubMessage , serialize } from '../pubsub-message' ; import * as uint8arrays from 'uint8arrays' ; import { IPFSPubsubMessage } from '../incoming-channel' ; import * as random from '@stablelib/random' ; param data param from export function asIpfsMessage ( data , from ? ) { return { from : from || 'outer-space' , data : serialize ( data ) , topicIDs : [ 'topic' ] , seqno : random . randomBytes ( 10 ) , signature : random . randomBytes ( 10 ) , key : random . randomBytes ( 10 ) , } ; }