diff --git a/dist/ckb-js-toolkit.esm.js b/dist/ckb-js-toolkit.esm.js index 0c0e94f..dcde7f8 100644 --- a/dist/ckb-js-toolkit.esm.js +++ b/dist/ckb-js-toolkit.esm.js @@ -1 +1 @@ -class t{constructor(t){this.view=new DataView(t)}length(){return this.view.byteLength}indexAt(t){return this.view.getUint8(t)}toArrayBuffer(){return this.view.buffer}serializeJson(){return"0x"+Array.prototype.map.call(new Uint8Array(this.view.buffer),t=>("00"+t.toString(16)).slice(-2)).join("")}}class e{constructor(t){this.string=t}length(){return this.string.length/2-1}indexAt(t){return parseInt(this.string.substr(2+2*t,2),16)}toArrayBuffer(){const t=new ArrayBuffer(this.length()),e=new DataView(t);for(let t=0;t255)throw new Error("fromRawString can only accept UTF-8 raw string!");n.setUint8(t,r)}return new t(r)}}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var o=i((function(t,e){t.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r,n=0;nl.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return(n=h(this,o(l).call(this,t))).sign=r,n}return i(l,r),n(l,[{key:"toDebugString",value:function(){var t=["BigInt["],e=!0,r=!1,n=void 0;try{for(var i,o,a=this[Symbol.iterator]();!(e=(i=a.next()).done);e=!0)o=i.value,t.push((o?(o>>>0).toString(16):o)+", ")}catch(t){r=!0,n=t}finally{try{e||null==a.return||a.return()}finally{if(r)throw n}}return t.push("]"),t.join("")}},{key:"toString",value:function(){var t=0t||36this.length&&(r=this.length);for(var n=65535&t,i=t>>>16,o=0,a=65535&e,s=e>>>16,_=0;_>>16,c=u(f,n),g=u(f,i),d=u(h,n),p=u(h,i),v=a+(65535&c),b=s+o+(v>>>16)+(c>>>16)+(65535&g)+(65535&d);o=(a=(g>>>16)+(d>>>16)+(65535&p)+(b>>>16))>>>16,a&=65535,s=p>>>16,this.__setDigit(_,65535&v|b<<16)}if(0!==o||0!==a||0!==s)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(t,e,r){for(var n,i=0,o=0;o>>16,this.__setHalfDigit(e+o,n);return i}},{key:"__inplaceSub",value:function(t,e,r){var n=0;if(1&e){e>>=1;for(var i=this.__digit(e),o=65535&i,a=0;a>>1;a++){var s=t.__digit(a),u=(i>>>16)-(65535&s)-n;n=1&u>>>16,this.__setDigit(e+a,u<<16|65535&o),n=1&(o=(65535&(i=this.__digit(e+a+1)))-(s>>>16)-n)>>>16}var _=t.__digit(a),l=(i>>>16)-(65535&_)-n;if(n=1&l>>>16,this.__setDigit(e+a,l<<16|65535&o),e+a+1>=this.length)throw new RangeError("out of bounds");0==(1&r)&&(n=1&(o=(65535&(i=this.__digit(e+a+1)))-(_>>>16)-n)>>>16,this.__setDigit(e+t.length,4294901760&i|65535&o))}else{e>>=1;for(var f=0;f>>16)-(c>>>16)-(n=1&g>>>16);n=1&d>>>16,this.__setDigit(e+f,d<<16|65535&g)}var p=this.__digit(e+f),v=t.__digit(f),b=(65535&p)-(65535&v)-n;n=1&b>>>16;var y=0;0==(1&r)&&(n=1&(y=(p>>>16)-(v>>>16)-n)>>>16),this.__setDigit(e+f,y<<16|65535&b)}return n}},{key:"__inplaceRightShift",value:function(t){if(0!==t){for(var e,r=this.__digit(0)>>>t,n=this.length-1,i=0;i>>t;this.__setDigit(n,r)}}},{key:"__digit",value:function(t){return this[t]}},{key:"__unsignedDigit",value:function(t){return this[t]>>>0}},{key:"__setDigit",value:function(t,e){this[t]=0|e}},{key:"__setDigitGrow",value:function(t,e){this[t]=0|e}},{key:"__halfDigitLength",value:function(){var t=this.length;return 65535>=this.__unsignedDigit(t-1)?2*t-1:2*t}},{key:"__halfDigit",value:function(t){return 65535&this[t>>>1]>>>((1&t)<<4)}},{key:"__setHalfDigit",value:function(t,e){var r=t>>>1,n=this.__digit(r),i=1&t?65535&n|e<<16:4294901760&n|65535&e;this.__setDigit(r,i)}}],[{key:"BigInt",value:function(e){var r=Math.floor,n=Number.isFinite;if("number"==typeof e){if(0===e)return l.__zero();if((0|e)===e)return 0>e?l.__oneDigit(-e,!0):l.__oneDigit(e,!1);if(!n(e)||r(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return l.__fromDouble(e)}if("string"==typeof e){var i=l.__fromString(e);if(null===i)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return i}if("boolean"==typeof e)return!0===e?l.__oneDigit(1,!1):l.__zero();if("object"===t(e)){if(e.constructor===l)return e;var o=l.__toPrimitive(e);return l.BigInt(o)}throw new TypeError("Cannot convert "+e+" to a BigInt")}},{key:"toNumber",value:function(t){var e=t.length;if(0===e)return 0;if(1===e){var r=t.__unsignedDigit(0);return t.sign?-r:r}var n=t.__digit(e-1),i=_(n),o=32*e-i;if(1024>>=12;var c=f-12,g=12<=f?0:s<<20+f,d=20+f;0>>32-c,g=s<>>32-d,d-=32);var p=l.__decideRounding(t,d,u,s);if((1===p||0===p&&1==(1&g))&&0==(g=g+1>>>0)&&0!=++h>>>20&&(h=0,1023<++a))return t.sign?-1/0:1/0;var v=t.sign?-2147483648:0;return a=a+1023<<20,l.__kBitConversionInts[1]=v|a|h,l.__kBitConversionInts[0]=g,l.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(t){if(0===t.length)return t;var e=t.__copy();return e.sign=!t.sign,e}},{key:"bitwiseNot",value:function(t){return t.sign?l.__absoluteSubOne(t).__trim():l.__absoluteAddOne(t,!0)}},{key:"exponentiate",value:function(t,e){if(e.sign)throw new RangeError("Exponent must be positive");if(0===e.length)return l.__oneDigit(1,!1);if(0===t.length)return t;if(1===t.length&&1===t.__digit(0))return t.sign&&0==(1&e.__digit(0))?l.unaryMinus(t):t;if(1=l.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){var n=1+(r>>>5),i=new l(n,t.sign&&0!=(1&r));i.__initializeDigits();var o=1<<(31&r);return i.__setDigit(n-1,o),i}var a=null,s=t;for(0!=(1&r)&&(a=t),r>>=1;0!==r;r>>=1)s=l.multiply(s,s),0!=(1&r)&&(a=null===a?s:l.multiply(a,s));return a}},{key:"multiply",value:function(t,e){if(0===t.length)return t;if(0===e.length)return e;var r=t.length+e.length;32<=t.__clzmsd()+e.__clzmsd()&&r--;var n=new l(r,t.sign!==e.sign);n.__initializeDigits();for(var i=0;il.__absoluteCompare(t,e))return l.__zero();var r,n=t.sign!==e.sign,i=e.__unsignedDigit(0);if(1===e.length&&65535>=i){if(1===i)return n===t.sign?t:l.unaryMinus(t);r=l.__absoluteDivSmall(t,i,null)}else r=l.__absoluteDivLarge(t,e,!0,!1);return r.sign=n,r.__trim()}},{key:"remainder",value:function(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>l.__absoluteCompare(t,e))return t;var r=e.__unsignedDigit(0);if(1===e.length&&65535>=r){if(1===r)return l.__zero();var n=l.__absoluteModSmall(t,r);return 0===n?l.__zero():l.__oneDigit(n,t.sign)}var i=l.__absoluteDivLarge(t,e,!1,!0);return i.sign=t.sign,i.__trim()}},{key:"add",value:function(t,e){var r=t.sign;return r===e.sign?l.__absoluteAdd(t,e,r):0<=l.__absoluteCompare(t,e)?l.__absoluteSub(t,e,r):l.__absoluteSub(e,t,!r)}},{key:"subtract",value:function(t,e){var r=t.sign;return r===e.sign?0<=l.__absoluteCompare(t,e)?l.__absoluteSub(t,e,r):l.__absoluteSub(e,t,!r):l.__absoluteAdd(t,e,r)}},{key:"leftShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?l.__rightShiftByAbsolute(t,e):l.__leftShiftByAbsolute(t,e)}},{key:"signedRightShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?l.__leftShiftByAbsolute(t,e):l.__rightShiftByAbsolute(t,e)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(t,e){return 0>l.__compareToBigInt(t,e)}},{key:"lessThanOrEqual",value:function(t,e){return 0>=l.__compareToBigInt(t,e)}},{key:"greaterThan",value:function(t,e){return 0=l.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.lengthl.__kMaxLengthBits)throw new RangeError("BigInt too big");return l.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=l.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length>>n)return e}return l.__truncateToNBits(t,e)}},{key:"ADD",value:function(t,e){if(t=l.__toPrimitive(t),e=l.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=l.__toNumeric(t),e=l.__toNumeric(e),l.__isBigInt(t)&&l.__isBigInt(e))return l.add(t,e);if("number"==typeof t&&"number"==typeof e)return t+e;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(t,e){return l.__compare(t,e,0)}},{key:"LE",value:function(t,e){return l.__compare(t,e,1)}},{key:"GT",value:function(t,e){return l.__compare(t,e,2)}},{key:"GE",value:function(t,e){return l.__compare(t,e,3)}},{key:"EQ",value:function(e,r){for(;;){if(l.__isBigInt(e))return l.__isBigInt(r)?l.equal(e,r):l.EQ(r,e);if("number"==typeof e){if(l.__isBigInt(r))return l.__equalToNumber(r,e);if("object"!==t(r))return e==r;r=l.__toPrimitive(r)}else if("string"==typeof e){if(l.__isBigInt(r))return null!==(e=l.__fromString(e))&&l.equal(e,r);if("object"!==t(r))return e==r;r=l.__toPrimitive(r)}else if("boolean"==typeof e){if(l.__isBigInt(r))return l.__equalToNumber(r,+e);if("object"!==t(r))return e==r;r=l.__toPrimitive(r)}else if("symbol"===t(e)){if(l.__isBigInt(r))return!1;if("object"!==t(r))return e==r;r=l.__toPrimitive(r)}else{if("object"!==t(e))return e==r;if("object"===t(r)&&r.constructor!==l)return e==r;e=l.__toPrimitive(e)}}}},{key:"NE",value:function(t,e){return!l.EQ(t,e)}},{key:"__zero",value:function(){return new l(0,!1)}},{key:"__oneDigit",value:function(t,e){var r=new l(1,e);return r.__setDigit(0,t),r}},{key:"__decideRounding",value:function(t,e,r,n){if(0e)i=-e-1;else{if(0===r)return-1;r--,n=t.__digit(r),i=31}var o=1<>>20)-1023,n=1+(r>>>5),i=new l(n,0>t),o=1048575&l.__kBitConversionInts[1]|1048576,a=l.__kBitConversionInts[0],s=20,u=31&r,_=0;if(u>>f,o=o<<32-f|a>>>f,a<<=32-f}else if(u===s)_=32,e=o,o=a;else{var h=u-s;_=32-h,e=o<>>32-h,o=a<=t&&9<=t)||(159>=t?32==t:131071>=t?160==t||5760==t:196607>=t?10>=(t&=131071)||40==t||41==t||47==t||95==t||4096==t:65279==t)}},{key:"__fromString",value:function(t){var e=11073741824/s)return null;var _=new l(31+(s*a+u>>>l.__kBitsPerCharTableShift)>>>5,!1),f=10>e?e:10,h=10>=l.__kBitsPerCharTableShift;var c=[],g=[],d=!1;do{for(var p,v=0,b=0;;){if(p=void 0,o-48>>>0>>0>>0>>0>>l.__kBitsPerCharTableShift+5;_.__inplaceMultiplyAdd(D,k,P)}while(!y)}if(i!==n){if(!l.__isWhitespace(o))return null;for(i++;i>>u-(o-=32))}if(0!==i){if(n>=t.length)throw new Error("implementation bug");t.__setDigit(n++,i)}for(;n>>1)+(85&n))>>>2)+(51&n))>>>4)+(15&n),o=e-1,a=t.__digit(r-1),s=0|(32*r-_(a)+i-1)/i;if(t.sign&&s++,268435456>>v,c=32-v;c>=i;)u[f--]=l.__kConversionChars[h&o],h>>>=i,c-=i}var b=(h|a<>>i-c;0!==h;)u[f--]=l.__kConversionChars[h&o],h>>>=i;if(t.sign&&(u[f--]="-"),-1!==f)throw new Error("implementation bug");return u.join("")}},{key:"__toStringGeneric",value:function(t,e,r){var n=t.length;if(0===n)return"";if(1===n){var i=t.__unsignedDigit(0).toString(e);return!1===r&&t.sign&&(i="-"+i),i}var o,a,s=32*n-_(t.__digit(n-1)),u=l.__kMaxBitsPerChar[e]-1,f=s*l.__kBitsPerCharTableMultiplier,h=1+(f=0|(f+=u-1)/u)>>1,c=l.exponentiate(l.__oneDigit(e,!1),l.__oneDigit(h,!1)),g=c.__unsignedDigit(0);if(1===c.length&&65535>=g){(o=new l(t.length,!1)).__initializeDigits();for(var d,p=0,v=2*t.length-1;0<=v;v--)d=p<<16|t.__halfDigit(v),o.__setHalfDigit(v,0|d/g),p=0|d%g;a=p.toString(e)}else{var b=l.__absoluteDivLarge(t,c,!0,!0);o=b.quotient;var y=b.remainder.__trim();a=l.__toStringGeneric(y,e,!0)}o.__trim();for(var m=l.__toStringGeneric(o,e,!0);a.lengthn?l.__absoluteLess(r):0}},{key:"__compareToNumber",value:function(t,e){if(!0|e){var r=t.sign,n=0>e;if(r!==n)return l.__unequalSign(r);if(0===t.length){if(n)throw new Error("implementation bug");return 0===e?0:-1}if(1i?l.__absoluteGreater(r):oe)return l.__unequalSign(r);if(0===e)throw new Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;l.__kBitConversionDouble[0]=e;var n=2047&l.__kBitConversionInts[1]>>>20;if(2047==n)throw new Error("implementation bug: handled elsewhere");var i=n-1023;if(0>i)return l.__absoluteGreater(r);var o=t.length,a=t.__digit(o-1),s=_(a),u=32*o-s,f=i+1;if(uf)return l.__absoluteGreater(r);var h=1048576|1048575&l.__kBitConversionInts[1],c=l.__kBitConversionInts[0],g=20,d=31-s;if(d!==(u-1)%31)throw new Error("implementation bug");var p,v=0;if(d>>b,h=h<<32-b|c>>>b,c<<=32-b}else if(d===g)v=32,p=h,h=c;else{var y=d-g;v=32-y,p=h<>>32-y,h=c<>>=0)>(p>>>=0))return l.__absoluteGreater(r);if(a>>0,h=c,c=0):p=0;var w=t.__unsignedDigit(m);if(w>p)return l.__absoluteGreater(r);if(we&&t.__unsignedDigit(0)===a(e):0===l.__compareToDouble(t,e)}},{key:"__comparisonResultToBool",value:function(t,e){switch(e){case 0:return 0>t;case 1:return 0>=t;case 2:return 0e;case 3:return t>=e}if(l.__isBigInt(t)&&"string"==typeof e)return null!==(e=l.__fromString(e))&&l.__comparisonResultToBool(l.__compareToBigInt(t,e),r);if("string"==typeof t&&l.__isBigInt(e))return null!==(t=l.__fromString(t))&&l.__comparisonResultToBool(l.__compareToBigInt(t,e),r);if(t=l.__toNumeric(t),e=l.__toNumeric(e),l.__isBigInt(t)){if(l.__isBigInt(e))return l.__comparisonResultToBool(l.__compareToBigInt(t,e),r);if("number"!=typeof e)throw new Error("implementation bug");return l.__comparisonResultToBool(l.__compareToNumber(t,e),r)}if("number"!=typeof t)throw new Error("implementation bug");if(l.__isBigInt(e))return l.__comparisonResultToBool(l.__compareToNumber(e,t),2^r);if("number"!=typeof e)throw new Error("implementation bug");return 0===r?te:3===r?t>=e:void 0}},{key:"__absoluteAdd",value:function(t,e,r){if(t.length>>16)+(s>>>16)+(_>>>16);o=f>>>16,i.__setDigit(a,65535&_|f<<16)}for(;a>>16)+(c>>>16);o=g>>>16,i.__setDigit(a,65535&c|g<<16)}return a>>16)-(s>>>16)-(i=1&u>>>16);i=1&_>>>16,n.__setDigit(o,65535&u|_<<16)}for(;o>>16)-(i=1&h>>>16);i=1&c>>>16,n.__setDigit(o,65535&h|c<<16)}return n.__trim()}},{key:"__absoluteAddOne",value:function(t,e){var r=2n?0:t.__unsignedDigit(n)>e.__unsignedDigit(n)?1:-1}},{key:"__multiplyAccumulate",value:function(t,e,r,n){if(0!==e){for(var i=65535&e,o=e>>>16,a=0,s=0,_=0,l=0;l>>16,g=t.__digit(l),d=65535&g,p=g>>>16,v=u(d,i),b=u(d,o),y=u(p,i),m=u(p,o);a=(s=(b>>>16)+(y>>>16)+(65535&m)+(a=(c+=_+a+((h+=s+(65535&v))>>>16)+(v>>>16)+(65535&b)+(65535&y))>>>16))>>>16,s&=65535,_=m>>>16,f=65535&h|c<<16,r.__setDigit(n,f)}for(;0!==a||0!==s||0!==_;n++){var w=r.__digit(n),k=(65535&w)+s,D=(w>>>16)+(k>>>16)+_+a;s=0,_=0,a=D>>>16,w=65535&k|D<<16,r.__setDigit(n,w)}}}},{key:"__internalMultiplyAdd",value:function(t,e,r,n,i){for(var o=r,a=0,s=0;s>>16;var h=u(_>>>16,e),c=(65535&h)+(l>>>16)+o;o=c>>>16,a=h>>>16,i.__setDigit(s,c<<16|65535&f)}if(i.length>n)for(i.__setDigit(n++,o+a);n>>0,a=0|o/e,s=0|(o=((n=0|o%e)<<16|t.__halfDigit(i-1))>>>0)/e;n=0|o%e,r.__setDigit(i>>>1,a<<16|s)}return r}},{key:"__absoluteModSmall",value:function(t,e){for(var r=0,n=2*t.length-1;0<=n;n--)r=0|((r<<16|t.__halfDigit(n))>>>0)%e;return r}},{key:"__absoluteDivLarge",value:function(t,e,r,n){var i=e.__halfDigitLength(),o=e.length,a=t.__halfDigitLength()-i,s=null;r&&(s=new l(a+2>>>1,!1)).__initializeDigits();var _=new l(i+2>>>1,!1);_.__initializeDigits();var f=l.__clz16(e.__halfDigit(i-1));0>>0;p=0|b/c;for(var y=0|b%c,m=e.__halfDigit(i-2),w=h.__halfDigit(d+i-2);u(p,m)>>>0>(y<<16|w)>>>0&&(p--,!(65535<(y+=c))););}l.__internalMultiplyAdd(e,p,0,o,_);var k=h.__inplaceSub(_,d,i+1);0!==k&&(k=h.__inplaceAdd(e,d,i),h.__setHalfDigit(d+i,h.__halfDigit(d+i)+k),p--),r&&(1&d?g=p<<16:s.__setDigit(d>>>1,g|p))}return n?(h.__inplaceRightShift(f),r?{quotient:s,remainder:h}:h):r?s:void 0}},{key:"__clz16",value:function(t){return _(t)-16}},{key:"__specialLeftShift",value:function(t,e,r){var n=t.length,i=new l(n+r,!1);if(0===e){for(var o=0;o>>32-e;return 0r)throw new RangeError("BigInt too big");var n=r>>>5,i=31&r,o=t.length,a=0!==i&&0!=t.__digit(o-1)>>>32-i,s=o+n+(a?1:0),u=new l(s,t.sign);if(0===i){for(var _=0;_>>32-i;if(a)u.__setDigit(o+n,f);else if(0!==f)throw new Error("implementation bug")}return u.__trim()}},{key:"__rightShiftByAbsolute",value:function(t,e){var r=t.length,n=t.sign,i=l.__toShiftAmount(e);if(0>i)return l.__rightShiftByMaximum(n);var o=i>>>5,a=31&i,s=r-o;if(0>=s)return l.__rightShiftByMaximum(n);var u=!1;if(n)if(0!=(t.__digit(o)&(1<>>a,d=r-o-1,p=0;p>>a;f.__setDigit(d,g)}return u&&(f=l.__absoluteAddOne(f,!0,f)),f.__trim()}},{key:"__rightShiftByMaximum",value:function(t){return t?l.__oneDigit(1,!0):l.__zero()}},{key:"__toShiftAmount",value:function(t){if(1l.__kMaxLengthBits?-1:e}},{key:"__toPrimitive",value:function(e){var r=1>>5,n=new l(r,e.sign),i=r-1,o=0;o>>s}return n.__setDigit(i,a),n.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(t,e,r){for(var n=Math.min,i=t+31>>>5,o=new l(i,r),a=0,s=i-1,u=0,_=n(s,e.length);a<_;a++){var f=e.__digit(a),h=0-(65535&f)-u,c=0-(f>>>16)-(u=1&h>>>16);u=1&c>>>16,o.__setDigit(a,65535&h|c<<16)}for(;a>>16)-(u=1&v>>>16)<<16}else{var b=32-p,y=1<<32-b,m=(65535&y)-(65535&(d=d<>>b))-u;g=65535&m|(y>>>16)-(d>>>16)-(u=1&m>>>16)<<16,g&=y-1}return o.__setDigit(s,g),o.__trim()}},{key:"__digitPow",value:function(t,e){for(var r=1;0>>=1,t*=t;return r}}]),l}(l(Array));return c.__kMaxLength=33554432,c.__kMaxLengthBits=c.__kMaxLength<<5,c.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],c.__kBitsPerCharTableShift=5,c.__kBitsPerCharTableMultiplier=1<a)throw new Error(s);let u=i.filter(t=>!r.includes(t));if(i.length-u.length!==o)throw new Error(s);if(u.find(t=>!n.includes(t)))throw new Error(s)}function s(t,e){if(!/^0x([0-9a-fA-F][0-9a-fA-F])*$/.test(e))throw new Error(t+" must be a hex string!")}function u(t,e){if(s(t,e),66!=e.length)throw new Error(t+" must be a hex string of 66 bytes long!")}function _(t,e){if("0x0"!==e&&!/^0x[1-9a-fA-F][0-9a-fA-F]*$/.test(e))throw new Error(t+" must be a hex integer!")}function l(t,{nestedValidation:e=!0,debugPath:r="script"}={}){if(a(r,t,["code_hash","hash_type","args"],[]),u(r+".code_hash",t.code_hash),s(r+".args",t.args),"data"!==t.hash_type&&"type"!==t.hash_type)throw new Error(r+".hash_type must be either data or type!")}function f(t,{nestedValidation:e=!0,debugPath:r="out_point"}={}){a(r,t,["tx_hash","index"],[]),u(r+".tx_hash",t.tx_hash),_(r+".index",t.index)}function h(t,{nestedValidation:e=!0,debugPath:r="cell_input"}={}){a(r,t,["since","previous_output"],[]),_(r+".since",t.since),e&&f(t.previous_output,{debugPath:r+".previous_output"})}function c(t,{nestedValidation:e=!0,debugPath:r="cell_output"}={}){a(r,t,["capacity","lock"],["type"]),_(r+".capacity",t.capacity),e&&(l(t.lock,{debugPath:r+".lock"}),t.type&&l(t.type,{debugPath:r+".type"}))}function g(t,{nestedValidation:e=!0,debugPath:r="cell_dep"}={}){if(a(r,t,["out_point","dep_type"],[]),"code"!==t.dep_type&&"dep_group"!==t.dep_type)throw new Error(r+".dep_type must be either code or dep_group!");e&&f(t.out_point,{debugPath:r+".out_point"})}function d(t,e,r,n){if(!Array.isArray(e))throw new Error(t+" is not an array!");if(n)for(let n=0;n=r.outputs.length)throw new Error(`Transaction ${t.tx_hash} does not have output ${n}!`);const i={output:r.outputs[n],data:r.outputs_data[n]};return"committed"===e.tx_status.status&&(i.header=e.tx_status.block_hash),i}}var S=i((function(t,e){var r=function(t){function e(){this.fetch=!1,this.DOMException=t.DOMException}return e.prototype=t,new e}("undefined"!=typeof self?self:n);!function(t){!function(e){var r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,i="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in t,a="ArrayBuffer"in t;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function _(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function l(t){return"string"!=typeof t&&(t=String(t)),t}function f(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function h(t){this.map={},t instanceof h?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function g(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function d(t){var e=new FileReader,r=g(e);return e.readAsArrayBuffer(t),r}function p(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&i&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=p(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||u(t))?this._bodyArrayBuffer=p(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var t,e,r,n=c(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=g(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function m(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function w(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new h(e.headers),this.url=e.url||"",this._initBody(t)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},v.call(y.prototype),v.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var k=[301,302,303,307,308];w.redirect=function(t,e){if(-1===k.indexOf(e))throw new RangeError("Invalid status code");return new w(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function D(t,r){return new Promise((function(n,o){var a=new y(t,r);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var t,e,r={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new h,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new w(i,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}D.polyfill=!0,t.fetch||(t.fetch=D,t.Headers=h,t.Request=y,t.Response=w),e.Headers=h,e.Request=y,e.Response=w,e.fetch=D}({})}(r),delete r.fetch.polyfill,(e=r.fetch).default=r.fetch,e.fetch=r.fetch,e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response,t.exports=e}));function x(t,e){e=e||{};const r=Object.assign({},e.headers||{},t.headers||{});return Object.assign({},e,t,{headers:r})}const O={get:(t,e,r)=>"send"===e?async()=>{const e=await S(t.uri,x({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.payload)},t.defaultOptions));return await e.json()}:(...n)=>{const i=t.id;return t.id=t.id+1,t.payload.push({jsonrpc:"2.0",id:i,method:e,params:n}),r}},C={get:(t,e)=>"batch"===e?()=>new Proxy({id:Math.round(1e7*Math.random()),payload:[],uri:t.uri,defaultOptions:t.defaultOptions},O):async(...r)=>{const n=Math.round(1e7*Math.random()),i=await S(t.uri,x({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:n,method:e,params:r})},t.defaultOptions)),o=await i.json();if(o.id!==n)throw new Error("JSONRPCError: response ID does not match request ID!");if(o.error)throw new Error("JSONRPCError: server error "+JSON.stringify(o.error));return o.result}};class I{constructor(t,e={}){return this.uri=t,this.defaultOptions=e,new Proxy(this,C)}static create(t){return new I(t)}}function j(t){return o.BigInt(t)}function R(t){return"0x"+t.toString(16)}function z(t){return function(e,r){if(!(r instanceof ArrayBuffer)){let n=R(o.BigInt(r)).substr(2);if(n.length%2!=0&&(n="0"+n),n.length/2>t)throw new Error(`${e} is ${n.length/2} bytes long, expected length is ${t}!`);const i=new DataView(new ArrayBuffer(t));for(let t=0;t0&&n.byteLength!==t)throw new Error(`${e} has invalid length ${n.byteLength}, required: ${t}`);return n}}function N(t,e,r){const n={};for(const[i,o]of Object.entries(r)){const r=e[i];if(!r)throw new Error(`${t} is missing ${i}!`);n[i]=o(`${t}.${i}`,r)}return n}function L(t,{debugPath:e="script"}={}){return N(e,t,{code_hash:M(32),hash_type:function(t,e){switch(e){case"data":return 0;case"type":return 1;case 0:case 1:return e;default:throw new Error(`${t}.hash_type has invalid value: ${e}`)}},args:M(-1)})}function U(t,{debugPath:e="out_point"}={}){return N(e,t,{tx_hash:M(32),index:z(4)})}function q(t){return function(e,r){return t(r,{debugPath:e})}}function V(t,{debugPath:e="cell_input"}={}){return N(e,t,{since:z(8),previous_output:q(U)})}function $(t,{debugPath:e="cell_output"}={}){const r=N(e,t,{capacity:z(8),lock:q(L)});return t.type&&(r.type_=L(t.type,{debugPath:e+".type"})),r}function F(t,{debugPath:e="cell_dep"}={}){return N(e,t,{out_point:q(U),dep_type:function(t,e){switch(e){case"code":return 0;case"dep_group":return 1;case 0:case 1:return e;default:throw new Error(`${t}.dep_type has invalid value: ${e}`)}}})}function G(t){return function(e,r){return r.map((r,n)=>t(`${e}[${n}]`,r))}}function H(t,{debugPath:e="raw_transaction"}={}){return N(e,t,{version:z(4),cell_deps:G(q(F)),header_deps:G(M(32)),inputs:G(q(V)),outputs:G(q($)),outputs_data:G(M(-1))})}function W(t,{debugPath:e="transaction"}={}){const r=H(t,{debugPath:"(raw)"+e}),n=N(e,t,{witnesses:G(M(-1))});return n.raw=r,n}function J(t,{debugPath:e="raw_header"}={}){return N(e,t,{version:z(4),compact_target:z(4),timestamp:z(8),number:z(8),epoch:z(8),parent_hash:M(32),transactions_root:M(32),proposals_hash:M(32),uncles_hash:M(32),dao:M(32)})}function X(t,{debugPath:e="header"}={}){const r=J(t,{debugPath:"(raw)"+e}),n=N(e,t,{nonce:z(16)});return n.raw=r,n}function Q(t,{debugPath:e="uncle_block"}={}){return N(e,t,{header:q(X),proposals:G(M(10))})}var K=Object.freeze({__proto__:null,NormalizeScript:L,NormalizeOutPoint:U,NormalizeCellInput:V,NormalizeCellOutput:$,NormalizeCellDep:F,NormalizeRawTransaction:H,NormalizeTransaction:W,NormalizeRawHeader:J,NormalizeHeader:X,NormalizeUncleBlock:Q,NormalizeBlock:function(t,{debugPath:e="block"}={}){return N(e,t,{header:q(X),uncles:G(q(Q)),transactions:G(q(W)),proposals:G(M(10))})},NormalizeCellbaseWitness:function(t,{debugPath:e="cellbase_witness"}={}){return N(e,t,{lock:q(L),message:M(-1)})},NormalizeWitnessArgs:function(t,{debugPath:e="witness_args"}={}){const r={};return t.lock&&(r.lock=M(-1)(e+".lock",t.lock)),t.input_type&&(r.input_type=M(-1)(e+".input_type",t.input_type)),t.output_type&&(r.output_type=M(-1)(e+".output_type",t.output_type)),r}});function Y(t,e){return e instanceof Object&&e.serializeJson instanceof Function?e.serializeJson.call(e):e}function Z(t,e,r){if(!((e=Y(0,e))instanceof Object))throw new Error(`Transformed ${t} is not an object!`);const n={};for(const[i,o]of Object.entries(r)){let r=e[i];if(!r){r=e[i.replace(/(_[a-z])/g,t=>t.toUpperCase().replace("_",""))]}r&&(n[i]=o(`${t}.${i}`,r))}return n}function tt(t,{validation:e=!0,debugPath:r="script"}={}){return t=Z(r,t,{code_hash:Y,hash_type:Y,args:Y}),e&&l(t,{debugPath:"(transformed) "+r}),t}function et(t,{validation:e=!0,debugPath:r="out_point"}={}){return t=Z(r,t,{tx_hash:Y,index:Y}),e&&f(t,{debugPath:"(transformed) "+r}),t}function rt(t){return function(e,r){return t(r,{validation:!1,debugPath:e})}}function nt(t,{validation:e=!0,debugPath:r="cell_input"}={}){return t=Z(r,t,{since:Y,previous_output:rt(et)}),e&&h(t,{debugPath:"(transformed) "+r}),t}function it(t,{validation:e=!0,debugPath:r="cell_output"}={}){return t=Z(r,t,{capacity:Y,lock:rt(tt),type:rt(tt)}),e&&c(t,{debugPath:"(transformed) "+r}),t}function ot(t,{validation:e=!0,debugPath:r="cell_dep"}={}){return t=Z(r,t,{out_point:rt(et),dep_type:Y}),e&&g(t,{debugPath:"(transformed) "+r}),t}function at(t){return function(e,r){return r.map((r,n)=>t(`${e}[${n}]`,r))}}function st(t,{validation:e=!0,debugPath:r="transaction"}={}){return t=Z(r,t,{version:Y,cell_deps:at(rt(ot)),header_deps:at(Y),inputs:at(rt(nt)),outputs:at(rt(it)),outputs_data:at(Y),witnesses:at(Y)}),e&&y(t,{debugPath:"(transformed) "+r}),t}function ut(t,{validation:e=!0,debugPath:r="header"}={}){return t=Z(r,t,{version:Y,compact_target:Y,timestamp:Y,number:Y,epoch:Y,parent_hash:Y,transactions_root:Y,proposals_hash:Y,uncles_hash:Y,dao:Y,nonce:Y}),e&&w(t,{debugPath:"(transformed) "+r}),t}function _t(t,{validation:e=!0,debugPath:r="uncle_block"}={}){return t=Z(r,t,{header:rt(ut),proposals:at(Y)}),e&&D(t,{debugPath:"(transformed) "+r}),t}var lt=Object.freeze({__proto__:null,TransformScript:tt,TransformOutPoint:et,TransformCellInput:nt,TransformCellOutput:it,TransformCellDep:ot,TransformRawTransaction:function(t,{validation:e=!0,debugPath:r="raw_transaction"}={}){return t=Z(r,t,{version:Y,cell_deps:at(rt(ot)),header_deps:at(Y),inputs:at(rt(nt)),outputs:at(rt(it)),outputs_data:at(Y)}),e&&b(t,{debugPath:"(transformed) "+r}),t},TransformTransaction:st,TransformRawHeader:function(t,{validation:e=!0,debugPath:r="raw_header"}={}){return t=Z(r,t,{version:Y,compact_target:Y,timestamp:Y,number:Y,epoch:Y,parent_hash:Y,transactions_root:Y,proposals_hash:Y,uncles_hash:Y,dao:Y}),e&&m(t,{debugPath:"(transformed) "+r}),t},TransformHeader:ut,TransformUncleBlock:_t,TransformBlock:function(t,{validation:e=!0,debugPath:r="block"}={}){return t=Z(r,t,{header:rt(ut),uncles:at(rt(_t)),transactions:at(rt(st)),proposals:at(Y)}),e&&B(t,{debugPath:"(transformed) "+r}),t},TransformCellbaseWitness:function(t,{validation:e=!0,debugPath:r="cellbase_witness"}={}){return t=Z(r,t,{lock:rt(tt),message:Y}),e&&P(t,{debugPath:"(transformed) "+r}),t},TransformWitnessArgs:function(t,{validation:e=!0,debugPath:r="witness_args"}={}){return t=Z(r,t,{lock:Y,input_type:Y,output_type:Y}),e&&A(t,{debugPath:"(transformed) "+r}),t}});var ft=Object.freeze({__proto__:null,RPCCollector:class{constructor(t,e,{skipCellWithContent:n=!0,loadData:i=!1,loadBlockNumber:o=!0}={}){this.rpc=t,this.lockHash=new r(e).serializeJson(),this.skipCellWithContent=n,this.loadData=i,this.loadBlockNumber=o}async*collect(){const t=j(await this.rpc.get_tip_block_number());let e=o.BigInt(0);for(;o.lessThanOrEqual(e,t);){let r=o.add(e,o.BigInt(100));o.greaterThan(r,t)&&(r=t);const n=await this.rpc.get_cells_by_lock_hash(this.lockHash,R(e),R(r));for(const t of n){if(this.skipCellWithContent&&(t.type||o.greaterThan(j(t.output_data_len),o.BigInt(100))))continue;let e=null;if(this.loadData){e=(await this.rpc.get_live_cell(t.out_point,!0)).cell.data.content}let r=null;if(this.loadBlockNumber){r=(await this.rpc.get_header(t.block_hash)).number}yield{cellbase:t.cellbase,cell_output:{capacity:t.capacity,lock:t.lock,type:t.type},out_point:t.out_point,block_hash:t.block_hash,data:e,output_data_len:t.output_data_len,block_number:r}}e=o.add(r,o.BigInt(1))}}}});const ht="0.10.2";export{R as BigIntToHexString,j as HexStringToBigInt,I as RPC,r as Reader,E as TransactionDumper,ht as VERSION,ft as cell_collectors,K as normalizers,lt as transformers,T as validators}; +class t{constructor(){this.__isByteLikeReader__=!0}static isReader(e){return null!=e&&(e instanceof t||!0===e.__isByteLikeReader__)}}class e extends t{constructor(t){super(),this.view=new DataView(t)}length(){return this.view.byteLength}indexAt(t){return this.view.getUint8(t)}toArrayBuffer(){return this.view.buffer}serializeJson(){return"0x"+Array.prototype.map.call(new Uint8Array(this.view.buffer),t=>("00"+t.toString(16)).slice(-2)).join("")}}class r extends t{constructor(t){super(),this.string=t}length(){return this.string.length/2-1}indexAt(t){return parseInt(this.string.substr(2+2*t,2),16)}toArrayBuffer(){const t=new ArrayBuffer(this.length()),e=new DataView(t);for(let t=0;t255)throw new Error("fromRawString can only accept UTF-8 raw string!");n.setUint8(e,r)}return new e(r)}}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var a=o((function(t,e){t.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r,n=0;nl.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return(n=h(this,o(l).call(this,t))).sign=r,n}return i(l,r),n(l,[{key:"toDebugString",value:function(){var t=["BigInt["],e=!0,r=!1,n=void 0;try{for(var i,o,a=this[Symbol.iterator]();!(e=(i=a.next()).done);e=!0)o=i.value,t.push((o?(o>>>0).toString(16):o)+", ")}catch(t){r=!0,n=t}finally{try{e||null==a.return||a.return()}finally{if(r)throw n}}return t.push("]"),t.join("")}},{key:"toString",value:function(){var t=0t||36this.length&&(r=this.length);for(var n=65535&t,i=t>>>16,o=0,a=65535&e,s=e>>>16,_=0;_>>16,c=u(f,n),g=u(f,i),d=u(h,n),p=u(h,i),v=a+(65535&c),y=s+o+(v>>>16)+(c>>>16)+(65535&g)+(65535&d);o=(a=(g>>>16)+(d>>>16)+(65535&p)+(y>>>16))>>>16,a&=65535,s=p>>>16,this.__setDigit(_,65535&v|y<<16)}if(0!==o||0!==a||0!==s)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(t,e,r){for(var n,i=0,o=0;o>>16,this.__setHalfDigit(e+o,n);return i}},{key:"__inplaceSub",value:function(t,e,r){var n=0;if(1&e){e>>=1;for(var i=this.__digit(e),o=65535&i,a=0;a>>1;a++){var s=t.__digit(a),u=(i>>>16)-(65535&s)-n;n=1&u>>>16,this.__setDigit(e+a,u<<16|65535&o),n=1&(o=(65535&(i=this.__digit(e+a+1)))-(s>>>16)-n)>>>16}var _=t.__digit(a),l=(i>>>16)-(65535&_)-n;if(n=1&l>>>16,this.__setDigit(e+a,l<<16|65535&o),e+a+1>=this.length)throw new RangeError("out of bounds");0==(1&r)&&(n=1&(o=(65535&(i=this.__digit(e+a+1)))-(_>>>16)-n)>>>16,this.__setDigit(e+t.length,4294901760&i|65535&o))}else{e>>=1;for(var f=0;f>>16)-(c>>>16)-(n=1&g>>>16);n=1&d>>>16,this.__setDigit(e+f,d<<16|65535&g)}var p=this.__digit(e+f),v=t.__digit(f),y=(65535&p)-(65535&v)-n;n=1&y>>>16;var b=0;0==(1&r)&&(n=1&(b=(p>>>16)-(v>>>16)-n)>>>16),this.__setDigit(e+f,b<<16|65535&y)}return n}},{key:"__inplaceRightShift",value:function(t){if(0!==t){for(var e,r=this.__digit(0)>>>t,n=this.length-1,i=0;i>>t;this.__setDigit(n,r)}}},{key:"__digit",value:function(t){return this[t]}},{key:"__unsignedDigit",value:function(t){return this[t]>>>0}},{key:"__setDigit",value:function(t,e){this[t]=0|e}},{key:"__setDigitGrow",value:function(t,e){this[t]=0|e}},{key:"__halfDigitLength",value:function(){var t=this.length;return 65535>=this.__unsignedDigit(t-1)?2*t-1:2*t}},{key:"__halfDigit",value:function(t){return 65535&this[t>>>1]>>>((1&t)<<4)}},{key:"__setHalfDigit",value:function(t,e){var r=t>>>1,n=this.__digit(r),i=1&t?65535&n|e<<16:4294901760&n|65535&e;this.__setDigit(r,i)}}],[{key:"BigInt",value:function(e){var r=Math.floor,n=Number.isFinite;if("number"==typeof e){if(0===e)return l.__zero();if((0|e)===e)return 0>e?l.__oneDigit(-e,!0):l.__oneDigit(e,!1);if(!n(e)||r(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return l.__fromDouble(e)}if("string"==typeof e){var i=l.__fromString(e);if(null===i)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return i}if("boolean"==typeof e)return!0===e?l.__oneDigit(1,!1):l.__zero();if("object"===t(e)){if(e.constructor===l)return e;var o=l.__toPrimitive(e);return l.BigInt(o)}throw new TypeError("Cannot convert "+e+" to a BigInt")}},{key:"toNumber",value:function(t){var e=t.length;if(0===e)return 0;if(1===e){var r=t.__unsignedDigit(0);return t.sign?-r:r}var n=t.__digit(e-1),i=_(n),o=32*e-i;if(1024>>=12;var c=f-12,g=12<=f?0:s<<20+f,d=20+f;0>>32-c,g=s<>>32-d,d-=32);var p=l.__decideRounding(t,d,u,s);if((1===p||0===p&&1==(1&g))&&0==(g=g+1>>>0)&&0!=++h>>>20&&(h=0,1023<++a))return t.sign?-1/0:1/0;var v=t.sign?-2147483648:0;return a=a+1023<<20,l.__kBitConversionInts[1]=v|a|h,l.__kBitConversionInts[0]=g,l.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(t){if(0===t.length)return t;var e=t.__copy();return e.sign=!t.sign,e}},{key:"bitwiseNot",value:function(t){return t.sign?l.__absoluteSubOne(t).__trim():l.__absoluteAddOne(t,!0)}},{key:"exponentiate",value:function(t,e){if(e.sign)throw new RangeError("Exponent must be positive");if(0===e.length)return l.__oneDigit(1,!1);if(0===t.length)return t;if(1===t.length&&1===t.__digit(0))return t.sign&&0==(1&e.__digit(0))?l.unaryMinus(t):t;if(1=l.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){var n=1+(r>>>5),i=new l(n,t.sign&&0!=(1&r));i.__initializeDigits();var o=1<<(31&r);return i.__setDigit(n-1,o),i}var a=null,s=t;for(0!=(1&r)&&(a=t),r>>=1;0!==r;r>>=1)s=l.multiply(s,s),0!=(1&r)&&(a=null===a?s:l.multiply(a,s));return a}},{key:"multiply",value:function(t,e){if(0===t.length)return t;if(0===e.length)return e;var r=t.length+e.length;32<=t.__clzmsd()+e.__clzmsd()&&r--;var n=new l(r,t.sign!==e.sign);n.__initializeDigits();for(var i=0;il.__absoluteCompare(t,e))return l.__zero();var r,n=t.sign!==e.sign,i=e.__unsignedDigit(0);if(1===e.length&&65535>=i){if(1===i)return n===t.sign?t:l.unaryMinus(t);r=l.__absoluteDivSmall(t,i,null)}else r=l.__absoluteDivLarge(t,e,!0,!1);return r.sign=n,r.__trim()}},{key:"remainder",value:function(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>l.__absoluteCompare(t,e))return t;var r=e.__unsignedDigit(0);if(1===e.length&&65535>=r){if(1===r)return l.__zero();var n=l.__absoluteModSmall(t,r);return 0===n?l.__zero():l.__oneDigit(n,t.sign)}var i=l.__absoluteDivLarge(t,e,!1,!0);return i.sign=t.sign,i.__trim()}},{key:"add",value:function(t,e){var r=t.sign;return r===e.sign?l.__absoluteAdd(t,e,r):0<=l.__absoluteCompare(t,e)?l.__absoluteSub(t,e,r):l.__absoluteSub(e,t,!r)}},{key:"subtract",value:function(t,e){var r=t.sign;return r===e.sign?0<=l.__absoluteCompare(t,e)?l.__absoluteSub(t,e,r):l.__absoluteSub(e,t,!r):l.__absoluteAdd(t,e,r)}},{key:"leftShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?l.__rightShiftByAbsolute(t,e):l.__leftShiftByAbsolute(t,e)}},{key:"signedRightShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?l.__leftShiftByAbsolute(t,e):l.__rightShiftByAbsolute(t,e)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(t,e){return 0>l.__compareToBigInt(t,e)}},{key:"lessThanOrEqual",value:function(t,e){return 0>=l.__compareToBigInt(t,e)}},{key:"greaterThan",value:function(t,e){return 0=l.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.lengthl.__kMaxLengthBits)throw new RangeError("BigInt too big");return l.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=l.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length>>n)return e}return l.__truncateToNBits(t,e)}},{key:"ADD",value:function(t,e){if(t=l.__toPrimitive(t),e=l.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=l.__toNumeric(t),e=l.__toNumeric(e),l.__isBigInt(t)&&l.__isBigInt(e))return l.add(t,e);if("number"==typeof t&&"number"==typeof e)return t+e;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(t,e){return l.__compare(t,e,0)}},{key:"LE",value:function(t,e){return l.__compare(t,e,1)}},{key:"GT",value:function(t,e){return l.__compare(t,e,2)}},{key:"GE",value:function(t,e){return l.__compare(t,e,3)}},{key:"EQ",value:function(e,r){for(;;){if(l.__isBigInt(e))return l.__isBigInt(r)?l.equal(e,r):l.EQ(r,e);if("number"==typeof e){if(l.__isBigInt(r))return l.__equalToNumber(r,e);if("object"!==t(r))return e==r;r=l.__toPrimitive(r)}else if("string"==typeof e){if(l.__isBigInt(r))return null!==(e=l.__fromString(e))&&l.equal(e,r);if("object"!==t(r))return e==r;r=l.__toPrimitive(r)}else if("boolean"==typeof e){if(l.__isBigInt(r))return l.__equalToNumber(r,+e);if("object"!==t(r))return e==r;r=l.__toPrimitive(r)}else if("symbol"===t(e)){if(l.__isBigInt(r))return!1;if("object"!==t(r))return e==r;r=l.__toPrimitive(r)}else{if("object"!==t(e))return e==r;if("object"===t(r)&&r.constructor!==l)return e==r;e=l.__toPrimitive(e)}}}},{key:"NE",value:function(t,e){return!l.EQ(t,e)}},{key:"__zero",value:function(){return new l(0,!1)}},{key:"__oneDigit",value:function(t,e){var r=new l(1,e);return r.__setDigit(0,t),r}},{key:"__decideRounding",value:function(t,e,r,n){if(0e)i=-e-1;else{if(0===r)return-1;r--,n=t.__digit(r),i=31}var o=1<>>20)-1023,n=1+(r>>>5),i=new l(n,0>t),o=1048575&l.__kBitConversionInts[1]|1048576,a=l.__kBitConversionInts[0],s=20,u=31&r,_=0;if(u>>f,o=o<<32-f|a>>>f,a<<=32-f}else if(u===s)_=32,e=o,o=a;else{var h=u-s;_=32-h,e=o<>>32-h,o=a<=t&&9<=t)||(159>=t?32==t:131071>=t?160==t||5760==t:196607>=t?10>=(t&=131071)||40==t||41==t||47==t||95==t||4096==t:65279==t)}},{key:"__fromString",value:function(t){var e=11073741824/s)return null;var _=new l(31+(s*a+u>>>l.__kBitsPerCharTableShift)>>>5,!1),f=10>e?e:10,h=10>=l.__kBitsPerCharTableShift;var c=[],g=[],d=!1;do{for(var p,v=0,y=0;;){if(p=void 0,o-48>>>0>>0>>0>>0>>l.__kBitsPerCharTableShift+5;_.__inplaceMultiplyAdd(D,k,P)}while(!b)}if(i!==n){if(!l.__isWhitespace(o))return null;for(i++;i>>u-(o-=32))}if(0!==i){if(n>=t.length)throw new Error("implementation bug");t.__setDigit(n++,i)}for(;n>>1)+(85&n))>>>2)+(51&n))>>>4)+(15&n),o=e-1,a=t.__digit(r-1),s=0|(32*r-_(a)+i-1)/i;if(t.sign&&s++,268435456>>v,c=32-v;c>=i;)u[f--]=l.__kConversionChars[h&o],h>>>=i,c-=i}var y=(h|a<>>i-c;0!==h;)u[f--]=l.__kConversionChars[h&o],h>>>=i;if(t.sign&&(u[f--]="-"),-1!==f)throw new Error("implementation bug");return u.join("")}},{key:"__toStringGeneric",value:function(t,e,r){var n=t.length;if(0===n)return"";if(1===n){var i=t.__unsignedDigit(0).toString(e);return!1===r&&t.sign&&(i="-"+i),i}var o,a,s=32*n-_(t.__digit(n-1)),u=l.__kMaxBitsPerChar[e]-1,f=s*l.__kBitsPerCharTableMultiplier,h=1+(f=0|(f+=u-1)/u)>>1,c=l.exponentiate(l.__oneDigit(e,!1),l.__oneDigit(h,!1)),g=c.__unsignedDigit(0);if(1===c.length&&65535>=g){(o=new l(t.length,!1)).__initializeDigits();for(var d,p=0,v=2*t.length-1;0<=v;v--)d=p<<16|t.__halfDigit(v),o.__setHalfDigit(v,0|d/g),p=0|d%g;a=p.toString(e)}else{var y=l.__absoluteDivLarge(t,c,!0,!0);o=y.quotient;var b=y.remainder.__trim();a=l.__toStringGeneric(b,e,!0)}o.__trim();for(var m=l.__toStringGeneric(o,e,!0);a.lengthn?l.__absoluteLess(r):0}},{key:"__compareToNumber",value:function(t,e){if(!0|e){var r=t.sign,n=0>e;if(r!==n)return l.__unequalSign(r);if(0===t.length){if(n)throw new Error("implementation bug");return 0===e?0:-1}if(1i?l.__absoluteGreater(r):oe)return l.__unequalSign(r);if(0===e)throw new Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;l.__kBitConversionDouble[0]=e;var n=2047&l.__kBitConversionInts[1]>>>20;if(2047==n)throw new Error("implementation bug: handled elsewhere");var i=n-1023;if(0>i)return l.__absoluteGreater(r);var o=t.length,a=t.__digit(o-1),s=_(a),u=32*o-s,f=i+1;if(uf)return l.__absoluteGreater(r);var h=1048576|1048575&l.__kBitConversionInts[1],c=l.__kBitConversionInts[0],g=20,d=31-s;if(d!==(u-1)%31)throw new Error("implementation bug");var p,v=0;if(d>>y,h=h<<32-y|c>>>y,c<<=32-y}else if(d===g)v=32,p=h,h=c;else{var b=d-g;v=32-b,p=h<>>32-b,h=c<>>=0)>(p>>>=0))return l.__absoluteGreater(r);if(a>>0,h=c,c=0):p=0;var w=t.__unsignedDigit(m);if(w>p)return l.__absoluteGreater(r);if(we&&t.__unsignedDigit(0)===a(e):0===l.__compareToDouble(t,e)}},{key:"__comparisonResultToBool",value:function(t,e){switch(e){case 0:return 0>t;case 1:return 0>=t;case 2:return 0e;case 3:return t>=e}if(l.__isBigInt(t)&&"string"==typeof e)return null!==(e=l.__fromString(e))&&l.__comparisonResultToBool(l.__compareToBigInt(t,e),r);if("string"==typeof t&&l.__isBigInt(e))return null!==(t=l.__fromString(t))&&l.__comparisonResultToBool(l.__compareToBigInt(t,e),r);if(t=l.__toNumeric(t),e=l.__toNumeric(e),l.__isBigInt(t)){if(l.__isBigInt(e))return l.__comparisonResultToBool(l.__compareToBigInt(t,e),r);if("number"!=typeof e)throw new Error("implementation bug");return l.__comparisonResultToBool(l.__compareToNumber(t,e),r)}if("number"!=typeof t)throw new Error("implementation bug");if(l.__isBigInt(e))return l.__comparisonResultToBool(l.__compareToNumber(e,t),2^r);if("number"!=typeof e)throw new Error("implementation bug");return 0===r?te:3===r?t>=e:void 0}},{key:"__absoluteAdd",value:function(t,e,r){if(t.length>>16)+(s>>>16)+(_>>>16);o=f>>>16,i.__setDigit(a,65535&_|f<<16)}for(;a>>16)+(c>>>16);o=g>>>16,i.__setDigit(a,65535&c|g<<16)}return a>>16)-(s>>>16)-(i=1&u>>>16);i=1&_>>>16,n.__setDigit(o,65535&u|_<<16)}for(;o>>16)-(i=1&h>>>16);i=1&c>>>16,n.__setDigit(o,65535&h|c<<16)}return n.__trim()}},{key:"__absoluteAddOne",value:function(t,e){var r=2n?0:t.__unsignedDigit(n)>e.__unsignedDigit(n)?1:-1}},{key:"__multiplyAccumulate",value:function(t,e,r,n){if(0!==e){for(var i=65535&e,o=e>>>16,a=0,s=0,_=0,l=0;l>>16,g=t.__digit(l),d=65535&g,p=g>>>16,v=u(d,i),y=u(d,o),b=u(p,i),m=u(p,o);a=(s=(y>>>16)+(b>>>16)+(65535&m)+(a=(c+=_+a+((h+=s+(65535&v))>>>16)+(v>>>16)+(65535&y)+(65535&b))>>>16))>>>16,s&=65535,_=m>>>16,f=65535&h|c<<16,r.__setDigit(n,f)}for(;0!==a||0!==s||0!==_;n++){var w=r.__digit(n),k=(65535&w)+s,D=(w>>>16)+(k>>>16)+_+a;s=0,_=0,a=D>>>16,w=65535&k|D<<16,r.__setDigit(n,w)}}}},{key:"__internalMultiplyAdd",value:function(t,e,r,n,i){for(var o=r,a=0,s=0;s>>16;var h=u(_>>>16,e),c=(65535&h)+(l>>>16)+o;o=c>>>16,a=h>>>16,i.__setDigit(s,c<<16|65535&f)}if(i.length>n)for(i.__setDigit(n++,o+a);n>>0,a=0|o/e,s=0|(o=((n=0|o%e)<<16|t.__halfDigit(i-1))>>>0)/e;n=0|o%e,r.__setDigit(i>>>1,a<<16|s)}return r}},{key:"__absoluteModSmall",value:function(t,e){for(var r=0,n=2*t.length-1;0<=n;n--)r=0|((r<<16|t.__halfDigit(n))>>>0)%e;return r}},{key:"__absoluteDivLarge",value:function(t,e,r,n){var i=e.__halfDigitLength(),o=e.length,a=t.__halfDigitLength()-i,s=null;r&&(s=new l(a+2>>>1,!1)).__initializeDigits();var _=new l(i+2>>>1,!1);_.__initializeDigits();var f=l.__clz16(e.__halfDigit(i-1));0>>0;p=0|y/c;for(var b=0|y%c,m=e.__halfDigit(i-2),w=h.__halfDigit(d+i-2);u(p,m)>>>0>(b<<16|w)>>>0&&(p--,!(65535<(b+=c))););}l.__internalMultiplyAdd(e,p,0,o,_);var k=h.__inplaceSub(_,d,i+1);0!==k&&(k=h.__inplaceAdd(e,d,i),h.__setHalfDigit(d+i,h.__halfDigit(d+i)+k),p--),r&&(1&d?g=p<<16:s.__setDigit(d>>>1,g|p))}return n?(h.__inplaceRightShift(f),r?{quotient:s,remainder:h}:h):r?s:void 0}},{key:"__clz16",value:function(t){return _(t)-16}},{key:"__specialLeftShift",value:function(t,e,r){var n=t.length,i=new l(n+r,!1);if(0===e){for(var o=0;o>>32-e;return 0r)throw new RangeError("BigInt too big");var n=r>>>5,i=31&r,o=t.length,a=0!==i&&0!=t.__digit(o-1)>>>32-i,s=o+n+(a?1:0),u=new l(s,t.sign);if(0===i){for(var _=0;_>>32-i;if(a)u.__setDigit(o+n,f);else if(0!==f)throw new Error("implementation bug")}return u.__trim()}},{key:"__rightShiftByAbsolute",value:function(t,e){var r=t.length,n=t.sign,i=l.__toShiftAmount(e);if(0>i)return l.__rightShiftByMaximum(n);var o=i>>>5,a=31&i,s=r-o;if(0>=s)return l.__rightShiftByMaximum(n);var u=!1;if(n)if(0!=(t.__digit(o)&(1<>>a,d=r-o-1,p=0;p>>a;f.__setDigit(d,g)}return u&&(f=l.__absoluteAddOne(f,!0,f)),f.__trim()}},{key:"__rightShiftByMaximum",value:function(t){return t?l.__oneDigit(1,!0):l.__zero()}},{key:"__toShiftAmount",value:function(t){if(1l.__kMaxLengthBits?-1:e}},{key:"__toPrimitive",value:function(e){var r=1>>5,n=new l(r,e.sign),i=r-1,o=0;o>>s}return n.__setDigit(i,a),n.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(t,e,r){for(var n=Math.min,i=t+31>>>5,o=new l(i,r),a=0,s=i-1,u=0,_=n(s,e.length);a<_;a++){var f=e.__digit(a),h=0-(65535&f)-u,c=0-(f>>>16)-(u=1&h>>>16);u=1&c>>>16,o.__setDigit(a,65535&h|c<<16)}for(;a>>16)-(u=1&v>>>16)<<16}else{var y=32-p,b=1<<32-y,m=(65535&b)-(65535&(d=d<>>y))-u;g=65535&m|(b>>>16)-(d>>>16)-(u=1&m>>>16)<<16,g&=b-1}return o.__setDigit(s,g),o.__trim()}},{key:"__digitPow",value:function(t,e){for(var r=1;0>>=1,t*=t;return r}}]),l}(l(Array));return c.__kMaxLength=33554432,c.__kMaxLengthBits=c.__kMaxLength<<5,c.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],c.__kBitsPerCharTableShift=5,c.__kBitsPerCharTableMultiplier=1<a)throw new Error(s);let u=i.filter(t=>!r.includes(t));if(i.length-u.length!==o)throw new Error(s);if(u.find(t=>!n.includes(t)))throw new Error(s)}function u(t,e){if(!/^0x([0-9a-fA-F][0-9a-fA-F])*$/.test(e))throw new Error(t+" must be a hex string!")}function _(t,e){if(u(t,e),66!=e.length)throw new Error(t+" must be a hex string of 66 bytes long!")}function l(t,e){if("0x0"!==e&&!/^0x[1-9a-fA-F][0-9a-fA-F]*$/.test(e))throw new Error(t+" must be a hex integer!")}function f(t,{nestedValidation:e=!0,debugPath:r="script"}={}){if(s(r,t,["code_hash","hash_type","args"],[]),_(r+".code_hash",t.code_hash),u(r+".args",t.args),"data"!==t.hash_type&&"type"!==t.hash_type)throw new Error(r+".hash_type must be either data or type!")}function h(t,{nestedValidation:e=!0,debugPath:r="out_point"}={}){s(r,t,["tx_hash","index"],[]),_(r+".tx_hash",t.tx_hash),l(r+".index",t.index)}function c(t,{nestedValidation:e=!0,debugPath:r="cell_input"}={}){s(r,t,["since","previous_output"],[]),l(r+".since",t.since),e&&h(t.previous_output,{debugPath:r+".previous_output"})}function g(t,{nestedValidation:e=!0,debugPath:r="cell_output"}={}){s(r,t,["capacity","lock"],["type"]),l(r+".capacity",t.capacity),e&&(f(t.lock,{debugPath:r+".lock"}),t.type&&f(t.type,{debugPath:r+".type"}))}function d(t,{nestedValidation:e=!0,debugPath:r="cell_dep"}={}){if(s(r,t,["out_point","dep_type"],[]),"code"!==t.dep_type&&"dep_group"!==t.dep_type)throw new Error(r+".dep_type must be either code or dep_group!");e&&h(t.out_point,{debugPath:r+".out_point"})}function p(t,e,r,n){if(!Array.isArray(e))throw new Error(t+" is not an array!");if(n)for(let n=0;n=r.outputs.length)throw new Error(`Transaction ${t.tx_hash} does not have output ${n}!`);const i={output:r.outputs[n],data:r.outputs_data[n]};return"committed"===e.tx_status.status&&(i.header=e.tx_status.block_hash),i}}var x=o((function(t,e){var r=function(t){function e(){this.fetch=!1,this.DOMException=t.DOMException}return e.prototype=t,new e}("undefined"!=typeof self?self:i);!function(t){!function(e){var r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,i="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in t,a="ArrayBuffer"in t;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function _(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function l(t){return"string"!=typeof t&&(t=String(t)),t}function f(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function h(t){this.map={},t instanceof h?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function g(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function d(t){var e=new FileReader,r=g(e);return e.readAsArrayBuffer(t),r}function p(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&i&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=p(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||u(t))?this._bodyArrayBuffer=p(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var t,e,r,n=c(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=g(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function m(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function w(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new h(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var k=[301,302,303,307,308];w.redirect=function(t,e){if(-1===k.indexOf(e))throw new RangeError("Invalid status code");return new w(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function D(t,r){return new Promise((function(n,o){var a=new b(t,r);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var t,e,r={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new h,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new w(i,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}D.polyfill=!0,t.fetch||(t.fetch=D,t.Headers=h,t.Request=b,t.Response=w),e.Headers=h,e.Request=b,e.Response=w,e.fetch=D}({})}(r),delete r.fetch.polyfill,(e=r.fetch).default=r.fetch,e.fetch=r.fetch,e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response,t.exports=e}));function O(t,e){e=e||{};const r=Object.assign({},e.headers||{},t.headers||{});return Object.assign({},e,t,{headers:r})}const C={get:(t,e,r)=>"send"===e?async()=>{const e=await x(t.uri,O({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.payload)},t.defaultOptions));return await e.json()}:(...n)=>{const i=t.id;return t.id=t.id+1,t.payload.push({jsonrpc:"2.0",id:i,method:e,params:n}),r}},I={get:(t,e)=>"batch"===e?()=>new Proxy({id:Math.round(1e7*Math.random()),payload:[],uri:t.uri,defaultOptions:t.defaultOptions},C):async(...r)=>{const n=Math.round(1e7*Math.random()),i=await x(t.uri,O({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:n,method:e,params:r})},t.defaultOptions)),o=await i.json();if(o.id!==n)throw new Error("JSONRPCError: response ID does not match request ID!");if(o.error)throw new Error("JSONRPCError: server error "+JSON.stringify(o.error));return o.result}};class R{constructor(t,e={}){return this.uri=t,this.defaultOptions=e,new Proxy(this,I)}static create(t){return new R(t)}}function j(t){return a.BigInt(t)}function z(t){return"0x"+t.toString(16)}function M(t){return function(e,r){if(!(r instanceof ArrayBuffer)){let n=z(a.BigInt(r)).substr(2);if(n.length%2!=0&&(n="0"+n),n.length/2>t)throw new Error(`${e} is ${n.length/2} bytes long, expected length is ${t}!`);const i=new DataView(new ArrayBuffer(t));for(let t=0;t0&&r.byteLength!==t)throw new Error(`${e} has invalid length ${r.byteLength}, required: ${t}`);return r}}function L(t,e,r){const n={};for(const[i,o]of Object.entries(r)){const r=e[i];if(!r)throw new Error(`${t} is missing ${i}!`);n[i]=o(`${t}.${i}`,r)}return n}function U(t,{debugPath:e="script"}={}){return L(e,t,{code_hash:N(32),hash_type:function(t,e){switch(e){case"data":return 0;case"type":return 1;case 0:case 1:return e;default:throw new Error(`${t}.hash_type has invalid value: ${e}`)}},args:N(-1)})}function q(t,{debugPath:e="out_point"}={}){return L(e,t,{tx_hash:N(32),index:M(4)})}function V(t){return function(e,r){return t(r,{debugPath:e})}}function $(t,{debugPath:e="cell_input"}={}){return L(e,t,{since:M(8),previous_output:V(q)})}function F(t,{debugPath:e="cell_output"}={}){const r=L(e,t,{capacity:M(8),lock:V(U)});return t.type&&(r.type_=U(t.type,{debugPath:e+".type"})),r}function G(t,{debugPath:e="cell_dep"}={}){return L(e,t,{out_point:V(q),dep_type:function(t,e){switch(e){case"code":return 0;case"dep_group":return 1;case 0:case 1:return e;default:throw new Error(`${t}.dep_type has invalid value: ${e}`)}}})}function H(t){return function(e,r){return r.map((r,n)=>t(`${e}[${n}]`,r))}}function W(t,{debugPath:e="raw_transaction"}={}){return L(e,t,{version:M(4),cell_deps:H(V(G)),header_deps:H(N(32)),inputs:H(V($)),outputs:H(V(F)),outputs_data:H(N(-1))})}function J(t,{debugPath:e="transaction"}={}){const r=W(t,{debugPath:"(raw)"+e}),n=L(e,t,{witnesses:H(N(-1))});return n.raw=r,n}function X(t,{debugPath:e="raw_header"}={}){return L(e,t,{version:M(4),compact_target:M(4),timestamp:M(8),number:M(8),epoch:M(8),parent_hash:N(32),transactions_root:N(32),proposals_hash:N(32),uncles_hash:N(32),dao:N(32)})}function Q(t,{debugPath:e="header"}={}){const r=X(t,{debugPath:"(raw)"+e}),n=L(e,t,{nonce:M(16)});return n.raw=r,n}function K(t,{debugPath:e="uncle_block"}={}){return L(e,t,{header:V(Q),proposals:H(N(10))})}var Y=Object.freeze({__proto__:null,NormalizeScript:U,NormalizeOutPoint:q,NormalizeCellInput:$,NormalizeCellOutput:F,NormalizeCellDep:G,NormalizeRawTransaction:W,NormalizeTransaction:J,NormalizeRawHeader:X,NormalizeHeader:Q,NormalizeUncleBlock:K,NormalizeBlock:function(t,{debugPath:e="block"}={}){return L(e,t,{header:V(Q),uncles:H(V(K)),transactions:H(V(J)),proposals:H(N(10))})},NormalizeCellbaseWitness:function(t,{debugPath:e="cellbase_witness"}={}){return L(e,t,{lock:V(U),message:N(-1)})},NormalizeWitnessArgs:function(t,{debugPath:e="witness_args"}={}){const r={};return t.lock&&(r.lock=N(-1)(e+".lock",t.lock)),t.input_type&&(r.input_type=N(-1)(e+".input_type",t.input_type)),t.output_type&&(r.output_type=N(-1)(e+".output_type",t.output_type)),r}});function Z(t,e){return e instanceof Object&&e.serializeJson instanceof Function?e.serializeJson.call(e):e}function tt(t,e,r){if(!((e=Z(0,e))instanceof Object))throw new Error(`Transformed ${t} is not an object!`);const n={};for(const[i,o]of Object.entries(r)){let r=e[i];if(!r){r=e[i.replace(/(_[a-z])/g,t=>t.toUpperCase().replace("_",""))]}r&&(n[i]=o(`${t}.${i}`,r))}return n}function et(t,{validation:e=!0,debugPath:r="script"}={}){return t=tt(r,t,{code_hash:Z,hash_type:Z,args:Z}),e&&f(t,{debugPath:"(transformed) "+r}),t}function rt(t,{validation:e=!0,debugPath:r="out_point"}={}){return t=tt(r,t,{tx_hash:Z,index:Z}),e&&h(t,{debugPath:"(transformed) "+r}),t}function nt(t){return function(e,r){return t(r,{validation:!1,debugPath:e})}}function it(t,{validation:e=!0,debugPath:r="cell_input"}={}){return t=tt(r,t,{since:Z,previous_output:nt(rt)}),e&&c(t,{debugPath:"(transformed) "+r}),t}function ot(t,{validation:e=!0,debugPath:r="cell_output"}={}){return t=tt(r,t,{capacity:Z,lock:nt(et),type:nt(et)}),e&&g(t,{debugPath:"(transformed) "+r}),t}function at(t,{validation:e=!0,debugPath:r="cell_dep"}={}){return t=tt(r,t,{out_point:nt(rt),dep_type:Z}),e&&d(t,{debugPath:"(transformed) "+r}),t}function st(t){return function(e,r){return r.map((r,n)=>t(`${e}[${n}]`,r))}}function ut(t,{validation:e=!0,debugPath:r="transaction"}={}){return t=tt(r,t,{version:Z,cell_deps:st(nt(at)),header_deps:st(Z),inputs:st(nt(it)),outputs:st(nt(ot)),outputs_data:st(Z),witnesses:st(Z)}),e&&m(t,{debugPath:"(transformed) "+r}),t}function _t(t,{validation:e=!0,debugPath:r="header"}={}){return t=tt(r,t,{version:Z,compact_target:Z,timestamp:Z,number:Z,epoch:Z,parent_hash:Z,transactions_root:Z,proposals_hash:Z,uncles_hash:Z,dao:Z,nonce:Z}),e&&k(t,{debugPath:"(transformed) "+r}),t}function lt(t,{validation:e=!0,debugPath:r="uncle_block"}={}){return t=tt(r,t,{header:nt(_t),proposals:st(Z)}),e&&B(t,{debugPath:"(transformed) "+r}),t}var ft=Object.freeze({__proto__:null,TransformScript:et,TransformOutPoint:rt,TransformCellInput:it,TransformCellOutput:ot,TransformCellDep:at,TransformRawTransaction:function(t,{validation:e=!0,debugPath:r="raw_transaction"}={}){return t=tt(r,t,{version:Z,cell_deps:st(nt(at)),header_deps:st(Z),inputs:st(nt(it)),outputs:st(nt(ot)),outputs_data:st(Z)}),e&&b(t,{debugPath:"(transformed) "+r}),t},TransformTransaction:ut,TransformRawHeader:function(t,{validation:e=!0,debugPath:r="raw_header"}={}){return t=tt(r,t,{version:Z,compact_target:Z,timestamp:Z,number:Z,epoch:Z,parent_hash:Z,transactions_root:Z,proposals_hash:Z,uncles_hash:Z,dao:Z}),e&&w(t,{debugPath:"(transformed) "+r}),t},TransformHeader:_t,TransformUncleBlock:lt,TransformBlock:function(t,{validation:e=!0,debugPath:r="block"}={}){return t=tt(r,t,{header:nt(_t),uncles:st(nt(lt)),transactions:st(nt(ut)),proposals:st(Z)}),e&&P(t,{debugPath:"(transformed) "+r}),t},TransformCellbaseWitness:function(t,{validation:e=!0,debugPath:r="cellbase_witness"}={}){return t=tt(r,t,{lock:nt(et),message:Z}),e&&A(t,{debugPath:"(transformed) "+r}),t},TransformWitnessArgs:function(t,{validation:e=!0,debugPath:r="witness_args"}={}){return t=tt(r,t,{lock:Z,input_type:Z,output_type:Z}),e&&T(t,{debugPath:"(transformed) "+r}),t}});var ht=Object.freeze({__proto__:null,RPCCollector:class{constructor(t,e,{skipCellWithContent:r=!0,loadData:i=!1,loadBlockNumber:o=!0}={}){this.rpc=t,this.lockHash=new n(e).serializeJson(),this.skipCellWithContent=r,this.loadData=i,this.loadBlockNumber=o}async*collect(){const t=j(await this.rpc.get_tip_block_number());let e=a.BigInt(0);for(;a.lessThanOrEqual(e,t);){let r=a.add(e,a.BigInt(100));a.greaterThan(r,t)&&(r=t);const n=await this.rpc.get_cells_by_lock_hash(this.lockHash,z(e),z(r));for(const t of n){if(this.skipCellWithContent&&(t.type||a.greaterThan(j(t.output_data_len),a.BigInt(100))))continue;let e=null;if(this.loadData){e=(await this.rpc.get_live_cell(t.out_point,!0)).cell.data.content}let r=null;if(this.loadBlockNumber){r=(await this.rpc.get_header(t.block_hash)).number}yield{cellbase:t.cellbase,cell_output:{capacity:t.capacity,lock:t.lock,type:t.type},out_point:t.out_point,block_hash:t.block_hash,data:e,output_data_len:t.output_data_len,block_number:r}}e=a.add(r,a.BigInt(1))}}}});const ct="0.10.2";export{z as BigIntToHexString,j as HexStringToBigInt,R as RPC,n as Reader,S as TransactionDumper,ct as VERSION,ht as cell_collectors,Y as normalizers,ft as transformers,E as validators}; diff --git a/dist/ckb-js-toolkit.node.js b/dist/ckb-js-toolkit.node.js index 19a7d2b..1db62b9 100644 --- a/dist/ckb-js-toolkit.node.js +++ b/dist/ckb-js-toolkit.node.js @@ -1,2 +1,2 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("stream"),e=require("http"),r=require("url"),n=require("https"),i=require("zlib");function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=o(t),a=o(e),u=o(r),l=o(n),c=o(i);class _{constructor(t){this.view=new DataView(t)}length(){return this.view.byteLength}indexAt(t){return this.view.getUint8(t)}toArrayBuffer(){return this.view.buffer}serializeJson(){return"0x"+Array.prototype.map.call(new Uint8Array(this.view.buffer),t=>("00"+t.toString(16)).slice(-2)).join("")}}class f{constructor(t){this.string=t}length(){return this.string.length/2-1}indexAt(t){return parseInt(this.string.substr(2+2*t,2),16)}toArrayBuffer(){const t=new ArrayBuffer(this.length()),e=new DataView(t);for(let t=0;t255)throw new Error("fromRawString can only accept UTF-8 raw string!");r.setUint8(e,n)}return new _(e)}}class g extends Array{constructor(t,e){if(t>g.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");super(t),this.sign=e}static BigInt(t){var e=Math.floor,r=Number.isFinite;if("number"==typeof t){if(0===t)return g.__zero();if((0|t)===t)return 0>t?g.__oneDigit(-t,!0):g.__oneDigit(t,!1);if(!r(t)||e(t)!==t)throw new RangeError("The number "+t+" cannot be converted to BigInt because it is not an integer");return g.__fromDouble(t)}if("string"==typeof t){const e=g.__fromString(t);if(null===e)throw new SyntaxError("Cannot convert "+t+" to a BigInt");return e}if("boolean"==typeof t)return!0===t?g.__oneDigit(1,!1):g.__zero();if("object"==typeof t){if(t.constructor===g)return t;const e=g.__toPrimitive(t);return g.BigInt(e)}throw new TypeError("Cannot convert "+t+" to a BigInt")}toDebugString(){const t=["BigInt["];for(const e of this)t.push((e?(e>>>0).toString(16):e)+", ");return t.push("]"),t.join("")}toString(t=10){if(2>t||36>>=12;const _=l-12;let f=12<=l?0:a<<20+l,h=20+l;0<_&&0>>32-_,f=a<<_,h=_),0>>32-h,h-=32);const d=g.__decideRounding(t,h,u,a);if((1===d||0===d&&1==(1&f))&&(f=f+1>>>0,0==f&&(c++,0!=c>>>20&&(c=0,s++,1023=g.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){const e=1+(r>>>5),n=t.sign&&0!=(1&r),i=new g(e,n);i.__initializeDigits();const o=1<<(31&r);return i.__setDigit(e-1,o),i}let n=null,i=t;for(0!=(1&r)&&(n=t),r>>=1;0!==r;r>>=1)i=g.multiply(i,i),0!=(1&r)&&(n=null===n?i:g.multiply(n,i));return n}static multiply(t,e){if(0===t.length)return t;if(0===e.length)return e;let r=t.length+e.length;32<=t.__clzmsd()+e.__clzmsd()&&r--;const n=new g(r,t.sign!==e.sign);n.__initializeDigits();for(let r=0;rg.__absoluteCompare(t,e))return g.__zero();const r=t.sign!==e.sign,n=e.__unsignedDigit(0);let i;if(1===e.length&&65535>=n){if(1===n)return r===t.sign?t:g.unaryMinus(t);i=g.__absoluteDivSmall(t,n,null)}else i=g.__absoluteDivLarge(t,e,!0,!1);return i.sign=r,i.__trim()}static remainder(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>g.__absoluteCompare(t,e))return t;const r=e.__unsignedDigit(0);if(1===e.length&&65535>=r){if(1===r)return g.__zero();const e=g.__absoluteModSmall(t,r);return 0===e?g.__zero():g.__oneDigit(e,t.sign)}const n=g.__absoluteDivLarge(t,e,!1,!0);return n.sign=t.sign,n.__trim()}static add(t,e){const r=t.sign;return r===e.sign?g.__absoluteAdd(t,e,r):0<=g.__absoluteCompare(t,e)?g.__absoluteSub(t,e,r):g.__absoluteSub(e,t,!r)}static subtract(t,e){const r=t.sign;return r===e.sign?0<=g.__absoluteCompare(t,e)?g.__absoluteSub(t,e,r):g.__absoluteSub(e,t,!r):g.__absoluteAdd(t,e,r)}static leftShift(t,e){return 0===e.length||0===t.length?t:e.sign?g.__rightShiftByAbsolute(t,e):g.__leftShiftByAbsolute(t,e)}static signedRightShift(t,e){return 0===e.length||0===t.length?t:e.sign?g.__leftShiftByAbsolute(t,e):g.__rightShiftByAbsolute(t,e)}static unsignedRightShift(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}static lessThan(t,e){return 0>g.__compareToBigInt(t,e)}static lessThanOrEqual(t,e){return 0>=g.__compareToBigInt(t,e)}static greaterThan(t,e){return 0=g.__kMaxLengthBits)return e;const r=t+31>>>5;if(e.lengthg.__kMaxLengthBits)throw new RangeError("BigInt too big");return g.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=g.__kMaxLengthBits)return e;const r=t+31>>>5;if(e.length>>n)return e}return g.__truncateToNBits(t,e)}static ADD(t,e){if(t=g.__toPrimitive(t),e=g.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=g.__toNumeric(t),e=g.__toNumeric(e),g.__isBigInt(t)&&g.__isBigInt(e))return g.add(t,e);if("number"==typeof t&&"number"==typeof e)return t+e;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}static LT(t,e){return g.__compare(t,e,0)}static LE(t,e){return g.__compare(t,e,1)}static GT(t,e){return g.__compare(t,e,2)}static GE(t,e){return g.__compare(t,e,3)}static EQ(t,e){for(;;){if(g.__isBigInt(t))return g.__isBigInt(e)?g.equal(t,e):g.EQ(e,t);if("number"==typeof t){if(g.__isBigInt(e))return g.__equalToNumber(e,t);if("object"!=typeof e)return t==e;e=g.__toPrimitive(e)}else if("string"==typeof t){if(g.__isBigInt(e))return null!==(t=g.__fromString(t))&&g.equal(t,e);if("object"!=typeof e)return t==e;e=g.__toPrimitive(e)}else if("boolean"==typeof t){if(g.__isBigInt(e))return g.__equalToNumber(e,+t);if("object"!=typeof e)return t==e;e=g.__toPrimitive(e)}else if("symbol"==typeof t){if(g.__isBigInt(e))return!1;if("object"!=typeof e)return t==e;e=g.__toPrimitive(e)}else{if("object"!=typeof t)return t==e;if("object"==typeof e&&e.constructor!==g)return t==e;t=g.__toPrimitive(t)}}}static NE(t,e){return!g.EQ(t,e)}static __zero(){return new g(0,!1)}static __oneDigit(t,e){const r=new g(1,e);return r.__setDigit(0,t),r}__copy(){const t=new g(this.length,this.sign);for(let e=0;ee)i=-e-1;else{if(0===r)return-1;r--,n=t.__digit(r),i=31}let o=1<>>20)-1023,r=1+(e>>>5),n=new g(r,0>t);let i=1048575&g.__kBitConversionInts[1]|1048576,o=g.__kBitConversionInts[0];const s=31&e;let a,u=0;if(s<20){const t=20-s;u=t+32,a=i>>>t,i=i<<32-t|o>>>t,o<<=32-t}else if(20===s)u=32,a=i,i=o;else{const t=s-20;u=32-t,a=i<>>32-t,i=o<=t&&9<=t)||(159>=t?32==t:131071>=t?160==t||5760==t:196607>=t?10>=(t&=131071)||40==t||41==t||47==t||95==t||4096==t:65279==t)}static __fromString(t,e=0){let r=0;const n=t.length;let i=0;if(i===n)return g.__zero();let o=t.charCodeAt(i);for(;g.__isWhitespace(o);){if(++i===n)return g.__zero();o=t.charCodeAt(i)}if(43===o){if(++i===n)return null;o=t.charCodeAt(i),r=1}else if(45===o){if(++i===n)return null;o=t.charCodeAt(i),r=-1}if(0===e){if(e=10,48===o){if(++i===n)return g.__zero();if(o=t.charCodeAt(i),88===o||120===o){if(e=16,++i===n)return null;o=t.charCodeAt(i)}else if(79===o||111===o){if(e=8,++i===n)return null;o=t.charCodeAt(i)}else if(66===o||98===o){if(e=2,++i===n)return null;o=t.charCodeAt(i)}}}else if(16===e&&48===o){if(++i===n)return g.__zero();if(o=t.charCodeAt(i),88===o||120===o){if(++i===n)return null;o=t.charCodeAt(i)}}for(;48===o;){if(++i===n)return g.__zero();o=t.charCodeAt(i)}const s=n-i;let a=g.__kMaxBitsPerChar[e],u=g.__kBitsPerCharTableMultiplier-1;if(s>1073741824/a)return null;const l=a*s+u>>>g.__kBitsPerCharTableShift,c=new g(l+31>>>5,!1),_=10>e?e:10,f=10>=g.__kBitsPerCharTableShift;const e=[],r=[];let s=!1;do{let u=0,l=0;for(;;){let e;if(o-48>>>0<_)e=o-48;else{if(!((32|o)-97>>>0>>0<_)a=o-48;else{if(!((32|o)-97>>>0>>g.__kBitsPerCharTableShift+5;c.__inplaceMultiplyAdd(h,l,d)}while(!r)}if(i!==n){if(!g.__isWhitespace(o))return null;for(i++;i>>u-o)}if(0!==i){if(n>=t.length)throw new Error("implementation bug");t.__setDigit(n++,i)}for(;n>>1)+(85&i),i=(51&i>>>2)+(51&i),i=(15&i>>>4)+(15&i);const o=i,s=e-1,a=t.__digit(n-1);let u=0|(32*n-r(a)+o-1)/o;if(t.sign&&u++,268435456>>i,f=32-i;f>=o;)l[c--]=g.__kConversionChars[_&s],_>>>=o,f-=o}const h=(_|a<>>o-f;0!==_;)l[c--]=g.__kConversionChars[_&s],_>>>=o;if(t.sign&&(l[c--]="-"),-1!=c)throw new Error("implementation bug");return l.join("")}static __toStringGeneric(t,e,r){var n=Math.clz32;const i=t.length;if(0===i)return"";if(1===i){let n=t.__unsignedDigit(0).toString(e);return!1===r&&t.sign&&(n="-"+n),n}const o=32*i-n(t.__digit(i-1)),s=g.__kMaxBitsPerChar[e]-1;let a=o*g.__kBitsPerCharTableMultiplier;a+=s-1,a=0|a/s;const u=a+1>>1,l=g.exponentiate(g.__oneDigit(e,!1),g.__oneDigit(u,!1));let c,_;const f=l.__unsignedDigit(0);if(1===l.length&&65535>=f){c=new g(t.length,!1),c.__initializeDigits();let r=0;for(let e=2*t.length-1;0<=e;e--){const n=r<<16|t.__halfDigit(e);c.__setHalfDigit(e,0|n/f),r=0|n%f}_=r.toString(e)}else{const r=g.__absoluteDivLarge(t,l,!0,!0);c=r.quotient;const n=r.remainder.__trim();_=g.__toStringGeneric(n,e,!0)}c.__trim();let h=g.__toStringGeneric(c,e,!0);for(;_.lengthn?g.__absoluteLess(r):0}static __compareToNumber(t,e){if(!0|e){const r=t.sign,n=0>e;if(r!==n)return g.__unequalSign(r);if(0===t.length){if(n)throw new Error("implementation bug");return 0===e?0:-1}if(1i?g.__absoluteGreater(r):oe)return g.__unequalSign(n);if(0===e)throw new Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;g.__kBitConversionDouble[0]=e;const i=2047&g.__kBitConversionInts[1]>>>20;if(2047==i)throw new Error("implementation bug: handled elsewhere");const o=i-1023;if(0>o)return g.__absoluteGreater(n);const s=t.length;let a=t.__digit(s-1);const u=r(a),l=32*s-u,c=o+1;if(lc)return g.__absoluteGreater(n);let _=1048576|1048575&g.__kBitConversionInts[1],f=g.__kBitConversionInts[0];const h=31-u;if(h!==(l-1)%31)throw new Error("implementation bug");let d,p=0;if(20>h){const t=20-h;p=t+32,d=_>>>t,_=_<<32-t|f>>>t,f<<=32-t}else if(20===h)p=32,d=_,_=f;else{const t=h-20;p=32-t,d=_<>>32-t,_=f<>>=0,d>>>=0,a>d)return g.__absoluteGreater(n);if(a>>0,_=f,f=0):d=0;const r=t.__unsignedDigit(e);if(r>d)return g.__absoluteGreater(n);if(re&&t.__unsignedDigit(0)===r(e):0===g.__compareToDouble(t,e)}static __comparisonResultToBool(t,e){switch(e){case 0:return 0>t;case 1:return 0>=t;case 2:return 0e;case 3:return t>=e}if(g.__isBigInt(t)&&"string"==typeof e)return null!==(e=g.__fromString(e))&&g.__comparisonResultToBool(g.__compareToBigInt(t,e),r);if("string"==typeof t&&g.__isBigInt(e))return null!==(t=g.__fromString(t))&&g.__comparisonResultToBool(g.__compareToBigInt(t,e),r);if(t=g.__toNumeric(t),e=g.__toNumeric(e),g.__isBigInt(t)){if(g.__isBigInt(e))return g.__comparisonResultToBool(g.__compareToBigInt(t,e),r);if("number"!=typeof e)throw new Error("implementation bug");return g.__comparisonResultToBool(g.__compareToNumber(t,e),r)}if("number"!=typeof t)throw new Error("implementation bug");if(g.__isBigInt(e))return g.__comparisonResultToBool(g.__compareToNumber(e,t),2^r);if("number"!=typeof e)throw new Error("implementation bug");return 0===r?te:3===r?t>=e:void 0}__clzmsd(){return Math.clz32(this[this.length-1])}static __absoluteAdd(t,e,r){if(t.length>>16)+(r>>>16)+(a>>>16);o=u>>>16,i.__setDigit(s,65535&a|u<<16)}for(;s>>16)+(r>>>16);o=n>>>16,i.__setDigit(s,65535&r|n<<16)}return s>>16;const u=(r>>>16)-(s>>>16)-i;i=1&u>>>16,n.__setDigit(o,65535&a|u<<16)}for(;o>>16;const s=(e>>>16)-i;i=1&s>>>16,n.__setDigit(o,65535&r|s<<16)}return n.__trim()}static __absoluteAddOne(t,e,r=null){const n=t.length;null===r?r=new g(n,e):r.sign=e;let i=!0;for(let e,o=0;on?0:t.__unsignedDigit(n)>e.__unsignedDigit(n)?1:-1}static __multiplyAccumulate(t,e,r,n){var i=Math.imul;if(0===e)return;const o=65535&e,s=e>>>16;let a=0,u=0,l=0;for(let e=0;e>>16;const h=t.__digit(e),g=65535&h,d=h>>>16,p=i(g,o),b=i(g,s),m=i(d,o),y=i(d,s);_+=u+(65535&p),f+=l+a+(_>>>16)+(p>>>16)+(65535&b)+(65535&m),a=f>>>16,u=(b>>>16)+(m>>>16)+(65535&y)+a,a=u>>>16,u&=65535,l=y>>>16,c=65535&_|f<<16,r.__setDigit(n,c)}for(;0!=a||0!==u||0!==l;n++){let t=r.__digit(n);const e=(65535&t)+u,i=(t>>>16)+(e>>>16)+l+a;u=0,l=0,a=i>>>16,t=65535&e|i<<16,r.__setDigit(n,t)}}static __internalMultiplyAdd(t,e,r,n,i){var o=Math.imul;let s=r,a=0;for(let r=0;r>>16;const c=o(n>>>16,e),_=(65535&c)+(u>>>16)+s;s=_>>>16,a=c>>>16,i.__setDigit(r,_<<16|65535&l)}if(i.length>n)for(i.__setDigit(n++,s+a);nthis.length&&(r=this.length);const i=65535&t,o=t>>>16;let s=0,a=65535&e,u=e>>>16;for(let t=0;t>>16,c=n(r,i),_=n(r,o),f=n(l,i),h=n(l,o),g=a+(65535&c),d=u+s+(g>>>16)+(c>>>16)+(65535&_)+(65535&f);a=(_>>>16)+(f>>>16)+(65535&h)+(d>>>16),s=a>>>16,a&=65535,u=h>>>16,this.__setDigit(t,65535&g|d<<16)}if(0!=s||0!==a||0!==u)throw new Error("implementation bug")}static __absoluteDivSmall(t,e,r){null===r&&(r=new g(t.length,!1));let n=0;for(let i,o=2*t.length-1;0<=o;o-=2){i=(n<<16|t.__halfDigit(o))>>>0;const s=0|i/e;n=0|i%e,i=(n<<16|t.__halfDigit(o-1))>>>0;const a=0|i/e;n=0|i%e,r.__setDigit(o>>>1,s<<16|a)}return r}static __absoluteModSmall(t,e){let r=0;for(let n=2*t.length-1;0<=n;n--){r=0|((r<<16|t.__halfDigit(n))>>>0)%e}return r}static __absoluteDivLarge(t,e,r,n){var i=Math.imul;const o=e.__halfDigitLength(),s=e.length,a=t.__halfDigitLength()-o;let u=null;r&&(u=new g(a+2>>>1,!1),u.__initializeDigits());const l=new g(o+2>>>1,!1);l.__initializeDigits();const c=g.__clz16(e.__halfDigit(o-1));0>>0;t=0|r/f;let s=0|r%f;const u=e.__halfDigit(o-2),l=_.__halfDigit(n+o-2);for(;i(t,u)>>>0>(s<<16|l)>>>0&&(t--,s+=f,!(65535>>1,h|t))}return n?(_.__inplaceRightShift(c),r?{quotient:u,remainder:_}:_):r?u:void 0}static __clz16(t){return Math.clz32(t)-16}__inplaceAdd(t,e,r){let n=0;for(let i=0;i>>16,this.__setHalfDigit(e+i,r)}return n}__inplaceSub(t,e,r){let n=0;if(1&e){e>>=1;let i=this.__digit(e),o=65535&i,s=0;for(;s>>1;s++){const r=t.__digit(s),a=(i>>>16)-(65535&r)-n;n=1&a>>>16,this.__setDigit(e+s,a<<16|65535&o),i=this.__digit(e+s+1),o=(65535&i)-(r>>>16)-n,n=1&o>>>16}const a=t.__digit(s),u=(i>>>16)-(65535&a)-n;if(n=1&u>>>16,this.__setDigit(e+s,u<<16|65535&o),e+s+1>=this.length)throw new RangeError("out of bounds");0==(1&r)&&(i=this.__digit(e+s+1),o=(65535&i)-(a>>>16)-n,n=1&o>>>16,this.__setDigit(e+t.length,4294901760&i|65535&o))}else{e>>=1;let i=0;for(;i>>16;const a=(r>>>16)-(o>>>16)-n;n=1&a>>>16,this.__setDigit(e+i,a<<16|65535&s)}const o=this.__digit(e+i),s=t.__digit(i),a=(65535&o)-(65535&s)-n;n=1&a>>>16;let u=0;0==(1&r)&&(u=(o>>>16)-(s>>>16)-n,n=1&u>>>16),this.__setDigit(e+i,u<<16|65535&a)}return n}__inplaceRightShift(t){if(0===t)return;let e=this.__digit(0)>>>t;const r=this.length-1;for(let n=0;n>>t}this.__setDigit(r,e)}static __specialLeftShift(t,e,r){const n=t.length,i=new g(n+r,!1);if(0===e){for(let e=0;e>>32-e}return 0r)throw new RangeError("BigInt too big");const n=r>>>5,i=31&r,o=t.length,s=0!==i&&0!=t.__digit(o-1)>>>32-i,a=o+n+(s?1:0),u=new g(a,t.sign);if(0===i){let e=0;for(;e>>32-i}if(s)u.__setDigit(o+n,e);else if(0!=e)throw new Error("implementation bug")}return u.__trim()}static __rightShiftByAbsolute(t,e){const r=t.length,n=t.sign,i=g.__toShiftAmount(e);if(0>i)return g.__rightShiftByMaximum(n);const o=i>>>5,s=31&i;let a=r-o;if(0>=a)return g.__rightShiftByMaximum(n);let u=!1;if(n)if(0!=(t.__digit(o)&(1<>>s;const n=r-o-1;for(let r=0;r>>s}l.__setDigit(n,e)}return u&&(l=g.__absoluteAddOne(l,!0,l)),l.__trim()}static __rightShiftByMaximum(t){return t?g.__oneDigit(1,!0):g.__zero()}static __toShiftAmount(t){if(1g.__kMaxLengthBits?-1:e}static __toPrimitive(t,e="default"){if("object"!=typeof t)return t;if(t.constructor===g)return t;const r=t[Symbol.toPrimitive];if(r){const t=r(e);if("object"!=typeof t)return t;throw new TypeError("Cannot convert object to primitive value")}const n=t.valueOf;if(n){const e=n.call(t);if("object"!=typeof e)return e}const i=t.toString;if(i){const e=i.call(t);if("object"!=typeof e)return e}throw new TypeError("Cannot convert object to primitive value")}static __toNumeric(t){return g.__isBigInt(t)?t:+t}static __isBigInt(t){return"object"==typeof t&&t.constructor===g}static __truncateToNBits(t,e){const r=t+31>>>5,n=new g(r,e.sign),i=r-1;for(let t=0;t>>e}return n.__setDigit(i,o),n.__trim()}static __truncateAndSubFromPowerOfTwo(t,e,r){var n=Math.min;const i=t+31>>>5,o=new g(i,r);let s=0;const a=i-1;let u=0;for(const t=n(a,e.length);s>>16;const n=0-(t>>>16)-u;u=1&n>>>16,o.__setDigit(s,65535&r|n<<16)}for(;s>>16;_=65535&t|0-(l>>>16)-u<<16}else{const t=32-c;l=l<>>t;const e=1<<32-t,r=(65535&e)-(65535&l)-u;u=1&r>>>16;_=65535&r|(e>>>16)-(l>>>16)-u<<16,_&=e-1}return o.__setDigit(a,_),o.__trim()}__digit(t){return this[t]}__unsignedDigit(t){return this[t]>>>0}__setDigit(t,e){this[t]=0|e}__setDigitGrow(t,e){this[t]=0|e}__halfDigitLength(){const t=this.length;return 65535>=this.__unsignedDigit(t-1)?2*t-1:2*t}__halfDigit(t){return 65535&this[t>>>1]>>>((1&t)<<4)}__setHalfDigit(t,e){const r=t>>>1,n=this.__digit(r),i=1&t?65535&n|e<<16:4294901760&n|65535&e;this.__setDigit(r,i)}static __digitPow(t,e){let r=1;for(;0>>=1,t*=t;return r}}function d(t,e,r,n=[]){!function(t,e){if(!(e instanceof Object))throw new Error(t+" is not an object!")}(t,e);const i=Object.keys(e).sort(),o=r.length,s=r.length+n.length,a=`${t} does not have correct keys! Required keys: [${r.sort().join(", ")}], optional keys: [${n.sort().join(", ")}], actual keys: [${i.join(", ")}]`;if(i.lengths)throw new Error(a);let u=i.filter(t=>!r.includes(t));if(i.length-u.length!==o)throw new Error(a);if(u.find(t=>!n.includes(t)))throw new Error(a)}function p(t,e){if(!/^0x([0-9a-fA-F][0-9a-fA-F])*$/.test(e))throw new Error(t+" must be a hex string!")}function b(t,e){if(p(t,e),66!=e.length)throw new Error(t+" must be a hex string of 66 bytes long!")}function m(t,e){if("0x0"!==e&&!/^0x[1-9a-fA-F][0-9a-fA-F]*$/.test(e))throw new Error(t+" must be a hex integer!")}function y(t,{nestedValidation:e=!0,debugPath:r="script"}={}){if(d(r,t,["code_hash","hash_type","args"],[]),b(r+".code_hash",t.code_hash),p(r+".args",t.args),"data"!==t.hash_type&&"type"!==t.hash_type)throw new Error(r+".hash_type must be either data or type!")}function w(t,{nestedValidation:e=!0,debugPath:r="out_point"}={}){d(r,t,["tx_hash","index"],[]),b(r+".tx_hash",t.tx_hash),m(r+".index",t.index)}function v(t,{nestedValidation:e=!0,debugPath:r="cell_input"}={}){d(r,t,["since","previous_output"],[]),m(r+".since",t.since),e&&w(t.previous_output,{debugPath:r+".previous_output"})}function B(t,{nestedValidation:e=!0,debugPath:r="cell_output"}={}){d(r,t,["capacity","lock"],["type"]),m(r+".capacity",t.capacity),e&&(y(t.lock,{debugPath:r+".lock"}),t.type&&y(t.type,{debugPath:r+".type"}))}function P(t,{nestedValidation:e=!0,debugPath:r="cell_dep"}={}){if(d(r,t,["out_point","dep_type"],[]),"code"!==t.dep_type&&"dep_group"!==t.dep_type)throw new Error(r+".dep_type must be either code or dep_group!");e&&w(t.out_point,{debugPath:r+".out_point"})}function D(t,e,r,n){if(!Array.isArray(e))throw new Error(t+" is not an array!");if(n)for(let n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=r.size;let i=void 0===n?0:n;var o=r.timeout;let a=void 0===o?0:o;null==t?t=null:W(t)?t=Buffer.from(t.toString()):J(t)||Buffer.isBuffer(t)||("[object ArrayBuffer]"===Object.prototype.toString.call(t)?t=Buffer.from(t):ArrayBuffer.isView(t)?t=Buffer.from(t.buffer,t.byteOffset,t.byteLength):t instanceof s.default||(t=Buffer.from(String(t)))),this[V]={body:t,disturbed:!1,error:null},this.size=i,this.timeout=a,t instanceof s.default&&t.on("error",(function(t){const r="AbortError"===t.name?t:new q(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t);e[V].error=r}))}function G(){var t=this;if(this[V].disturbed)return F.Promise.reject(new TypeError("body used already for: "+this.url));if(this[V].disturbed=!0,this[V].error)return F.Promise.reject(this[V].error);let e=this.body;if(null===e)return F.Promise.resolve(Buffer.alloc(0));if(J(e)&&(e=e.stream()),Buffer.isBuffer(e))return F.Promise.resolve(e);if(!(e instanceof s.default))return F.Promise.resolve(Buffer.alloc(0));let r=[],n=0,i=!1;return new F.Promise((function(o,s){let a;t.timeout&&(a=setTimeout((function(){i=!0,s(new q(`Response timeout while trying to fetch ${t.url} (over ${t.timeout}ms)`,"body-timeout"))}),t.timeout)),e.on("error",(function(e){"AbortError"===e.name?(i=!0,s(e)):s(new q(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e))})),e.on("data",(function(e){if(!i&&null!==e){if(t.size&&n+e.length>t.size)return i=!0,void s(new q(`content size at ${t.url} over limit: ${t.size}`,"max-size"));n+=e.length,r.push(e)}})),e.on("end",(function(){if(!i){clearTimeout(a);try{o(Buffer.concat(r,n))}catch(e){s(new q(`Could not create Buffer from response body for ${t.url}: ${e.message}`,"system",e))}}}))}))}function W(t){return"object"==typeof t&&"function"==typeof t.append&&"function"==typeof t.delete&&"function"==typeof t.get&&"function"==typeof t.getAll&&"function"==typeof t.has&&"function"==typeof t.set&&("URLSearchParams"===t.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(t)||"function"==typeof t.sort)}function J(t){return"object"==typeof t&&"function"==typeof t.arrayBuffer&&"string"==typeof t.type&&"function"==typeof t.stream&&"function"==typeof t.constructor&&"string"==typeof t.constructor.name&&/^(Blob|File)$/.test(t.constructor.name)&&/^(Blob|File)$/.test(t[Symbol.toStringTag])}function X(t){let e,r,n=t.body;if(t.bodyUsed)throw new Error("cannot clone body after it is used");return n instanceof s.default&&"function"!=typeof n.getBoundary&&(e=new H,r=new H,n.pipe(e),n.pipe(r),t[V].body=e,n=r),n}function Q(t){return null===t?null:"string"==typeof t?"text/plain;charset=UTF-8":W(t)?"application/x-www-form-urlencoded;charset=UTF-8":J(t)?t.type||null:Buffer.isBuffer(t)||"[object ArrayBuffer]"===Object.prototype.toString.call(t)||ArrayBuffer.isView(t)?null:"function"==typeof t.getBoundary?"multipart/form-data;boundary="+t.getBoundary():t instanceof s.default?null:"text/plain;charset=UTF-8"}function Z(t){const e=t.body;return null===e?0:J(e)?e.size:Buffer.isBuffer(e)?e.length:e&&"function"==typeof e.getLengthSync&&(e._lengthRetrievers&&0==e._lengthRetrievers.length||e.hasKnownLength&&e.hasKnownLength())?e.getLengthSync():null}F.prototype={get body(){return this[V].body},get bodyUsed(){return this[V].disturbed},arrayBuffer(){return G.call(this).then((function(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}))},blob(){let t=this.headers&&this.headers.get("content-type")||"";return G.call(this).then((function(e){return Object.assign(new $([],{type:t.toLowerCase()}),{[M]:e})}))},json(){var t=this;return G.call(this).then((function(e){try{return JSON.parse(e.toString())}catch(e){return F.Promise.reject(new q(`invalid json response body at ${t.url} reason: ${e.message}`,"invalid-json"))}}))},text(){return G.call(this).then((function(t){return t.toString()}))},buffer(){return G.call(this)},textConverted(){var t=this;return G.call(this).then((function(e){return function(t,e){if("function"!=typeof U)throw new Error("The package `encoding` must be installed to use the textConverted() function");const r=e.get("content-type");let n,i,o="utf-8";r&&(n=/charset=([^;]*)/i.exec(r));i=t.slice(0,1024).toString(),!n&&i&&(n=/0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[nt]=Object.create(null),t instanceof it){const e=t.raw(),r=Object.keys(e);for(const t of r)for(const r of e[t])this.append(t,r)}else if(null==t);else{if("object"!=typeof t)throw new TypeError("Provided initializer must be an object");{const e=t[Symbol.iterator];if(null!=e){if("function"!=typeof e)throw new TypeError("Header pairs must be iterable");const r=[];for(const e of t){if("object"!=typeof e||"function"!=typeof e[Symbol.iterator])throw new TypeError("Each header pair must be iterable");r.push(Array.from(e))}for(const t of r){if(2!==t.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(t[0],t[1])}}else for(const e of Object.keys(t)){const r=t[e];this.append(e,r)}}}}get(t){tt(t=""+t);const e=rt(this[nt],t);return void 0===e?null:this[nt][e].join(", ")}forEach(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=ot(this),n=0;for(;n1&&void 0!==arguments[1]?arguments[1]:"key+value";const r=Object.keys(t[nt]).sort();return r.map("key"===e?function(t){return t.toLowerCase()}:"value"===e?function(e){return t[nt][e].join(", ")}:function(e){return[e.toLowerCase(),t[nt][e].join(", ")]})}it.prototype.entries=it.prototype[Symbol.iterator],Object.defineProperty(it.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(it.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const st=Symbol("internal");function at(t,e){const r=Object.create(ut);return r[st]={target:t,kind:e,index:0},r}const ut=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==ut)throw new TypeError("Value of `this` is not a HeadersIterator");var t=this[st];const e=t.target,r=t.kind,n=t.index,i=ot(e,r);return n>=i.length?{value:void 0,done:!0}:(this[st].index=n+1,{value:i[n],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function lt(t){const e=Object.assign({__proto__:null},t[nt]),r=rt(t[nt],"Host");return void 0!==r&&(e[r]=e[r][0]),e}Object.defineProperty(ut,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const ct=Symbol("Response internals"),_t=a.default.STATUS_CODES;class ft{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};F.call(this,t,e);const r=e.status||200,n=new it(e.headers);if(null!=t&&!n.has("Content-Type")){const e=Q(t);e&&n.append("Content-Type",e)}this[ct]={url:e.url,status:r,statusText:e.statusText||_t[r],headers:n,counter:e.counter}}get url(){return this[ct].url||""}get status(){return this[ct].status}get ok(){return this[ct].status>=200&&this[ct].status<300}get redirected(){return this[ct].counter>0}get statusText(){return this[ct].statusText}get headers(){return this[ct].headers}clone(){return new ft(X(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}F.mixIn(ft.prototype),Object.defineProperties(ft.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(ft.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const ht=Symbol("Request internals"),gt=u.default.parse,dt=u.default.format,pt="destroy"in s.default.Readable.prototype;function bt(t){return"object"==typeof t&&"object"==typeof t[ht]}class mt{constructor(t){let e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};bt(t)?e=gt(t.url):(e=t&&t.href?gt(t.href):gt(""+t),t={});let n=r.method||t.method||"GET";if(n=n.toUpperCase(),(null!=r.body||bt(t)&&null!==t.body)&&("GET"===n||"HEAD"===n))throw new TypeError("Request with GET/HEAD method cannot have body");let i=null!=r.body?r.body:bt(t)&&null!==t.body?X(t):null;F.call(this,i,{timeout:r.timeout||t.timeout||0,size:r.size||t.size||0});const o=new it(r.headers||t.headers||{});if(null!=i&&!o.has("Content-Type")){const t=Q(i);t&&o.append("Content-Type",t)}let s=bt(t)?t.signal:null;if("signal"in r&&(s=r.signal),null!=s&&!function(t){const e=t&&"object"==typeof t&&Object.getPrototypeOf(t);return!(!e||"AbortSignal"!==e.constructor.name)}(s))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[ht]={method:n,redirect:r.redirect||t.redirect||"follow",headers:o,parsedURL:e,signal:s},this.follow=void 0!==r.follow?r.follow:void 0!==t.follow?t.follow:20,this.compress=void 0!==r.compress?r.compress:void 0===t.compress||t.compress,this.counter=r.counter||t.counter||0,this.agent=r.agent||t.agent}get method(){return this[ht].method}get url(){return dt(this[ht].parsedURL)}get headers(){return this[ht].headers}get redirect(){return this[ht].redirect}get signal(){return this[ht].signal}clone(){return new mt(this)}}function yt(t){Error.call(this,t),this.type="aborted",this.message=t,Error.captureStackTrace(this,this.constructor)}F.mixIn(mt.prototype),Object.defineProperty(mt.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(mt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),yt.prototype=Object.create(Error.prototype),yt.prototype.constructor=yt,yt.prototype.name="AbortError";const wt=s.default.PassThrough,vt=u.default.resolve;function Bt(t,e){if(!Bt.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return F.Promise=Bt.Promise,new Bt.Promise((function(r,n){const i=new mt(t,e),o=function(t){const e=t[ht].parsedURL,r=new it(t[ht].headers);if(r.has("Accept")||r.set("Accept","*/*"),!e.protocol||!e.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(e.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(t.signal&&t.body instanceof s.default.Readable&&!pt)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let n=null;if(null==t.body&&/^(POST|PUT)$/i.test(t.method)&&(n="0"),null!=t.body){const e=Z(t);"number"==typeof e&&(n=String(e))}n&&r.set("Content-Length",n),r.has("User-Agent")||r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let i=t.agent;return"function"==typeof i&&(i=i(e)),r.has("Connection")||i||r.set("Connection","close"),Object.assign({},e,{method:t.method,headers:lt(r),agent:i})}(i),u=("https:"===o.protocol?l.default:a.default).request,_=i.signal;let f=null;const h=function(){let t=new yt("The user aborted a request.");n(t),i.body&&i.body instanceof s.default.Readable&&i.body.destroy(t),f&&f.body&&f.body.emit("error",t)};if(_&&_.aborted)return void h();const g=function(){h(),b()},d=u(o);let p;function b(){d.abort(),_&&_.removeEventListener("abort",g),clearTimeout(p)}_&&_.addEventListener("abort",g),i.timeout&&d.once("socket",(function(t){p=setTimeout((function(){n(new q("network timeout at: "+i.url,"request-timeout")),b()}),i.timeout)})),d.on("error",(function(t){n(new q(`request to ${i.url} failed, reason: ${t.message}`,"system",t)),b()})),d.on("response",(function(t){clearTimeout(p);const e=function(t){const e=new it;for(const r of Object.keys(t))if(!K.test(r))if(Array.isArray(t[r]))for(const n of t[r])Y.test(n)||(void 0===e[nt][r]?e[nt][r]=[n]:e[nt][r].push(n));else Y.test(t[r])||(e[nt][r]=[t[r]]);return e}(t.headers);if(Bt.isRedirect(t.statusCode)){const o=e.get("Location"),s=null===o?null:vt(i.url,o);switch(i.redirect){case"error":return n(new q("uri requested responds with a redirect, redirect mode is set to error: "+i.url,"no-redirect")),void b();case"manual":if(null!==s)try{e.set("Location",s)}catch(t){n(t)}break;case"follow":if(null===s)break;if(i.counter>=i.follow)return n(new q("maximum redirect reached at: "+i.url,"max-redirect")),void b();const o={headers:new it(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:i.body,signal:i.signal,timeout:i.timeout,size:i.size};return 303!==t.statusCode&&i.body&&null===Z(i)?(n(new q("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void b()):(303!==t.statusCode&&(301!==t.statusCode&&302!==t.statusCode||"POST"!==i.method)||(o.method="GET",o.body=void 0,o.headers.delete("content-length")),r(Bt(new mt(s,o))),void b())}}t.once("end",(function(){_&&_.removeEventListener("abort",g)}));let o=t.pipe(new wt);const s={url:i.url,status:t.statusCode,statusText:t.statusMessage,headers:e,size:i.size,timeout:i.timeout,counter:i.counter},a=e.get("Content-Encoding");if(!i.compress||"HEAD"===i.method||null===a||204===t.statusCode||304===t.statusCode)return f=new ft(o,s),void r(f);const u={flush:c.default.Z_SYNC_FLUSH,finishFlush:c.default.Z_SYNC_FLUSH};if("gzip"==a||"x-gzip"==a)return o=o.pipe(c.default.createGunzip(u)),f=new ft(o,s),void r(f);if("deflate"!=a&&"x-deflate"!=a){if("br"==a&&"function"==typeof c.default.createBrotliDecompress)return o=o.pipe(c.default.createBrotliDecompress()),f=new ft(o,s),void r(f);f=new ft(o,s),r(f)}else{t.pipe(new wt).once("data",(function(t){o=8==(15&t[0])?o.pipe(c.default.createInflate()):o.pipe(c.default.createInflateRaw()),f=new ft(o,s),r(f)}))}})),function(t,e){const r=e.body;null===r?t.end():J(r)?r.stream().pipe(t):Buffer.isBuffer(r)?(t.write(r),t.end()):r.pipe(t)}(d,i)}))}Bt.isRedirect=function(t){return 301===t||302===t||303===t||307===t||308===t},Bt.Promise=global.Promise;var Pt,Dt,St=Object.freeze({__proto__:null,default:Bt,Headers:it,Request:mt,Response:ft,FetchError:q}),Tt=(function(t,e){var r=St.default||St,n=function(t,e){return/^\/\//.test(t)&&(t="https:"+t),r.call(this,t,e)};t.exports=e=n,e.fetch=n,e.Headers=St.Headers,e.Request=St.Request,e.Response=St.Response,e.default=n}(Dt={path:Pt,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&Dt.path)}},Dt.exports),Dt.exports);function kt(t,e){e=e||{};const r=Object.assign({},e.headers||{},t.headers||{});return Object.assign({},e,t,{headers:r})}const xt={get:(t,e,r)=>"send"===e?async()=>{const e=await Tt(t.uri,kt({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.payload)},t.defaultOptions));return await e.json()}:(...n)=>{const i=t.id;return t.id=t.id+1,t.payload.push({jsonrpc:"2.0",id:i,method:e,params:n}),r}},Ct={get:(t,e)=>"batch"===e?()=>new Proxy({id:Math.round(1e7*Math.random()),payload:[],uri:t.uri,defaultOptions:t.defaultOptions},xt):async(...r)=>{const n=Math.round(1e7*Math.random()),i=await Tt(t.uri,kt({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:n,method:e,params:r})},t.defaultOptions)),o=await i.json();if(o.id!==n)throw new Error("JSONRPCError: response ID does not match request ID!");if(o.error)throw new Error("JSONRPCError: server error "+JSON.stringify(o.error));return o.result}};class Et{constructor(t,e={}){return this.uri=t,this.defaultOptions=e,new Proxy(this,Ct)}static create(t){return new Et(t)}}function Ot(t){return g.BigInt(t)}function At(t){return"0x"+t.toString(16)}function jt(t){return function(e,r){if(!(r instanceof ArrayBuffer)){let n=At(g.BigInt(r)).substr(2);if(n.length%2!=0&&(n="0"+n),n.length/2>t)throw new Error(`${e} is ${n.length/2} bytes long, expected length is ${t}!`);const i=new DataView(new ArrayBuffer(t));for(let t=0;t0&&r.byteLength!==t)throw new Error(`${e} has invalid length ${r.byteLength}, required: ${t}`);return r}}function It(t,e,r){const n={};for(const[i,o]of Object.entries(r)){const r=e[i];if(!r)throw new Error(`${t} is missing ${i}!`);n[i]=o(`${t}.${i}`,r)}return n}function Rt(t,{debugPath:e="script"}={}){return It(e,t,{code_hash:zt(32),hash_type:function(t,e){switch(e){case"data":return 0;case"type":return 1;case 0:case 1:return e;default:throw new Error(`${t}.hash_type has invalid value: ${e}`)}},args:zt(-1)})}function Lt(t,{debugPath:e="out_point"}={}){return It(e,t,{tx_hash:zt(32),index:jt(4)})}function Mt(t){return function(e,r){return t(r,{debugPath:e})}}function Nt(t,{debugPath:e="cell_input"}={}){return It(e,t,{since:jt(8),previous_output:Mt(Lt)})}function $t(t,{debugPath:e="cell_output"}={}){const r=It(e,t,{capacity:jt(8),lock:Mt(Rt)});return t.type&&(r.type_=Rt(t.type,{debugPath:e+".type"})),r}function qt(t,{debugPath:e="cell_dep"}={}){return It(e,t,{out_point:Mt(Lt),dep_type:function(t,e){switch(e){case"code":return 0;case"dep_group":return 1;case 0:case 1:return e;default:throw new Error(`${t}.dep_type has invalid value: ${e}`)}}})}function Ut(t){return function(e,r){return r.map((r,n)=>t(`${e}[${n}]`,r))}}function Vt(t,{debugPath:e="raw_transaction"}={}){return It(e,t,{version:jt(4),cell_deps:Ut(Mt(qt)),header_deps:Ut(zt(32)),inputs:Ut(Mt(Nt)),outputs:Ut(Mt($t)),outputs_data:Ut(zt(-1))})}function Ht(t,{debugPath:e="transaction"}={}){const r=Vt(t,{debugPath:"(raw)"+e}),n=It(e,t,{witnesses:Ut(zt(-1))});return n.raw=r,n}function Ft(t,{debugPath:e="raw_header"}={}){return It(e,t,{version:jt(4),compact_target:jt(4),timestamp:jt(8),number:jt(8),epoch:jt(8),parent_hash:zt(32),transactions_root:zt(32),proposals_hash:zt(32),uncles_hash:zt(32),dao:zt(32)})}function Gt(t,{debugPath:e="header"}={}){const r=Ft(t,{debugPath:"(raw)"+e}),n=It(e,t,{nonce:jt(16)});return n.raw=r,n}function Wt(t,{debugPath:e="uncle_block"}={}){return It(e,t,{header:Mt(Gt),proposals:Ut(zt(10))})}var Jt=Object.freeze({__proto__:null,NormalizeScript:Rt,NormalizeOutPoint:Lt,NormalizeCellInput:Nt,NormalizeCellOutput:$t,NormalizeCellDep:qt,NormalizeRawTransaction:Vt,NormalizeTransaction:Ht,NormalizeRawHeader:Ft,NormalizeHeader:Gt,NormalizeUncleBlock:Wt,NormalizeBlock:function(t,{debugPath:e="block"}={}){return It(e,t,{header:Mt(Gt),uncles:Ut(Mt(Wt)),transactions:Ut(Mt(Ht)),proposals:Ut(zt(10))})},NormalizeCellbaseWitness:function(t,{debugPath:e="cellbase_witness"}={}){return It(e,t,{lock:Mt(Rt),message:zt(-1)})},NormalizeWitnessArgs:function(t,{debugPath:e="witness_args"}={}){const r={};return t.lock&&(r.lock=zt(-1)(e+".lock",t.lock)),t.input_type&&(r.input_type=zt(-1)(e+".input_type",t.input_type)),t.output_type&&(r.output_type=zt(-1)(e+".output_type",t.output_type)),r}});function Xt(t,e){return e instanceof Object&&e.serializeJson instanceof Function?e.serializeJson.call(e):e}function Qt(t,e,r){if(!((e=Xt(0,e))instanceof Object))throw new Error(`Transformed ${t} is not an object!`);const n={};for(const[i,o]of Object.entries(r)){let r=e[i];if(!r){r=e[i.replace(/(_[a-z])/g,t=>t.toUpperCase().replace("_",""))]}r&&(n[i]=o(`${t}.${i}`,r))}return n}function Zt(t,{validation:e=!0,debugPath:r="script"}={}){return t=Qt(r,t,{code_hash:Xt,hash_type:Xt,args:Xt}),e&&y(t,{debugPath:"(transformed) "+r}),t}function Kt(t,{validation:e=!0,debugPath:r="out_point"}={}){return t=Qt(r,t,{tx_hash:Xt,index:Xt}),e&&w(t,{debugPath:"(transformed) "+r}),t}function Yt(t){return function(e,r){return t(r,{validation:!1,debugPath:e})}}function te(t,{validation:e=!0,debugPath:r="cell_input"}={}){return t=Qt(r,t,{since:Xt,previous_output:Yt(Kt)}),e&&v(t,{debugPath:"(transformed) "+r}),t}function ee(t,{validation:e=!0,debugPath:r="cell_output"}={}){return t=Qt(r,t,{capacity:Xt,lock:Yt(Zt),type:Yt(Zt)}),e&&B(t,{debugPath:"(transformed) "+r}),t}function re(t,{validation:e=!0,debugPath:r="cell_dep"}={}){return t=Qt(r,t,{out_point:Yt(Kt),dep_type:Xt}),e&&P(t,{debugPath:"(transformed) "+r}),t}function ne(t){return function(e,r){return r.map((r,n)=>t(`${e}[${n}]`,r))}}function ie(t,{validation:e=!0,debugPath:r="transaction"}={}){return t=Qt(r,t,{version:Xt,cell_deps:ne(Yt(re)),header_deps:ne(Xt),inputs:ne(Yt(te)),outputs:ne(Yt(ee)),outputs_data:ne(Xt),witnesses:ne(Xt)}),e&&x(t,{debugPath:"(transformed) "+r}),t}function oe(t,{validation:e=!0,debugPath:r="header"}={}){return t=Qt(r,t,{version:Xt,compact_target:Xt,timestamp:Xt,number:Xt,epoch:Xt,parent_hash:Xt,transactions_root:Xt,proposals_hash:Xt,uncles_hash:Xt,dao:Xt,nonce:Xt}),e&&E(t,{debugPath:"(transformed) "+r}),t}function se(t,{validation:e=!0,debugPath:r="uncle_block"}={}){return t=Qt(r,t,{header:Yt(oe),proposals:ne(Xt)}),e&&A(t,{debugPath:"(transformed) "+r}),t}var ae=Object.freeze({__proto__:null,TransformScript:Zt,TransformOutPoint:Kt,TransformCellInput:te,TransformCellOutput:ee,TransformCellDep:re,TransformRawTransaction:function(t,{validation:e=!0,debugPath:r="raw_transaction"}={}){return t=Qt(r,t,{version:Xt,cell_deps:ne(Yt(re)),header_deps:ne(Xt),inputs:ne(Yt(te)),outputs:ne(Yt(ee)),outputs_data:ne(Xt)}),e&&k(t,{debugPath:"(transformed) "+r}),t},TransformTransaction:ie,TransformRawHeader:function(t,{validation:e=!0,debugPath:r="raw_header"}={}){return t=Qt(r,t,{version:Xt,compact_target:Xt,timestamp:Xt,number:Xt,epoch:Xt,parent_hash:Xt,transactions_root:Xt,proposals_hash:Xt,uncles_hash:Xt,dao:Xt}),e&&C(t,{debugPath:"(transformed) "+r}),t},TransformHeader:oe,TransformUncleBlock:se,TransformBlock:function(t,{validation:e=!0,debugPath:r="block"}={}){return t=Qt(r,t,{header:Yt(oe),uncles:ne(Yt(se)),transactions:ne(Yt(ie)),proposals:ne(Xt)}),e&&j(t,{debugPath:"(transformed) "+r}),t},TransformCellbaseWitness:function(t,{validation:e=!0,debugPath:r="cellbase_witness"}={}){return t=Qt(r,t,{lock:Yt(Zt),message:Xt}),e&&z(t,{debugPath:"(transformed) "+r}),t},TransformWitnessArgs:function(t,{validation:e=!0,debugPath:r="witness_args"}={}){return t=Qt(r,t,{lock:Xt,input_type:Xt,output_type:Xt}),e&&I(t,{debugPath:"(transformed) "+r}),t}});var ue=Object.freeze({__proto__:null,RPCCollector:class{constructor(t,e,{skipCellWithContent:r=!0,loadData:n=!1,loadBlockNumber:i=!0}={}){this.rpc=t,this.lockHash=new h(e).serializeJson(),this.skipCellWithContent=r,this.loadData=n,this.loadBlockNumber=i}async*collect(){const t=Ot(await this.rpc.get_tip_block_number());let e=g.BigInt(0);for(;g.lessThanOrEqual(e,t);){let r=g.add(e,g.BigInt(100));g.greaterThan(r,t)&&(r=t);const n=await this.rpc.get_cells_by_lock_hash(this.lockHash,At(e),At(r));for(const t of n){if(this.skipCellWithContent&&(t.type||g.greaterThan(Ot(t.output_data_len),g.BigInt(100))))continue;let e=null;if(this.loadData){e=(await this.rpc.get_live_cell(t.out_point,!0)).cell.data.content}let r=null;if(this.loadBlockNumber){r=(await this.rpc.get_header(t.block_hash)).number}yield{cellbase:t.cellbase,cell_output:{capacity:t.capacity,lock:t.lock,type:t.type},out_point:t.out_point,block_hash:t.block_hash,data:e,output_data_len:t.output_data_len,block_number:r}}e=g.add(r,g.BigInt(1))}}}});exports.BigIntToHexString=At,exports.HexStringToBigInt=Ot,exports.RPC=Et,exports.Reader=h,exports.TransactionDumper=class{constructor(t,{validateTransaction:e=!0,depGroupUnpacker:r=null}={}){this.rpc=t,this.validateTransaction=e,this.depGroupUnpacker=r}async dumpByHash(t){const e=(await this.rpc.get_transaction(t)).transaction;return delete e.hash,await this.dump(e)}async dump(t){this.validateTransaction&&x(t);const e=[];for(const r of t.inputs){const{output:t,data:n,header:i}=await this._resolveOutPoint(r.previous_output);e.push({input:r,output:t,data:n,header:i})}const r=[];for(const e of t.cell_deps){const{output:t,data:n,header:i}=await this._resolveOutPoint(e.out_point);if(r.push({cell_dep:e,output:t,data:n,header:i}),"dep_group"===e.dep_type){if(!this.depGroupUnpacker)throw new Error("depGroupUnpacker must be provided when the transaction contains dep_group!");const t=this.depGroupUnpacker(new h(n));for(const e of t){w(e);const{output:t,data:n,header:i}=await this._resolveOutPoint(e);r.push({cell_dep:{out_point:e,dep_type:"code"},output:t,data:n,header:i})}}}const n=[];for(const e of t.header_deps)n.push(await this.rpc.get_header(e));return JSON.stringify({mock_info:{inputs:e,cell_deps:r,header_deps:n},tx:t})}async _resolveOutPoint(t){const e=await this.rpc.get_transaction(t.tx_hash);if(!e||!e.transaction)throw new Error(`Transaction ${t.tx_hash} cannot be found!`);const r=e.transaction,n=g.toNumber(g.BigInt(t.index));if(n>=r.outputs.length)throw new Error(`Transaction ${t.tx_hash} does not have output ${n}!`);const i={output:r.outputs[n],data:r.outputs_data[n]};return"committed"===e.tx_status.status&&(i.header=e.tx_status.block_hash),i}},exports.VERSION="0.10.2",exports.cell_collectors=ue,exports.normalizers=Jt,exports.transformers=ae,exports.validators=R; +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("stream"),e=require("http"),r=require("url"),n=require("https"),i=require("zlib");function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=o(t),a=o(e),u=o(r),l=o(n),c=o(i);class _{constructor(){this.__isByteLikeReader__=!0}static isReader(t){return null!=t&&(t instanceof _||!0===t.__isByteLikeReader__)}}class f extends _{constructor(t){super(),this.view=new DataView(t)}length(){return this.view.byteLength}indexAt(t){return this.view.getUint8(t)}toArrayBuffer(){return this.view.buffer}serializeJson(){return"0x"+Array.prototype.map.call(new Uint8Array(this.view.buffer),t=>("00"+t.toString(16)).slice(-2)).join("")}}class h extends _{constructor(t){super(),this.string=t}length(){return this.string.length/2-1}indexAt(t){return parseInt(this.string.substr(2+2*t,2),16)}toArrayBuffer(){const t=new ArrayBuffer(this.length()),e=new DataView(t);for(let t=0;t255)throw new Error("fromRawString can only accept UTF-8 raw string!");r.setUint8(e,n)}return new f(e)}}class d extends Array{constructor(t,e){if(t>d.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");super(t),this.sign=e}static BigInt(t){var e=Math.floor,r=Number.isFinite;if("number"==typeof t){if(0===t)return d.__zero();if((0|t)===t)return 0>t?d.__oneDigit(-t,!0):d.__oneDigit(t,!1);if(!r(t)||e(t)!==t)throw new RangeError("The number "+t+" cannot be converted to BigInt because it is not an integer");return d.__fromDouble(t)}if("string"==typeof t){const e=d.__fromString(t);if(null===e)throw new SyntaxError("Cannot convert "+t+" to a BigInt");return e}if("boolean"==typeof t)return!0===t?d.__oneDigit(1,!1):d.__zero();if("object"==typeof t){if(t.constructor===d)return t;const e=d.__toPrimitive(t);return d.BigInt(e)}throw new TypeError("Cannot convert "+t+" to a BigInt")}toDebugString(){const t=["BigInt["];for(const e of this)t.push((e?(e>>>0).toString(16):e)+", ");return t.push("]"),t.join("")}toString(t=10){if(2>t||36>>=12;const _=l-12;let f=12<=l?0:a<<20+l,h=20+l;0<_&&0>>32-_,f=a<<_,h=_),0>>32-h,h-=32);const g=d.__decideRounding(t,h,u,a);if((1===g||0===g&&1==(1&f))&&(f=f+1>>>0,0==f&&(c++,0!=c>>>20&&(c=0,s++,1023=d.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){const e=1+(r>>>5),n=t.sign&&0!=(1&r),i=new d(e,n);i.__initializeDigits();const o=1<<(31&r);return i.__setDigit(e-1,o),i}let n=null,i=t;for(0!=(1&r)&&(n=t),r>>=1;0!==r;r>>=1)i=d.multiply(i,i),0!=(1&r)&&(n=null===n?i:d.multiply(n,i));return n}static multiply(t,e){if(0===t.length)return t;if(0===e.length)return e;let r=t.length+e.length;32<=t.__clzmsd()+e.__clzmsd()&&r--;const n=new d(r,t.sign!==e.sign);n.__initializeDigits();for(let r=0;rd.__absoluteCompare(t,e))return d.__zero();const r=t.sign!==e.sign,n=e.__unsignedDigit(0);let i;if(1===e.length&&65535>=n){if(1===n)return r===t.sign?t:d.unaryMinus(t);i=d.__absoluteDivSmall(t,n,null)}else i=d.__absoluteDivLarge(t,e,!0,!1);return i.sign=r,i.__trim()}static remainder(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>d.__absoluteCompare(t,e))return t;const r=e.__unsignedDigit(0);if(1===e.length&&65535>=r){if(1===r)return d.__zero();const e=d.__absoluteModSmall(t,r);return 0===e?d.__zero():d.__oneDigit(e,t.sign)}const n=d.__absoluteDivLarge(t,e,!1,!0);return n.sign=t.sign,n.__trim()}static add(t,e){const r=t.sign;return r===e.sign?d.__absoluteAdd(t,e,r):0<=d.__absoluteCompare(t,e)?d.__absoluteSub(t,e,r):d.__absoluteSub(e,t,!r)}static subtract(t,e){const r=t.sign;return r===e.sign?0<=d.__absoluteCompare(t,e)?d.__absoluteSub(t,e,r):d.__absoluteSub(e,t,!r):d.__absoluteAdd(t,e,r)}static leftShift(t,e){return 0===e.length||0===t.length?t:e.sign?d.__rightShiftByAbsolute(t,e):d.__leftShiftByAbsolute(t,e)}static signedRightShift(t,e){return 0===e.length||0===t.length?t:e.sign?d.__leftShiftByAbsolute(t,e):d.__rightShiftByAbsolute(t,e)}static unsignedRightShift(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}static lessThan(t,e){return 0>d.__compareToBigInt(t,e)}static lessThanOrEqual(t,e){return 0>=d.__compareToBigInt(t,e)}static greaterThan(t,e){return 0=d.__kMaxLengthBits)return e;const r=t+31>>>5;if(e.lengthd.__kMaxLengthBits)throw new RangeError("BigInt too big");return d.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=d.__kMaxLengthBits)return e;const r=t+31>>>5;if(e.length>>n)return e}return d.__truncateToNBits(t,e)}static ADD(t,e){if(t=d.__toPrimitive(t),e=d.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=d.__toNumeric(t),e=d.__toNumeric(e),d.__isBigInt(t)&&d.__isBigInt(e))return d.add(t,e);if("number"==typeof t&&"number"==typeof e)return t+e;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}static LT(t,e){return d.__compare(t,e,0)}static LE(t,e){return d.__compare(t,e,1)}static GT(t,e){return d.__compare(t,e,2)}static GE(t,e){return d.__compare(t,e,3)}static EQ(t,e){for(;;){if(d.__isBigInt(t))return d.__isBigInt(e)?d.equal(t,e):d.EQ(e,t);if("number"==typeof t){if(d.__isBigInt(e))return d.__equalToNumber(e,t);if("object"!=typeof e)return t==e;e=d.__toPrimitive(e)}else if("string"==typeof t){if(d.__isBigInt(e))return null!==(t=d.__fromString(t))&&d.equal(t,e);if("object"!=typeof e)return t==e;e=d.__toPrimitive(e)}else if("boolean"==typeof t){if(d.__isBigInt(e))return d.__equalToNumber(e,+t);if("object"!=typeof e)return t==e;e=d.__toPrimitive(e)}else if("symbol"==typeof t){if(d.__isBigInt(e))return!1;if("object"!=typeof e)return t==e;e=d.__toPrimitive(e)}else{if("object"!=typeof t)return t==e;if("object"==typeof e&&e.constructor!==d)return t==e;t=d.__toPrimitive(t)}}}static NE(t,e){return!d.EQ(t,e)}static __zero(){return new d(0,!1)}static __oneDigit(t,e){const r=new d(1,e);return r.__setDigit(0,t),r}__copy(){const t=new d(this.length,this.sign);for(let e=0;ee)i=-e-1;else{if(0===r)return-1;r--,n=t.__digit(r),i=31}let o=1<>>20)-1023,r=1+(e>>>5),n=new d(r,0>t);let i=1048575&d.__kBitConversionInts[1]|1048576,o=d.__kBitConversionInts[0];const s=31&e;let a,u=0;if(s<20){const t=20-s;u=t+32,a=i>>>t,i=i<<32-t|o>>>t,o<<=32-t}else if(20===s)u=32,a=i,i=o;else{const t=s-20;u=32-t,a=i<>>32-t,i=o<=t&&9<=t)||(159>=t?32==t:131071>=t?160==t||5760==t:196607>=t?10>=(t&=131071)||40==t||41==t||47==t||95==t||4096==t:65279==t)}static __fromString(t,e=0){let r=0;const n=t.length;let i=0;if(i===n)return d.__zero();let o=t.charCodeAt(i);for(;d.__isWhitespace(o);){if(++i===n)return d.__zero();o=t.charCodeAt(i)}if(43===o){if(++i===n)return null;o=t.charCodeAt(i),r=1}else if(45===o){if(++i===n)return null;o=t.charCodeAt(i),r=-1}if(0===e){if(e=10,48===o){if(++i===n)return d.__zero();if(o=t.charCodeAt(i),88===o||120===o){if(e=16,++i===n)return null;o=t.charCodeAt(i)}else if(79===o||111===o){if(e=8,++i===n)return null;o=t.charCodeAt(i)}else if(66===o||98===o){if(e=2,++i===n)return null;o=t.charCodeAt(i)}}}else if(16===e&&48===o){if(++i===n)return d.__zero();if(o=t.charCodeAt(i),88===o||120===o){if(++i===n)return null;o=t.charCodeAt(i)}}for(;48===o;){if(++i===n)return d.__zero();o=t.charCodeAt(i)}const s=n-i;let a=d.__kMaxBitsPerChar[e],u=d.__kBitsPerCharTableMultiplier-1;if(s>1073741824/a)return null;const l=a*s+u>>>d.__kBitsPerCharTableShift,c=new d(l+31>>>5,!1),_=10>e?e:10,f=10>=d.__kBitsPerCharTableShift;const e=[],r=[];let s=!1;do{let u=0,l=0;for(;;){let e;if(o-48>>>0<_)e=o-48;else{if(!((32|o)-97>>>0>>0<_)a=o-48;else{if(!((32|o)-97>>>0>>d.__kBitsPerCharTableShift+5;c.__inplaceMultiplyAdd(h,l,g)}while(!r)}if(i!==n){if(!d.__isWhitespace(o))return null;for(i++;i>>u-o)}if(0!==i){if(n>=t.length)throw new Error("implementation bug");t.__setDigit(n++,i)}for(;n>>1)+(85&i),i=(51&i>>>2)+(51&i),i=(15&i>>>4)+(15&i);const o=i,s=e-1,a=t.__digit(n-1);let u=0|(32*n-r(a)+o-1)/o;if(t.sign&&u++,268435456>>i,f=32-i;f>=o;)l[c--]=d.__kConversionChars[_&s],_>>>=o,f-=o}const h=(_|a<>>o-f;0!==_;)l[c--]=d.__kConversionChars[_&s],_>>>=o;if(t.sign&&(l[c--]="-"),-1!=c)throw new Error("implementation bug");return l.join("")}static __toStringGeneric(t,e,r){var n=Math.clz32;const i=t.length;if(0===i)return"";if(1===i){let n=t.__unsignedDigit(0).toString(e);return!1===r&&t.sign&&(n="-"+n),n}const o=32*i-n(t.__digit(i-1)),s=d.__kMaxBitsPerChar[e]-1;let a=o*d.__kBitsPerCharTableMultiplier;a+=s-1,a=0|a/s;const u=a+1>>1,l=d.exponentiate(d.__oneDigit(e,!1),d.__oneDigit(u,!1));let c,_;const f=l.__unsignedDigit(0);if(1===l.length&&65535>=f){c=new d(t.length,!1),c.__initializeDigits();let r=0;for(let e=2*t.length-1;0<=e;e--){const n=r<<16|t.__halfDigit(e);c.__setHalfDigit(e,0|n/f),r=0|n%f}_=r.toString(e)}else{const r=d.__absoluteDivLarge(t,l,!0,!0);c=r.quotient;const n=r.remainder.__trim();_=d.__toStringGeneric(n,e,!0)}c.__trim();let h=d.__toStringGeneric(c,e,!0);for(;_.lengthn?d.__absoluteLess(r):0}static __compareToNumber(t,e){if(!0|e){const r=t.sign,n=0>e;if(r!==n)return d.__unequalSign(r);if(0===t.length){if(n)throw new Error("implementation bug");return 0===e?0:-1}if(1i?d.__absoluteGreater(r):oe)return d.__unequalSign(n);if(0===e)throw new Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;d.__kBitConversionDouble[0]=e;const i=2047&d.__kBitConversionInts[1]>>>20;if(2047==i)throw new Error("implementation bug: handled elsewhere");const o=i-1023;if(0>o)return d.__absoluteGreater(n);const s=t.length;let a=t.__digit(s-1);const u=r(a),l=32*s-u,c=o+1;if(lc)return d.__absoluteGreater(n);let _=1048576|1048575&d.__kBitConversionInts[1],f=d.__kBitConversionInts[0];const h=31-u;if(h!==(l-1)%31)throw new Error("implementation bug");let g,p=0;if(20>h){const t=20-h;p=t+32,g=_>>>t,_=_<<32-t|f>>>t,f<<=32-t}else if(20===h)p=32,g=_,_=f;else{const t=h-20;p=32-t,g=_<>>32-t,_=f<>>=0,g>>>=0,a>g)return d.__absoluteGreater(n);if(a>>0,_=f,f=0):g=0;const r=t.__unsignedDigit(e);if(r>g)return d.__absoluteGreater(n);if(re&&t.__unsignedDigit(0)===r(e):0===d.__compareToDouble(t,e)}static __comparisonResultToBool(t,e){switch(e){case 0:return 0>t;case 1:return 0>=t;case 2:return 0e;case 3:return t>=e}if(d.__isBigInt(t)&&"string"==typeof e)return null!==(e=d.__fromString(e))&&d.__comparisonResultToBool(d.__compareToBigInt(t,e),r);if("string"==typeof t&&d.__isBigInt(e))return null!==(t=d.__fromString(t))&&d.__comparisonResultToBool(d.__compareToBigInt(t,e),r);if(t=d.__toNumeric(t),e=d.__toNumeric(e),d.__isBigInt(t)){if(d.__isBigInt(e))return d.__comparisonResultToBool(d.__compareToBigInt(t,e),r);if("number"!=typeof e)throw new Error("implementation bug");return d.__comparisonResultToBool(d.__compareToNumber(t,e),r)}if("number"!=typeof t)throw new Error("implementation bug");if(d.__isBigInt(e))return d.__comparisonResultToBool(d.__compareToNumber(e,t),2^r);if("number"!=typeof e)throw new Error("implementation bug");return 0===r?te:3===r?t>=e:void 0}__clzmsd(){return Math.clz32(this[this.length-1])}static __absoluteAdd(t,e,r){if(t.length>>16)+(r>>>16)+(a>>>16);o=u>>>16,i.__setDigit(s,65535&a|u<<16)}for(;s>>16)+(r>>>16);o=n>>>16,i.__setDigit(s,65535&r|n<<16)}return s>>16;const u=(r>>>16)-(s>>>16)-i;i=1&u>>>16,n.__setDigit(o,65535&a|u<<16)}for(;o>>16;const s=(e>>>16)-i;i=1&s>>>16,n.__setDigit(o,65535&r|s<<16)}return n.__trim()}static __absoluteAddOne(t,e,r=null){const n=t.length;null===r?r=new d(n,e):r.sign=e;let i=!0;for(let e,o=0;on?0:t.__unsignedDigit(n)>e.__unsignedDigit(n)?1:-1}static __multiplyAccumulate(t,e,r,n){var i=Math.imul;if(0===e)return;const o=65535&e,s=e>>>16;let a=0,u=0,l=0;for(let e=0;e>>16;const h=t.__digit(e),g=65535&h,d=h>>>16,p=i(g,o),b=i(g,s),m=i(d,o),y=i(d,s);_+=u+(65535&p),f+=l+a+(_>>>16)+(p>>>16)+(65535&b)+(65535&m),a=f>>>16,u=(b>>>16)+(m>>>16)+(65535&y)+a,a=u>>>16,u&=65535,l=y>>>16,c=65535&_|f<<16,r.__setDigit(n,c)}for(;0!=a||0!==u||0!==l;n++){let t=r.__digit(n);const e=(65535&t)+u,i=(t>>>16)+(e>>>16)+l+a;u=0,l=0,a=i>>>16,t=65535&e|i<<16,r.__setDigit(n,t)}}static __internalMultiplyAdd(t,e,r,n,i){var o=Math.imul;let s=r,a=0;for(let r=0;r>>16;const c=o(n>>>16,e),_=(65535&c)+(u>>>16)+s;s=_>>>16,a=c>>>16,i.__setDigit(r,_<<16|65535&l)}if(i.length>n)for(i.__setDigit(n++,s+a);nthis.length&&(r=this.length);const i=65535&t,o=t>>>16;let s=0,a=65535&e,u=e>>>16;for(let t=0;t>>16,c=n(r,i),_=n(r,o),f=n(l,i),h=n(l,o),g=a+(65535&c),d=u+s+(g>>>16)+(c>>>16)+(65535&_)+(65535&f);a=(_>>>16)+(f>>>16)+(65535&h)+(d>>>16),s=a>>>16,a&=65535,u=h>>>16,this.__setDigit(t,65535&g|d<<16)}if(0!=s||0!==a||0!==u)throw new Error("implementation bug")}static __absoluteDivSmall(t,e,r){null===r&&(r=new d(t.length,!1));let n=0;for(let i,o=2*t.length-1;0<=o;o-=2){i=(n<<16|t.__halfDigit(o))>>>0;const s=0|i/e;n=0|i%e,i=(n<<16|t.__halfDigit(o-1))>>>0;const a=0|i/e;n=0|i%e,r.__setDigit(o>>>1,s<<16|a)}return r}static __absoluteModSmall(t,e){let r=0;for(let n=2*t.length-1;0<=n;n--){r=0|((r<<16|t.__halfDigit(n))>>>0)%e}return r}static __absoluteDivLarge(t,e,r,n){var i=Math.imul;const o=e.__halfDigitLength(),s=e.length,a=t.__halfDigitLength()-o;let u=null;r&&(u=new d(a+2>>>1,!1),u.__initializeDigits());const l=new d(o+2>>>1,!1);l.__initializeDigits();const c=d.__clz16(e.__halfDigit(o-1));0>>0;t=0|r/f;let s=0|r%f;const u=e.__halfDigit(o-2),l=_.__halfDigit(n+o-2);for(;i(t,u)>>>0>(s<<16|l)>>>0&&(t--,s+=f,!(65535>>1,h|t))}return n?(_.__inplaceRightShift(c),r?{quotient:u,remainder:_}:_):r?u:void 0}static __clz16(t){return Math.clz32(t)-16}__inplaceAdd(t,e,r){let n=0;for(let i=0;i>>16,this.__setHalfDigit(e+i,r)}return n}__inplaceSub(t,e,r){let n=0;if(1&e){e>>=1;let i=this.__digit(e),o=65535&i,s=0;for(;s>>1;s++){const r=t.__digit(s),a=(i>>>16)-(65535&r)-n;n=1&a>>>16,this.__setDigit(e+s,a<<16|65535&o),i=this.__digit(e+s+1),o=(65535&i)-(r>>>16)-n,n=1&o>>>16}const a=t.__digit(s),u=(i>>>16)-(65535&a)-n;if(n=1&u>>>16,this.__setDigit(e+s,u<<16|65535&o),e+s+1>=this.length)throw new RangeError("out of bounds");0==(1&r)&&(i=this.__digit(e+s+1),o=(65535&i)-(a>>>16)-n,n=1&o>>>16,this.__setDigit(e+t.length,4294901760&i|65535&o))}else{e>>=1;let i=0;for(;i>>16;const a=(r>>>16)-(o>>>16)-n;n=1&a>>>16,this.__setDigit(e+i,a<<16|65535&s)}const o=this.__digit(e+i),s=t.__digit(i),a=(65535&o)-(65535&s)-n;n=1&a>>>16;let u=0;0==(1&r)&&(u=(o>>>16)-(s>>>16)-n,n=1&u>>>16),this.__setDigit(e+i,u<<16|65535&a)}return n}__inplaceRightShift(t){if(0===t)return;let e=this.__digit(0)>>>t;const r=this.length-1;for(let n=0;n>>t}this.__setDigit(r,e)}static __specialLeftShift(t,e,r){const n=t.length,i=new d(n+r,!1);if(0===e){for(let e=0;e>>32-e}return 0r)throw new RangeError("BigInt too big");const n=r>>>5,i=31&r,o=t.length,s=0!==i&&0!=t.__digit(o-1)>>>32-i,a=o+n+(s?1:0),u=new d(a,t.sign);if(0===i){let e=0;for(;e>>32-i}if(s)u.__setDigit(o+n,e);else if(0!=e)throw new Error("implementation bug")}return u.__trim()}static __rightShiftByAbsolute(t,e){const r=t.length,n=t.sign,i=d.__toShiftAmount(e);if(0>i)return d.__rightShiftByMaximum(n);const o=i>>>5,s=31&i;let a=r-o;if(0>=a)return d.__rightShiftByMaximum(n);let u=!1;if(n)if(0!=(t.__digit(o)&(1<>>s;const n=r-o-1;for(let r=0;r>>s}l.__setDigit(n,e)}return u&&(l=d.__absoluteAddOne(l,!0,l)),l.__trim()}static __rightShiftByMaximum(t){return t?d.__oneDigit(1,!0):d.__zero()}static __toShiftAmount(t){if(1d.__kMaxLengthBits?-1:e}static __toPrimitive(t,e="default"){if("object"!=typeof t)return t;if(t.constructor===d)return t;const r=t[Symbol.toPrimitive];if(r){const t=r(e);if("object"!=typeof t)return t;throw new TypeError("Cannot convert object to primitive value")}const n=t.valueOf;if(n){const e=n.call(t);if("object"!=typeof e)return e}const i=t.toString;if(i){const e=i.call(t);if("object"!=typeof e)return e}throw new TypeError("Cannot convert object to primitive value")}static __toNumeric(t){return d.__isBigInt(t)?t:+t}static __isBigInt(t){return"object"==typeof t&&t.constructor===d}static __truncateToNBits(t,e){const r=t+31>>>5,n=new d(r,e.sign),i=r-1;for(let t=0;t>>e}return n.__setDigit(i,o),n.__trim()}static __truncateAndSubFromPowerOfTwo(t,e,r){var n=Math.min;const i=t+31>>>5,o=new d(i,r);let s=0;const a=i-1;let u=0;for(const t=n(a,e.length);s>>16;const n=0-(t>>>16)-u;u=1&n>>>16,o.__setDigit(s,65535&r|n<<16)}for(;s>>16;_=65535&t|0-(l>>>16)-u<<16}else{const t=32-c;l=l<>>t;const e=1<<32-t,r=(65535&e)-(65535&l)-u;u=1&r>>>16;_=65535&r|(e>>>16)-(l>>>16)-u<<16,_&=e-1}return o.__setDigit(a,_),o.__trim()}__digit(t){return this[t]}__unsignedDigit(t){return this[t]>>>0}__setDigit(t,e){this[t]=0|e}__setDigitGrow(t,e){this[t]=0|e}__halfDigitLength(){const t=this.length;return 65535>=this.__unsignedDigit(t-1)?2*t-1:2*t}__halfDigit(t){return 65535&this[t>>>1]>>>((1&t)<<4)}__setHalfDigit(t,e){const r=t>>>1,n=this.__digit(r),i=1&t?65535&n|e<<16:4294901760&n|65535&e;this.__setDigit(r,i)}static __digitPow(t,e){let r=1;for(;0>>=1,t*=t;return r}}function p(t,e,r,n=[]){!function(t,e){if(!(e instanceof Object))throw new Error(t+" is not an object!")}(t,e);const i=Object.keys(e).sort(),o=r.length,s=r.length+n.length,a=`${t} does not have correct keys! Required keys: [${r.sort().join(", ")}], optional keys: [${n.sort().join(", ")}], actual keys: [${i.join(", ")}]`;if(i.lengths)throw new Error(a);let u=i.filter(t=>!r.includes(t));if(i.length-u.length!==o)throw new Error(a);if(u.find(t=>!n.includes(t)))throw new Error(a)}function b(t,e){if(!/^0x([0-9a-fA-F][0-9a-fA-F])*$/.test(e))throw new Error(t+" must be a hex string!")}function m(t,e){if(b(t,e),66!=e.length)throw new Error(t+" must be a hex string of 66 bytes long!")}function y(t,e){if("0x0"!==e&&!/^0x[1-9a-fA-F][0-9a-fA-F]*$/.test(e))throw new Error(t+" must be a hex integer!")}function w(t,{nestedValidation:e=!0,debugPath:r="script"}={}){if(p(r,t,["code_hash","hash_type","args"],[]),m(r+".code_hash",t.code_hash),b(r+".args",t.args),"data"!==t.hash_type&&"type"!==t.hash_type)throw new Error(r+".hash_type must be either data or type!")}function v(t,{nestedValidation:e=!0,debugPath:r="out_point"}={}){p(r,t,["tx_hash","index"],[]),m(r+".tx_hash",t.tx_hash),y(r+".index",t.index)}function B(t,{nestedValidation:e=!0,debugPath:r="cell_input"}={}){p(r,t,["since","previous_output"],[]),y(r+".since",t.since),e&&v(t.previous_output,{debugPath:r+".previous_output"})}function P(t,{nestedValidation:e=!0,debugPath:r="cell_output"}={}){p(r,t,["capacity","lock"],["type"]),y(r+".capacity",t.capacity),e&&(w(t.lock,{debugPath:r+".lock"}),t.type&&w(t.type,{debugPath:r+".type"}))}function D(t,{nestedValidation:e=!0,debugPath:r="cell_dep"}={}){if(p(r,t,["out_point","dep_type"],[]),"code"!==t.dep_type&&"dep_group"!==t.dep_type)throw new Error(r+".dep_type must be either code or dep_group!");e&&v(t.out_point,{debugPath:r+".out_point"})}function S(t,e,r,n){if(!Array.isArray(e))throw new Error(t+" is not an array!");if(n)for(let n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=r.size;let i=void 0===n?0:n;var o=r.timeout;let a=void 0===o?0:o;null==t?t=null:J(t)?t=Buffer.from(t.toString()):X(t)||Buffer.isBuffer(t)||("[object ArrayBuffer]"===Object.prototype.toString.call(t)?t=Buffer.from(t):ArrayBuffer.isView(t)?t=Buffer.from(t.buffer,t.byteOffset,t.byteLength):t instanceof s.default||(t=Buffer.from(String(t)))),this[H]={body:t,disturbed:!1,error:null},this.size=i,this.timeout=a,t instanceof s.default&&t.on("error",(function(t){const r="AbortError"===t.name?t:new U(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t);e[H].error=r}))}function W(){var t=this;if(this[H].disturbed)return G.Promise.reject(new TypeError("body used already for: "+this.url));if(this[H].disturbed=!0,this[H].error)return G.Promise.reject(this[H].error);let e=this.body;if(null===e)return G.Promise.resolve(Buffer.alloc(0));if(X(e)&&(e=e.stream()),Buffer.isBuffer(e))return G.Promise.resolve(e);if(!(e instanceof s.default))return G.Promise.resolve(Buffer.alloc(0));let r=[],n=0,i=!1;return new G.Promise((function(o,s){let a;t.timeout&&(a=setTimeout((function(){i=!0,s(new U(`Response timeout while trying to fetch ${t.url} (over ${t.timeout}ms)`,"body-timeout"))}),t.timeout)),e.on("error",(function(e){"AbortError"===e.name?(i=!0,s(e)):s(new U(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e))})),e.on("data",(function(e){if(!i&&null!==e){if(t.size&&n+e.length>t.size)return i=!0,void s(new U(`content size at ${t.url} over limit: ${t.size}`,"max-size"));n+=e.length,r.push(e)}})),e.on("end",(function(){if(!i){clearTimeout(a);try{o(Buffer.concat(r,n))}catch(e){s(new U(`Could not create Buffer from response body for ${t.url}: ${e.message}`,"system",e))}}}))}))}function J(t){return"object"==typeof t&&"function"==typeof t.append&&"function"==typeof t.delete&&"function"==typeof t.get&&"function"==typeof t.getAll&&"function"==typeof t.has&&"function"==typeof t.set&&("URLSearchParams"===t.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(t)||"function"==typeof t.sort)}function X(t){return"object"==typeof t&&"function"==typeof t.arrayBuffer&&"string"==typeof t.type&&"function"==typeof t.stream&&"function"==typeof t.constructor&&"string"==typeof t.constructor.name&&/^(Blob|File)$/.test(t.constructor.name)&&/^(Blob|File)$/.test(t[Symbol.toStringTag])}function Q(t){let e,r,n=t.body;if(t.bodyUsed)throw new Error("cannot clone body after it is used");return n instanceof s.default&&"function"!=typeof n.getBoundary&&(e=new F,r=new F,n.pipe(e),n.pipe(r),t[H].body=e,n=r),n}function Z(t){return null===t?null:"string"==typeof t?"text/plain;charset=UTF-8":J(t)?"application/x-www-form-urlencoded;charset=UTF-8":X(t)?t.type||null:Buffer.isBuffer(t)||"[object ArrayBuffer]"===Object.prototype.toString.call(t)||ArrayBuffer.isView(t)?null:"function"==typeof t.getBoundary?"multipart/form-data;boundary="+t.getBoundary():t instanceof s.default?null:"text/plain;charset=UTF-8"}function K(t){const e=t.body;return null===e?0:X(e)?e.size:Buffer.isBuffer(e)?e.length:e&&"function"==typeof e.getLengthSync&&(e._lengthRetrievers&&0==e._lengthRetrievers.length||e.hasKnownLength&&e.hasKnownLength())?e.getLengthSync():null}G.prototype={get body(){return this[H].body},get bodyUsed(){return this[H].disturbed},arrayBuffer(){return W.call(this).then((function(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}))},blob(){let t=this.headers&&this.headers.get("content-type")||"";return W.call(this).then((function(e){return Object.assign(new q([],{type:t.toLowerCase()}),{[N]:e})}))},json(){var t=this;return W.call(this).then((function(e){try{return JSON.parse(e.toString())}catch(e){return G.Promise.reject(new U(`invalid json response body at ${t.url} reason: ${e.message}`,"invalid-json"))}}))},text(){return W.call(this).then((function(t){return t.toString()}))},buffer(){return W.call(this)},textConverted(){var t=this;return W.call(this).then((function(e){return function(t,e){if("function"!=typeof V)throw new Error("The package `encoding` must be installed to use the textConverted() function");const r=e.get("content-type");let n,i,o="utf-8";r&&(n=/charset=([^;]*)/i.exec(r));i=t.slice(0,1024).toString(),!n&&i&&(n=/0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[it]=Object.create(null),t instanceof ot){const e=t.raw(),r=Object.keys(e);for(const t of r)for(const r of e[t])this.append(t,r)}else if(null==t);else{if("object"!=typeof t)throw new TypeError("Provided initializer must be an object");{const e=t[Symbol.iterator];if(null!=e){if("function"!=typeof e)throw new TypeError("Header pairs must be iterable");const r=[];for(const e of t){if("object"!=typeof e||"function"!=typeof e[Symbol.iterator])throw new TypeError("Each header pair must be iterable");r.push(Array.from(e))}for(const t of r){if(2!==t.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(t[0],t[1])}}else for(const e of Object.keys(t)){const r=t[e];this.append(e,r)}}}}get(t){et(t=""+t);const e=nt(this[it],t);return void 0===e?null:this[it][e].join(", ")}forEach(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=st(this),n=0;for(;n1&&void 0!==arguments[1]?arguments[1]:"key+value";const r=Object.keys(t[it]).sort();return r.map("key"===e?function(t){return t.toLowerCase()}:"value"===e?function(e){return t[it][e].join(", ")}:function(e){return[e.toLowerCase(),t[it][e].join(", ")]})}ot.prototype.entries=ot.prototype[Symbol.iterator],Object.defineProperty(ot.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(ot.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const at=Symbol("internal");function ut(t,e){const r=Object.create(lt);return r[at]={target:t,kind:e,index:0},r}const lt=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==lt)throw new TypeError("Value of `this` is not a HeadersIterator");var t=this[at];const e=t.target,r=t.kind,n=t.index,i=st(e,r);return n>=i.length?{value:void 0,done:!0}:(this[at].index=n+1,{value:i[n],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function ct(t){const e=Object.assign({__proto__:null},t[it]),r=nt(t[it],"Host");return void 0!==r&&(e[r]=e[r][0]),e}Object.defineProperty(lt,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const _t=Symbol("Response internals"),ft=a.default.STATUS_CODES;class ht{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};G.call(this,t,e);const r=e.status||200,n=new ot(e.headers);if(null!=t&&!n.has("Content-Type")){const e=Z(t);e&&n.append("Content-Type",e)}this[_t]={url:e.url,status:r,statusText:e.statusText||ft[r],headers:n,counter:e.counter}}get url(){return this[_t].url||""}get status(){return this[_t].status}get ok(){return this[_t].status>=200&&this[_t].status<300}get redirected(){return this[_t].counter>0}get statusText(){return this[_t].statusText}get headers(){return this[_t].headers}clone(){return new ht(Q(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}G.mixIn(ht.prototype),Object.defineProperties(ht.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(ht.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const gt=Symbol("Request internals"),dt=u.default.parse,pt=u.default.format,bt="destroy"in s.default.Readable.prototype;function mt(t){return"object"==typeof t&&"object"==typeof t[gt]}class yt{constructor(t){let e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};mt(t)?e=dt(t.url):(e=t&&t.href?dt(t.href):dt(""+t),t={});let n=r.method||t.method||"GET";if(n=n.toUpperCase(),(null!=r.body||mt(t)&&null!==t.body)&&("GET"===n||"HEAD"===n))throw new TypeError("Request with GET/HEAD method cannot have body");let i=null!=r.body?r.body:mt(t)&&null!==t.body?Q(t):null;G.call(this,i,{timeout:r.timeout||t.timeout||0,size:r.size||t.size||0});const o=new ot(r.headers||t.headers||{});if(null!=i&&!o.has("Content-Type")){const t=Z(i);t&&o.append("Content-Type",t)}let s=mt(t)?t.signal:null;if("signal"in r&&(s=r.signal),null!=s&&!function(t){const e=t&&"object"==typeof t&&Object.getPrototypeOf(t);return!(!e||"AbortSignal"!==e.constructor.name)}(s))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[gt]={method:n,redirect:r.redirect||t.redirect||"follow",headers:o,parsedURL:e,signal:s},this.follow=void 0!==r.follow?r.follow:void 0!==t.follow?t.follow:20,this.compress=void 0!==r.compress?r.compress:void 0===t.compress||t.compress,this.counter=r.counter||t.counter||0,this.agent=r.agent||t.agent}get method(){return this[gt].method}get url(){return pt(this[gt].parsedURL)}get headers(){return this[gt].headers}get redirect(){return this[gt].redirect}get signal(){return this[gt].signal}clone(){return new yt(this)}}function wt(t){Error.call(this,t),this.type="aborted",this.message=t,Error.captureStackTrace(this,this.constructor)}G.mixIn(yt.prototype),Object.defineProperty(yt.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(yt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),wt.prototype=Object.create(Error.prototype),wt.prototype.constructor=wt,wt.prototype.name="AbortError";const vt=s.default.PassThrough,Bt=u.default.resolve;function Pt(t,e){if(!Pt.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return G.Promise=Pt.Promise,new Pt.Promise((function(r,n){const i=new yt(t,e),o=function(t){const e=t[gt].parsedURL,r=new ot(t[gt].headers);if(r.has("Accept")||r.set("Accept","*/*"),!e.protocol||!e.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(e.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(t.signal&&t.body instanceof s.default.Readable&&!bt)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let n=null;if(null==t.body&&/^(POST|PUT)$/i.test(t.method)&&(n="0"),null!=t.body){const e=K(t);"number"==typeof e&&(n=String(e))}n&&r.set("Content-Length",n),r.has("User-Agent")||r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let i=t.agent;return"function"==typeof i&&(i=i(e)),r.has("Connection")||i||r.set("Connection","close"),Object.assign({},e,{method:t.method,headers:ct(r),agent:i})}(i),u=("https:"===o.protocol?l.default:a.default).request,_=i.signal;let f=null;const h=function(){let t=new wt("The user aborted a request.");n(t),i.body&&i.body instanceof s.default.Readable&&i.body.destroy(t),f&&f.body&&f.body.emit("error",t)};if(_&&_.aborted)return void h();const g=function(){h(),b()},d=u(o);let p;function b(){d.abort(),_&&_.removeEventListener("abort",g),clearTimeout(p)}_&&_.addEventListener("abort",g),i.timeout&&d.once("socket",(function(t){p=setTimeout((function(){n(new U("network timeout at: "+i.url,"request-timeout")),b()}),i.timeout)})),d.on("error",(function(t){n(new U(`request to ${i.url} failed, reason: ${t.message}`,"system",t)),b()})),d.on("response",(function(t){clearTimeout(p);const e=function(t){const e=new ot;for(const r of Object.keys(t))if(!Y.test(r))if(Array.isArray(t[r]))for(const n of t[r])tt.test(n)||(void 0===e[it][r]?e[it][r]=[n]:e[it][r].push(n));else tt.test(t[r])||(e[it][r]=[t[r]]);return e}(t.headers);if(Pt.isRedirect(t.statusCode)){const o=e.get("Location"),s=null===o?null:Bt(i.url,o);switch(i.redirect){case"error":return n(new U("uri requested responds with a redirect, redirect mode is set to error: "+i.url,"no-redirect")),void b();case"manual":if(null!==s)try{e.set("Location",s)}catch(t){n(t)}break;case"follow":if(null===s)break;if(i.counter>=i.follow)return n(new U("maximum redirect reached at: "+i.url,"max-redirect")),void b();const o={headers:new ot(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:i.body,signal:i.signal,timeout:i.timeout,size:i.size};return 303!==t.statusCode&&i.body&&null===K(i)?(n(new U("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void b()):(303!==t.statusCode&&(301!==t.statusCode&&302!==t.statusCode||"POST"!==i.method)||(o.method="GET",o.body=void 0,o.headers.delete("content-length")),r(Pt(new yt(s,o))),void b())}}t.once("end",(function(){_&&_.removeEventListener("abort",g)}));let o=t.pipe(new vt);const s={url:i.url,status:t.statusCode,statusText:t.statusMessage,headers:e,size:i.size,timeout:i.timeout,counter:i.counter},a=e.get("Content-Encoding");if(!i.compress||"HEAD"===i.method||null===a||204===t.statusCode||304===t.statusCode)return f=new ht(o,s),void r(f);const u={flush:c.default.Z_SYNC_FLUSH,finishFlush:c.default.Z_SYNC_FLUSH};if("gzip"==a||"x-gzip"==a)return o=o.pipe(c.default.createGunzip(u)),f=new ht(o,s),void r(f);if("deflate"!=a&&"x-deflate"!=a){if("br"==a&&"function"==typeof c.default.createBrotliDecompress)return o=o.pipe(c.default.createBrotliDecompress()),f=new ht(o,s),void r(f);f=new ht(o,s),r(f)}else{t.pipe(new vt).once("data",(function(t){o=8==(15&t[0])?o.pipe(c.default.createInflate()):o.pipe(c.default.createInflateRaw()),f=new ht(o,s),r(f)}))}})),function(t,e){const r=e.body;null===r?t.end():X(r)?r.stream().pipe(t):Buffer.isBuffer(r)?(t.write(r),t.end()):r.pipe(t)}(d,i)}))}Pt.isRedirect=function(t){return 301===t||302===t||303===t||307===t||308===t},Pt.Promise=global.Promise;var Dt,St,Tt=Object.freeze({__proto__:null,default:Pt,Headers:ot,Request:yt,Response:ht,FetchError:U}),kt=(function(t,e){var r=Tt.default||Tt,n=function(t,e){return/^\/\//.test(t)&&(t="https:"+t),r.call(this,t,e)};t.exports=e=n,e.fetch=n,e.Headers=Tt.Headers,e.Request=Tt.Request,e.Response=Tt.Response,e.default=n}(St={path:Dt,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&St.path)}},St.exports),St.exports);function xt(t,e){e=e||{};const r=Object.assign({},e.headers||{},t.headers||{});return Object.assign({},e,t,{headers:r})}const Ct={get:(t,e,r)=>"send"===e?async()=>{const e=await kt(t.uri,xt({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.payload)},t.defaultOptions));return await e.json()}:(...n)=>{const i=t.id;return t.id=t.id+1,t.payload.push({jsonrpc:"2.0",id:i,method:e,params:n}),r}},Et={get:(t,e)=>"batch"===e?()=>new Proxy({id:Math.round(1e7*Math.random()),payload:[],uri:t.uri,defaultOptions:t.defaultOptions},Ct):async(...r)=>{const n=Math.round(1e7*Math.random()),i=await kt(t.uri,xt({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:n,method:e,params:r})},t.defaultOptions)),o=await i.json();if(o.id!==n)throw new Error("JSONRPCError: response ID does not match request ID!");if(o.error)throw new Error("JSONRPCError: server error "+JSON.stringify(o.error));return o.result}};class Ot{constructor(t,e={}){return this.uri=t,this.defaultOptions=e,new Proxy(this,Et)}static create(t){return new Ot(t)}}function At(t){return d.BigInt(t)}function jt(t){return"0x"+t.toString(16)}function zt(t){return function(e,r){if(!(r instanceof ArrayBuffer)){let n=jt(d.BigInt(r)).substr(2);if(n.length%2!=0&&(n="0"+n),n.length/2>t)throw new Error(`${e} is ${n.length/2} bytes long, expected length is ${t}!`);const i=new DataView(new ArrayBuffer(t));for(let t=0;t0&&r.byteLength!==t)throw new Error(`${e} has invalid length ${r.byteLength}, required: ${t}`);return r}}function Rt(t,e,r){const n={};for(const[i,o]of Object.entries(r)){const r=e[i];if(!r)throw new Error(`${t} is missing ${i}!`);n[i]=o(`${t}.${i}`,r)}return n}function Lt(t,{debugPath:e="script"}={}){return Rt(e,t,{code_hash:It(32),hash_type:function(t,e){switch(e){case"data":return 0;case"type":return 1;case 0:case 1:return e;default:throw new Error(`${t}.hash_type has invalid value: ${e}`)}},args:It(-1)})}function Mt(t,{debugPath:e="out_point"}={}){return Rt(e,t,{tx_hash:It(32),index:zt(4)})}function Nt(t){return function(e,r){return t(r,{debugPath:e})}}function $t(t,{debugPath:e="cell_input"}={}){return Rt(e,t,{since:zt(8),previous_output:Nt(Mt)})}function qt(t,{debugPath:e="cell_output"}={}){const r=Rt(e,t,{capacity:zt(8),lock:Nt(Lt)});return t.type&&(r.type_=Lt(t.type,{debugPath:e+".type"})),r}function Ut(t,{debugPath:e="cell_dep"}={}){return Rt(e,t,{out_point:Nt(Mt),dep_type:function(t,e){switch(e){case"code":return 0;case"dep_group":return 1;case 0:case 1:return e;default:throw new Error(`${t}.dep_type has invalid value: ${e}`)}}})}function Vt(t){return function(e,r){return r.map((r,n)=>t(`${e}[${n}]`,r))}}function Ht(t,{debugPath:e="raw_transaction"}={}){return Rt(e,t,{version:zt(4),cell_deps:Vt(Nt(Ut)),header_deps:Vt(It(32)),inputs:Vt(Nt($t)),outputs:Vt(Nt(qt)),outputs_data:Vt(It(-1))})}function Ft(t,{debugPath:e="transaction"}={}){const r=Ht(t,{debugPath:"(raw)"+e}),n=Rt(e,t,{witnesses:Vt(It(-1))});return n.raw=r,n}function Gt(t,{debugPath:e="raw_header"}={}){return Rt(e,t,{version:zt(4),compact_target:zt(4),timestamp:zt(8),number:zt(8),epoch:zt(8),parent_hash:It(32),transactions_root:It(32),proposals_hash:It(32),uncles_hash:It(32),dao:It(32)})}function Wt(t,{debugPath:e="header"}={}){const r=Gt(t,{debugPath:"(raw)"+e}),n=Rt(e,t,{nonce:zt(16)});return n.raw=r,n}function Jt(t,{debugPath:e="uncle_block"}={}){return Rt(e,t,{header:Nt(Wt),proposals:Vt(It(10))})}var Xt=Object.freeze({__proto__:null,NormalizeScript:Lt,NormalizeOutPoint:Mt,NormalizeCellInput:$t,NormalizeCellOutput:qt,NormalizeCellDep:Ut,NormalizeRawTransaction:Ht,NormalizeTransaction:Ft,NormalizeRawHeader:Gt,NormalizeHeader:Wt,NormalizeUncleBlock:Jt,NormalizeBlock:function(t,{debugPath:e="block"}={}){return Rt(e,t,{header:Nt(Wt),uncles:Vt(Nt(Jt)),transactions:Vt(Nt(Ft)),proposals:Vt(It(10))})},NormalizeCellbaseWitness:function(t,{debugPath:e="cellbase_witness"}={}){return Rt(e,t,{lock:Nt(Lt),message:It(-1)})},NormalizeWitnessArgs:function(t,{debugPath:e="witness_args"}={}){const r={};return t.lock&&(r.lock=It(-1)(e+".lock",t.lock)),t.input_type&&(r.input_type=It(-1)(e+".input_type",t.input_type)),t.output_type&&(r.output_type=It(-1)(e+".output_type",t.output_type)),r}});function Qt(t,e){return e instanceof Object&&e.serializeJson instanceof Function?e.serializeJson.call(e):e}function Zt(t,e,r){if(!((e=Qt(0,e))instanceof Object))throw new Error(`Transformed ${t} is not an object!`);const n={};for(const[i,o]of Object.entries(r)){let r=e[i];if(!r){r=e[i.replace(/(_[a-z])/g,t=>t.toUpperCase().replace("_",""))]}r&&(n[i]=o(`${t}.${i}`,r))}return n}function Kt(t,{validation:e=!0,debugPath:r="script"}={}){return t=Zt(r,t,{code_hash:Qt,hash_type:Qt,args:Qt}),e&&w(t,{debugPath:"(transformed) "+r}),t}function Yt(t,{validation:e=!0,debugPath:r="out_point"}={}){return t=Zt(r,t,{tx_hash:Qt,index:Qt}),e&&v(t,{debugPath:"(transformed) "+r}),t}function te(t){return function(e,r){return t(r,{validation:!1,debugPath:e})}}function ee(t,{validation:e=!0,debugPath:r="cell_input"}={}){return t=Zt(r,t,{since:Qt,previous_output:te(Yt)}),e&&B(t,{debugPath:"(transformed) "+r}),t}function re(t,{validation:e=!0,debugPath:r="cell_output"}={}){return t=Zt(r,t,{capacity:Qt,lock:te(Kt),type:te(Kt)}),e&&P(t,{debugPath:"(transformed) "+r}),t}function ne(t,{validation:e=!0,debugPath:r="cell_dep"}={}){return t=Zt(r,t,{out_point:te(Yt),dep_type:Qt}),e&&D(t,{debugPath:"(transformed) "+r}),t}function ie(t){return function(e,r){return r.map((r,n)=>t(`${e}[${n}]`,r))}}function oe(t,{validation:e=!0,debugPath:r="transaction"}={}){return t=Zt(r,t,{version:Qt,cell_deps:ie(te(ne)),header_deps:ie(Qt),inputs:ie(te(ee)),outputs:ie(te(re)),outputs_data:ie(Qt),witnesses:ie(Qt)}),e&&C(t,{debugPath:"(transformed) "+r}),t}function se(t,{validation:e=!0,debugPath:r="header"}={}){return t=Zt(r,t,{version:Qt,compact_target:Qt,timestamp:Qt,number:Qt,epoch:Qt,parent_hash:Qt,transactions_root:Qt,proposals_hash:Qt,uncles_hash:Qt,dao:Qt,nonce:Qt}),e&&O(t,{debugPath:"(transformed) "+r}),t}function ae(t,{validation:e=!0,debugPath:r="uncle_block"}={}){return t=Zt(r,t,{header:te(se),proposals:ie(Qt)}),e&&j(t,{debugPath:"(transformed) "+r}),t}var ue=Object.freeze({__proto__:null,TransformScript:Kt,TransformOutPoint:Yt,TransformCellInput:ee,TransformCellOutput:re,TransformCellDep:ne,TransformRawTransaction:function(t,{validation:e=!0,debugPath:r="raw_transaction"}={}){return t=Zt(r,t,{version:Qt,cell_deps:ie(te(ne)),header_deps:ie(Qt),inputs:ie(te(ee)),outputs:ie(te(re)),outputs_data:ie(Qt)}),e&&x(t,{debugPath:"(transformed) "+r}),t},TransformTransaction:oe,TransformRawHeader:function(t,{validation:e=!0,debugPath:r="raw_header"}={}){return t=Zt(r,t,{version:Qt,compact_target:Qt,timestamp:Qt,number:Qt,epoch:Qt,parent_hash:Qt,transactions_root:Qt,proposals_hash:Qt,uncles_hash:Qt,dao:Qt}),e&&E(t,{debugPath:"(transformed) "+r}),t},TransformHeader:se,TransformUncleBlock:ae,TransformBlock:function(t,{validation:e=!0,debugPath:r="block"}={}){return t=Zt(r,t,{header:te(se),uncles:ie(te(ae)),transactions:ie(te(oe)),proposals:ie(Qt)}),e&&z(t,{debugPath:"(transformed) "+r}),t},TransformCellbaseWitness:function(t,{validation:e=!0,debugPath:r="cellbase_witness"}={}){return t=Zt(r,t,{lock:te(Kt),message:Qt}),e&&I(t,{debugPath:"(transformed) "+r}),t},TransformWitnessArgs:function(t,{validation:e=!0,debugPath:r="witness_args"}={}){return t=Zt(r,t,{lock:Qt,input_type:Qt,output_type:Qt}),e&&R(t,{debugPath:"(transformed) "+r}),t}});var le=Object.freeze({__proto__:null,RPCCollector:class{constructor(t,e,{skipCellWithContent:r=!0,loadData:n=!1,loadBlockNumber:i=!0}={}){this.rpc=t,this.lockHash=new g(e).serializeJson(),this.skipCellWithContent=r,this.loadData=n,this.loadBlockNumber=i}async*collect(){const t=At(await this.rpc.get_tip_block_number());let e=d.BigInt(0);for(;d.lessThanOrEqual(e,t);){let r=d.add(e,d.BigInt(100));d.greaterThan(r,t)&&(r=t);const n=await this.rpc.get_cells_by_lock_hash(this.lockHash,jt(e),jt(r));for(const t of n){if(this.skipCellWithContent&&(t.type||d.greaterThan(At(t.output_data_len),d.BigInt(100))))continue;let e=null;if(this.loadData){e=(await this.rpc.get_live_cell(t.out_point,!0)).cell.data.content}let r=null;if(this.loadBlockNumber){r=(await this.rpc.get_header(t.block_hash)).number}yield{cellbase:t.cellbase,cell_output:{capacity:t.capacity,lock:t.lock,type:t.type},out_point:t.out_point,block_hash:t.block_hash,data:e,output_data_len:t.output_data_len,block_number:r}}e=d.add(r,d.BigInt(1))}}}});exports.BigIntToHexString=jt,exports.HexStringToBigInt=At,exports.RPC=Ot,exports.Reader=g,exports.TransactionDumper=class{constructor(t,{validateTransaction:e=!0,depGroupUnpacker:r=null}={}){this.rpc=t,this.validateTransaction=e,this.depGroupUnpacker=r}async dumpByHash(t){const e=(await this.rpc.get_transaction(t)).transaction;return delete e.hash,await this.dump(e)}async dump(t){this.validateTransaction&&C(t);const e=[];for(const r of t.inputs){const{output:t,data:n,header:i}=await this._resolveOutPoint(r.previous_output);e.push({input:r,output:t,data:n,header:i})}const r=[];for(const e of t.cell_deps){const{output:t,data:n,header:i}=await this._resolveOutPoint(e.out_point);if(r.push({cell_dep:e,output:t,data:n,header:i}),"dep_group"===e.dep_type){if(!this.depGroupUnpacker)throw new Error("depGroupUnpacker must be provided when the transaction contains dep_group!");const t=this.depGroupUnpacker(new g(n));for(const e of t){v(e);const{output:t,data:n,header:i}=await this._resolveOutPoint(e);r.push({cell_dep:{out_point:e,dep_type:"code"},output:t,data:n,header:i})}}}const n=[];for(const e of t.header_deps)n.push(await this.rpc.get_header(e));return JSON.stringify({mock_info:{inputs:e,cell_deps:r,header_deps:n},tx:t})}async _resolveOutPoint(t){const e=await this.rpc.get_transaction(t.tx_hash);if(!e||!e.transaction)throw new Error(`Transaction ${t.tx_hash} cannot be found!`);const r=e.transaction,n=d.toNumber(d.BigInt(t.index));if(n>=r.outputs.length)throw new Error(`Transaction ${t.tx_hash} does not have output ${n}!`);const i={output:r.outputs[n],data:r.outputs_data[n]};return"committed"===e.tx_status.status&&(i.header=e.tx_status.block_hash),i}},exports.VERSION="0.10.2",exports.cell_collectors=le,exports.normalizers=Xt,exports.transformers=ue,exports.validators=L; //# sourceMappingURL=ckb-js-toolkit.node.js.map diff --git a/dist/ckb-js-toolkit.node.js.map b/dist/ckb-js-toolkit.node.js.map index 24f0a76..4ec65bd 100644 --- a/dist/ckb-js-toolkit.node.js.map +++ b/dist/ckb-js-toolkit.node.js.map @@ -1 +1 @@ -{"version":3,"file":"ckb-js-toolkit.node.js","sources":["../src/reader.js","../node_modules/jsbi/dist/jsbi.mjs","../src/validators.js","../node_modules/node-fetch/lib/index.mjs","../node_modules/cross-fetch/dist/node-ponyfill.js","../src/rpc.js","../src/normalizers.js","../src/transformers.js","../src/cell_collectors/rpc_collector.js","../src/transaction_dumper.js","../src/index.js"],"sourcesContent":["class ArrayBufferReader {\n constructor(buffer) {\n this.view = new DataView(buffer);\n }\n\n length() {\n return this.view.byteLength;\n }\n\n indexAt(i) {\n return this.view.getUint8(i);\n }\n\n toArrayBuffer() {\n return this.view.buffer;\n }\n\n serializeJson() {\n return (\n \"0x\" +\n Array.prototype.map\n .call(new Uint8Array(this.view.buffer), x =>\n (\"00\" + x.toString(16)).slice(-2)\n )\n .join(\"\")\n );\n }\n}\n\nclass HexStringReader {\n constructor(string) {\n this.string = string;\n }\n\n length() {\n return this.string.length / 2 - 1;\n }\n\n indexAt(i) {\n return parseInt(this.string.substr(2 + i * 2, 2), 16);\n }\n\n toArrayBuffer() {\n const buffer = new ArrayBuffer(this.length());\n const view = new DataView(buffer);\n\n for (let i = 0; i < this.length(); i++) {\n view.setUint8(i, this.indexAt(i));\n }\n return buffer;\n }\n\n serializeJson() {\n return this.string;\n }\n}\n\nexport class Reader {\n constructor(input) {\n if (\n input instanceof HexStringReader ||\n input instanceof ArrayBufferReader\n ) {\n return input;\n }\n if (typeof input === \"string\") {\n if (!input.startsWith(\"0x\") || input.length % 2 != 0) {\n throw new Error(\n \"Hex string must start with 0x, and has even numbered length!\"\n );\n }\n return new HexStringReader(input);\n }\n if (input instanceof ArrayBuffer) {\n return new ArrayBufferReader(input);\n }\n throw new Error(\"Reader can only accept hex string or ArrayBuffer!\");\n }\n\n static fromRawString(string) {\n const buffer = new ArrayBuffer(string.length);\n const view = new DataView(buffer);\n\n for (let i = 0; i < string.length; i++) {\n const c = string.charCodeAt(i);\n if (c > 0xff) {\n throw new Error(\"fromRawString can only accept UTF-8 raw string!\");\n }\n view.setUint8(i, c);\n }\n return new ArrayBufferReader(buffer);\n }\n}\n","class JSBI extends Array{constructor(a,b){if(a>JSBI.__kMaxLength)throw new RangeError(\"Maximum BigInt size exceeded\");super(a),this.sign=b}static BigInt(a){var b=Math.floor,c=Number.isFinite;if(\"number\"==typeof a){if(0===a)return JSBI.__zero();if((0|a)===a)return 0>a?JSBI.__oneDigit(-a,!0):JSBI.__oneDigit(a,!1);if(!c(a)||b(a)!==a)throw new RangeError(\"The number \"+a+\" cannot be converted to BigInt because it is not an integer\");return JSBI.__fromDouble(a)}if(\"string\"==typeof a){const b=JSBI.__fromString(a);if(null===b)throw new SyntaxError(\"Cannot convert \"+a+\" to a BigInt\");return b}if(\"boolean\"==typeof a)return!0===a?JSBI.__oneDigit(1,!1):JSBI.__zero();if(\"object\"==typeof a){if(a.constructor===JSBI)return a;const b=JSBI.__toPrimitive(a);return JSBI.BigInt(b)}throw new TypeError(\"Cannot convert \"+a+\" to a BigInt\")}toDebugString(){const a=[\"BigInt[\"];for(const b of this)a.push((b?(b>>>0).toString(16):b)+\", \");return a.push(\"]\"),a.join(\"\")}toString(a=10){if(2>a||36>>=12;const l=j-12;let m=12<=j?0:h<<20+j,n=20+j;0>>32-l,m=h<>>32-n,n-=32);const o=JSBI.__decideRounding(a,n,i,h);if((1===o||0===o&&1==(1&m))&&(m=m+1>>>0,0==m&&(k++,0!=k>>>20&&(k=0,g++,1023=JSBI.__kMaxLengthBits)throw new RangeError(\"BigInt too big\");if(1===a.length&&2===a.__digit(0)){const b=1+(c>>>5),d=a.sign&&0!=(1&c),e=new JSBI(b,d);e.__initializeDigits();const f=1<<(31&c);return e.__setDigit(b-1,f),e}let d=null,e=a;for(0!=(1&c)&&(d=a),c>>=1;0!==c;c>>=1)e=JSBI.multiply(e,e),0!=(1&c)&&(null===d?d=e:d=JSBI.multiply(d,e));return d}static multiply(a,b){if(0===a.length)return a;if(0===b.length)return b;let c=a.length+b.length;32<=a.__clzmsd()+b.__clzmsd()&&c--;const d=new JSBI(c,a.sign!==b.sign);d.__initializeDigits();for(let c=0;cJSBI.__absoluteCompare(a,b))return JSBI.__zero();const c=a.sign!==b.sign,d=b.__unsignedDigit(0);let e;if(1===b.length&&65535>=d){if(1===d)return c===a.sign?a:JSBI.unaryMinus(a);e=JSBI.__absoluteDivSmall(a,d,null)}else e=JSBI.__absoluteDivLarge(a,b,!0,!1);return e.sign=c,e.__trim()}static remainder(a,b){if(0===b.length)throw new RangeError(\"Division by zero\");if(0>JSBI.__absoluteCompare(a,b))return a;const c=b.__unsignedDigit(0);if(1===b.length&&65535>=c){if(1===c)return JSBI.__zero();const b=JSBI.__absoluteModSmall(a,c);return 0===b?JSBI.__zero():JSBI.__oneDigit(b,a.sign)}const d=JSBI.__absoluteDivLarge(a,b,!1,!0);return d.sign=a.sign,d.__trim()}static add(a,b){const c=a.sign;return c===b.sign?JSBI.__absoluteAdd(a,b,c):0<=JSBI.__absoluteCompare(a,b)?JSBI.__absoluteSub(a,b,c):JSBI.__absoluteSub(b,a,!c)}static subtract(a,b){const c=a.sign;return c===b.sign?0<=JSBI.__absoluteCompare(a,b)?JSBI.__absoluteSub(a,b,c):JSBI.__absoluteSub(b,a,!c):JSBI.__absoluteAdd(a,b,c)}static leftShift(a,b){return 0===b.length||0===a.length?a:b.sign?JSBI.__rightShiftByAbsolute(a,b):JSBI.__leftShiftByAbsolute(a,b)}static signedRightShift(a,b){return 0===b.length||0===a.length?a:b.sign?JSBI.__leftShiftByAbsolute(a,b):JSBI.__rightShiftByAbsolute(a,b)}static unsignedRightShift(){throw new TypeError(\"BigInts have no unsigned right shift; use >> instead\")}static lessThan(a,b){return 0>JSBI.__compareToBigInt(a,b)}static lessThanOrEqual(a,b){return 0>=JSBI.__compareToBigInt(a,b)}static greaterThan(a,b){return 0=JSBI.__kMaxLengthBits)return b;const c=a+31>>>5;if(b.lengthJSBI.__kMaxLengthBits)throw new RangeError(\"BigInt too big\");return JSBI.__truncateAndSubFromPowerOfTwo(a,b,!1)}if(a>=JSBI.__kMaxLengthBits)return b;const c=a+31>>>5;if(b.length>>d)return b}return JSBI.__truncateToNBits(a,b)}static ADD(a,b){if(a=JSBI.__toPrimitive(a),b=JSBI.__toPrimitive(b),\"string\"==typeof a)return\"string\"!=typeof b&&(b=b.toString()),a+b;if(\"string\"==typeof b)return a.toString()+b;if(a=JSBI.__toNumeric(a),b=JSBI.__toNumeric(b),JSBI.__isBigInt(a)&&JSBI.__isBigInt(b))return JSBI.add(a,b);if(\"number\"==typeof a&&\"number\"==typeof b)return a+b;throw new TypeError(\"Cannot mix BigInt and other types, use explicit conversions\")}static LT(a,b){return JSBI.__compare(a,b,0)}static LE(a,b){return JSBI.__compare(a,b,1)}static GT(a,b){return JSBI.__compare(a,b,2)}static GE(a,b){return JSBI.__compare(a,b,3)}static EQ(a,b){for(;;){if(JSBI.__isBigInt(a))return JSBI.__isBigInt(b)?JSBI.equal(a,b):JSBI.EQ(b,a);if(\"number\"==typeof a){if(JSBI.__isBigInt(b))return JSBI.__equalToNumber(b,a);if(\"object\"!=typeof b)return a==b;b=JSBI.__toPrimitive(b)}else if(\"string\"==typeof a){if(JSBI.__isBigInt(b))return a=JSBI.__fromString(a),null!==a&&JSBI.equal(a,b);if(\"object\"!=typeof b)return a==b;b=JSBI.__toPrimitive(b)}else if(\"boolean\"==typeof a){if(JSBI.__isBigInt(b))return JSBI.__equalToNumber(b,+a);if(\"object\"!=typeof b)return a==b;b=JSBI.__toPrimitive(b)}else if(\"symbol\"==typeof a){if(JSBI.__isBigInt(b))return!1;if(\"object\"!=typeof b)return a==b;b=JSBI.__toPrimitive(b)}else if(\"object\"==typeof a){if(\"object\"==typeof b&&b.constructor!==JSBI)return a==b;a=JSBI.__toPrimitive(a)}else return a==b}}static NE(a,b){return!JSBI.EQ(a,b)}static __zero(){return new JSBI(0,!1)}static __oneDigit(a,b){const c=new JSBI(1,b);return c.__setDigit(0,a),c}__copy(){const a=new JSBI(this.length,this.sign);for(let b=0;bb)e=-b-1;else{if(0===c)return-1;c--,d=a.__digit(c),e=31}let f=1<>>20,c=b-1023,d=(c>>>5)+1,e=new JSBI(d,0>a);let f=1048575&JSBI.__kBitConversionInts[1]|1048576,g=JSBI.__kBitConversionInts[0];const h=20,i=31&c;let j,k=0;if(i<20){const a=h-i;k=a+32,j=f>>>a,f=f<<32-a|g>>>a,g<<=32-a}else if(i===20)k=32,j=f,f=g;else{const a=i-h;k=32-a,j=f<>>32-a,f=g<=a&&9<=a)||(159>=a?32==a:131071>=a?160==a||5760==a:196607>=a?(a&=131071,10>=a||40==a||41==a||47==a||95==a||4096==a):65279==a)}static __fromString(a,b=0){let c=0;const e=a.length;let f=0;if(f===e)return JSBI.__zero();let g=a.charCodeAt(f);for(;JSBI.__isWhitespace(g);){if(++f===e)return JSBI.__zero();g=a.charCodeAt(f)}if(43===g){if(++f===e)return null;g=a.charCodeAt(f),c=1}else if(45===g){if(++f===e)return null;g=a.charCodeAt(f),c=-1}if(0===b){if(b=10,48===g){if(++f===e)return JSBI.__zero();if(g=a.charCodeAt(f),88===g||120===g){if(b=16,++f===e)return null;g=a.charCodeAt(f)}else if(79===g||111===g){if(b=8,++f===e)return null;g=a.charCodeAt(f)}else if(66===g||98===g){if(b=2,++f===e)return null;g=a.charCodeAt(f)}}}else if(16===b&&48===g){if(++f===e)return JSBI.__zero();if(g=a.charCodeAt(f),88===g||120===g){if(++f===e)return null;g=a.charCodeAt(f)}}for(;48===g;){if(++f===e)return JSBI.__zero();g=a.charCodeAt(f)}const h=e-f;let i=JSBI.__kMaxBitsPerChar[b],j=JSBI.__kBitsPerCharTableMultiplier-1;if(h>1073741824/i)return null;const k=i*h+j>>>JSBI.__kBitsPerCharTableShift,l=new JSBI(k+31>>>5,!1),n=10>b?b:10,o=10>=JSBI.__kBitsPerCharTableShift;const b=[],c=[];let d=!1;do{let h=0,j=0;for(;;){let b;if(g-48>>>0>>0>>0>>0>>JSBI.__kBitsPerCharTableShift+5;l.__inplaceMultiplyAdd(p,k,q)}while(!c)}if(f!==e){if(!JSBI.__isWhitespace(g))return null;for(f++;f>>i-f)}if(0!==e){if(d>=a.length)throw new Error(\"implementation bug\");a.__setDigit(d++,e)}for(;d>>1)+(85&e),e=(51&e>>>2)+(51&e),e=(15&e>>>4)+(15&e);const f=e,g=b-1,h=a.__digit(d-1),i=c(h);let j=0|(32*d-i+f-1)/f;if(a.sign&&j++,268435456>>e,n=32-e;n>=f;)k[l--]=JSBI.__kConversionChars[m&g],m>>>=f,n-=f}const o=(m|h<>>f-n;0!==m;)k[l--]=JSBI.__kConversionChars[m&g],m>>>=f;if(a.sign&&(k[l--]=\"-\"),-1!=l)throw new Error(\"implementation bug\");return k.join(\"\")}static __toStringGeneric(a,b,c){var d=Math.clz32;const e=a.length;if(0===e)return\"\";if(1===e){let d=a.__unsignedDigit(0).toString(b);return!1===c&&a.sign&&(d=\"-\"+d),d}const f=32*e-d(a.__digit(e-1)),g=JSBI.__kMaxBitsPerChar[b],h=g-1;let i=f*JSBI.__kBitsPerCharTableMultiplier;i+=h-1,i=0|i/h;const j=i+1>>1,k=JSBI.exponentiate(JSBI.__oneDigit(b,!1),JSBI.__oneDigit(j,!1));let l,m;const n=k.__unsignedDigit(0);if(1===k.length&&65535>=n){l=new JSBI(a.length,!1),l.__initializeDigits();let c=0;for(let b=2*a.length-1;0<=b;b--){const d=c<<16|a.__halfDigit(b);l.__setHalfDigit(b,0|d/n),c=0|d%n}m=c.toString(b)}else{const c=JSBI.__absoluteDivLarge(a,k,!0,!0);l=c.quotient;const d=c.remainder.__trim();m=JSBI.__toStringGeneric(d,b,!0)}l.__trim();let o=JSBI.__toStringGeneric(l,b,!0);for(;m.lengthd?JSBI.__absoluteLess(c):0}static __compareToNumber(a,b){if(b|!0){const c=a.sign,d=0>b;if(c!==d)return JSBI.__unequalSign(c);if(0===a.length){if(d)throw new Error(\"implementation bug\");return 0===b?0:-1}if(1e?JSBI.__absoluteGreater(c):fb)return JSBI.__unequalSign(d);if(0===b)throw new Error(\"implementation bug: should be handled elsewhere\");if(0===a.length)return-1;JSBI.__kBitConversionDouble[0]=b;const e=2047&JSBI.__kBitConversionInts[1]>>>20;if(2047==e)throw new Error(\"implementation bug: handled elsewhere\");const f=e-1023;if(0>f)return JSBI.__absoluteGreater(d);const g=a.length;let h=a.__digit(g-1);const i=c(h),j=32*g-i,k=f+1;if(jk)return JSBI.__absoluteGreater(d);let l=1048576|1048575&JSBI.__kBitConversionInts[1],m=JSBI.__kBitConversionInts[0];const n=20,o=31-i;if(o!==(j-1)%31)throw new Error(\"implementation bug\");let p,q=0;if(20>o){const a=n-o;q=a+32,p=l>>>a,l=l<<32-a|m>>>a,m<<=32-a}else if(20===o)q=32,p=l,l=m;else{const a=o-n;q=32-a,p=l<>>32-a,l=m<>>=0,p>>>=0,h>p)return JSBI.__absoluteGreater(d);if(h>>0,l=m,m=0):p=0;const b=a.__unsignedDigit(c);if(b>p)return JSBI.__absoluteGreater(d);if(bb&&a.__unsignedDigit(0)===c(b):0===JSBI.__compareToDouble(a,b)}static __comparisonResultToBool(a,b){switch(b){case 0:return 0>a;case 1:return 0>=a;case 2:return 0b;case 3:return a>=b;}if(JSBI.__isBigInt(a)&&\"string\"==typeof b)return b=JSBI.__fromString(b),null!==b&&JSBI.__comparisonResultToBool(JSBI.__compareToBigInt(a,b),c);if(\"string\"==typeof a&&JSBI.__isBigInt(b))return a=JSBI.__fromString(a),null!==a&&JSBI.__comparisonResultToBool(JSBI.__compareToBigInt(a,b),c);if(a=JSBI.__toNumeric(a),b=JSBI.__toNumeric(b),JSBI.__isBigInt(a)){if(JSBI.__isBigInt(b))return JSBI.__comparisonResultToBool(JSBI.__compareToBigInt(a,b),c);if(\"number\"!=typeof b)throw new Error(\"implementation bug\");return JSBI.__comparisonResultToBool(JSBI.__compareToNumber(a,b),c)}if(\"number\"!=typeof a)throw new Error(\"implementation bug\");if(JSBI.__isBigInt(b))return JSBI.__comparisonResultToBool(JSBI.__compareToNumber(b,a),2^c);if(\"number\"!=typeof b)throw new Error(\"implementation bug\");return 0===c?ab:3===c?a>=b:void 0}__clzmsd(){return Math.clz32(this[this.length-1])}static __absoluteAdd(a,b,c){if(a.length>>16)+(c>>>16)+(h>>>16);f=i>>>16,e.__setDigit(g,65535&h|i<<16)}for(;g>>16)+(c>>>16);f=d>>>16,e.__setDigit(g,65535&c|d<<16)}return g>>16;const i=(c>>>16)-(g>>>16)-e;e=1&i>>>16,d.__setDigit(f,65535&h|i<<16)}for(;f>>16;const g=(b>>>16)-e;e=1&g>>>16,d.__setDigit(f,65535&c|g<<16)}return d.__trim()}static __absoluteAddOne(a,b,c=null){const d=a.length;null===c?c=new JSBI(d,b):c.sign=b;let e=!0;for(let f,g=0;gd?0:a.__unsignedDigit(d)>b.__unsignedDigit(d)?1:-1}static __multiplyAccumulate(a,b,c,d){var e=Math.imul;if(0===b)return;const f=65535&b,g=b>>>16;let h=0,j=0,k=0;for(let l=0;l>>16;const n=a.__digit(l),o=65535&n,p=n>>>16,q=e(o,f),r=e(o,g),s=e(p,f),t=e(p,g);i+=j+(65535&q),m+=k+h+(i>>>16)+(q>>>16)+(65535&r)+(65535&s),h=m>>>16,j=(r>>>16)+(s>>>16)+(65535&t)+h,h=j>>>16,j&=65535,k=t>>>16,b=65535&i|m<<16,c.__setDigit(d,b)}for(;0!=h||0!==j||0!==k;d++){let a=c.__digit(d);const b=(65535&a)+j,e=(a>>>16)+(b>>>16)+k+h;j=0,k=0,h=e>>>16,a=65535&b|e<<16,c.__setDigit(d,a)}}static __internalMultiplyAdd(a,b,c,d,e){var f=Math.imul;let g=c,h=0;for(let j=0;j>>16;const k=f(c>>>16,b),l=(65535&k)+(d>>>16)+g;g=l>>>16,h=k>>>16,e.__setDigit(j,l<<16|65535&i)}if(e.length>d)for(e.__setDigit(d++,g+h);dthis.length&&(c=this.length);const f=65535&a,g=a>>>16;let h=0,j=65535&b,k=b>>>16;for(let l=0;l>>16,d=e(b,f),i=e(b,g),m=e(c,f),n=e(c,g),o=j+(65535&d),p=k+h+(o>>>16)+(d>>>16)+(65535&i)+(65535&m);j=(i>>>16)+(m>>>16)+(65535&n)+(p>>>16),h=j>>>16,j&=65535,k=n>>>16;this.__setDigit(l,65535&o|p<<16)}if(0!=h||0!==j||0!==k)throw new Error(\"implementation bug\")}static __absoluteDivSmall(a,b,c){null===c&&(c=new JSBI(a.length,!1));let d=0;for(let e,f=2*a.length-1;0<=f;f-=2){e=(d<<16|a.__halfDigit(f))>>>0;const g=0|e/b;d=0|e%b,e=(d<<16|a.__halfDigit(f-1))>>>0;const h=0|e/b;d=0|e%b,c.__setDigit(f>>>1,g<<16|h)}return c}static __absoluteModSmall(a,b){let c=0;for(let d=2*a.length-1;0<=d;d--){const e=(c<<16|a.__halfDigit(d))>>>0;c=0|e%b}return c}static __absoluteDivLarge(a,b,d,e){var f=Math.imul;const g=b.__halfDigitLength(),h=b.length,c=a.__halfDigitLength()-g;let i=null;d&&(i=new JSBI(c+2>>>1,!1),i.__initializeDigits());const k=new JSBI(g+2>>>1,!1);k.__initializeDigits();const l=JSBI.__clz16(b.__halfDigit(g-1));0>>0;l=0|c/n;let d=0|c%n;const e=b.__halfDigit(g-2),h=m.__halfDigit(p+g-2);for(;f(l,e)>>>0>(d<<16|h)>>>0&&(l--,d+=n,!(65535>>1,o|l))}return e?(m.__inplaceRightShift(l),d?{quotient:i,remainder:m}:m):d?i:void 0}static __clz16(a){return Math.clz32(a)-16}__inplaceAdd(a,b,c){let d=0;for(let e=0;e>>16,this.__setHalfDigit(b+e,c)}return d}__inplaceSub(a,b,c){let d=0;if(1&b){b>>=1;let e=this.__digit(b),f=65535&e,g=0;for(;g>>1;g++){const c=a.__digit(g),h=(e>>>16)-(65535&c)-d;d=1&h>>>16,this.__setDigit(b+g,h<<16|65535&f),e=this.__digit(b+g+1),f=(65535&e)-(c>>>16)-d,d=1&f>>>16}const h=a.__digit(g),i=(e>>>16)-(65535&h)-d;d=1&i>>>16,this.__setDigit(b+g,i<<16|65535&f);if(b+g+1>=this.length)throw new RangeError(\"out of bounds\");0==(1&c)&&(e=this.__digit(b+g+1),f=(65535&e)-(h>>>16)-d,d=1&f>>>16,this.__setDigit(b+a.length,4294901760&e|65535&f))}else{b>>=1;let e=0;for(;e>>16;const h=(c>>>16)-(f>>>16)-d;d=1&h>>>16,this.__setDigit(b+e,h<<16|65535&g)}const f=this.__digit(b+e),g=a.__digit(e),h=(65535&f)-(65535&g)-d;d=1&h>>>16;let i=0;0==(1&c)&&(i=(f>>>16)-(g>>>16)-d,d=1&i>>>16),this.__setDigit(b+e,i<<16|65535&h)}return d}__inplaceRightShift(a){if(0===a)return;let b=this.__digit(0)>>>a;const c=this.length-1;for(let e=0;e>>a}this.__setDigit(c,b)}static __specialLeftShift(a,b,c){const d=a.length,e=new JSBI(d+c,!1);if(0===b){for(let b=0;b>>32-b}return 0c)throw new RangeError(\"BigInt too big\");const e=c>>>5,f=31&c,g=a.length,h=0!==f&&0!=a.__digit(g-1)>>>32-f,j=g+e+(h?1:0),k=new JSBI(j,a.sign);if(0===f){let b=0;for(;b>>32-f}if(h)k.__setDigit(g+e,b);else if(0!=b)throw new Error(\"implementation bug\")}return k.__trim()}static __rightShiftByAbsolute(a,b){const c=a.length,d=a.sign,e=JSBI.__toShiftAmount(b);if(0>e)return JSBI.__rightShiftByMaximum(d);const f=e>>>5,g=31&e;let h=c-f;if(0>=h)return JSBI.__rightShiftByMaximum(d);let i=!1;if(d){if(0!=(a.__digit(f)&(1<>>g;const d=c-f-1;for(let c=0;c>>g}j.__setDigit(d,b)}return i&&(j=JSBI.__absoluteAddOne(j,!0,j)),j.__trim()}static __rightShiftByMaximum(a){return a?JSBI.__oneDigit(1,!0):JSBI.__zero()}static __toShiftAmount(a){if(1JSBI.__kMaxLengthBits?-1:b}static __toPrimitive(a,b=\"default\"){if(\"object\"!=typeof a)return a;if(a.constructor===JSBI)return a;const c=a[Symbol.toPrimitive];if(c){const a=c(b);if(\"object\"!=typeof a)return a;throw new TypeError(\"Cannot convert object to primitive value\")}const d=a.valueOf;if(d){const b=d.call(a);if(\"object\"!=typeof b)return b}const e=a.toString;if(e){const b=e.call(a);if(\"object\"!=typeof b)return b}throw new TypeError(\"Cannot convert object to primitive value\")}static __toNumeric(a){return JSBI.__isBigInt(a)?a:+a}static __isBigInt(a){return\"object\"==typeof a&&a.constructor===JSBI}static __truncateToNBits(a,b){const c=a+31>>>5,d=new JSBI(c,b.sign),e=c-1;for(let c=0;c>>b}return d.__setDigit(e,f),d.__trim()}static __truncateAndSubFromPowerOfTwo(a,b,c){var d=Math.min;const e=a+31>>>5,f=new JSBI(e,c);let g=0;const h=e-1;let j=0;for(const e=d(h,b.length);g>>16;const d=0-(a>>>16)-j;j=1&d>>>16,f.__setDigit(g,65535&c|d<<16)}for(;g>>16;const b=0-(k>>>16)-j;m=65535&a|b<<16}else{const a=32-l;k=k<>>a;const b=1<<32-a,c=(65535&b)-(65535&k)-j;j=1&c>>>16;const d=(b>>>16)-(k>>>16)-j;m=65535&c|d<<16,m&=b-1}return f.__setDigit(h,m),f.__trim()}__digit(a){return this[a]}__unsignedDigit(a){return this[a]>>>0}__setDigit(a,b){this[a]=0|b}__setDigitGrow(a,b){this[a]=0|b}__halfDigitLength(){const a=this.length;return 65535>=this.__unsignedDigit(a-1)?2*a-1:2*a}__halfDigit(a){return 65535&this[a>>>1]>>>((1&a)<<4)}__setHalfDigit(a,b){const c=a>>>1,d=this.__digit(c),e=1&a?65535&d|b<<16:4294901760&d|65535&b;this.__setDigit(c,e)}static __digitPow(a,b){let c=1;for(;0>>=1,a*=a;return c}}JSBI.__kMaxLength=33554432,JSBI.__kMaxLengthBits=JSBI.__kMaxLength<<5,JSBI.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],JSBI.__kBitsPerCharTableShift=5,JSBI.__kBitsPerCharTableMultiplier=1< maximalLength\n ) {\n throw new Error(errorMessage);\n }\n let optionalProvidedKeys = providedKeys.filter(\n key => !expectedKeys.includes(key)\n );\n if (providedKeys.length - optionalProvidedKeys.length !== requiredLength) {\n throw new Error(errorMessage);\n }\n if (optionalProvidedKeys.find(key => !optionalKeys.includes(key))) {\n throw new Error(errorMessage);\n }\n}\n\nfunction assertHexString(debugPath, string) {\n if (!/^0x([0-9a-fA-F][0-9a-fA-F])*$/.test(string)) {\n throw new Error(`${debugPath} must be a hex string!`);\n }\n}\n\nfunction assertHash(debugPath, hash) {\n assertHexString(debugPath, hash);\n if (hash.length != 66) {\n throw new Error(`${debugPath} must be a hex string of 66 bytes long!`);\n }\n}\n\nfunction assertInteger(debugPath, i) {\n if (i === \"0x0\") {\n return;\n }\n if (!/^0x[1-9a-fA-F][0-9a-fA-F]*$/.test(i)) {\n throw new Error(`${debugPath} must be a hex integer!`);\n }\n}\n\nexport function ValidateScript(\n script,\n { nestedValidation = true, debugPath = \"script\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n script,\n [\"code_hash\", \"hash_type\", \"args\"],\n []\n );\n assertHash(`${debugPath}.code_hash`, script.code_hash);\n assertHexString(`${debugPath}.args`, script.args);\n\n if (script.hash_type !== \"data\" && script.hash_type !== \"type\") {\n throw new Error(`${debugPath}.hash_type must be either data or type!`);\n }\n}\n\nexport function ValidateOutPoint(\n outPoint,\n { nestedValidation = true, debugPath = \"out_point\" } = {}\n) {\n assertObjectWithKeys(debugPath, outPoint, [\"tx_hash\", \"index\"], []);\n assertHash(`${debugPath}.tx_hash`, outPoint.tx_hash);\n assertInteger(`${debugPath}.index`, outPoint.index);\n}\n\nexport function ValidateCellInput(\n cellInput,\n { nestedValidation = true, debugPath = \"cell_input\" } = {}\n) {\n assertObjectWithKeys(debugPath, cellInput, [\"since\", \"previous_output\"], []);\n assertInteger(`${debugPath}.since`, cellInput.since);\n\n if (nestedValidation) {\n ValidateOutPoint(cellInput.previous_output, {\n debugPath: `${debugPath}.previous_output`\n });\n }\n}\n\nexport function ValidateCellOutput(\n cellOutput,\n { nestedValidation = true, debugPath = \"cell_output\" } = {}\n) {\n assertObjectWithKeys(debugPath, cellOutput, [\"capacity\", \"lock\"], [\"type\"]);\n assertInteger(`${debugPath}.capacity`, cellOutput.capacity);\n\n if (nestedValidation) {\n ValidateScript(cellOutput.lock, {\n debugPath: `${debugPath}.lock`\n });\n if (cellOutput.type) {\n ValidateScript(cellOutput.type, {\n debugPath: `${debugPath}.type`\n });\n }\n }\n}\n\nexport function ValidateCellDep(\n cellDep,\n { nestedValidation = true, debugPath = \"cell_dep\" } = {}\n) {\n assertObjectWithKeys(debugPath, cellDep, [\"out_point\", \"dep_type\"], []);\n if (cellDep.dep_type !== \"code\" && cellDep.dep_type !== \"dep_group\") {\n throw new Error(`${debugPath}.dep_type must be either code or dep_group!`);\n }\n\n if (nestedValidation) {\n ValidateOutPoint(cellDep.out_point, {\n debugPath: `${debugPath}.out_point`\n });\n }\n}\n\nfunction assertArray(debugPath, array, validateFunction, nestedValidation) {\n if (!Array.isArray(array)) {\n throw new Error(`${debugPath} is not an array!`);\n }\n if (nestedValidation) {\n for (let i = 0; i < array.length; i++) {\n validateFunction(`${debugPath}[${i}]`, array[i]);\n }\n }\n}\n\nfunction toAssert(validateFunction, nestedValidation) {\n return function(debugPath, value) {\n validateFunction(value, {\n nestedValidation: nestedValidation,\n debugPath: debugPath\n });\n };\n}\n\nfunction assertCommonTransaction(debugPath, rawTransaction, nestedValidation) {\n assertInteger(`${debugPath}.version`, rawTransaction.version);\n assertArray(\n `${debugPath}.cell_deps`,\n rawTransaction.cell_deps,\n toAssert(ValidateCellDep, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.header_deps`,\n rawTransaction.header_deps,\n assertHash,\n nestedValidation\n );\n assertArray(\n `${debugPath}.inputs`,\n rawTransaction.inputs,\n toAssert(ValidateCellInput, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.outputs`,\n rawTransaction.outputs,\n toAssert(ValidateCellOutput, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.outputs_data`,\n rawTransaction.outputs_data,\n assertHexString,\n nestedValidation\n );\n}\n\nexport function ValidateRawTransaction(\n rawTransaction,\n { nestedValidation = true, debugPath = \"raw_transaction\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n rawTransaction,\n [\n \"version\",\n \"cell_deps\",\n \"header_deps\",\n \"inputs\",\n \"outputs\",\n \"outputs_data\"\n ],\n []\n );\n assertCommonTransaction(debugPath, rawTransaction, nestedValidation);\n}\n\nexport function ValidateTransaction(\n transaction,\n { nestedValidation = true, debugPath = \"transaction\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n transaction,\n [\n \"version\",\n \"cell_deps\",\n \"header_deps\",\n \"inputs\",\n \"outputs\",\n \"outputs_data\",\n \"witnesses\"\n ],\n []\n );\n assertCommonTransaction(debugPath, transaction, nestedValidation);\n assertArray(\n `${debugPath}.witnesses`,\n transaction.witnesses,\n assertHexString,\n nestedValidation\n );\n}\n\nfunction assertCommonHeader(debugPath, rawHeader) {\n assertInteger(`${debugPath}.version`, rawHeader.version);\n assertInteger(`${debugPath}.compact_target`, rawHeader.compact_target);\n assertInteger(`${debugPath}.timestamp`, rawHeader.timestamp);\n assertInteger(`${debugPath}.number`, rawHeader.number);\n assertInteger(`${debugPath}.epoch`, rawHeader.epoch);\n assertHash(`${debugPath}.parent_hash`, rawHeader.parent_hash);\n assertHash(`${debugPath}.transactions_root`, rawHeader.transactions_root);\n assertHash(`${debugPath}.proposals_hash`, rawHeader.proposals_hash);\n assertHash(`${debugPath}.uncles_hash`, rawHeader.uncles_hash);\n assertHash(`${debugPath}.dao`, rawHeader.dao);\n}\n\nexport function ValidateRawHeader(\n rawHeader,\n { nestedValidation = true, debugPath = \"raw_header\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n rawHeader,\n [\n \"version\",\n \"compact_target\",\n \"timestamp\",\n \"number\",\n \"epoch\",\n \"parent_hash\",\n \"transactions_root\",\n \"proposals_hash\",\n \"uncles_hash\",\n \"dao\"\n ],\n []\n );\n assertCommonHeader(debugPath, rawHeader);\n}\n\nexport function ValidateHeader(\n header,\n { nestedValidation = true, debugPath = \"header\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n header,\n [\n \"version\",\n \"compact_target\",\n \"timestamp\",\n \"number\",\n \"epoch\",\n \"parent_hash\",\n \"transactions_root\",\n \"proposals_hash\",\n \"uncles_hash\",\n \"dao\",\n \"nonce\"\n ],\n []\n );\n assertHexString(`${debugPath}.nonce`, header.nonce);\n if (header.nonce.length != 34) {\n throw new Error(\n `${debugPath}.nonce must be a hex string of 34 bytes long!`\n );\n }\n}\n\nfunction assertProposalShortId(debugPath, shortId) {\n assertHexString(debugPath, shortId);\n if (shortId.length != 22) {\n throw new Error(`${debugPath} must be a hex string of 22 bytes long!`);\n }\n}\n\nexport function ValidateUncleBlock(\n uncleBlock,\n { nestedValidation = true, debugPath = \"uncle_block\" } = {}\n) {\n assertObjectWithKeys(debugPath, uncleBlock, [\"header\", \"proposals\"], []);\n\n if (nestedValidation) {\n ValidateHeader(uncleBlock.header, {\n debugPath: `${debugPath}.header`\n });\n }\n assertArray(\n `${debugPath}.proposals`,\n uncleBlock.proposals,\n assertProposalShortId,\n nestedValidation\n );\n}\n\nexport function ValidateBlock(\n block,\n { nestedValidation = true, debugPath = \"block\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n block,\n [\"header\", \"uncles\", \"transactions\", \"proposals\"],\n []\n );\n\n if (nestedValidation) {\n ValidateHeader(block.header, {\n debugPath: `${debugPath}.header`\n });\n }\n assertArray(\n `${debugPath}.uncles`,\n block.uncles,\n toAssert(ValidateUncleBlock, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.transactions`,\n block.transactions,\n toAssert(ValidateTransaction, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.proposals`,\n block.proposals,\n assertProposalShortId,\n nestedValidation\n );\n}\n\nexport function ValidateCellbaseWitness(\n cellbaseWitness,\n { nestedValidation = true, debugPath = \"cellbase_witness\" } = {}\n) {\n assertObjectWithKeys(debugPath, cellbaseWitness, [\"lock\", \"message\"], []);\n assertHexString(`${debugPath}.message`, cellbaseWitness.message);\n\n if (nestedValidation) {\n ValidateScript(cellbaseWitness.lock, {\n debugPath: `${debugPath}.lock`\n });\n }\n}\n\nexport function ValidateWitnessArgs(\n witnessArgs,\n { nestedValidation = true, debugPath = \"witness_args\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n witnessArgs,\n [],\n [\"lock\", \"input_type\", \"output_type\"]\n );\n\n if (witnessArgs.lock) {\n assertHexString(`${debugPath}.lock`, witnessArgs.lock);\n }\n if (witnessArgs.input_type) {\n assertHexString(`${debugPath}.input_type`, witnessArgs.input_type);\n }\n if (witnessArgs.output_type) {\n assertHexString(`${debugPath}.output_type`, witnessArgs.output_type);\n }\n}\n","import Stream from 'stream';\nimport http from 'http';\nimport Url from 'url';\nimport https from 'https';\nimport zlib from 'zlib';\n\n// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js\n\n// fix for \"Readable\" isn't a named export issue\nconst Readable = Stream.Readable;\n\nconst BUFFER = Symbol('buffer');\nconst TYPE = Symbol('type');\n\nclass Blob {\n\tconstructor() {\n\t\tthis[TYPE] = '';\n\n\t\tconst blobParts = arguments[0];\n\t\tconst options = arguments[1];\n\n\t\tconst buffers = [];\n\t\tlet size = 0;\n\n\t\tif (blobParts) {\n\t\t\tconst a = blobParts;\n\t\t\tconst length = Number(a.length);\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tconst element = a[i];\n\t\t\t\tlet buffer;\n\t\t\t\tif (element instanceof Buffer) {\n\t\t\t\t\tbuffer = element;\n\t\t\t\t} else if (ArrayBuffer.isView(element)) {\n\t\t\t\t\tbuffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);\n\t\t\t\t} else if (element instanceof ArrayBuffer) {\n\t\t\t\t\tbuffer = Buffer.from(element);\n\t\t\t\t} else if (element instanceof Blob) {\n\t\t\t\t\tbuffer = element[BUFFER];\n\t\t\t\t} else {\n\t\t\t\t\tbuffer = Buffer.from(typeof element === 'string' ? element : String(element));\n\t\t\t\t}\n\t\t\t\tsize += buffer.length;\n\t\t\t\tbuffers.push(buffer);\n\t\t\t}\n\t\t}\n\n\t\tthis[BUFFER] = Buffer.concat(buffers);\n\n\t\tlet type = options && options.type !== undefined && String(options.type).toLowerCase();\n\t\tif (type && !/[^\\u0020-\\u007E]/.test(type)) {\n\t\t\tthis[TYPE] = type;\n\t\t}\n\t}\n\tget size() {\n\t\treturn this[BUFFER].length;\n\t}\n\tget type() {\n\t\treturn this[TYPE];\n\t}\n\ttext() {\n\t\treturn Promise.resolve(this[BUFFER].toString());\n\t}\n\tarrayBuffer() {\n\t\tconst buf = this[BUFFER];\n\t\tconst ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\treturn Promise.resolve(ab);\n\t}\n\tstream() {\n\t\tconst readable = new Readable();\n\t\treadable._read = function () {};\n\t\treadable.push(this[BUFFER]);\n\t\treadable.push(null);\n\t\treturn readable;\n\t}\n\ttoString() {\n\t\treturn '[object Blob]';\n\t}\n\tslice() {\n\t\tconst size = this.size;\n\n\t\tconst start = arguments[0];\n\t\tconst end = arguments[1];\n\t\tlet relativeStart, relativeEnd;\n\t\tif (start === undefined) {\n\t\t\trelativeStart = 0;\n\t\t} else if (start < 0) {\n\t\t\trelativeStart = Math.max(size + start, 0);\n\t\t} else {\n\t\t\trelativeStart = Math.min(start, size);\n\t\t}\n\t\tif (end === undefined) {\n\t\t\trelativeEnd = size;\n\t\t} else if (end < 0) {\n\t\t\trelativeEnd = Math.max(size + end, 0);\n\t\t} else {\n\t\t\trelativeEnd = Math.min(end, size);\n\t\t}\n\t\tconst span = Math.max(relativeEnd - relativeStart, 0);\n\n\t\tconst buffer = this[BUFFER];\n\t\tconst slicedBuffer = buffer.slice(relativeStart, relativeStart + span);\n\t\tconst blob = new Blob([], { type: arguments[2] });\n\t\tblob[BUFFER] = slicedBuffer;\n\t\treturn blob;\n\t}\n}\n\nObject.defineProperties(Blob.prototype, {\n\tsize: { enumerable: true },\n\ttype: { enumerable: true },\n\tslice: { enumerable: true }\n});\n\nObject.defineProperty(Blob.prototype, Symbol.toStringTag, {\n\tvalue: 'Blob',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * fetch-error.js\n *\n * FetchError interface for operational errors\n */\n\n/**\n * Create FetchError instance\n *\n * @param String message Error message for human\n * @param String type Error type for machine\n * @param String systemError For Node.js system error\n * @return FetchError\n */\nfunction FetchError(message, type, systemError) {\n Error.call(this, message);\n\n this.message = message;\n this.type = type;\n\n // when err.type is `system`, err.code contains system error code\n if (systemError) {\n this.code = this.errno = systemError.code;\n }\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nFetchError.prototype = Object.create(Error.prototype);\nFetchError.prototype.constructor = FetchError;\nFetchError.prototype.name = 'FetchError';\n\nlet convert;\ntry {\n\tconvert = require('encoding').convert;\n} catch (e) {}\n\nconst INTERNALS = Symbol('Body internals');\n\n// fix an issue where \"PassThrough\" isn't a named export for node <10\nconst PassThrough = Stream.PassThrough;\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nfunction Body(body) {\n\tvar _this = this;\n\n\tvar _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n\t _ref$size = _ref.size;\n\n\tlet size = _ref$size === undefined ? 0 : _ref$size;\n\tvar _ref$timeout = _ref.timeout;\n\tlet timeout = _ref$timeout === undefined ? 0 : _ref$timeout;\n\n\tif (body == null) {\n\t\t// body is undefined or null\n\t\tbody = null;\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\tbody = Buffer.from(body.toString());\n\t} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\tbody = Buffer.from(body);\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t} else if (body instanceof Stream) ; else {\n\t\t// none of the above\n\t\t// coerce to string then buffer\n\t\tbody = Buffer.from(String(body));\n\t}\n\tthis[INTERNALS] = {\n\t\tbody,\n\t\tdisturbed: false,\n\t\terror: null\n\t};\n\tthis.size = size;\n\tthis.timeout = timeout;\n\n\tif (body instanceof Stream) {\n\t\tbody.on('error', function (err) {\n\t\t\tconst error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);\n\t\t\t_this[INTERNALS].error = error;\n\t\t});\n\t}\n}\n\nBody.prototype = {\n\tget body() {\n\t\treturn this[INTERNALS].body;\n\t},\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t},\n\n\t/**\n * Decode response as ArrayBuffer\n *\n * @return Promise\n */\n\tarrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t},\n\n\t/**\n * Return raw response as Blob\n *\n * @return Promise\n */\n\tblob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n * Decode response as json\n *\n * @return Promise\n */\n\tjson() {\n\t\tvar _this2 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(buffer.toString());\n\t\t\t} catch (err) {\n\t\t\t\treturn Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n * Decode response as text\n *\n * @return Promise\n */\n\ttext() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t},\n\n\t/**\n * Decode response as buffer (non-spec api)\n *\n * @return Promise\n */\n\tbuffer() {\n\t\treturn consumeBody.call(this);\n\t},\n\n\t/**\n * Decode response as text, while automatically detecting the encoding and\n * trying to decode to UTF-8 (non-spec api)\n *\n * @return Promise\n */\n\ttextConverted() {\n\t\tvar _this3 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn convertBody(buffer, _this3.headers);\n\t\t});\n\t}\n};\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: { enumerable: true },\n\tbodyUsed: { enumerable: true },\n\tarrayBuffer: { enumerable: true },\n\tblob: { enumerable: true },\n\tjson: { enumerable: true },\n\ttext: { enumerable: true }\n});\n\nBody.mixIn = function (proto) {\n\tfor (const name of Object.getOwnPropertyNames(Body.prototype)) {\n\t\t// istanbul ignore else: future proof\n\t\tif (!(name in proto)) {\n\t\t\tconst desc = Object.getOwnPropertyDescriptor(Body.prototype, name);\n\t\t\tObject.defineProperty(proto, name, desc);\n\t\t}\n\t}\n};\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nfunction consumeBody() {\n\tvar _this4 = this;\n\n\tif (this[INTERNALS].disturbed) {\n\t\treturn Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));\n\t}\n\n\tthis[INTERNALS].disturbed = true;\n\n\tif (this[INTERNALS].error) {\n\t\treturn Body.Promise.reject(this[INTERNALS].error);\n\t}\n\n\tlet body = this.body;\n\n\t// body is null\n\tif (body === null) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is blob\n\tif (isBlob(body)) {\n\t\tbody = body.stream();\n\t}\n\n\t// body is buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn Body.Promise.resolve(body);\n\t}\n\n\t// istanbul ignore if: should never happen\n\tif (!(body instanceof Stream)) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is stream\n\t// get ready to actually consume the body\n\tlet accum = [];\n\tlet accumBytes = 0;\n\tlet abort = false;\n\n\treturn new Body.Promise(function (resolve, reject) {\n\t\tlet resTimeout;\n\n\t\t// allow timeout on slow response body\n\t\tif (_this4.timeout) {\n\t\t\tresTimeout = setTimeout(function () {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));\n\t\t\t}, _this4.timeout);\n\t\t}\n\n\t\t// handle stream errors\n\t\tbody.on('error', function (err) {\n\t\t\tif (err.name === 'AbortError') {\n\t\t\t\t// if the request was aborted, reject with this Error\n\t\t\t\tabort = true;\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\t// other errors, such as incorrect content-encoding\n\t\t\t\treject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\n\t\tbody.on('data', function (chunk) {\n\t\t\tif (abort || chunk === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_this4.size && accumBytes + chunk.length > _this4.size) {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t});\n\n\t\tbody.on('end', function () {\n\t\t\tif (abort) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tclearTimeout(resTimeout);\n\n\t\t\ttry {\n\t\t\t\tresolve(Buffer.concat(accum, accumBytes));\n\t\t\t} catch (err) {\n\t\t\t\t// handle streams that have accumulated too much data (issue #414)\n\t\t\t\treject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect buffer encoding and convert to target encoding\n * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding\n *\n * @param Buffer buffer Incoming buffer\n * @param String encoding Target encoding\n * @return String\n */\nfunction convertBody(buffer, headers) {\n\tif (typeof convert !== 'function') {\n\t\tthrow new Error('The package `encoding` must be installed to use the textConverted() function');\n\t}\n\n\tconst ct = headers.get('content-type');\n\tlet charset = 'utf-8';\n\tlet res, str;\n\n\t// header\n\tif (ct) {\n\t\tres = /charset=([^;]*)/i.exec(ct);\n\t}\n\n\t// no charset in content type, peek at response body for at most 1024 bytes\n\tstr = buffer.slice(0, 1024).toString();\n\n\t// html5\n\tif (!res && str) {\n\t\tres = / 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\n\t\tthis[MAP] = Object.create(null);\n\n\t\tif (init instanceof Headers) {\n\t\t\tconst rawHeaders = init.raw();\n\t\t\tconst headerNames = Object.keys(rawHeaders);\n\n\t\t\tfor (const headerName of headerNames) {\n\t\t\t\tfor (const value of rawHeaders[headerName]) {\n\t\t\t\t\tthis.append(headerName, value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't worry about converting prop to ByteString here as append()\n\t\t// will handle it.\n\t\tif (init == null) ; else if (typeof init === 'object') {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\tif (method != null) {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// sequence>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tconst pairs = [];\n\t\t\t\tfor (const pair of init) {\n\t\t\t\t\tif (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be iterable');\n\t\t\t\t\t}\n\t\t\t\t\tpairs.push(Array.from(pair));\n\t\t\t\t}\n\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t}\n\t\t\t\t\tthis.append(pair[0], pair[1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// record\n\t\t\t\tfor (const key of Object.keys(init)) {\n\t\t\t\t\tconst value = init[key];\n\t\t\t\t\tthis.append(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Provided initializer must be an object');\n\t\t}\n\t}\n\n\t/**\n * Return combined header value given name\n *\n * @param String name Header name\n * @return Mixed\n */\n\tget(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key === undefined) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this[MAP][key].join(', ');\n\t}\n\n\t/**\n * Iterate over all headers\n *\n * @param Function callback Executed for each item with parameters (value, name, thisArg)\n * @param Boolean thisArg `this` context for callback function\n * @return Void\n */\n\tforEach(callback) {\n\t\tlet thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\tlet pairs = getHeaders(this);\n\t\tlet i = 0;\n\t\twhile (i < pairs.length) {\n\t\t\tvar _pairs$i = pairs[i];\n\t\t\tconst name = _pairs$i[0],\n\t\t\t value = _pairs$i[1];\n\n\t\t\tcallback.call(thisArg, value, name, this);\n\t\t\tpairs = getHeaders(this);\n\t\t\ti++;\n\t\t}\n\t}\n\n\t/**\n * Overwrite header values given name\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tset(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}\n\n\t/**\n * Append a value onto existing header\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tappend(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tthis[MAP][key].push(value);\n\t\t} else {\n\t\t\tthis[MAP][name] = [value];\n\t\t}\n\t}\n\n\t/**\n * Check for header name existence\n *\n * @param String name Header name\n * @return Boolean\n */\n\thas(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}\n\n\t/**\n * Delete all header values given name\n *\n * @param String name Header name\n * @return Void\n */\n\tdelete(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tdelete this[MAP][key];\n\t\t}\n\t}\n\n\t/**\n * Return raw headers (non-spec api)\n *\n * @return Object\n */\n\traw() {\n\t\treturn this[MAP];\n\t}\n\n\t/**\n * Get an iterator on keys.\n *\n * @return Iterator\n */\n\tkeys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}\n\n\t/**\n * Get an iterator on values.\n *\n * @return Iterator\n */\n\tvalues() {\n\t\treturn createHeadersIterator(this, 'value');\n\t}\n\n\t/**\n * Get an iterator on entries.\n *\n * This is the default iterator of the Headers object.\n *\n * @return Iterator\n */\n\t[Symbol.iterator]() {\n\t\treturn createHeadersIterator(this, 'key+value');\n\t}\n}\nHeaders.prototype.entries = Headers.prototype[Symbol.iterator];\n\nObject.defineProperty(Headers.prototype, Symbol.toStringTag, {\n\tvalue: 'Headers',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Headers.prototype, {\n\tget: { enumerable: true },\n\tforEach: { enumerable: true },\n\tset: { enumerable: true },\n\tappend: { enumerable: true },\n\thas: { enumerable: true },\n\tdelete: { enumerable: true },\n\tkeys: { enumerable: true },\n\tvalues: { enumerable: true },\n\tentries: { enumerable: true }\n});\n\nfunction getHeaders(headers) {\n\tlet kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';\n\n\tconst keys = Object.keys(headers[MAP]).sort();\n\treturn keys.map(kind === 'key' ? function (k) {\n\t\treturn k.toLowerCase();\n\t} : kind === 'value' ? function (k) {\n\t\treturn headers[MAP][k].join(', ');\n\t} : function (k) {\n\t\treturn [k.toLowerCase(), headers[MAP][k].join(', ')];\n\t});\n}\n\nconst INTERNAL = Symbol('internal');\n\nfunction createHeadersIterator(target, kind) {\n\tconst iterator = Object.create(HeadersIteratorPrototype);\n\titerator[INTERNAL] = {\n\t\ttarget,\n\t\tkind,\n\t\tindex: 0\n\t};\n\treturn iterator;\n}\n\nconst HeadersIteratorPrototype = Object.setPrototypeOf({\n\tnext() {\n\t\t// istanbul ignore if\n\t\tif (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {\n\t\t\tthrow new TypeError('Value of `this` is not a HeadersIterator');\n\t\t}\n\n\t\tvar _INTERNAL = this[INTERNAL];\n\t\tconst target = _INTERNAL.target,\n\t\t kind = _INTERNAL.kind,\n\t\t index = _INTERNAL.index;\n\n\t\tconst values = getHeaders(target, kind);\n\t\tconst len = values.length;\n\t\tif (index >= len) {\n\t\t\treturn {\n\t\t\t\tvalue: undefined,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t}\n\n\t\tthis[INTERNAL].index = index + 1;\n\n\t\treturn {\n\t\t\tvalue: values[index],\n\t\t\tdone: false\n\t\t};\n\t}\n}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));\n\nObject.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {\n\tvalue: 'HeadersIterator',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * Export the Headers object in a form that Node.js can consume.\n *\n * @param Headers headers\n * @return Object\n */\nfunction exportNodeCompatibleHeaders(headers) {\n\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\n\n\t// http.request() only supports string as Host header. This hack makes\n\t// specifying custom Host header possible.\n\tconst hostHeaderKey = find(headers[MAP], 'Host');\n\tif (hostHeaderKey !== undefined) {\n\t\tobj[hostHeaderKey] = obj[hostHeaderKey][0];\n\t}\n\n\treturn obj;\n}\n\n/**\n * Create a Headers object from an object of headers, ignoring those that do\n * not conform to HTTP grammar productions.\n *\n * @param Object obj Object of headers\n * @return Headers\n */\nfunction createHeadersLenient(obj) {\n\tconst headers = new Headers();\n\tfor (const name of Object.keys(obj)) {\n\t\tif (invalidTokenRegex.test(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(obj[name])) {\n\t\t\tfor (const val of obj[name]) {\n\t\t\t\tif (invalidHeaderCharRegex.test(val)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (headers[MAP][name] === undefined) {\n\t\t\t\t\theaders[MAP][name] = [val];\n\t\t\t\t} else {\n\t\t\t\t\theaders[MAP][name].push(val);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!invalidHeaderCharRegex.test(obj[name])) {\n\t\t\theaders[MAP][name] = [obj[name]];\n\t\t}\n\t}\n\treturn headers;\n}\n\nconst INTERNALS$1 = Symbol('Response internals');\n\n// fix an issue where \"STATUS_CODES\" aren't a named export for node <10\nconst STATUS_CODES = http.STATUS_CODES;\n\n/**\n * Response class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nclass Response {\n\tconstructor() {\n\t\tlet body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\t\tlet opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tBody.call(this, body, opts);\n\n\t\tconst status = opts.status || 200;\n\t\tconst headers = new Headers(opts.headers);\n\n\t\tif (body != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS$1] = {\n\t\t\turl: opts.url,\n\t\t\tstatus,\n\t\t\tstatusText: opts.statusText || STATUS_CODES[status],\n\t\t\theaders,\n\t\t\tcounter: opts.counter\n\t\t};\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS$1].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS$1].status;\n\t}\n\n\t/**\n * Convenience property representing if the request ended normally\n */\n\tget ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS$1].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS$1].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$1].headers;\n\t}\n\n\t/**\n * Clone this response\n *\n * @return Response\n */\n\tclone() {\n\t\treturn new Response(clone(this), {\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected\n\t\t});\n\t}\n}\n\nBody.mixIn(Response.prototype);\n\nObject.defineProperties(Response.prototype, {\n\turl: { enumerable: true },\n\tstatus: { enumerable: true },\n\tok: { enumerable: true },\n\tredirected: { enumerable: true },\n\tstatusText: { enumerable: true },\n\theaders: { enumerable: true },\n\tclone: { enumerable: true }\n});\n\nObject.defineProperty(Response.prototype, Symbol.toStringTag, {\n\tvalue: 'Response',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nconst INTERNALS$2 = Symbol('Request internals');\n\n// fix an issue where \"format\", \"parse\" aren't a named export for node <10\nconst parse_url = Url.parse;\nconst format_url = Url.format;\n\nconst streamDestructionSupported = 'destroy' in Stream.Readable.prototype;\n\n/**\n * Check if a value is an instance of Request.\n *\n * @param Mixed input\n * @return Boolean\n */\nfunction isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}\n\nfunction isAbortSignal(signal) {\n\tconst proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);\n\treturn !!(proto && proto.constructor.name === 'AbortSignal');\n}\n\n/**\n * Request class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nclass Request {\n\tconstructor(input) {\n\t\tlet init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tlet parsedURL;\n\n\t\t// normalize input\n\t\tif (!isRequest(input)) {\n\t\t\tif (input && input.href) {\n\t\t\t\t// in order to support Node.js' Url objects; though WHATWG's URL objects\n\t\t\t\t// will fall into this branch also (since their `toString()` will return\n\t\t\t\t// `href` property anyway)\n\t\t\t\tparsedURL = parse_url(input.href);\n\t\t\t} else {\n\t\t\t\t// coerce input to a string before attempting to parse\n\t\t\t\tparsedURL = parse_url(`${input}`);\n\t\t\t}\n\t\t\tinput = {};\n\t\t} else {\n\t\t\tparsedURL = parse_url(input.url);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tmethod = method.toUpperCase();\n\n\t\tif ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tlet inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;\n\n\t\tBody.call(this, inputBody, {\n\t\t\ttimeout: init.timeout || input.timeout || 0,\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ? input.signal : null;\n\t\tif ('signal' in init) signal = init.signal;\n\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal');\n\t\t}\n\n\t\tthis[INTERNALS$2] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal\n\t\t};\n\n\t\t// node-fetch-only options\n\t\tthis.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;\n\t\tthis.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t}\n\n\tget method() {\n\t\treturn this[INTERNALS$2].method;\n\t}\n\n\tget url() {\n\t\treturn format_url(this[INTERNALS$2].parsedURL);\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$2].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS$2].redirect;\n\t}\n\n\tget signal() {\n\t\treturn this[INTERNALS$2].signal;\n\t}\n\n\t/**\n * Clone this request\n *\n * @return Request\n */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n}\n\nBody.mixIn(Request.prototype);\n\nObject.defineProperty(Request.prototype, Symbol.toStringTag, {\n\tvalue: 'Request',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Request.prototype, {\n\tmethod: { enumerable: true },\n\turl: { enumerable: true },\n\theaders: { enumerable: true },\n\tredirect: { enumerable: true },\n\tclone: { enumerable: true },\n\tsignal: { enumerable: true }\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param Request A Request instance\n * @return Object The options object to be passed to http.request\n */\nfunction getNodeRequestOptions(request) {\n\tconst parsedURL = request[INTERNALS$2].parsedURL;\n\tconst headers = new Headers(request[INTERNALS$2].headers);\n\n\t// fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// Basic fetch\n\tif (!parsedURL.protocol || !parsedURL.hostname) {\n\t\tthrow new TypeError('Only absolute URLs are supported');\n\t}\n\n\tif (!/^https?:$/.test(parsedURL.protocol)) {\n\t\tthrow new TypeError('Only HTTP(S) protocols are supported');\n\t}\n\n\tif (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {\n\t\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\tif (request.body != null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\tif (typeof totalBytes === 'number') {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate');\n\t}\n\n\tlet agent = request.agent;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\tif (!headers.has('Connection') && !agent) {\n\t\theaders.set('Connection', 'close');\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\treturn Object.assign({}, parsedURL, {\n\t\tmethod: request.method,\n\t\theaders: exportNodeCompatibleHeaders(headers),\n\t\tagent\n\t});\n}\n\n/**\n * abort-error.js\n *\n * AbortError interface for cancelled requests\n */\n\n/**\n * Create AbortError instance\n *\n * @param String message Error message for human\n * @return AbortError\n */\nfunction AbortError(message) {\n Error.call(this, message);\n\n this.type = 'aborted';\n this.message = message;\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nAbortError.prototype = Object.create(Error.prototype);\nAbortError.prototype.constructor = AbortError;\nAbortError.prototype.name = 'AbortError';\n\n// fix an issue where \"PassThrough\", \"resolve\" aren't a named export for node <10\nconst PassThrough$1 = Stream.PassThrough;\nconst resolve_url = Url.resolve;\n\n/**\n * Fetch function\n *\n * @param Mixed url Absolute url or Request instance\n * @param Object opts Fetch options\n * @return Promise\n */\nfunction fetch(url, opts) {\n\n\t// allow custom promise\n\tif (!fetch.Promise) {\n\t\tthrow new Error('native promise missing, set fetch.Promise to your favorite alternative');\n\t}\n\n\tBody.Promise = fetch.Promise;\n\n\t// wrap http.request into fetch\n\treturn new fetch.Promise(function (resolve, reject) {\n\t\t// build request object\n\t\tconst request = new Request(url, opts);\n\t\tconst options = getNodeRequestOptions(request);\n\n\t\tconst send = (options.protocol === 'https:' ? https : http).request;\n\t\tconst signal = request.signal;\n\n\t\tlet response = null;\n\n\t\tconst abort = function abort() {\n\t\t\tlet error = new AbortError('The user aborted a request.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\trequest.body.destroy(error);\n\t\t\t}\n\t\t\tif (!response || !response.body) return;\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = function abortAndFinalize() {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// send request\n\t\tconst req = send(options);\n\t\tlet reqTimeout;\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tfunction finalize() {\n\t\t\treq.abort();\n\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\tclearTimeout(reqTimeout);\n\t\t}\n\n\t\tif (request.timeout) {\n\t\t\treq.once('socket', function (socket) {\n\t\t\t\treqTimeout = setTimeout(function () {\n\t\t\t\t\treject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));\n\t\t\t\t\tfinalize();\n\t\t\t\t}, request.timeout);\n\t\t\t});\n\t\t}\n\n\t\treq.on('error', function (err) {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\n\t\t\tfinalize();\n\t\t});\n\n\t\treq.on('response', function (res) {\n\t\t\tclearTimeout(reqTimeout);\n\n\t\t\tconst headers = createHeadersLenient(res.headers);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (fetch.isRedirect(res.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tconst locationURL = location === null ? null : resolve_url(request.url, location);\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\n\t\t\t\t\t\tif (locationURL !== null) {\n\t\t\t\t\t\t\t// handle corrupted header\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\theaders.set('Location', locationURL);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request\n\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow':\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOpts = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: request.body,\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\ttimeout: request.timeout,\n\t\t\t\t\t\t\tsize: request.size\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {\n\t\t\t\t\t\t\trequestOpts.method = 'GET';\n\t\t\t\t\t\t\trequestOpts.body = undefined;\n\t\t\t\t\t\t\trequestOpts.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOpts)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// prepare response\n\t\t\tres.once('end', function () {\n\t\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\t});\n\t\t\tlet body = res.pipe(new PassThrough$1());\n\n\t\t\tconst response_options = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: res.statusCode,\n\t\t\t\tstatusText: res.statusMessage,\n\t\t\t\theaders: headers,\n\t\t\t\tsize: request.size,\n\t\t\t\ttimeout: request.timeout,\n\t\t\t\tcounter: request.counter\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// for gzip\n\t\t\tif (codings == 'gzip' || codings == 'x-gzip') {\n\t\t\t\tbody = body.pipe(zlib.createGunzip(zlibOptions));\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for deflate\n\t\t\tif (codings == 'deflate' || codings == 'x-deflate') {\n\t\t\t\t// handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = res.pipe(new PassThrough$1());\n\t\t\t\traw.once('data', function (chunk) {\n\t\t\t\t\t// see http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflate());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflateRaw());\n\t\t\t\t\t}\n\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for br\n\t\t\tif (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {\n\t\t\t\tbody = body.pipe(zlib.createBrotliDecompress());\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// otherwise, use response as-is\n\t\t\tresponse = new Response(body, response_options);\n\t\t\tresolve(response);\n\t\t});\n\n\t\twriteToStream(req, request);\n\t});\n}\n/**\n * Redirect code matching\n *\n * @param Number code Status code\n * @return Boolean\n */\nfetch.isRedirect = function (code) {\n\treturn code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n};\n\n// expose Promise\nfetch.Promise = global.Promise;\n\nexport default fetch;\nexport { Headers, Request, Response, FetchError };\n","var nodeFetch = require('node-fetch')\nvar realFetch = nodeFetch.default || nodeFetch\n\nvar fetch = function (url, options) {\n // Support schemaless URIs on the server for parity with the browser.\n // Ex: //github.com/ -> https://github.com/\n if (/^\\/\\//.test(url)) {\n url = 'https:' + url\n }\n return realFetch.call(this, url, options)\n}\n\nmodule.exports = exports = fetch\nexports.fetch = fetch\nexports.Headers = nodeFetch.Headers\nexports.Request = nodeFetch.Request\nexports.Response = nodeFetch.Response\n\n// Needed for TypeScript consumers without esModuleInterop.\nexports.default = fetch\n","import fetch from \"cross-fetch\";\nimport JSBI from \"jsbi\";\n\nfunction mergeOptions(overrideOptions, defaultOptions) {\n defaultOptions = defaultOptions || {};\n const headers = Object.assign(\n {},\n defaultOptions.headers || {},\n overrideOptions.headers || {}\n );\n return Object.assign({}, defaultOptions, overrideOptions, {\n headers: headers\n });\n}\n\nconst batchHandler = {\n get: (target, method, receiver) => {\n if (method === \"send\") {\n return async () => {\n const response = await fetch(\n target.uri,\n mergeOptions(\n {\n method: \"post\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(target.payload)\n },\n target.defaultOptions\n )\n );\n return await response.json();\n };\n }\n return (...params) => {\n const id = target.id;\n target.id = target.id + 1;\n target.payload.push({\n jsonrpc: \"2.0\",\n id: id,\n method: method,\n params: params\n });\n return receiver;\n };\n }\n};\n\nconst handler = {\n get: (target, method) => {\n if (method === \"batch\") {\n return () => {\n return new Proxy(\n {\n id: Math.round(Math.random() * 10000000),\n payload: [],\n uri: target.uri,\n defaultOptions: target.defaultOptions\n },\n batchHandler\n );\n };\n }\n return async (...params) => {\n const id = Math.round(Math.random() * 10000000);\n const response = await fetch(\n target.uri,\n mergeOptions(\n {\n method: \"post\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n jsonrpc: \"2.0\",\n id: id,\n method: method,\n params: params\n })\n },\n target.defaultOptions\n )\n );\n const data = await response.json();\n if (data.id !== id) {\n throw new Error(\"JSONRPCError: response ID does not match request ID!\");\n }\n if (data.error) {\n throw new Error(\n `JSONRPCError: server error ${JSON.stringify(data.error)}`\n );\n }\n return data.result;\n };\n }\n};\n\nexport class RPC {\n constructor(uri, defaultOptions = {}) {\n this.uri = uri;\n this.defaultOptions = defaultOptions;\n return new Proxy(this, handler);\n }\n\n static create(uri) {\n return new RPC(uri);\n }\n}\n\nexport function HexStringToBigInt(hexString) {\n return JSBI.BigInt(hexString);\n}\n\nexport function BigIntToHexString(bigInt) {\n return \"0x\" + bigInt.toString(16);\n}\n","// This package provides normalizer functions. Even though CKB uses molecule\n// as the serialization layer. There is still CKB specific knowledge that does\n// not belong in molecule. For example, all numbers in CKB protocols are\n// serialized using little endian format. This package tries to encode such\n// knowledge. The goal here, is that you are free to use whatever types that\n// makes most sense to represent the values. As long as you pass your object\n// through the normalizers here, molecule should be able to serialize the values\n// into correct formats required by CKB.\n//\n// Note this is only used when you need to deal with CKB structures in molecule\n// format. If you are using RPCs or GraphQL to interact with CKB, chances are you\n// will not need this package.\nimport JSBI from \"jsbi\";\nimport { Reader } from \"./reader\";\nimport { BigIntToHexString } from \"./rpc\";\n\nfunction normalizeHexNumber(length) {\n return function(debugPath, value) {\n if (!(value instanceof ArrayBuffer)) {\n let intValue = BigIntToHexString(JSBI.BigInt(value)).substr(2);\n if (intValue.length % 2 !== 0) {\n intValue = \"0\" + intValue;\n }\n if (intValue.length / 2 > length) {\n throw new Error(\n `${debugPath} is ${intValue.length /\n 2} bytes long, expected length is ${length}!`\n );\n }\n const view = new DataView(new ArrayBuffer(length));\n for (let i = 0; i < intValue.length / 2; i++) {\n const start = intValue.length - (i + 1) * 2;\n view.setUint8(i, parseInt(intValue.substr(start, 2), 16));\n }\n value = view.buffer;\n }\n if (value.byteLength < length) {\n const array = new Uint8Array(length);\n array.set(new Uint8Array(value), 0);\n value = array.buffer;\n }\n return value;\n };\n}\n\nfunction normalizeRawData(length) {\n return function(debugPath, value) {\n value = new Reader(value).toArrayBuffer();\n if (length > 0 && value.byteLength !== length) {\n throw new Error(\n `${debugPath} has invalid length ${value.byteLength}, required: ${length}`\n );\n }\n return value;\n };\n}\n\nfunction normalizeObject(debugPath, object, keys) {\n const result = {};\n\n for (const [key, f] of Object.entries(keys)) {\n const value = object[key];\n if (!value) {\n throw new Error(`${debugPath} is missing ${key}!`);\n }\n result[key] = f(`${debugPath}.${key}`, value);\n }\n return result;\n}\n\nexport function NormalizeScript(script, { debugPath = \"script\" } = {}) {\n return normalizeObject(debugPath, script, {\n code_hash: normalizeRawData(32),\n hash_type: function(debugPath, value) {\n switch (value) {\n case \"data\":\n return 0;\n case \"type\":\n return 1;\n case 0:\n return value;\n case 1:\n return value;\n default:\n throw new Error(`${debugPath}.hash_type has invalid value: ${value}`);\n }\n },\n args: normalizeRawData(-1)\n });\n}\n\nexport function NormalizeOutPoint(outPoint, { debugPath = \"out_point\" } = {}) {\n return normalizeObject(debugPath, outPoint, {\n tx_hash: normalizeRawData(32),\n index: normalizeHexNumber(4)\n });\n}\n\nfunction toNormalize(normalize) {\n return function(debugPath, value) {\n return normalize(value, {\n debugPath\n });\n };\n}\n\nexport function NormalizeCellInput(\n cellInput,\n { debugPath = \"cell_input\" } = {}\n) {\n return normalizeObject(debugPath, cellInput, {\n since: normalizeHexNumber(8),\n previous_output: toNormalize(NormalizeOutPoint)\n });\n}\n\nexport function NormalizeCellOutput(\n cellOutput,\n { debugPath = \"cell_output\" } = {}\n) {\n const result = normalizeObject(debugPath, cellOutput, {\n capacity: normalizeHexNumber(8),\n lock: toNormalize(NormalizeScript)\n });\n if (cellOutput.type) {\n result.type_ = NormalizeScript(cellOutput.type, {\n debugPath: `${debugPath}.type`\n });\n }\n return result;\n}\n\nexport function NormalizeCellDep(cellDep, { debugPath = \"cell_dep\" } = {}) {\n return normalizeObject(debugPath, cellDep, {\n out_point: toNormalize(NormalizeOutPoint),\n dep_type: function(debugPath, value) {\n switch (value) {\n case \"code\":\n return 0;\n case \"dep_group\":\n return 1;\n case 0:\n return value;\n case 1:\n return value;\n default:\n throw new Error(`${debugPath}.dep_type has invalid value: ${value}`);\n }\n }\n });\n}\n\nfunction toNormalizeArray(normalizeFunction) {\n return function(debugPath, array) {\n return array.map((item, i) => {\n return normalizeFunction(`${debugPath}[${i}]`, item);\n });\n };\n}\n\nexport function NormalizeRawTransaction(\n rawTransaction,\n { debugPath = \"raw_transaction\" } = {}\n) {\n return normalizeObject(debugPath, rawTransaction, {\n version: normalizeHexNumber(4),\n cell_deps: toNormalizeArray(toNormalize(NormalizeCellDep)),\n header_deps: toNormalizeArray(normalizeRawData(32)),\n inputs: toNormalizeArray(toNormalize(NormalizeCellInput)),\n outputs: toNormalizeArray(toNormalize(NormalizeCellOutput)),\n outputs_data: toNormalizeArray(normalizeRawData(-1))\n });\n}\n\nexport function NormalizeTransaction(\n transaction,\n { debugPath = \"transaction\" } = {}\n) {\n const rawTransaction = NormalizeRawTransaction(transaction, {\n debugPath: `(raw)${debugPath}`\n });\n const result = normalizeObject(debugPath, transaction, {\n witnesses: toNormalizeArray(normalizeRawData(-1))\n });\n result.raw = rawTransaction;\n return result;\n}\n\nexport function NormalizeRawHeader(\n rawHeader,\n { debugPath = \"raw_header\" } = {}\n) {\n return normalizeObject(debugPath, rawHeader, {\n version: normalizeHexNumber(4),\n compact_target: normalizeHexNumber(4),\n timestamp: normalizeHexNumber(8),\n number: normalizeHexNumber(8),\n epoch: normalizeHexNumber(8),\n parent_hash: normalizeRawData(32),\n transactions_root: normalizeRawData(32),\n proposals_hash: normalizeRawData(32),\n uncles_hash: normalizeRawData(32),\n dao: normalizeRawData(32)\n });\n}\n\nexport function NormalizeHeader(header, { debugPath = \"header\" } = {}) {\n const rawHeader = NormalizeRawHeader(header, {\n debugPath: `(raw)${debugPath}`\n });\n const result = normalizeObject(debugPath, header, {\n nonce: normalizeHexNumber(16)\n });\n result.raw = rawHeader;\n return result;\n}\n\nexport function NormalizeUncleBlock(\n uncleBlock,\n { debugPath = \"uncle_block\" } = {}\n) {\n return normalizeObject(debugPath, uncleBlock, {\n header: toNormalize(NormalizeHeader),\n proposals: toNormalizeArray(normalizeRawData(10))\n });\n}\n\nexport function NormalizeBlock(block, { debugPath = \"block\" } = {}) {\n return normalizeObject(debugPath, block, {\n header: toNormalize(NormalizeHeader),\n uncles: toNormalizeArray(toNormalize(NormalizeUncleBlock)),\n transactions: toNormalizeArray(toNormalize(NormalizeTransaction)),\n proposals: toNormalizeArray(normalizeRawData(10))\n });\n}\n\nexport function NormalizeCellbaseWitness(\n cellbaseWitness,\n { debugPath = \"cellbase_witness\" } = {}\n) {\n return normalizeObject(debugPath, cellbaseWitness, {\n lock: toNormalize(NormalizeScript),\n message: normalizeRawData(-1)\n });\n}\n\nexport function NormalizeWitnessArgs(\n witnessArgs,\n { debugPath = \"witness_args\" } = {}\n) {\n const result = {};\n if (witnessArgs.lock) {\n result.lock = normalizeRawData(-1)(`${debugPath}.lock`, witnessArgs.lock);\n }\n if (witnessArgs.input_type) {\n result.input_type = normalizeRawData(-1)(\n `${debugPath}.input_type`,\n witnessArgs.input_type\n );\n }\n if (witnessArgs.output_type) {\n result.output_type = normalizeRawData(-1)(\n `${debugPath}.output_type`,\n witnessArgs.output_type\n );\n }\n return result;\n}\n","// This package provides transformer functions that transform JavaScript objects\n// into JSON ready objects that can be passed to RPC. It following the following\n// rules:\n//\n// 1. If the specified object has a serializeJson method, it would invoke this\n// method and use the result to replace current object.\n// 2. It then restricts the keys of the object to keys required by the specified\n// entity(i.e., a Script would only have code_hash, hash_type, args keys),for each\n// sub-field, it then recursively perform the steps here from step 1.\n// 3. It then optionally run validator functions to ensure the resulting object\n// follows specified rules.\n//\n// Note rule 1 here provides the flexibility in defining your own structures: you\n// could define a class containing custom data structures, then provide a\n// serializeJson that transforms the custom one into the rigid data structure\n// required by CKB. You can also leverage the Reader class we provide as much as\n// possible. Since Reader class does provide serializeJson methods, transformers\n// here will transform them to valid hex strings required by CKB.\nimport * as validators from \"./validators\";\n\nfunction invokeSerializeJson(debugPath, value) {\n if (value instanceof Object && value.serializeJson instanceof Function) {\n return value.serializeJson.call(value);\n }\n return value;\n}\n\nfunction transformObject(debugPath, object, keys) {\n object = invokeSerializeJson(debugPath, object);\n if (!(object instanceof Object)) {\n throw new Error(`Transformed ${debugPath} is not an object!`);\n }\n const result = {};\n\n for (const [key, f] of Object.entries(keys)) {\n let value = object[key];\n if (!value) {\n const camelKey = key.replace(/(_[a-z])/g, group =>\n group.toUpperCase().replace(\"_\", \"\")\n );\n value = object[camelKey];\n }\n if (value) {\n result[key] = f(`${debugPath}.${key}`, value);\n }\n }\n return result;\n}\n\nexport function TransformScript(\n script,\n { validation = true, debugPath = \"script\" } = {}\n) {\n script = transformObject(debugPath, script, {\n code_hash: invokeSerializeJson,\n hash_type: invokeSerializeJson,\n args: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateScript(script, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return script;\n}\n\nexport function TransformOutPoint(\n outPoint,\n { validation = true, debugPath = \"out_point\" } = {}\n) {\n outPoint = transformObject(debugPath, outPoint, {\n tx_hash: invokeSerializeJson,\n index: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateOutPoint(outPoint, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return outPoint;\n}\n\nfunction toInvoke(transform) {\n return function(debugPath, value) {\n return transform(value, {\n validation: false,\n debugPath\n });\n };\n}\n\nexport function TransformCellInput(\n cellInput,\n { validation = true, debugPath = \"cell_input\" } = {}\n) {\n cellInput = transformObject(debugPath, cellInput, {\n since: invokeSerializeJson,\n previous_output: toInvoke(TransformOutPoint)\n });\n\n if (validation) {\n validators.ValidateCellInput(cellInput, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return cellInput;\n}\n\nexport function TransformCellOutput(\n cellOutput,\n { validation = true, debugPath = \"cell_output\" } = {}\n) {\n cellOutput = transformObject(debugPath, cellOutput, {\n capacity: invokeSerializeJson,\n lock: toInvoke(TransformScript),\n type: toInvoke(TransformScript)\n });\n\n if (validation) {\n validators.ValidateCellOutput(cellOutput, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return cellOutput;\n}\n\nexport function TransformCellDep(\n cellDep,\n { validation = true, debugPath = \"cell_dep\" } = {}\n) {\n cellDep = transformObject(debugPath, cellDep, {\n out_point: toInvoke(TransformOutPoint),\n dep_type: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateCellDep(cellDep, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return cellDep;\n}\n\nfunction toInvokeArray(invokeFunction) {\n return function(debugPath, array) {\n return array.map((item, i) => {\n return invokeFunction(`${debugPath}[${i}]`, item);\n });\n };\n}\n\nexport function TransformRawTransaction(\n rawTransaction,\n { validation = true, debugPath = \"raw_transaction\" } = {}\n) {\n rawTransaction = transformObject(debugPath, rawTransaction, {\n version: invokeSerializeJson,\n cell_deps: toInvokeArray(toInvoke(TransformCellDep)),\n header_deps: toInvokeArray(invokeSerializeJson),\n inputs: toInvokeArray(toInvoke(TransformCellInput)),\n outputs: toInvokeArray(toInvoke(TransformCellOutput)),\n outputs_data: toInvokeArray(invokeSerializeJson)\n });\n\n if (validation) {\n validators.ValidateRawTransaction(rawTransaction, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return rawTransaction;\n}\n\nexport function TransformTransaction(\n transaction,\n { validation = true, debugPath = \"transaction\" } = {}\n) {\n transaction = transformObject(debugPath, transaction, {\n version: invokeSerializeJson,\n cell_deps: toInvokeArray(toInvoke(TransformCellDep)),\n header_deps: toInvokeArray(invokeSerializeJson),\n inputs: toInvokeArray(toInvoke(TransformCellInput)),\n outputs: toInvokeArray(toInvoke(TransformCellOutput)),\n outputs_data: toInvokeArray(invokeSerializeJson),\n witnesses: toInvokeArray(invokeSerializeJson)\n });\n\n if (validation) {\n validators.ValidateTransaction(transaction, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return transaction;\n}\n\nexport function TransformRawHeader(\n rawHeader,\n { validation = true, debugPath = \"raw_header\" } = {}\n) {\n rawHeader = transformObject(debugPath, rawHeader, {\n version: invokeSerializeJson,\n compact_target: invokeSerializeJson,\n timestamp: invokeSerializeJson,\n number: invokeSerializeJson,\n epoch: invokeSerializeJson,\n parent_hash: invokeSerializeJson,\n transactions_root: invokeSerializeJson,\n proposals_hash: invokeSerializeJson,\n uncles_hash: invokeSerializeJson,\n dao: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateRawHeader(rawHeader, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return rawHeader;\n}\n\nexport function TransformHeader(\n header,\n { validation = true, debugPath = \"header\" } = {}\n) {\n header = transformObject(debugPath, header, {\n version: invokeSerializeJson,\n compact_target: invokeSerializeJson,\n timestamp: invokeSerializeJson,\n number: invokeSerializeJson,\n epoch: invokeSerializeJson,\n parent_hash: invokeSerializeJson,\n transactions_root: invokeSerializeJson,\n proposals_hash: invokeSerializeJson,\n uncles_hash: invokeSerializeJson,\n dao: invokeSerializeJson,\n nonce: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateHeader(header, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return header;\n}\n\nexport function TransformUncleBlock(\n uncleBlock,\n { validation = true, debugPath = \"uncle_block\" } = {}\n) {\n uncleBlock = transformObject(debugPath, uncleBlock, {\n header: toInvoke(TransformHeader),\n proposals: toInvokeArray(invokeSerializeJson)\n });\n\n if (validation) {\n validators.ValidateUncleBlock(uncleBlock, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return uncleBlock;\n}\n\nexport function TransformBlock(\n block,\n { validation = true, debugPath = \"block\" } = {}\n) {\n block = transformObject(debugPath, block, {\n header: toInvoke(TransformHeader),\n uncles: toInvokeArray(toInvoke(TransformUncleBlock)),\n transactions: toInvokeArray(toInvoke(TransformTransaction)),\n proposals: toInvokeArray(invokeSerializeJson)\n });\n\n if (validation) {\n validators.ValidateBlock(block, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return block;\n}\n\nexport function TransformCellbaseWitness(\n cellbaseWitness,\n { validation = true, debugPath = \"cellbase_witness\" } = {}\n) {\n cellbaseWitness = transformObject(debugPath, cellbaseWitness, {\n lock: toInvoke(TransformScript),\n message: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateCellbaseWitness(cellbaseWitness, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return cellbaseWitness;\n}\n\nexport function TransformWitnessArgs(\n witnessArgs,\n { validation = true, debugPath = \"witness_args\" } = {}\n) {\n witnessArgs = transformObject(debugPath, witnessArgs, {\n lock: invokeSerializeJson,\n input_type: invokeSerializeJson,\n output_type: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateWitnessArgs(witnessArgs, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return witnessArgs;\n}\n","import JSBI from \"jsbi\";\nimport { Reader } from \"../reader\";\nimport { HexStringToBigInt, BigIntToHexString } from \"../rpc\";\n\nexport class RPCCollector {\n constructor(\n rpc,\n lockHash,\n {\n skipCellWithContent = true,\n loadData = false,\n loadBlockNumber = true\n } = {}\n ) {\n this.rpc = rpc;\n this.lockHash = new Reader(lockHash).serializeJson();\n this.skipCellWithContent = skipCellWithContent;\n this.loadData = loadData;\n this.loadBlockNumber = loadBlockNumber;\n }\n\n async *collect() {\n const to = HexStringToBigInt(await this.rpc.get_tip_block_number());\n let currentFrom = JSBI.BigInt(0);\n while (JSBI.lessThanOrEqual(currentFrom, to)) {\n let currentTo = JSBI.add(currentFrom, JSBI.BigInt(100));\n if (JSBI.greaterThan(currentTo, to)) {\n currentTo = to;\n }\n const cells = await this.rpc.get_cells_by_lock_hash(\n this.lockHash,\n BigIntToHexString(currentFrom),\n BigIntToHexString(currentTo)\n );\n for (const cell of cells) {\n if (this.skipCellWithContent) {\n if (\n cell.type ||\n JSBI.greaterThan(\n HexStringToBigInt(cell.output_data_len),\n JSBI.BigInt(100)\n )\n ) {\n continue;\n }\n }\n let data = null;\n if (this.loadData) {\n const cellWithData = await this.rpc.get_live_cell(\n cell.out_point,\n true\n );\n data = cellWithData.cell.data.content;\n }\n let block_number = null;\n if (this.loadBlockNumber) {\n const header = await this.rpc.get_header(cell.block_hash);\n block_number = header.number;\n }\n yield {\n cellbase: cell.cellbase,\n cell_output: {\n capacity: cell.capacity,\n lock: cell.lock,\n type: cell.type\n },\n out_point: cell.out_point,\n block_hash: cell.block_hash,\n data: data,\n output_data_len: cell.output_data_len,\n block_number\n };\n }\n currentFrom = JSBI.add(currentTo, JSBI.BigInt(1));\n }\n }\n}\n","import JSBI from \"jsbi\";\nimport { Reader } from \"./reader\";\nimport { ValidateTransaction, ValidateOutPoint } from \"./validators\";\n\nexport class TransactionDumper {\n constructor(\n rpc,\n { validateTransaction = true, depGroupUnpacker = null } = {}\n ) {\n this.rpc = rpc;\n this.validateTransaction = validateTransaction;\n this.depGroupUnpacker = depGroupUnpacker;\n }\n\n async dumpByHash(txHash) {\n const tx = (await this.rpc.get_transaction(txHash)).transaction;\n delete tx.hash;\n return await this.dump(tx);\n }\n\n async dump(tx) {\n if (this.validateTransaction) {\n ValidateTransaction(tx);\n }\n const mockInputs = [];\n for (const input of tx.inputs) {\n const { output, data, header } = await this._resolveOutPoint(\n input.previous_output\n );\n mockInputs.push({ input, output, data, header });\n }\n const mockCellDeps = [];\n for (const cellDep of tx.cell_deps) {\n const { output, data, header } = await this._resolveOutPoint(\n cellDep.out_point\n );\n mockCellDeps.push({\n cell_dep: cellDep,\n output,\n data,\n header\n });\n if (cellDep.dep_type === \"dep_group\") {\n if (!this.depGroupUnpacker) {\n throw new Error(\n \"depGroupUnpacker must be provided when the transaction contains dep_group!\"\n );\n }\n const outPoints = this.depGroupUnpacker(new Reader(data));\n for (const outPoint of outPoints) {\n ValidateOutPoint(outPoint);\n const { output, data, header } = await this._resolveOutPoint(\n outPoint\n );\n mockCellDeps.push({\n cell_dep: {\n out_point: outPoint,\n dep_type: \"code\"\n },\n output,\n data,\n header\n });\n }\n }\n }\n const mockHeaderDeps = [];\n for (const headerDep of tx.header_deps) {\n mockHeaderDeps.push(await this.rpc.get_header(headerDep));\n }\n return JSON.stringify({\n mock_info: {\n inputs: mockInputs,\n cell_deps: mockCellDeps,\n header_deps: mockHeaderDeps\n },\n tx\n });\n }\n\n async _resolveOutPoint(out_point) {\n const txStatus = await this.rpc.get_transaction(out_point.tx_hash);\n if (!txStatus || !txStatus.transaction) {\n throw new Error(`Transaction ${out_point.tx_hash} cannot be found!`);\n }\n const tx = txStatus.transaction;\n const index = JSBI.toNumber(JSBI.BigInt(out_point.index));\n if (index >= tx.outputs.length) {\n throw new Error(\n `Transaction ${out_point.tx_hash} does not have output ${index}!`\n );\n }\n const data = {\n output: tx.outputs[index],\n data: tx.outputs_data[index]\n };\n if (txStatus.tx_status.status === \"committed\") {\n data.header = txStatus.tx_status.block_hash;\n }\n return data;\n }\n}\n","export { Reader } from \"./reader.js\";\nexport { TransactionDumper } from \"./transaction_dumper.js\";\nexport { RPC, HexStringToBigInt, BigIntToHexString } from \"./rpc.js\";\nexport * as normalizers from \"./normalizers\";\nexport * as transformers from \"./transformers\";\nexport * as validators from \"./validators\";\nexport * as cell_collectors from \"./cell_collectors\";\nexport const VERSION = \"__development_build__\";\n"],"names":["ArrayBufferReader","[object Object]","buffer","this","view","DataView","byteLength","i","getUint8","Array","prototype","map","call","Uint8Array","x","toString","slice","join","HexStringReader","string","length","parseInt","substr","ArrayBuffer","setUint8","indexAt","Reader","input","startsWith","Error","c","charCodeAt","JSBI","a","b","__kMaxLength","RangeError","super","sign","Math","floor","Number","isFinite","__zero","__oneDigit","__fromDouble","__fromString","SyntaxError","constructor","__toPrimitive","BigInt","TypeError","push","__toStringBasePowerOfTwo","__toStringGeneric","clz32","__unsignedDigit","d","__digit","e","f","Infinity","g","h","j","k","l","m","n","o","__decideRounding","p","__kBitConversionInts","__kBitConversionDouble","__copy","__absoluteSubOne","__trim","__absoluteAddOne","unaryMinus","__kMaxLengthBits","__initializeDigits","__setDigit","multiply","__clzmsd","__multiplyAccumulate","__absoluteCompare","__absoluteDivSmall","__absoluteDivLarge","__absoluteModSmall","__absoluteAdd","__absoluteSub","__rightShiftByAbsolute","__leftShiftByAbsolute","__compareToBigInt","equal","max","__absoluteAnd","__absoluteOr","__absoluteAndNot","__absoluteXor","__truncateToNBits","__truncateAndSubFromPowerOfTwo","__toNumeric","__isBigInt","add","__compare","EQ","__equalToNumber","pop","__isWhitespace","__kMaxBitsPerChar","__kBitsPerCharTableMultiplier","__kBitsPerCharTableShift","__fillFromParts","q","__inplaceMultiplyAdd","__kConversionChars","exponentiate","__halfDigit","__setHalfDigit","quotient","remainder","__unequalSign","__absoluteGreater","__absoluteLess","abs","__compareToDouble","__comparisonResultToBool","__compareToNumber","__setDigitGrow","imul","r","s","t","__halfDigitLength","__clz16","__specialLeftShift","__internalMultiplyAdd","__inplaceSub","__inplaceAdd","__inplaceRightShift","__toShiftAmount","__rightShiftByMaximum","Symbol","toPrimitive","valueOf","min","assertObjectWithKeys","debugPath","object","expectedKeys","optionalKeys","Object","assertObject","providedKeys","keys","sort","requiredLength","maximalLength","errorMessage","optionalProvidedKeys","filter","key","includes","find","assertHexString","test","assertHash","hash","assertInteger","ValidateScript","script","nestedValidation","code_hash","args","hash_type","ValidateOutPoint","outPoint","tx_hash","index","ValidateCellInput","cellInput","since","previous_output","ValidateCellOutput","cellOutput","capacity","lock","type","ValidateCellDep","cellDep","dep_type","out_point","assertArray","array","validateFunction","isArray","toAssert","value","assertCommonTransaction","rawTransaction","version","cell_deps","header_deps","inputs","outputs","outputs_data","ValidateRawTransaction","ValidateTransaction","transaction","witnesses","ValidateRawHeader","rawHeader","compact_target","timestamp","number","epoch","parent_hash","transactions_root","proposals_hash","uncles_hash","dao","assertCommonHeader","ValidateHeader","header","nonce","assertProposalShortId","shortId","ValidateUncleBlock","uncleBlock","proposals","ValidateBlock","block","uncles","transactions","ValidateCellbaseWitness","cellbaseWitness","message","ValidateWitnessArgs","witnessArgs","input_type","output_type","__kBitConversionBuffer","Float64Array","Int32Array","Readable","Stream","BUFFER","TYPE","Blob","blobParts","arguments","options","buffers","size","element","Buffer","isView","from","byteOffset","String","concat","undefined","toLowerCase","Promise","resolve","buf","ab","readable","_read","start","end","relativeStart","relativeEnd","span","slicedBuffer","blob","FetchError","systemError","code","errno","captureStackTrace","convert","defineProperties","enumerable","defineProperty","toStringTag","writable","configurable","create","name","require","INTERNALS","PassThrough","Body","body","_this","_ref","_ref$size","_ref$timeout","timeout","isURLSearchParams","isBlob","isBuffer","disturbed","error","on","err","url","consumeBody","_this4","reject","alloc","stream","accum","accumBytes","abort","resTimeout","setTimeout","chunk","clearTimeout","obj","append","delete","get","getAll","has","set","arrayBuffer","clone","instance","p1","p2","bodyUsed","getBoundary","pipe","extractContentType","getTotalBytes","getLengthSync","_lengthRetrievers","hasKnownLength","then","ct","headers","assign","_this2","JSON","parse","_this3","res","str","charset","exec","convertBody","json","text","mixIn","proto","getOwnPropertyNames","desc","getOwnPropertyDescriptor","global","invalidTokenRegex","invalidHeaderCharRegex","validateName","validateValue","MAP","Headers","init","rawHeaders","raw","headerNames","headerName","method","iterator","pairs","pair","callback","thisArg","getHeaders","_pairs$i","createHeadersIterator","kind","entries","forEach","values","INTERNAL","target","HeadersIteratorPrototype","setPrototypeOf","getPrototypeOf","_INTERNAL","done","exportNodeCompatibleHeaders","__proto__","hostHeaderKey","INTERNALS$1","STATUS_CODES","http","Response","opts","status","contentType","statusText","counter","ok","redirected","INTERNALS$2","parse_url","Url","format_url","format","streamDestructionSupported","isRequest","Request","parsedURL","href","toUpperCase","inputBody","signal","isAbortSignal","redirect","follow","compress","agent","AbortError","PassThrough$1","resolve_url","fetch","request","protocol","hostname","contentLengthValue","totalBytes","getNodeRequestOptions","send","https","response","destroy","emit","aborted","abortAndFinalize","finalize","req","reqTimeout","removeEventListener","addEventListener","once","socket","val","createHeadersLenient","isRedirect","statusCode","location","locationURL","requestOpts","response_options","statusMessage","codings","zlibOptions","flush","zlib","Z_SYNC_FLUSH","finishFlush","createGunzip","createBrotliDecompress","createInflate","createInflateRaw","dest","write","writeToStream","realFetch","nodeFetch","default","module","exports","mergeOptions","overrideOptions","defaultOptions","batchHandler","receiver","async","uri","Content-Type","stringify","payload","params","id","jsonrpc","handler","Proxy","round","random","data","result","RPC","HexStringToBigInt","hexString","BigIntToHexString","bigInt","normalizeHexNumber","intValue","normalizeRawData","toArrayBuffer","normalizeObject","NormalizeScript","NormalizeOutPoint","toNormalize","normalize","NormalizeCellInput","NormalizeCellOutput","type_","NormalizeCellDep","toNormalizeArray","normalizeFunction","item","NormalizeRawTransaction","NormalizeTransaction","NormalizeRawHeader","NormalizeHeader","NormalizeUncleBlock","invokeSerializeJson","serializeJson","Function","transformObject","replace","group","TransformScript","validation","validators.ValidateScript","TransformOutPoint","validators.ValidateOutPoint","toInvoke","transform","TransformCellInput","validators.ValidateCellInput","TransformCellOutput","validators.ValidateCellOutput","TransformCellDep","validators.ValidateCellDep","toInvokeArray","invokeFunction","TransformTransaction","validators.ValidateTransaction","TransformHeader","validators.ValidateHeader","TransformUncleBlock","validators.ValidateUncleBlock","validators.ValidateRawTransaction","validators.ValidateRawHeader","validators.ValidateBlock","validators.ValidateCellbaseWitness","validators.ValidateWitnessArgs","rpc","lockHash","skipCellWithContent","loadData","loadBlockNumber","to","get_tip_block_number","currentFrom","lessThanOrEqual","currentTo","greaterThan","cells","get_cells_by_lock_hash","cell","output_data_len","get_live_cell","content","block_number","get_header","block_hash","cellbase","cell_output","validateTransaction","depGroupUnpacker","txHash","tx","get_transaction","dump","mockInputs","output","_resolveOutPoint","mockCellDeps","cell_dep","outPoints","mockHeaderDeps","headerDep","mock_info","txStatus","toNumber","tx_status"],"mappings":"mRAAA,MAAMA,EACJC,YAAYC,GACVC,KAAKC,KAAO,IAAIC,SAASH,GAG3BD,SACE,OAAOE,KAAKC,KAAKE,WAGnBL,QAAQM,GACN,OAAOJ,KAAKC,KAAKI,SAASD,GAG5BN,gBACE,OAAOE,KAAKC,KAAKF,OAGnBD,gBACE,MACE,KACAQ,MAAMC,UAAUC,IACbC,KAAK,IAAIC,WAAWV,KAAKC,KAAKF,QAASY,IACrC,KAAOA,EAAEC,SAAS,KAAKC,OAAO,IAEhCC,KAAK,KAKd,MAAMC,EACJjB,YAAYkB,GACVhB,KAAKgB,OAASA,EAGhBlB,SACE,OAAOE,KAAKgB,OAAOC,OAAS,EAAI,EAGlCnB,QAAQM,GACN,OAAOc,SAASlB,KAAKgB,OAAOG,OAAO,EAAQ,EAAJf,EAAO,GAAI,IAGpDN,gBACE,MAAMC,EA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5FY"} \ No newline at end of file +{"version":3,"file":"ckb-js-toolkit.node.js","sources":["../src/reader.js","../node_modules/jsbi/dist/jsbi.mjs","../src/validators.js","../node_modules/node-fetch/lib/index.mjs","../node_modules/cross-fetch/dist/node-ponyfill.js","../src/rpc.js","../src/normalizers.js","../src/transformers.js","../src/cell_collectors/rpc_collector.js","../src/transaction_dumper.js","../src/index.js"],"sourcesContent":["class BaseReader {\n constructor() {\n /**\n * instanceof would be nice here, but when a user use multi version of Reader that may cause problem\n * @example\n * const { Reader } = require('ckb-js-toolkit'); // ckb-js-toolkit@0.100.1\n * const { readSomething } = require('other-serializer-lib'); // dependent on ckb-js-toolkit@0.100.0\n *\n * readSomething() instanceof Reader; // false\n *\n * @type {boolean}\n * @protected\n */\n this.__isByteLikeReader__ = true;\n }\n\n static isReader(x) {\n if (x == null) return false;\n if (x instanceof BaseReader) return true;\n return x.__isByteLikeReader__ === true;\n }\n}\n\nclass ArrayBufferReader extends BaseReader {\n constructor(buffer) {\n super();\n this.view = new DataView(buffer);\n }\n\n length() {\n return this.view.byteLength;\n }\n\n indexAt(i) {\n return this.view.getUint8(i);\n }\n\n toArrayBuffer() {\n return this.view.buffer;\n }\n\n serializeJson() {\n return (\n \"0x\" +\n Array.prototype.map\n .call(new Uint8Array(this.view.buffer), x =>\n (\"00\" + x.toString(16)).slice(-2)\n )\n .join(\"\")\n );\n }\n}\n\nclass HexStringReader extends BaseReader {\n constructor(string) {\n super();\n this.string = string;\n }\n\n length() {\n return this.string.length / 2 - 1;\n }\n\n indexAt(i) {\n return parseInt(this.string.substr(2 + i * 2, 2), 16);\n }\n\n toArrayBuffer() {\n const buffer = new ArrayBuffer(this.length());\n const view = new DataView(buffer);\n\n for (let i = 0; i < this.length(); i++) {\n view.setUint8(i, this.indexAt(i));\n }\n return buffer;\n }\n\n serializeJson() {\n return this.string;\n }\n}\n\nexport class Reader extends BaseReader {\n constructor(input) {\n super();\n if (\n input instanceof HexStringReader ||\n input instanceof ArrayBufferReader\n ) {\n return input;\n }\n if (typeof input === \"string\") {\n if (!input.startsWith(\"0x\") || input.length % 2 !== 0) {\n throw new Error(\n \"Hex string must start with 0x, and has even numbered length!\"\n );\n }\n return new HexStringReader(input);\n }\n if (input instanceof ArrayBuffer) {\n return new ArrayBufferReader(input);\n }\n\n if (input instanceof Uint8Array) {\n return new ArrayBufferReader(Uint8Array.from(input).buffer);\n }\n throw new Error(\"Reader can only accept hex string or ArrayBuffer!\");\n }\n\n static from(x) {\n return new Reader(x);\n }\n\n static fromRawString(string) {\n const buffer = new ArrayBuffer(string.length);\n const view = new DataView(buffer);\n\n for (let i = 0; i < string.length; i++) {\n const c = string.charCodeAt(i);\n if (c > 0xff) {\n throw new Error(\"fromRawString can only accept UTF-8 raw string!\");\n }\n view.setUint8(i, c);\n }\n return new ArrayBufferReader(buffer);\n }\n}\n","class JSBI extends Array{constructor(a,b){if(a>JSBI.__kMaxLength)throw new RangeError(\"Maximum BigInt size exceeded\");super(a),this.sign=b}static BigInt(a){var b=Math.floor,c=Number.isFinite;if(\"number\"==typeof a){if(0===a)return JSBI.__zero();if((0|a)===a)return 0>a?JSBI.__oneDigit(-a,!0):JSBI.__oneDigit(a,!1);if(!c(a)||b(a)!==a)throw new RangeError(\"The number \"+a+\" cannot be converted to BigInt because it is not an integer\");return JSBI.__fromDouble(a)}if(\"string\"==typeof a){const b=JSBI.__fromString(a);if(null===b)throw new SyntaxError(\"Cannot convert \"+a+\" to a BigInt\");return b}if(\"boolean\"==typeof a)return!0===a?JSBI.__oneDigit(1,!1):JSBI.__zero();if(\"object\"==typeof a){if(a.constructor===JSBI)return a;const b=JSBI.__toPrimitive(a);return JSBI.BigInt(b)}throw new TypeError(\"Cannot convert \"+a+\" to a BigInt\")}toDebugString(){const a=[\"BigInt[\"];for(const b of this)a.push((b?(b>>>0).toString(16):b)+\", \");return a.push(\"]\"),a.join(\"\")}toString(a=10){if(2>a||36>>=12;const l=j-12;let m=12<=j?0:h<<20+j,n=20+j;0>>32-l,m=h<>>32-n,n-=32);const o=JSBI.__decideRounding(a,n,i,h);if((1===o||0===o&&1==(1&m))&&(m=m+1>>>0,0==m&&(k++,0!=k>>>20&&(k=0,g++,1023=JSBI.__kMaxLengthBits)throw new RangeError(\"BigInt too big\");if(1===a.length&&2===a.__digit(0)){const b=1+(c>>>5),d=a.sign&&0!=(1&c),e=new JSBI(b,d);e.__initializeDigits();const f=1<<(31&c);return e.__setDigit(b-1,f),e}let d=null,e=a;for(0!=(1&c)&&(d=a),c>>=1;0!==c;c>>=1)e=JSBI.multiply(e,e),0!=(1&c)&&(null===d?d=e:d=JSBI.multiply(d,e));return d}static multiply(a,b){if(0===a.length)return a;if(0===b.length)return b;let c=a.length+b.length;32<=a.__clzmsd()+b.__clzmsd()&&c--;const d=new JSBI(c,a.sign!==b.sign);d.__initializeDigits();for(let c=0;cJSBI.__absoluteCompare(a,b))return JSBI.__zero();const c=a.sign!==b.sign,d=b.__unsignedDigit(0);let e;if(1===b.length&&65535>=d){if(1===d)return c===a.sign?a:JSBI.unaryMinus(a);e=JSBI.__absoluteDivSmall(a,d,null)}else e=JSBI.__absoluteDivLarge(a,b,!0,!1);return e.sign=c,e.__trim()}static remainder(a,b){if(0===b.length)throw new RangeError(\"Division by zero\");if(0>JSBI.__absoluteCompare(a,b))return a;const c=b.__unsignedDigit(0);if(1===b.length&&65535>=c){if(1===c)return JSBI.__zero();const b=JSBI.__absoluteModSmall(a,c);return 0===b?JSBI.__zero():JSBI.__oneDigit(b,a.sign)}const d=JSBI.__absoluteDivLarge(a,b,!1,!0);return d.sign=a.sign,d.__trim()}static add(a,b){const c=a.sign;return c===b.sign?JSBI.__absoluteAdd(a,b,c):0<=JSBI.__absoluteCompare(a,b)?JSBI.__absoluteSub(a,b,c):JSBI.__absoluteSub(b,a,!c)}static subtract(a,b){const c=a.sign;return c===b.sign?0<=JSBI.__absoluteCompare(a,b)?JSBI.__absoluteSub(a,b,c):JSBI.__absoluteSub(b,a,!c):JSBI.__absoluteAdd(a,b,c)}static leftShift(a,b){return 0===b.length||0===a.length?a:b.sign?JSBI.__rightShiftByAbsolute(a,b):JSBI.__leftShiftByAbsolute(a,b)}static signedRightShift(a,b){return 0===b.length||0===a.length?a:b.sign?JSBI.__leftShiftByAbsolute(a,b):JSBI.__rightShiftByAbsolute(a,b)}static unsignedRightShift(){throw new TypeError(\"BigInts have no unsigned right shift; use >> instead\")}static lessThan(a,b){return 0>JSBI.__compareToBigInt(a,b)}static lessThanOrEqual(a,b){return 0>=JSBI.__compareToBigInt(a,b)}static greaterThan(a,b){return 0=JSBI.__kMaxLengthBits)return b;const c=a+31>>>5;if(b.lengthJSBI.__kMaxLengthBits)throw new RangeError(\"BigInt too big\");return JSBI.__truncateAndSubFromPowerOfTwo(a,b,!1)}if(a>=JSBI.__kMaxLengthBits)return b;const c=a+31>>>5;if(b.length>>d)return b}return JSBI.__truncateToNBits(a,b)}static ADD(a,b){if(a=JSBI.__toPrimitive(a),b=JSBI.__toPrimitive(b),\"string\"==typeof a)return\"string\"!=typeof b&&(b=b.toString()),a+b;if(\"string\"==typeof b)return a.toString()+b;if(a=JSBI.__toNumeric(a),b=JSBI.__toNumeric(b),JSBI.__isBigInt(a)&&JSBI.__isBigInt(b))return JSBI.add(a,b);if(\"number\"==typeof a&&\"number\"==typeof b)return a+b;throw new TypeError(\"Cannot mix BigInt and other types, use explicit conversions\")}static LT(a,b){return JSBI.__compare(a,b,0)}static LE(a,b){return JSBI.__compare(a,b,1)}static GT(a,b){return JSBI.__compare(a,b,2)}static GE(a,b){return JSBI.__compare(a,b,3)}static EQ(a,b){for(;;){if(JSBI.__isBigInt(a))return JSBI.__isBigInt(b)?JSBI.equal(a,b):JSBI.EQ(b,a);if(\"number\"==typeof a){if(JSBI.__isBigInt(b))return JSBI.__equalToNumber(b,a);if(\"object\"!=typeof b)return a==b;b=JSBI.__toPrimitive(b)}else if(\"string\"==typeof a){if(JSBI.__isBigInt(b))return a=JSBI.__fromString(a),null!==a&&JSBI.equal(a,b);if(\"object\"!=typeof b)return a==b;b=JSBI.__toPrimitive(b)}else if(\"boolean\"==typeof a){if(JSBI.__isBigInt(b))return JSBI.__equalToNumber(b,+a);if(\"object\"!=typeof b)return a==b;b=JSBI.__toPrimitive(b)}else if(\"symbol\"==typeof a){if(JSBI.__isBigInt(b))return!1;if(\"object\"!=typeof b)return a==b;b=JSBI.__toPrimitive(b)}else if(\"object\"==typeof a){if(\"object\"==typeof b&&b.constructor!==JSBI)return a==b;a=JSBI.__toPrimitive(a)}else return a==b}}static NE(a,b){return!JSBI.EQ(a,b)}static __zero(){return new JSBI(0,!1)}static __oneDigit(a,b){const c=new JSBI(1,b);return c.__setDigit(0,a),c}__copy(){const a=new JSBI(this.length,this.sign);for(let b=0;bb)e=-b-1;else{if(0===c)return-1;c--,d=a.__digit(c),e=31}let f=1<>>20,c=b-1023,d=(c>>>5)+1,e=new JSBI(d,0>a);let f=1048575&JSBI.__kBitConversionInts[1]|1048576,g=JSBI.__kBitConversionInts[0];const h=20,i=31&c;let j,k=0;if(i<20){const a=h-i;k=a+32,j=f>>>a,f=f<<32-a|g>>>a,g<<=32-a}else if(i===20)k=32,j=f,f=g;else{const a=i-h;k=32-a,j=f<>>32-a,f=g<=a&&9<=a)||(159>=a?32==a:131071>=a?160==a||5760==a:196607>=a?(a&=131071,10>=a||40==a||41==a||47==a||95==a||4096==a):65279==a)}static __fromString(a,b=0){let c=0;const e=a.length;let f=0;if(f===e)return JSBI.__zero();let g=a.charCodeAt(f);for(;JSBI.__isWhitespace(g);){if(++f===e)return JSBI.__zero();g=a.charCodeAt(f)}if(43===g){if(++f===e)return null;g=a.charCodeAt(f),c=1}else if(45===g){if(++f===e)return null;g=a.charCodeAt(f),c=-1}if(0===b){if(b=10,48===g){if(++f===e)return JSBI.__zero();if(g=a.charCodeAt(f),88===g||120===g){if(b=16,++f===e)return null;g=a.charCodeAt(f)}else if(79===g||111===g){if(b=8,++f===e)return null;g=a.charCodeAt(f)}else if(66===g||98===g){if(b=2,++f===e)return null;g=a.charCodeAt(f)}}}else if(16===b&&48===g){if(++f===e)return JSBI.__zero();if(g=a.charCodeAt(f),88===g||120===g){if(++f===e)return null;g=a.charCodeAt(f)}}for(;48===g;){if(++f===e)return JSBI.__zero();g=a.charCodeAt(f)}const h=e-f;let i=JSBI.__kMaxBitsPerChar[b],j=JSBI.__kBitsPerCharTableMultiplier-1;if(h>1073741824/i)return null;const k=i*h+j>>>JSBI.__kBitsPerCharTableShift,l=new JSBI(k+31>>>5,!1),n=10>b?b:10,o=10>=JSBI.__kBitsPerCharTableShift;const b=[],c=[];let d=!1;do{let h=0,j=0;for(;;){let b;if(g-48>>>0>>0>>0>>0>>JSBI.__kBitsPerCharTableShift+5;l.__inplaceMultiplyAdd(p,k,q)}while(!c)}if(f!==e){if(!JSBI.__isWhitespace(g))return null;for(f++;f>>i-f)}if(0!==e){if(d>=a.length)throw new Error(\"implementation bug\");a.__setDigit(d++,e)}for(;d>>1)+(85&e),e=(51&e>>>2)+(51&e),e=(15&e>>>4)+(15&e);const f=e,g=b-1,h=a.__digit(d-1),i=c(h);let j=0|(32*d-i+f-1)/f;if(a.sign&&j++,268435456>>e,n=32-e;n>=f;)k[l--]=JSBI.__kConversionChars[m&g],m>>>=f,n-=f}const o=(m|h<>>f-n;0!==m;)k[l--]=JSBI.__kConversionChars[m&g],m>>>=f;if(a.sign&&(k[l--]=\"-\"),-1!=l)throw new Error(\"implementation bug\");return k.join(\"\")}static __toStringGeneric(a,b,c){var d=Math.clz32;const e=a.length;if(0===e)return\"\";if(1===e){let d=a.__unsignedDigit(0).toString(b);return!1===c&&a.sign&&(d=\"-\"+d),d}const f=32*e-d(a.__digit(e-1)),g=JSBI.__kMaxBitsPerChar[b],h=g-1;let i=f*JSBI.__kBitsPerCharTableMultiplier;i+=h-1,i=0|i/h;const j=i+1>>1,k=JSBI.exponentiate(JSBI.__oneDigit(b,!1),JSBI.__oneDigit(j,!1));let l,m;const n=k.__unsignedDigit(0);if(1===k.length&&65535>=n){l=new JSBI(a.length,!1),l.__initializeDigits();let c=0;for(let b=2*a.length-1;0<=b;b--){const d=c<<16|a.__halfDigit(b);l.__setHalfDigit(b,0|d/n),c=0|d%n}m=c.toString(b)}else{const c=JSBI.__absoluteDivLarge(a,k,!0,!0);l=c.quotient;const d=c.remainder.__trim();m=JSBI.__toStringGeneric(d,b,!0)}l.__trim();let o=JSBI.__toStringGeneric(l,b,!0);for(;m.lengthd?JSBI.__absoluteLess(c):0}static __compareToNumber(a,b){if(b|!0){const c=a.sign,d=0>b;if(c!==d)return JSBI.__unequalSign(c);if(0===a.length){if(d)throw new Error(\"implementation bug\");return 0===b?0:-1}if(1e?JSBI.__absoluteGreater(c):fb)return JSBI.__unequalSign(d);if(0===b)throw new Error(\"implementation bug: should be handled elsewhere\");if(0===a.length)return-1;JSBI.__kBitConversionDouble[0]=b;const e=2047&JSBI.__kBitConversionInts[1]>>>20;if(2047==e)throw new Error(\"implementation bug: handled elsewhere\");const f=e-1023;if(0>f)return JSBI.__absoluteGreater(d);const g=a.length;let h=a.__digit(g-1);const i=c(h),j=32*g-i,k=f+1;if(jk)return JSBI.__absoluteGreater(d);let l=1048576|1048575&JSBI.__kBitConversionInts[1],m=JSBI.__kBitConversionInts[0];const n=20,o=31-i;if(o!==(j-1)%31)throw new Error(\"implementation bug\");let p,q=0;if(20>o){const a=n-o;q=a+32,p=l>>>a,l=l<<32-a|m>>>a,m<<=32-a}else if(20===o)q=32,p=l,l=m;else{const a=o-n;q=32-a,p=l<>>32-a,l=m<>>=0,p>>>=0,h>p)return JSBI.__absoluteGreater(d);if(h>>0,l=m,m=0):p=0;const b=a.__unsignedDigit(c);if(b>p)return JSBI.__absoluteGreater(d);if(bb&&a.__unsignedDigit(0)===c(b):0===JSBI.__compareToDouble(a,b)}static __comparisonResultToBool(a,b){switch(b){case 0:return 0>a;case 1:return 0>=a;case 2:return 0b;case 3:return a>=b;}if(JSBI.__isBigInt(a)&&\"string\"==typeof b)return b=JSBI.__fromString(b),null!==b&&JSBI.__comparisonResultToBool(JSBI.__compareToBigInt(a,b),c);if(\"string\"==typeof a&&JSBI.__isBigInt(b))return a=JSBI.__fromString(a),null!==a&&JSBI.__comparisonResultToBool(JSBI.__compareToBigInt(a,b),c);if(a=JSBI.__toNumeric(a),b=JSBI.__toNumeric(b),JSBI.__isBigInt(a)){if(JSBI.__isBigInt(b))return JSBI.__comparisonResultToBool(JSBI.__compareToBigInt(a,b),c);if(\"number\"!=typeof b)throw new Error(\"implementation bug\");return JSBI.__comparisonResultToBool(JSBI.__compareToNumber(a,b),c)}if(\"number\"!=typeof a)throw new Error(\"implementation bug\");if(JSBI.__isBigInt(b))return JSBI.__comparisonResultToBool(JSBI.__compareToNumber(b,a),2^c);if(\"number\"!=typeof b)throw new Error(\"implementation bug\");return 0===c?ab:3===c?a>=b:void 0}__clzmsd(){return Math.clz32(this[this.length-1])}static __absoluteAdd(a,b,c){if(a.length>>16)+(c>>>16)+(h>>>16);f=i>>>16,e.__setDigit(g,65535&h|i<<16)}for(;g>>16)+(c>>>16);f=d>>>16,e.__setDigit(g,65535&c|d<<16)}return g>>16;const i=(c>>>16)-(g>>>16)-e;e=1&i>>>16,d.__setDigit(f,65535&h|i<<16)}for(;f>>16;const g=(b>>>16)-e;e=1&g>>>16,d.__setDigit(f,65535&c|g<<16)}return d.__trim()}static __absoluteAddOne(a,b,c=null){const d=a.length;null===c?c=new JSBI(d,b):c.sign=b;let e=!0;for(let f,g=0;gd?0:a.__unsignedDigit(d)>b.__unsignedDigit(d)?1:-1}static __multiplyAccumulate(a,b,c,d){var e=Math.imul;if(0===b)return;const f=65535&b,g=b>>>16;let h=0,j=0,k=0;for(let l=0;l>>16;const n=a.__digit(l),o=65535&n,p=n>>>16,q=e(o,f),r=e(o,g),s=e(p,f),t=e(p,g);i+=j+(65535&q),m+=k+h+(i>>>16)+(q>>>16)+(65535&r)+(65535&s),h=m>>>16,j=(r>>>16)+(s>>>16)+(65535&t)+h,h=j>>>16,j&=65535,k=t>>>16,b=65535&i|m<<16,c.__setDigit(d,b)}for(;0!=h||0!==j||0!==k;d++){let a=c.__digit(d);const b=(65535&a)+j,e=(a>>>16)+(b>>>16)+k+h;j=0,k=0,h=e>>>16,a=65535&b|e<<16,c.__setDigit(d,a)}}static __internalMultiplyAdd(a,b,c,d,e){var f=Math.imul;let g=c,h=0;for(let j=0;j>>16;const k=f(c>>>16,b),l=(65535&k)+(d>>>16)+g;g=l>>>16,h=k>>>16,e.__setDigit(j,l<<16|65535&i)}if(e.length>d)for(e.__setDigit(d++,g+h);dthis.length&&(c=this.length);const f=65535&a,g=a>>>16;let h=0,j=65535&b,k=b>>>16;for(let l=0;l>>16,d=e(b,f),i=e(b,g),m=e(c,f),n=e(c,g),o=j+(65535&d),p=k+h+(o>>>16)+(d>>>16)+(65535&i)+(65535&m);j=(i>>>16)+(m>>>16)+(65535&n)+(p>>>16),h=j>>>16,j&=65535,k=n>>>16;this.__setDigit(l,65535&o|p<<16)}if(0!=h||0!==j||0!==k)throw new Error(\"implementation bug\")}static __absoluteDivSmall(a,b,c){null===c&&(c=new JSBI(a.length,!1));let d=0;for(let e,f=2*a.length-1;0<=f;f-=2){e=(d<<16|a.__halfDigit(f))>>>0;const g=0|e/b;d=0|e%b,e=(d<<16|a.__halfDigit(f-1))>>>0;const h=0|e/b;d=0|e%b,c.__setDigit(f>>>1,g<<16|h)}return c}static __absoluteModSmall(a,b){let c=0;for(let d=2*a.length-1;0<=d;d--){const e=(c<<16|a.__halfDigit(d))>>>0;c=0|e%b}return c}static __absoluteDivLarge(a,b,d,e){var f=Math.imul;const g=b.__halfDigitLength(),h=b.length,c=a.__halfDigitLength()-g;let i=null;d&&(i=new JSBI(c+2>>>1,!1),i.__initializeDigits());const k=new JSBI(g+2>>>1,!1);k.__initializeDigits();const l=JSBI.__clz16(b.__halfDigit(g-1));0>>0;l=0|c/n;let d=0|c%n;const e=b.__halfDigit(g-2),h=m.__halfDigit(p+g-2);for(;f(l,e)>>>0>(d<<16|h)>>>0&&(l--,d+=n,!(65535>>1,o|l))}return e?(m.__inplaceRightShift(l),d?{quotient:i,remainder:m}:m):d?i:void 0}static __clz16(a){return Math.clz32(a)-16}__inplaceAdd(a,b,c){let d=0;for(let e=0;e>>16,this.__setHalfDigit(b+e,c)}return d}__inplaceSub(a,b,c){let d=0;if(1&b){b>>=1;let e=this.__digit(b),f=65535&e,g=0;for(;g>>1;g++){const c=a.__digit(g),h=(e>>>16)-(65535&c)-d;d=1&h>>>16,this.__setDigit(b+g,h<<16|65535&f),e=this.__digit(b+g+1),f=(65535&e)-(c>>>16)-d,d=1&f>>>16}const h=a.__digit(g),i=(e>>>16)-(65535&h)-d;d=1&i>>>16,this.__setDigit(b+g,i<<16|65535&f);if(b+g+1>=this.length)throw new RangeError(\"out of bounds\");0==(1&c)&&(e=this.__digit(b+g+1),f=(65535&e)-(h>>>16)-d,d=1&f>>>16,this.__setDigit(b+a.length,4294901760&e|65535&f))}else{b>>=1;let e=0;for(;e>>16;const h=(c>>>16)-(f>>>16)-d;d=1&h>>>16,this.__setDigit(b+e,h<<16|65535&g)}const f=this.__digit(b+e),g=a.__digit(e),h=(65535&f)-(65535&g)-d;d=1&h>>>16;let i=0;0==(1&c)&&(i=(f>>>16)-(g>>>16)-d,d=1&i>>>16),this.__setDigit(b+e,i<<16|65535&h)}return d}__inplaceRightShift(a){if(0===a)return;let b=this.__digit(0)>>>a;const c=this.length-1;for(let e=0;e>>a}this.__setDigit(c,b)}static __specialLeftShift(a,b,c){const d=a.length,e=new JSBI(d+c,!1);if(0===b){for(let b=0;b>>32-b}return 0c)throw new RangeError(\"BigInt too big\");const e=c>>>5,f=31&c,g=a.length,h=0!==f&&0!=a.__digit(g-1)>>>32-f,j=g+e+(h?1:0),k=new JSBI(j,a.sign);if(0===f){let b=0;for(;b>>32-f}if(h)k.__setDigit(g+e,b);else if(0!=b)throw new Error(\"implementation bug\")}return k.__trim()}static __rightShiftByAbsolute(a,b){const c=a.length,d=a.sign,e=JSBI.__toShiftAmount(b);if(0>e)return JSBI.__rightShiftByMaximum(d);const f=e>>>5,g=31&e;let h=c-f;if(0>=h)return JSBI.__rightShiftByMaximum(d);let i=!1;if(d){if(0!=(a.__digit(f)&(1<>>g;const d=c-f-1;for(let c=0;c>>g}j.__setDigit(d,b)}return i&&(j=JSBI.__absoluteAddOne(j,!0,j)),j.__trim()}static __rightShiftByMaximum(a){return a?JSBI.__oneDigit(1,!0):JSBI.__zero()}static __toShiftAmount(a){if(1JSBI.__kMaxLengthBits?-1:b}static __toPrimitive(a,b=\"default\"){if(\"object\"!=typeof a)return a;if(a.constructor===JSBI)return a;const c=a[Symbol.toPrimitive];if(c){const a=c(b);if(\"object\"!=typeof a)return a;throw new TypeError(\"Cannot convert object to primitive value\")}const d=a.valueOf;if(d){const b=d.call(a);if(\"object\"!=typeof b)return b}const e=a.toString;if(e){const b=e.call(a);if(\"object\"!=typeof b)return b}throw new TypeError(\"Cannot convert object to primitive value\")}static __toNumeric(a){return JSBI.__isBigInt(a)?a:+a}static __isBigInt(a){return\"object\"==typeof a&&a.constructor===JSBI}static __truncateToNBits(a,b){const c=a+31>>>5,d=new JSBI(c,b.sign),e=c-1;for(let c=0;c>>b}return d.__setDigit(e,f),d.__trim()}static __truncateAndSubFromPowerOfTwo(a,b,c){var d=Math.min;const e=a+31>>>5,f=new JSBI(e,c);let g=0;const h=e-1;let j=0;for(const e=d(h,b.length);g>>16;const d=0-(a>>>16)-j;j=1&d>>>16,f.__setDigit(g,65535&c|d<<16)}for(;g>>16;const b=0-(k>>>16)-j;m=65535&a|b<<16}else{const a=32-l;k=k<>>a;const b=1<<32-a,c=(65535&b)-(65535&k)-j;j=1&c>>>16;const d=(b>>>16)-(k>>>16)-j;m=65535&c|d<<16,m&=b-1}return f.__setDigit(h,m),f.__trim()}__digit(a){return this[a]}__unsignedDigit(a){return this[a]>>>0}__setDigit(a,b){this[a]=0|b}__setDigitGrow(a,b){this[a]=0|b}__halfDigitLength(){const a=this.length;return 65535>=this.__unsignedDigit(a-1)?2*a-1:2*a}__halfDigit(a){return 65535&this[a>>>1]>>>((1&a)<<4)}__setHalfDigit(a,b){const c=a>>>1,d=this.__digit(c),e=1&a?65535&d|b<<16:4294901760&d|65535&b;this.__setDigit(c,e)}static __digitPow(a,b){let c=1;for(;0>>=1,a*=a;return c}}JSBI.__kMaxLength=33554432,JSBI.__kMaxLengthBits=JSBI.__kMaxLength<<5,JSBI.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],JSBI.__kBitsPerCharTableShift=5,JSBI.__kBitsPerCharTableMultiplier=1< maximalLength\n ) {\n throw new Error(errorMessage);\n }\n let optionalProvidedKeys = providedKeys.filter(\n key => !expectedKeys.includes(key)\n );\n if (providedKeys.length - optionalProvidedKeys.length !== requiredLength) {\n throw new Error(errorMessage);\n }\n if (optionalProvidedKeys.find(key => !optionalKeys.includes(key))) {\n throw new Error(errorMessage);\n }\n}\n\nfunction assertHexString(debugPath, string) {\n if (!/^0x([0-9a-fA-F][0-9a-fA-F])*$/.test(string)) {\n throw new Error(`${debugPath} must be a hex string!`);\n }\n}\n\nfunction assertHash(debugPath, hash) {\n assertHexString(debugPath, hash);\n if (hash.length != 66) {\n throw new Error(`${debugPath} must be a hex string of 66 bytes long!`);\n }\n}\n\nfunction assertInteger(debugPath, i) {\n if (i === \"0x0\") {\n return;\n }\n if (!/^0x[1-9a-fA-F][0-9a-fA-F]*$/.test(i)) {\n throw new Error(`${debugPath} must be a hex integer!`);\n }\n}\n\nexport function ValidateScript(\n script,\n { nestedValidation = true, debugPath = \"script\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n script,\n [\"code_hash\", \"hash_type\", \"args\"],\n []\n );\n assertHash(`${debugPath}.code_hash`, script.code_hash);\n assertHexString(`${debugPath}.args`, script.args);\n\n if (script.hash_type !== \"data\" && script.hash_type !== \"type\") {\n throw new Error(`${debugPath}.hash_type must be either data or type!`);\n }\n}\n\nexport function ValidateOutPoint(\n outPoint,\n { nestedValidation = true, debugPath = \"out_point\" } = {}\n) {\n assertObjectWithKeys(debugPath, outPoint, [\"tx_hash\", \"index\"], []);\n assertHash(`${debugPath}.tx_hash`, outPoint.tx_hash);\n assertInteger(`${debugPath}.index`, outPoint.index);\n}\n\nexport function ValidateCellInput(\n cellInput,\n { nestedValidation = true, debugPath = \"cell_input\" } = {}\n) {\n assertObjectWithKeys(debugPath, cellInput, [\"since\", \"previous_output\"], []);\n assertInteger(`${debugPath}.since`, cellInput.since);\n\n if (nestedValidation) {\n ValidateOutPoint(cellInput.previous_output, {\n debugPath: `${debugPath}.previous_output`\n });\n }\n}\n\nexport function ValidateCellOutput(\n cellOutput,\n { nestedValidation = true, debugPath = \"cell_output\" } = {}\n) {\n assertObjectWithKeys(debugPath, cellOutput, [\"capacity\", \"lock\"], [\"type\"]);\n assertInteger(`${debugPath}.capacity`, cellOutput.capacity);\n\n if (nestedValidation) {\n ValidateScript(cellOutput.lock, {\n debugPath: `${debugPath}.lock`\n });\n if (cellOutput.type) {\n ValidateScript(cellOutput.type, {\n debugPath: `${debugPath}.type`\n });\n }\n }\n}\n\nexport function ValidateCellDep(\n cellDep,\n { nestedValidation = true, debugPath = \"cell_dep\" } = {}\n) {\n assertObjectWithKeys(debugPath, cellDep, [\"out_point\", \"dep_type\"], []);\n if (cellDep.dep_type !== \"code\" && cellDep.dep_type !== \"dep_group\") {\n throw new Error(`${debugPath}.dep_type must be either code or dep_group!`);\n }\n\n if (nestedValidation) {\n ValidateOutPoint(cellDep.out_point, {\n debugPath: `${debugPath}.out_point`\n });\n }\n}\n\nfunction assertArray(debugPath, array, validateFunction, nestedValidation) {\n if (!Array.isArray(array)) {\n throw new Error(`${debugPath} is not an array!`);\n }\n if (nestedValidation) {\n for (let i = 0; i < array.length; i++) {\n validateFunction(`${debugPath}[${i}]`, array[i]);\n }\n }\n}\n\nfunction toAssert(validateFunction, nestedValidation) {\n return function(debugPath, value) {\n validateFunction(value, {\n nestedValidation: nestedValidation,\n debugPath: debugPath\n });\n };\n}\n\nfunction assertCommonTransaction(debugPath, rawTransaction, nestedValidation) {\n assertInteger(`${debugPath}.version`, rawTransaction.version);\n assertArray(\n `${debugPath}.cell_deps`,\n rawTransaction.cell_deps,\n toAssert(ValidateCellDep, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.header_deps`,\n rawTransaction.header_deps,\n assertHash,\n nestedValidation\n );\n assertArray(\n `${debugPath}.inputs`,\n rawTransaction.inputs,\n toAssert(ValidateCellInput, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.outputs`,\n rawTransaction.outputs,\n toAssert(ValidateCellOutput, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.outputs_data`,\n rawTransaction.outputs_data,\n assertHexString,\n nestedValidation\n );\n}\n\nexport function ValidateRawTransaction(\n rawTransaction,\n { nestedValidation = true, debugPath = \"raw_transaction\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n rawTransaction,\n [\n \"version\",\n \"cell_deps\",\n \"header_deps\",\n \"inputs\",\n \"outputs\",\n \"outputs_data\"\n ],\n []\n );\n assertCommonTransaction(debugPath, rawTransaction, nestedValidation);\n}\n\nexport function ValidateTransaction(\n transaction,\n { nestedValidation = true, debugPath = \"transaction\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n transaction,\n [\n \"version\",\n \"cell_deps\",\n \"header_deps\",\n \"inputs\",\n \"outputs\",\n \"outputs_data\",\n \"witnesses\"\n ],\n []\n );\n assertCommonTransaction(debugPath, transaction, nestedValidation);\n assertArray(\n `${debugPath}.witnesses`,\n transaction.witnesses,\n assertHexString,\n nestedValidation\n );\n}\n\nfunction assertCommonHeader(debugPath, rawHeader) {\n assertInteger(`${debugPath}.version`, rawHeader.version);\n assertInteger(`${debugPath}.compact_target`, rawHeader.compact_target);\n assertInteger(`${debugPath}.timestamp`, rawHeader.timestamp);\n assertInteger(`${debugPath}.number`, rawHeader.number);\n assertInteger(`${debugPath}.epoch`, rawHeader.epoch);\n assertHash(`${debugPath}.parent_hash`, rawHeader.parent_hash);\n assertHash(`${debugPath}.transactions_root`, rawHeader.transactions_root);\n assertHash(`${debugPath}.proposals_hash`, rawHeader.proposals_hash);\n assertHash(`${debugPath}.uncles_hash`, rawHeader.uncles_hash);\n assertHash(`${debugPath}.dao`, rawHeader.dao);\n}\n\nexport function ValidateRawHeader(\n rawHeader,\n { nestedValidation = true, debugPath = \"raw_header\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n rawHeader,\n [\n \"version\",\n \"compact_target\",\n \"timestamp\",\n \"number\",\n \"epoch\",\n \"parent_hash\",\n \"transactions_root\",\n \"proposals_hash\",\n \"uncles_hash\",\n \"dao\"\n ],\n []\n );\n assertCommonHeader(debugPath, rawHeader);\n}\n\nexport function ValidateHeader(\n header,\n { nestedValidation = true, debugPath = \"header\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n header,\n [\n \"version\",\n \"compact_target\",\n \"timestamp\",\n \"number\",\n \"epoch\",\n \"parent_hash\",\n \"transactions_root\",\n \"proposals_hash\",\n \"uncles_hash\",\n \"dao\",\n \"nonce\"\n ],\n []\n );\n assertHexString(`${debugPath}.nonce`, header.nonce);\n if (header.nonce.length != 34) {\n throw new Error(\n `${debugPath}.nonce must be a hex string of 34 bytes long!`\n );\n }\n}\n\nfunction assertProposalShortId(debugPath, shortId) {\n assertHexString(debugPath, shortId);\n if (shortId.length != 22) {\n throw new Error(`${debugPath} must be a hex string of 22 bytes long!`);\n }\n}\n\nexport function ValidateUncleBlock(\n uncleBlock,\n { nestedValidation = true, debugPath = \"uncle_block\" } = {}\n) {\n assertObjectWithKeys(debugPath, uncleBlock, [\"header\", \"proposals\"], []);\n\n if (nestedValidation) {\n ValidateHeader(uncleBlock.header, {\n debugPath: `${debugPath}.header`\n });\n }\n assertArray(\n `${debugPath}.proposals`,\n uncleBlock.proposals,\n assertProposalShortId,\n nestedValidation\n );\n}\n\nexport function ValidateBlock(\n block,\n { nestedValidation = true, debugPath = \"block\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n block,\n [\"header\", \"uncles\", \"transactions\", \"proposals\"],\n []\n );\n\n if (nestedValidation) {\n ValidateHeader(block.header, {\n debugPath: `${debugPath}.header`\n });\n }\n assertArray(\n `${debugPath}.uncles`,\n block.uncles,\n toAssert(ValidateUncleBlock, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.transactions`,\n block.transactions,\n toAssert(ValidateTransaction, nestedValidation),\n nestedValidation\n );\n assertArray(\n `${debugPath}.proposals`,\n block.proposals,\n assertProposalShortId,\n nestedValidation\n );\n}\n\nexport function ValidateCellbaseWitness(\n cellbaseWitness,\n { nestedValidation = true, debugPath = \"cellbase_witness\" } = {}\n) {\n assertObjectWithKeys(debugPath, cellbaseWitness, [\"lock\", \"message\"], []);\n assertHexString(`${debugPath}.message`, cellbaseWitness.message);\n\n if (nestedValidation) {\n ValidateScript(cellbaseWitness.lock, {\n debugPath: `${debugPath}.lock`\n });\n }\n}\n\nexport function ValidateWitnessArgs(\n witnessArgs,\n { nestedValidation = true, debugPath = \"witness_args\" } = {}\n) {\n assertObjectWithKeys(\n debugPath,\n witnessArgs,\n [],\n [\"lock\", \"input_type\", \"output_type\"]\n );\n\n if (witnessArgs.lock) {\n assertHexString(`${debugPath}.lock`, witnessArgs.lock);\n }\n if (witnessArgs.input_type) {\n assertHexString(`${debugPath}.input_type`, witnessArgs.input_type);\n }\n if (witnessArgs.output_type) {\n assertHexString(`${debugPath}.output_type`, witnessArgs.output_type);\n }\n}\n","import Stream from 'stream';\nimport http from 'http';\nimport Url from 'url';\nimport https from 'https';\nimport zlib from 'zlib';\n\n// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js\n\n// fix for \"Readable\" isn't a named export issue\nconst Readable = Stream.Readable;\n\nconst BUFFER = Symbol('buffer');\nconst TYPE = Symbol('type');\n\nclass Blob {\n\tconstructor() {\n\t\tthis[TYPE] = '';\n\n\t\tconst blobParts = arguments[0];\n\t\tconst options = arguments[1];\n\n\t\tconst buffers = [];\n\t\tlet size = 0;\n\n\t\tif (blobParts) {\n\t\t\tconst a = blobParts;\n\t\t\tconst length = Number(a.length);\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tconst element = a[i];\n\t\t\t\tlet buffer;\n\t\t\t\tif (element instanceof Buffer) {\n\t\t\t\t\tbuffer = element;\n\t\t\t\t} else if (ArrayBuffer.isView(element)) {\n\t\t\t\t\tbuffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);\n\t\t\t\t} else if (element instanceof ArrayBuffer) {\n\t\t\t\t\tbuffer = Buffer.from(element);\n\t\t\t\t} else if (element instanceof Blob) {\n\t\t\t\t\tbuffer = element[BUFFER];\n\t\t\t\t} else {\n\t\t\t\t\tbuffer = Buffer.from(typeof element === 'string' ? element : String(element));\n\t\t\t\t}\n\t\t\t\tsize += buffer.length;\n\t\t\t\tbuffers.push(buffer);\n\t\t\t}\n\t\t}\n\n\t\tthis[BUFFER] = Buffer.concat(buffers);\n\n\t\tlet type = options && options.type !== undefined && String(options.type).toLowerCase();\n\t\tif (type && !/[^\\u0020-\\u007E]/.test(type)) {\n\t\t\tthis[TYPE] = type;\n\t\t}\n\t}\n\tget size() {\n\t\treturn this[BUFFER].length;\n\t}\n\tget type() {\n\t\treturn this[TYPE];\n\t}\n\ttext() {\n\t\treturn Promise.resolve(this[BUFFER].toString());\n\t}\n\tarrayBuffer() {\n\t\tconst buf = this[BUFFER];\n\t\tconst ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\treturn Promise.resolve(ab);\n\t}\n\tstream() {\n\t\tconst readable = new Readable();\n\t\treadable._read = function () {};\n\t\treadable.push(this[BUFFER]);\n\t\treadable.push(null);\n\t\treturn readable;\n\t}\n\ttoString() {\n\t\treturn '[object Blob]';\n\t}\n\tslice() {\n\t\tconst size = this.size;\n\n\t\tconst start = arguments[0];\n\t\tconst end = arguments[1];\n\t\tlet relativeStart, relativeEnd;\n\t\tif (start === undefined) {\n\t\t\trelativeStart = 0;\n\t\t} else if (start < 0) {\n\t\t\trelativeStart = Math.max(size + start, 0);\n\t\t} else {\n\t\t\trelativeStart = Math.min(start, size);\n\t\t}\n\t\tif (end === undefined) {\n\t\t\trelativeEnd = size;\n\t\t} else if (end < 0) {\n\t\t\trelativeEnd = Math.max(size + end, 0);\n\t\t} else {\n\t\t\trelativeEnd = Math.min(end, size);\n\t\t}\n\t\tconst span = Math.max(relativeEnd - relativeStart, 0);\n\n\t\tconst buffer = this[BUFFER];\n\t\tconst slicedBuffer = buffer.slice(relativeStart, relativeStart + span);\n\t\tconst blob = new Blob([], { type: arguments[2] });\n\t\tblob[BUFFER] = slicedBuffer;\n\t\treturn blob;\n\t}\n}\n\nObject.defineProperties(Blob.prototype, {\n\tsize: { enumerable: true },\n\ttype: { enumerable: true },\n\tslice: { enumerable: true }\n});\n\nObject.defineProperty(Blob.prototype, Symbol.toStringTag, {\n\tvalue: 'Blob',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * fetch-error.js\n *\n * FetchError interface for operational errors\n */\n\n/**\n * Create FetchError instance\n *\n * @param String message Error message for human\n * @param String type Error type for machine\n * @param String systemError For Node.js system error\n * @return FetchError\n */\nfunction FetchError(message, type, systemError) {\n Error.call(this, message);\n\n this.message = message;\n this.type = type;\n\n // when err.type is `system`, err.code contains system error code\n if (systemError) {\n this.code = this.errno = systemError.code;\n }\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nFetchError.prototype = Object.create(Error.prototype);\nFetchError.prototype.constructor = FetchError;\nFetchError.prototype.name = 'FetchError';\n\nlet convert;\ntry {\n\tconvert = require('encoding').convert;\n} catch (e) {}\n\nconst INTERNALS = Symbol('Body internals');\n\n// fix an issue where \"PassThrough\" isn't a named export for node <10\nconst PassThrough = Stream.PassThrough;\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nfunction Body(body) {\n\tvar _this = this;\n\n\tvar _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n\t _ref$size = _ref.size;\n\n\tlet size = _ref$size === undefined ? 0 : _ref$size;\n\tvar _ref$timeout = _ref.timeout;\n\tlet timeout = _ref$timeout === undefined ? 0 : _ref$timeout;\n\n\tif (body == null) {\n\t\t// body is undefined or null\n\t\tbody = null;\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\tbody = Buffer.from(body.toString());\n\t} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\tbody = Buffer.from(body);\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t} else if (body instanceof Stream) ; else {\n\t\t// none of the above\n\t\t// coerce to string then buffer\n\t\tbody = Buffer.from(String(body));\n\t}\n\tthis[INTERNALS] = {\n\t\tbody,\n\t\tdisturbed: false,\n\t\terror: null\n\t};\n\tthis.size = size;\n\tthis.timeout = timeout;\n\n\tif (body instanceof Stream) {\n\t\tbody.on('error', function (err) {\n\t\t\tconst error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);\n\t\t\t_this[INTERNALS].error = error;\n\t\t});\n\t}\n}\n\nBody.prototype = {\n\tget body() {\n\t\treturn this[INTERNALS].body;\n\t},\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t},\n\n\t/**\n * Decode response as ArrayBuffer\n *\n * @return Promise\n */\n\tarrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t},\n\n\t/**\n * Return raw response as Blob\n *\n * @return Promise\n */\n\tblob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n * Decode response as json\n *\n * @return Promise\n */\n\tjson() {\n\t\tvar _this2 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(buffer.toString());\n\t\t\t} catch (err) {\n\t\t\t\treturn Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n * Decode response as text\n *\n * @return Promise\n */\n\ttext() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t},\n\n\t/**\n * Decode response as buffer (non-spec api)\n *\n * @return Promise\n */\n\tbuffer() {\n\t\treturn consumeBody.call(this);\n\t},\n\n\t/**\n * Decode response as text, while automatically detecting the encoding and\n * trying to decode to UTF-8 (non-spec api)\n *\n * @return Promise\n */\n\ttextConverted() {\n\t\tvar _this3 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn convertBody(buffer, _this3.headers);\n\t\t});\n\t}\n};\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: { enumerable: true },\n\tbodyUsed: { enumerable: true },\n\tarrayBuffer: { enumerable: true },\n\tblob: { enumerable: true },\n\tjson: { enumerable: true },\n\ttext: { enumerable: true }\n});\n\nBody.mixIn = function (proto) {\n\tfor (const name of Object.getOwnPropertyNames(Body.prototype)) {\n\t\t// istanbul ignore else: future proof\n\t\tif (!(name in proto)) {\n\t\t\tconst desc = Object.getOwnPropertyDescriptor(Body.prototype, name);\n\t\t\tObject.defineProperty(proto, name, desc);\n\t\t}\n\t}\n};\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nfunction consumeBody() {\n\tvar _this4 = this;\n\n\tif (this[INTERNALS].disturbed) {\n\t\treturn Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));\n\t}\n\n\tthis[INTERNALS].disturbed = true;\n\n\tif (this[INTERNALS].error) {\n\t\treturn Body.Promise.reject(this[INTERNALS].error);\n\t}\n\n\tlet body = this.body;\n\n\t// body is null\n\tif (body === null) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is blob\n\tif (isBlob(body)) {\n\t\tbody = body.stream();\n\t}\n\n\t// body is buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn Body.Promise.resolve(body);\n\t}\n\n\t// istanbul ignore if: should never happen\n\tif (!(body instanceof Stream)) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is stream\n\t// get ready to actually consume the body\n\tlet accum = [];\n\tlet accumBytes = 0;\n\tlet abort = false;\n\n\treturn new Body.Promise(function (resolve, reject) {\n\t\tlet resTimeout;\n\n\t\t// allow timeout on slow response body\n\t\tif (_this4.timeout) {\n\t\t\tresTimeout = setTimeout(function () {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));\n\t\t\t}, _this4.timeout);\n\t\t}\n\n\t\t// handle stream errors\n\t\tbody.on('error', function (err) {\n\t\t\tif (err.name === 'AbortError') {\n\t\t\t\t// if the request was aborted, reject with this Error\n\t\t\t\tabort = true;\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\t// other errors, such as incorrect content-encoding\n\t\t\t\treject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\n\t\tbody.on('data', function (chunk) {\n\t\t\tif (abort || chunk === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_this4.size && accumBytes + chunk.length > _this4.size) {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t});\n\n\t\tbody.on('end', function () {\n\t\t\tif (abort) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tclearTimeout(resTimeout);\n\n\t\t\ttry {\n\t\t\t\tresolve(Buffer.concat(accum, accumBytes));\n\t\t\t} catch (err) {\n\t\t\t\t// handle streams that have accumulated too much data (issue #414)\n\t\t\t\treject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect buffer encoding and convert to target encoding\n * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding\n *\n * @param Buffer buffer Incoming buffer\n * @param String encoding Target encoding\n * @return String\n */\nfunction convertBody(buffer, headers) {\n\tif (typeof convert !== 'function') {\n\t\tthrow new Error('The package `encoding` must be installed to use the textConverted() function');\n\t}\n\n\tconst ct = headers.get('content-type');\n\tlet charset = 'utf-8';\n\tlet res, str;\n\n\t// header\n\tif (ct) {\n\t\tres = /charset=([^;]*)/i.exec(ct);\n\t}\n\n\t// no charset in content type, peek at response body for at most 1024 bytes\n\tstr = buffer.slice(0, 1024).toString();\n\n\t// html5\n\tif (!res && str) {\n\t\tres = / 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\n\t\tthis[MAP] = Object.create(null);\n\n\t\tif (init instanceof Headers) {\n\t\t\tconst rawHeaders = init.raw();\n\t\t\tconst headerNames = Object.keys(rawHeaders);\n\n\t\t\tfor (const headerName of headerNames) {\n\t\t\t\tfor (const value of rawHeaders[headerName]) {\n\t\t\t\t\tthis.append(headerName, value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't worry about converting prop to ByteString here as append()\n\t\t// will handle it.\n\t\tif (init == null) ; else if (typeof init === 'object') {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\tif (method != null) {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// sequence>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tconst pairs = [];\n\t\t\t\tfor (const pair of init) {\n\t\t\t\t\tif (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be iterable');\n\t\t\t\t\t}\n\t\t\t\t\tpairs.push(Array.from(pair));\n\t\t\t\t}\n\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t}\n\t\t\t\t\tthis.append(pair[0], pair[1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// record\n\t\t\t\tfor (const key of Object.keys(init)) {\n\t\t\t\t\tconst value = init[key];\n\t\t\t\t\tthis.append(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Provided initializer must be an object');\n\t\t}\n\t}\n\n\t/**\n * Return combined header value given name\n *\n * @param String name Header name\n * @return Mixed\n */\n\tget(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key === undefined) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this[MAP][key].join(', ');\n\t}\n\n\t/**\n * Iterate over all headers\n *\n * @param Function callback Executed for each item with parameters (value, name, thisArg)\n * @param Boolean thisArg `this` context for callback function\n * @return Void\n */\n\tforEach(callback) {\n\t\tlet thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\tlet pairs = getHeaders(this);\n\t\tlet i = 0;\n\t\twhile (i < pairs.length) {\n\t\t\tvar _pairs$i = pairs[i];\n\t\t\tconst name = _pairs$i[0],\n\t\t\t value = _pairs$i[1];\n\n\t\t\tcallback.call(thisArg, value, name, this);\n\t\t\tpairs = getHeaders(this);\n\t\t\ti++;\n\t\t}\n\t}\n\n\t/**\n * Overwrite header values given name\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tset(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}\n\n\t/**\n * Append a value onto existing header\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tappend(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tthis[MAP][key].push(value);\n\t\t} else {\n\t\t\tthis[MAP][name] = [value];\n\t\t}\n\t}\n\n\t/**\n * Check for header name existence\n *\n * @param String name Header name\n * @return Boolean\n */\n\thas(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}\n\n\t/**\n * Delete all header values given name\n *\n * @param String name Header name\n * @return Void\n */\n\tdelete(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tdelete this[MAP][key];\n\t\t}\n\t}\n\n\t/**\n * Return raw headers (non-spec api)\n *\n * @return Object\n */\n\traw() {\n\t\treturn this[MAP];\n\t}\n\n\t/**\n * Get an iterator on keys.\n *\n * @return Iterator\n */\n\tkeys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}\n\n\t/**\n * Get an iterator on values.\n *\n * @return Iterator\n */\n\tvalues() {\n\t\treturn createHeadersIterator(this, 'value');\n\t}\n\n\t/**\n * Get an iterator on entries.\n *\n * This is the default iterator of the Headers object.\n *\n * @return Iterator\n */\n\t[Symbol.iterator]() {\n\t\treturn createHeadersIterator(this, 'key+value');\n\t}\n}\nHeaders.prototype.entries = Headers.prototype[Symbol.iterator];\n\nObject.defineProperty(Headers.prototype, Symbol.toStringTag, {\n\tvalue: 'Headers',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Headers.prototype, {\n\tget: { enumerable: true },\n\tforEach: { enumerable: true },\n\tset: { enumerable: true },\n\tappend: { enumerable: true },\n\thas: { enumerable: true },\n\tdelete: { enumerable: true },\n\tkeys: { enumerable: true },\n\tvalues: { enumerable: true },\n\tentries: { enumerable: true }\n});\n\nfunction getHeaders(headers) {\n\tlet kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';\n\n\tconst keys = Object.keys(headers[MAP]).sort();\n\treturn keys.map(kind === 'key' ? function (k) {\n\t\treturn k.toLowerCase();\n\t} : kind === 'value' ? function (k) {\n\t\treturn headers[MAP][k].join(', ');\n\t} : function (k) {\n\t\treturn [k.toLowerCase(), headers[MAP][k].join(', ')];\n\t});\n}\n\nconst INTERNAL = Symbol('internal');\n\nfunction createHeadersIterator(target, kind) {\n\tconst iterator = Object.create(HeadersIteratorPrototype);\n\titerator[INTERNAL] = {\n\t\ttarget,\n\t\tkind,\n\t\tindex: 0\n\t};\n\treturn iterator;\n}\n\nconst HeadersIteratorPrototype = Object.setPrototypeOf({\n\tnext() {\n\t\t// istanbul ignore if\n\t\tif (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {\n\t\t\tthrow new TypeError('Value of `this` is not a HeadersIterator');\n\t\t}\n\n\t\tvar _INTERNAL = this[INTERNAL];\n\t\tconst target = _INTERNAL.target,\n\t\t kind = _INTERNAL.kind,\n\t\t index = _INTERNAL.index;\n\n\t\tconst values = getHeaders(target, kind);\n\t\tconst len = values.length;\n\t\tif (index >= len) {\n\t\t\treturn {\n\t\t\t\tvalue: undefined,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t}\n\n\t\tthis[INTERNAL].index = index + 1;\n\n\t\treturn {\n\t\t\tvalue: values[index],\n\t\t\tdone: false\n\t\t};\n\t}\n}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));\n\nObject.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {\n\tvalue: 'HeadersIterator',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * Export the Headers object in a form that Node.js can consume.\n *\n * @param Headers headers\n * @return Object\n */\nfunction exportNodeCompatibleHeaders(headers) {\n\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\n\n\t// http.request() only supports string as Host header. This hack makes\n\t// specifying custom Host header possible.\n\tconst hostHeaderKey = find(headers[MAP], 'Host');\n\tif (hostHeaderKey !== undefined) {\n\t\tobj[hostHeaderKey] = obj[hostHeaderKey][0];\n\t}\n\n\treturn obj;\n}\n\n/**\n * Create a Headers object from an object of headers, ignoring those that do\n * not conform to HTTP grammar productions.\n *\n * @param Object obj Object of headers\n * @return Headers\n */\nfunction createHeadersLenient(obj) {\n\tconst headers = new Headers();\n\tfor (const name of Object.keys(obj)) {\n\t\tif (invalidTokenRegex.test(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(obj[name])) {\n\t\t\tfor (const val of obj[name]) {\n\t\t\t\tif (invalidHeaderCharRegex.test(val)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (headers[MAP][name] === undefined) {\n\t\t\t\t\theaders[MAP][name] = [val];\n\t\t\t\t} else {\n\t\t\t\t\theaders[MAP][name].push(val);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!invalidHeaderCharRegex.test(obj[name])) {\n\t\t\theaders[MAP][name] = [obj[name]];\n\t\t}\n\t}\n\treturn headers;\n}\n\nconst INTERNALS$1 = Symbol('Response internals');\n\n// fix an issue where \"STATUS_CODES\" aren't a named export for node <10\nconst STATUS_CODES = http.STATUS_CODES;\n\n/**\n * Response class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nclass Response {\n\tconstructor() {\n\t\tlet body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\t\tlet opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tBody.call(this, body, opts);\n\n\t\tconst status = opts.status || 200;\n\t\tconst headers = new Headers(opts.headers);\n\n\t\tif (body != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS$1] = {\n\t\t\turl: opts.url,\n\t\t\tstatus,\n\t\t\tstatusText: opts.statusText || STATUS_CODES[status],\n\t\t\theaders,\n\t\t\tcounter: opts.counter\n\t\t};\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS$1].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS$1].status;\n\t}\n\n\t/**\n * Convenience property representing if the request ended normally\n */\n\tget ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS$1].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS$1].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$1].headers;\n\t}\n\n\t/**\n * Clone this response\n *\n * @return Response\n */\n\tclone() {\n\t\treturn new Response(clone(this), {\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected\n\t\t});\n\t}\n}\n\nBody.mixIn(Response.prototype);\n\nObject.defineProperties(Response.prototype, {\n\turl: { enumerable: true },\n\tstatus: { enumerable: true },\n\tok: { enumerable: true },\n\tredirected: { enumerable: true },\n\tstatusText: { enumerable: true },\n\theaders: { enumerable: true },\n\tclone: { enumerable: true }\n});\n\nObject.defineProperty(Response.prototype, Symbol.toStringTag, {\n\tvalue: 'Response',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nconst INTERNALS$2 = Symbol('Request internals');\n\n// fix an issue where \"format\", \"parse\" aren't a named export for node <10\nconst parse_url = Url.parse;\nconst format_url = Url.format;\n\nconst streamDestructionSupported = 'destroy' in Stream.Readable.prototype;\n\n/**\n * Check if a value is an instance of Request.\n *\n * @param Mixed input\n * @return Boolean\n */\nfunction isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}\n\nfunction isAbortSignal(signal) {\n\tconst proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);\n\treturn !!(proto && proto.constructor.name === 'AbortSignal');\n}\n\n/**\n * Request class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nclass Request {\n\tconstructor(input) {\n\t\tlet init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tlet parsedURL;\n\n\t\t// normalize input\n\t\tif (!isRequest(input)) {\n\t\t\tif (input && input.href) {\n\t\t\t\t// in order to support Node.js' Url objects; though WHATWG's URL objects\n\t\t\t\t// will fall into this branch also (since their `toString()` will return\n\t\t\t\t// `href` property anyway)\n\t\t\t\tparsedURL = parse_url(input.href);\n\t\t\t} else {\n\t\t\t\t// coerce input to a string before attempting to parse\n\t\t\t\tparsedURL = parse_url(`${input}`);\n\t\t\t}\n\t\t\tinput = {};\n\t\t} else {\n\t\t\tparsedURL = parse_url(input.url);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tmethod = method.toUpperCase();\n\n\t\tif ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tlet inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;\n\n\t\tBody.call(this, inputBody, {\n\t\t\ttimeout: init.timeout || input.timeout || 0,\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ? input.signal : null;\n\t\tif ('signal' in init) signal = init.signal;\n\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal');\n\t\t}\n\n\t\tthis[INTERNALS$2] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal\n\t\t};\n\n\t\t// node-fetch-only options\n\t\tthis.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;\n\t\tthis.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t}\n\n\tget method() {\n\t\treturn this[INTERNALS$2].method;\n\t}\n\n\tget url() {\n\t\treturn format_url(this[INTERNALS$2].parsedURL);\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$2].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS$2].redirect;\n\t}\n\n\tget signal() {\n\t\treturn this[INTERNALS$2].signal;\n\t}\n\n\t/**\n * Clone this request\n *\n * @return Request\n */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n}\n\nBody.mixIn(Request.prototype);\n\nObject.defineProperty(Request.prototype, Symbol.toStringTag, {\n\tvalue: 'Request',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Request.prototype, {\n\tmethod: { enumerable: true },\n\turl: { enumerable: true },\n\theaders: { enumerable: true },\n\tredirect: { enumerable: true },\n\tclone: { enumerable: true },\n\tsignal: { enumerable: true }\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param Request A Request instance\n * @return Object The options object to be passed to http.request\n */\nfunction getNodeRequestOptions(request) {\n\tconst parsedURL = request[INTERNALS$2].parsedURL;\n\tconst headers = new Headers(request[INTERNALS$2].headers);\n\n\t// fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// Basic fetch\n\tif (!parsedURL.protocol || !parsedURL.hostname) {\n\t\tthrow new TypeError('Only absolute URLs are supported');\n\t}\n\n\tif (!/^https?:$/.test(parsedURL.protocol)) {\n\t\tthrow new TypeError('Only HTTP(S) protocols are supported');\n\t}\n\n\tif (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {\n\t\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\tif (request.body != null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\tif (typeof totalBytes === 'number') {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate');\n\t}\n\n\tlet agent = request.agent;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\tif (!headers.has('Connection') && !agent) {\n\t\theaders.set('Connection', 'close');\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\treturn Object.assign({}, parsedURL, {\n\t\tmethod: request.method,\n\t\theaders: exportNodeCompatibleHeaders(headers),\n\t\tagent\n\t});\n}\n\n/**\n * abort-error.js\n *\n * AbortError interface for cancelled requests\n */\n\n/**\n * Create AbortError instance\n *\n * @param String message Error message for human\n * @return AbortError\n */\nfunction AbortError(message) {\n Error.call(this, message);\n\n this.type = 'aborted';\n this.message = message;\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nAbortError.prototype = Object.create(Error.prototype);\nAbortError.prototype.constructor = AbortError;\nAbortError.prototype.name = 'AbortError';\n\n// fix an issue where \"PassThrough\", \"resolve\" aren't a named export for node <10\nconst PassThrough$1 = Stream.PassThrough;\nconst resolve_url = Url.resolve;\n\n/**\n * Fetch function\n *\n * @param Mixed url Absolute url or Request instance\n * @param Object opts Fetch options\n * @return Promise\n */\nfunction fetch(url, opts) {\n\n\t// allow custom promise\n\tif (!fetch.Promise) {\n\t\tthrow new Error('native promise missing, set fetch.Promise to your favorite alternative');\n\t}\n\n\tBody.Promise = fetch.Promise;\n\n\t// wrap http.request into fetch\n\treturn new fetch.Promise(function (resolve, reject) {\n\t\t// build request object\n\t\tconst request = new Request(url, opts);\n\t\tconst options = getNodeRequestOptions(request);\n\n\t\tconst send = (options.protocol === 'https:' ? https : http).request;\n\t\tconst signal = request.signal;\n\n\t\tlet response = null;\n\n\t\tconst abort = function abort() {\n\t\t\tlet error = new AbortError('The user aborted a request.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\trequest.body.destroy(error);\n\t\t\t}\n\t\t\tif (!response || !response.body) return;\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = function abortAndFinalize() {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// send request\n\t\tconst req = send(options);\n\t\tlet reqTimeout;\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tfunction finalize() {\n\t\t\treq.abort();\n\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\tclearTimeout(reqTimeout);\n\t\t}\n\n\t\tif (request.timeout) {\n\t\t\treq.once('socket', function (socket) {\n\t\t\t\treqTimeout = setTimeout(function () {\n\t\t\t\t\treject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));\n\t\t\t\t\tfinalize();\n\t\t\t\t}, request.timeout);\n\t\t\t});\n\t\t}\n\n\t\treq.on('error', function (err) {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\n\t\t\tfinalize();\n\t\t});\n\n\t\treq.on('response', function (res) {\n\t\t\tclearTimeout(reqTimeout);\n\n\t\t\tconst headers = createHeadersLenient(res.headers);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (fetch.isRedirect(res.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tconst locationURL = location === null ? null : resolve_url(request.url, location);\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\n\t\t\t\t\t\tif (locationURL !== null) {\n\t\t\t\t\t\t\t// handle corrupted header\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\theaders.set('Location', locationURL);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request\n\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow':\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOpts = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: request.body,\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\ttimeout: request.timeout,\n\t\t\t\t\t\t\tsize: request.size\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {\n\t\t\t\t\t\t\trequestOpts.method = 'GET';\n\t\t\t\t\t\t\trequestOpts.body = undefined;\n\t\t\t\t\t\t\trequestOpts.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOpts)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// prepare response\n\t\t\tres.once('end', function () {\n\t\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\t});\n\t\t\tlet body = res.pipe(new PassThrough$1());\n\n\t\t\tconst response_options = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: res.statusCode,\n\t\t\t\tstatusText: res.statusMessage,\n\t\t\t\theaders: headers,\n\t\t\t\tsize: request.size,\n\t\t\t\ttimeout: request.timeout,\n\t\t\t\tcounter: request.counter\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// for gzip\n\t\t\tif (codings == 'gzip' || codings == 'x-gzip') {\n\t\t\t\tbody = body.pipe(zlib.createGunzip(zlibOptions));\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for deflate\n\t\t\tif (codings == 'deflate' || codings == 'x-deflate') {\n\t\t\t\t// handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = res.pipe(new PassThrough$1());\n\t\t\t\traw.once('data', function (chunk) {\n\t\t\t\t\t// see http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflate());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflateRaw());\n\t\t\t\t\t}\n\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for br\n\t\t\tif (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {\n\t\t\t\tbody = body.pipe(zlib.createBrotliDecompress());\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// otherwise, use response as-is\n\t\t\tresponse = new Response(body, response_options);\n\t\t\tresolve(response);\n\t\t});\n\n\t\twriteToStream(req, request);\n\t});\n}\n/**\n * Redirect code matching\n *\n * @param Number code Status code\n * @return Boolean\n */\nfetch.isRedirect = function (code) {\n\treturn code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n};\n\n// expose Promise\nfetch.Promise = global.Promise;\n\nexport default fetch;\nexport { Headers, Request, Response, FetchError };\n","var nodeFetch = require('node-fetch')\nvar realFetch = nodeFetch.default || nodeFetch\n\nvar fetch = function (url, options) {\n // Support schemaless URIs on the server for parity with the browser.\n // Ex: //github.com/ -> https://github.com/\n if (/^\\/\\//.test(url)) {\n url = 'https:' + url\n }\n return realFetch.call(this, url, options)\n}\n\nmodule.exports = exports = fetch\nexports.fetch = fetch\nexports.Headers = nodeFetch.Headers\nexports.Request = nodeFetch.Request\nexports.Response = nodeFetch.Response\n\n// Needed for TypeScript consumers without esModuleInterop.\nexports.default = fetch\n","import fetch from \"cross-fetch\";\nimport JSBI from \"jsbi\";\n\nfunction mergeOptions(overrideOptions, defaultOptions) {\n defaultOptions = defaultOptions || {};\n const headers = Object.assign(\n {},\n defaultOptions.headers || {},\n overrideOptions.headers || {}\n );\n return Object.assign({}, defaultOptions, overrideOptions, {\n headers: headers\n });\n}\n\nconst batchHandler = {\n get: (target, method, receiver) => {\n if (method === \"send\") {\n return async () => {\n const response = await fetch(\n target.uri,\n mergeOptions(\n {\n method: \"post\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(target.payload)\n },\n target.defaultOptions\n )\n );\n return await response.json();\n };\n }\n return (...params) => {\n const id = target.id;\n target.id = target.id + 1;\n target.payload.push({\n jsonrpc: \"2.0\",\n id: id,\n method: method,\n params: params\n });\n return receiver;\n };\n }\n};\n\nconst handler = {\n get: (target, method) => {\n if (method === \"batch\") {\n return () => {\n return new Proxy(\n {\n id: Math.round(Math.random() * 10000000),\n payload: [],\n uri: target.uri,\n defaultOptions: target.defaultOptions\n },\n batchHandler\n );\n };\n }\n return async (...params) => {\n const id = Math.round(Math.random() * 10000000);\n const response = await fetch(\n target.uri,\n mergeOptions(\n {\n method: \"post\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n jsonrpc: \"2.0\",\n id: id,\n method: method,\n params: params\n })\n },\n target.defaultOptions\n )\n );\n const data = await response.json();\n if (data.id !== id) {\n throw new Error(\"JSONRPCError: response ID does not match request ID!\");\n }\n if (data.error) {\n throw new Error(\n `JSONRPCError: server error ${JSON.stringify(data.error)}`\n );\n }\n return data.result;\n };\n }\n};\n\nexport class RPC {\n constructor(uri, defaultOptions = {}) {\n this.uri = uri;\n this.defaultOptions = defaultOptions;\n return new Proxy(this, handler);\n }\n\n static create(uri) {\n return new RPC(uri);\n }\n}\n\nexport function HexStringToBigInt(hexString) {\n return JSBI.BigInt(hexString);\n}\n\nexport function BigIntToHexString(bigInt) {\n return \"0x\" + bigInt.toString(16);\n}\n","// This package provides normalizer functions. Even though CKB uses molecule\n// as the serialization layer. There is still CKB specific knowledge that does\n// not belong in molecule. For example, all numbers in CKB protocols are\n// serialized using little endian format. This package tries to encode such\n// knowledge. The goal here, is that you are free to use whatever types that\n// makes most sense to represent the values. As long as you pass your object\n// through the normalizers here, molecule should be able to serialize the values\n// into correct formats required by CKB.\n//\n// Note this is only used when you need to deal with CKB structures in molecule\n// format. If you are using RPCs or GraphQL to interact with CKB, chances are you\n// will not need this package.\nimport JSBI from \"jsbi\";\nimport { Reader } from \"./reader\";\nimport { BigIntToHexString } from \"./rpc\";\n\nfunction normalizeHexNumber(length) {\n return function(debugPath, value) {\n if (!(value instanceof ArrayBuffer)) {\n let intValue = BigIntToHexString(JSBI.BigInt(value)).substr(2);\n if (intValue.length % 2 !== 0) {\n intValue = \"0\" + intValue;\n }\n if (intValue.length / 2 > length) {\n throw new Error(\n `${debugPath} is ${intValue.length /\n 2} bytes long, expected length is ${length}!`\n );\n }\n const view = new DataView(new ArrayBuffer(length));\n for (let i = 0; i < intValue.length / 2; i++) {\n const start = intValue.length - (i + 1) * 2;\n view.setUint8(i, parseInt(intValue.substr(start, 2), 16));\n }\n value = view.buffer;\n }\n if (value.byteLength < length) {\n const array = new Uint8Array(length);\n array.set(new Uint8Array(value), 0);\n value = array.buffer;\n }\n return value;\n };\n}\n\nfunction normalizeRawData(length) {\n return function(debugPath, value) {\n value = new Reader(value).toArrayBuffer();\n if (length > 0 && value.byteLength !== length) {\n throw new Error(\n `${debugPath} has invalid length ${value.byteLength}, required: ${length}`\n );\n }\n return value;\n };\n}\n\nfunction normalizeObject(debugPath, object, keys) {\n const result = {};\n\n for (const [key, f] of Object.entries(keys)) {\n const value = object[key];\n if (!value) {\n throw new Error(`${debugPath} is missing ${key}!`);\n }\n result[key] = f(`${debugPath}.${key}`, value);\n }\n return result;\n}\n\nexport function NormalizeScript(script, { debugPath = \"script\" } = {}) {\n return normalizeObject(debugPath, script, {\n code_hash: normalizeRawData(32),\n hash_type: function(debugPath, value) {\n switch (value) {\n case \"data\":\n return 0;\n case \"type\":\n return 1;\n case 0:\n return value;\n case 1:\n return value;\n default:\n throw new Error(`${debugPath}.hash_type has invalid value: ${value}`);\n }\n },\n args: normalizeRawData(-1)\n });\n}\n\nexport function NormalizeOutPoint(outPoint, { debugPath = \"out_point\" } = {}) {\n return normalizeObject(debugPath, outPoint, {\n tx_hash: normalizeRawData(32),\n index: normalizeHexNumber(4)\n });\n}\n\nfunction toNormalize(normalize) {\n return function(debugPath, value) {\n return normalize(value, {\n debugPath\n });\n };\n}\n\nexport function NormalizeCellInput(\n cellInput,\n { debugPath = \"cell_input\" } = {}\n) {\n return normalizeObject(debugPath, cellInput, {\n since: normalizeHexNumber(8),\n previous_output: toNormalize(NormalizeOutPoint)\n });\n}\n\nexport function NormalizeCellOutput(\n cellOutput,\n { debugPath = \"cell_output\" } = {}\n) {\n const result = normalizeObject(debugPath, cellOutput, {\n capacity: normalizeHexNumber(8),\n lock: toNormalize(NormalizeScript)\n });\n if (cellOutput.type) {\n result.type_ = NormalizeScript(cellOutput.type, {\n debugPath: `${debugPath}.type`\n });\n }\n return result;\n}\n\nexport function NormalizeCellDep(cellDep, { debugPath = \"cell_dep\" } = {}) {\n return normalizeObject(debugPath, cellDep, {\n out_point: toNormalize(NormalizeOutPoint),\n dep_type: function(debugPath, value) {\n switch (value) {\n case \"code\":\n return 0;\n case \"dep_group\":\n return 1;\n case 0:\n return value;\n case 1:\n return value;\n default:\n throw new Error(`${debugPath}.dep_type has invalid value: ${value}`);\n }\n }\n });\n}\n\nfunction toNormalizeArray(normalizeFunction) {\n return function(debugPath, array) {\n return array.map((item, i) => {\n return normalizeFunction(`${debugPath}[${i}]`, item);\n });\n };\n}\n\nexport function NormalizeRawTransaction(\n rawTransaction,\n { debugPath = \"raw_transaction\" } = {}\n) {\n return normalizeObject(debugPath, rawTransaction, {\n version: normalizeHexNumber(4),\n cell_deps: toNormalizeArray(toNormalize(NormalizeCellDep)),\n header_deps: toNormalizeArray(normalizeRawData(32)),\n inputs: toNormalizeArray(toNormalize(NormalizeCellInput)),\n outputs: toNormalizeArray(toNormalize(NormalizeCellOutput)),\n outputs_data: toNormalizeArray(normalizeRawData(-1))\n });\n}\n\nexport function NormalizeTransaction(\n transaction,\n { debugPath = \"transaction\" } = {}\n) {\n const rawTransaction = NormalizeRawTransaction(transaction, {\n debugPath: `(raw)${debugPath}`\n });\n const result = normalizeObject(debugPath, transaction, {\n witnesses: toNormalizeArray(normalizeRawData(-1))\n });\n result.raw = rawTransaction;\n return result;\n}\n\nexport function NormalizeRawHeader(\n rawHeader,\n { debugPath = \"raw_header\" } = {}\n) {\n return normalizeObject(debugPath, rawHeader, {\n version: normalizeHexNumber(4),\n compact_target: normalizeHexNumber(4),\n timestamp: normalizeHexNumber(8),\n number: normalizeHexNumber(8),\n epoch: normalizeHexNumber(8),\n parent_hash: normalizeRawData(32),\n transactions_root: normalizeRawData(32),\n proposals_hash: normalizeRawData(32),\n uncles_hash: normalizeRawData(32),\n dao: normalizeRawData(32)\n });\n}\n\nexport function NormalizeHeader(header, { debugPath = \"header\" } = {}) {\n const rawHeader = NormalizeRawHeader(header, {\n debugPath: `(raw)${debugPath}`\n });\n const result = normalizeObject(debugPath, header, {\n nonce: normalizeHexNumber(16)\n });\n result.raw = rawHeader;\n return result;\n}\n\nexport function NormalizeUncleBlock(\n uncleBlock,\n { debugPath = \"uncle_block\" } = {}\n) {\n return normalizeObject(debugPath, uncleBlock, {\n header: toNormalize(NormalizeHeader),\n proposals: toNormalizeArray(normalizeRawData(10))\n });\n}\n\nexport function NormalizeBlock(block, { debugPath = \"block\" } = {}) {\n return normalizeObject(debugPath, block, {\n header: toNormalize(NormalizeHeader),\n uncles: toNormalizeArray(toNormalize(NormalizeUncleBlock)),\n transactions: toNormalizeArray(toNormalize(NormalizeTransaction)),\n proposals: toNormalizeArray(normalizeRawData(10))\n });\n}\n\nexport function NormalizeCellbaseWitness(\n cellbaseWitness,\n { debugPath = \"cellbase_witness\" } = {}\n) {\n return normalizeObject(debugPath, cellbaseWitness, {\n lock: toNormalize(NormalizeScript),\n message: normalizeRawData(-1)\n });\n}\n\nexport function NormalizeWitnessArgs(\n witnessArgs,\n { debugPath = \"witness_args\" } = {}\n) {\n const result = {};\n if (witnessArgs.lock) {\n result.lock = normalizeRawData(-1)(`${debugPath}.lock`, witnessArgs.lock);\n }\n if (witnessArgs.input_type) {\n result.input_type = normalizeRawData(-1)(\n `${debugPath}.input_type`,\n witnessArgs.input_type\n );\n }\n if (witnessArgs.output_type) {\n result.output_type = normalizeRawData(-1)(\n `${debugPath}.output_type`,\n witnessArgs.output_type\n );\n }\n return result;\n}\n","// This package provides transformer functions that transform JavaScript objects\n// into JSON ready objects that can be passed to RPC. It following the following\n// rules:\n//\n// 1. If the specified object has a serializeJson method, it would invoke this\n// method and use the result to replace current object.\n// 2. It then restricts the keys of the object to keys required by the specified\n// entity(i.e., a Script would only have code_hash, hash_type, args keys),for each\n// sub-field, it then recursively perform the steps here from step 1.\n// 3. It then optionally run validator functions to ensure the resulting object\n// follows specified rules.\n//\n// Note rule 1 here provides the flexibility in defining your own structures: you\n// could define a class containing custom data structures, then provide a\n// serializeJson that transforms the custom one into the rigid data structure\n// required by CKB. You can also leverage the Reader class we provide as much as\n// possible. Since Reader class does provide serializeJson methods, transformers\n// here will transform them to valid hex strings required by CKB.\nimport * as validators from \"./validators\";\n\nfunction invokeSerializeJson(debugPath, value) {\n if (value instanceof Object && value.serializeJson instanceof Function) {\n return value.serializeJson.call(value);\n }\n return value;\n}\n\nfunction transformObject(debugPath, object, keys) {\n object = invokeSerializeJson(debugPath, object);\n if (!(object instanceof Object)) {\n throw new Error(`Transformed ${debugPath} is not an object!`);\n }\n const result = {};\n\n for (const [key, f] of Object.entries(keys)) {\n let value = object[key];\n if (!value) {\n const camelKey = key.replace(/(_[a-z])/g, group =>\n group.toUpperCase().replace(\"_\", \"\")\n );\n value = object[camelKey];\n }\n if (value) {\n result[key] = f(`${debugPath}.${key}`, value);\n }\n }\n return result;\n}\n\nexport function TransformScript(\n script,\n { validation = true, debugPath = \"script\" } = {}\n) {\n script = transformObject(debugPath, script, {\n code_hash: invokeSerializeJson,\n hash_type: invokeSerializeJson,\n args: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateScript(script, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return script;\n}\n\nexport function TransformOutPoint(\n outPoint,\n { validation = true, debugPath = \"out_point\" } = {}\n) {\n outPoint = transformObject(debugPath, outPoint, {\n tx_hash: invokeSerializeJson,\n index: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateOutPoint(outPoint, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return outPoint;\n}\n\nfunction toInvoke(transform) {\n return function(debugPath, value) {\n return transform(value, {\n validation: false,\n debugPath\n });\n };\n}\n\nexport function TransformCellInput(\n cellInput,\n { validation = true, debugPath = \"cell_input\" } = {}\n) {\n cellInput = transformObject(debugPath, cellInput, {\n since: invokeSerializeJson,\n previous_output: toInvoke(TransformOutPoint)\n });\n\n if (validation) {\n validators.ValidateCellInput(cellInput, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return cellInput;\n}\n\nexport function TransformCellOutput(\n cellOutput,\n { validation = true, debugPath = \"cell_output\" } = {}\n) {\n cellOutput = transformObject(debugPath, cellOutput, {\n capacity: invokeSerializeJson,\n lock: toInvoke(TransformScript),\n type: toInvoke(TransformScript)\n });\n\n if (validation) {\n validators.ValidateCellOutput(cellOutput, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return cellOutput;\n}\n\nexport function TransformCellDep(\n cellDep,\n { validation = true, debugPath = \"cell_dep\" } = {}\n) {\n cellDep = transformObject(debugPath, cellDep, {\n out_point: toInvoke(TransformOutPoint),\n dep_type: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateCellDep(cellDep, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return cellDep;\n}\n\nfunction toInvokeArray(invokeFunction) {\n return function(debugPath, array) {\n return array.map((item, i) => {\n return invokeFunction(`${debugPath}[${i}]`, item);\n });\n };\n}\n\nexport function TransformRawTransaction(\n rawTransaction,\n { validation = true, debugPath = \"raw_transaction\" } = {}\n) {\n rawTransaction = transformObject(debugPath, rawTransaction, {\n version: invokeSerializeJson,\n cell_deps: toInvokeArray(toInvoke(TransformCellDep)),\n header_deps: toInvokeArray(invokeSerializeJson),\n inputs: toInvokeArray(toInvoke(TransformCellInput)),\n outputs: toInvokeArray(toInvoke(TransformCellOutput)),\n outputs_data: toInvokeArray(invokeSerializeJson)\n });\n\n if (validation) {\n validators.ValidateRawTransaction(rawTransaction, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return rawTransaction;\n}\n\nexport function TransformTransaction(\n transaction,\n { validation = true, debugPath = \"transaction\" } = {}\n) {\n transaction = transformObject(debugPath, transaction, {\n version: invokeSerializeJson,\n cell_deps: toInvokeArray(toInvoke(TransformCellDep)),\n header_deps: toInvokeArray(invokeSerializeJson),\n inputs: toInvokeArray(toInvoke(TransformCellInput)),\n outputs: toInvokeArray(toInvoke(TransformCellOutput)),\n outputs_data: toInvokeArray(invokeSerializeJson),\n witnesses: toInvokeArray(invokeSerializeJson)\n });\n\n if (validation) {\n validators.ValidateTransaction(transaction, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return transaction;\n}\n\nexport function TransformRawHeader(\n rawHeader,\n { validation = true, debugPath = \"raw_header\" } = {}\n) {\n rawHeader = transformObject(debugPath, rawHeader, {\n version: invokeSerializeJson,\n compact_target: invokeSerializeJson,\n timestamp: invokeSerializeJson,\n number: invokeSerializeJson,\n epoch: invokeSerializeJson,\n parent_hash: invokeSerializeJson,\n transactions_root: invokeSerializeJson,\n proposals_hash: invokeSerializeJson,\n uncles_hash: invokeSerializeJson,\n dao: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateRawHeader(rawHeader, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return rawHeader;\n}\n\nexport function TransformHeader(\n header,\n { validation = true, debugPath = \"header\" } = {}\n) {\n header = transformObject(debugPath, header, {\n version: invokeSerializeJson,\n compact_target: invokeSerializeJson,\n timestamp: invokeSerializeJson,\n number: invokeSerializeJson,\n epoch: invokeSerializeJson,\n parent_hash: invokeSerializeJson,\n transactions_root: invokeSerializeJson,\n proposals_hash: invokeSerializeJson,\n uncles_hash: invokeSerializeJson,\n dao: invokeSerializeJson,\n nonce: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateHeader(header, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return header;\n}\n\nexport function TransformUncleBlock(\n uncleBlock,\n { validation = true, debugPath = \"uncle_block\" } = {}\n) {\n uncleBlock = transformObject(debugPath, uncleBlock, {\n header: toInvoke(TransformHeader),\n proposals: toInvokeArray(invokeSerializeJson)\n });\n\n if (validation) {\n validators.ValidateUncleBlock(uncleBlock, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return uncleBlock;\n}\n\nexport function TransformBlock(\n block,\n { validation = true, debugPath = \"block\" } = {}\n) {\n block = transformObject(debugPath, block, {\n header: toInvoke(TransformHeader),\n uncles: toInvokeArray(toInvoke(TransformUncleBlock)),\n transactions: toInvokeArray(toInvoke(TransformTransaction)),\n proposals: toInvokeArray(invokeSerializeJson)\n });\n\n if (validation) {\n validators.ValidateBlock(block, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return block;\n}\n\nexport function TransformCellbaseWitness(\n cellbaseWitness,\n { validation = true, debugPath = \"cellbase_witness\" } = {}\n) {\n cellbaseWitness = transformObject(debugPath, cellbaseWitness, {\n lock: toInvoke(TransformScript),\n message: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateCellbaseWitness(cellbaseWitness, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return cellbaseWitness;\n}\n\nexport function TransformWitnessArgs(\n witnessArgs,\n { validation = true, debugPath = \"witness_args\" } = {}\n) {\n witnessArgs = transformObject(debugPath, witnessArgs, {\n lock: invokeSerializeJson,\n input_type: invokeSerializeJson,\n output_type: invokeSerializeJson\n });\n\n if (validation) {\n validators.ValidateWitnessArgs(witnessArgs, {\n debugPath: `(transformed) ${debugPath}`\n });\n }\n return witnessArgs;\n}\n","import JSBI from \"jsbi\";\nimport { Reader } from \"../reader\";\nimport { HexStringToBigInt, BigIntToHexString } from \"../rpc\";\n\nexport class RPCCollector {\n constructor(\n rpc,\n lockHash,\n {\n skipCellWithContent = true,\n loadData = false,\n loadBlockNumber = true\n } = {}\n ) {\n this.rpc = rpc;\n this.lockHash = new Reader(lockHash).serializeJson();\n this.skipCellWithContent = skipCellWithContent;\n this.loadData = loadData;\n this.loadBlockNumber = loadBlockNumber;\n }\n\n async *collect() {\n const to = HexStringToBigInt(await this.rpc.get_tip_block_number());\n let currentFrom = JSBI.BigInt(0);\n while (JSBI.lessThanOrEqual(currentFrom, to)) {\n let currentTo = JSBI.add(currentFrom, JSBI.BigInt(100));\n if (JSBI.greaterThan(currentTo, to)) {\n currentTo = to;\n }\n const cells = await this.rpc.get_cells_by_lock_hash(\n this.lockHash,\n BigIntToHexString(currentFrom),\n BigIntToHexString(currentTo)\n );\n for (const cell of cells) {\n if (this.skipCellWithContent) {\n if (\n cell.type ||\n JSBI.greaterThan(\n HexStringToBigInt(cell.output_data_len),\n JSBI.BigInt(100)\n )\n ) {\n continue;\n }\n }\n let data = null;\n if (this.loadData) {\n const cellWithData = await this.rpc.get_live_cell(\n cell.out_point,\n true\n );\n data = cellWithData.cell.data.content;\n }\n let block_number = null;\n if (this.loadBlockNumber) {\n const header = await this.rpc.get_header(cell.block_hash);\n block_number = header.number;\n }\n yield {\n cellbase: cell.cellbase,\n cell_output: {\n capacity: cell.capacity,\n lock: cell.lock,\n type: cell.type\n },\n out_point: cell.out_point,\n block_hash: cell.block_hash,\n data: data,\n output_data_len: cell.output_data_len,\n block_number\n };\n }\n currentFrom = JSBI.add(currentTo, JSBI.BigInt(1));\n }\n }\n}\n","import JSBI from \"jsbi\";\nimport { Reader } from \"./reader\";\nimport { ValidateTransaction, ValidateOutPoint } from \"./validators\";\n\nexport class TransactionDumper {\n constructor(\n rpc,\n { validateTransaction = true, depGroupUnpacker = null } = {}\n ) {\n this.rpc = rpc;\n this.validateTransaction = validateTransaction;\n this.depGroupUnpacker = depGroupUnpacker;\n }\n\n async dumpByHash(txHash) {\n const tx = (await this.rpc.get_transaction(txHash)).transaction;\n delete tx.hash;\n return await this.dump(tx);\n }\n\n async dump(tx) {\n if (this.validateTransaction) {\n ValidateTransaction(tx);\n }\n const mockInputs = [];\n for (const input of tx.inputs) {\n const { output, data, header } = await this._resolveOutPoint(\n input.previous_output\n );\n mockInputs.push({ input, output, data, header });\n }\n const mockCellDeps = [];\n for (const cellDep of tx.cell_deps) {\n const { output, data, header } = await this._resolveOutPoint(\n cellDep.out_point\n );\n mockCellDeps.push({\n cell_dep: cellDep,\n output,\n data,\n header\n });\n if (cellDep.dep_type === \"dep_group\") {\n if (!this.depGroupUnpacker) {\n throw new Error(\n \"depGroupUnpacker must be provided when the transaction contains dep_group!\"\n );\n }\n const outPoints = this.depGroupUnpacker(new Reader(data));\n for (const outPoint of outPoints) {\n ValidateOutPoint(outPoint);\n const { output, data, header } = await this._resolveOutPoint(\n outPoint\n );\n mockCellDeps.push({\n cell_dep: {\n out_point: outPoint,\n dep_type: \"code\"\n },\n output,\n data,\n header\n });\n }\n }\n }\n const mockHeaderDeps = [];\n for (const headerDep of tx.header_deps) {\n mockHeaderDeps.push(await this.rpc.get_header(headerDep));\n }\n return JSON.stringify({\n mock_info: {\n inputs: mockInputs,\n cell_deps: mockCellDeps,\n header_deps: mockHeaderDeps\n },\n tx\n });\n }\n\n async _resolveOutPoint(out_point) {\n const txStatus = await this.rpc.get_transaction(out_point.tx_hash);\n if (!txStatus || !txStatus.transaction) {\n throw new Error(`Transaction ${out_point.tx_hash} cannot be found!`);\n }\n const tx = txStatus.transaction;\n const index = JSBI.toNumber(JSBI.BigInt(out_point.index));\n if (index >= tx.outputs.length) {\n throw new Error(\n `Transaction ${out_point.tx_hash} does not have output ${index}!`\n );\n }\n const data = {\n output: tx.outputs[index],\n data: tx.outputs_data[index]\n };\n if (txStatus.tx_status.status === \"committed\") {\n data.header = txStatus.tx_status.block_hash;\n }\n return data;\n }\n}\n","export { Reader } from \"./reader.js\";\nexport { TransactionDumper } from \"./transaction_dumper.js\";\nexport { RPC, HexStringToBigInt, BigIntToHexString } from \"./rpc.js\";\nexport * as normalizers from \"./normalizers\";\nexport * as transformers from \"./transformers\";\nexport * as validators from \"./validators\";\nexport * as cell_collectors from \"./cell_collectors\";\nexport const VERSION = \"__development_build__\";\n"],"names":["BaseReader","[object Object]","this","__isByteLikeReader__","x","ArrayBufferReader","buffer","super","view","DataView","byteLength","i","getUint8","Array","prototype","map","call","Uint8Array","toString","slice","join","HexStringReader","string","length","parseInt","substr","ArrayBuffer","setUint8","indexAt","Reader","input","startsWith","Error","from","c","charCodeAt","JSBI","a","b","__kMaxLength","RangeError","sign","Math","floor","Number","isFinite","__zero","__oneDigit","__fromDouble","__fromString","SyntaxError","constructor","__toPrimitive","BigInt","TypeError","push","__toStringBasePowerOfTwo","__toStringGeneric","clz32","__unsignedDigit","d","__digit","e","f","Infinity","g","h","j","k","l","m","n","o","__decideRounding","p","__kBitConversionInts","__kBitConversionDouble","__copy","__absoluteSubOne","__trim","__absoluteAddOne","unaryMinus","__kMaxLengthBits","__initializeDigits","__setDigit","multiply","__clzmsd","__multiplyAccumulate","__absoluteCompare","__absoluteDivSmall","__absoluteDivLarge","__absoluteModSmall","__absoluteAdd","__absoluteSub","__rightShiftByAbsolute","__leftShiftByAbsolute","__compareToBigInt","equal","max","__absoluteAnd","__absoluteOr","__absoluteAndNot","__absoluteXor","__truncateToNBits","__truncateAndSubFromPowerOfTwo","__toNumeric","__isBigInt","add","__compare","EQ","__equalToNumber","pop","__isWhitespace","__kMaxBitsPerChar","__kBitsPerCharTableMultiplier","__kBitsPerCharTableShift","__fillFromParts","q","__inplaceMultiplyAdd","__kConversionChars","exponentiate","__halfDigit","__setHalfDigit","quotient","remainder","__unequalSign","__absoluteGreater","__absoluteLess","abs","__compareToDouble","__comparisonResultToBool","__compareToNumber","__setDigitGrow","imul","r","s","t","__halfDigitLength","__clz16","__specialLeftShift","__internalMultiplyAdd","__inplaceSub","__inplaceAdd","__inplaceRightShift","__toShiftAmount","__rightShiftByMaximum","Symbol","toPrimitive","valueOf","min","assertObjectWithKeys","debugPath","object","expectedKeys","optionalKeys","Object","assertObject","providedKeys","keys","sort","requiredLength","maximalLength","errorMessage","optionalProvidedKeys","filter","key","includes","find","assertHexString","test","assertHash","hash","assertInteger","ValidateScript","script","nestedValidation","code_hash","args","hash_type","ValidateOutPoint","outPoint","tx_hash","index","ValidateCellInput","cellInput","since","previous_output","ValidateCellOutput","cellOutput","capacity","lock","type","ValidateCellDep","cellDep","dep_type","out_point","assertArray","array","validateFunction","isArray","toAssert","value","assertCommonTransaction","rawTransaction","version","cell_deps","header_deps","inputs","outputs","outputs_data","ValidateRawTransaction","ValidateTransaction","transaction","witnesses","ValidateRawHeader","rawHeader","compact_target","timestamp","number","epoch","parent_hash","transactions_root","proposals_hash","uncles_hash","dao","assertCommonHeader","ValidateHeader","header","nonce","assertProposalShortId","shortId","ValidateUncleBlock","uncleBlock","proposals","ValidateBlock","block","uncles","transactions","ValidateCellbaseWitness","cellbaseWitness","message","ValidateWitnessArgs","witnessArgs","input_type","output_type","__kBitConversionBuffer","Float64Array","Int32Array","Readable","Stream","BUFFER","TYPE","Blob","blobParts","arguments","options","buffers","size","element","Buffer","isView","byteOffset","String","concat","undefined","toLowerCase","Promise","resolve","buf","ab","readable","_read","start","end","relativeStart","relativeEnd","span","slicedBuffer","blob","FetchError","systemError","code","errno","captureStackTrace","convert","defineProperties","enumerable","defineProperty","toStringTag","writable","configurable","create","name","require","INTERNALS","PassThrough","Body","body","_this","_ref","_ref$size","_ref$timeout","timeout","isURLSearchParams","isBlob","isBuffer","disturbed","error","on","err","url","consumeBody","_this4","reject","alloc","stream","accum","accumBytes","abort","resTimeout","setTimeout","chunk","clearTimeout","obj","append","delete","get","getAll","has","set","arrayBuffer","clone","instance","p1","p2","bodyUsed","getBoundary","pipe","extractContentType","getTotalBytes","getLengthSync","_lengthRetrievers","hasKnownLength","then","ct","headers","assign","_this2","JSON","parse","_this3","res","str","charset","exec","convertBody","json","text","mixIn","proto","getOwnPropertyNames","desc","getOwnPropertyDescriptor","global","invalidTokenRegex","invalidHeaderCharRegex","validateName","validateValue","MAP","Headers","init","rawHeaders","raw","headerNames","headerName","method","iterator","pairs","pair","callback","thisArg","getHeaders","_pairs$i","createHeadersIterator","kind","entries","forEach","values","INTERNAL","target","HeadersIteratorPrototype","setPrototypeOf","getPrototypeOf","_INTERNAL","done","exportNodeCompatibleHeaders","__proto__","hostHeaderKey","INTERNALS$1","STATUS_CODES","http","Response","opts","status","contentType","statusText","counter","ok","redirected","INTERNALS$2","parse_url","Url","format_url","format","streamDestructionSupported","isRequest","Request","parsedURL","href","toUpperCase","inputBody","signal","isAbortSignal","redirect","follow","compress","agent","AbortError","PassThrough$1","resolve_url","fetch","request","protocol","hostname","contentLengthValue","totalBytes","getNodeRequestOptions","send","https","response","destroy","emit","aborted","abortAndFinalize","finalize","req","reqTimeout","removeEventListener","addEventListener","once","socket","val","createHeadersLenient","isRedirect","statusCode","location","locationURL","requestOpts","response_options","statusMessage","codings","zlibOptions","flush","zlib","Z_SYNC_FLUSH","finishFlush","createGunzip","createBrotliDecompress","createInflate","createInflateRaw","dest","write","writeToStream","realFetch","nodeFetch","default","module","exports","mergeOptions","overrideOptions","defaultOptions","batchHandler","receiver","async","uri","Content-Type","stringify","payload","params","id","jsonrpc","handler","Proxy","round","random","data","result","RPC","HexStringToBigInt","hexString","BigIntToHexString","bigInt","normalizeHexNumber","intValue","normalizeRawData","toArrayBuffer","normalizeObject","NormalizeScript","NormalizeOutPoint","toNormalize","normalize","NormalizeCellInput","NormalizeCellOutput","type_","NormalizeCellDep","toNormalizeArray","normalizeFunction","item","NormalizeRawTransaction","NormalizeTransaction","NormalizeRawHeader","NormalizeHeader","NormalizeUncleBlock","invokeSerializeJson","serializeJson","Function","transformObject","replace","group","TransformScript","validation","validators.ValidateScript","TransformOutPoint","validators.ValidateOutPoint","toInvoke","transform","TransformCellInput","validators.ValidateCellInput","TransformCellOutput","validators.ValidateCellOutput","TransformCellDep","validators.ValidateCellDep","toInvokeArray","invokeFunction","TransformTransaction","validators.ValidateTransaction","TransformHeader","validators.ValidateHeader","TransformUncleBlock","validators.ValidateUncleBlock","validators.ValidateRawTransaction","validators.ValidateRawHeader","validators.ValidateBlock","validators.ValidateCellbaseWitness","validators.ValidateWitnessArgs","rpc","lockHash","skipCellWithContent","loadData","loadBlockNumber","to","get_tip_block_number","currentFrom","lessThanOrEqual","currentTo","greaterThan","cells","get_cells_by_lock_hash","cell","output_data_len","get_live_cell","content","block_number","get_header","block_hash","cellbase","cell_output","validateTransaction","depGroupUnpacker","txHash","tx","get_transaction","dump","mockInputs","output","_resolveOutPoint","mockCellDeps","cell_dep","outPoints","mockHeaderDeps","headerDep","mock_info","txStatus","toNumber","tx_status"],"mappings":"mRAAA,MAAMA,EACJC,cAYEC,KAAKC,sBAAuB,EAG9BF,gBAAgBG,GACd,OAAS,MAALA,IACAA,aAAaJ,IACiB,IAA3BI,EAAED,uBAIb,MAAME,UAA0BL,EAC9BC,YAAYK,GACVC,QACAL,KAAKM,KAAO,IAAIC,SAASH,GAG3BL,SACE,OAAOC,K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YACzB+X,EAAethB,WAAWrD,KAAKyiB,IAAIkB,WAAWiB,IAEhD,OAAOlP,KAAK0I,UAAU,CACpByG,UAAW,CACThY,OAAQwX,EACR1X,UAAW6X,EACX5X,YAAa+X,GAEfT,GAAAA,IAIJnkB,uBAAuBkM,GACrB,MAAM6Y,QAAiB9kB,KAAKyiB,IAAI0B,gBAAgBlY,EAAUd,SAC1D,IAAK2Z,IAAaA,EAAS5X,YACzB,MAAM,IAAIpL,MAAM,eAAemK,EAAUd,4BAE3C,MAAM+Y,EAAKY,EAAS5X,YACd9B,EAAQlJ,EAAK6iB,SAAS7iB,EAAKiB,OAAO8I,EAAUb,QAClD,GAAIA,GAAS8Y,EAAGpX,QAAQzL,OACtB,MAAM,IAAIS,MACR,eAAemK,EAAUd,gCAAgCC,MAG7D,MAAMyT,EAAO,CACXyF,OAAQJ,EAAGpX,QAAQ1B,GACnByT,KAAMqF,EAAGnX,aAAa3B,IAKxB,MAHkC,cAA9B0Z,EAASE,UAAU/L,SACrB4F,EAAK5Q,OAAS6W,EAASE,UAAUpB,YAE5B/E,oBC5FY"} \ No newline at end of file diff --git a/dist/ckb-js-toolkit.umd.js b/dist/ckb-js-toolkit.umd.js index f2085d4..27d47c1 100644 --- a/dist/ckb-js-toolkit.umd.js +++ b/dist/ckb-js-toolkit.umd.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).CKBJSToolkit={})}(this,(function(t){"use strict";class e{constructor(t){this.view=new DataView(t)}length(){return this.view.byteLength}indexAt(t){return this.view.getUint8(t)}toArrayBuffer(){return this.view.buffer}serializeJson(){return"0x"+Array.prototype.map.call(new Uint8Array(this.view.buffer),t=>("00"+t.toString(16)).slice(-2)).join("")}}class r{constructor(t){this.string=t}length(){return this.string.length/2-1}indexAt(t){return parseInt(this.string.substr(2+2*t,2),16)}toArrayBuffer(){const t=new ArrayBuffer(this.length()),e=new DataView(t);for(let t=0;t255)throw new Error("fromRawString can only accept UTF-8 raw string!");n.setUint8(e,r)}return new e(r)}}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var a=o((function(t,e){t.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r,n=0;nl.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return(n=h(this,o(l).call(this,t))).sign=r,n}return i(l,r),n(l,[{key:"toDebugString",value:function(){var t=["BigInt["],e=!0,r=!1,n=void 0;try{for(var i,o,a=this[Symbol.iterator]();!(e=(i=a.next()).done);e=!0)o=i.value,t.push((o?(o>>>0).toString(16):o)+", ")}catch(t){r=!0,n=t}finally{try{e||null==a.return||a.return()}finally{if(r)throw n}}return t.push("]"),t.join("")}},{key:"toString",value:function(){var t=0t||36this.length&&(r=this.length);for(var n=65535&t,i=t>>>16,o=0,a=65535&e,s=e>>>16,_=0;_>>16,c=u(f,n),g=u(f,i),d=u(h,n),p=u(h,i),v=a+(65535&c),y=s+o+(v>>>16)+(c>>>16)+(65535&g)+(65535&d);o=(a=(g>>>16)+(d>>>16)+(65535&p)+(y>>>16))>>>16,a&=65535,s=p>>>16,this.__setDigit(_,65535&v|y<<16)}if(0!==o||0!==a||0!==s)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(t,e,r){for(var n,i=0,o=0;o>>16,this.__setHalfDigit(e+o,n);return i}},{key:"__inplaceSub",value:function(t,e,r){var n=0;if(1&e){e>>=1;for(var i=this.__digit(e),o=65535&i,a=0;a>>1;a++){var s=t.__digit(a),u=(i>>>16)-(65535&s)-n;n=1&u>>>16,this.__setDigit(e+a,u<<16|65535&o),n=1&(o=(65535&(i=this.__digit(e+a+1)))-(s>>>16)-n)>>>16}var _=t.__digit(a),l=(i>>>16)-(65535&_)-n;if(n=1&l>>>16,this.__setDigit(e+a,l<<16|65535&o),e+a+1>=this.length)throw new RangeError("out of bounds");0==(1&r)&&(n=1&(o=(65535&(i=this.__digit(e+a+1)))-(_>>>16)-n)>>>16,this.__setDigit(e+t.length,4294901760&i|65535&o))}else{e>>=1;for(var f=0;f>>16)-(c>>>16)-(n=1&g>>>16);n=1&d>>>16,this.__setDigit(e+f,d<<16|65535&g)}var p=this.__digit(e+f),v=t.__digit(f),y=(65535&p)-(65535&v)-n;n=1&y>>>16;var b=0;0==(1&r)&&(n=1&(b=(p>>>16)-(v>>>16)-n)>>>16),this.__setDigit(e+f,b<<16|65535&y)}return n}},{key:"__inplaceRightShift",value:function(t){if(0!==t){for(var e,r=this.__digit(0)>>>t,n=this.length-1,i=0;i>>t;this.__setDigit(n,r)}}},{key:"__digit",value:function(t){return this[t]}},{key:"__unsignedDigit",value:function(t){return this[t]>>>0}},{key:"__setDigit",value:function(t,e){this[t]=0|e}},{key:"__setDigitGrow",value:function(t,e){this[t]=0|e}},{key:"__halfDigitLength",value:function(){var t=this.length;return 65535>=this.__unsignedDigit(t-1)?2*t-1:2*t}},{key:"__halfDigit",value:function(t){return 65535&this[t>>>1]>>>((1&t)<<4)}},{key:"__setHalfDigit",value:function(t,e){var r=t>>>1,n=this.__digit(r),i=1&t?65535&n|e<<16:4294901760&n|65535&e;this.__setDigit(r,i)}}],[{key:"BigInt",value:function(e){var r=Math.floor,n=Number.isFinite;if("number"==typeof e){if(0===e)return l.__zero();if((0|e)===e)return 0>e?l.__oneDigit(-e,!0):l.__oneDigit(e,!1);if(!n(e)||r(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return l.__fromDouble(e)}if("string"==typeof e){var i=l.__fromString(e);if(null===i)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return i}if("boolean"==typeof e)return!0===e?l.__oneDigit(1,!1):l.__zero();if("object"===t(e)){if(e.constructor===l)return e;var o=l.__toPrimitive(e);return l.BigInt(o)}throw new TypeError("Cannot convert "+e+" to a BigInt")}},{key:"toNumber",value:function(t){var e=t.length;if(0===e)return 0;if(1===e){var r=t.__unsignedDigit(0);return t.sign?-r:r}var n=t.__digit(e-1),i=_(n),o=32*e-i;if(1024>>=12;var c=f-12,g=12<=f?0:s<<20+f,d=20+f;0>>32-c,g=s<>>32-d,d-=32);var p=l.__decideRounding(t,d,u,s);if((1===p||0===p&&1==(1&g))&&0==(g=g+1>>>0)&&0!=++h>>>20&&(h=0,1023<++a))return t.sign?-1/0:1/0;var v=t.sign?-2147483648:0;return a=a+1023<<20,l.__kBitConversionInts[1]=v|a|h,l.__kBitConversionInts[0]=g,l.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(t){if(0===t.length)return t;var e=t.__copy();return e.sign=!t.sign,e}},{key:"bitwiseNot",value:function(t){return t.sign?l.__absoluteSubOne(t).__trim():l.__absoluteAddOne(t,!0)}},{key:"exponentiate",value:function(t,e){if(e.sign)throw new RangeError("Exponent must be positive");if(0===e.length)return l.__oneDigit(1,!1);if(0===t.length)return t;if(1===t.length&&1===t.__digit(0))return t.sign&&0==(1&e.__digit(0))?l.unaryMinus(t):t;if(1=l.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){var n=1+(r>>>5),i=new l(n,t.sign&&0!=(1&r));i.__initializeDigits();var o=1<<(31&r);return i.__setDigit(n-1,o),i}var a=null,s=t;for(0!=(1&r)&&(a=t),r>>=1;0!==r;r>>=1)s=l.multiply(s,s),0!=(1&r)&&(a=null===a?s:l.multiply(a,s));return a}},{key:"multiply",value:function(t,e){if(0===t.length)return t;if(0===e.length)return e;var r=t.length+e.length;32<=t.__clzmsd()+e.__clzmsd()&&r--;var n=new l(r,t.sign!==e.sign);n.__initializeDigits();for(var i=0;il.__absoluteCompare(t,e))return l.__zero();var r,n=t.sign!==e.sign,i=e.__unsignedDigit(0);if(1===e.length&&65535>=i){if(1===i)return n===t.sign?t:l.unaryMinus(t);r=l.__absoluteDivSmall(t,i,null)}else r=l.__absoluteDivLarge(t,e,!0,!1);return r.sign=n,r.__trim()}},{key:"remainder",value:function(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>l.__absoluteCompare(t,e))return t;var r=e.__unsignedDigit(0);if(1===e.length&&65535>=r){if(1===r)return l.__zero();var n=l.__absoluteModSmall(t,r);return 0===n?l.__zero():l.__oneDigit(n,t.sign)}var i=l.__absoluteDivLarge(t,e,!1,!0);return i.sign=t.sign,i.__trim()}},{key:"add",value:function(t,e){var r=t.sign;return r===e.sign?l.__absoluteAdd(t,e,r):0<=l.__absoluteCompare(t,e)?l.__absoluteSub(t,e,r):l.__absoluteSub(e,t,!r)}},{key:"subtract",value:function(t,e){var r=t.sign;return r===e.sign?0<=l.__absoluteCompare(t,e)?l.__absoluteSub(t,e,r):l.__absoluteSub(e,t,!r):l.__absoluteAdd(t,e,r)}},{key:"leftShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?l.__rightShiftByAbsolute(t,e):l.__leftShiftByAbsolute(t,e)}},{key:"signedRightShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?l.__leftShiftByAbsolute(t,e):l.__rightShiftByAbsolute(t,e)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(t,e){return 0>l.__compareToBigInt(t,e)}},{key:"lessThanOrEqual",value:function(t,e){return 0>=l.__compareToBigInt(t,e)}},{key:"greaterThan",value:function(t,e){return 0=l.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.lengthl.__kMaxLengthBits)throw new RangeError("BigInt too big");return l.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=l.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length>>n)return e}return l.__truncateToNBits(t,e)}},{key:"ADD",value:function(t,e){if(t=l.__toPrimitive(t),e=l.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=l.__toNumeric(t),e=l.__toNumeric(e),l.__isBigInt(t)&&l.__isBigInt(e))return l.add(t,e);if("number"==typeof t&&"number"==typeof e)return t+e;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(t,e){return l.__compare(t,e,0)}},{key:"LE",value:function(t,e){return l.__compare(t,e,1)}},{key:"GT",value:function(t,e){return l.__compare(t,e,2)}},{key:"GE",value:function(t,e){return l.__compare(t,e,3)}},{key:"EQ",value:function(e,r){for(;;){if(l.__isBigInt(e))return l.__isBigInt(r)?l.equal(e,r):l.EQ(r,e);if("number"==typeof e){if(l.__isBigInt(r))return l.__equalToNumber(r,e);if("object"!==t(r))return e==r;r=l.__toPrimitive(r)}else if("string"==typeof e){if(l.__isBigInt(r))return null!==(e=l.__fromString(e))&&l.equal(e,r);if("object"!==t(r))return e==r;r=l.__toPrimitive(r)}else if("boolean"==typeof e){if(l.__isBigInt(r))return l.__equalToNumber(r,+e);if("object"!==t(r))return e==r;r=l.__toPrimitive(r)}else if("symbol"===t(e)){if(l.__isBigInt(r))return!1;if("object"!==t(r))return e==r;r=l.__toPrimitive(r)}else{if("object"!==t(e))return e==r;if("object"===t(r)&&r.constructor!==l)return e==r;e=l.__toPrimitive(e)}}}},{key:"NE",value:function(t,e){return!l.EQ(t,e)}},{key:"__zero",value:function(){return new l(0,!1)}},{key:"__oneDigit",value:function(t,e){var r=new l(1,e);return r.__setDigit(0,t),r}},{key:"__decideRounding",value:function(t,e,r,n){if(0e)i=-e-1;else{if(0===r)return-1;r--,n=t.__digit(r),i=31}var o=1<>>20)-1023,n=1+(r>>>5),i=new l(n,0>t),o=1048575&l.__kBitConversionInts[1]|1048576,a=l.__kBitConversionInts[0],s=20,u=31&r,_=0;if(u>>f,o=o<<32-f|a>>>f,a<<=32-f}else if(u===s)_=32,e=o,o=a;else{var h=u-s;_=32-h,e=o<>>32-h,o=a<=t&&9<=t)||(159>=t?32==t:131071>=t?160==t||5760==t:196607>=t?10>=(t&=131071)||40==t||41==t||47==t||95==t||4096==t:65279==t)}},{key:"__fromString",value:function(t){var e=11073741824/s)return null;var _=new l(31+(s*a+u>>>l.__kBitsPerCharTableShift)>>>5,!1),f=10>e?e:10,h=10>=l.__kBitsPerCharTableShift;var c=[],g=[],d=!1;do{for(var p,v=0,y=0;;){if(p=void 0,o-48>>>0>>0>>0>>0>>l.__kBitsPerCharTableShift+5;_.__inplaceMultiplyAdd(D,k,P)}while(!b)}if(i!==n){if(!l.__isWhitespace(o))return null;for(i++;i>>u-(o-=32))}if(0!==i){if(n>=t.length)throw new Error("implementation bug");t.__setDigit(n++,i)}for(;n>>1)+(85&n))>>>2)+(51&n))>>>4)+(15&n),o=e-1,a=t.__digit(r-1),s=0|(32*r-_(a)+i-1)/i;if(t.sign&&s++,268435456>>v,c=32-v;c>=i;)u[f--]=l.__kConversionChars[h&o],h>>>=i,c-=i}var y=(h|a<>>i-c;0!==h;)u[f--]=l.__kConversionChars[h&o],h>>>=i;if(t.sign&&(u[f--]="-"),-1!==f)throw new Error("implementation bug");return u.join("")}},{key:"__toStringGeneric",value:function(t,e,r){var n=t.length;if(0===n)return"";if(1===n){var i=t.__unsignedDigit(0).toString(e);return!1===r&&t.sign&&(i="-"+i),i}var o,a,s=32*n-_(t.__digit(n-1)),u=l.__kMaxBitsPerChar[e]-1,f=s*l.__kBitsPerCharTableMultiplier,h=1+(f=0|(f+=u-1)/u)>>1,c=l.exponentiate(l.__oneDigit(e,!1),l.__oneDigit(h,!1)),g=c.__unsignedDigit(0);if(1===c.length&&65535>=g){(o=new l(t.length,!1)).__initializeDigits();for(var d,p=0,v=2*t.length-1;0<=v;v--)d=p<<16|t.__halfDigit(v),o.__setHalfDigit(v,0|d/g),p=0|d%g;a=p.toString(e)}else{var y=l.__absoluteDivLarge(t,c,!0,!0);o=y.quotient;var b=y.remainder.__trim();a=l.__toStringGeneric(b,e,!0)}o.__trim();for(var m=l.__toStringGeneric(o,e,!0);a.lengthn?l.__absoluteLess(r):0}},{key:"__compareToNumber",value:function(t,e){if(!0|e){var r=t.sign,n=0>e;if(r!==n)return l.__unequalSign(r);if(0===t.length){if(n)throw new Error("implementation bug");return 0===e?0:-1}if(1i?l.__absoluteGreater(r):oe)return l.__unequalSign(r);if(0===e)throw new Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;l.__kBitConversionDouble[0]=e;var n=2047&l.__kBitConversionInts[1]>>>20;if(2047==n)throw new Error("implementation bug: handled elsewhere");var i=n-1023;if(0>i)return l.__absoluteGreater(r);var o=t.length,a=t.__digit(o-1),s=_(a),u=32*o-s,f=i+1;if(uf)return l.__absoluteGreater(r);var h=1048576|1048575&l.__kBitConversionInts[1],c=l.__kBitConversionInts[0],g=20,d=31-s;if(d!==(u-1)%31)throw new Error("implementation bug");var p,v=0;if(d>>y,h=h<<32-y|c>>>y,c<<=32-y}else if(d===g)v=32,p=h,h=c;else{var b=d-g;v=32-b,p=h<>>32-b,h=c<>>=0)>(p>>>=0))return l.__absoluteGreater(r);if(a>>0,h=c,c=0):p=0;var w=t.__unsignedDigit(m);if(w>p)return l.__absoluteGreater(r);if(we&&t.__unsignedDigit(0)===a(e):0===l.__compareToDouble(t,e)}},{key:"__comparisonResultToBool",value:function(t,e){switch(e){case 0:return 0>t;case 1:return 0>=t;case 2:return 0e;case 3:return t>=e}if(l.__isBigInt(t)&&"string"==typeof e)return null!==(e=l.__fromString(e))&&l.__comparisonResultToBool(l.__compareToBigInt(t,e),r);if("string"==typeof t&&l.__isBigInt(e))return null!==(t=l.__fromString(t))&&l.__comparisonResultToBool(l.__compareToBigInt(t,e),r);if(t=l.__toNumeric(t),e=l.__toNumeric(e),l.__isBigInt(t)){if(l.__isBigInt(e))return l.__comparisonResultToBool(l.__compareToBigInt(t,e),r);if("number"!=typeof e)throw new Error("implementation bug");return l.__comparisonResultToBool(l.__compareToNumber(t,e),r)}if("number"!=typeof t)throw new Error("implementation bug");if(l.__isBigInt(e))return l.__comparisonResultToBool(l.__compareToNumber(e,t),2^r);if("number"!=typeof e)throw new Error("implementation bug");return 0===r?te:3===r?t>=e:void 0}},{key:"__absoluteAdd",value:function(t,e,r){if(t.length>>16)+(s>>>16)+(_>>>16);o=f>>>16,i.__setDigit(a,65535&_|f<<16)}for(;a>>16)+(c>>>16);o=g>>>16,i.__setDigit(a,65535&c|g<<16)}return a>>16)-(s>>>16)-(i=1&u>>>16);i=1&_>>>16,n.__setDigit(o,65535&u|_<<16)}for(;o>>16)-(i=1&h>>>16);i=1&c>>>16,n.__setDigit(o,65535&h|c<<16)}return n.__trim()}},{key:"__absoluteAddOne",value:function(t,e){var r=2n?0:t.__unsignedDigit(n)>e.__unsignedDigit(n)?1:-1}},{key:"__multiplyAccumulate",value:function(t,e,r,n){if(0!==e){for(var i=65535&e,o=e>>>16,a=0,s=0,_=0,l=0;l>>16,g=t.__digit(l),d=65535&g,p=g>>>16,v=u(d,i),y=u(d,o),b=u(p,i),m=u(p,o);a=(s=(y>>>16)+(b>>>16)+(65535&m)+(a=(c+=_+a+((h+=s+(65535&v))>>>16)+(v>>>16)+(65535&y)+(65535&b))>>>16))>>>16,s&=65535,_=m>>>16,f=65535&h|c<<16,r.__setDigit(n,f)}for(;0!==a||0!==s||0!==_;n++){var w=r.__digit(n),k=(65535&w)+s,D=(w>>>16)+(k>>>16)+_+a;s=0,_=0,a=D>>>16,w=65535&k|D<<16,r.__setDigit(n,w)}}}},{key:"__internalMultiplyAdd",value:function(t,e,r,n,i){for(var o=r,a=0,s=0;s>>16;var h=u(_>>>16,e),c=(65535&h)+(l>>>16)+o;o=c>>>16,a=h>>>16,i.__setDigit(s,c<<16|65535&f)}if(i.length>n)for(i.__setDigit(n++,o+a);n>>0,a=0|o/e,s=0|(o=((n=0|o%e)<<16|t.__halfDigit(i-1))>>>0)/e;n=0|o%e,r.__setDigit(i>>>1,a<<16|s)}return r}},{key:"__absoluteModSmall",value:function(t,e){for(var r=0,n=2*t.length-1;0<=n;n--)r=0|((r<<16|t.__halfDigit(n))>>>0)%e;return r}},{key:"__absoluteDivLarge",value:function(t,e,r,n){var i=e.__halfDigitLength(),o=e.length,a=t.__halfDigitLength()-i,s=null;r&&(s=new l(a+2>>>1,!1)).__initializeDigits();var _=new l(i+2>>>1,!1);_.__initializeDigits();var f=l.__clz16(e.__halfDigit(i-1));0>>0;p=0|y/c;for(var b=0|y%c,m=e.__halfDigit(i-2),w=h.__halfDigit(d+i-2);u(p,m)>>>0>(b<<16|w)>>>0&&(p--,!(65535<(b+=c))););}l.__internalMultiplyAdd(e,p,0,o,_);var k=h.__inplaceSub(_,d,i+1);0!==k&&(k=h.__inplaceAdd(e,d,i),h.__setHalfDigit(d+i,h.__halfDigit(d+i)+k),p--),r&&(1&d?g=p<<16:s.__setDigit(d>>>1,g|p))}return n?(h.__inplaceRightShift(f),r?{quotient:s,remainder:h}:h):r?s:void 0}},{key:"__clz16",value:function(t){return _(t)-16}},{key:"__specialLeftShift",value:function(t,e,r){var n=t.length,i=new l(n+r,!1);if(0===e){for(var o=0;o>>32-e;return 0r)throw new RangeError("BigInt too big");var n=r>>>5,i=31&r,o=t.length,a=0!==i&&0!=t.__digit(o-1)>>>32-i,s=o+n+(a?1:0),u=new l(s,t.sign);if(0===i){for(var _=0;_>>32-i;if(a)u.__setDigit(o+n,f);else if(0!==f)throw new Error("implementation bug")}return u.__trim()}},{key:"__rightShiftByAbsolute",value:function(t,e){var r=t.length,n=t.sign,i=l.__toShiftAmount(e);if(0>i)return l.__rightShiftByMaximum(n);var o=i>>>5,a=31&i,s=r-o;if(0>=s)return l.__rightShiftByMaximum(n);var u=!1;if(n)if(0!=(t.__digit(o)&(1<>>a,d=r-o-1,p=0;p>>a;f.__setDigit(d,g)}return u&&(f=l.__absoluteAddOne(f,!0,f)),f.__trim()}},{key:"__rightShiftByMaximum",value:function(t){return t?l.__oneDigit(1,!0):l.__zero()}},{key:"__toShiftAmount",value:function(t){if(1l.__kMaxLengthBits?-1:e}},{key:"__toPrimitive",value:function(e){var r=1>>5,n=new l(r,e.sign),i=r-1,o=0;o>>s}return n.__setDigit(i,a),n.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(t,e,r){for(var n=Math.min,i=t+31>>>5,o=new l(i,r),a=0,s=i-1,u=0,_=n(s,e.length);a<_;a++){var f=e.__digit(a),h=0-(65535&f)-u,c=0-(f>>>16)-(u=1&h>>>16);u=1&c>>>16,o.__setDigit(a,65535&h|c<<16)}for(;a>>16)-(u=1&v>>>16)<<16}else{var y=32-p,b=1<<32-y,m=(65535&b)-(65535&(d=d<>>y))-u;g=65535&m|(b>>>16)-(d>>>16)-(u=1&m>>>16)<<16,g&=b-1}return o.__setDigit(s,g),o.__trim()}},{key:"__digitPow",value:function(t,e){for(var r=1;0>>=1,t*=t;return r}}]),l}(l(Array));return c.__kMaxLength=33554432,c.__kMaxLengthBits=c.__kMaxLength<<5,c.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],c.__kBitsPerCharTableShift=5,c.__kBitsPerCharTableMultiplier=1<a)throw new Error(s);let u=i.filter(t=>!r.includes(t));if(i.length-u.length!==o)throw new Error(s);if(u.find(t=>!n.includes(t)))throw new Error(s)}function u(t,e){if(!/^0x([0-9a-fA-F][0-9a-fA-F])*$/.test(e))throw new Error(t+" must be a hex string!")}function _(t,e){if(u(t,e),66!=e.length)throw new Error(t+" must be a hex string of 66 bytes long!")}function l(t,e){if("0x0"!==e&&!/^0x[1-9a-fA-F][0-9a-fA-F]*$/.test(e))throw new Error(t+" must be a hex integer!")}function f(t,{nestedValidation:e=!0,debugPath:r="script"}={}){if(s(r,t,["code_hash","hash_type","args"],[]),_(r+".code_hash",t.code_hash),u(r+".args",t.args),"data"!==t.hash_type&&"type"!==t.hash_type)throw new Error(r+".hash_type must be either data or type!")}function h(t,{nestedValidation:e=!0,debugPath:r="out_point"}={}){s(r,t,["tx_hash","index"],[]),_(r+".tx_hash",t.tx_hash),l(r+".index",t.index)}function c(t,{nestedValidation:e=!0,debugPath:r="cell_input"}={}){s(r,t,["since","previous_output"],[]),l(r+".since",t.since),e&&h(t.previous_output,{debugPath:r+".previous_output"})}function g(t,{nestedValidation:e=!0,debugPath:r="cell_output"}={}){s(r,t,["capacity","lock"],["type"]),l(r+".capacity",t.capacity),e&&(f(t.lock,{debugPath:r+".lock"}),t.type&&f(t.type,{debugPath:r+".type"}))}function d(t,{nestedValidation:e=!0,debugPath:r="cell_dep"}={}){if(s(r,t,["out_point","dep_type"],[]),"code"!==t.dep_type&&"dep_group"!==t.dep_type)throw new Error(r+".dep_type must be either code or dep_group!");e&&h(t.out_point,{debugPath:r+".out_point"})}function p(t,e,r,n){if(!Array.isArray(e))throw new Error(t+" is not an array!");if(n)for(let n=0;n-1};function _(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function l(t){return"string"!=typeof t&&(t=String(t)),t}function f(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function h(t){this.map={},t instanceof h?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function g(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function d(t){var e=new FileReader,r=g(e);return e.readAsArrayBuffer(t),r}function p(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&i&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=p(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||u(t))?this._bodyArrayBuffer=p(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var t,e,r,n=c(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=g(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function m(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function w(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new h(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var k=[301,302,303,307,308];w.redirect=function(t,e){if(-1===k.indexOf(e))throw new RangeError("Invalid status code");return new w(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function D(t,r){return new Promise((function(n,o){var a=new b(t,r);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var t,e,r={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new h,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new w(i,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}D.polyfill=!0,t.fetch||(t.fetch=D,t.Headers=h,t.Request=b,t.Response=w),e.Headers=h,e.Request=b,e.Response=w,e.fetch=D}({})}(r),delete r.fetch.polyfill,(e=r.fetch).default=r.fetch,e.fetch=r.fetch,e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response,t.exports=e}));function x(t,e){e=e||{};const r=Object.assign({},e.headers||{},t.headers||{});return Object.assign({},e,t,{headers:r})}const O={get:(t,e,r)=>"send"===e?async()=>{const e=await S(t.uri,x({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.payload)},t.defaultOptions));return await e.json()}:(...n)=>{const i=t.id;return t.id=t.id+1,t.payload.push({jsonrpc:"2.0",id:i,method:e,params:n}),r}},C={get:(t,e)=>"batch"===e?()=>new Proxy({id:Math.round(1e7*Math.random()),payload:[],uri:t.uri,defaultOptions:t.defaultOptions},O):async(...r)=>{const n=Math.round(1e7*Math.random()),i=await S(t.uri,x({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:n,method:e,params:r})},t.defaultOptions)),o=await i.json();if(o.id!==n)throw new Error("JSONRPCError: response ID does not match request ID!");if(o.error)throw new Error("JSONRPCError: server error "+JSON.stringify(o.error));return o.result}};class I{constructor(t,e={}){return this.uri=t,this.defaultOptions=e,new Proxy(this,C)}static create(t){return new I(t)}}function j(t){return a.BigInt(t)}function R(t){return"0x"+t.toString(16)}function z(t){return function(e,r){if(!(r instanceof ArrayBuffer)){let n=R(a.BigInt(r)).substr(2);if(n.length%2!=0&&(n="0"+n),n.length/2>t)throw new Error(`${e} is ${n.length/2} bytes long, expected length is ${t}!`);const i=new DataView(new ArrayBuffer(t));for(let t=0;t0&&r.byteLength!==t)throw new Error(`${e} has invalid length ${r.byteLength}, required: ${t}`);return r}}function N(t,e,r){const n={};for(const[i,o]of Object.entries(r)){const r=e[i];if(!r)throw new Error(`${t} is missing ${i}!`);n[i]=o(`${t}.${i}`,r)}return n}function L(t,{debugPath:e="script"}={}){return N(e,t,{code_hash:M(32),hash_type:function(t,e){switch(e){case"data":return 0;case"type":return 1;case 0:case 1:return e;default:throw new Error(`${t}.hash_type has invalid value: ${e}`)}},args:M(-1)})}function U(t,{debugPath:e="out_point"}={}){return N(e,t,{tx_hash:M(32),index:z(4)})}function V(t){return function(e,r){return t(r,{debugPath:e})}}function q(t,{debugPath:e="cell_input"}={}){return N(e,t,{since:z(8),previous_output:V(U)})}function $(t,{debugPath:e="cell_output"}={}){const r=N(e,t,{capacity:z(8),lock:V(L)});return t.type&&(r.type_=L(t.type,{debugPath:e+".type"})),r}function F(t,{debugPath:e="cell_dep"}={}){return N(e,t,{out_point:V(U),dep_type:function(t,e){switch(e){case"code":return 0;case"dep_group":return 1;case 0:case 1:return e;default:throw new Error(`${t}.dep_type has invalid value: ${e}`)}}})}function H(t){return function(e,r){return r.map((r,n)=>t(`${e}[${n}]`,r))}}function G(t,{debugPath:e="raw_transaction"}={}){return N(e,t,{version:z(4),cell_deps:H(V(F)),header_deps:H(M(32)),inputs:H(V(q)),outputs:H(V($)),outputs_data:H(M(-1))})}function W(t,{debugPath:e="transaction"}={}){const r=G(t,{debugPath:"(raw)"+e}),n=N(e,t,{witnesses:H(M(-1))});return n.raw=r,n}function J(t,{debugPath:e="raw_header"}={}){return N(e,t,{version:z(4),compact_target:z(4),timestamp:z(8),number:z(8),epoch:z(8),parent_hash:M(32),transactions_root:M(32),proposals_hash:M(32),uncles_hash:M(32),dao:M(32)})}function X(t,{debugPath:e="header"}={}){const r=J(t,{debugPath:"(raw)"+e}),n=N(e,t,{nonce:z(16)});return n.raw=r,n}function Q(t,{debugPath:e="uncle_block"}={}){return N(e,t,{header:V(X),proposals:H(M(10))})}var K=Object.freeze({__proto__:null,NormalizeScript:L,NormalizeOutPoint:U,NormalizeCellInput:q,NormalizeCellOutput:$,NormalizeCellDep:F,NormalizeRawTransaction:G,NormalizeTransaction:W,NormalizeRawHeader:J,NormalizeHeader:X,NormalizeUncleBlock:Q,NormalizeBlock:function(t,{debugPath:e="block"}={}){return N(e,t,{header:V(X),uncles:H(V(Q)),transactions:H(V(W)),proposals:H(M(10))})},NormalizeCellbaseWitness:function(t,{debugPath:e="cellbase_witness"}={}){return N(e,t,{lock:V(L),message:M(-1)})},NormalizeWitnessArgs:function(t,{debugPath:e="witness_args"}={}){const r={};return t.lock&&(r.lock=M(-1)(e+".lock",t.lock)),t.input_type&&(r.input_type=M(-1)(e+".input_type",t.input_type)),t.output_type&&(r.output_type=M(-1)(e+".output_type",t.output_type)),r}});function Y(t,e){return e instanceof Object&&e.serializeJson instanceof Function?e.serializeJson.call(e):e}function Z(t,e,r){if(!((e=Y(0,e))instanceof Object))throw new Error(`Transformed ${t} is not an object!`);const n={};for(const[i,o]of Object.entries(r)){let r=e[i];if(!r){r=e[i.replace(/(_[a-z])/g,t=>t.toUpperCase().replace("_",""))]}r&&(n[i]=o(`${t}.${i}`,r))}return n}function tt(t,{validation:e=!0,debugPath:r="script"}={}){return t=Z(r,t,{code_hash:Y,hash_type:Y,args:Y}),e&&f(t,{debugPath:"(transformed) "+r}),t}function et(t,{validation:e=!0,debugPath:r="out_point"}={}){return t=Z(r,t,{tx_hash:Y,index:Y}),e&&h(t,{debugPath:"(transformed) "+r}),t}function rt(t){return function(e,r){return t(r,{validation:!1,debugPath:e})}}function nt(t,{validation:e=!0,debugPath:r="cell_input"}={}){return t=Z(r,t,{since:Y,previous_output:rt(et)}),e&&c(t,{debugPath:"(transformed) "+r}),t}function it(t,{validation:e=!0,debugPath:r="cell_output"}={}){return t=Z(r,t,{capacity:Y,lock:rt(tt),type:rt(tt)}),e&&g(t,{debugPath:"(transformed) "+r}),t}function ot(t,{validation:e=!0,debugPath:r="cell_dep"}={}){return t=Z(r,t,{out_point:rt(et),dep_type:Y}),e&&d(t,{debugPath:"(transformed) "+r}),t}function at(t){return function(e,r){return r.map((r,n)=>t(`${e}[${n}]`,r))}}function st(t,{validation:e=!0,debugPath:r="transaction"}={}){return t=Z(r,t,{version:Y,cell_deps:at(rt(ot)),header_deps:at(Y),inputs:at(rt(nt)),outputs:at(rt(it)),outputs_data:at(Y),witnesses:at(Y)}),e&&m(t,{debugPath:"(transformed) "+r}),t}function ut(t,{validation:e=!0,debugPath:r="header"}={}){return t=Z(r,t,{version:Y,compact_target:Y,timestamp:Y,number:Y,epoch:Y,parent_hash:Y,transactions_root:Y,proposals_hash:Y,uncles_hash:Y,dao:Y,nonce:Y}),e&&k(t,{debugPath:"(transformed) "+r}),t}function _t(t,{validation:e=!0,debugPath:r="uncle_block"}={}){return t=Z(r,t,{header:rt(ut),proposals:at(Y)}),e&&B(t,{debugPath:"(transformed) "+r}),t}var lt=Object.freeze({__proto__:null,TransformScript:tt,TransformOutPoint:et,TransformCellInput:nt,TransformCellOutput:it,TransformCellDep:ot,TransformRawTransaction:function(t,{validation:e=!0,debugPath:r="raw_transaction"}={}){return t=Z(r,t,{version:Y,cell_deps:at(rt(ot)),header_deps:at(Y),inputs:at(rt(nt)),outputs:at(rt(it)),outputs_data:at(Y)}),e&&b(t,{debugPath:"(transformed) "+r}),t},TransformTransaction:st,TransformRawHeader:function(t,{validation:e=!0,debugPath:r="raw_header"}={}){return t=Z(r,t,{version:Y,compact_target:Y,timestamp:Y,number:Y,epoch:Y,parent_hash:Y,transactions_root:Y,proposals_hash:Y,uncles_hash:Y,dao:Y}),e&&w(t,{debugPath:"(transformed) "+r}),t},TransformHeader:ut,TransformUncleBlock:_t,TransformBlock:function(t,{validation:e=!0,debugPath:r="block"}={}){return t=Z(r,t,{header:rt(ut),uncles:at(rt(_t)),transactions:at(rt(st)),proposals:at(Y)}),e&&P(t,{debugPath:"(transformed) "+r}),t},TransformCellbaseWitness:function(t,{validation:e=!0,debugPath:r="cellbase_witness"}={}){return t=Z(r,t,{lock:rt(tt),message:Y}),e&&T(t,{debugPath:"(transformed) "+r}),t},TransformWitnessArgs:function(t,{validation:e=!0,debugPath:r="witness_args"}={}){return t=Z(r,t,{lock:Y,input_type:Y,output_type:Y}),e&&A(t,{debugPath:"(transformed) "+r}),t}});var ft=Object.freeze({__proto__:null,RPCCollector:class{constructor(t,e,{skipCellWithContent:r=!0,loadData:i=!1,loadBlockNumber:o=!0}={}){this.rpc=t,this.lockHash=new n(e).serializeJson(),this.skipCellWithContent=r,this.loadData=i,this.loadBlockNumber=o}async*collect(){const t=j(await this.rpc.get_tip_block_number());let e=a.BigInt(0);for(;a.lessThanOrEqual(e,t);){let r=a.add(e,a.BigInt(100));a.greaterThan(r,t)&&(r=t);const n=await this.rpc.get_cells_by_lock_hash(this.lockHash,R(e),R(r));for(const t of n){if(this.skipCellWithContent&&(t.type||a.greaterThan(j(t.output_data_len),a.BigInt(100))))continue;let e=null;if(this.loadData){e=(await this.rpc.get_live_cell(t.out_point,!0)).cell.data.content}let r=null;if(this.loadBlockNumber){r=(await this.rpc.get_header(t.block_hash)).number}yield{cellbase:t.cellbase,cell_output:{capacity:t.capacity,lock:t.lock,type:t.type},out_point:t.out_point,block_hash:t.block_hash,data:e,output_data_len:t.output_data_len,block_number:r}}e=a.add(r,a.BigInt(1))}}}});t.BigIntToHexString=R,t.HexStringToBigInt=j,t.RPC=I,t.Reader=n,t.TransactionDumper=class{constructor(t,{validateTransaction:e=!0,depGroupUnpacker:r=null}={}){this.rpc=t,this.validateTransaction=e,this.depGroupUnpacker=r}async dumpByHash(t){const e=(await this.rpc.get_transaction(t)).transaction;return delete e.hash,await this.dump(e)}async dump(t){this.validateTransaction&&m(t);const e=[];for(const r of t.inputs){const{output:t,data:n,header:i}=await this._resolveOutPoint(r.previous_output);e.push({input:r,output:t,data:n,header:i})}const r=[];for(const e of t.cell_deps){const{output:t,data:i,header:o}=await this._resolveOutPoint(e.out_point);if(r.push({cell_dep:e,output:t,data:i,header:o}),"dep_group"===e.dep_type){if(!this.depGroupUnpacker)throw new Error("depGroupUnpacker must be provided when the transaction contains dep_group!");const t=this.depGroupUnpacker(new n(i));for(const e of t){h(e);const{output:t,data:n,header:i}=await this._resolveOutPoint(e);r.push({cell_dep:{out_point:e,dep_type:"code"},output:t,data:n,header:i})}}}const i=[];for(const e of t.header_deps)i.push(await this.rpc.get_header(e));return JSON.stringify({mock_info:{inputs:e,cell_deps:r,header_deps:i},tx:t})}async _resolveOutPoint(t){const e=await this.rpc.get_transaction(t.tx_hash);if(!e||!e.transaction)throw new Error(`Transaction ${t.tx_hash} cannot be found!`);const r=e.transaction,n=a.toNumber(a.BigInt(t.index));if(n>=r.outputs.length)throw new Error(`Transaction ${t.tx_hash} does not have output ${n}!`);const i={output:r.outputs[n],data:r.outputs_data[n]};return"committed"===e.tx_status.status&&(i.header=e.tx_status.block_hash),i}},t.VERSION="0.10.2",t.cell_collectors=ft,t.normalizers=K,t.transformers=lt,t.validators=E,Object.defineProperty(t,"__esModule",{value:!0})})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).CKBJSToolkit={})}(this,(function(t){"use strict";class e{constructor(){this.__isByteLikeReader__=!0}static isReader(t){return null!=t&&(t instanceof e||!0===t.__isByteLikeReader__)}}class r extends e{constructor(t){super(),this.view=new DataView(t)}length(){return this.view.byteLength}indexAt(t){return this.view.getUint8(t)}toArrayBuffer(){return this.view.buffer}serializeJson(){return"0x"+Array.prototype.map.call(new Uint8Array(this.view.buffer),t=>("00"+t.toString(16)).slice(-2)).join("")}}class n extends e{constructor(t){super(),this.string=t}length(){return this.string.length/2-1}indexAt(t){return parseInt(this.string.substr(2+2*t,2),16)}toArrayBuffer(){const t=new ArrayBuffer(this.length()),e=new DataView(t);for(let t=0;t255)throw new Error("fromRawString can only accept UTF-8 raw string!");n.setUint8(e,r)}return new r(e)}}var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var s=a((function(t,e){t.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r,n=0;nl.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return(n=h(this,o(l).call(this,t))).sign=r,n}return i(l,r),n(l,[{key:"toDebugString",value:function(){var t=["BigInt["],e=!0,r=!1,n=void 0;try{for(var i,o,a=this[Symbol.iterator]();!(e=(i=a.next()).done);e=!0)o=i.value,t.push((o?(o>>>0).toString(16):o)+", ")}catch(t){r=!0,n=t}finally{try{e||null==a.return||a.return()}finally{if(r)throw n}}return t.push("]"),t.join("")}},{key:"toString",value:function(){var t=0t||36this.length&&(r=this.length);for(var n=65535&t,i=t>>>16,o=0,a=65535&e,s=e>>>16,_=0;_>>16,c=u(f,n),g=u(f,i),d=u(h,n),p=u(h,i),y=a+(65535&c),v=s+o+(y>>>16)+(c>>>16)+(65535&g)+(65535&d);o=(a=(g>>>16)+(d>>>16)+(65535&p)+(v>>>16))>>>16,a&=65535,s=p>>>16,this.__setDigit(_,65535&y|v<<16)}if(0!==o||0!==a||0!==s)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(t,e,r){for(var n,i=0,o=0;o>>16,this.__setHalfDigit(e+o,n);return i}},{key:"__inplaceSub",value:function(t,e,r){var n=0;if(1&e){e>>=1;for(var i=this.__digit(e),o=65535&i,a=0;a>>1;a++){var s=t.__digit(a),u=(i>>>16)-(65535&s)-n;n=1&u>>>16,this.__setDigit(e+a,u<<16|65535&o),n=1&(o=(65535&(i=this.__digit(e+a+1)))-(s>>>16)-n)>>>16}var _=t.__digit(a),l=(i>>>16)-(65535&_)-n;if(n=1&l>>>16,this.__setDigit(e+a,l<<16|65535&o),e+a+1>=this.length)throw new RangeError("out of bounds");0==(1&r)&&(n=1&(o=(65535&(i=this.__digit(e+a+1)))-(_>>>16)-n)>>>16,this.__setDigit(e+t.length,4294901760&i|65535&o))}else{e>>=1;for(var f=0;f>>16)-(c>>>16)-(n=1&g>>>16);n=1&d>>>16,this.__setDigit(e+f,d<<16|65535&g)}var p=this.__digit(e+f),y=t.__digit(f),v=(65535&p)-(65535&y)-n;n=1&v>>>16;var b=0;0==(1&r)&&(n=1&(b=(p>>>16)-(y>>>16)-n)>>>16),this.__setDigit(e+f,b<<16|65535&v)}return n}},{key:"__inplaceRightShift",value:function(t){if(0!==t){for(var e,r=this.__digit(0)>>>t,n=this.length-1,i=0;i>>t;this.__setDigit(n,r)}}},{key:"__digit",value:function(t){return this[t]}},{key:"__unsignedDigit",value:function(t){return this[t]>>>0}},{key:"__setDigit",value:function(t,e){this[t]=0|e}},{key:"__setDigitGrow",value:function(t,e){this[t]=0|e}},{key:"__halfDigitLength",value:function(){var t=this.length;return 65535>=this.__unsignedDigit(t-1)?2*t-1:2*t}},{key:"__halfDigit",value:function(t){return 65535&this[t>>>1]>>>((1&t)<<4)}},{key:"__setHalfDigit",value:function(t,e){var r=t>>>1,n=this.__digit(r),i=1&t?65535&n|e<<16:4294901760&n|65535&e;this.__setDigit(r,i)}}],[{key:"BigInt",value:function(e){var r=Math.floor,n=Number.isFinite;if("number"==typeof e){if(0===e)return l.__zero();if((0|e)===e)return 0>e?l.__oneDigit(-e,!0):l.__oneDigit(e,!1);if(!n(e)||r(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return l.__fromDouble(e)}if("string"==typeof e){var i=l.__fromString(e);if(null===i)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return i}if("boolean"==typeof e)return!0===e?l.__oneDigit(1,!1):l.__zero();if("object"===t(e)){if(e.constructor===l)return e;var o=l.__toPrimitive(e);return l.BigInt(o)}throw new TypeError("Cannot convert "+e+" to a BigInt")}},{key:"toNumber",value:function(t){var e=t.length;if(0===e)return 0;if(1===e){var r=t.__unsignedDigit(0);return t.sign?-r:r}var n=t.__digit(e-1),i=_(n),o=32*e-i;if(1024>>=12;var c=f-12,g=12<=f?0:s<<20+f,d=20+f;0>>32-c,g=s<>>32-d,d-=32);var p=l.__decideRounding(t,d,u,s);if((1===p||0===p&&1==(1&g))&&0==(g=g+1>>>0)&&0!=++h>>>20&&(h=0,1023<++a))return t.sign?-1/0:1/0;var y=t.sign?-2147483648:0;return a=a+1023<<20,l.__kBitConversionInts[1]=y|a|h,l.__kBitConversionInts[0]=g,l.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(t){if(0===t.length)return t;var e=t.__copy();return e.sign=!t.sign,e}},{key:"bitwiseNot",value:function(t){return t.sign?l.__absoluteSubOne(t).__trim():l.__absoluteAddOne(t,!0)}},{key:"exponentiate",value:function(t,e){if(e.sign)throw new RangeError("Exponent must be positive");if(0===e.length)return l.__oneDigit(1,!1);if(0===t.length)return t;if(1===t.length&&1===t.__digit(0))return t.sign&&0==(1&e.__digit(0))?l.unaryMinus(t):t;if(1=l.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){var n=1+(r>>>5),i=new l(n,t.sign&&0!=(1&r));i.__initializeDigits();var o=1<<(31&r);return i.__setDigit(n-1,o),i}var a=null,s=t;for(0!=(1&r)&&(a=t),r>>=1;0!==r;r>>=1)s=l.multiply(s,s),0!=(1&r)&&(a=null===a?s:l.multiply(a,s));return a}},{key:"multiply",value:function(t,e){if(0===t.length)return t;if(0===e.length)return e;var r=t.length+e.length;32<=t.__clzmsd()+e.__clzmsd()&&r--;var n=new l(r,t.sign!==e.sign);n.__initializeDigits();for(var i=0;il.__absoluteCompare(t,e))return l.__zero();var r,n=t.sign!==e.sign,i=e.__unsignedDigit(0);if(1===e.length&&65535>=i){if(1===i)return n===t.sign?t:l.unaryMinus(t);r=l.__absoluteDivSmall(t,i,null)}else r=l.__absoluteDivLarge(t,e,!0,!1);return r.sign=n,r.__trim()}},{key:"remainder",value:function(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>l.__absoluteCompare(t,e))return t;var r=e.__unsignedDigit(0);if(1===e.length&&65535>=r){if(1===r)return l.__zero();var n=l.__absoluteModSmall(t,r);return 0===n?l.__zero():l.__oneDigit(n,t.sign)}var i=l.__absoluteDivLarge(t,e,!1,!0);return i.sign=t.sign,i.__trim()}},{key:"add",value:function(t,e){var r=t.sign;return r===e.sign?l.__absoluteAdd(t,e,r):0<=l.__absoluteCompare(t,e)?l.__absoluteSub(t,e,r):l.__absoluteSub(e,t,!r)}},{key:"subtract",value:function(t,e){var r=t.sign;return r===e.sign?0<=l.__absoluteCompare(t,e)?l.__absoluteSub(t,e,r):l.__absoluteSub(e,t,!r):l.__absoluteAdd(t,e,r)}},{key:"leftShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?l.__rightShiftByAbsolute(t,e):l.__leftShiftByAbsolute(t,e)}},{key:"signedRightShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?l.__leftShiftByAbsolute(t,e):l.__rightShiftByAbsolute(t,e)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(t,e){return 0>l.__compareToBigInt(t,e)}},{key:"lessThanOrEqual",value:function(t,e){return 0>=l.__compareToBigInt(t,e)}},{key:"greaterThan",value:function(t,e){return 0=l.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.lengthl.__kMaxLengthBits)throw new RangeError("BigInt too big");return l.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=l.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length>>n)return e}return l.__truncateToNBits(t,e)}},{key:"ADD",value:function(t,e){if(t=l.__toPrimitive(t),e=l.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=l.__toNumeric(t),e=l.__toNumeric(e),l.__isBigInt(t)&&l.__isBigInt(e))return l.add(t,e);if("number"==typeof t&&"number"==typeof e)return t+e;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(t,e){return l.__compare(t,e,0)}},{key:"LE",value:function(t,e){return l.__compare(t,e,1)}},{key:"GT",value:function(t,e){return l.__compare(t,e,2)}},{key:"GE",value:function(t,e){return l.__compare(t,e,3)}},{key:"EQ",value:function(e,r){for(;;){if(l.__isBigInt(e))return l.__isBigInt(r)?l.equal(e,r):l.EQ(r,e);if("number"==typeof e){if(l.__isBigInt(r))return l.__equalToNumber(r,e);if("object"!==t(r))return e==r;r=l.__toPrimitive(r)}else if("string"==typeof e){if(l.__isBigInt(r))return null!==(e=l.__fromString(e))&&l.equal(e,r);if("object"!==t(r))return e==r;r=l.__toPrimitive(r)}else if("boolean"==typeof e){if(l.__isBigInt(r))return l.__equalToNumber(r,+e);if("object"!==t(r))return e==r;r=l.__toPrimitive(r)}else if("symbol"===t(e)){if(l.__isBigInt(r))return!1;if("object"!==t(r))return e==r;r=l.__toPrimitive(r)}else{if("object"!==t(e))return e==r;if("object"===t(r)&&r.constructor!==l)return e==r;e=l.__toPrimitive(e)}}}},{key:"NE",value:function(t,e){return!l.EQ(t,e)}},{key:"__zero",value:function(){return new l(0,!1)}},{key:"__oneDigit",value:function(t,e){var r=new l(1,e);return r.__setDigit(0,t),r}},{key:"__decideRounding",value:function(t,e,r,n){if(0e)i=-e-1;else{if(0===r)return-1;r--,n=t.__digit(r),i=31}var o=1<>>20)-1023,n=1+(r>>>5),i=new l(n,0>t),o=1048575&l.__kBitConversionInts[1]|1048576,a=l.__kBitConversionInts[0],s=20,u=31&r,_=0;if(u>>f,o=o<<32-f|a>>>f,a<<=32-f}else if(u===s)_=32,e=o,o=a;else{var h=u-s;_=32-h,e=o<>>32-h,o=a<=t&&9<=t)||(159>=t?32==t:131071>=t?160==t||5760==t:196607>=t?10>=(t&=131071)||40==t||41==t||47==t||95==t||4096==t:65279==t)}},{key:"__fromString",value:function(t){var e=11073741824/s)return null;var _=new l(31+(s*a+u>>>l.__kBitsPerCharTableShift)>>>5,!1),f=10>e?e:10,h=10>=l.__kBitsPerCharTableShift;var c=[],g=[],d=!1;do{for(var p,y=0,v=0;;){if(p=void 0,o-48>>>0>>0>>0>>0>>l.__kBitsPerCharTableShift+5;_.__inplaceMultiplyAdd(D,k,P)}while(!b)}if(i!==n){if(!l.__isWhitespace(o))return null;for(i++;i>>u-(o-=32))}if(0!==i){if(n>=t.length)throw new Error("implementation bug");t.__setDigit(n++,i)}for(;n>>1)+(85&n))>>>2)+(51&n))>>>4)+(15&n),o=e-1,a=t.__digit(r-1),s=0|(32*r-_(a)+i-1)/i;if(t.sign&&s++,268435456>>y,c=32-y;c>=i;)u[f--]=l.__kConversionChars[h&o],h>>>=i,c-=i}var v=(h|a<>>i-c;0!==h;)u[f--]=l.__kConversionChars[h&o],h>>>=i;if(t.sign&&(u[f--]="-"),-1!==f)throw new Error("implementation bug");return u.join("")}},{key:"__toStringGeneric",value:function(t,e,r){var n=t.length;if(0===n)return"";if(1===n){var i=t.__unsignedDigit(0).toString(e);return!1===r&&t.sign&&(i="-"+i),i}var o,a,s=32*n-_(t.__digit(n-1)),u=l.__kMaxBitsPerChar[e]-1,f=s*l.__kBitsPerCharTableMultiplier,h=1+(f=0|(f+=u-1)/u)>>1,c=l.exponentiate(l.__oneDigit(e,!1),l.__oneDigit(h,!1)),g=c.__unsignedDigit(0);if(1===c.length&&65535>=g){(o=new l(t.length,!1)).__initializeDigits();for(var d,p=0,y=2*t.length-1;0<=y;y--)d=p<<16|t.__halfDigit(y),o.__setHalfDigit(y,0|d/g),p=0|d%g;a=p.toString(e)}else{var v=l.__absoluteDivLarge(t,c,!0,!0);o=v.quotient;var b=v.remainder.__trim();a=l.__toStringGeneric(b,e,!0)}o.__trim();for(var m=l.__toStringGeneric(o,e,!0);a.lengthn?l.__absoluteLess(r):0}},{key:"__compareToNumber",value:function(t,e){if(!0|e){var r=t.sign,n=0>e;if(r!==n)return l.__unequalSign(r);if(0===t.length){if(n)throw new Error("implementation bug");return 0===e?0:-1}if(1i?l.__absoluteGreater(r):oe)return l.__unequalSign(r);if(0===e)throw new Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;l.__kBitConversionDouble[0]=e;var n=2047&l.__kBitConversionInts[1]>>>20;if(2047==n)throw new Error("implementation bug: handled elsewhere");var i=n-1023;if(0>i)return l.__absoluteGreater(r);var o=t.length,a=t.__digit(o-1),s=_(a),u=32*o-s,f=i+1;if(uf)return l.__absoluteGreater(r);var h=1048576|1048575&l.__kBitConversionInts[1],c=l.__kBitConversionInts[0],g=20,d=31-s;if(d!==(u-1)%31)throw new Error("implementation bug");var p,y=0;if(d>>v,h=h<<32-v|c>>>v,c<<=32-v}else if(d===g)y=32,p=h,h=c;else{var b=d-g;y=32-b,p=h<>>32-b,h=c<>>=0)>(p>>>=0))return l.__absoluteGreater(r);if(a>>0,h=c,c=0):p=0;var w=t.__unsignedDigit(m);if(w>p)return l.__absoluteGreater(r);if(we&&t.__unsignedDigit(0)===a(e):0===l.__compareToDouble(t,e)}},{key:"__comparisonResultToBool",value:function(t,e){switch(e){case 0:return 0>t;case 1:return 0>=t;case 2:return 0e;case 3:return t>=e}if(l.__isBigInt(t)&&"string"==typeof e)return null!==(e=l.__fromString(e))&&l.__comparisonResultToBool(l.__compareToBigInt(t,e),r);if("string"==typeof t&&l.__isBigInt(e))return null!==(t=l.__fromString(t))&&l.__comparisonResultToBool(l.__compareToBigInt(t,e),r);if(t=l.__toNumeric(t),e=l.__toNumeric(e),l.__isBigInt(t)){if(l.__isBigInt(e))return l.__comparisonResultToBool(l.__compareToBigInt(t,e),r);if("number"!=typeof e)throw new Error("implementation bug");return l.__comparisonResultToBool(l.__compareToNumber(t,e),r)}if("number"!=typeof t)throw new Error("implementation bug");if(l.__isBigInt(e))return l.__comparisonResultToBool(l.__compareToNumber(e,t),2^r);if("number"!=typeof e)throw new Error("implementation bug");return 0===r?te:3===r?t>=e:void 0}},{key:"__absoluteAdd",value:function(t,e,r){if(t.length>>16)+(s>>>16)+(_>>>16);o=f>>>16,i.__setDigit(a,65535&_|f<<16)}for(;a>>16)+(c>>>16);o=g>>>16,i.__setDigit(a,65535&c|g<<16)}return a>>16)-(s>>>16)-(i=1&u>>>16);i=1&_>>>16,n.__setDigit(o,65535&u|_<<16)}for(;o>>16)-(i=1&h>>>16);i=1&c>>>16,n.__setDigit(o,65535&h|c<<16)}return n.__trim()}},{key:"__absoluteAddOne",value:function(t,e){var r=2n?0:t.__unsignedDigit(n)>e.__unsignedDigit(n)?1:-1}},{key:"__multiplyAccumulate",value:function(t,e,r,n){if(0!==e){for(var i=65535&e,o=e>>>16,a=0,s=0,_=0,l=0;l>>16,g=t.__digit(l),d=65535&g,p=g>>>16,y=u(d,i),v=u(d,o),b=u(p,i),m=u(p,o);a=(s=(v>>>16)+(b>>>16)+(65535&m)+(a=(c+=_+a+((h+=s+(65535&y))>>>16)+(y>>>16)+(65535&v)+(65535&b))>>>16))>>>16,s&=65535,_=m>>>16,f=65535&h|c<<16,r.__setDigit(n,f)}for(;0!==a||0!==s||0!==_;n++){var w=r.__digit(n),k=(65535&w)+s,D=(w>>>16)+(k>>>16)+_+a;s=0,_=0,a=D>>>16,w=65535&k|D<<16,r.__setDigit(n,w)}}}},{key:"__internalMultiplyAdd",value:function(t,e,r,n,i){for(var o=r,a=0,s=0;s>>16;var h=u(_>>>16,e),c=(65535&h)+(l>>>16)+o;o=c>>>16,a=h>>>16,i.__setDigit(s,c<<16|65535&f)}if(i.length>n)for(i.__setDigit(n++,o+a);n>>0,a=0|o/e,s=0|(o=((n=0|o%e)<<16|t.__halfDigit(i-1))>>>0)/e;n=0|o%e,r.__setDigit(i>>>1,a<<16|s)}return r}},{key:"__absoluteModSmall",value:function(t,e){for(var r=0,n=2*t.length-1;0<=n;n--)r=0|((r<<16|t.__halfDigit(n))>>>0)%e;return r}},{key:"__absoluteDivLarge",value:function(t,e,r,n){var i=e.__halfDigitLength(),o=e.length,a=t.__halfDigitLength()-i,s=null;r&&(s=new l(a+2>>>1,!1)).__initializeDigits();var _=new l(i+2>>>1,!1);_.__initializeDigits();var f=l.__clz16(e.__halfDigit(i-1));0>>0;p=0|v/c;for(var b=0|v%c,m=e.__halfDigit(i-2),w=h.__halfDigit(d+i-2);u(p,m)>>>0>(b<<16|w)>>>0&&(p--,!(65535<(b+=c))););}l.__internalMultiplyAdd(e,p,0,o,_);var k=h.__inplaceSub(_,d,i+1);0!==k&&(k=h.__inplaceAdd(e,d,i),h.__setHalfDigit(d+i,h.__halfDigit(d+i)+k),p--),r&&(1&d?g=p<<16:s.__setDigit(d>>>1,g|p))}return n?(h.__inplaceRightShift(f),r?{quotient:s,remainder:h}:h):r?s:void 0}},{key:"__clz16",value:function(t){return _(t)-16}},{key:"__specialLeftShift",value:function(t,e,r){var n=t.length,i=new l(n+r,!1);if(0===e){for(var o=0;o>>32-e;return 0r)throw new RangeError("BigInt too big");var n=r>>>5,i=31&r,o=t.length,a=0!==i&&0!=t.__digit(o-1)>>>32-i,s=o+n+(a?1:0),u=new l(s,t.sign);if(0===i){for(var _=0;_>>32-i;if(a)u.__setDigit(o+n,f);else if(0!==f)throw new Error("implementation bug")}return u.__trim()}},{key:"__rightShiftByAbsolute",value:function(t,e){var r=t.length,n=t.sign,i=l.__toShiftAmount(e);if(0>i)return l.__rightShiftByMaximum(n);var o=i>>>5,a=31&i,s=r-o;if(0>=s)return l.__rightShiftByMaximum(n);var u=!1;if(n)if(0!=(t.__digit(o)&(1<>>a,d=r-o-1,p=0;p>>a;f.__setDigit(d,g)}return u&&(f=l.__absoluteAddOne(f,!0,f)),f.__trim()}},{key:"__rightShiftByMaximum",value:function(t){return t?l.__oneDigit(1,!0):l.__zero()}},{key:"__toShiftAmount",value:function(t){if(1l.__kMaxLengthBits?-1:e}},{key:"__toPrimitive",value:function(e){var r=1>>5,n=new l(r,e.sign),i=r-1,o=0;o>>s}return n.__setDigit(i,a),n.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(t,e,r){for(var n=Math.min,i=t+31>>>5,o=new l(i,r),a=0,s=i-1,u=0,_=n(s,e.length);a<_;a++){var f=e.__digit(a),h=0-(65535&f)-u,c=0-(f>>>16)-(u=1&h>>>16);u=1&c>>>16,o.__setDigit(a,65535&h|c<<16)}for(;a>>16)-(u=1&y>>>16)<<16}else{var v=32-p,b=1<<32-v,m=(65535&b)-(65535&(d=d<>>v))-u;g=65535&m|(b>>>16)-(d>>>16)-(u=1&m>>>16)<<16,g&=b-1}return o.__setDigit(s,g),o.__trim()}},{key:"__digitPow",value:function(t,e){for(var r=1;0>>=1,t*=t;return r}}]),l}(l(Array));return c.__kMaxLength=33554432,c.__kMaxLengthBits=c.__kMaxLength<<5,c.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],c.__kBitsPerCharTableShift=5,c.__kBitsPerCharTableMultiplier=1<a)throw new Error(s);let u=i.filter(t=>!r.includes(t));if(i.length-u.length!==o)throw new Error(s);if(u.find(t=>!n.includes(t)))throw new Error(s)}function _(t,e){if(!/^0x([0-9a-fA-F][0-9a-fA-F])*$/.test(e))throw new Error(t+" must be a hex string!")}function l(t,e){if(_(t,e),66!=e.length)throw new Error(t+" must be a hex string of 66 bytes long!")}function f(t,e){if("0x0"!==e&&!/^0x[1-9a-fA-F][0-9a-fA-F]*$/.test(e))throw new Error(t+" must be a hex integer!")}function h(t,{nestedValidation:e=!0,debugPath:r="script"}={}){if(u(r,t,["code_hash","hash_type","args"],[]),l(r+".code_hash",t.code_hash),_(r+".args",t.args),"data"!==t.hash_type&&"type"!==t.hash_type)throw new Error(r+".hash_type must be either data or type!")}function c(t,{nestedValidation:e=!0,debugPath:r="out_point"}={}){u(r,t,["tx_hash","index"],[]),l(r+".tx_hash",t.tx_hash),f(r+".index",t.index)}function g(t,{nestedValidation:e=!0,debugPath:r="cell_input"}={}){u(r,t,["since","previous_output"],[]),f(r+".since",t.since),e&&c(t.previous_output,{debugPath:r+".previous_output"})}function d(t,{nestedValidation:e=!0,debugPath:r="cell_output"}={}){u(r,t,["capacity","lock"],["type"]),f(r+".capacity",t.capacity),e&&(h(t.lock,{debugPath:r+".lock"}),t.type&&h(t.type,{debugPath:r+".type"}))}function p(t,{nestedValidation:e=!0,debugPath:r="cell_dep"}={}){if(u(r,t,["out_point","dep_type"],[]),"code"!==t.dep_type&&"dep_group"!==t.dep_type)throw new Error(r+".dep_type must be either code or dep_group!");e&&c(t.out_point,{debugPath:r+".out_point"})}function y(t,e,r,n){if(!Array.isArray(e))throw new Error(t+" is not an array!");if(n)for(let n=0;n-1};function _(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function l(t){return"string"!=typeof t&&(t=String(t)),t}function f(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function h(t){this.map={},t instanceof h?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function g(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function d(t){var e=new FileReader,r=g(e);return e.readAsArrayBuffer(t),r}function p(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&i&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=p(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||u(t))?this._bodyArrayBuffer=p(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var t,e,r,n=c(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=g(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function m(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function w(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new h(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},y.call(b.prototype),y.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var k=[301,302,303,307,308];w.redirect=function(t,e){if(-1===k.indexOf(e))throw new RangeError("Invalid status code");return new w(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function D(t,r){return new Promise((function(n,o){var a=new b(t,r);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var t,e,r={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new h,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new w(i,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}D.polyfill=!0,t.fetch||(t.fetch=D,t.Headers=h,t.Request=b,t.Response=w),e.Headers=h,e.Request=b,e.Response=w,e.fetch=D}({})}(r),delete r.fetch.polyfill,(e=r.fetch).default=r.fetch,e.fetch=r.fetch,e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response,t.exports=e}));function O(t,e){e=e||{};const r=Object.assign({},e.headers||{},t.headers||{});return Object.assign({},e,t,{headers:r})}const C={get:(t,e,r)=>"send"===e?async()=>{const e=await x(t.uri,O({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.payload)},t.defaultOptions));return await e.json()}:(...n)=>{const i=t.id;return t.id=t.id+1,t.payload.push({jsonrpc:"2.0",id:i,method:e,params:n}),r}},I={get:(t,e)=>"batch"===e?()=>new Proxy({id:Math.round(1e7*Math.random()),payload:[],uri:t.uri,defaultOptions:t.defaultOptions},C):async(...r)=>{const n=Math.round(1e7*Math.random()),i=await x(t.uri,O({method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:n,method:e,params:r})},t.defaultOptions)),o=await i.json();if(o.id!==n)throw new Error("JSONRPCError: response ID does not match request ID!");if(o.error)throw new Error("JSONRPCError: server error "+JSON.stringify(o.error));return o.result}};class R{constructor(t,e={}){return this.uri=t,this.defaultOptions=e,new Proxy(this,I)}static create(t){return new R(t)}}function j(t){return s.BigInt(t)}function z(t){return"0x"+t.toString(16)}function M(t){return function(e,r){if(!(r instanceof ArrayBuffer)){let n=z(s.BigInt(r)).substr(2);if(n.length%2!=0&&(n="0"+n),n.length/2>t)throw new Error(`${e} is ${n.length/2} bytes long, expected length is ${t}!`);const i=new DataView(new ArrayBuffer(t));for(let t=0;t0&&r.byteLength!==t)throw new Error(`${e} has invalid length ${r.byteLength}, required: ${t}`);return r}}function L(t,e,r){const n={};for(const[i,o]of Object.entries(r)){const r=e[i];if(!r)throw new Error(`${t} is missing ${i}!`);n[i]=o(`${t}.${i}`,r)}return n}function U(t,{debugPath:e="script"}={}){return L(e,t,{code_hash:N(32),hash_type:function(t,e){switch(e){case"data":return 0;case"type":return 1;case 0:case 1:return e;default:throw new Error(`${t}.hash_type has invalid value: ${e}`)}},args:N(-1)})}function V(t,{debugPath:e="out_point"}={}){return L(e,t,{tx_hash:N(32),index:M(4)})}function q(t){return function(e,r){return t(r,{debugPath:e})}}function $(t,{debugPath:e="cell_input"}={}){return L(e,t,{since:M(8),previous_output:q(V)})}function F(t,{debugPath:e="cell_output"}={}){const r=L(e,t,{capacity:M(8),lock:q(U)});return t.type&&(r.type_=U(t.type,{debugPath:e+".type"})),r}function H(t,{debugPath:e="cell_dep"}={}){return L(e,t,{out_point:q(V),dep_type:function(t,e){switch(e){case"code":return 0;case"dep_group":return 1;case 0:case 1:return e;default:throw new Error(`${t}.dep_type has invalid value: ${e}`)}}})}function G(t){return function(e,r){return r.map((r,n)=>t(`${e}[${n}]`,r))}}function W(t,{debugPath:e="raw_transaction"}={}){return L(e,t,{version:M(4),cell_deps:G(q(H)),header_deps:G(N(32)),inputs:G(q($)),outputs:G(q(F)),outputs_data:G(N(-1))})}function J(t,{debugPath:e="transaction"}={}){const r=W(t,{debugPath:"(raw)"+e}),n=L(e,t,{witnesses:G(N(-1))});return n.raw=r,n}function X(t,{debugPath:e="raw_header"}={}){return L(e,t,{version:M(4),compact_target:M(4),timestamp:M(8),number:M(8),epoch:M(8),parent_hash:N(32),transactions_root:N(32),proposals_hash:N(32),uncles_hash:N(32),dao:N(32)})}function Q(t,{debugPath:e="header"}={}){const r=X(t,{debugPath:"(raw)"+e}),n=L(e,t,{nonce:M(16)});return n.raw=r,n}function K(t,{debugPath:e="uncle_block"}={}){return L(e,t,{header:q(Q),proposals:G(N(10))})}var Y=Object.freeze({__proto__:null,NormalizeScript:U,NormalizeOutPoint:V,NormalizeCellInput:$,NormalizeCellOutput:F,NormalizeCellDep:H,NormalizeRawTransaction:W,NormalizeTransaction:J,NormalizeRawHeader:X,NormalizeHeader:Q,NormalizeUncleBlock:K,NormalizeBlock:function(t,{debugPath:e="block"}={}){return L(e,t,{header:q(Q),uncles:G(q(K)),transactions:G(q(J)),proposals:G(N(10))})},NormalizeCellbaseWitness:function(t,{debugPath:e="cellbase_witness"}={}){return L(e,t,{lock:q(U),message:N(-1)})},NormalizeWitnessArgs:function(t,{debugPath:e="witness_args"}={}){const r={};return t.lock&&(r.lock=N(-1)(e+".lock",t.lock)),t.input_type&&(r.input_type=N(-1)(e+".input_type",t.input_type)),t.output_type&&(r.output_type=N(-1)(e+".output_type",t.output_type)),r}});function Z(t,e){return e instanceof Object&&e.serializeJson instanceof Function?e.serializeJson.call(e):e}function tt(t,e,r){if(!((e=Z(0,e))instanceof Object))throw new Error(`Transformed ${t} is not an object!`);const n={};for(const[i,o]of Object.entries(r)){let r=e[i];if(!r){r=e[i.replace(/(_[a-z])/g,t=>t.toUpperCase().replace("_",""))]}r&&(n[i]=o(`${t}.${i}`,r))}return n}function et(t,{validation:e=!0,debugPath:r="script"}={}){return t=tt(r,t,{code_hash:Z,hash_type:Z,args:Z}),e&&h(t,{debugPath:"(transformed) "+r}),t}function rt(t,{validation:e=!0,debugPath:r="out_point"}={}){return t=tt(r,t,{tx_hash:Z,index:Z}),e&&c(t,{debugPath:"(transformed) "+r}),t}function nt(t){return function(e,r){return t(r,{validation:!1,debugPath:e})}}function it(t,{validation:e=!0,debugPath:r="cell_input"}={}){return t=tt(r,t,{since:Z,previous_output:nt(rt)}),e&&g(t,{debugPath:"(transformed) "+r}),t}function ot(t,{validation:e=!0,debugPath:r="cell_output"}={}){return t=tt(r,t,{capacity:Z,lock:nt(et),type:nt(et)}),e&&d(t,{debugPath:"(transformed) "+r}),t}function at(t,{validation:e=!0,debugPath:r="cell_dep"}={}){return t=tt(r,t,{out_point:nt(rt),dep_type:Z}),e&&p(t,{debugPath:"(transformed) "+r}),t}function st(t){return function(e,r){return r.map((r,n)=>t(`${e}[${n}]`,r))}}function ut(t,{validation:e=!0,debugPath:r="transaction"}={}){return t=tt(r,t,{version:Z,cell_deps:st(nt(at)),header_deps:st(Z),inputs:st(nt(it)),outputs:st(nt(ot)),outputs_data:st(Z),witnesses:st(Z)}),e&&w(t,{debugPath:"(transformed) "+r}),t}function _t(t,{validation:e=!0,debugPath:r="header"}={}){return t=tt(r,t,{version:Z,compact_target:Z,timestamp:Z,number:Z,epoch:Z,parent_hash:Z,transactions_root:Z,proposals_hash:Z,uncles_hash:Z,dao:Z,nonce:Z}),e&&D(t,{debugPath:"(transformed) "+r}),t}function lt(t,{validation:e=!0,debugPath:r="uncle_block"}={}){return t=tt(r,t,{header:nt(_t),proposals:st(Z)}),e&&P(t,{debugPath:"(transformed) "+r}),t}var ft=Object.freeze({__proto__:null,TransformScript:et,TransformOutPoint:rt,TransformCellInput:it,TransformCellOutput:ot,TransformCellDep:at,TransformRawTransaction:function(t,{validation:e=!0,debugPath:r="raw_transaction"}={}){return t=tt(r,t,{version:Z,cell_deps:st(nt(at)),header_deps:st(Z),inputs:st(nt(it)),outputs:st(nt(ot)),outputs_data:st(Z)}),e&&m(t,{debugPath:"(transformed) "+r}),t},TransformTransaction:ut,TransformRawHeader:function(t,{validation:e=!0,debugPath:r="raw_header"}={}){return t=tt(r,t,{version:Z,compact_target:Z,timestamp:Z,number:Z,epoch:Z,parent_hash:Z,transactions_root:Z,proposals_hash:Z,uncles_hash:Z,dao:Z}),e&&k(t,{debugPath:"(transformed) "+r}),t},TransformHeader:_t,TransformUncleBlock:lt,TransformBlock:function(t,{validation:e=!0,debugPath:r="block"}={}){return t=tt(r,t,{header:nt(_t),uncles:st(nt(lt)),transactions:st(nt(ut)),proposals:st(Z)}),e&&T(t,{debugPath:"(transformed) "+r}),t},TransformCellbaseWitness:function(t,{validation:e=!0,debugPath:r="cellbase_witness"}={}){return t=tt(r,t,{lock:nt(et),message:Z}),e&&A(t,{debugPath:"(transformed) "+r}),t},TransformWitnessArgs:function(t,{validation:e=!0,debugPath:r="witness_args"}={}){return t=tt(r,t,{lock:Z,input_type:Z,output_type:Z}),e&&E(t,{debugPath:"(transformed) "+r}),t}});var ht=Object.freeze({__proto__:null,RPCCollector:class{constructor(t,e,{skipCellWithContent:r=!0,loadData:n=!1,loadBlockNumber:o=!0}={}){this.rpc=t,this.lockHash=new i(e).serializeJson(),this.skipCellWithContent=r,this.loadData=n,this.loadBlockNumber=o}async*collect(){const t=j(await this.rpc.get_tip_block_number());let e=s.BigInt(0);for(;s.lessThanOrEqual(e,t);){let r=s.add(e,s.BigInt(100));s.greaterThan(r,t)&&(r=t);const n=await this.rpc.get_cells_by_lock_hash(this.lockHash,z(e),z(r));for(const t of n){if(this.skipCellWithContent&&(t.type||s.greaterThan(j(t.output_data_len),s.BigInt(100))))continue;let e=null;if(this.loadData){e=(await this.rpc.get_live_cell(t.out_point,!0)).cell.data.content}let r=null;if(this.loadBlockNumber){r=(await this.rpc.get_header(t.block_hash)).number}yield{cellbase:t.cellbase,cell_output:{capacity:t.capacity,lock:t.lock,type:t.type},out_point:t.out_point,block_hash:t.block_hash,data:e,output_data_len:t.output_data_len,block_number:r}}e=s.add(r,s.BigInt(1))}}}});t.BigIntToHexString=z,t.HexStringToBigInt=j,t.RPC=R,t.Reader=i,t.TransactionDumper=class{constructor(t,{validateTransaction:e=!0,depGroupUnpacker:r=null}={}){this.rpc=t,this.validateTransaction=e,this.depGroupUnpacker=r}async dumpByHash(t){const e=(await this.rpc.get_transaction(t)).transaction;return delete e.hash,await this.dump(e)}async dump(t){this.validateTransaction&&w(t);const e=[];for(const r of t.inputs){const{output:t,data:n,header:i}=await this._resolveOutPoint(r.previous_output);e.push({input:r,output:t,data:n,header:i})}const r=[];for(const e of t.cell_deps){const{output:t,data:n,header:o}=await this._resolveOutPoint(e.out_point);if(r.push({cell_dep:e,output:t,data:n,header:o}),"dep_group"===e.dep_type){if(!this.depGroupUnpacker)throw new Error("depGroupUnpacker must be provided when the transaction contains dep_group!");const t=this.depGroupUnpacker(new i(n));for(const e of t){c(e);const{output:t,data:n,header:i}=await this._resolveOutPoint(e);r.push({cell_dep:{out_point:e,dep_type:"code"},output:t,data:n,header:i})}}}const n=[];for(const e of t.header_deps)n.push(await this.rpc.get_header(e));return JSON.stringify({mock_info:{inputs:e,cell_deps:r,header_deps:n},tx:t})}async _resolveOutPoint(t){const e=await this.rpc.get_transaction(t.tx_hash);if(!e||!e.transaction)throw new Error(`Transaction ${t.tx_hash} cannot be found!`);const r=e.transaction,n=s.toNumber(s.BigInt(t.index));if(n>=r.outputs.length)throw new Error(`Transaction ${t.tx_hash} does not have output ${n}!`);const i={output:r.outputs[n],data:r.outputs_data[n]};return"committed"===e.tx_status.status&&(i.header=e.tx_status.block_hash),i}},t.VERSION="0.10.2",t.cell_collectors=ht,t.normalizers=Y,t.transformers=ft,t.validators=S,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/index.d.ts b/index.d.ts index 6d772ce..0b7dd0c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -3,6 +3,8 @@ import JSBI from "jsbi"; export class Reader { constructor(reader: string | ArrayBuffer | Reader); static fromRawString(s: string): Reader; + static isReader(x: unknown): x is Reader; + static from(x: string | ArrayBuffer | Reader | Uint8Array): Reader; length(): number; indexAt(i: number): number; diff --git a/package-lock.json b/package-lock.json index ee42d67..e128f5a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -100,28 +100,28 @@ } }, "@nodelib/fs.scandir": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", - "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "requires": { - "@nodelib/fs.stat": "2.0.3", + "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "@nodelib/fs.stat": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", - "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true }, "@nodelib/fs.walk": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", - "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "requires": { - "@nodelib/fs.scandir": "2.1.3", + "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, @@ -202,12 +202,6 @@ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", "dev": true - }, - "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", - "dev": true } } }, @@ -238,29 +232,6 @@ "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", "dev": true }, - "@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", - "dev": true - }, - "@types/glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", - "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", - "dev": true, - "requires": { - "@types/events": "*", - "@types/minimatch": "*", - "@types/node": "*" - } - }, - "@types/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", - "dev": true - }, "@types/node": { "version": "13.7.7", "resolved": "https://registry.npmjs.org/@types/node/-/node-13.7.7.tgz", @@ -282,10 +253,22 @@ "@types/node": "*" } }, + "acorn": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "dev": true + }, + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true + }, "aggregate-error": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", - "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dev": true, "requires": { "clean-stack": "^2.0.0", @@ -293,58 +276,18 @@ } }, "ansi-align": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", - "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", "dev": true, "requires": { - "string-width": "^3.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } + "string-width": "^4.1.0" } }, "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { @@ -358,9 +301,9 @@ } }, "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "dev": true, "requires": { "normalize-path": "^3.0.0", @@ -407,63 +350,75 @@ "dev": true }, "ava": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/ava/-/ava-3.5.0.tgz", - "integrity": "sha512-o+xq1RgAZrQ7GX5nddTNeYbUDogwlBoa/Hnt+b1ciCLLxSOj5U6ZFblLNBSKwHtP1X/8R06bmzvX47jmlVu9KQ==", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/ava/-/ava-3.15.0.tgz", + "integrity": "sha512-HGAnk1SHPk4Sx6plFAUkzV/XC1j9+iQhOzt4vBly18/yo0AV8Oytx7mtJd/CR8igCJ5p160N/Oo/cNJi2uSeWA==", "dev": true, "requires": { "@concordance/react": "^2.0.0", - "ansi-styles": "^4.2.1", + "acorn": "^8.0.4", + "acorn-walk": "^8.0.0", + "ansi-styles": "^5.0.0", "arrgv": "^1.0.2", "arrify": "^2.0.1", - "chalk": "^3.0.0", - "chokidar": "^3.3.1", + "callsites": "^3.1.0", + "chalk": "^4.1.0", + "chokidar": "^3.4.3", "chunkd": "^2.0.1", - "ci-parallel-vars": "^1.0.0", - "clean-stack": "^2.2.0", + "ci-info": "^2.0.0", + "ci-parallel-vars": "^1.0.1", "clean-yaml-object": "^0.1.0", "cli-cursor": "^3.1.0", "cli-truncate": "^2.1.0", - "code-excerpt": "^2.1.1", + "code-excerpt": "^3.0.0", "common-path-prefix": "^3.0.0", - "concordance": "^4.0.0", + "concordance": "^5.0.1", "convert-source-map": "^1.7.0", "currently-unhandled": "^0.4.1", - "debug": "^4.1.1", - "del": "^5.1.0", - "emittery": "^0.5.1", + "debug": "^4.3.1", + "del": "^6.0.0", + "emittery": "^0.8.0", "equal-length": "^1.0.0", - "figures": "^3.1.0", - "globby": "^11.0.0", - "ignore-by-default": "^1.0.0", + "figures": "^3.2.0", + "globby": "^11.0.1", + "ignore-by-default": "^2.0.0", "import-local": "^3.0.2", "indent-string": "^4.0.0", - "is-ci": "^2.0.0", "is-error": "^2.2.2", - "is-plain-object": "^3.0.0", - "is-promise": "^2.1.0", - "lodash": "^4.17.15", - "matcher": "^2.1.0", + "is-plain-object": "^5.0.0", + "is-promise": "^4.0.0", + "lodash": "^4.17.20", + "matcher": "^3.0.0", "md5-hex": "^3.0.1", - "ms": "^2.1.2", - "ora": "^4.0.3", - "p-map": "^3.0.0", - "picomatch": "^2.2.1", + "mem": "^8.0.0", + "ms": "^2.1.3", + "ora": "^5.2.0", + "p-event": "^4.2.0", + "p-map": "^4.0.0", + "picomatch": "^2.2.2", "pkg-conf": "^3.1.0", "plur": "^4.0.0", - "pretty-ms": "^6.0.0", + "pretty-ms": "^7.0.1", "read-pkg": "^5.2.0", "resolve-cwd": "^3.0.0", "slash": "^3.0.0", - "source-map-support": "^0.5.16", - "stack-utils": "^2.0.1", + "source-map-support": "^0.5.19", + "stack-utils": "^2.0.3", "strip-ansi": "^6.0.0", - "supertap": "^1.0.0", + "supertap": "^2.0.0", "temp-dir": "^2.0.0", "trim-off-newlines": "^1.0.1", - "update-notifier": "^4.1.0", - "write-file-atomic": "^3.0.1", - "yargs": "^15.1.0" + "update-notifier": "^5.0.1", + "write-file-atomic": "^3.0.3", + "yargs": "^16.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true + } } }, "balanced-match": { @@ -472,12 +427,29 @@ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true + }, "binary-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", - "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, + "bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "requires": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, "blueimp-md5": { "version": "2.12.0", "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.12.0.tgz", @@ -485,25 +457,25 @@ "dev": true }, "boxen": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", - "integrity": "sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", + "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", "dev": true, "requires": { "ansi-align": "^3.0.0", - "camelcase": "^5.3.1", - "chalk": "^3.0.0", - "cli-boxes": "^2.2.0", - "string-width": "^4.1.0", - "term-size": "^2.1.0", - "type-fest": "^0.8.1", - "widest-line": "^3.1.0" + "camelcase": "^6.2.0", + "chalk": "^4.1.0", + "cli-boxes": "^2.2.1", + "string-width": "^4.2.2", + "type-fest": "^0.20.2", + "widest-line": "^3.1.0", + "wrap-ansi": "^7.0.0" }, "dependencies": { "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true } } @@ -527,6 +499,16 @@ "fill-range": "^7.0.1" } }, + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -555,9 +537,9 @@ }, "dependencies": { "get-stream": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", - "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", "dev": true, "requires": { "pump": "^3.0.0" @@ -571,16 +553,22 @@ } } }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true }, "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -588,19 +576,28 @@ } }, "chokidar": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz", - "integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", "dev": true, "requires": { - "anymatch": "~3.1.1", + "anymatch": "~3.1.2", "braces": "~3.0.2", - "fsevents": "~2.1.2", - "glob-parent": "~5.1.0", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.3.0" + "readdirp": "~3.6.0" + }, + "dependencies": { + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + } } }, "chunkd": { @@ -616,9 +613,9 @@ "dev": true }, "ci-parallel-vars": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/ci-parallel-vars/-/ci-parallel-vars-1.0.0.tgz", - "integrity": "sha512-u6dx20FBXm+apMi+5x7UVm6EH7BL1gc4XrcnQewjcB7HWRcor/V5qWc3RG2HwpgDJ26gIi2DSEu3B7sXynAw/g==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ci-parallel-vars/-/ci-parallel-vars-1.0.1.tgz", + "integrity": "sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==", "dev": true }, "clean-stack": { @@ -634,9 +631,9 @@ "dev": true }, "cli-boxes": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.0.tgz", - "integrity": "sha512-gpaBrMAizVEANOpfZp/EEUixTXDyGt7DFzdK5hU+UbWt/J0lB0w20ncZj59Z9a93xHb9u12zF5BS6i9RKbtg4w==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", "dev": true }, "cli-cursor": { @@ -649,9 +646,9 @@ } }, "cli-spinners": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.2.0.tgz", - "integrity": "sha512-tgU3fKwzYjiLEQgPMD9Jt+JjHVL9kW93FiIMX/l7rivvOD4/LL0Mf7gda3+4U2KJBloybwgj5KEoQgGRioMiKQ==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", + "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==", "dev": true }, "cli-truncate": { @@ -665,14 +662,14 @@ } }, "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, "requires": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" + "wrap-ansi": "^7.0.0" } }, "clone": { @@ -691,9 +688,9 @@ } }, "code-excerpt": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/code-excerpt/-/code-excerpt-2.1.1.tgz", - "integrity": "sha512-tJLhH3EpFm/1x7heIW0hemXJTUU5EWl2V0EIX558jp05Mt1U6DVryCgkp3l37cxqs+DNbNgxG43SkwJXpQ14Jw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/code-excerpt/-/code-excerpt-3.0.0.tgz", + "integrity": "sha512-VHNTVhd7KsLGOqfX3SyeO8RyYPMp1GJOg194VITk04WMYCv4plV68YWe6TJZxd9MhobjtpMRnVky01gqZsalaw==", "dev": true, "requires": { "convert-to-spaces": "^1.0.1" @@ -739,31 +736,28 @@ "dev": true }, "concordance": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/concordance/-/concordance-4.0.0.tgz", - "integrity": "sha512-l0RFuB8RLfCS0Pt2Id39/oCPykE01pyxgAFypWTlaGRgvLkZrtczZ8atEHpTeEIW+zYWXTBuA9cCSeEOScxReQ==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/concordance/-/concordance-5.0.4.tgz", + "integrity": "sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==", "dev": true, "requires": { - "date-time": "^2.1.0", - "esutils": "^2.0.2", - "fast-diff": "^1.1.2", + "date-time": "^3.1.0", + "esutils": "^2.0.3", + "fast-diff": "^1.2.0", "js-string-escape": "^1.0.1", - "lodash.clonedeep": "^4.5.0", - "lodash.flattendeep": "^4.4.0", - "lodash.islength": "^4.0.1", - "lodash.merge": "^4.6.1", - "md5-hex": "^2.0.0", - "semver": "^5.5.1", + "lodash": "^4.17.15", + "md5-hex": "^3.0.1", + "semver": "^7.3.2", "well-known-symbols": "^2.0.0" }, "dependencies": { - "md5-hex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-2.0.0.tgz", - "integrity": "sha1-0FiOnxx0lUSS7NJKwKxs6ZfZLjM=", + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "dev": true, "requires": { - "md5-o-matic": "^0.1.1" + "lru-cache": "^6.0.0" } } } @@ -821,29 +815,31 @@ } }, "date-time": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/date-time/-/date-time-2.1.0.tgz", - "integrity": "sha512-/9+C44X7lot0IeiyfgJmETtRMhBidBYM2QFFIkGa0U1k+hSyY87Nw7PY3eDqpvCBm7I3WCSfPeZskW/YYq6m4g==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/date-time/-/date-time-3.1.0.tgz", + "integrity": "sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==", "dev": true, "requires": { "time-zone": "^1.0.0" } }, "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "requires": { - "ms": "^2.1.1" + "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } } }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, "decompress-response": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", @@ -881,37 +877,19 @@ "dev": true }, "del": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/del/-/del-5.1.0.tgz", - "integrity": "sha512-wH9xOVHnczo9jN2IW68BabcecVPxacIA3g/7z6vhSU/4stOKQzeCRK0yD0A24WiAAUJmmVpWqrERcTxnLo3AnA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/del/-/del-6.0.0.tgz", + "integrity": "sha512-1shh9DQ23L16oXSZKB2JxpL7iMy2E0S9d517ptA1P8iw0alkPtQcrKH7ru31rYtKwF499HkTu+DRzq3TCKDFRQ==", "dev": true, "requires": { - "globby": "^10.0.1", - "graceful-fs": "^4.2.2", + "globby": "^11.0.1", + "graceful-fs": "^4.2.4", "is-glob": "^4.0.1", "is-path-cwd": "^2.2.0", - "is-path-inside": "^3.0.1", - "p-map": "^3.0.0", - "rimraf": "^3.0.0", + "is-path-inside": "^3.0.2", + "p-map": "^4.0.0", + "rimraf": "^3.0.2", "slash": "^3.0.0" - }, - "dependencies": { - "globby": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", - "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", - "dev": true, - "requires": { - "@types/glob": "^7.1.1", - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.0.3", - "glob": "^7.1.3", - "ignore": "^5.1.1", - "merge2": "^1.2.3", - "slash": "^3.0.0" - } - } } }, "dir-glob": { @@ -924,9 +902,9 @@ } }, "dot-prop": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.2.0.tgz", - "integrity": "sha512-uEUyaDKoSQ1M4Oq8l45hSE26SnTxL6snNnqvK/VWx5wJhmff5z0FUVJDKDanor/6w3kzE3i7XZOk+7wC0EXr1A==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", "dev": true, "requires": { "is-obj": "^2.0.0" @@ -939,9 +917,9 @@ "dev": true }, "emittery": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.5.1.tgz", - "integrity": "sha512-sYZXNHH9PhTfs98ROEFVC3bLiR8KSqXQsEHIwZ9J6H0RaQObC3JYq4G8IvDd0b45/LxfGKYBpmaUN4LiKytaNw==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz", + "integrity": "sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg==", "dev": true }, "emoji-regex": { @@ -974,6 +952,12 @@ "is-arrayish": "^0.2.1" } }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, "escape-goat": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", @@ -1011,23 +995,22 @@ "dev": true }, "fast-glob": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.2.tgz", - "integrity": "sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==", + "version": "3.2.10", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.10.tgz", + "integrity": "sha512-s9nFhFnvR63wls6/kM88kQqDhMu0AfdjqouE2l5GVQPbqLgyFjjU5ry/r2yKsJxpb9Py1EYNqieFrmMaX4v++A==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", + "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" + "micromatch": "^4.0.4" } }, "fastq": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.1.tgz", - "integrity": "sha512-mpIH5sKYueh3YyeJwqtVo8sORi0CgtmkVbK6kZStpQlZBYQuTzG2CZ7idSiJuA7bY0SFCWUc5WIs+oYumGCQNw==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -1104,34 +1087,34 @@ } }, "glob-parent": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", - "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "requires": { "is-glob": "^4.0.1" } }, "global-dirs": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.0.1.tgz", - "integrity": "sha512-5HqUqdhkEovj2Of/ms3IeS/EekcO54ytHRLV4PEY2rhRwrHXLQjeVEES0Lhka0xwNDtGYn58wyC4s5+MHsOO6A==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", + "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", "dev": true, "requires": { - "ini": "^1.3.5" + "ini": "2.0.0" } }, "globby": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.0.tgz", - "integrity": "sha512-iuehFnR3xu5wBBtm4xi0dMe92Ob87ufyu/dHwpDYfbcpYpIbrO5OnS8M1vWvrBhSGEJ3/Ecj7gnX76P8YxpPEg==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "requires": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", - "fast-glob": "^3.1.1", - "ignore": "^5.1.4", - "merge2": "^1.3.0", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", "slash": "^3.0.0" } }, @@ -1155,9 +1138,9 @@ } }, "graceful-fs": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", - "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==", + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", + "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", "dev": true }, "has-flag": { @@ -1173,9 +1156,9 @@ "dev": true }, "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, "http-cache-semantics": { @@ -1184,16 +1167,22 @@ "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", "dev": true }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true + }, "ignore": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", - "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true }, "ignore-by-default": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-2.0.0.tgz", + "integrity": "sha512-+mQSgMRiFD3L3AOxLYOCxjIq4OnAmo5CIuC+lj5ehCJcPtV++QacEV7FdpzvYxH6DaOySWzQU6RR0lPLy37ckA==", "dev": true }, "import-lazy": { @@ -1241,9 +1230,9 @@ "dev": true }, "ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", "dev": true }, "irregular-plurals": { @@ -1295,22 +1284,22 @@ "dev": true }, "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "requires": { "is-extglob": "^2.1.1" } }, "is-installed-globally": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.3.1.tgz", - "integrity": "sha512-oiEcGoQbGc+3/iijAijrK2qFpkNoNjsHOm/5V5iaeydyrS/hnwaRCEgH5cpW0P3T1lSjV5piB7S5b5lEugNLhg==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", + "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", "dev": true, "requires": { - "global-dirs": "^2.0.1", - "is-path-inside": "^3.0.1" + "global-dirs": "^3.0.0", + "is-path-inside": "^3.0.2" } }, "is-interactive": { @@ -1326,9 +1315,9 @@ "dev": true }, "is-npm": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-4.0.0.tgz", - "integrity": "sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-5.0.0.tgz", + "integrity": "sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==", "dev": true }, "is-number": { @@ -1350,24 +1339,21 @@ "dev": true }, "is-path-inside": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.2.tgz", - "integrity": "sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true }, "is-plain-object": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", - "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", - "dev": true, - "requires": { - "isobject": "^4.0.0" - } + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true }, "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", "dev": true }, "is-reference": { @@ -1385,18 +1371,18 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true + }, "is-yarn-global": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", "dev": true }, - "isobject": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", - "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", - "dev": true - }, "jest-worker": { "version": "26.3.0", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.3.0.tgz", @@ -1421,9 +1407,9 @@ "dev": true }, "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -1494,94 +1480,19 @@ } }, "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", - "dev": true - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, - "lodash.flattendeep": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", - "dev": true - }, - "lodash.islength": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.islength/-/lodash.islength-4.0.1.tgz", - "integrity": "sha1-Tpho1FJXXXUK/9NYyXlUPcIO1Xc=", - "dev": true - }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, "log-symbols": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", - "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "requires": { - "chalk": "^2.4.2" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" } }, "lowercase-keys": { @@ -1590,6 +1501,15 @@ "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", "dev": true }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "magic-string": { "version": "0.25.7", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", @@ -1600,9 +1520,9 @@ } }, "make-dir": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.2.tgz", - "integrity": "sha512-rYKABKutXa6vXTXhoV18cBE7PaewPXHe/Bdq4v+ZLMhxbWApkFFplT0LcbMW+6BbjnQXzZ/sAvSE/JdguApG5w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "requires": { "semver": "^6.0.0" @@ -1616,19 +1536,28 @@ } } }, + "map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "dev": true, + "requires": { + "p-defer": "^1.0.0" + } + }, "matcher": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/matcher/-/matcher-2.1.0.tgz", - "integrity": "sha512-o+nZr+vtJtgPNklyeUKkkH42OsK8WAfdgaJE2FNxcjLPg+5QbeEoT6vRj8Xq/iv18JlQ9cmKsEu0b94ixWf1YQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", + "integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==", "dev": true, "requires": { - "escape-string-regexp": "^2.0.0" + "escape-string-regexp": "^4.0.0" }, "dependencies": { "escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true } } @@ -1642,11 +1571,15 @@ "blueimp-md5": "^2.10.0" } }, - "md5-o-matic": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/md5-o-matic/-/md5-o-matic-0.1.1.tgz", - "integrity": "sha1-givM1l4RfFFPqxdrJZRdVBAKA8M=", - "dev": true + "mem": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/mem/-/mem-8.1.1.tgz", + "integrity": "sha512-qFCFUDs7U3b8mBDPyz5EToEKoAkgCzqquIgi9nkkR9bixxOVOre+09lbuH7+9Kn2NFpm56M3GUWVbU2hQgdACA==", + "dev": true, + "requires": { + "map-age-cleaner": "^0.1.3", + "mimic-fn": "^3.1.0" + } }, "merge-stream": { "version": "2.0.0", @@ -1655,25 +1588,25 @@ "dev": true }, "merge2": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", - "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true }, "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", "dev": true, "requires": { "braces": "^3.0.1", - "picomatch": "^2.0.5" + "picomatch": "^2.2.3" } }, "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz", + "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==", "dev": true }, "mimic-response": { @@ -1698,15 +1631,9 @@ "dev": true }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "node-fetch": { @@ -1733,9 +1660,9 @@ "dev": true }, "normalize-url": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", - "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz", + "integrity": "sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==", "dev": true }, "once": { @@ -1748,26 +1675,35 @@ } }, "onetime": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", - "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "requires": { "mimic-fn": "^2.1.0" + }, + "dependencies": { + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + } } }, "ora": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/ora/-/ora-4.0.3.tgz", - "integrity": "sha512-fnDebVFyz309A73cqCipVL1fBZewq4vwgSHfxh43vVy31mbyoQ8sCH3Oeaog/owYOs/lLlGVPCISQonTneg6Pg==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", "dev": true, "requires": { - "chalk": "^3.0.0", + "bl": "^4.1.0", + "chalk": "^4.1.0", "cli-cursor": "^3.1.0", - "cli-spinners": "^2.2.0", + "cli-spinners": "^2.5.0", "is-interactive": "^1.0.0", - "log-symbols": "^3.0.0", - "mute-stream": "0.0.8", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", "strip-ansi": "^6.0.0", "wcwidth": "^1.0.1" } @@ -1778,6 +1714,27 @@ "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", "dev": true }, + "p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "dev": true + }, + "p-event": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-4.2.0.tgz", + "integrity": "sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==", + "dev": true, + "requires": { + "p-timeout": "^3.1.0" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, "p-limit": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", @@ -1797,14 +1754,23 @@ } }, "p-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", "dev": true, "requires": { "aggregate-error": "^3.0.0" } }, + "p-timeout": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", + "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", + "dev": true, + "requires": { + "p-finally": "^1.0.0" + } + }, "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -1860,9 +1826,9 @@ "dev": true }, "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "path-type": { @@ -1872,9 +1838,9 @@ "dev": true }, "picomatch": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.1.tgz", - "integrity": "sha512-ISBaA8xQNmwELC7eOjqFKMESB2VIqt4PPDD0nsS95b/9dZXvVKOlz9keMSnoGGKcOHXfTvDD6WMaRoSc9UuhRA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, "pify": { @@ -1960,9 +1926,9 @@ "dev": true }, "pretty-ms": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-6.0.1.tgz", - "integrity": "sha512-ke4njoVmlotekHlHyCZ3wI/c5AMT8peuHs8rKJqekj/oR5G8lND2dVpicFlUz5cbZgE290vvkMuDwfj/OcW1kw==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-7.0.1.tgz", + "integrity": "sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q==", "dev": true, "requires": { "parse-ms": "^2.1.0" @@ -1979,14 +1945,20 @@ } }, "pupa": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.0.1.tgz", - "integrity": "sha512-hEJH0s8PXLY/cdXh66tNEQGndDrIKNqNC5xmrysZy3i5C3oEoLna7YAOad+7u125+zH1HNXUmGEkrhb3c2VriA==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", + "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", "dev": true, "requires": { "escape-goat": "^2.0.0" } }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -2006,6 +1978,14 @@ "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + } } }, "read-pkg": { @@ -2040,19 +2020,30 @@ } } }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, "readdirp": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz", - "integrity": "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "requires": { - "picomatch": "^2.0.7" + "picomatch": "^2.2.1" } }, "registry-auth-token": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.1.1.tgz", - "integrity": "sha512-9bKS7nTl9+/A1s7tnPeGrUpRcVY+LUh7bfFgzpndALdPfXQBfQV77rQVtqgUV3ti4vc/Ik81Ex8UJDWDQ12zQA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", + "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", "dev": true, "requires": { "rc": "^1.2.8" @@ -2073,12 +2064,6 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, "resolve": { "version": "1.15.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.1.tgz", @@ -2231,10 +2216,13 @@ } }, "run-parallel": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", - "dev": true + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } }, "safe-buffer": { "version": "5.1.2", @@ -2266,10 +2254,21 @@ } }, "serialize-error": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", - "integrity": "sha1-ULZ51WNc34Rme9yOWa9OW4HV9go=", - "dev": true + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz", + "integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==", + "dev": true, + "requires": { + "type-fest": "^0.13.1" + }, + "dependencies": { + "type-fest": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + "dev": true + } + } }, "serialize-javascript": { "version": "4.0.0", @@ -2280,16 +2279,10 @@ "randombytes": "^2.1.0" } }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz", + "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==", "dev": true }, "slash": { @@ -2316,9 +2309,9 @@ "dev": true }, "source-map-support": { - "version": "0.5.16", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", - "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -2370,9 +2363,9 @@ "dev": true }, "stack-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.1.tgz", - "integrity": "sha512-BvBTnHGm8boe+HiJFqP19ywEsGlfQAKqW78pbfvUuzCbUuxPPUyLrH5dYFY+Xn9IpLY3b5ZmMcl8jAqXB4wddg==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", + "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", "dev": true, "requires": { "escape-string-regexp": "^2.0.0" @@ -2387,23 +2380,40 @@ } }, "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "requires": { + "safe-buffer": "~5.2.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } } }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" } }, "strip-bom": { @@ -2419,45 +2429,16 @@ "dev": true }, "supertap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supertap/-/supertap-1.0.0.tgz", - "integrity": "sha512-HZJ3geIMPgVwKk2VsmO5YHqnnJYl6bV5A9JW2uzqV43WmpgliNEYbuvukfor7URpaqpxuw3CfZ3ONdVbZjCgIA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supertap/-/supertap-2.0.0.tgz", + "integrity": "sha512-jRzcXlCeDYvKoZGA5oRhYyR3jUIYu0enkSxtmAgHRlD7HwrovTpH4bDSi0py9FtuA8si9cW/fKommJHuaoDHJA==", "dev": true, "requires": { - "arrify": "^1.0.1", - "indent-string": "^3.2.0", - "js-yaml": "^3.10.0", - "serialize-error": "^2.1.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, - "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } + "arrify": "^2.0.1", + "indent-string": "^4.0.0", + "js-yaml": "^3.14.0", + "serialize-error": "^7.0.1", + "strip-ansi": "^6.0.0" } }, "supports-color": { @@ -2475,12 +2456,6 @@ "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==", "dev": true }, - "term-size": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.0.tgz", - "integrity": "sha512-a6sumDlzyHVJWb8+YofY4TW112G6p2FCPEAFk+59gIYHv3XHRhm9ltVQ9kli4hNWeQBwSpe8cRN25x0ROunMOw==", - "dev": true - }, "terser": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/terser/-/terser-5.3.1.tgz", @@ -2514,9 +2489,9 @@ } }, "trim-off-newlines": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz", - "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.3.tgz", + "integrity": "sha512-kh6Tu6GbeSNMGfrrZh6Bb/4ZEHV1QlB4xNDBeog8Y9/QwFlKTRyWvY3Fs9tRDAMZliVUwieMgEdIeL/FtqjkJg==", "dev": true }, "type-fest": { @@ -2544,24 +2519,36 @@ } }, "update-notifier": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.0.tgz", - "integrity": "sha512-w3doE1qtI0/ZmgeoDoARmI5fjDoT93IfKgEGqm26dGUOh8oNpaSTsGNdYRN/SjOuo10jcJGwkEL3mroKzktkew==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-5.1.0.tgz", + "integrity": "sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw==", "dev": true, "requires": { - "boxen": "^4.2.0", - "chalk": "^3.0.0", + "boxen": "^5.0.0", + "chalk": "^4.1.0", "configstore": "^5.0.1", "has-yarn": "^2.1.0", "import-lazy": "^2.1.0", "is-ci": "^2.0.0", - "is-installed-globally": "^0.3.1", - "is-npm": "^4.0.0", + "is-installed-globally": "^0.4.0", + "is-npm": "^5.0.0", "is-yarn-global": "^0.3.0", - "latest-version": "^5.0.0", - "pupa": "^2.0.1", + "latest-version": "^5.1.0", + "pupa": "^2.1.1", + "semver": "^7.3.4", "semver-diff": "^3.1.1", "xdg-basedir": "^4.0.0" + }, + "dependencies": { + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } } }, "url-parse-lax": { @@ -2573,6 +2560,12 @@ "prepend-http": "^2.0.0" } }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -2598,12 +2591,6 @@ "integrity": "sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==", "dev": true }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, "widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", @@ -2614,9 +2601,9 @@ } }, "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "requires": { "ansi-styles": "^4.0.0", @@ -2649,41 +2636,37 @@ "dev": true }, "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, - "dependencies": { - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" } + }, + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true } } } diff --git a/src/reader.js b/src/reader.js index f8f73bf..ba4dd73 100644 --- a/src/reader.js +++ b/src/reader.js @@ -1,5 +1,29 @@ -class ArrayBufferReader { +class BaseReader { + constructor() { + /** + * instanceof would be nice here, but when a user use multi version of Reader that may cause problem + * @example + * const { Reader } = require('ckb-js-toolkit'); // ckb-js-toolkit@0.100.1 + * const { readSomething } = require('other-serializer-lib'); // dependent on ckb-js-toolkit@0.100.0 + * + * readSomething() instanceof Reader; // false + * + * @type {boolean} + * @protected + */ + this.__isByteLikeReader__ = true; + } + + static isReader(x) { + if (x == null) return false; + if (x instanceof BaseReader) return true; + return x.__isByteLikeReader__ === true; + } +} + +class ArrayBufferReader extends BaseReader { constructor(buffer) { + super(); this.view = new DataView(buffer); } @@ -27,8 +51,9 @@ class ArrayBufferReader { } } -class HexStringReader { +class HexStringReader extends BaseReader { constructor(string) { + super(); this.string = string; } @@ -55,8 +80,9 @@ class HexStringReader { } } -export class Reader { +export class Reader extends BaseReader { constructor(input) { + super(); if ( input instanceof HexStringReader || input instanceof ArrayBufferReader @@ -64,7 +90,7 @@ export class Reader { return input; } if (typeof input === "string") { - if (!input.startsWith("0x") || input.length % 2 != 0) { + if (!input.startsWith("0x") || input.length % 2 !== 0) { throw new Error( "Hex string must start with 0x, and has even numbered length!" ); @@ -74,9 +100,17 @@ export class Reader { if (input instanceof ArrayBuffer) { return new ArrayBufferReader(input); } + + if (input instanceof Uint8Array) { + return new ArrayBufferReader(Uint8Array.from(input).buffer); + } throw new Error("Reader can only accept hex string or ArrayBuffer!"); } + static from(x) { + return new Reader(x); + } + static fromRawString(string) { const buffer = new ArrayBuffer(string.length); const view = new DataView(buffer); diff --git a/tests/reader.js b/tests/reader.js new file mode 100644 index 0000000..9e7cce0 --- /dev/null +++ b/tests/reader.js @@ -0,0 +1,19 @@ +const test = require("ava"); +const { Reader } = require("../build/ckb-js-toolkit.node"); + +test("reader functions", t => { + const ra = Reader.from("0x12345678"); + const rb = Reader.from(Uint8Array.from([0x12, 0x34, 0x56, 0x78])); + const rc = Reader.from(Buffer.from("12345678", "hex")); + const rd = Reader.from(Uint8Array.from([0x12, 0x34, 0x56, 0x78]).buffer); + + t.is(new DataView(ra.toArrayBuffer()).getUint32(0), 0x12345678); + t.is(new DataView(rb.toArrayBuffer()).getUint32(0), 0x12345678); + t.is(new DataView(rc.toArrayBuffer()).getUint32(0), 0x12345678); + t.is(new DataView(rd.toArrayBuffer()).getUint32(0), 0x12345678); + + t.true(Reader.isReader(ra)); + t.true(Reader.isReader(rb)); + t.true(Reader.isReader(rc)); + t.true(Reader.isReader(rd)); +});