diff --git a/packages/core/lib/ckb-js-toolkit.esm.js b/packages/core/lib/ckb-js-toolkit.esm.js deleted file mode 100644 index 2178aed57..000000000 --- a/packages/core/lib/ckb-js-toolkit.esm.js +++ /dev/null @@ -1 +0,0 @@ -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;nt.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw o}}}}var v=function(r){var o=Math.abs,a=Math.max,u=Math.imul,s=Math.clz32;function _(t,r){var n;if(e(this,_),t>_.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return(n=l.call(this,t)).sign=r,n}i(_,r);var l=h(_);return n(_,[{key:"toDebugString",value:function(){var t,e=["BigInt["],r=p(this);try{for(r.s();!(t=r.n()).done;){var n=t.value;e.push((n?(n>>>0).toString(16):n)+", ")}}catch(t){r.e(t)}finally{r.f()}return e.push("]"),e.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,h=u(f,n),g=u(f,i),d=u(c,n),p=u(c,i),v=a+(65535&h),y=s+o+(v>>>16)+(h>>>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 u=t.__digit(a),s=(i>>>16)-(65535&u)-n;n=1&s>>>16,this.__setDigit(e+a,s<<16|65535&o),n=1&(o=(65535&(i=this.__digit(e+a+1)))-(u>>>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)-(h>>>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 _.__zero();if((0|e)===e)return 0>e?_.__oneDigit(-e,!0):_.__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 _.__fromDouble(e)}if("string"==typeof e){var i=_.__fromString(e);if(null===i)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return i}if("boolean"==typeof e)return!0===e?_.__oneDigit(1,!1):_.__zero();if("object"===t(e)){if(e.constructor===_)return e;var o=_.__toPrimitive(e);return _.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=s(n),o=32*e-i;if(1024>>=12;var h=f-12,g=12<=f?0:u<<20+f,d=20+f;0>>32-h,g=u<>>32-d,d-=32);var p=_.__decideRounding(t,d,l,u);if((1===p||0===p&&1==(1&g))&&0==(g=g+1>>>0)&&0!=++c>>>20&&(c=0,1023<++a))return t.sign?-1/0:1/0;var v=t.sign?-2147483648:0;return a=a+1023<<20,_.__kBitConversionInts[1]=v|a|c,_.__kBitConversionInts[0]=g,_.__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?_.__absoluteSubOne(t).__trim():_.__absoluteAddOne(t,!0)}},{key:"exponentiate",value:function(t,e){if(e.sign)throw new RangeError("Exponent must be positive");if(0===e.length)return _.__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))?_.unaryMinus(t):t;if(1=_.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){var n=1+(r>>>5),i=new _(n,t.sign&&0!=(1&r));i.__initializeDigits();var o=1<<(31&r);return i.__setDigit(n-1,o),i}var a=null,u=t;for(0!=(1&r)&&(a=t),r>>=1;0!==r;r>>=1)u=_.multiply(u,u),0!=(1&r)&&(a=null===a?u:_.multiply(a,u));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 _(r,t.sign!==e.sign);n.__initializeDigits();for(var i=0;i_.__absoluteCompare(t,e))return _.__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:_.unaryMinus(t);r=_.__absoluteDivSmall(t,i,null)}else r=_.__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>_.__absoluteCompare(t,e))return t;var r=e.__unsignedDigit(0);if(1===e.length&&65535>=r){if(1===r)return _.__zero();var n=_.__absoluteModSmall(t,r);return 0===n?_.__zero():_.__oneDigit(n,t.sign)}var i=_.__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?_.__absoluteAdd(t,e,r):0<=_.__absoluteCompare(t,e)?_.__absoluteSub(t,e,r):_.__absoluteSub(e,t,!r)}},{key:"subtract",value:function(t,e){var r=t.sign;return r===e.sign?0<=_.__absoluteCompare(t,e)?_.__absoluteSub(t,e,r):_.__absoluteSub(e,t,!r):_.__absoluteAdd(t,e,r)}},{key:"leftShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?_.__rightShiftByAbsolute(t,e):_.__leftShiftByAbsolute(t,e)}},{key:"signedRightShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?_.__leftShiftByAbsolute(t,e):_.__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>_.__compareToBigInt(t,e)}},{key:"lessThanOrEqual",value:function(t,e){return 0>=_.__compareToBigInt(t,e)}},{key:"greaterThan",value:function(t,e){return 0<_.__compareToBigInt(t,e)}},{key:"greaterThanOrEqual",value:function(t,e){return 0<=_.__compareToBigInt(t,e)}},{key:"equal",value:function(t,e){if(t.sign!==e.sign)return!1;if(t.length!==e.length)return!1;for(var r=0;r=_.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length_.__kMaxLengthBits)throw new RangeError("BigInt too big");return _.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=_.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length>>n)return e}return _.__truncateToNBits(t,e)}},{key:"ADD",value:function(t,e){if(t=_.__toPrimitive(t),e=_.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=_.__toNumeric(t),e=_.__toNumeric(e),_.__isBigInt(t)&&_.__isBigInt(e))return _.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 _.__compare(t,e,0)}},{key:"LE",value:function(t,e){return _.__compare(t,e,1)}},{key:"GT",value:function(t,e){return _.__compare(t,e,2)}},{key:"GE",value:function(t,e){return _.__compare(t,e,3)}},{key:"EQ",value:function(e,r){for(;;){if(_.__isBigInt(e))return _.__isBigInt(r)?_.equal(e,r):_.EQ(r,e);if("number"==typeof e){if(_.__isBigInt(r))return _.__equalToNumber(r,e);if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else if("string"==typeof e){if(_.__isBigInt(r))return null!==(e=_.__fromString(e))&&_.equal(e,r);if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else if("boolean"==typeof e){if(_.__isBigInt(r))return _.__equalToNumber(r,+e);if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else if("symbol"===t(e)){if(_.__isBigInt(r))return!1;if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else{if("object"!==t(e))return e==r;if("object"===t(r)&&r.constructor!==_)return e==r;e=_.__toPrimitive(e)}}}},{key:"NE",value:function(t,e){return!_.EQ(t,e)}},{key:"__zero",value:function(){return new _(0,!1)}},{key:"__oneDigit",value:function(t,e){var r=new _(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 _(n,0>t),o=1048575&_.__kBitConversionInts[1]|1048576,a=_.__kBitConversionInts[0],u=20,s=31&r,l=0;if(s>>f,o=o<<32-f|a>>>f,a<<=32-f}else if(s===u)l=32,e=o,o=a;else{var c=s-u;l=32-c,e=o<>>32-c,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/u)return null;var l=new _(31+(u*a+s>>>_.__kBitsPerCharTableShift)>>>5,!1),f=10>e?e:10,c=10>=_.__kBitsPerCharTableShift;var h=[],g=[],d=!1;do{for(var p,v=0,y=0;;){if(p=void 0,o-48>>>0>>0>>0>>0>>_.__kBitsPerCharTableShift+5;l.__inplaceMultiplyAdd(D,k,P)}while(!b)}if(i!==n){if(!_.__isWhitespace(o))return null;for(i++;i>>s-(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),u=0|(32*r-s(a)+i-1)/i;if(t.sign&&u++,268435456>>v,h=32-v;h>=i;)l[f--]=_.__kConversionChars[c&o],c>>>=i,h-=i}var y=(c|a<>>i-h;0!==c;)l[f--]=_.__kConversionChars[c&o],c>>>=i;if(t.sign&&(l[f--]="-"),-1!==f)throw new Error("implementation bug");return l.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,u=32*n-s(t.__digit(n-1)),l=_.__kMaxBitsPerChar[e]-1,f=u*_.__kBitsPerCharTableMultiplier,c=1+(f=0|(f+=l-1)/l)>>1,h=_.exponentiate(_.__oneDigit(e,!1),_.__oneDigit(c,!1)),g=h.__unsignedDigit(0);if(1===h.length&&65535>=g){(o=new _(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=_.__absoluteDivLarge(t,h,!0,!0);o=y.quotient;var b=y.remainder.__trim();a=_.__toStringGeneric(b,e,!0)}o.__trim();for(var m=_.__toStringGeneric(o,e,!0);a.lengthn?_.__absoluteLess(r):0}},{key:"__compareToNumber",value:function(t,e){if(!0|e){var r=t.sign,n=0>e;if(r!==n)return _.__unequalSign(r);if(0===t.length){if(n)throw new Error("implementation bug");return 0===e?0:-1}if(1i?_.__absoluteGreater(r):ae)return _.__unequalSign(r);if(0===e)throw new Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;_.__kBitConversionDouble[0]=e;var n=2047&_.__kBitConversionInts[1]>>>20;if(2047==n)throw new Error("implementation bug: handled elsewhere");var i=n-1023;if(0>i)return _.__absoluteGreater(r);var o=t.length,a=t.__digit(o-1),u=s(a),l=32*o-u,f=i+1;if(lf)return _.__absoluteGreater(r);var c=1048576|1048575&_.__kBitConversionInts[1],h=_.__kBitConversionInts[0],g=20,d=31-u;if(d!==(l-1)%31)throw new Error("implementation bug");var p,v=0;if(d>>y,c=c<<32-y|h>>>y,h<<=32-y}else if(d===g)v=32,p=c,c=h;else{var b=d-g;v=32-b,p=c<>>32-b,c=h<>>=0)>(p>>>=0))return _.__absoluteGreater(r);if(a>>0,c=h,h=0):p=0;var w=t.__unsignedDigit(m);if(w>p)return _.__absoluteGreater(r);if(we&&t.__unsignedDigit(0)===o(e):0===_.__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(_.__isBigInt(t)&&"string"==typeof e)return null!==(e=_.__fromString(e))&&_.__comparisonResultToBool(_.__compareToBigInt(t,e),r);if("string"==typeof t&&_.__isBigInt(e))return null!==(t=_.__fromString(t))&&_.__comparisonResultToBool(_.__compareToBigInt(t,e),r);if(t=_.__toNumeric(t),e=_.__toNumeric(e),_.__isBigInt(t)){if(_.__isBigInt(e))return _.__comparisonResultToBool(_.__compareToBigInt(t,e),r);if("number"!=typeof e)throw new Error("implementation bug");return _.__comparisonResultToBool(_.__compareToNumber(t,e),r)}if("number"!=typeof t)throw new Error("implementation bug");if(_.__isBigInt(e))return _.__comparisonResultToBool(_.__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)+(u>>>16)+(l>>>16);o=f>>>16,i.__setDigit(a,65535&l|f<<16)}for(;a>>16)+(h>>>16);o=g>>>16,i.__setDigit(a,65535&h|g<<16)}return a>>16)-(u>>>16)-(i=1&s>>>16);i=1&l>>>16,n.__setDigit(o,65535&s|l<<16)}for(;o>>16)-(i=1&c>>>16);i=1&h>>>16,n.__setDigit(o,65535&c|h<<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=(h+=_+a+((c+=s+(65535&v))>>>16)+(v>>>16)+(65535&y)+(65535&b))>>>16))>>>16,s&=65535,_=m>>>16,f=65535&c|h<<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 c=u(_>>>16,e),h=(65535&c)+(l>>>16)+o;o=h>>>16,a=c>>>16,i.__setDigit(s,h<<16|65535&f)}if(i.length>n)for(i.__setDigit(n++,o+a);n>>0,a=0|o/e,u=0|(o=((n=0|o%e)<<16|t.__halfDigit(i-1))>>>0)/e;n=0|o%e,r.__setDigit(i>>>1,a<<16|u)}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 _(a+2>>>1,!1)).__initializeDigits();var l=new _(i+2>>>1,!1);l.__initializeDigits();var f=_.__clz16(e.__halfDigit(i-1));0>>0;p=0|y/h;for(var b=0|y%h,m=e.__halfDigit(i-2),w=c.__halfDigit(d+i-2);u(p,m)>>>0>(b<<16|w)>>>0&&(p--,!(65535<(b+=h))););}_.__internalMultiplyAdd(e,p,0,o,l);var k=c.__inplaceSub(l,d,i+1);0!==k&&(k=c.__inplaceAdd(e,d,i),c.__setHalfDigit(d+i,c.__halfDigit(d+i)+k),p--),r&&(1&d?g=p<<16:s.__setDigit(d>>>1,g|p))}return n?(c.__inplaceRightShift(f),r?{quotient:s,remainder:c}:c):r?s:void 0}},{key:"__clz16",value:function(t){return s(t)-16}},{key:"__specialLeftShift",value:function(t,e,r){var n=t.length,i=new _(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,u=o+n+(a?1:0),s=new _(u,t.sign);if(0===i){for(var l=0;l>>32-i;if(a)s.__setDigit(o+n,f);else if(0!==f)throw new Error("implementation bug")}return s.__trim()}},{key:"__rightShiftByAbsolute",value:function(t,e){var r=t.length,n=t.sign,i=_.__toShiftAmount(e);if(0>i)return _.__rightShiftByMaximum(n);var o=i>>>5,a=31&i,u=r-o;if(0>=u)return _.__rightShiftByMaximum(n);var s=!1;if(n)if(0!=(t.__digit(o)&(1<>>a,d=r-o-1,p=0;p>>a;f.__setDigit(d,g)}return s&&(f=_.__absoluteAddOne(f,!0,f)),f.__trim()}},{key:"__rightShiftByMaximum",value:function(t){return t?_.__oneDigit(1,!0):_.__zero()}},{key:"__toShiftAmount",value:function(t){if(1_.__kMaxLengthBits?-1:e}},{key:"__toPrimitive",value:function(e){var r=1>>5,n=new _(r,e.sign),i=r-1,o=0;o>>u}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 _(i,r),a=0,u=i-1,s=0,l=n(u,e.length);a>>16)-(s=1&c>>>16);s=1&h>>>16,o.__setDigit(a,65535&c|h<<16)}for(;a>>16)-(s=1&v>>>16)<<16}else{var y=32-p,b=1<<32-y,m=(65535&b)-(65535&(d=d<>>y))-s;g=65535&m|(b>>>16)-(d>>>16)-(s=1&m>>>16)<<16,g&=b-1}return o.__setDigit(u,g),o.__trim()}},{key:"__digitPow",value:function(t,e){for(var r=1;0>>=1,t*=t;return r}}]),_}(l(Array));return v.__kMaxLength=33554432,v.__kMaxLengthBits=v.__kMaxLength<<5,v.__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],v.__kBitsPerCharTableShift=5,v.__kBitsPerCharTableMultiplier=1<a)throw new Error(u);let s=i.filter((t=>!r.includes(t)));if(i.length-s.length!==o)throw new Error(u);if(s.find((t=>!n.includes(t))))throw new Error(u)}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 s(t,e){if(u(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"],[]),s(`${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 f(t,{nestedValidation:e=!0,debugPath:r="out_point"}={}){a(r,t,["tx_hash","index"],[]),s(`${r}.tx_hash`,t.tx_hash),_(`${r}.index`,t.index)}function c(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 h(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 u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(t){return t&&u.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 c(t){this.map={},t instanceof c?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 h(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)||s(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=h(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?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var t,e,r,n=h(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 c(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 c(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 u=new XMLHttpRequest;function s(){u.abort()}u.onload=function(){var t,e,r={status:u.status,statusText:u.statusText,headers:(t=u.getAllResponseHeaders()||"",e=new c,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 u?u.responseURL:r.headers.get("X-Request-URL");var i="response"in u?u.response:u.responseText;n(new w(i,r))},u.onerror=function(){o(new TypeError("Network request failed"))},u.ontimeout=function(){o(new TypeError("Network request failed"))},u.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},u.open(a.method,a.url,!0),"include"===a.credentials?u.withCredentials=!0:"omit"===a.credentials&&(u.withCredentials=!1),"responseType"in u&&i&&(u.responseType="blob"),a.headers.forEach((function(t,e){u.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",s),u.onreadystatechange=function(){4===u.readyState&&a.signal.removeEventListener("abort",s)}),u.send(void 0===a._bodyInit?null:a._bodyInit)}))}D.polyfill=!0,t.fetch||(t.fetch=D,t.Headers=c,t.Request=b,t.Response=w),e.Headers=c,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 x={get:(t,e,r)=>"send"===e?async()=>{const e=await S(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}},$={get:(t,e)=>"batch"===e?()=>new Proxy({id:Math.round(1e7*Math.random()),payload:[],uri:t.uri,defaultOptions:t.defaultOptions},x):async(...r)=>{const n=Math.round(1e7*Math.random()),i=await S(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 C{constructor(t,e={}){return this.uri=t,this.defaultOptions=e,new Proxy(this,$)}static create(t){return new C(t)}}function I(t){return o.BigInt(t)}function j(t){return"0x"+t.toString(16)}function R(t){return function(e,r){if(!(r instanceof ArrayBuffer)){let n=j(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 M(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 N(t,{debugPath:e="script"}={}){return M(e,t,{code_hash:z(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:z(-1)})}function L(t,{debugPath:e="out_point"}={}){return M(e,t,{tx_hash:z(32),index:R(4)})}function U(t){return function(e,r){return t(r,{debugPath:e})}}function q(t,{debugPath:e="cell_input"}={}){return M(e,t,{since:R(8),previous_output:U(L)})}function V(t,{debugPath:e="cell_output"}={}){const r=M(e,t,{capacity:R(8),lock:U(N)});return t.type&&(r.type_=N(t.type,{debugPath:`${e}.type`})),r}function F(t,{debugPath:e="cell_dep"}={}){return M(e,t,{out_point:U(L),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 M(e,t,{version:R(4),cell_deps:G(U(F)),header_deps:G(z(32)),inputs:G(U(q)),outputs:G(U(V)),outputs_data:G(z(-1))})}function W(t,{debugPath:e="transaction"}={}){const r=H(t,{debugPath:`(raw)${e}`}),n=M(e,t,{witnesses:G(z(-1))});return n.raw=r,n}function J(t,{debugPath:e="raw_header"}={}){return M(e,t,{version:R(4),compact_target:R(4),timestamp:R(8),number:R(8),epoch:R(8),parent_hash:z(32),transactions_root:z(32),proposals_hash:z(32),uncles_hash:z(32),dao:z(32)})}function X(t,{debugPath:e="header"}={}){const r=J(t,{debugPath:`(raw)${e}`}),n=M(e,t,{nonce:R(16)});return n.raw=r,n}function Q(t,{debugPath:e="uncle_block"}={}){return M(e,t,{header:U(X),proposals:G(z(10))})}var K=Object.freeze({__proto__:null,NormalizeScript:N,NormalizeOutPoint:L,NormalizeCellInput:q,NormalizeCellOutput:V,NormalizeCellDep:F,NormalizeRawTransaction:H,NormalizeTransaction:W,NormalizeRawHeader:J,NormalizeHeader:X,NormalizeUncleBlock:Q,NormalizeBlock:function(t,{debugPath:e="block"}={}){return M(e,t,{header:U(X),uncles:G(U(Q)),transactions:G(U(W)),proposals:G(z(10))})},NormalizeCellbaseWitness:function(t,{debugPath:e="cellbase_witness"}={}){return M(e,t,{lock:U(N),message:z(-1)})},NormalizeWitnessArgs:function(t,{debugPath:e="witness_args"}={}){const r={};return t.lock&&(r.lock=z(-1)(`${e}.lock`,t.lock)),t.input_type&&(r.input_type=z(-1)(`${e}.input_type`,t.input_type)),t.output_type&&(r.output_type=z(-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&&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&&h(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 ut(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&&b(t,{debugPath:`(transformed) ${r}`}),t}function st(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(st),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&&y(t,{debugPath:`(transformed) ${r}`}),t},TransformTransaction:ut,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:st,TransformUncleBlock:_t,TransformBlock:function(t,{validation:e=!0,debugPath:r="block"}={}){return t=Z(r,t,{header:rt(st),uncles:at(rt(_t)),transactions:at(rt(ut)),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=I(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,j(e),j(r));for(const t of n){if(this.skipCellWithContent&&(t.type||o.greaterThan(I(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 ct="0.10.2";export{j as BigIntToHexString,I as HexStringToBigInt,C as RPC,r as Reader,E as TransactionDumper,ct as VERSION,ft as cell_collectors,K as normalizers,lt as transformers,T as validators}; diff --git a/packages/core/lib/ckb-js-toolkit.node.js b/packages/core/lib/ckb-js-toolkit.node.js deleted file mode 100644 index 19618e699..000000000 --- a/packages/core/lib/ckb-js-toolkit.node.js +++ /dev/null @@ -1,2 +0,0 @@ -"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: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()}),{[L]: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,$t=R(Object.freeze({__proto__:null,default:Pt,Headers:ot,Request:yt,Response:ht,FetchError:U})),kt=(Dt=function(t,e){var r=$t.default||$t,n=function(t,e){return/^\/\//.test(t)&&(t="https:"+t),r.call(this,t,e)};t.exports=e=n,e.fetch=n,e.Headers=$t.Headers,e.Request=$t.Request,e.Response=$t.Response,e.default=n},Dt(Tt={path:St,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&Tt.path)}},Tt.exports),Tt.exports);function xt(t,e){e=e||{};const r=Object.assign({},e.headers||{},t.headers||{});return Object.assign({},e,t,{headers:r})}const Ot={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},Ot):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 Ct{constructor(t,e={}){return this.uri=t,this.defaultOptions=e,new Proxy(this,Et)}static create(t){return new Ct(t)}}function At(t){return g.BigInt(t)}function jt(t){return"0x"+t.toString(16)}function zt(t){return function(e,r){if(!(r instanceof ArrayBuffer)){let n=jt(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 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 Mt(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 Lt(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 qt(t,{debugPath:e="cell_input"}={}){return Rt(e,t,{since:zt(8),previous_output:Nt(Lt)})}function Ut(t,{debugPath:e="cell_output"}={}){const r=Rt(e,t,{capacity:zt(8),lock:Nt(Mt)});return t.type&&(r.type_=Mt(t.type,{debugPath:`${e}.type`})),r}function Vt(t,{debugPath:e="cell_dep"}={}){return Rt(e,t,{out_point:Nt(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 Ht(t){return function(e,r){return r.map(((r,n)=>t(`${e}[${n}]`,r)))}}function Ft(t,{debugPath:e="raw_transaction"}={}){return Rt(e,t,{version:zt(4),cell_deps:Ht(Nt(Vt)),header_deps:Ht(It(32)),inputs:Ht(Nt(qt)),outputs:Ht(Nt(Ut)),outputs_data:Ht(It(-1))})}function Gt(t,{debugPath:e="transaction"}={}){const r=Ft(t,{debugPath:`(raw)${e}`}),n=Rt(e,t,{witnesses:Ht(It(-1))});return n.raw=r,n}function Wt(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 Jt(t,{debugPath:e="header"}={}){const r=Wt(t,{debugPath:`(raw)${e}`}),n=Rt(e,t,{nonce:zt(16)});return n.raw=r,n}function Xt(t,{debugPath:e="uncle_block"}={}){return Rt(e,t,{header:Nt(Jt),proposals:Ht(It(10))})}var Qt=Object.freeze({__proto__:null,NormalizeScript:Mt,NormalizeOutPoint:Lt,NormalizeCellInput:qt,NormalizeCellOutput:Ut,NormalizeCellDep:Vt,NormalizeRawTransaction:Ft,NormalizeTransaction:Gt,NormalizeRawHeader:Wt,NormalizeHeader:Jt,NormalizeUncleBlock:Xt,NormalizeBlock:function(t,{debugPath:e="block"}={}){return Rt(e,t,{header:Nt(Jt),uncles:Ht(Nt(Xt)),transactions:Ht(Nt(Gt)),proposals:Ht(It(10))})},NormalizeCellbaseWitness:function(t,{debugPath:e="cellbase_witness"}={}){return Rt(e,t,{lock:Nt(Mt),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 Zt(t,e){return e instanceof Object&&e.serializeJson instanceof Function?e.serializeJson.call(e):e}function Kt(t,e,r){if(!((e=Zt(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 Yt(t,{validation:e=!0,debugPath:r="script"}={}){return t=Kt(r,t,{code_hash:Zt,hash_type:Zt,args:Zt}),e&&y(t,{debugPath:`(transformed) ${r}`}),t}function te(t,{validation:e=!0,debugPath:r="out_point"}={}){return t=Kt(r,t,{tx_hash:Zt,index:Zt}),e&&w(t,{debugPath:`(transformed) ${r}`}),t}function ee(t){return function(e,r){return t(r,{validation:!1,debugPath:e})}}function re(t,{validation:e=!0,debugPath:r="cell_input"}={}){return t=Kt(r,t,{since:Zt,previous_output:ee(te)}),e&&v(t,{debugPath:`(transformed) ${r}`}),t}function ne(t,{validation:e=!0,debugPath:r="cell_output"}={}){return t=Kt(r,t,{capacity:Zt,lock:ee(Yt),type:ee(Yt)}),e&&B(t,{debugPath:`(transformed) ${r}`}),t}function ie(t,{validation:e=!0,debugPath:r="cell_dep"}={}){return t=Kt(r,t,{out_point:ee(te),dep_type:Zt}),e&&P(t,{debugPath:`(transformed) ${r}`}),t}function oe(t){return function(e,r){return r.map(((r,n)=>t(`${e}[${n}]`,r)))}}function se(t,{validation:e=!0,debugPath:r="transaction"}={}){return t=Kt(r,t,{version:Zt,cell_deps:oe(ee(ie)),header_deps:oe(Zt),inputs:oe(ee(re)),outputs:oe(ee(ne)),outputs_data:oe(Zt),witnesses:oe(Zt)}),e&&k(t,{debugPath:`(transformed) ${r}`}),t}function ae(t,{validation:e=!0,debugPath:r="header"}={}){return t=Kt(r,t,{version:Zt,compact_target:Zt,timestamp:Zt,number:Zt,epoch:Zt,parent_hash:Zt,transactions_root:Zt,proposals_hash:Zt,uncles_hash:Zt,dao:Zt,nonce:Zt}),e&&O(t,{debugPath:`(transformed) ${r}`}),t}function ue(t,{validation:e=!0,debugPath:r="uncle_block"}={}){return t=Kt(r,t,{header:ee(ae),proposals:oe(Zt)}),e&&C(t,{debugPath:`(transformed) ${r}`}),t}var le=Object.freeze({__proto__:null,TransformScript:Yt,TransformOutPoint:te,TransformCellInput:re,TransformCellOutput:ne,TransformCellDep:ie,TransformRawTransaction:function(t,{validation:e=!0,debugPath:r="raw_transaction"}={}){return t=Kt(r,t,{version:Zt,cell_deps:oe(ee(ie)),header_deps:oe(Zt),inputs:oe(ee(re)),outputs:oe(ee(ne)),outputs_data:oe(Zt)}),e&&$(t,{debugPath:`(transformed) ${r}`}),t},TransformTransaction:se,TransformRawHeader:function(t,{validation:e=!0,debugPath:r="raw_header"}={}){return t=Kt(r,t,{version:Zt,compact_target:Zt,timestamp:Zt,number:Zt,epoch:Zt,parent_hash:Zt,transactions_root:Zt,proposals_hash:Zt,uncles_hash:Zt,dao:Zt}),e&&x(t,{debugPath:`(transformed) ${r}`}),t},TransformHeader:ae,TransformUncleBlock:ue,TransformBlock:function(t,{validation:e=!0,debugPath:r="block"}={}){return t=Kt(r,t,{header:ee(ae),uncles:oe(ee(ue)),transactions:oe(ee(se)),proposals:oe(Zt)}),e&&A(t,{debugPath:`(transformed) ${r}`}),t},TransformCellbaseWitness:function(t,{validation:e=!0,debugPath:r="cellbase_witness"}={}){return t=Kt(r,t,{lock:ee(Yt),message:Zt}),e&&j(t,{debugPath:`(transformed) ${r}`}),t},TransformWitnessArgs:function(t,{validation:e=!0,debugPath:r="witness_args"}={}){return t=Kt(r,t,{lock:Zt,input_type:Zt,output_type:Zt}),e&&z(t,{debugPath:`(transformed) ${r}`}),t}});var ce=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=At(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,jt(e),jt(r));for(const t of n){if(this.skipCellWithContent&&(t.type||g.greaterThan(At(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=jt,exports.HexStringToBigInt=At,exports.RPC=Ct,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&&k(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=ce,exports.normalizers=Qt,exports.transformers=le,exports.validators=I; -//# sourceMappingURL=ckb-js-toolkit.node.js.map diff --git a/packages/core/lib/ckb-js-toolkit.node.js.map b/packages/core/lib/ckb-js-toolkit.node.js.map deleted file mode 100644 index 65f13e91b..000000000 --- a/packages/core/lib/ckb-js-toolkit.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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","constructor","buffer","this","view","DataView","length","byteLength","indexAt","i","getUint8","toArrayBuffer","serializeJson","Array","prototype","map","call","Uint8Array","x","toString","slice","join","HexStringReader","string","parseInt","substr","ArrayBuffer","setUint8","Reader","input","startsWith","Error","static","c","charCodeAt","JSBI","a","b","__kMaxLength","RangeError","super","sign","Math","floor","Number","isFinite","__zero","__oneDigit","__fromDouble","__fromString","SyntaxError","__toPrimitive","BigInt","TypeError","toDebugString","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","text","Promise","resolve","arrayBuffer","buf","ab","stream","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","accum","accumBytes","abort","resTimeout","setTimeout","chunk","clearTimeout","obj","append","delete","get","getAll","has","set","clone","instance","p1","p2","bodyUsed","getBoundary","pipe","extractContentType","getTotalBytes","getLengthSync","_lengthRetrievers","hasKnownLength","then","ct","headers","assign","json","_this2","JSON","parse","textConverted","_this3","res","str","charset","exec","convertBody","mixIn","proto","getOwnPropertyNames","desc","getOwnPropertyDescriptor","global","invalidTokenRegex","invalidHeaderCharRegex","validateName","validateValue","MAP","Headers","init","rawHeaders","raw","headerNames","headerName","method","iterator","pairs","pair","forEach","callback","thisArg","getHeaders","_pairs$i","createHeadersIterator","values","kind","entries","INTERNAL","target","HeadersIteratorPrototype","setPrototypeOf","next","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","stringify","payload","params","id","jsonrpc","handler","Proxy","round","random","data","result","RPC","HexStringToBigInt","hexString","BigIntToHexString","bigInt","normalizeHexNumber","intValue","normalizeRawData","normalizeObject","NormalizeScript","NormalizeOutPoint","toNormalize","normalize","NormalizeCellInput","NormalizeCellOutput","type_","NormalizeCellDep","toNormalizeArray","normalizeFunction","item","NormalizeRawTransaction","NormalizeTransaction","NormalizeRawHeader","NormalizeHeader","NormalizeUncleBlock","invokeSerializeJson","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,GAG3BI,SACE,OAAOH,KAAKC,KAAKG,WAGnBC,QAAQC,GACN,OAAON,KAAKC,KAAKM,SAASD,GAG5BE,gBACE,OAAOR,KAAKC,KAAKF,OAGnBU,gBACE,MACE,KACAC,MAAMC,UAAUC,IACbC,KAAK,IAAIC,WAAWd,KAAKC,KAAKF,SAASgB,IACrC,KAAOA,EAAEC,SAAS,KAAKC,OAAO,KAEhCC,KAAK,KAKd,MAAMC,EACJrB,YAAYsB,GACVpB,KAAKoB,OAASA,EAGhBjB,SACE,OAAOH,KAAKoB,OAAOjB,OAA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AS8Y,EAAGpX,QAAQ1M,OACtB,MAAM,IAAIyB,MACR,eAAeoK,EAAUd,gCAAgCC,MAG7D,MAAM2T,EAAO,CACXuF,OAAQJ,EAAGpX,QAAQ1B,GACnB2T,KAAMmF,EAAGnX,aAAa3B,IAKxB,MAHkC,cAA9B0Z,EAASE,UAAU5L,SACrB2F,EAAK9Q,OAAS6W,EAASE,UAAUpB,YAE5B7E,oBC5FY"} \ No newline at end of file diff --git a/packages/core/lib/ckb-js-toolkit.umd.js b/packages/core/lib/ckb-js-toolkit.umd.js deleted file mode 100644 index cc6338a8a..000000000 --- a/packages/core/lib/ckb-js-toolkit.umd.js +++ /dev/null @@ -1 +0,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(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;nt.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw o}}}}var v=function(r){var o=Math.abs,a=Math.max,u=Math.imul,s=Math.clz32;function _(t,r){var n;if(e(this,_),t>_.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return(n=l.call(this,t)).sign=r,n}i(_,r);var l=h(_);return n(_,[{key:"toDebugString",value:function(){var t,e=["BigInt["],r=p(this);try{for(r.s();!(t=r.n()).done;){var n=t.value;e.push((n?(n>>>0).toString(16):n)+", ")}}catch(t){r.e(t)}finally{r.f()}return e.push("]"),e.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,h=u(f,n),g=u(f,i),d=u(c,n),p=u(c,i),v=a+(65535&h),y=s+o+(v>>>16)+(h>>>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 u=t.__digit(a),s=(i>>>16)-(65535&u)-n;n=1&s>>>16,this.__setDigit(e+a,s<<16|65535&o),n=1&(o=(65535&(i=this.__digit(e+a+1)))-(u>>>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)-(h>>>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 _.__zero();if((0|e)===e)return 0>e?_.__oneDigit(-e,!0):_.__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 _.__fromDouble(e)}if("string"==typeof e){var i=_.__fromString(e);if(null===i)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return i}if("boolean"==typeof e)return!0===e?_.__oneDigit(1,!1):_.__zero();if("object"===t(e)){if(e.constructor===_)return e;var o=_.__toPrimitive(e);return _.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=s(n),o=32*e-i;if(1024>>=12;var h=f-12,g=12<=f?0:u<<20+f,d=20+f;0>>32-h,g=u<>>32-d,d-=32);var p=_.__decideRounding(t,d,l,u);if((1===p||0===p&&1==(1&g))&&0==(g=g+1>>>0)&&0!=++c>>>20&&(c=0,1023<++a))return t.sign?-1/0:1/0;var v=t.sign?-2147483648:0;return a=a+1023<<20,_.__kBitConversionInts[1]=v|a|c,_.__kBitConversionInts[0]=g,_.__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?_.__absoluteSubOne(t).__trim():_.__absoluteAddOne(t,!0)}},{key:"exponentiate",value:function(t,e){if(e.sign)throw new RangeError("Exponent must be positive");if(0===e.length)return _.__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))?_.unaryMinus(t):t;if(1=_.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){var n=1+(r>>>5),i=new _(n,t.sign&&0!=(1&r));i.__initializeDigits();var o=1<<(31&r);return i.__setDigit(n-1,o),i}var a=null,u=t;for(0!=(1&r)&&(a=t),r>>=1;0!==r;r>>=1)u=_.multiply(u,u),0!=(1&r)&&(a=null===a?u:_.multiply(a,u));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 _(r,t.sign!==e.sign);n.__initializeDigits();for(var i=0;i_.__absoluteCompare(t,e))return _.__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:_.unaryMinus(t);r=_.__absoluteDivSmall(t,i,null)}else r=_.__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>_.__absoluteCompare(t,e))return t;var r=e.__unsignedDigit(0);if(1===e.length&&65535>=r){if(1===r)return _.__zero();var n=_.__absoluteModSmall(t,r);return 0===n?_.__zero():_.__oneDigit(n,t.sign)}var i=_.__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?_.__absoluteAdd(t,e,r):0<=_.__absoluteCompare(t,e)?_.__absoluteSub(t,e,r):_.__absoluteSub(e,t,!r)}},{key:"subtract",value:function(t,e){var r=t.sign;return r===e.sign?0<=_.__absoluteCompare(t,e)?_.__absoluteSub(t,e,r):_.__absoluteSub(e,t,!r):_.__absoluteAdd(t,e,r)}},{key:"leftShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?_.__rightShiftByAbsolute(t,e):_.__leftShiftByAbsolute(t,e)}},{key:"signedRightShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?_.__leftShiftByAbsolute(t,e):_.__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>_.__compareToBigInt(t,e)}},{key:"lessThanOrEqual",value:function(t,e){return 0>=_.__compareToBigInt(t,e)}},{key:"greaterThan",value:function(t,e){return 0<_.__compareToBigInt(t,e)}},{key:"greaterThanOrEqual",value:function(t,e){return 0<=_.__compareToBigInt(t,e)}},{key:"equal",value:function(t,e){if(t.sign!==e.sign)return!1;if(t.length!==e.length)return!1;for(var r=0;r=_.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length_.__kMaxLengthBits)throw new RangeError("BigInt too big");return _.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=_.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length>>n)return e}return _.__truncateToNBits(t,e)}},{key:"ADD",value:function(t,e){if(t=_.__toPrimitive(t),e=_.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=_.__toNumeric(t),e=_.__toNumeric(e),_.__isBigInt(t)&&_.__isBigInt(e))return _.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 _.__compare(t,e,0)}},{key:"LE",value:function(t,e){return _.__compare(t,e,1)}},{key:"GT",value:function(t,e){return _.__compare(t,e,2)}},{key:"GE",value:function(t,e){return _.__compare(t,e,3)}},{key:"EQ",value:function(e,r){for(;;){if(_.__isBigInt(e))return _.__isBigInt(r)?_.equal(e,r):_.EQ(r,e);if("number"==typeof e){if(_.__isBigInt(r))return _.__equalToNumber(r,e);if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else if("string"==typeof e){if(_.__isBigInt(r))return null!==(e=_.__fromString(e))&&_.equal(e,r);if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else if("boolean"==typeof e){if(_.__isBigInt(r))return _.__equalToNumber(r,+e);if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else if("symbol"===t(e)){if(_.__isBigInt(r))return!1;if("object"!==t(r))return e==r;r=_.__toPrimitive(r)}else{if("object"!==t(e))return e==r;if("object"===t(r)&&r.constructor!==_)return e==r;e=_.__toPrimitive(e)}}}},{key:"NE",value:function(t,e){return!_.EQ(t,e)}},{key:"__zero",value:function(){return new _(0,!1)}},{key:"__oneDigit",value:function(t,e){var r=new _(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 _(n,0>t),o=1048575&_.__kBitConversionInts[1]|1048576,a=_.__kBitConversionInts[0],u=20,s=31&r,l=0;if(s>>f,o=o<<32-f|a>>>f,a<<=32-f}else if(s===u)l=32,e=o,o=a;else{var c=s-u;l=32-c,e=o<>>32-c,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/u)return null;var l=new _(31+(u*a+s>>>_.__kBitsPerCharTableShift)>>>5,!1),f=10>e?e:10,c=10>=_.__kBitsPerCharTableShift;var h=[],g=[],d=!1;do{for(var p,v=0,y=0;;){if(p=void 0,o-48>>>0>>0>>0>>0>>_.__kBitsPerCharTableShift+5;l.__inplaceMultiplyAdd(D,k,P)}while(!b)}if(i!==n){if(!_.__isWhitespace(o))return null;for(i++;i>>s-(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),u=0|(32*r-s(a)+i-1)/i;if(t.sign&&u++,268435456>>v,h=32-v;h>=i;)l[f--]=_.__kConversionChars[c&o],c>>>=i,h-=i}var y=(c|a<>>i-h;0!==c;)l[f--]=_.__kConversionChars[c&o],c>>>=i;if(t.sign&&(l[f--]="-"),-1!==f)throw new Error("implementation bug");return l.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,u=32*n-s(t.__digit(n-1)),l=_.__kMaxBitsPerChar[e]-1,f=u*_.__kBitsPerCharTableMultiplier,c=1+(f=0|(f+=l-1)/l)>>1,h=_.exponentiate(_.__oneDigit(e,!1),_.__oneDigit(c,!1)),g=h.__unsignedDigit(0);if(1===h.length&&65535>=g){(o=new _(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=_.__absoluteDivLarge(t,h,!0,!0);o=y.quotient;var b=y.remainder.__trim();a=_.__toStringGeneric(b,e,!0)}o.__trim();for(var m=_.__toStringGeneric(o,e,!0);a.lengthn?_.__absoluteLess(r):0}},{key:"__compareToNumber",value:function(t,e){if(!0|e){var r=t.sign,n=0>e;if(r!==n)return _.__unequalSign(r);if(0===t.length){if(n)throw new Error("implementation bug");return 0===e?0:-1}if(1i?_.__absoluteGreater(r):ae)return _.__unequalSign(r);if(0===e)throw new Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;_.__kBitConversionDouble[0]=e;var n=2047&_.__kBitConversionInts[1]>>>20;if(2047==n)throw new Error("implementation bug: handled elsewhere");var i=n-1023;if(0>i)return _.__absoluteGreater(r);var o=t.length,a=t.__digit(o-1),u=s(a),l=32*o-u,f=i+1;if(lf)return _.__absoluteGreater(r);var c=1048576|1048575&_.__kBitConversionInts[1],h=_.__kBitConversionInts[0],g=20,d=31-u;if(d!==(l-1)%31)throw new Error("implementation bug");var p,v=0;if(d>>y,c=c<<32-y|h>>>y,h<<=32-y}else if(d===g)v=32,p=c,c=h;else{var b=d-g;v=32-b,p=c<>>32-b,c=h<>>=0)>(p>>>=0))return _.__absoluteGreater(r);if(a>>0,c=h,h=0):p=0;var w=t.__unsignedDigit(m);if(w>p)return _.__absoluteGreater(r);if(we&&t.__unsignedDigit(0)===o(e):0===_.__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(_.__isBigInt(t)&&"string"==typeof e)return null!==(e=_.__fromString(e))&&_.__comparisonResultToBool(_.__compareToBigInt(t,e),r);if("string"==typeof t&&_.__isBigInt(e))return null!==(t=_.__fromString(t))&&_.__comparisonResultToBool(_.__compareToBigInt(t,e),r);if(t=_.__toNumeric(t),e=_.__toNumeric(e),_.__isBigInt(t)){if(_.__isBigInt(e))return _.__comparisonResultToBool(_.__compareToBigInt(t,e),r);if("number"!=typeof e)throw new Error("implementation bug");return _.__comparisonResultToBool(_.__compareToNumber(t,e),r)}if("number"!=typeof t)throw new Error("implementation bug");if(_.__isBigInt(e))return _.__comparisonResultToBool(_.__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)+(u>>>16)+(l>>>16);o=f>>>16,i.__setDigit(a,65535&l|f<<16)}for(;a>>16)+(h>>>16);o=g>>>16,i.__setDigit(a,65535&h|g<<16)}return a>>16)-(u>>>16)-(i=1&s>>>16);i=1&l>>>16,n.__setDigit(o,65535&s|l<<16)}for(;o>>16)-(i=1&c>>>16);i=1&h>>>16,n.__setDigit(o,65535&c|h<<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=(h+=_+a+((c+=s+(65535&v))>>>16)+(v>>>16)+(65535&y)+(65535&b))>>>16))>>>16,s&=65535,_=m>>>16,f=65535&c|h<<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 c=u(_>>>16,e),h=(65535&c)+(l>>>16)+o;o=h>>>16,a=c>>>16,i.__setDigit(s,h<<16|65535&f)}if(i.length>n)for(i.__setDigit(n++,o+a);n>>0,a=0|o/e,u=0|(o=((n=0|o%e)<<16|t.__halfDigit(i-1))>>>0)/e;n=0|o%e,r.__setDigit(i>>>1,a<<16|u)}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 _(a+2>>>1,!1)).__initializeDigits();var l=new _(i+2>>>1,!1);l.__initializeDigits();var f=_.__clz16(e.__halfDigit(i-1));0>>0;p=0|y/h;for(var b=0|y%h,m=e.__halfDigit(i-2),w=c.__halfDigit(d+i-2);u(p,m)>>>0>(b<<16|w)>>>0&&(p--,!(65535<(b+=h))););}_.__internalMultiplyAdd(e,p,0,o,l);var k=c.__inplaceSub(l,d,i+1);0!==k&&(k=c.__inplaceAdd(e,d,i),c.__setHalfDigit(d+i,c.__halfDigit(d+i)+k),p--),r&&(1&d?g=p<<16:s.__setDigit(d>>>1,g|p))}return n?(c.__inplaceRightShift(f),r?{quotient:s,remainder:c}:c):r?s:void 0}},{key:"__clz16",value:function(t){return s(t)-16}},{key:"__specialLeftShift",value:function(t,e,r){var n=t.length,i=new _(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,u=o+n+(a?1:0),s=new _(u,t.sign);if(0===i){for(var l=0;l>>32-i;if(a)s.__setDigit(o+n,f);else if(0!==f)throw new Error("implementation bug")}return s.__trim()}},{key:"__rightShiftByAbsolute",value:function(t,e){var r=t.length,n=t.sign,i=_.__toShiftAmount(e);if(0>i)return _.__rightShiftByMaximum(n);var o=i>>>5,a=31&i,u=r-o;if(0>=u)return _.__rightShiftByMaximum(n);var s=!1;if(n)if(0!=(t.__digit(o)&(1<>>a,d=r-o-1,p=0;p>>a;f.__setDigit(d,g)}return s&&(f=_.__absoluteAddOne(f,!0,f)),f.__trim()}},{key:"__rightShiftByMaximum",value:function(t){return t?_.__oneDigit(1,!0):_.__zero()}},{key:"__toShiftAmount",value:function(t){if(1_.__kMaxLengthBits?-1:e}},{key:"__toPrimitive",value:function(e){var r=1>>5,n=new _(r,e.sign),i=r-1,o=0;o>>u}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 _(i,r),a=0,u=i-1,s=0,l=n(u,e.length);a>>16)-(s=1&c>>>16);s=1&h>>>16,o.__setDigit(a,65535&c|h<<16)}for(;a>>16)-(s=1&v>>>16)<<16}else{var y=32-p,b=1<<32-y,m=(65535&b)-(65535&(d=d<>>y))-s;g=65535&m|(b>>>16)-(d>>>16)-(s=1&m>>>16)<<16,g&=b-1}return o.__setDigit(u,g),o.__trim()}},{key:"__digitPow",value:function(t,e){for(var r=1;0>>=1,t*=t;return r}}]),_}(l(Array));return v.__kMaxLength=33554432,v.__kMaxLengthBits=v.__kMaxLength<<5,v.__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],v.__kBitsPerCharTableShift=5,v.__kBitsPerCharTableMultiplier=1<a)throw new Error(u);let s=i.filter((t=>!r.includes(t)));if(i.length-s.length!==o)throw new Error(u);if(s.find((t=>!n.includes(t))))throw new Error(u)}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 _(t,e){if(s(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(u(r,t,["code_hash","hash_type","args"],[]),_(`${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 c(t,{nestedValidation:e=!0,debugPath:r="out_point"}={}){u(r,t,["tx_hash","index"],[]),_(`${r}.tx_hash`,t.tx_hash),l(`${r}.index`,t.index)}function h(t,{nestedValidation:e=!0,debugPath:r="cell_input"}={}){u(r,t,["since","previous_output"],[]),l(`${r}.since`,t.since),e&&c(t.previous_output,{debugPath:`${r}.previous_output`})}function g(t,{nestedValidation:e=!0,debugPath:r="cell_output"}={}){u(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(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 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 c(t){this.map={},t instanceof c?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 h(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)||s(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=h(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?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var t,e,r,n=h(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 c(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 c(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 u=new XMLHttpRequest;function s(){u.abort()}u.onload=function(){var t,e,r={status:u.status,statusText:u.statusText,headers:(t=u.getAllResponseHeaders()||"",e=new c,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 u?u.responseURL:r.headers.get("X-Request-URL");var i="response"in u?u.response:u.responseText;n(new w(i,r))},u.onerror=function(){o(new TypeError("Network request failed"))},u.ontimeout=function(){o(new TypeError("Network request failed"))},u.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},u.open(a.method,a.url,!0),"include"===a.credentials?u.withCredentials=!0:"omit"===a.credentials&&(u.withCredentials=!1),"responseType"in u&&i&&(u.responseType="blob"),a.headers.forEach((function(t,e){u.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",s),u.onreadystatechange=function(){4===u.readyState&&a.signal.removeEventListener("abort",s)}),u.send(void 0===a._bodyInit?null:a._bodyInit)}))}D.polyfill=!0,t.fetch||(t.fetch=D,t.Headers=c,t.Request=b,t.Response=w),e.Headers=c,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 E(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 E(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 ${constructor(t,e={}){return this.uri=t,this.defaultOptions=e,new Proxy(this,C)}static create(t){return new $(t)}}function I(t){return a.BigInt(t)}function j(t){return"0x"+t.toString(16)}function R(t){return function(e,r){if(!(r instanceof ArrayBuffer)){let n=j(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 M(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 N(t,{debugPath:e="script"}={}){return M(e,t,{code_hash:z(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:z(-1)})}function L(t,{debugPath:e="out_point"}={}){return M(e,t,{tx_hash:z(32),index:R(4)})}function U(t){return function(e,r){return t(r,{debugPath:e})}}function V(t,{debugPath:e="cell_input"}={}){return M(e,t,{since:R(8),previous_output:U(L)})}function q(t,{debugPath:e="cell_output"}={}){const r=M(e,t,{capacity:R(8),lock:U(N)});return t.type&&(r.type_=N(t.type,{debugPath:`${e}.type`})),r}function F(t,{debugPath:e="cell_dep"}={}){return M(e,t,{out_point:U(L),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 M(e,t,{version:R(4),cell_deps:H(U(F)),header_deps:H(z(32)),inputs:H(U(V)),outputs:H(U(q)),outputs_data:H(z(-1))})}function W(t,{debugPath:e="transaction"}={}){const r=G(t,{debugPath:`(raw)${e}`}),n=M(e,t,{witnesses:H(z(-1))});return n.raw=r,n}function J(t,{debugPath:e="raw_header"}={}){return M(e,t,{version:R(4),compact_target:R(4),timestamp:R(8),number:R(8),epoch:R(8),parent_hash:z(32),transactions_root:z(32),proposals_hash:z(32),uncles_hash:z(32),dao:z(32)})}function X(t,{debugPath:e="header"}={}){const r=J(t,{debugPath:`(raw)${e}`}),n=M(e,t,{nonce:R(16)});return n.raw=r,n}function Q(t,{debugPath:e="uncle_block"}={}){return M(e,t,{header:U(X),proposals:H(z(10))})}var K=Object.freeze({__proto__:null,NormalizeScript:N,NormalizeOutPoint:L,NormalizeCellInput:V,NormalizeCellOutput:q,NormalizeCellDep:F,NormalizeRawTransaction:G,NormalizeTransaction:W,NormalizeRawHeader:J,NormalizeHeader:X,NormalizeUncleBlock:Q,NormalizeBlock:function(t,{debugPath:e="block"}={}){return M(e,t,{header:U(X),uncles:H(U(Q)),transactions:H(U(W)),proposals:H(z(10))})},NormalizeCellbaseWitness:function(t,{debugPath:e="cellbase_witness"}={}){return M(e,t,{lock:U(N),message:z(-1)})},NormalizeWitnessArgs:function(t,{debugPath:e="witness_args"}={}){const r={};return t.lock&&(r.lock=z(-1)(`${e}.lock`,t.lock)),t.input_type&&(r.input_type=z(-1)(`${e}.input_type`,t.input_type)),t.output_type&&(r.output_type=z(-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&&c(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&&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 ut(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 st(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(st),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:ut,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:st,TransformUncleBlock:_t,TransformBlock:function(t,{validation:e=!0,debugPath:r="block"}={}){return t=Z(r,t,{header:rt(st),uncles:at(rt(_t)),transactions:at(rt(ut)),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&&A(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&&T(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=I(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,j(e),j(r));for(const t of n){if(this.skipCellWithContent&&(t.type||a.greaterThan(I(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=j,t.HexStringToBigInt=I,t.RPC=$,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){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 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=S,Object.defineProperty(t,"__esModule",{value:!0})}));