bitcoinjs-lib/src/templates/nulldata.ts

19 lines
337 B
TypeScript
Raw Normal View History

// OP_RETURN {data}
2018-06-25 16:25:12 +10:00
const bscript = require('../script')
const OPS = require('bitcoin-ops')
2018-12-26 18:37:09 +09:00
export function check (script) {
const buffer = bscript.compile(script)
return buffer.length > 1 &&
buffer[0] === OPS.OP_RETURN
}
check.toJSON = function () { return 'null data output' }
2018-12-26 18:37:09 +09:00
const output = { check }
export {
output
}