2016-11-02 12:30:37 +11:00
|
|
|
// {signature}
|
|
|
|
|
2018-12-28 13:23:23 +09:00
|
|
|
import * as bscript from '../../script'
|
2016-11-02 12:30:37 +11:00
|
|
|
|
2018-12-28 13:23:23 +09:00
|
|
|
export function check (script: Buffer | Array<number | Buffer>): boolean {
|
2018-12-29 01:55:07 +09:00
|
|
|
const chunks = <Array<number | Buffer>>bscript.decompile(script)
|
2016-11-02 12:30:37 +11:00
|
|
|
|
|
|
|
return chunks.length === 1 &&
|
2018-12-28 13:23:23 +09:00
|
|
|
bscript.isCanonicalScriptSignature(<Buffer>chunks[0])
|
2016-11-02 12:30:37 +11:00
|
|
|
}
|
2016-11-02 14:33:46 +11:00
|
|
|
check.toJSON = function () { return 'pubKey input' }
|