bitcoinjs-lib/ts_src/templates/nulldata.ts

18 lines
367 B
TypeScript
Raw Normal View History

// OP_RETURN {data}
2018-12-28 05:18:42 +01:00
import * as bscript from '../script'
const OPS = bscript.OPS
2018-12-28 05:18:42 +01:00
export function check (script: Buffer | Array<number | Buffer>): boolean {
const buffer = bscript.compile(script)
return buffer.length > 1 &&
buffer[0] === OPS.OP_RETURN
}
check.toJSON = function () { return 'null data output' }
2018-12-26 10:37:09 +01:00
const output = { check }
export {
output
}