bitcore-channel
bitcore-channel copied to clipboard
Update examples with the latest version of bitcore v0.13.x
examples/01.createChannel.js
fs.writeFileSync('unsigned.refund.log', consumer.setupRefund().toJSON());
write [object Object]
so that is not working examples/02.signRefund.js var refund = JSON.parse(String(fs.readFileSync('unsigned.refund.log')));
The behavior or toJSON() has recently changed in the latest Bitcore release (see release notes), and JSON.stringify will return a string:
JSON.stringify(consumer.setupRefund())
The examples need to be updated.
Updated in: https://github.com/bitpay/bitcore-channel/pull/37