mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 20:25:51 +00:00
Escrow tutorial [WIP]
This commit is contained in:
9
content/code_samples/escrow/makecondition.js
Normal file
9
content/code_samples/escrow/makecondition.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const cc = require('five-bells-condition')
|
||||
const crypto = require('crypto')
|
||||
|
||||
const preimageData = crypto.randomBytes(32)
|
||||
const myFulfillment = new cc.PreimageSha256()
|
||||
myFulfillment.setPreimage(preimageData)
|
||||
|
||||
console.log('Condition:', myFulfillment.getConditionBinary().toString('hex').toUpperCase())
|
||||
console.log('Fulfillment:', myFulfillment.serializeBinary().toString('hex').toUpperCase())
|
||||
Reference in New Issue
Block a user