bitcoinjs-lib/ts_src/templates/pubkey/input.ts
2019-03-06 21:38:36 +09:00

14 lines
356 B
TypeScript

// {signature}
import * as bscript from '../../script';
export function check(script: Buffer | Array<number | Buffer>): boolean {
const chunks = <Array<number | Buffer>>bscript.decompile(script);
return (
chunks.length === 1 && bscript.isCanonicalScriptSignature(<Buffer>chunks[0])
);
}
check.toJSON = function() {
return 'pubKey input';
};