bitcoinjs-lib/ts_src/templates/pubkey/input.ts
2019-03-07 14:16:45 +09:00

16 lines
365 B
TypeScript

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