File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { PayloadBuilder } from '@xyo-network/payload-builder'
2- import type { Payload } from '@xyo-network/payload-model'
3- import type { HashPayload } from '@xyo-network/xl1-sdk'
2+ import { asSchema , type Payload } from '@xyo-network/payload-model'
3+ import { type HashPayload , HashSchema } from '@xyo-network/xl1-sdk'
44
55/**
66 * Generates random data for a transaction.
@@ -9,11 +9,11 @@ import type { HashPayload } from '@xyo-network/xl1-sdk'
99export const getRandomTransactionData = async ( ) => {
1010 // Data to store off-chain
1111 const salt = `Hello from Sample - ${ new Date ( ) . toISOString ( ) } `
12- const idPayload : Payload < { salt : string } > = { schema : 'network.xyo.id' , salt }
12+ const idPayload : Payload < { salt : string } > = { schema : asSchema ( 'network.xyo.id' , true ) , salt }
1313
1414 // Data to store on-chain (can reference the off-chain data)
1515 const hash = await PayloadBuilder . hash ( idPayload )
16- const hashPayload : HashPayload = { schema : 'network.xyo.hash' , hash }
16+ const hashPayload : HashPayload = { schema : HashSchema , hash }
1717
1818 return {
1919 offChainData : [ idPayload ] ,
You can’t perform that action at this time.
0 commit comments