Transaction

e14a84cc9985ea617e0f95011bc804d08459022ced8c1ce4493766c876a1ee20
( - )
255,251
2019-06-30 12:06:16
1
95,575 B

2 Outputs

Total Output:
  • j"1ChDHzdd1H4wSjgGMHyndZm6qxEDGjqpJLNsermatTest=y;var i=r(6),o=new i(24),s=new(r(94)),a=new i(1),f=new i(2),u=new i(5),c=(new i(16),new i(8),new i(10)),h=new i(3),d=(new i(7),new i(11)),l=new i(4),p=(new i(12),null);function b(){if(null!==p)return p;var t=[];t[0]=2;for(var e=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;i<e&&t[i]<=n&&r%t[i]!=0;i++);e!==i&&t[i]<=n||(t[e++]=r)}return p=t,t}function g(t){for(var e=b(),r=0;r<e.length;r++)if(0===t.modn(e[r]))return 0===t.cmpn(e[r]);return!0}function y(t){var e=i.mont(t);return 0===f.toRed(e).redPow(t.subn(1)).fromRed().cmpn(1)}function m(t,e){if(t<16)return new i(2===e||5===e?[140,123]:[140,39]);var r,p;for(e=new i(e);;){for(r=new i(n(Math.ceil(t/8)));r.bitLength()>t;)r.ishrn(1);if(r.isEven()&&r.iadd(a),r.testn(1)||r.iadd(f),e.cmp(f)){if(!e.cmp(u))for(;r.mod(c).cmp(h);)r.iadd(l)}else for(;r.mod(o).cmp(d);)r.iadd(l);if(g(p=r.shrn(1))&&g(r)&&y(p)&&y(r)&&s.test(p)&&s.test(r))return r}}},function(t,e,r){var n=r(6),i=r(69);function o(t){this.rand=t||new i.Rand}t.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(t)>=0);return i},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var i=t.bitLength(),o=n.mont(t),s=new n(1).toRed(o);e||(e=Math.max(1,i/48|0));for(var a=t.subn(1),f=0;!a.testn(f);f++);for(var u=t.shrn(f),c=a.toRed(o);e>0;e--){var h=this._randrange(new n(2),a);r&&r(h);var d=h.toRed(o).redPow(u);if(0!==d.cmp(s)&&0!==d.cmp(c)){for(var l=1;l<f;l++){if(0===(d=d.redSqr()).cmp(s))return!1;if(0===d.cmp(c))break}if(l===f)return!1}}return!0},o.prototype.getDivisor=function(t,e){var r=t.bitLength(),i=n.mont(t),o=new n(1).toRed(i);e||(e=Math.max(1,r/48|0));for(var s=t.subn(1),a=0;!s.testn(a);a++);for(var f=t.shrn(a),u=s.toRed(i);e>0;e--){var c=this._randrange(new n(2),s),h=t.gcd(c);if(0!==h.cmpn(1))return h;var d=c.toRed(i).redPow(f);if(0!==d.cmp(o)&&0!==d.cmp(u)){for(var l=1;l<a;l++){if(0===(d=d.redSqr()).cmp(o))return d.fromRed().subn(1).gcd(t);if(0===d.cmp(u))break}if(l===a)return(d=d.redSqr()).fromRed().subn(1).gcd(t)}}return!1}},function(t,e,r){var n=r(1),i=r(35).Reporter,o=r(0).Buffer;function s(t,e){i.call(this,e),o.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function a(t,e){if(Array.isArray(t))this.length=0,this.value=t.map(function(t){return t instanceof a||(t=new a(t,e)),this.length+=t.length,t},this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=o.byteLength(t);else{if(!o.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}n(s,i),e.DecoderBuffer=s,s.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},s.prototype.restore=function(t){var e=new s(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,i.prototype.restore.call(this,t.reporter),e},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},s.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");var r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},s.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},e.EncoderBuffer=a,a.prototype.join=function(t,e){return t||(t=new o(this.length)),e||(e=0),0===this.length?t:(Array.isArray(this.value)?this.value.forEach(function(r){r.join(t,e),e+=r.length}):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):o.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length),t)}},function(t,e,r){var n=e;n._reverse=function(t){var e={};return Object.keys(t).forEach(function(r){(0|r)==r&&(r|=0);var n=t[r];e[n]=r}),e},n.der=r(187)},function(t,e,r){var n=r(1),i=r(34),o=i.base,s=i.bignum,a=i.constants.der;function f(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new u,this.tree._init(t.body)}function u(t){o.Node.call(this,"der",t)}function c(t,e){var r=t.readUInt8(e);if(t.isError(r))return r;var n=a.tagClass[r>>6],i=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=t.readUInt8(e),t.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:a.tag[r]}}function h(t,e,r){var n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(0==(128&n))return n;var i=127&n;if(i>4)return t.error("length octect is too long");n=0;for(var o=0;o<i;o++){n<<=8;var s=t.readUInt8(r);if(t.isError(s))return s;n|=s}return n}t.exports=f,f.prototype.decode=function(t,e){return t instanceof o.DecoderBuffer||(t=new o.DecoderBuffer(t,e)),this.tree._decode(t,e)},n(u,o.Node),u.prototype._peekTag=function(t,e,r){if(t.isEmpty())return!1;var n=t.save(),i=c(t,'Failed to peek tag: "'+e+'"');return t.isError(i)?i:(t.restore(n),i.tag===e||i.tagStr===e||i.tagStr+"of"===e||r)},u.prototype._decodeTag=function(t,e,r){var n=c(t,'Failed to decode tag of "'+e+'"');if(t.isError(n))return n;var i=h(t,n.primitive,'Failed to get length of "'+e+'"');if(t.isError(i))return i;if(!r&&n.tag!==e&&n.tagStr!==e&&n.tagStr+"of"!==e)return t.error('Failed to match tag: "'+e+'"');if(n.primitive||null!==i)return t.skip(i,'Failed to match body of: "'+e+'"');var o=t.save(),s=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(s)?s:(i=t.offset-o.offset,t.restore(o),t.skip(i,'Failed to match body of: "'+e+'"'))},u.prototype._skipUntilEnd=function(t,e){for(;;){var r=c(t,e);if(t.isError(r))return r;var n,i=h(t,r.primitive,e);if(t.isError(i))return i;if(n=r.primitive||null!==i?t.skip(i):this._skipUntilEnd(t,e),t.isError(n))return n;if("end"===r.tagStr)break}},u.prototype._decodeList=function(t,e,r,n){for(var i=[];!t.isEmpty();){var o=this._peekTag(t,"end");if(t.isError(o))return o;var s=r.decode(t,"der",n);if(t.isError(s)&&o)break;i.push(s)}return i},u.prototype._decodeStr=function(t,e){if("bitstr"===e){var r=t.readUInt8();return t.isError(r)?r:{unused:r,data:t.raw()}}if("bmpstr"===e){var n=t.raw();if(n.length%2==1)return t.error("Decoding of string type: bmpstr length mismatch");for(var i="",o=0;o<n.length/2;o++)i+=String.fromCharCode(n.readUInt16BE(2*o));return i}if("numstr"===e){var s=t.raw().toString("ascii");return this._isNumstr(s)?s:t.error("Decoding of string type: numstr unsupported characters")}if("octstr"===e)return t.raw();if("objDesc"===e)return t.raw();if("printstr"===e){var a=t.raw().toString("ascii");return this._isPrintstr(a)?a:t.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(e)?t.raw().toString():t.error("Decoding of string type: "+e+" unsupported")},u.prototype._decodeObjid=function(t,e,r){for(var n,i=[],o=0;!t.isEmpty();){var s=t.readUInt8();o<<=7,o|=127&s,0==(128&s)&&(i.push(o),o=0)}128&s&&i.push(o);var a=i[0]/40|0,f=i[0]%40;if(n=r?i:[a,f].concat(i.slice(1)),e){var u=e[n.join(" ")];void 0===u&&(u=e[n.join(".")]),void 0!==u&&(n=u)}return n},u.prototype._decodeTime=function(t,e){var r=t.raw().toString();if("gentime"===e)var n=0|r.slice(0,4),i=0|r.slice(4,6),o=0|r.slice(6,8),s=0|r.slice(8,10),a=0|r.slice(10,12),f=0|r.slice(12,14);else{if("utctime"!==e)return t.error("Decoding "+e+" time is not supported yet");n=0|r.slice(0,2),i=0|r.slice(2,4),o=0|r.slice(4,6),s=0|r.slice(6,8),a=0|r.slice(8,10),f=0|r.slice(10,12);n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,o,s,a,f,0)},u.prototype._decodeNull=function(t){return null},u.prototype._decodeBool=function(t){var e=t.readUInt8();return t.isError(e)?e:0!==e},u.prototype._decodeInt=function(t,e){var r=t.raw(),n=new s(r);return e&&(n=e[n.toString(10)]||n),n},u.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getDecoder("der").tree}},function(t,e,r){var n=r(1),i=r(0).Buffer,o=r(34),s=o.base,a=o.constants.der;function f(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new u,this.tree._init(t.body)}function u(t){s.Node.call(this,"der",t)}function c(t){return t<10?"0"+t:t}t.exports=f,f.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},n(u,s.Node),u.prototype._encodeComposite=function(t,e,r,n){var o,s=function(t,e,r,n){var i;"seqof"===t?t="seq":"setof"===t&&(t="set");if(a.tagByName.hasOwnProperty(t))i=a.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return n.error("Unknown tag: "+t);i=t}if(i>=31)return n.error("Multi-octet tag encoding unsupported");e||(i|=32);return i|=a.tagClassByName[r||"universal"]<<6}(t,e,r,this.reporter);if(n.length<128)return(o=new i(2))[0]=s,o[1]=n.length,this._createEncoderBuffer([o,n]);for(var f=1,u=n.length;u>=256;u>>=8)f++;(o=new i(2+f))[0]=s,o[1]=128|f;u=1+f;for(var c=n.length;c>0;u--,c>>=8)o[u]=255&c;return this._createEncoderBuffer([o,n])},u.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var r=new i(2*t.length),n=0;n<t.length;n++)r.writeUInt16BE(t.charCodeAt(n),2*n);return this._createEncoderBuffer(r)}return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)?this._createEncoderBuffer(t):"objDesc"===e?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported")},u.prototype._encodeObjid=function(t,e,r){if("string"==typeof t){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=e[t].split(/[\s\.]+/g);for(var n=0;n<t.length;n++)t[n]|=0}else if(Array.isArray(t)){t=t.slice();for(n=0;n<t.length;n++)t[n]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!r){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}var o=0;for(n=0;n<t.length;n++){var s=t[n];for(o++;s>=128;s>>=7)o++}var a=new i(o),f=a.length-1;for(n=t.length-1;n>=0;n--){s=t[n];for(a[f--]=127&s;(s>>=7)>0;)a[f--]=128|127&s}return this._createEncoderBuffer(a)},u.prototype._encodeTime=function(t,e){var r,n=new Date(t);return"gentime"===e?r=[c(n.getFullYear()),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[c(n.getFullYear()%100),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!i.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=new i(r)}if(i.isBuffer(t)){var n=t.length;0===t.length&&n++;var o=new i(n);return t.copy(o),0===t.length&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);n=1;for(var s=t;s>=256;s>>=8)n++;for(s=(o=new Array(n)).length-1;s>=0;s--)o[s]=255&t,t>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new i(o))},u.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},u.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},u.prototype._skipDefault=function(t,e,r){var n,i=this._baseState;if(null===i.default)return!1;var o=t.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,e,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n<o.length;n++)if(o[n]!==i.defaultBuffer[n])return!1;return!0}},function(t){t.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},function(t,e,r){var n=r(31),i=r(2).Buffer;function o(t){var e=i.allocUnsafe(4);return e.writeUInt32BE(t,0),e}t.exports=function(t,e){for(var r,s=i.alloc(0),a=0;s.length<e;)r=o(a++),s=i.concat([s,n("sha1").update(t).update(r).digest()]);return s.slice(0,e)}},function(t,e){t.exports=function(t,e){for(var r=t.length,n=-1;++n<r;)t[n]^=e[n];return t}},function(t,e,r){var n=r(6),i=r(2).Buffer;t.exports=function(t,e){return i.from(t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed().toArray())}},function(t,e,r){var n=r(201);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(t,e,r){"use strict";(function(e){var n=r(29),i=r(21),o=r(18),s=r(10),a=r(63),f=r(19),u=r(14),c=r(25),h=r(4),d=r(3),l=r(13),p=r(0),b=r(5),g=r(8),y=function t(e){return this instanceof t?(this.chunks=[],b.isBuffer(e)?t.fromBuffer(e):e instanceof n?t.fromAddress(e):e instanceof t?t.fromBuffer(e.toBuffer()):d.isString(e)?t.fromString(e):void(d.isObject(e)&&d.isArray(e.chunks)&&this.set(e))):new t(e)};y.prototype.set=function(t){return h.checkArgument(d.isObject(t)),h.checkArgument(d.isArray(t.chunks)),this.chunks=t.chunks,this},y.fromBuffer=function(t){var e=new y;e.chunks=[];for(var r=new i(t);!r.finished();)try{var n,o,s=r.readUInt8();s>0&&s<a.OP_PUSHDATA1?(n=s,e.chunks.push({buf:r.read(n),len:n,opcodenum:s})):s===a.OP_PUSHDATA1?(n=r.readUInt8(),o=r.read(n),e.chunks.push({buf:o,len:n,opcodenum:s})):s===a.OP_PUSHDATA2?(n=r.readUInt16LE(),o=r.read(n),e.chunks.push({buf:o,len:n,opcodenum:s})):s===a.OP_PUSHDATA4?(n=r.readUInt32LE(),o=r.read(n),e.chunks.push({buf:o,len:n,opcodenum:s})):e.chunks.push({opcodenum:s})}catch(e){if(e instanceof RangeError)throw new l.Script.InvalidBuffer(t.toString("hex"));throw e}return e},y.prototype.toBuffer=function(){for(var t=new o,e=0;e<this.chunks.length;e++){var r=this.chunks[e],n=r.opcodenum;t.writeUInt8(r.opcodenum),r.buf&&(n<a.OP_PUSHDATA1?t.write(r.buf):n===a.OP_PUSHDATA1?(t.writeUInt8(r.len),t.write(r.buf)):n===a.OP_PUSHDATA2?(t.writeUInt16LE(r.len),t.write(r.buf)):n===a.OP_PUSHDATA4&&(t.writeUInt32LE(r.len),t.write(r.buf)))}return t.concat()},y.fromASM=function(t){var r=new y;r.chunks=[];for(var n=t.split(" "),i=0;i<n.length;){var o=n[i],s=a(o).toNumber();if("0"===o)s=0,r.chunks.push({opcodenum:s}),i+=1;else if("-1"===o)s=a.OP_1NEGATE,r.chunks.push({opcodenum:s}),i+=1;else if(d.isUndefined(s)){var f=e.from(n[i],"hex"),u=f.length;u>=0&&u<a.OP_PUSHDATA1?s=u:u<Math.pow(2,8)?s=a.OP_PUSHDATA1:u<Math.pow(2,16)?s=a.OP_PUSHDATA2:u<Math.pow(2,32)&&(s=a.OP_PUSHDATA4),r.chunks.push({buf:f,len:f.length,opcodenum:s}),i+=1}else r.chunks.push({opcodenum:s}),i+=1}return r},y.fromHex=function(t){return new y(p.Buffer.from(t,"hex"))},y.fromString=function(t){if(g.isHexa(t)||0===t.length)return new y(p.Buffer.from(t,"hex"));var r=new y;r.chunks=[];for(var n=t.split(" "),i=0;i<n.length;){var o=n[i],s=a(o).toNumber();if(d.isUndefined(s)){if(!((s=parseInt(o))>0&&s<a.OP_PUSHDATA1))throw new Error("Invalid script: "+JSON.stringify(t));r.chunks.push({buf:e.from(n[i+1].slice(2),"hex"),len:s,opcodenum:s}),i+=2}else if(s===a.OP_PUSHDATA1||s===a.OP_PUSHDATA2||s===a.OP_PUSHDATA4){if("0x"!==n[i+2].slice(0,2))throw new Error("Pushdata data must start with 0x");r.chunks.push({buf:e.from(n[i+2].slice(2),"hex"),len:parseInt(n[i+1]),opcodenum:s}),i+=3}else r.chunks.push({opcodenum:s}),i+=1}return r},y.prototype._chunkToString=function(t,e){var r=t.opcodenum,n="asm"===e,i="";if(t.buf)n||r!==a.OP_PUSHDATA1&&r!==a.OP_PUSHDATA2&&r!==a.OP_PUSHDATA4||(i=i+" "+a(r).toString()),t.len>0&&(i=n?i+" "+t.buf.toString("hex"):i+" "+t.len+" 0x"+t.buf.toString("hex"));else if(void 0!==a.reverseMap[r])n?0===r?i+=" 0":79===r?i+=" -1":i=i+" "+a(r).toString():i=i+" "+a(r).toString();else{var o=r.toString(16);o.length%2!=0&&(o="0"+o),i=n?i+" "+o:i+" 0x"+o}return i},y.prototype.toASM=function(){for(var t="",e=0;e<this.chunks.length;e++){var r=this.chunks[e];t+=this._chunkToString(r,"asm")}return t.substr(1)},y.prototype.toString=function(){for(var t="",e=0;e<this.chunks.length;e++){var r=this.chunks[e];t+=this._chunkToString(r)}return t.substr(1)},y.prototype.toHex=function(){return this.toBuffer().toString("hex")},y.prototype.inspect=function(){return"<Script: "+this.toString()+">"},y.prototype.isPublicKeyHashOut=function(){return!(5!==this.chunks.length||this.chunks[0].opcodenum!==a.OP_DUP||this.chunks[1].opcodenum!==a.OP_HASH160||!this.chunks[2].buf||20!==this.chunks[2].buf.length||this.chunks[3].opcodenum!==a.OP_EQUALVERIFY||this.chunks[4].opcodenum!==a.OP_CHECKSIG)},y.prototype.isPublicKeyHashIn=function(){if(2===this.chunks.length){var t=this.chunks[0].buf,e=this.chunks[1].buf;if(t&&t.length&&48===t[0]&&e&&e.length){var r=e[0];if((4===r||6===r||7===r)&&65===e.length)return!0;if((3===r||2===r)&&33===e.length)return!0}}return!1},y.prototype.getPublicKey=function(){return h.checkState(this.isPublicKeyOut(),"Can't retrieve PublicKey from a non-PK output"),this.chunks[0].buf},y.prototype.getPublicKeyHash=function(){return h.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf},y.prototype.isPublicKeyOut=function(){if(2===this.chunks.length&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===a.OP_CHECKSIG){var t=this.chunks[0].buf,e=t[0],r=!1;if((4!==e&&6!==e&&7!==e||65!==t.length)&&(3!==e&&2!==e||33!==t.length)||(r=!0),r)return f.isValid(t)}return!1},y.prototype.isPublicKeyIn=function(){if(1===this.chunks.length){var t=this.chunks[0].buf;if(t&&t.length&&48===t[0])return!0}return!1},y.prototype.isScriptHashOut=function(){var t=this.toBuffer();return 23===t.length&&t[0]===a.OP_HASH160&&20===t[1]&&t[t.length-1]===a.OP_EQUAL},y.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var t,e=this.chunks[this.chunks.length-1].buf;if(!e)return!1;try{t=y.fromBuffer(e)}catch(t){if(t instanceof l.Script.InvalidBuffer)return!1;throw t}return t.classify()!==y.types.UNKNOWN},y.prototype.isMultisigOut=function(){return this.chunks.length>3&&a.isSmallIntOp(this.chunks[0].opcodenum)&&this.chunks.slice(1,this.chunks.length-2).every(function(t){return t.buf&&b.isBuffer(t.buf)})&&a.isSmallIntOp(this.chunks[this.chunks.length-2].opcodenum)&&this.chunks[this.chunks.length-1].opcodenum===a.OP_CHECKMULTISIG},y.prototype.isMultisigIn=function(){return this.chunks.length>=2&&0===this.chunks[0].opcodenum&&this.chunks.slice(1,this.chunks.length).every(function(t){return t.buf&&b.isBuffer(t.buf)&&u.isTxDER(t.buf)})},y.prototype.isDataOut=function(){if(!(this.chunks.length>=1&&this.chunks[0].opcodenum===a.OP_RETURN&&this.toBuffer().length<=1e5))return!1;var t=this.chunks.slice(1);return new y({chunks:t}).isPushOnly()},y.prototype.getData=function(){if(this.isDataOut()||this.isScriptHashOut())return d.isUndefined(this.chunks[1])?e.alloc(0):e.from(this.chunks[1].buf);if(this.isPublicKeyHashOut())return e.from(this.chunks[2].buf);throw new Error("Unrecognized script type to get data from")},y.prototype.isPushOnly=function(){return d.every(this.chunks,function(t){return t.opcodenum<=a.OP_16||t.opcodenum===a.OP_PUSHDATA1||t.opcodenum===a.OP_PUSHDATA2||t.opcodenum===a.OP_PUSHDATA4})},(y.types={}).UNKNOWN="Unknown",y.types.PUBKEY_OUT="Pay to public key",y.types.PUBKEY_IN="Spend from public key",y.types.PUBKEYHASH_OUT="Pay to public key hash",y.types.PUBKEYHASH_IN="Spend from public key hash",y.types.SCRIPTHASH_OUT="Pay to script hash",y.types.SCRIPTHASH_IN="Spend from script hash",y.types.MULTISIG_OUT="Pay to multisig",y.types.MULTISIG_IN="Spend from multisig",y.types.DATA_OUT="Data push",y.OP_RETURN_STANDARD_SIZE=220,y.prototype.classify=function(){if(this._isInput)return this.classifyInput();if(this._isOutput)return this.classifyOutput();var t=this.classifyOutput();return t!==y.types.UNKNOWN?t:this.classifyInput()},(y.outputIdentifiers={}).PUBKEY_OUT=y.prototype.isPublicKeyOut,y.outputIdentifiers.PUBKEYHASH_OUT=y.prototype.isPublicKeyHashOut,y.outputIdentifiers.MULTISIG_OUT=y.prototype.isMultisigOut,y.outputIdentifiers.SCRIPTHASH_OUT=y.prototype.isScriptHashOut,y.outputIdentifiers.DATA_OUT=y.prototype.isDataOut,y.prototype.classifyOutput=function(){for(var t in y.outputIdentifiers)if(y.outputIdentifiers[t].bind(this)())return y.types[t];return y.types.UNKNOWN},(y.inputIdentifiers={}).PUBKEY_IN=y.prototype.isPublicKeyIn,y.inputIdentifiers.PUBKEYHASH_IN=y.prototype.isPublicKeyHashIn,y.inputIdentifiers.MULTISIG_IN=y.prototype.isMultisigIn,y.inputIdentifiers.SCRIPTHASH_IN=y.prototype.isScriptHashIn,y.prototype.classifyInput=function(){for(var t in y.inputIdentifiers)if(y.inputIdentifiers[t].bind(this)())return y.types[t];return y.types.UNKNOWN},y.prototype.isStandard=function(){return this.classify()!==y.types.UNKNOWN},y.prototype.prepend=function(t){return this._addByType(t,!0),this},y.prototype.equals=function(t){if(h.checkState(t instanceof y,"Must provide another script"),this.chunks.length!==t.chunks.length)return!1;var e;for(e=0;e<this.chunks.length;e++){if(b.isBuffer(this.chunks[e].buf)&&!b.isBuffer(t.chunks[e].buf))return!1;if(b.isBuffer(this.chunks[e].buf)&&!b.equals(this.chunks[e].buf,t.chunks[e].buf))return!1;if(this.chunks[e].opcodenum!==t.chunks[e].opcodenum)return!1}return!0},y.prototype.add=function(t){return this._addByType(t,!1),this},y.prototype._addByType=function(t,e){if("string"==typeof t)this._addOpcode(t,e);else if("number"==typeof t)this._addOpcode(t,e);else if(t instanceof a)this._addOpcode(t,e);else if(b.isBuffer(t))this._addBuffer(t,e);else if(t instanceof y)this.chunks=this.chunks.concat(t.chunks);else{if("object"!=typeof t)throw new Error("Invalid script chunk");this._insertAtPosition(t,e)}},y.prototype._insertAtPosition=function(t,e){e?this.chunks.unshift(t):this.chunks.push(t)},y.prototype._addOpcode=function(t,e){var r;return r="number"==typeof t?t:t instanceof a?t.toNumber():a(t).toNumber(),this._insertAtPosition({opcodenum:r},e),this},y.prototype._addBuffer=function(t,e){var r,n=t.length;if(n>=0&&n<a.OP_PUSHDATA1)r=n;else if(n<Math.pow(2,8))r=a.OP_PUSHDATA1;else if(n<Math.pow(2,16))r=a.OP_PUSHDATA2;else{if(!(n<Math.pow(2,32)))throw new Error("You can't push that much data");r=a.OP_PUSHDATA4}return this._insertAtPosition({buf:t,len:n,opcodenum:r},e),this},y.prototype.removeCodeseparators=function(){for(var t=[],e=0;e<this.chunks.length;e++)this.chunks[e].opcodenum!==a.OP_CODESEPARATOR&&t.push(this.chunks[e]);return this.chunks=t,this},y.buildMultisigOut=function(t,e,r){h.checkArgument(e<=t.length,"Number of required signatures must be less than or equal to the number of public keys"),r=r||{};var n=new y;n.add(a.smallInt(e));var i=t=d.map(t,f);r.noSorting||(i=d.sortBy(t,function(t){return t.toString("hex")}));for(var o=0;o<i.length;o++){var s=i[o];n.add(s.toBuffer())}return n.add(a.smallInt(t.length)),n.add(a.OP_CHECKMULTISIG),n},y.buildMultisigIn=function(t,e,r,n){h.checkArgument(d.isArray(t)),h.checkArgument(d.isNumber(e)),h.checkArgument(d.isArray(r)),n=n||{};var i=new y;return i.add(a.OP_0),d.each(r,function(t){h.checkArgument(b.isBuffer(t),"Signatures must be an array of Buffers"),i.add(t)}),i},y.buildP2SHMultisigIn=function(t,e,r,n){h.checkArgument(d.isArray(t)),h.checkArgument(d.isNumber(e)),h.checkArgument(d.isArray(r)),n=n||{};var i=new y;return i.add(a.OP_0),d.each(r,function(t){h.checkArgument(b.isBuffer(t),"Signatures must be an array of Buffers"),i.add(t)}),i.add((n.cachedMultisig||y.buildMultisigOut(t,e,n)).toBuffer()),i},y.buildPublicKeyHashOut=function(t){h.checkArgument(!d.isUndefined(t)),h.checkArgument(t instanceof f||t instanceof n||d.isString(t)),t instanceof f?t=t.toAddress():d.isString(t)&&(t=new n(t));var e=new y;return e.add(a.OP_DUP).add(a.OP_HASH160).add(t.hashBuffer).add(a.OP_EQUALVERIFY).add(a.OP_CHECKSIG),e._network=t.network,e},y.buildPublicKeyOut=function(t){h.checkArgument(t instanceof f);var e=new y;return e.add(t.toBuffer()).add(a.OP_CHECKSIG),e},y.buildDataOut=function(t,r){h.checkArgument(d.isUndefined(t)||d.isString(t)||d.isArray(t)||b.isBuffer(t));var n=t;d.isArray(n)||(n=[t]);var i=new y;i.add(a.OP_RETURN);for(let t of n)h.checkArgument(d.isUndefined(t)||d.isString(t)||b.isBuffer(t)),d.isString(t)&&(t=e.from(t,r)),d.isUndefined(t)||i.add(t);return i},y.buildScriptHashOut=function(t){h.checkArgument(t instanceof y||t instanceof n&&t.isPayToScriptHash());var e=new y;return e.add(a.OP_HASH160).add(t instanceof n?t.hashBuffer:s.sha256ripemd160(t.toBuffer())).add(a.OP_EQUAL),e._network=t._network||t.network,e},y.buildPublicKeyIn=function(t,e){h.checkArgument(t instanceof u||b.isBuffer(t)),h.checkArgument(d.isUndefined(e)||d.isNumber(e)),t instanceof u&&(t=t.toBuffer());var r=new y;return r.add(b.concat([t,b.integerAsSingleByteBuffer(e||u.SIGHASH_ALL)])),r},y.buildPublicKeyHashIn=function(t,e,r){return h.checkArgument(e instanceof u||b.isBuffer(e)),h.checkArgument(d.isUndefined(r)||d.isNumber(r)),e instanceof u&&(e=e.toBuffer()),(new y).add(b.concat([e,b.integerAsSingleByteBuffer(r||u.SIGHASH_ALL)])).add(new f(t).toBuffer())},y.empty=function(){return new y},y.prototype.toScriptHashOut=function(){return y.buildScriptHashOut(this)},y.fromAddress=function(t){if((t=n(t)).isPayToScriptHash())return y.buildScriptHashOut(t);if(t.isPayToPublicKeyHash())return y.buildPublicKeyHashOut(t);throw new l.Script.UnrecognizedAddress(t)},y.prototype.getAddressInfo=function(t){if(this._isInput)return this._getInputAddressInfo();if(this._isOutput)return this._getOutputAddressInfo();var e=this._getOutputAddressInfo();return e||this._getInputAddressInfo()},y.prototype._getOutputAddressInfo=function(){var t={};if(this.isScriptHashOut())t.hashBuffer=this.getData(),t.type=n.PayToScriptHash;else{if(!this.isPublicKeyHashOut())return!1;t.hashBuffer=this.getData(),t.type=n.PayToPublicKeyHash}return t},y.prototype._getInputAddressInfo=function(){var t={};if(this.isPublicKeyHashIn())t.hashBuffer=s.sha256ripemd160(this.chunks[1].buf),t.type=n.PayToPublicKeyHash;else{if(!this.isScriptHashIn())return!1;t.hashBuffer=s.sha256ripemd160(this.chunks[this.chunks.length-1].buf),t.type=n.PayToScriptHash}return t},y.prototype.toAddress=function(t){var e=this.getAddressInfo();return!!e&&(e.network=c.get(t)||this._network||c.defaultNetwork,new n(e))},y.prototype.findAndDelete=function(t){for(var e=t.toBuffer().toString("hex"),r=0;r<this.chunks.length;r++){e===y({chunks:[this.chunks[r]]}).toBuffer().toString("hex")&&this.chunks.splice(r,1)}return this},y.prototype.checkMinimalPush=function(t){var e=this.chunks[t],r=e.buf,n=e.opcodenum;return!r||(0===r.length?n===a.OP_0:1===r.length&&r[0]>=1&&r[0]<=16?n===a.OP_1+(r[0]-1):1===r.length&&129===r[0]?n===a.OP_1NEGATE:r.length<=75?n===r.length:r.length<=255?n===a.OP_PUSHDATA1:!(r.length<=65535)||n===a.OP_PUSHDATA2)},y.prototype._decodeOP_N=function(t){if(t===a.OP_0)return 0;if(t>=a.OP_1&&t<=a.OP_16)return t-(a.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(t))},y.prototype.getSignatureOperationsCount=function(t){t=!!d.isUndefined(t)||t;var e=this,r=0,n=a.OP_INVALIDOPCODE;return d.each(e.chunks,function(i){var o=i.opcodenum;o===a.OP_CHECKSIG||o===a.OP_CHECKSIGVERIFY?r++:o!==a.OP_CHECKMULTISIG&&o!==a.OP_CHECKMULTISIGVERIFY||(t&&n>=a.OP_1&&n<=a.OP_16?r+=e._decodeOP_N(n):r+=20),n=o}),r},t.exports=y}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(e){var n=r(3),i=r(104),o=r(63),s=r(7),a=r(10),f=r(14),u=r(19),c=function t(e){if(!(this instanceof t))return new t(e);e?(this.initialize(),this.set(e)):this.initialize()};c.prototype.verify=function(t,e,o,s,a,f){var u,h=r(47);if(n.isUndefined(o)&&(o=new h),n.isUndefined(s)&&(s=0),n.isUndefined(a)&&(a=0),a&c.SCRIPT_ENABLE_SIGHASH_FORKID&&(a|=c.SCRIPT_VERIFY_STRICTENC,!f))throw new Error("internal error - need satoshisBN to verify FORKID transactions");if(this.set({script:t,tx:o,nin:s,flags:a,satoshisBN:f}),0!=(a&c.SCRIPT_VERIFY_SIGPUSHONLY)&&!t.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(!this.evaluate())return!1;a&c.SCRIPT_VERIFY_P2SH&&(u=this.stack.slice());var d=this.stack;if(this.initialize(),this.set({script:e,stack:d,tx:o,nin:s,flags:a,satoshisBN:f}),!this.evaluate())return!1;if(0===this.stack.length)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT",!1;var l=this.stack[this.stack.length-1];if(!c.castToBool(l))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK",!1;if(a&c.SCRIPT_VERIFY_P2SH&&e.isScriptHashOut()){if(!t.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(0===u.length)throw new Error("internal error - stack copy empty");var p=u[u.length-1],b=i.fromBuffer(p);if(u.pop(),this.initialize(),this.set({script:b,stack:u,tx:o,nin:s,flags:a,satoshisBN:f}),!this.evaluate())return!1;if(0===u.length)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK",!1;if(!c.castToBool(u[u.length-1]))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK",!1}if(0!=(a&c.SCRIPT_VERIFY_CLEANSTACK)){if(0==(a&c.SCRIPT_VERIFY_P2SH))throw new Error("internal error - CLEANSTACK without P2SH");if(1!==u.length)return this.errstr="SCRIPT_ERR_CLEANSTACK",!1}return!0},t.exports=c,c.prototype.initialize=function(t){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0},c.prototype.set=function(t){this.script=t.script||this.script,this.tx=t.tx||this.tx,this.nin=void 0!==t.nin?t.nin:this.nin,this.satoshisBN=t.satoshisBN||this.satoshisBN,this.stack=t.stack||this.stack,this.altstack=t.altstack||this.altstack,this.pc=void 0!==t.pc?t.pc:this.pc,this.pbegincodehash=void 0!==t.pbegincodehash?t.pbegincodehash:this.pbegincodehash,this.nOpCount=void 0!==t.nOpCount?t.nOpCount:this.nOpCount,this.vfExec=t.vfExec||this.vfExec,this.errstr=t.errstr||this.errstr,this.flags=void 0!==t.flags?t.flags:this.flags},c.true=e.from([1]),c.false=e.from([]),c.MAX_SCRIPT_ELEMENT_SIZE=520,c.MAXIMUM_ELEMENT_SIZE=4,c.LOCKTIME_THRESHOLD=5e8,c.LOCKTIME_THRESHOLD_BN=new s(c.LOCKTIME_THRESHOLD),c.SCRIPT_VERIFY_NONE=0,c.SCRIPT_VERIFY_P2SH=1,c.SCRIPT_VERIFY_STRICTENC=2,c.SCRIPT_VERIFY_DERSIG=4,c.SCRIPT_VERIFY_LOW_S=8,c.SCRIPT_VERIFY_NULLDUMMY=16,c.SCRIPT_VERIFY_SIGPUSHONLY=32,c.SCRIPT_VERIFY_MINIMALDATA=64,c.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,c.SCRIPT_VERIFY_CLEANSTACK=256,c.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,c.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY=1024,c.SCRIPT_VERIFY_MINIMALIF=8192,c.SCRIPT_VERIFY_NULLFAIL=16384,c.SCRIPT_VERIFY_COMPRESSED_PUBKEYTYPE=32768,c.SCRIPT_ENABLE_SIGHASH_FORKID=65536,c.SCRIPT_ENABLE_REPLAY_PROTECTION=1<<17,c.SCRIPT_ENABLE_MONOLITH_OPCODES=1<<18,c.SCRIPT_ENABLE_MAGNETIC_OPCODES=1<<19,c.SEQUENCE_LOCKTIME_DISABLE_FLAG=1<<31,c.SEQUENCE_LOCKTIME_TYPE_FLAG=1<<22,c.SEQUENCE_LOCKTIME_MASK=65535,c.castToBool=function(t){for(var e=0;e<t.length;e++)if(0!==t[e])return e!==t.length-1||128!==t[e];return!1},c.prototype.checkSignatureEncoding=function(t){var e;if(0===t.length)return!0;if(0!=(this.flags&(c.SCRIPT_VERIFY_DERSIG|c.SCRIPT_VERIFY_LOW_S|c.SCRIPT_VERIFY_STRICTENC))&&!f.isTxDER(t))return this.errstr="SCRIPT_ERR_SIG_DER_INVALID_FORMAT",!1;if(0!=(this.flags&c.SCRIPT_VERIFY_LOW_S)){if(!(e=f.fromTxFormat(t)).hasLowS())return this.errstr="SCRIPT_ERR_SIG_DER_HIGH_S",!1}else if(0!=(this.flags&c.SCRIPT_VERIFY_STRICTENC)){if(!(e=f.fromTxFormat(t)).hasDefinedHashtype())return this.errstr="SCRIPT_ERR_SIG_HASHTYPE",!1;if(!(this.flags&c.SCRIPT_ENABLE_SIGHASH_FORKID)&&e.nhashtype&f.SIGHASH_FORKID)return this.errstr="SCRIPT_ERR_ILLEGAL_FORKID",!1;if(this.flags&c.SCRIPT_ENABLE_SIGHASH_FORKID&&!(e.nhashtype&f.SIGHASH_FORKID))return this.errstr="SCRIPT_ERR_MUST_USE_FORKID",!1}return!0},c.prototype.checkPubkeyEncoding=function(t){return!(0!=(this.flags&c.SCRIPT_VERIFY_STRICTENC)&&!u.isValid(t))||(this.errstr="SCRIPT_ERR_PUBKEYTYPE",!1)},c._isMinimallyEncoded=function(t,e){return e=e||c.MAXIMUM_ELEMENT_SIZE,!(t.length>e)&&!(t.length>0&&0==(127&t[t.length-1])&&(t.length<=1||0==(128&t[t.length-2])))},c._minimallyEncode=function(t){if(0===t.length)return t;var r=t[t.length-1];if(127&r)return t;if(1===t.length)return e.from("");if(128&t[t.length-2])return t;for(var n=t.length-1;n>0;n--)if(0!==t[n-1])return 128&t[n-1]?t[n++]=r:t[n-1]|=r,t.slice(0,n);return e.from("")},c.prototype.evaluate=function(){if(this.script.toBuffer().length>1e4)return this.errstr="SCRIPT_ERR_SCRIPT_SIZE",!1;try{for(;this.pc<this.script.chunks.length;){let t={pc:this.pc,opcode:o.fromNumber(this.script.chunks[this.pc].opcodenum)};if(!this.step())return!1;this._callbackStep(t)}if(this.stack.length+this.altstack.length>1e3)return this.errstr="SCRIPT_ERR_STACK_SIZE",!1}catch(t){return this.errstr="SCRIPT_ERR_UNKNOWN_ERROR: "+t,!1}return!(this.vfExec.length>0)||(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1)},c.prototype._callbackStep=function(t){if("function"==typeof this.stepListener)try{this.stepListener(t,n.cloneDeep(this.stack,!0),n.cloneDeep(this.altstack,!0))}catch(t){console.log(`Error in Step callback:${t}`)}},c.prototype.checkLockTime=function(t){return!!(this.tx.nLockTime<c.LOCKTIME_THRESHOLD&&t.lt(c.LOCKTIME_THRESHOLD_BN)||this.tx.nLockTime>=c.LOCKTIME_THRESHOLD&&t.gte(c.LOCKTIME_THRESHOLD_BN))&&(!t.gt(new s(this.tx.nLockTime))&&!!this.tx.inputs[this.nin].isFinal())},c.prototype.checkSequence=function(t){var e=this.tx.inputs[this.nin].sequenceNumber;if(this.tx.version<2)return!1;if(e&c.SEQUENCE_LOCKTIME_DISABLE_FLAG)return!1;var r=c.SEQUENCE_LOCKTIME_TYPE_FLAG|c.SEQUENCE_LOCKTIME_MASK,n=new s(e&r),i=t.and(r),o=new s(c.SEQUENCE_LOCKTIME_TYPE_FLAG);return!!(n.lt(o)&&i.lt(o)||n.gte(o)&&i.gte(o))&&!i.gt(n)},c.prototype.step=function(){var t=this;function r(e){return t.stack[t.stack.length+e]}var h,d,l,p,b,g,y,m,v,_,w,S,E,I,k,A,P,O=0!=(this.flags&c.SCRIPT_VERIFY_MINIMALDATA),x=-1===this.vfExec.indexOf(!1),B=this.script.chunks[this.pc];this.pc++;var R=B.opcodenum;if(n.isUndefined(R))return this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE",!1;if(B.buf&&B.buf.length>c.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;if(R>o.OP_16&&++this.nOpCount>201)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;if(function(e){switch(e){case o.OP_2MUL:case o.OP_2DIV:return!0;case o.OP_INVERT:case o.OP_MUL:case o.OP_LSHIFT:case o.OP_RSHIFT:if(0==(t.flags&c.SCRIPT_ENABLE_MAGNETIC_OPCODES))return!0;break;case o.OP_DIV:case o.OP_MOD:case o.OP_SPLIT:case o.OP_CAT:case o.OP_AND:case o.OP_OR:case o.OP_XOR:case o.OP_BIN2NUM:case o.OP_NUM2BIN:if(0==(t.flags&c.SCRIPT_ENABLE_MONOLITH_OPCODES))return!0}return!1}(R))return this.errstr="SCRIPT_ERR_DISABLED_OPCODE",!1;if(x&&R>=0&&R<=o.OP_PUSHDATA4){if(O&&!this.script.checkMinimalPush(this.pc-1))return this.errstr="SCRIPT_ERR_MINIMALDATA",!1;if(B.buf){if(B.len!==B.buf.length)throw new Error(`Length of push value not equal to length of data (${B.len},${B.buf.length})`);this.stack.push(B.buf)}else this.stack.push(c.false)}else if(x||o.OP_IF<=R&&R<=o.OP_ENDIF)switch(R){case o.OP_1NEGATE:case o.OP_1:case o.OP_2:case o.OP_3:case o.OP_4:case o.OP_5:case o.OP_6:case o.OP_7:case o.OP_8:case o.OP_9:case o.OP_10:case o.OP_11:case o.OP_12:case o.OP_13:case o.OP_14:case o.OP_15:case o.OP_16:b=R-(o.OP_1-1),h=new s(b).toScriptNumBuffer(),this.stack.push(h);break;case o.OP_NOP:break;case o.OP_NOP2:case o.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&c.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&c.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var T=s.fromScriptNumBuffer(this.stack[this.stack.length-1],O,5);if(T.lt(new s(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(!this.checkLockTime(T))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case o.OP_NOP3:case o.OP_CHECKSEQUENCEVERIFY:if(!(this.flags&c.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)){if(this.flags&c.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var M=s.fromScriptNumBuffer(r(-1),O,5);if(M.lt(new s(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(0!=(M&c.SEQUENCE_LOCKTIME_DISABLE_FLAG))break;if(!this.checkSequence(M))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case o.OP_NOP1:case o.OP_NOP4:case o.OP_NOP5:case o.OP_NOP6:case o.OP_NOP7:case o.OP_NOP8:case o.OP_NOP9:case o.OP_NOP10:if(this.flags&c.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break;case o.OP_IF:case o.OP_NOTIF:if(A=!1,x){if(this.stack.length<1)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;if(h=r(-1),this.flags&c.SCRIPT_VERIFY_MINIMALIF){if(h.length>1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1;if(1===h.length&&1!==h[0])return this.errstr="SCRIPT_ERR_MINIMALIF",!1}A=c.castToBool(h),R===o.OP_NOTIF&&(A=!A),this.stack.pop()}this.vfExec.push(A);break;case o.OP_ELSE:if(0===this.vfExec.length)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case o.OP_ENDIF:if(0===this.vfExec.length)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec.pop();break;case o.OP_VERIFY:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(h=r(-1),!(A=c.castToBool(h)))return this.errstr="SCRIPT_ERR_VERIFY",!1;this.stack.pop();break;case o.OP_RETURN:return this.errstr="SCRIPT_ERR_OP_RETURN",!1;case o.OP_TOALTSTACK:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.altstack.push(this.stack.pop());break;case o.OP_FROMALTSTACK:if(this.altstack.length<1)return this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION",!1;this.stack.push(this.altstack.pop());break;case o.OP_2DROP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop(),this.stack.pop();break;case o.OP_2DUP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;d=r(-2),l=r(-1),this.stack.push(d),this.stack.push(l);break;case o.OP_3DUP:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;d=r(-3),l=r(-2);var C=r(-1);this.stack.push(d),this.stack.push(l),this.stack.push(C);break;case o.OP_2OVER:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;d=r(-4),l=r(-3),this.stack.push(d),this.stack.push(l);break;case o.OP_2ROT:if(this.stack.length<6)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;p=this.stack.splice(this.stack.length-6,2),this.stack.push(p[0]),this.stack.push(p[1]);break;case o.OP_2SWAP:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;p=this.stack.splice(this.stack.length-4,2),this.stack.push(p[0]),this.stack.push(p[1]);break;case o.OP_IFDUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;h=r(-1),(A=c.castToBool(h))&&this.stack.push(h);break;case o.OP_DEPTH:h=new s(this.stack.length).toScriptNumBuffer(),this.stack.push(h);break;case o.OP_DROP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop();break;case o.OP_DUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(r(-1));break;case o.OP_NIP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,1);break;case o.OP_OVER:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(r(-2));break;case o.OP_PICK:case o.OP_ROLL:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(h=r(-1),b=(m=s.fromScriptNumBuffer(h,O)).toNumber(),this.stack.pop(),b<0||b>=this.stack.length)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;h=r(-b-1),R===o.OP_ROLL&&this.stack.splice(this.stack.length-b-1,1),this.stack.push(h);break;case o.OP_ROT:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;g=r(-3),y=r(-2);var N=r(-1);this.stack[this.stack.length-3]=y,this.stack[this.stack.length-2]=N,this.stack[this.stack.length-1]=g;break;case o.OP_SWAP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;g=r(-2),y=r(-1),this.stack[this.stack.length-2]=y,this.stack[this.stack.length-1]=g;break;case o.OP_TUCK:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,0,r(-1));break;case o.OP_SIZE:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;m=new s(r(-1).length),this.stack.push(m.toScriptNumBuffer());break;case o.OP_AND:case o.OP_OR:case o.OP_XOR:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(d=r(-2),l=r(-1),d.length!==l.length)return this.errstr="SCRIPT_ERR_INVALID_OPERAND_SIZE",!1;switch(R){case o.OP_AND:for(let t=0;t<d.length;t++)d[t]&=l[t];break;case o.OP_OR:for(let t=0;t<d.length;t++)d[t]|=l[t];break;case o.OP_XOR:for(let t=0;t<d.length;t++)d[t]^=l[t]}this.stack.pop();break;case o.OP_INVERT:this.stack.length<1&&(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION"),h=r(-1);for(let t=0;t<h.length;t++)h[t]=~h[t];break;case o.OP_LSHIFT:case o.OP_RSHIFT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(0===(d=r(-2)).length)this.stack.pop();else{if(v=new s(d),(b=(_=s.fromScriptNumBuffer(r(-1),O)).toNumber())<0)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;let t;this.stack.pop(),this.stack.pop(),R===o.OP_LSHIFT&&(t=v.ushln(b)),R===o.OP_RSHIFT&&(t=v.ushrn(b));let n=function(t,r){let n=t;for(;n.length<r;)n=e.concat([e.from([0]),n]);return n}(e.from(t.toArray().slice(-1*d.length)),d.length);this.stack.push(n)}break;case o.OP_EQUAL:case o.OP_EQUALVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;d=r(-2),l=r(-1);var U=d.toString("hex")===l.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(U?c.true:c.false),R===o.OP_EQUALVERIFY){if(!U)return this.errstr="SCRIPT_ERR_EQUALVERIFY",!1;this.stack.pop()}break;case o.OP_1ADD:case o.OP_1SUB:case o.OP_NEGATE:case o.OP_ABS:case o.OP_NOT:case o.OP_0NOTEQUAL:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(h=r(-1),m=s.fromScriptNumBuffer(h,O),R){case o.OP_1ADD:m=m.add(s.One);break;case o.OP_1SUB:m=m.sub(s.One);break;case o.OP_NEGATE:m=m.neg();break;case o.OP_ABS:m.cmp(s.Zero)<0&&(m=m.neg());break;case o.OP_NOT:m=new s((0===m.cmp(s.Zero))+0);break;case o.OP_0NOTEQUAL:m=new s((0!==m.cmp(s.Zero))+0)}this.stack.pop(),this.stack.push(m.toScriptNumBuffer());break;case o.OP_ADD:case o.OP_SUB:case o.OP_MUL:case o.OP_MOD:case o.OP_DIV:case o.OP_BOOLAND:case o.OP_BOOLOR:case o.OP_NUMEQUAL:case o.OP_NUMEQUALVERIFY:case o.OP_NUMNOTEQUAL:case o.OP_LESSTHAN:case o.OP_GREATERTHAN:case o.OP_LESSTHANOREQUAL:case o.OP_GREATERTHANOREQUAL:case o.OP_MIN:case o.OP_MAX:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(v=s.fromScriptNumBuffer(r(-2),O),_=s.fromScriptNumBuffer(r(-1),O),m=new s(0),R){case o.OP_ADD:m=v.add(_);break;case o.OP_SUB:m=v.sub(_);break;case o.OP_MUL:m=v.mul(_);break;case o.OP_DIV:if(0===_)return this.errstr="SCRIPT_ERR_DIV_BY_ZERO",!1;m=v.div(_);break;case o.OP_MOD:if(0===_)return this.errstr="SCRIPT_ERR_DIV_BY_ZERO",!1;m=v.mod(_);break;case o.OP_BOOLAND:m=new s((0!==v.cmp(s.Zero)&&0!==_.cmp(s.Zero))+0);break;case o.OP_BOOLOR:m=new s((0!==v.cmp(s.Zero)||0!==_.cmp(s.Zero))+0);break;case o.OP_NUMEQUAL:case o.OP_NUMEQUALVERIFY:m=new s((0===v.cmp(_))+0);break;case o.OP_NUMNOTEQUAL:m=new s((0!==v.cmp(_))+0);break;case o.OP_LESSTHAN:m=new s((v.cmp(_)<0)+0);break;case o.OP_GREATERTHAN:m=new s((v.cmp(_)>0)+0);break;case o.OP_LESSTHANOREQUAL:m=new s((v.cmp(_)<=0)+0);break;case o.OP_GREATERTHANOREQUAL:m=new s((v.cmp(_)>=0)+0);break;case o.OP_MIN:m=v.cmp(_)<0?v:_;break;case o.OP_MAX:m=v.cmp(_)>0?v:_}if(this.stack.pop(),this.stack.pop(),this.stack.push(m.toScriptNumBuffer()),R===o.OP_NUMEQUALVERIFY){if(!c.castToBool(r(-1)))return this.errstr="SCRIPT_ERR_NUMEQUALVERIFY",!1;this.stack.pop()}break;case o.OP_WITHIN:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;v=s.fromScriptNumBuffer(r(-3),O),_=s.fromScriptNumBuffer(r(-2),O);var L=s.fromScriptNumBuffer(r(-1),O);A=_.cmp(v)<=0&&v.cmp(L)<0,this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push(A?c.true:c.false);break;case o.OP_RIPEMD160:case o.OP_SHA1:case o.OP_SHA256:case o.OP_HASH160:case o.OP_HASH256:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var D;h=r(-1),R===o.OP_RIPEMD160?D=a.ripemd160(h):R===o.OP_SHA1?D=a.sha1(h):R===o.OP_SHA256?D=a.sha256(h):R===o.OP_HASH160?D=a.sha256ripemd160(h):R===o.OP_HASH256&&(D=a.sha256sha256(h)),this.stack.pop(),this.stack.push(D);break;case o.OP_CODESEPARATOR:this.pbegincodehash=this.pc;break;case o.OP_CHECKSIG:case o.OP_CHECKSIGVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(w=r(-2),S=r(-1),!this.checkSignatureEncoding(w)||!this.checkPubkeyEncoding(S))return!1;E=(new i).set({chunks:this.script.chunks.slice(this.pbegincodehash)});var j=(new i).add(w);E.findAndDelete(j);try{I=f.fromTxFormat(w),k=u.fromBuffer(S,!1),P=this.tx.verifySignature(I,k,this.nin,E,this.satoshisBN,this.flags)}catch(t){P=!1}if(!P&&this.flags&c.SCRIPT_VERIFY_NULLFAIL&&w.length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;if(this.stack.pop(),this.stack.pop(),this.stack.push(P?c.true:c.false),R===o.OP_CHECKSIGVERIFY){if(!P)return this.errstr="SCRIPT_ERR_CHECKSIGVERIFY",!1;this.stack.pop()}break;case o.OP_CHECKMULTISIG:case o.OP_CHECKMULTISIGVERIFY:var H=1;if(this.stack.length<H)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var F=s.fromScriptNumBuffer(r(-H),O).toNumber();if(F<0||F>20)return this.errstr="SCRIPT_ERR_PUBKEY_COUNT",!1;if(this.nOpCount+=F,this.nOpCount>201)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;var K=++H;H+=F;var z=F+2;if(this.stack.length<H)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var V=s.fromScriptNumBuffer(r(-H),O).toNumber();if(V<0||V>F)return this.errstr="SCRIPT_ERR_SIG_COUNT",!1;var q=++H;if(H+=V,this.stack.length<H)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;E=(new i).set({chunks:this.script.chunks.slice(this.pbegincodehash)});for(var Y=0;Y<V;Y++)w=r(-q-Y),E.findAndDelete((new i).add(w));for(P=!0;P&&V>0;){if(w=r(-q),S=r(-K),!this.checkSignatureEncoding(w)||!this.checkPubkeyEncoding(S))return!1;var G;try{I=f.fromTxFormat(w),k=u.fromBuffer(S,!1),G=this.tx.verifySignature(I,k,this.nin,E,this.satoshisBN,this.flags)}catch(t){G=!1}G&&(q++,V--),K++,V>--F&&(P=!1)}for(;H-- >1;){if(!P&&this.flags&c.SCRIPT_VERIFY_NULLFAIL&&!z&&r(-1).length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;z>0&&z--,this.stack.pop()}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(this.flags&c.SCRIPT_VERIFY_NULLDUMMY&&r(-1).length)return this.errstr="SCRIPT_ERR_SIG_NULLDUMMY",!1;if(this.stack.pop(),this.stack.push(P?c.true:c.false),R===o.OP_CHECKMULTISIGVERIFY){if(!P)return this.errstr="SCRIPT_ERR_CHECKMULTISIGVERIFY",!1;this.stack.pop()}break;case o.OP_CAT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(d=r(-2),l=r(-1),d.length+l.length>c.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;this.stack[this.stack.length-2]=e.concat([d,l]),this.stack.pop();break;case o.OP_SPLIT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;d=r(-2);var W=s.fromScriptNumBuffer(r(-1),O).toNumber();if(W<0||W>d.length)return this.errstr="SCRIPT_ERR_INVALID_SPLIT_RANGE",!1;var X=e.from(d);this.stack[this.stack.length-2]=X.slice(0,W),this.stack[this.stack.length-1]=X.slice(W);break;case o.OP_NUM2BIN:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var Z=s.fromScriptNumBuffer(r(-1),O).toNumber();if(Z>c.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;this.stack.pop();var J=r(-1);if((J=c._minimallyEncode(J)).length>Z)return this.errstr="SCRIPT_ERR_IMPOSSIBLE_ENCODING",!1;if(J.length===Z){this.stack[this.stack.length-1]=J;break}var Q=0;J.length>0&&(Q=128&J[J.length-1],J[J.length-1]&=127);var $=e.alloc(Z);J.copy($,0);for(var tt=J.length-1;tt++<Z-2;)$[tt]=0;$[tt]=Q,this.stack[this.stack.length-1]=$;break;case o.OP_BIN2NUM:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(d=r(-1),l=c._minimallyEncode(d),this.stack[this.stack.length-1]=l,!c._isMinimallyEncoded(l))return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;break;default:return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1}return!0}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(e){var n=r(3),i=r(4),o=r(0),s=e.compare||r(202),a=r(13),f=r(5),u=r(8),c=r(21),h=r(18),d=r(10),l=r(14),p=r(22),b=r(29),g=r(107),y=r(64),m=y.PublicKeyHash,v=y.PublicKey,_=y.MultiSigScriptHash,w=y.MultiSig,S=r(23),E=r(15),I=r(45),k=r(7);function A(t){if(!(this instanceof A))return new A(t);if(this.inputs=[],this.outputs=[],this._inputAmount=void 0,this._outputAmount=void 0,t){if(t instanceof A)return A.shallowCopy(t);if(u.isHexa(t))this.fromString(t);else if(f.isBuffer(t))this.fromBuffer(t);else{if(!n.isObject(t))throw new a.InvalidArgument("Must provide an object or string to deserialize a transaction");this.fromObject(t)}}else this._newTransaction()}A.DUST_AMOUNT=546,A.FEE_SECURITY_MARGIN=150,A.MAX_MONEY=21e14,A.NLOCKTIME_BLOCKHEIGHT_LIMIT=5e8,A.NLOCKTIME_MAX_
    https://whatsonchain.com/tx/e14a84cc9985ea617e0f95011bc804d08459022ced8c1ce4493766c876a1ee20
    Partial data displayed. To get full data click on Download.