File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { Id } from "@xyo-network/id-payload-plugin"
2+ import { PayloadBuilder } from "@xyo-network/payload-builder"
3+ import { HashPayload } from "@xyo-network/xl1-protocol"
4+
5+ export const buildSamplePayloads = async ( ) => {
6+ // Data to store off-chain
7+ const offChainPayloads : Id [ ] = [ 0 , 1 ] . map ( index => ( {
8+ schema : 'network.xyo.id' ,
9+ salt : `Hello from Sample ${ index } - ${ new Date ( ) . toISOString ( ) } ` ,
10+ } ) )
11+
12+ // build a hash payload with the hash of the off-chain payload
13+ const hashPayloads : HashPayload [ ] = await Promise . all ( [ 0 , 1 ] . map ( async index => ( {
14+ schema : 'network.xyo.hash' ,
15+ hash : await PayloadBuilder . hash ( offChainPayloads [ index ] ) ,
16+ } ) ) )
17+ return { offChainPayloads, hashPayloads }
18+ }
Original file line number Diff line number Diff line change 1- export * from './getXyoGateway.ts'
1+ export * from './getXyoGateway.ts'
2+ export * from './buildSamplePayloads.ts'
You can’t perform that action at this time.
0 commit comments