diff --git a/Data/js/jcwallet.js b/Data/js/jcwallet.js index 3bb9bd5..408c69c 100644 --- a/Data/js/jcwallet.js +++ b/Data/js/jcwallet.js @@ -13,7 +13,7 @@ var n=r(0),a=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r) * * @author Feross Aboukhadijeh * @license MIT - */function i(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,a=0,i=Math.min(r,n);a=0;f--)if(s[f]!==u[f])return!1;for(f=s.length-1;f>=0;f--)if(o=s[f],!g(e[o],t[o],r,n))return!1;return!0}(e,t,r,a))}return r?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function _(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function M(e,t,r,n){var a;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),a=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!a&&y(a,r,"Missing expected exception"+n);var i="string"==typeof n,o=!e&&a&&!r;if((!e&&c.isError(a)&&i&&_(a,r)||o)&&y(a,r,"Got unwanted exception"+n),e&&a&&r&&!_(a,r)||!e&&a)throw a}h.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return m(x(e.actual),128)+" "+e.operator+" "+m(x(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,a=p(t),i=n.indexOf("\n"+a);if(i>=0){var o=n.indexOf("\n",i+1);n=n.substring(o+1)}this.stack=n}}},c.inherits(h.AssertionError,Error),h.fail=y,h.ok=v,h.equal=function(e,t,r){e!=t&&y(e,t,r,"==",h.equal)},h.notEqual=function(e,t,r){e==t&&y(e,t,r,"!=",h.notEqual)},h.deepEqual=function(e,t,r){g(e,t,!1)||y(e,t,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,r){g(e,t,!0)||y(e,t,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,r){g(e,t,!1)&&y(e,t,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,r,n){g(t,r,!0)&&y(t,r,n,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,r){e!==t&&y(e,t,r,"===",h.strictEqual)},h.notStrictEqual=function(e,t,r){e===t&&y(e,t,r,"!==",h.notStrictEqual)},h.throws=function(e,t,r){M(!0,e,t,r)},h.doesNotThrow=function(e,t,r){M(!1,e,t,r)},h.ifError=function(e){if(e)throw e},h.strict=a((function e(t,r){t||y(t,!0,r,"==",e)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var k=Object.keys||function(e){var t=[];for(var r in e)f.call(e,r)&&t.push(r);return t}}).call(this,r(13))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";var n=r(459),a=r(460);e.exports={errors:n,formatters:a}},function(e,t,r){"use strict";var n;function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"b",(function(){return i})),r.d(t,"d",(function(){return o})),r.d(t,"c",(function(){return c})),r.d(t,"e",(function(){return f})),r.d(t,"f",(function(){return d})),r.d(t,"a",(function(){return s}));var i="INTERNAL_ERROR",o="SERVER_ERROR",c=[-32700,-32600,-32601,-32602,-32603],f=[-32e3,-32099],d=(a(n={},"PARSE_ERROR",{code:-32700,message:"Parse error"}),a(n,"INVALID_REQUEST",{code:-32600,message:"Invalid Request"}),a(n,"METHOD_NOT_FOUND",{code:-32601,message:"Method not found"}),a(n,"INVALID_PARAMS",{code:-32602,message:"Invalid params"}),a(n,i,{code:-32603,message:"Internal error"}),a(n,o,{code:-32e3,message:"Server error"}),n),s=o},function(e,t,r){"use strict";(function(t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=r(204),i=r(205);function o(e){var t=e;if("string"!=typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+n(t)+", while padToEven.");return t.length%2&&(t="0"+t),t}function c(e){return"0x"+e.toString(16)}e.exports={arrayContainsArray:function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+n(e)+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+n(t)+"'");return t[Boolean(r)?"some":"every"]((function(t){return e.indexOf(t)>=0}))},intToBuffer:function(e){var r=c(e);return new t(o(r.slice(2)),"hex")},getBinarySize:function(e){if("string"!=typeof e)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+n(e)+"'.");return t.byteLength(e,"utf8")},isHexPrefixed:a,stripHexPrefix:i,padToEven:o,intToHex:c,fromAscii:function(e){for(var t="",r=0;rr.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(c=r.slice(a,u)).length)throw new Error("invalid rlp, List has a invalid length");for(;c.length;)f=t(c),d.push(f.data),c=f.remainder;return{data:d,remainder:r.slice(u)}}(d(t));if(r)return n;if(0!==n.remainder.length)throw new Error("invalid remainder");return n.data},t.getLength=function(t){if(!t||0===t.length)return e.from([]);var r=d(t),n=r[0];if(n<=127)return r.length;if(n<=183)return n-127;if(n<=191)return n-182;if(n<=247)return n-191;var a=n-246;return a+i(r.slice(1,a).toString("hex"),16)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{f(n.next(e))}catch(e){i(e)}}function c(e){try{f(n.throw(e))}catch(e){i(e)}}function f(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}f((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]0&&o.length>a&&!o.warned){o.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=o.length,c=f,console&&console.warn&&console.warn(c)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},a=h.bind(n);return a.listener=r,n.wrapFn=a,a}function p(e,t,r){var n=e._events;if(void 0===n)return[];var a=n[t];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(i=t[0]),i instanceof Error)throw i;var c=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw c.context=i,c}var f=a[e];if(void 0===f)return!1;if("function"==typeof f)o(f,this,t);else{var d=f.length,s=x(f,d);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){o=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},f.prototype.listeners=function(e){return p(this,e,!0)},f.prototype.rawListeners=function(e){return p(this,e,!1)},f.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},f.prototype.listenerCount=m,f.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=r(461),i=r(228),o=r(471),c=r(32),f=r(106),d=function e(t,r){var a=[];return r.forEach((function(r){if("object"===n(r.components)){if("tuple"!==r.type.substring(0,5))throw new Error("components found but type is not tuple; report on GitHub");var i="",o=r.type.indexOf("[");o>=0&&(i=r.type.substring(o));var c=e(t,r.components);Array.isArray(c)&&t?a.push("tuple("+c.join(",")+")"+i):t?a.push("("+c+")"):a.push("("+c.join(",")+")"+i)}else a.push(r.type)})),a},s=function(e){if(!i.isHexStrict(e))throw new Error("The parameter must be a valid HEX string.");var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r7?r+=e[n].toUpperCase():r+=e[n];return r},toHex:i.toHex,toBN:i.toBN,bytesToHex:i.bytesToHex,hexToBytes:i.hexToBytes,hexToNumberString:i.hexToNumberString,hexToNumber:i.hexToNumber,toDecimal:i.hexToNumber,numberToHex:i.numberToHex,fromDecimal:i.numberToHex,hexToUtf8:i.hexToUtf8,hexToString:i.hexToUtf8,toUtf8:i.hexToUtf8,stripHexPrefix:i.stripHexPrefix,utf8ToHex:i.utf8ToHex,stringToHex:i.utf8ToHex,fromUtf8:i.utf8ToHex,hexToAscii:s,toAscii:s,asciiToHex:u,fromAscii:u,unitMap:a.unitMap,toWei:function(e,t){if(t=b(t),!i.isBN(e)&&"string"!=typeof e)throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return i.isBN(e)?a.toWei(e,t):a.toWei(e,t).toString(10)},fromWei:function(e,t){if(t=b(t),!i.isBN(e)&&"string"!=typeof e)throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return i.isBN(e)?a.fromWei(e,t):a.fromWei(e,t).toString(10)},padLeft:i.leftPad,leftPad:i.leftPad,padRight:i.rightPad,rightPad:i.rightPad,toTwosComplement:i.toTwosComplement,isBloom:i.isBloom,isUserEthereumAddressInBloom:i.isUserEthereumAddressInBloom,isContractAddressInBloom:i.isContractAddressInBloom,isTopic:i.isTopic,isTopicInBloom:i.isTopicInBloom,isInBloom:i.isInBloom,compareBlockNumbers:function(e,t){if(e==t)return 0;if("genesis"!=e&&"earliest"!=e&&0!=e||"genesis"!=t&&"earliest"!=t&&0!=t){if("genesis"==e||"earliest"==e)return-1;if("genesis"==t||"earliest"==t)return 1;if("latest"==e)return"pending"==t?-1:1;if("latest"===t)return"pending"==e?1:-1;if("pending"==e)return 1;if("pending"==t)return-1;var r=new f(e),n=new f(t);return r.lt(n)?-1:r.eq(n)?0:1}return 0},toNumber:i.toNumber}},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){var t,r,n,a,i,o,c;return r=(t=e).lib,n=r.Base,a=r.WordArray,i=t.algo,o=i.MD5,c=i.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,n=this.cfg,i=n.hasher.create(),o=a.create(),c=o.words,f=n.keySize,d=n.iterations;c.length>>24)|4278255360&(a<<24|a>>>8)}var i=this._hash.words,o=e[t+0],f=e[t+1],h=e[t+2],l=e[t+3],p=e[t+4],m=e[t+5],x=e[t+6],y=e[t+7],v=e[t+8],g=e[t+9],w=e[t+10],_=e[t+11],M=e[t+12],k=e[t+13],S=e[t+14],A=e[t+15],E=i[0],T=i[1],O=i[2],P=i[3];E=d(E,T,O,P,o,7,c[0]),P=d(P,E,T,O,f,12,c[1]),O=d(O,P,E,T,h,17,c[2]),T=d(T,O,P,E,l,22,c[3]),E=d(E,T,O,P,p,7,c[4]),P=d(P,E,T,O,m,12,c[5]),O=d(O,P,E,T,x,17,c[6]),T=d(T,O,P,E,y,22,c[7]),E=d(E,T,O,P,v,7,c[8]),P=d(P,E,T,O,g,12,c[9]),O=d(O,P,E,T,w,17,c[10]),T=d(T,O,P,E,_,22,c[11]),E=d(E,T,O,P,M,7,c[12]),P=d(P,E,T,O,k,12,c[13]),O=d(O,P,E,T,S,17,c[14]),E=s(E,T=d(T,O,P,E,A,22,c[15]),O,P,f,5,c[16]),P=s(P,E,T,O,x,9,c[17]),O=s(O,P,E,T,_,14,c[18]),T=s(T,O,P,E,o,20,c[19]),E=s(E,T,O,P,m,5,c[20]),P=s(P,E,T,O,w,9,c[21]),O=s(O,P,E,T,A,14,c[22]),T=s(T,O,P,E,p,20,c[23]),E=s(E,T,O,P,g,5,c[24]),P=s(P,E,T,O,S,9,c[25]),O=s(O,P,E,T,l,14,c[26]),T=s(T,O,P,E,v,20,c[27]),E=s(E,T,O,P,k,5,c[28]),P=s(P,E,T,O,h,9,c[29]),O=s(O,P,E,T,y,14,c[30]),E=u(E,T=s(T,O,P,E,M,20,c[31]),O,P,m,4,c[32]),P=u(P,E,T,O,v,11,c[33]),O=u(O,P,E,T,_,16,c[34]),T=u(T,O,P,E,S,23,c[35]),E=u(E,T,O,P,f,4,c[36]),P=u(P,E,T,O,p,11,c[37]),O=u(O,P,E,T,y,16,c[38]),T=u(T,O,P,E,w,23,c[39]),E=u(E,T,O,P,k,4,c[40]),P=u(P,E,T,O,o,11,c[41]),O=u(O,P,E,T,l,16,c[42]),T=u(T,O,P,E,x,23,c[43]),E=u(E,T,O,P,g,4,c[44]),P=u(P,E,T,O,M,11,c[45]),O=u(O,P,E,T,A,16,c[46]),E=b(E,T=u(T,O,P,E,h,23,c[47]),O,P,o,6,c[48]),P=b(P,E,T,O,y,10,c[49]),O=b(O,P,E,T,S,15,c[50]),T=b(T,O,P,E,m,21,c[51]),E=b(E,T,O,P,M,6,c[52]),P=b(P,E,T,O,l,10,c[53]),O=b(O,P,E,T,w,15,c[54]),T=b(T,O,P,E,f,21,c[55]),E=b(E,T,O,P,v,6,c[56]),P=b(P,E,T,O,A,10,c[57]),O=b(O,P,E,T,x,15,c[58]),T=b(T,O,P,E,k,21,c[59]),E=b(E,T,O,P,p,6,c[60]),P=b(P,E,T,O,_,10,c[61]),O=b(O,P,E,T,h,15,c[62]),T=b(T,O,P,E,g,21,c[63]),i[0]=i[0]+E|0,i[1]=i[1]+T|0,i[2]=i[2]+O|0,i[3]=i[3]+P|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,a=8*e.sigBytes;r[a>>>5]|=128<<24-a%32;var i=t.floor(n/4294967296),o=n;r[15+(a+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),r[14+(a+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(r.length+1),this._process();for(var c=this._hash,f=c.words,d=0;d<4;d++){var s=f[d];f[d]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return c},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function d(e,t,r,n,a,i,o){var c=e+(t&r|~t&n)+a+o;return(c<>>32-i)+t}function s(e,t,r,n,a,i,o){var c=e+(t&n|r&~n)+a+o;return(c<>>32-i)+t}function u(e,t,r,n,a,i,o){var c=e+(t^r^n)+a+o;return(c<>>32-i)+t}function b(e,t,r,n,a,i,o){var c=e+(r^(t|~n))+a+o;return(c<>>32-i)+t}r.MD5=i._createHelper(f),r.HmacMD5=i._createHmacHelper(f)}(Math),e.MD5},"object"===c(t)?e.exports=t=o(r(2)):(a=[r(2)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){"use strict";var n=t,a=r(9),i=r(30),o=r(199);n.assert=i,n.toArray=o.toArray,n.zero2=o.zero2,n.toHex=o.toHex,n.encode=o.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var a=1<(a>>1)-1?(a>>1)-f:f,i.isubn(c)):c=0,n[o]=c,i.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,a=0,i=0;e.cmpn(-a)>0||t.cmpn(-i)>0;){var o,c,f=e.andln(3)+a&3,d=t.andln(3)+i&3;3===f&&(f=-1),3===d&&(d=-1),o=0==(1&f)?0:3!==(n=e.andln(7)+a&7)&&5!==n||2!==d?f:-f,r[0].push(o),c=0==(1&d)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==f?d:-d,r[1].push(c),2*a===o+1&&(a=1-a),2*i===c+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new a(e,"hex","le")}},function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){var t,r;return r=(t=e).lib.WordArray,t.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var a=[],i=0;i>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,c=0;c<4&&i+.75*c>>6*(3-c)&63));var f=n.charAt(64);if(f)for(;a.length%4;)a.push(f);return a.join("")},parse:function(e){var t=e.length,n=this._map,a=this._reverseMap;if(!a){a=this._reverseMap=[];for(var i=0;i>>6-o%4*2,d=c|f;a[i>>>2]|=d<<24-i%4*8,i++}return r.create(a,i)}(e,t,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"===c(t)?e.exports=t=o(r(2)):(a=[r(2)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){"use strict";(function(t,n){var a=r(6).Buffer,i=t.crypto||t.msCrypto;function o(e){for(var t=0,r=e.length;t4294967295)throw new RangeError("requested too many random bytes");var r=a.allocUnsafe(e);if(e>0)if(e>65536)for(var o=0;o4294967295)throw new RangeError("requested too many random bytes");var r=a.allocUnsafe(e);if(e>0)if(e>65536)for(var i=0;i>1]>>4>=8&&(t[f]=t[f].toUpperCase()),(15&c[f>>1])>=8&&(t[f+1]=t[f+1].toUpperCase());return"0x"+t.join("")}for(var f={},d=0;d<10;d++)f[String(d)]=String(d);for(var s=0;s<26;s++)f[String.fromCharCode(65+s)]=String(10+s);var u,b=Math.floor((u=9007199254740991,Math.log10?Math.log10(u):Math.log(u)/Math.LN10));function h(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return f[e]})).join("");t.length>=b;){var r=t.substring(0,b);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function l(e){var t=null;if("string"!=typeof e&&o.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=c(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&o.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==h(e)&&o.throwArgumentError("bad icap checksum","address",e),t=Object(a.c)(e.substring(4));t.length<40;)t="0"+t;t=c("0x"+t)}else o.throwArgumentError("invalid address","address",e);return t}},function(e,t,r){"use strict";r.d(t,"b",(function(){return f})),r.d(t,"a",(function(){return u}));var n=r(1),a=r(3),i=new a.a("rlp/5.6.1");function o(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function c(e,t,r){for(var n=0,a=0;at+1+n&&i.throwError("child data too short",a.a.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:o}}function s(e,t){if(0===e.length&&i.throwError("data too short",a.a.errors.BUFFER_OVERRUN,{}),e[t]>=248){var r=e[t]-247;t+1+r>e.length&&i.throwError("data short segment too short",a.a.errors.BUFFER_OVERRUN,{});var o=c(e,t+1,r);return t+1+r+o>e.length&&i.throwError("data long segment too short",a.a.errors.BUFFER_OVERRUN,{}),d(e,t,t+1+r,r+o)}if(e[t]>=192){var f=e[t]-192;return t+1+f>e.length&&i.throwError("data array too short",a.a.errors.BUFFER_OVERRUN,{}),d(e,t,t+1,f)}if(e[t]>=184){var s=e[t]-183;t+1+s>e.length&&i.throwError("data array too short",a.a.errors.BUFFER_OVERRUN,{});var u=c(e,t+1,s);return t+1+s+u>e.length&&i.throwError("data array too short",a.a.errors.BUFFER_OVERRUN,{}),{consumed:1+s+u,result:Object(n.g)(e.slice(t+1+s,t+1+s+u))}}if(e[t]>=128){var b=e[t]-128;return t+1+b>e.length&&i.throwError("data too short",a.a.errors.BUFFER_OVERRUN,{}),{consumed:1+b,result:Object(n.g)(e.slice(t+1,t+1+b))}}return{consumed:1,result:Object(n.g)(e[t])}}function u(e){var t=Object(n.a)(e),r=s(t,0);return r.consumed!==t.length&&i.throwArgumentError("invalid rlp data","data",e),r.result}},function(e,t,r){"use strict";var n=r(30),a=r(4);function i(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function c(e){return 1===e.length?"0"+e:e}function f(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=a,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),a=0;a>6|192,r[n++]=63&o|128):i(e,a)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++a)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(a=0;a>>0}return o},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,a=0;n>>24,r[a+1]=i>>>16&255,r[a+2]=i>>>8&255,r[a+3]=255&i):(r[a+3]=i>>>24,r[a+2]=i>>>16&255,r[a+1]=i>>>8&255,r[a]=255&i)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,a){return e+t+r+n+a>>>0},t.sum64=function(e,t,r,n){var a=e[t],i=n+e[t+1]>>>0,o=(i>>0,e[t+1]=i},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,a,i,o,c){var f=0,d=t;return f+=(d=d+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,a,i,o,c){return t+n+i+c>>>0},t.sum64_5_hi=function(e,t,r,n,a,i,o,c,f,d){var s=0,u=t;return s+=(u=u+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,a,i,o,c,f,d){return t+n+i+c+d>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t,r){"use strict";var n=t;n.version=r(377).version,n.utils=r(29),n.rand=r(127),n.curve=r(200),n.curves=r(128),n.ec=r(389),n.eddsa=r(393)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(132),a=r(405);t.keccak224=n.createHashFunction((function(){return a("keccak224")})),t.keccak256=n.createHashFunction((function(){return a("keccak256")})),t.keccak384=n.createHashFunction((function(){return a("keccak384")})),t.keccak512=n.createHashFunction((function(){return a("keccak512")}))},function(e,t,r){"use strict";var n=r(6).Buffer,a=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===a||!a(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=f,this.end=d,t=4;break;case"utf8":this.fillLast=c,t=4;break;case"base64":this.text=s,this.end=u,t=3;break;default:return this.write=b,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function c(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function f(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function d(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function s(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function b(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return a>0&&(e.lastNeed=a-1),a;if(--n=0)return a>0&&(e.lastNeed=a-2),a;if(--n=0)return a>0&&(2===a?a=0:e.lastNeed=a-3),a;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(106));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(603));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(610));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(673));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(813));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){(function(e){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),c=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=d),u(n,e,n.depth)}function d(e,t){var r=f.styles[t];return r?"["+f.colors[r][0]+"m"+e+"["+f.colors[r][1]+"m":e}function s(e,t){return e}function u(e,r,n){if(e.customInspect&&r&&k(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var a=r.inspect(n,e);return y(a)||(a=u(e,a,n)),a}var i=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(y(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(x(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,r);if(i)return i;var o=Object.keys(r),c=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),M(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return b(r);if(0===o.length){if(k(r)){var f=r.name?": "+r.name:"";return e.stylize("[Function"+f+"]","special")}if(g(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(M(r))return b(r)}var d,s="",w=!1,S=["{","}"];(l(r)&&(w=!0,S=["[","]"]),k(r))&&(s=" [Function"+(r.name?": "+r.name:"")+"]");return g(r)&&(s=" "+RegExp.prototype.toString.call(r)),_(r)&&(s=" "+Date.prototype.toUTCString.call(r)),M(r)&&(s=" "+b(r)),0!==o.length||w&&0!=r.length?n<0?g(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),d=w?function(e,t,r,n,a){for(var i=[],o=0,c=t.length;o=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(d,s,S)):S[0]+s+S[1]}function b(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,a,i){var o,c,f;if((f=Object.getOwnPropertyDescriptor(t,a)||{value:t[a]}).get?c=f.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):f.set&&(c=e.stylize("[Setter]","special")),O(n,a)||(o="["+a+"]"),c||(e.seen.indexOf(f.value)<0?(c=m(r)?u(e,f.value,null):u(e,f.value,r-1)).indexOf("\n")>-1&&(c=i?c.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+c.split("\n").map((function(e){return" "+e})).join("\n")):c=e.stylize("[Circular]","special")),v(o)){if(i&&a.match(/^\d+$/))return c;(o=JSON.stringify(""+a)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+c}function l(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function m(e){return null===e}function x(e){return"number"==typeof e}function y(e){return"string"==typeof e}function v(e){return void 0===e}function g(e){return w(e)&&"[object RegExp]"===S(e)}function w(e){return"object"===n(e)&&null!==e}function _(e){return w(e)&&"[object Date]"===S(e)}function M(e){return w(e)&&("[object Error]"===S(e)||e instanceof Error)}function k(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(v(o)&&(o=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!c[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var n=e.pid;c[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,n,e)}}else c[r]=function(){};return c[r]},t.inspect=f,f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=l,t.isBoolean=p,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=x,t.isString=y,t.isSymbol=function(e){return"symbol"===n(e)},t.isUndefined=v,t.isRegExp=g,t.isObject=w,t.isDate=_,t.isError=M,t.isFunction=k,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===n(e)||void 0===e},t.isBuffer=r(403);var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var e=new Date,t=[A(e.getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":");return[e.getDate(),E[e.getMonth()],t].join(" ")}function O(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",T(),t.format.apply(t,arguments))},t.inherits=r(404),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var P="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function j(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(P&&e[P]){var t;if("function"!=typeof(t=e[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),a=[],i=0;i=9007199254740991||t<=-9007199254740991)&&m("overflow","BigNumber.from",t),e.from(String(t));var r=t;if("bigint"==typeof r)return e.from(r.toString());if(Object(i.h)(r))return e.from(Object(i.g)(r));if(r)if(r.toHexString){var n=r.toHexString();if("string"==typeof n)return e.from(n)}else{var a=r._hex;if(null==a&&"BigNumber"===r.type&&(a=r.hex),"string"==typeof a&&(Object(i.j)(a)||"-"===a[0]&&Object(i.j)(a.substring(1))))return e.from(a)}return d.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}],(r=[{key:"fromTwos",value:function(e){return l(p(this).fromTwos(e))}},{key:"toTwos",value:function(e){return l(p(this).toTwos(e))}},{key:"abs",value:function(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}},{key:"add",value:function(e){return l(p(this).add(p(e)))}},{key:"sub",value:function(e){return l(p(this).sub(p(e)))}},{key:"div",value:function(t){return e.from(t).isZero()&&m("division-by-zero","div"),l(p(this).div(p(t)))}},{key:"mul",value:function(e){return l(p(this).mul(p(e)))}},{key:"mod",value:function(e){var t=p(e);return t.isNeg()&&m("division-by-zero","mod"),l(p(this).umod(t))}},{key:"pow",value:function(e){var t=p(e);return t.isNeg()&&m("negative-power","pow"),l(p(this).pow(t))}},{key:"and",value:function(e){var t=p(e);return(this.isNegative()||t.isNeg())&&m("unbound-bitwise-result","and"),l(p(this).and(t))}},{key:"or",value:function(e){var t=p(e);return(this.isNegative()||t.isNeg())&&m("unbound-bitwise-result","or"),l(p(this).or(t))}},{key:"xor",value:function(e){var t=p(e);return(this.isNegative()||t.isNeg())&&m("unbound-bitwise-result","xor"),l(p(this).xor(t))}},{key:"mask",value:function(e){return(this.isNegative()||e<0)&&m("negative-width","mask"),l(p(this).maskn(e))}},{key:"shl",value:function(e){return(this.isNegative()||e<0)&&m("negative-width","shl"),l(p(this).shln(e))}},{key:"shr",value:function(e){return(this.isNegative()||e<0)&&m("negative-width","shr"),l(p(this).shrn(e))}},{key:"eq",value:function(e){return p(this).eq(p(e))}},{key:"lt",value:function(e){return p(this).lt(p(e))}},{key:"lte",value:function(e){return p(this).lte(p(e))}},{key:"gt",value:function(e){return p(this).gt(p(e))}},{key:"gte",value:function(e){return p(this).gte(p(e))}},{key:"isNegative",value:function(){return"-"===this._hex[0]}},{key:"isZero",value:function(){return p(this).isZero()}},{key:"toNumber",value:function(){try{return p(this).toNumber()}catch(e){m("overflow","toNumber",this.toString())}return null}},{key:"toBigInt",value:function(){try{return BigInt(this.toString())}catch(e){}return d.throwError("this platform does not support BigInt",o.a.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}},{key:"toString",value:function(){return arguments.length>0&&(10===arguments[0]?u||(u=!0,d.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?d.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",o.a.errors.UNEXPECTED_ARGUMENT,{}):d.throwError("BigNumber.toString does not accept parameters",o.a.errors.UNEXPECTED_ARGUMENT,{})),p(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(e){return{type:"BigNumber",hex:this.toHexString()}}}])&&c(t.prototype,r),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function h(e){if("string"!=typeof e)return h(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&d.throwArgumentError("invalid hex","value",e),"0x00"===(e=h(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function l(e){return b.from(h(e))}function p(e){var t=b.from(e).toHexString();return"-"===t[0]?new f("-"+t.substring(3),16):new f(t.substring(2),16)}function m(e,t,r){var n={fault:e,operation:t};return null!=r&&(n.value=r),d.throwError(e,o.a.errors.NUMERIC_FAULT,n)}function x(e){return new f(e,36).toString(16)}function y(e){return new f(e,16).toString(36)}},function(e,t,r){"use strict";var n=r(103),a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var i=Object.create(r(83));i.inherits=r(4);var o=r(222),c=r(139);i.inherits(u,o);for(var f=a(c.prototype),d=0;d=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(39),o=r(68),c=r(107);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,a,i=[],o=!0,c=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);o=!0);}catch(e){c=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(c)throw a}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),f=r.call(i,"finallyLoc");if(c&&f){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;k(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),b}},e}function d(e,t,r,n,a,i,o){try{var c=e[i](o),f=c.value}catch(e){return void r(e)}c.done?t(f):Promise.resolve(f).then(n,a)}function s(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){d(i,n,a,o,c,"next",e)}function c(e){d(i,n,a,o,c,"throw",e)}o(void 0)}))}}function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var b=r(16).errors,h=r(16).formatters,l=r(24),p=r(108),m=r(109).subscriptions,x=r(872),y=function(e){if(!e.call||!e.name)throw new Error('When creating a method you need to provide at least the "name" and "call" property.');this.name=e.name,this.call=e.call,this.params=e.params||0,this.inputFormatter=e.inputFormatter,this.outputFormatter=e.outputFormatter,this.transformPayload=e.transformPayload,this.extraFormatters=e.extraFormatters,this.abiCoder=e.abiCoder,this.requestManager=e.requestManager,this.accounts=e.accounts,this.defaultBlock=e.defaultBlock||"latest",this.defaultAccount=e.defaultAccount||null,this.transactionBlockTimeout=e.transactionBlockTimeout||50,this.transactionConfirmationBlocks=e.transactionConfirmationBlocks||24,this.transactionPollingTimeout=e.transactionPollingTimeout||750,this.transactionPollingInterval=e.transactionPollingInterval||1e3,this.blockHeaderTimeout=e.blockHeaderTimeout||10,this.defaultCommon=e.defaultCommon,this.defaultChain=e.defaultChain,this.defaultHardfork=e.defaultHardfork,this.handleRevert=e.handleRevert};y.prototype.setRequestManager=function(e,t){this.requestManager=e,t&&(this.accounts=t)},y.prototype.createFunction=function(e,t){var r=this.buildCall();return Object.defineProperty(r,"call",{configurable:!0,writable:!0,value:this.call}),this.setRequestManager(e||this.requestManager,t||this.accounts),r},y.prototype.attachToObject=function(e){var t=this.buildCall();Object.defineProperty(t,"call",{configurable:!0,writable:!0,value:this.call});var r=this.name.split(".");r.length>1?(e[r[0]]=e[r[0]]||{},e[r[0]][r[1]]=t):e[r[0]]=t},y.prototype.getCall=function(e){return"function"==typeof this.call?this.call(e):this.call},y.prototype.extractCallback=function(e){if("function"==typeof e[e.length-1])return e.pop()},y.prototype.validateArgs=function(e){if(e.length!==this.params)throw b.InvalidNumberOfParams(e.length,this.params,this.name)},y.prototype.formatInput=function(e){var t=this;return this.inputFormatter?this.inputFormatter.map((function(r,n){return r?r.call(t,e[n]):e[n]})):e},y.prototype.formatOutput=function(e){var t=this;return Array.isArray(e)?e.map((function(e){return t.outputFormatter&&e?t.outputFormatter(e):e})):this.outputFormatter&&e?this.outputFormatter(e):e},y.prototype.toPayload=function(e){var t=this.getCall(e),r=this.extractCallback(e),n=this.formatInput(e);this.validateArgs(n);var a={method:t,params:n,callback:r};return this.transformPayload&&(a=this.transformPayload(a)),a},y.prototype._confirmTransaction=function(e,t,r){var n=this,a=!1,i=!0,o=0,c=0,d=null,v=null,g=null,w=r.params[0]&&"object"===u(r.params[0])&&r.params[0].gas?r.params[0].gas:null,_=!!r.params[0]&&"object"===u(r.params[0])&&r.params[0].data&&r.params[0].from&&!r.params[0].to,M=_&&r.params[0].data.length>2,k=[new y({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[h.inputBlockNumberFormatter,function(e){return!!e}],outputFormatter:h.outputBlockFormatter}),new y({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:h.outputTransactionReceiptFormatter}),new y({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[h.inputAddressFormatter,h.inputDefaultBlockNumberFormatter]}),new y({name:"getTransactionByHash",call:"eth_getTransactionByHash",params:1,inputFormatter:[null],outputFormatter:h.outputTransactionFormatter}),new m({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:h.outputBlockFormatter}}})],S={};k.forEach((function(e){e.attachToObject(S),e.requestManager=n.requestManager}));var A=function(u,m,y,k,A){if(!y)return A||(A={unsubscribe:function(){clearInterval(d),clearTimeout(v)}}),(u?p.resolve(u):S.getTransactionReceipt(t)).catch((function(t){A.unsubscribe(),a=!0,l._fireError({message:"Failed to check for transaction receipt:",data:t},e.eventEmitter,e.reject)})).then(function(){var t=s(f().mark((function t(r){var a,o,d;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r&&r.blockHash){t.next=2;break}throw new Error("Receipt missing or blockHash null");case 2:if(n.extraFormatters&&n.extraFormatters.receiptFormatter&&(r=n.extraFormatters.receiptFormatter(r)),!(e.eventEmitter.listeners("confirmation").length>0)){t.next=28;break}if(void 0!==u&&0===c){t.next=25;break}return t.next=7,S.getBlockByNumber("latest");case 7:if(o=t.sent,d=o?o.hash:null,!m){t.next=24;break}if(!g){t.next=17;break}return t.next=13,S.getBlockByNumber(g.number+1);case 13:(a=t.sent)&&(g=a,e.eventEmitter.emit("confirmation",c,r,d)),t.next=22;break;case 17:return t.next=19,S.getBlockByNumber(r.blockNumber);case 19:a=t.sent,g=a,e.eventEmitter.emit("confirmation",c,r,d);case 22:t.next=25;break;case 24:e.eventEmitter.emit("confirmation",c,r,d);case 25:(m&&a||!m)&&c++,i=!1,c===n.transactionConfirmationBlocks+1&&(A.unsubscribe(),e.eventEmitter.removeAllListeners());case 28:return t.abrupt("return",r);case 29:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).then(function(){var t=s(f().mark((function t(r){var o;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!_||a){t.next=19;break}if(r.contractAddress){t.next=5;break}return i&&(A.unsubscribe(),a=!0),l._fireError(b.NoContractAddressFoundError(r),e.eventEmitter,e.reject,null,r),t.abrupt("return");case 5:return t.prev=5,t.next=8,S.getCode(r.contractAddress);case 8:o=t.sent,t.next=13;break;case 11:t.prev=11,t.t0=t.catch(5);case 13:if(o){t.next=15;break}return t.abrupt("return");case 15:!0===r.status&&M||o.length>2?(e.eventEmitter.emit("receipt",r),n.extraFormatters&&n.extraFormatters.contractDeployFormatter?e.resolve(n.extraFormatters.contractDeployFormatter(r)):e.resolve(r),i&&e.eventEmitter.removeAllListeners()):l._fireError(b.ContractCodeNotStoredError(r),e.eventEmitter,e.reject,null,r),i&&A.unsubscribe(),a=!0;case 19:return t.abrupt("return",r);case 20:case"end":return t.stop()}}),t,null,[[5,11]])})));return function(e){return t.apply(this,arguments)}}()).then(function(){var t=s(f().mark((function t(o){var c,d,s,u;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(_||a){t.next=35;break}if(o.outOfGas||w&&w===o.gasUsed||!0!==o.status&&"0x1"!==o.status&&void 0!==o.status){t.next=7;break}e.eventEmitter.emit("receipt",o),e.resolve(o),i&&e.eventEmitter.removeAllListeners(),t.next=33;break;case 7:if(JSON.stringify(o,null,2),!1!==o.status&&"0x0"!==o.status){t.next=32;break}if(t.prev=9,c=null,!n.handleRevert||"eth_sendTransaction"!==n.call&&"eth_sendRawTransaction"!==n.call){t.next=24;break}return d=r.params[0],"eth_sendRawTransaction"===n.call&&(s=r.params[0],u=x.parse(s),d=h.inputTransactionFormatter({data:u.data,to:u.to,from:u.from,gas:u.gasLimit.toHexString(),gasPrice:u.gasPrice?u.gasPrice.toHexString():void 0,value:u.value.toHexString()})),t.next=16,n.getRevertReason(d,o.blockNumber);case 16:if(!(c=t.sent)){t.next=21;break}l._fireError(b.TransactionRevertInstructionError(c.reason,c.signature,o),e.eventEmitter,e.reject,null,o),t.next=22;break;case 21:throw!1;case 22:t.next=25;break;case 24:throw!1;case 25:t.next=30;break;case 27:t.prev=27,t.t0=t.catch(9),l._fireError(b.TransactionRevertedWithoutReasonError(o),e.eventEmitter,e.reject,null,o);case 30:t.next=33;break;case 32:l._fireError(b.TransactionOutOfGasError(o),e.eventEmitter,e.reject,null,o);case 33:i&&A.unsubscribe(),a=!0;case 35:case"end":return t.stop()}}),t,null,[[9,27]])})));return function(e){return t.apply(this,arguments)}}()).catch((function(){o++,m?o-1>=n.transactionPollingTimeout&&(A.unsubscribe(),a=!0,l._fireError(b.TransactionError("Transaction was not mined within "+n.transactionPollingTimeout+" seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),e.eventEmitter,e.reject)):o-1>=n.transactionBlockTimeout&&(A.unsubscribe(),a=!0,l._fireError(b.TransactionError("Transaction was not mined within "+n.transactionBlockTimeout+" blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),e.eventEmitter,e.reject))}));A.unsubscribe(),a=!0,l._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:y},e.eventEmitter,e.reject)},E=function(e){var t=!1,r=function(){d=setInterval(A.bind(null,e,!0),n.transactionPollingInterval)};if(!this.requestManager.provider.on)return r();S.subscribe("newBlockHeaders",(function(n,a,i){if(t=!0,n||!a)return r();A(e,!1,n,0,i)})),v=setTimeout((function(){t||r()}),1e3*this.blockHeaderTimeout)}.bind(this);S.getTransactionReceipt(t).then((function(t){t&&t.blockHash?(e.eventEmitter.listeners("confirmation").length>0&&E(t),A(t,!1)):a||E()})).catch((function(){a||E()}))};var v=function(e,t){return"number"==typeof e?t.wallet[e]:e&&"object"===u(e)&&e.address&&e.privateKey?e:t.wallet[e.toLowerCase()]};function g(e,t){return new Promise((function(r,a){try{var i=new y({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[function(e){return e?l.toHex(e):"latest"},function(){return!1}]}).createFunction(e.requestManager),o=new y({name:"getGasPrice",call:"eth_gasPrice",params:0}).createFunction(e.requestManager);Promise.all([i(),o()]).then((function(e){var a=n(e,2),i=a[0],o=a[1];if(("0x2"===t.type||void 0===t.type)&&i&&i.baseFeePerGas){var c,f;t.gasPrice?(c=t.gasPrice,f=t.gasPrice,delete t.gasPrice):(c=t.maxPriorityFeePerGas||"0x9502F900",f=t.maxFeePerGas||l.toHex(l.toBN(i.baseFeePerGas).mul(l.toBN(2)).add(l.toBN(c)))),r({maxFeePerGas:f,maxPriorityFeePerGas:c})}else{if(t.maxPriorityFeePerGas||t.maxFeePerGas)throw Error("Network doesn't support eip-1559");r({gasPrice:o})}}))}catch(e){a(e)}}))}y.prototype.buildCall=function(){var e=this,t="eth_sendTransaction"===e.call||"eth_sendRawTransaction"===e.call,r="eth_call"===e.call,n=function(){var n=p(!t),a=e.toPayload(Array.prototype.slice.call(arguments)),i=function(i,o){var c;if(e.handleRevert&&r&&e.abiCoder&&(!i&&e.isRevertReasonString(o)?c=o.substring(10):i&&i.data&&(c=i.data.substring(10)),c)){var f=e.abiCoder.decodeParameter("string","0x"+c);return void l._fireError(b.RevertInstructionError(f,"Error(String)"),n.eventEmitter,n.reject,a.callback,{reason:f,signature:"Error(String)"})}try{o=e.formatOutput(o)}catch(e){i=e}if(o instanceof Error&&(i=o),i)return i.error&&(i=i.error),l._fireError(i,n.eventEmitter,n.reject,a.callback);a.callback&&a.callback(null,o),t?(n.eventEmitter.emit("transactionHash",o),e._confirmTransaction(n,o,a)):i||n.resolve(o)},c=function(t){var r=Object.assign({},a.params[0]);r.transactionHash=t.transactionHash,n.eventEmitter.emit("presend",r);var c=o(o({},a),{},{method:"eth_sendRawTransaction",params:[t.rawTransaction]});e.requestManager.send(c,i)},f=function(e,t){var r;if(t&&t.accounts&&t.accounts.wallet&&t.accounts.wallet.length)if("eth_sendTransaction"===e.method){var a=e.params[0];if((r=v(a&&"object"===u(a)?a.from:null,t.accounts))&&r.privateKey)return delete(a=JSON.parse(JSON.stringify(a))).from,t.defaultChain&&!a.chain&&(a.chain=t.defaultChain),t.defaultHardfork&&!a.hardfork&&(a.hardfork=t.defaultHardfork),t.defaultCommon&&!a.common&&(a.common=t.defaultCommon),void t.accounts.signTransaction(a,r.privateKey).then(c).catch((function(e){if("function"==typeof n.eventEmitter.listeners&&n.eventEmitter.listeners("error").length){try{n.eventEmitter.emit("error",e)}catch(e){}n.eventEmitter.removeAllListeners(),n.eventEmitter.catch((function(){}))}n.reject(e)}))}else if("eth_sign"===e.method){var o=e.params[1];if((r=v(e.params[0],t.accounts))&&r.privateKey){var f=t.accounts.sign(o,r.privateKey);return e.callback&&e.callback(null,f.signature),void n.resolve(f.signature)}}return t.requestManager.send(e,i)};return t&&a.params[0]&&"object"===u(a.params[0])&&void 0===a.params[0].gasPrice&&(void 0===a.params[0].maxPriorityFeePerGas||void 0===a.params[0].maxFeePerGas)?g(e,a.params[0]).then((function(r){void 0!==r.gasPrice?a.params[0].gasPrice=r.gasPrice:void 0!==r.maxPriorityFeePerGas&&void 0!==r.maxFeePerGas&&(a.params[0].maxPriorityFeePerGas=r.maxPriorityFeePerGas,a.params[0].maxFeePerGas=r.maxFeePerGas),t&&setTimeout((function(){n.eventEmitter.emit("sending",a)}),0),f(a,e)})):(t&&setTimeout((function(){n.eventEmitter.emit("sending",a)}),0),f(a,e)),t&&setTimeout((function(){n.eventEmitter.emit("sent",a)}),0),n.eventEmitter};return n.method=e,n.request=this.request.bind(this),n},y.prototype.getRevertReason=function(e,t){var r=this;return new Promise((function(n,a){new y({name:"call",call:"eth_call",params:2,abiCoder:r.abiCoder,handleRevert:!0}).createFunction(r.requestManager)(e,l.numberToHex(t)).then((function(){n(!1)})).catch((function(e){e.reason?n({reason:e.reason,signature:e.signature}):a(e)}))}))},y.prototype.isRevertReasonString=function(e){return"string"==typeof e&&(e.length-2)/2%32==4&&"0x08c379a0"===e.substring(0,10)},y.prototype.request=function(){var e=this.toPayload(Array.prototype.slice.call(arguments));return e.format=this.formatOutput.bind(this),e},e.exports=y},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,a(r(281),t),a(r(282),t),a(r(605),t),a(r(163),t),a(r(606),t),a(r(55),t),a(r(607),t),a(r(40),t),a(r(164),t);var i=r(71);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return i.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return i.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return i.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return i.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return i.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return i.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return i.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return i.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return i.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return i.isHexString}})},function(e,t,r){"use strict";(function(e){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(40),o=r(71),c=r(115);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(41),o=r(73),c=r(116);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(42),o=r(74),c=r(117);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsync=void 0;var n,a=r(758),i=(n=a)&&n.__esModule?n:{default:n};var o="function"==typeof Symbol;function c(e){return o&&"AsyncFunction"===e[Symbol.toStringTag]}t.default=function(e){return c(e)?(0,i.default)(e):e},t.isAsync=c},function(e,t,r){"use strict";(function(e){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(43),o=r(77),c=r(122);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){var t,r,n,a,i,o,c;return r=(t=e).lib,n=r.WordArray,a=r.Hasher,i=t.algo,o=[],c=i.SHA1=a.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],a=r[1],i=r[2],c=r[3],f=r[4],d=0;d<80;d++){if(d<16)o[d]=0|e[t+d];else{var s=o[d-3]^o[d-8]^o[d-14]^o[d-16];o[d]=s<<1|s>>>31}var u=(n<<5|n>>>27)+f+o[d];u+=d<20?1518500249+(a&i|~a&c):d<40?1859775393+(a^i^c):d<60?(a&i|a&c|i&c)-1894007588:(a^i^c)-899497514,f=c,c=i,i=a<<30|a>>>2,a=n,n=u}r[0]=r[0]+n|0,r[1]=r[1]+a|0,r[2]=r[2]+i|0,r[3]=r[3]+c|0,r[4]=r[4]+f|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=a._createHelper(c),t.HmacSHA1=a._createHmacHelper(c),e.SHA1},"object"===c(t)?e.exports=t=o(r(2)):(a=[r(2)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return o}));var n=r(17);function a(e){return n.c.includes(e)}function i(e){return Object.keys(n.f).includes(e)?n.f[e]:n.f[n.a]}function o(e){var t=Object.values(n.f).find((function(t){return t.code===e}));return t||n.f[n.a]}},,function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a={};function i(e,t,r){r||(r=Error);var n=function(e){var r,n;function a(r,n,a){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,a))||this}return n=e,(r=a).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,a}(r);n.prototype.name=r.name,n.prototype.code=e,a[e]=n}function o(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,i,c,f;if("string"==typeof t&&(i="not ",t.substr(!c||c<0?0:+c,i.length)===i)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))f="The ".concat(e," ").concat(a," ").concat(o(t,"type"));else{var d=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";f='The "'.concat(e,'" ').concat(d," ").concat(a," ").concat(o(t,"type"))}return f+=". Received type ".concat(n(r))}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=d;var a=r(207),i=r(211);r(4)(d,a);for(var o=n(i.prototype),c=0;c2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,i,c,f;if("string"==typeof t&&(i="not ",t.substr(!c||c<0?0:+c,i.length)===i)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))f="The ".concat(e," ").concat(a," ").concat(o(t,"type"));else{var d=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";f='The "'.concat(e,'" ').concat(d," ").concat(a," ").concat(o(t,"type"))}return f+=". Received type ".concat(n(r))}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=d;var a=r(214),i=r(218);r(4)(d,a);for(var o=n(i.prototype),c=0;c=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,a=(r-n)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},a.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=a},function(e,t,r){"use strict";(function(e){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(r(e)));return"0"===e[0]&&"x"===e[1]}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=n;function a(e){var t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(r(t)));return t.length%2&&(t="0".concat(t)),t}t.stripHexPrefix=function(e){if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(r(e)));return n(e)?e.slice(2):e},t.padToEven=a,t.getBinarySize=function(t){if("string"!=typeof t)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(r(t)));return e.byteLength(t,"utf8")},t.arrayContainsArray=function(e,t,n){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(r(e),"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(r(t),"'"));return t[n?"some":"every"]((function(t){return e.indexOf(t)>=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,i,c,f;if("string"==typeof t&&(i="not ",t.substr(!c||c<0?0:+c,i.length)===i)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))f="The ".concat(e," ").concat(a," ").concat(o(t,"type"));else{var d=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";f='The "'.concat(e,'" ').concat(d," ").concat(a," ").concat(o(t,"type"))}return f+=". Received type ".concat(n(r))}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=d;var a=r(263),i=r(267);r(4)(d,a);for(var o=n(i.prototype),c=0;c=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r0&&"0"===r.toString();)r=(e=e.slice(1))[0];return e},t.toBuffer=function(e){if(!p.isBuffer(e))if(Array.isArray(e))e=p.from(e);else if("string"==typeof e)e=t.isHexString(e)?p.from(t.padToEven(t.stripHexPrefix(e)),"hex"):p.from(e);else if("number"==typeof e)e=t.intToBuffer(e);else if(null==e)e=p.allocUnsafe(0);else if(h.isBN(e))e=e.toArrayLike(p);else{if(!e.toArray)throw new Error("invalid type");e=p.from(e.toArray())}return e},t.bufferToInt=function(e){return new h(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new h(e).fromTwos(256)},t.toUnsigned=function(e){return p.from(e.toTwos(256).toArray())},t.keccak=function(e,r){switch(e=t.toBuffer(e),r||(r=256),r){case 224:return o(e);case 256:return f(e);case 384:return c(e);case 512:return d(e);default:throw new Error("Invald algorithm: keccak"+r)}},t.keccak256=function(e){return t.keccak(e)},t.sha3=t.keccak,t.sha256=function(e){return e=t.toBuffer(e),l("sha256").update(e).digest()},t.ripemd160=function(e,r){e=t.toBuffer(e);var n=l("rmd160").update(e).digest();return!0===r?t.setLength(n,32):n},t.rlphash=function(e){return t.keccak(b.encode(e))},t.isValidPrivate=function(e){return s.privateKeyVerify(e)},t.isValidPublic=function(e,t){return 64===e.length?s.publicKeyVerify(p.concat([p.from([4]),e])):!!t&&s.publicKeyVerify(e)},t.pubToAddress=t.publicToAddress=function(e,r){return e=t.toBuffer(e),r&&64!==e.length&&(e=s.publicKeyConvert(e,!1).slice(1)),u(64===e.length),t.keccak(e).slice(-20)};var m=t.privateToPublic=function(e){return e=t.toBuffer(e),s.publicKeyCreate(e,!1).slice(1)};t.importPublic=function(e){return 64!==(e=t.toBuffer(e)).length&&(e=s.publicKeyConvert(e,!1).slice(1)),e},t.ecsign=function(e,t){var r=s.sign(e,t),n={};return n.r=r.signature.slice(0,32),n.s=r.signature.slice(32,64),n.v=r.recovery+27,n},t.hashPersonalMessage=function(e){var r=t.toBuffer("Ethereum Signed Message:\n"+e.length.toString());return t.keccak(p.concat([r,e]))},t.ecrecover=function(e,r,n,a){var i=p.concat([t.setLength(n,32),t.setLength(a,32)],64),o=r-27;if(0!==o&&1!==o)throw new Error("Invalid signature v value");var c=s.recover(e,i,o);return s.publicKeyConvert(c,!1).slice(1)},t.toRpcSig=function(e,r,n){if(27!==e&&28!==e)throw new Error("Invalid recovery id");return t.bufferToHex(p.concat([t.setLengthLeft(r,32),t.setLengthLeft(n,32),t.toBuffer(e-27)]))},t.fromRpcSig=function(e){if(65!==(e=t.toBuffer(e)).length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},t.privateToAddress=function(e){return t.publicToAddress(m(e))},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){return t.zeroAddress()===t.addHexPrefix(e)},t.toChecksumAddress=function(e){e=t.stripHexPrefix(e).toLowerCase();for(var r=t.keccak(e).toString("hex"),n="0x",a=0;a=8?n+=e[a].toUpperCase():n+=e[a];return n},t.isValidChecksumAddress=function(e){return t.isValidAddress(e)&&t.toChecksumAddress(e)===e},t.generateAddress=function(e,r){return e=t.toBuffer(e),r=(r=new h(r)).isZero()?null:p.from(r.toArray()),t.rlphash([e,r]).slice(-20)},t.isPrecompiled=function(e){var r=t.unpad(e);return 1===r.length&&r[0]>=1&&r[0]<=8},t.addHexPrefix=function(e){return"string"!=typeof e||t.isHexPrefixed(e)?e:"0x"+e},t.isValidSignature=function(e,t,r,n){var a=new h("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),i=new h("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===t.length&&32===r.length&&((27===e||28===e)&&(t=new h(t),r=new h(r),!(t.isZero()||t.gt(i)||r.isZero()||r.gt(i))&&(!1!==n||1!==new h(r).cmp(a))))},t.baToJSON=function(e){if(p.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],n=0;n=a.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===a.length||!r.length||u(r.length===a.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[n]=a}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:a,set:i}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:i,get:a})})),n)if("string"==typeof n&&(n=p.from(t.stripHexPrefix(n),"hex")),p.isBuffer(n)&&(n=b.decode(n)),Array.isArray(n)){if(n.length>e._fields.length)throw new Error("wrong number of fields in data");n.forEach((function(r,n){e[e._fields[n]]=t.toBuffer(r)}))}else{if("object"!==(void 0===n?"undefined":a(n)))throw new Error("invalid data");var i=Object.keys(n);r.forEach((function(t){-1!==i.indexOf(t.name)&&(e[t.name]=n[t.name]),-1!==i.indexOf(t.alias)&&(e[t.alias]=n[t.alias])}))}}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{f(n.next(e))}catch(e){i(e)}}function c(e){try{f(n.throw(e))}catch(e){i(e)}}function f(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}f((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.universalChainCb=t.getJCErc721Info=t.getAddressByName=t.getTypeByAddress=t.toHexChainId=t.formatPrice=t.parsePrice=t.UNKNOW=void 0;var o=r(47),c=r(808),f=r(24);t.UNKNOW="unknow",t.parsePrice=function(e,t){return e+new Array(19-t).join("0")},t.formatPrice=function(e,t,r){if(void 0===r&&(r=2),!t)return e;var n=e+"",a=n.length;if(n=n.padStart(t,"0"),t>=a)n="0."+n;else{var i=a-t;n=n.slice(0,i)+"."+n.slice(i)}return n=n.slice(0,n.lastIndexOf(".")+r+1)},t.toHexChainId=function(e){return"0x"+e.toString(16)},t.getTypeByAddress=function(e){var t,r,n=jc.wallet.currentChainCfg,a="erc721";if(n&&n.tokens)try{for(var o=i(n.tokens),c=o.next();!c.done;c=o.next()){var f=c.value;f.address.toLowerCase()===e.toLowerCase()&&(a=f.type)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return{type:a}},t.getAddressByName=function(e){var t=jc.wallet.currentChainCfg,r="";if(t&&t.tokens){var n=t.tokens.find((function(t){return t.name===e||t.symbol===e}));n&&(r=n.address)}return r},t.getJCErc721Info=function(e){return n(this,void 0,void 0,(function(){var t;return a(this,(function(r){return t=""+o.BASE_TOKEN_URI+e,[2,fetch(t).then((function(e){return e.json()}))]}))}))},t.universalChainCb=function(e,t){return t.on("presend",(function(t){if(jc.wallet.isInternal){console.log("before send tran: ",JSON.stringify(t));var r=void 0;!t.gasPrice&&t.maxPriorityFeePerGas&&t.maxFeePerGas?r=f.toBN(t.maxFeePerGas).sub(f.toBN(t.maxPriorityFeePerGas)).div(f.toBN(2)).mul(f.toBN(1e9)):t.gasPrice&&(r=f.toBN(t.gasPrice)),e.gas=f.toBN(t.gas).toString(),e.gasPrice=r.toString(),e.transactionHash=t.transactionHash,e.chain=jc.wallet.currentChain.id,e.startTime=Date.now(),(new c.LoggerQueue).addLog(e)}})).on("transactionHash",(function(e){console.log("remote transactionHash: "+e)})).on("confirmation",(function(t,r){console.log("confirmation:: confirmationNumber: "+t+" , receipt: "+r),jc.wallet.isInternal&&t>=o.TX_CONFIRM_BLOCKS&&(e.status=2,e.confirmTime=Date.now(),(new c.LoggerQueue).addLog(e))})).on("receipt",(function(t){return console.log(t),jc.wallet.isInternal&&(e.status=t.status?1:10,e.blockNumber=t.blockNumber,e.blockHash=t.blockHash,e.gas=t.gasUsed,(new c.LoggerQueue).addLog(e)),Promise.resolve(t)})).on("error",(function(t,r){return console.log(t),jc.wallet.isInternal&&(e.status=11,(new c.LoggerQueue).addLog(e)),Promise.reject(t)}))}},function(e,t,r){"use strict";(function(e){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(r(e)));return"0"===e[0]&&"x"===e[1]}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=n;function a(e){var t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(r(t)));return t.length%2&&(t="0".concat(t)),t}t.stripHexPrefix=function(e){if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(r(e)));return n(e)?e.slice(2):e},t.padToEven=a,t.getBinarySize=function(t){if("string"!=typeof t)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(r(t)));return e.byteLength(t,"utf8")},t.arrayContainsArray=function(e,t,n){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(r(e),"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(r(t),"'"));return t[n?"some":"every"]((function(t){return e.indexOf(t)>=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r>>7)^(l<<14|l>>>18)^l>>>3,m=d[h-2],x=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;d[h]=p+d[h-7]+x+d[h-16]}var y=n&a^n&i^a&i,v=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),g=b+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&s^~c&u)+f[h]+d[h];b=u,u=s,s=c,c=o+g|0,o=i,i=a,a=n,n=g+(v+y)|0}r[0]=r[0]+n|0,r[1]=r[1]+a|0,r[2]=r[2]+i|0,r[3]=r[3]+o|0,r[4]=r[4]+c|0,r[5]=r[5]+s|0,r[6]=r[6]+u|0,r[7]=r[7]+b|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,a=8*e.sigBytes;return r[a>>>5]|=128<<24-a%32,r[14+(a+64>>>9<<4)]=t.floor(n/4294967296),r[15+(a+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=i._createHelper(s),r.HmacSHA256=i._createHmacHelper(s)}(Math),e.SHA256},"object"===c(t)?e.exports=t=o(r(2)):(a=[r(2)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){var t,r,n;r=(t=e).lib.Base,n=t.enc.Utf8,t.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=n.parse(t));var r=e.blockSize,a=4*r;t.sigBytes>a&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),c=i.words,f=o.words,d=0;d=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var a=0;a>>24&255,n[a++]=e>>>16&255,n[a++]=e>>>8&255,n[a++]=255&e}else for(n[a++]=255&e,n[a++]=e>>>8&255,n[a++]=e>>>16&255,n[a++]=e>>>24&255,n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=0,i=8;i0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(t){if(!e.isBuffer(t))if(Array.isArray(t))t=e.from(t);else if("string"==typeof t){if(!n.isHexString(t))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+t);t=e.from(n.padToEven(n.stripHexPrefix(t)),"hex")}else if("number"==typeof t)t=n.intToBuffer(t);else if(null==t)t=e.allocUnsafe(0);else if(a.isBN(t))t=t.toArrayLike(e);else{if(!t.toArray)throw new Error("invalid type");t=e.from(t.toArray())}return t},t.bufferToInt=function(e){return new a(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new a(e).fromTwos(256)},t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||n.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(r){if(e.isBuffer(r))return"0x"+r.toString("hex");if(r instanceof Array){for(var n=[],a=0;a0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(t){if(!e.isBuffer(t))if(Array.isArray(t))t=e.from(t);else if("string"==typeof t){if(!n.isHexString(t))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+t);t=e.from(n.padToEven(n.stripHexPrefix(t)),"hex")}else if("number"==typeof t)t=n.intToBuffer(t);else if(null==t)t=e.allocUnsafe(0);else if(a.isBN(t))t=t.toArrayLike(e);else{if(!t.toArray)throw new Error("invalid type");t=e.from(t.toArray())}return t},t.bufferToInt=function(e){return new a(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new a(e).fromTwos(256)},t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||n.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(r){if(e.isBuffer(r))return"0x"+r.toString("hex");if(r instanceof Array){for(var n=[],a=0;a",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(s),b=["%","/","?",";","#"].concat(u),h=["/","?","#"],l=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},x={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=r(479);function g(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+n(e));var o=e.indexOf("?"),f=-1!==o&&o127?C+="x":C+=R[I];if(!C.match(l)){var N=j.slice(0,T),U=j.slice(T+1),z=R.match(p);z&&(N.push(z[1]),U.unshift(z[2])),U.length&&(g="/"+U.join(".")+g),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=a.toASCII(this.hostname));var F=this.port?":"+this.port:"",q=this.hostname||"";this.host=q+F,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==g[0]&&(g="/"+g))}if(!m[M])for(T=0,B=u.length;T0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift());return r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!M.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var S=M.slice(-1)[0],A=(r.host||e.host||M.length>1)&&("."===S||".."===S)||""===S,E=0,T=M.length;T>=0;T--)"."===(S=M[T])?M.splice(T,1):".."===S?(M.splice(T,1),E++):E&&(M.splice(T,1),E--);if(!w&&!_)for(;E--;E)M.unshift("..");!w||""===M[0]||M[0]&&"/"===M[0].charAt(0)||M.unshift(""),A&&"/"!==M.join("/").substr(-1)&&M.push("");var O,P=""===M[0]||M[0]&&"/"===M[0].charAt(0);k&&(r.hostname=r.host=P?"":M.length?M.shift():"",(O=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift()));return(w=w||r.host&&M.length)&&!P&&M.unshift(""),M.length?r.pathname=M.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=f.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t){e.exports=function(){for(var e={},t=0;t0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(t){if(!e.isBuffer(t))if(Array.isArray(t))t=e.from(t);else if("string"==typeof t){if(!n.isHexString(t))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+t);t=e.from(n.padToEven(n.stripHexPrefix(t)),"hex")}else if("number"==typeof t)t=n.intToBuffer(t);else if(null==t)t=e.allocUnsafe(0);else if(a.isBN(t))t=t.toArrayLike(e);else{if(!t.toArray)throw new Error("invalid type");t=e.from(t.toArray())}return t},t.bufferToInt=function(e){return new a(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new a(e).fromTwos(256)},t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||n.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(r){if(e.isBuffer(r))return"0x"+r.toString("hex");if(r instanceof Array){for(var n=[],a=0;a0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.numberToBN=t.toWeiBn=t.stripHexPrefix=t.fastSplit=t.safeNumberToBN=t.addHexPrefix=t.toBN=t.isDecimal=t.calcTokenValueToSend=t.renderFromWei=t.fromTokenMinimalUnit=t.renderFromTokenMinimalUnit=void 0;var o=i(r(226)),c=r(75);function f(e,t){var r=s(e=d(Number(e).toString(16))),n=r.lt(new c.BN(0)),a=o.default.utils.toBN(Math.pow(10,t).toString());n&&(r=r.mul(new c.BN(-1)));for(var i=r.mod(a).toString(10);i.length0)n="< 0.00001";else{var o=Math.pow(10,r);n=(Math.round(i*o)/o).toString()}return n},t.fromTokenMinimalUnit=f,t.renderFromWei=function(e,t){void 0===t&&(t=5);var r="0";if(e){var n=o.default.utils.fromWei(e),a=parseFloat(n);if(a<1e-5&&a>0)r="< 0.00001";else{var i=Math.pow(10,t);r=(Math.round(a*i)/i).toString()}}return r},t.calcTokenValueToSend=function(e,t){return e?(e*Math.pow(10,t)).toString(16):0},t.isDecimal=function(e){return Number.isFinite(parseFloat(e))&&!Number.isNaN(parseFloat(e))&&!isNaN(+e)},t.toBN=function(e){return o.default.utils.toBN(e)},t.addHexPrefix=d,t.safeNumberToBN=s,t.fastSplit=u,t.stripHexPrefix=b,t.toWeiBn=function(e,t){var r=o.default.utils.toBN(o.default.utils.toWei(e+""));return t>18?r=r.mul(o.default.utils.toBN(10).pow(o.default.utils.toBN(t-18))):t<18&&(r=r.div(o.default.utils.toBN(10).pow(o.default.utils.toBN(18-t)))),r},t.numberToBN=h},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),a(r(707),t),a(r(708),t)},function(e,t,r){(function(e,n,a){var i;function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)} + */function i(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,a=0,i=Math.min(r,n);a=0;f--)if(s[f]!==u[f])return!1;for(f=s.length-1;f>=0;f--)if(o=s[f],!g(e[o],t[o],r,n))return!1;return!0}(e,t,r,a))}return r?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function _(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function M(e,t,r,n){var a;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),a=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!a&&y(a,r,"Missing expected exception"+n);var i="string"==typeof n,o=!e&&a&&!r;if((!e&&c.isError(a)&&i&&_(a,r)||o)&&y(a,r,"Got unwanted exception"+n),e&&a&&r&&!_(a,r)||!e&&a)throw a}h.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return m(x(e.actual),128)+" "+e.operator+" "+m(x(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,a=p(t),i=n.indexOf("\n"+a);if(i>=0){var o=n.indexOf("\n",i+1);n=n.substring(o+1)}this.stack=n}}},c.inherits(h.AssertionError,Error),h.fail=y,h.ok=v,h.equal=function(e,t,r){e!=t&&y(e,t,r,"==",h.equal)},h.notEqual=function(e,t,r){e==t&&y(e,t,r,"!=",h.notEqual)},h.deepEqual=function(e,t,r){g(e,t,!1)||y(e,t,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,r){g(e,t,!0)||y(e,t,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,r){g(e,t,!1)&&y(e,t,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,r,n){g(t,r,!0)&&y(t,r,n,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,r){e!==t&&y(e,t,r,"===",h.strictEqual)},h.notStrictEqual=function(e,t,r){e===t&&y(e,t,r,"!==",h.notStrictEqual)},h.throws=function(e,t,r){M(!0,e,t,r)},h.doesNotThrow=function(e,t,r){M(!1,e,t,r)},h.ifError=function(e){if(e)throw e},h.strict=a((function e(t,r){t||y(t,!0,r,"==",e)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var k=Object.keys||function(e){var t=[];for(var r in e)f.call(e,r)&&t.push(r);return t}}).call(this,r(13))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";var n=r(459),a=r(460);e.exports={errors:n,formatters:a}},function(e,t,r){"use strict";var n;function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"b",(function(){return i})),r.d(t,"d",(function(){return o})),r.d(t,"c",(function(){return c})),r.d(t,"e",(function(){return f})),r.d(t,"f",(function(){return d})),r.d(t,"a",(function(){return s}));var i="INTERNAL_ERROR",o="SERVER_ERROR",c=[-32700,-32600,-32601,-32602,-32603],f=[-32e3,-32099],d=(a(n={},"PARSE_ERROR",{code:-32700,message:"Parse error"}),a(n,"INVALID_REQUEST",{code:-32600,message:"Invalid Request"}),a(n,"METHOD_NOT_FOUND",{code:-32601,message:"Method not found"}),a(n,"INVALID_PARAMS",{code:-32602,message:"Invalid params"}),a(n,i,{code:-32603,message:"Internal error"}),a(n,o,{code:-32e3,message:"Server error"}),n),s=o},function(e,t,r){"use strict";(function(t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=r(204),i=r(205);function o(e){var t=e;if("string"!=typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+n(t)+", while padToEven.");return t.length%2&&(t="0"+t),t}function c(e){return"0x"+e.toString(16)}e.exports={arrayContainsArray:function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+n(e)+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+n(t)+"'");return t[Boolean(r)?"some":"every"]((function(t){return e.indexOf(t)>=0}))},intToBuffer:function(e){var r=c(e);return new t(o(r.slice(2)),"hex")},getBinarySize:function(e){if("string"!=typeof e)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+n(e)+"'.");return t.byteLength(e,"utf8")},isHexPrefixed:a,stripHexPrefix:i,padToEven:o,intToHex:c,fromAscii:function(e){for(var t="",r=0;rr.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(c=r.slice(a,u)).length)throw new Error("invalid rlp, List has a invalid length");for(;c.length;)f=t(c),d.push(f.data),c=f.remainder;return{data:d,remainder:r.slice(u)}}(d(t));if(r)return n;if(0!==n.remainder.length)throw new Error("invalid remainder");return n.data},t.getLength=function(t){if(!t||0===t.length)return e.from([]);var r=d(t),n=r[0];if(n<=127)return r.length;if(n<=183)return n-127;if(n<=191)return n-182;if(n<=247)return n-191;var a=n-246;return a+i(r.slice(1,a).toString("hex"),16)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{f(n.next(e))}catch(e){i(e)}}function c(e){try{f(n.throw(e))}catch(e){i(e)}}function f(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}f((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]0&&o.length>a&&!o.warned){o.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=o.length,c=f,console&&console.warn&&console.warn(c)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},a=h.bind(n);return a.listener=r,n.wrapFn=a,a}function p(e,t,r){var n=e._events;if(void 0===n)return[];var a=n[t];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(i=t[0]),i instanceof Error)throw i;var c=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw c.context=i,c}var f=a[e];if(void 0===f)return!1;if("function"==typeof f)o(f,this,t);else{var d=f.length,s=x(f,d);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){o=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},f.prototype.listeners=function(e){return p(this,e,!0)},f.prototype.rawListeners=function(e){return p(this,e,!1)},f.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},f.prototype.listenerCount=m,f.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=r(461),i=r(228),o=r(471),c=r(32),f=r(106),d=function e(t,r){var a=[];return r.forEach((function(r){if("object"===n(r.components)){if("tuple"!==r.type.substring(0,5))throw new Error("components found but type is not tuple; report on GitHub");var i="",o=r.type.indexOf("[");o>=0&&(i=r.type.substring(o));var c=e(t,r.components);Array.isArray(c)&&t?a.push("tuple("+c.join(",")+")"+i):t?a.push("("+c+")"):a.push("("+c.join(",")+")"+i)}else a.push(r.type)})),a},s=function(e){if(!i.isHexStrict(e))throw new Error("The parameter must be a valid HEX string.");var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r7?r+=e[n].toUpperCase():r+=e[n];return r},toHex:i.toHex,toBN:i.toBN,bytesToHex:i.bytesToHex,hexToBytes:i.hexToBytes,hexToNumberString:i.hexToNumberString,hexToNumber:i.hexToNumber,toDecimal:i.hexToNumber,numberToHex:i.numberToHex,fromDecimal:i.numberToHex,hexToUtf8:i.hexToUtf8,hexToString:i.hexToUtf8,toUtf8:i.hexToUtf8,stripHexPrefix:i.stripHexPrefix,utf8ToHex:i.utf8ToHex,stringToHex:i.utf8ToHex,fromUtf8:i.utf8ToHex,hexToAscii:s,toAscii:s,asciiToHex:u,fromAscii:u,unitMap:a.unitMap,toWei:function(e,t){if(t=b(t),!i.isBN(e)&&"string"!=typeof e)throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return i.isBN(e)?a.toWei(e,t):a.toWei(e,t).toString(10)},fromWei:function(e,t){if(t=b(t),!i.isBN(e)&&"string"!=typeof e)throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return i.isBN(e)?a.fromWei(e,t):a.fromWei(e,t).toString(10)},padLeft:i.leftPad,leftPad:i.leftPad,padRight:i.rightPad,rightPad:i.rightPad,toTwosComplement:i.toTwosComplement,isBloom:i.isBloom,isUserEthereumAddressInBloom:i.isUserEthereumAddressInBloom,isContractAddressInBloom:i.isContractAddressInBloom,isTopic:i.isTopic,isTopicInBloom:i.isTopicInBloom,isInBloom:i.isInBloom,compareBlockNumbers:function(e,t){if(e==t)return 0;if("genesis"!=e&&"earliest"!=e&&0!=e||"genesis"!=t&&"earliest"!=t&&0!=t){if("genesis"==e||"earliest"==e)return-1;if("genesis"==t||"earliest"==t)return 1;if("latest"==e)return"pending"==t?-1:1;if("latest"===t)return"pending"==e?1:-1;if("pending"==e)return 1;if("pending"==t)return-1;var r=new f(e),n=new f(t);return r.lt(n)?-1:r.eq(n)?0:1}return 0},toNumber:i.toNumber}},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){var t,r,n,a,i,o,c;return r=(t=e).lib,n=r.Base,a=r.WordArray,i=t.algo,o=i.MD5,c=i.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,n=this.cfg,i=n.hasher.create(),o=a.create(),c=o.words,f=n.keySize,d=n.iterations;c.length>>24)|4278255360&(a<<24|a>>>8)}var i=this._hash.words,o=e[t+0],f=e[t+1],h=e[t+2],l=e[t+3],p=e[t+4],m=e[t+5],x=e[t+6],y=e[t+7],v=e[t+8],g=e[t+9],w=e[t+10],_=e[t+11],M=e[t+12],k=e[t+13],S=e[t+14],A=e[t+15],E=i[0],T=i[1],O=i[2],P=i[3];E=d(E,T,O,P,o,7,c[0]),P=d(P,E,T,O,f,12,c[1]),O=d(O,P,E,T,h,17,c[2]),T=d(T,O,P,E,l,22,c[3]),E=d(E,T,O,P,p,7,c[4]),P=d(P,E,T,O,m,12,c[5]),O=d(O,P,E,T,x,17,c[6]),T=d(T,O,P,E,y,22,c[7]),E=d(E,T,O,P,v,7,c[8]),P=d(P,E,T,O,g,12,c[9]),O=d(O,P,E,T,w,17,c[10]),T=d(T,O,P,E,_,22,c[11]),E=d(E,T,O,P,M,7,c[12]),P=d(P,E,T,O,k,12,c[13]),O=d(O,P,E,T,S,17,c[14]),E=s(E,T=d(T,O,P,E,A,22,c[15]),O,P,f,5,c[16]),P=s(P,E,T,O,x,9,c[17]),O=s(O,P,E,T,_,14,c[18]),T=s(T,O,P,E,o,20,c[19]),E=s(E,T,O,P,m,5,c[20]),P=s(P,E,T,O,w,9,c[21]),O=s(O,P,E,T,A,14,c[22]),T=s(T,O,P,E,p,20,c[23]),E=s(E,T,O,P,g,5,c[24]),P=s(P,E,T,O,S,9,c[25]),O=s(O,P,E,T,l,14,c[26]),T=s(T,O,P,E,v,20,c[27]),E=s(E,T,O,P,k,5,c[28]),P=s(P,E,T,O,h,9,c[29]),O=s(O,P,E,T,y,14,c[30]),E=u(E,T=s(T,O,P,E,M,20,c[31]),O,P,m,4,c[32]),P=u(P,E,T,O,v,11,c[33]),O=u(O,P,E,T,_,16,c[34]),T=u(T,O,P,E,S,23,c[35]),E=u(E,T,O,P,f,4,c[36]),P=u(P,E,T,O,p,11,c[37]),O=u(O,P,E,T,y,16,c[38]),T=u(T,O,P,E,w,23,c[39]),E=u(E,T,O,P,k,4,c[40]),P=u(P,E,T,O,o,11,c[41]),O=u(O,P,E,T,l,16,c[42]),T=u(T,O,P,E,x,23,c[43]),E=u(E,T,O,P,g,4,c[44]),P=u(P,E,T,O,M,11,c[45]),O=u(O,P,E,T,A,16,c[46]),E=b(E,T=u(T,O,P,E,h,23,c[47]),O,P,o,6,c[48]),P=b(P,E,T,O,y,10,c[49]),O=b(O,P,E,T,S,15,c[50]),T=b(T,O,P,E,m,21,c[51]),E=b(E,T,O,P,M,6,c[52]),P=b(P,E,T,O,l,10,c[53]),O=b(O,P,E,T,w,15,c[54]),T=b(T,O,P,E,f,21,c[55]),E=b(E,T,O,P,v,6,c[56]),P=b(P,E,T,O,A,10,c[57]),O=b(O,P,E,T,x,15,c[58]),T=b(T,O,P,E,k,21,c[59]),E=b(E,T,O,P,p,6,c[60]),P=b(P,E,T,O,_,10,c[61]),O=b(O,P,E,T,h,15,c[62]),T=b(T,O,P,E,g,21,c[63]),i[0]=i[0]+E|0,i[1]=i[1]+T|0,i[2]=i[2]+O|0,i[3]=i[3]+P|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,a=8*e.sigBytes;r[a>>>5]|=128<<24-a%32;var i=t.floor(n/4294967296),o=n;r[15+(a+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),r[14+(a+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(r.length+1),this._process();for(var c=this._hash,f=c.words,d=0;d<4;d++){var s=f[d];f[d]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return c},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function d(e,t,r,n,a,i,o){var c=e+(t&r|~t&n)+a+o;return(c<>>32-i)+t}function s(e,t,r,n,a,i,o){var c=e+(t&n|r&~n)+a+o;return(c<>>32-i)+t}function u(e,t,r,n,a,i,o){var c=e+(t^r^n)+a+o;return(c<>>32-i)+t}function b(e,t,r,n,a,i,o){var c=e+(r^(t|~n))+a+o;return(c<>>32-i)+t}r.MD5=i._createHelper(f),r.HmacMD5=i._createHmacHelper(f)}(Math),e.MD5},"object"===c(t)?e.exports=t=o(r(2)):(a=[r(2)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){"use strict";var n=t,a=r(9),i=r(30),o=r(199);n.assert=i,n.toArray=o.toArray,n.zero2=o.zero2,n.toHex=o.toHex,n.encode=o.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var a=1<(a>>1)-1?(a>>1)-f:f,i.isubn(c)):c=0,n[o]=c,i.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,a=0,i=0;e.cmpn(-a)>0||t.cmpn(-i)>0;){var o,c,f=e.andln(3)+a&3,d=t.andln(3)+i&3;3===f&&(f=-1),3===d&&(d=-1),o=0==(1&f)?0:3!==(n=e.andln(7)+a&7)&&5!==n||2!==d?f:-f,r[0].push(o),c=0==(1&d)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==f?d:-d,r[1].push(c),2*a===o+1&&(a=1-a),2*i===c+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new a(e,"hex","le")}},function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){var t,r;return r=(t=e).lib.WordArray,t.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var a=[],i=0;i>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,c=0;c<4&&i+.75*c>>6*(3-c)&63));var f=n.charAt(64);if(f)for(;a.length%4;)a.push(f);return a.join("")},parse:function(e){var t=e.length,n=this._map,a=this._reverseMap;if(!a){a=this._reverseMap=[];for(var i=0;i>>6-o%4*2,d=c|f;a[i>>>2]|=d<<24-i%4*8,i++}return r.create(a,i)}(e,t,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"===c(t)?e.exports=t=o(r(2)):(a=[r(2)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){"use strict";(function(t,n){var a=r(6).Buffer,i=t.crypto||t.msCrypto;function o(e){for(var t=0,r=e.length;t4294967295)throw new RangeError("requested too many random bytes");var r=a.allocUnsafe(e);if(e>0)if(e>65536)for(var o=0;o4294967295)throw new RangeError("requested too many random bytes");var r=a.allocUnsafe(e);if(e>0)if(e>65536)for(var i=0;i>1]>>4>=8&&(t[f]=t[f].toUpperCase()),(15&c[f>>1])>=8&&(t[f+1]=t[f+1].toUpperCase());return"0x"+t.join("")}for(var f={},d=0;d<10;d++)f[String(d)]=String(d);for(var s=0;s<26;s++)f[String.fromCharCode(65+s)]=String(10+s);var u,b=Math.floor((u=9007199254740991,Math.log10?Math.log10(u):Math.log(u)/Math.LN10));function h(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return f[e]})).join("");t.length>=b;){var r=t.substring(0,b);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function l(e){var t=null;if("string"!=typeof e&&o.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=c(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&o.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==h(e)&&o.throwArgumentError("bad icap checksum","address",e),t=Object(a.c)(e.substring(4));t.length<40;)t="0"+t;t=c("0x"+t)}else o.throwArgumentError("invalid address","address",e);return t}},function(e,t,r){"use strict";r.d(t,"b",(function(){return f})),r.d(t,"a",(function(){return u}));var n=r(1),a=r(3),i=new a.a("rlp/5.6.1");function o(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function c(e,t,r){for(var n=0,a=0;at+1+n&&i.throwError("child data too short",a.a.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:o}}function s(e,t){if(0===e.length&&i.throwError("data too short",a.a.errors.BUFFER_OVERRUN,{}),e[t]>=248){var r=e[t]-247;t+1+r>e.length&&i.throwError("data short segment too short",a.a.errors.BUFFER_OVERRUN,{});var o=c(e,t+1,r);return t+1+r+o>e.length&&i.throwError("data long segment too short",a.a.errors.BUFFER_OVERRUN,{}),d(e,t,t+1+r,r+o)}if(e[t]>=192){var f=e[t]-192;return t+1+f>e.length&&i.throwError("data array too short",a.a.errors.BUFFER_OVERRUN,{}),d(e,t,t+1,f)}if(e[t]>=184){var s=e[t]-183;t+1+s>e.length&&i.throwError("data array too short",a.a.errors.BUFFER_OVERRUN,{});var u=c(e,t+1,s);return t+1+s+u>e.length&&i.throwError("data array too short",a.a.errors.BUFFER_OVERRUN,{}),{consumed:1+s+u,result:Object(n.g)(e.slice(t+1+s,t+1+s+u))}}if(e[t]>=128){var b=e[t]-128;return t+1+b>e.length&&i.throwError("data too short",a.a.errors.BUFFER_OVERRUN,{}),{consumed:1+b,result:Object(n.g)(e.slice(t+1,t+1+b))}}return{consumed:1,result:Object(n.g)(e[t])}}function u(e){var t=Object(n.a)(e),r=s(t,0);return r.consumed!==t.length&&i.throwArgumentError("invalid rlp data","data",e),r.result}},function(e,t,r){"use strict";var n=r(30),a=r(4);function i(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function c(e){return 1===e.length?"0"+e:e}function f(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=a,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),a=0;a>6|192,r[n++]=63&o|128):i(e,a)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++a)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(a=0;a>>0}return o},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,a=0;n>>24,r[a+1]=i>>>16&255,r[a+2]=i>>>8&255,r[a+3]=255&i):(r[a+3]=i>>>24,r[a+2]=i>>>16&255,r[a+1]=i>>>8&255,r[a]=255&i)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,a){return e+t+r+n+a>>>0},t.sum64=function(e,t,r,n){var a=e[t],i=n+e[t+1]>>>0,o=(i>>0,e[t+1]=i},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,a,i,o,c){var f=0,d=t;return f+=(d=d+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,a,i,o,c){return t+n+i+c>>>0},t.sum64_5_hi=function(e,t,r,n,a,i,o,c,f,d){var s=0,u=t;return s+=(u=u+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,a,i,o,c,f,d){return t+n+i+c+d>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t,r){"use strict";var n=t;n.version=r(377).version,n.utils=r(29),n.rand=r(127),n.curve=r(200),n.curves=r(128),n.ec=r(389),n.eddsa=r(393)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(132),a=r(405);t.keccak224=n.createHashFunction((function(){return a("keccak224")})),t.keccak256=n.createHashFunction((function(){return a("keccak256")})),t.keccak384=n.createHashFunction((function(){return a("keccak384")})),t.keccak512=n.createHashFunction((function(){return a("keccak512")}))},function(e,t,r){"use strict";var n=r(6).Buffer,a=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===a||!a(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=f,this.end=d,t=4;break;case"utf8":this.fillLast=c,t=4;break;case"base64":this.text=s,this.end=u,t=3;break;default:return this.write=b,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function c(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function f(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function d(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function s(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function b(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return a>0&&(e.lastNeed=a-1),a;if(--n=0)return a>0&&(e.lastNeed=a-2),a;if(--n=0)return a>0&&(2===a?a=0:e.lastNeed=a-3),a;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(106));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(603));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(610));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(673));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(813));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){(function(e){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),c=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=d),u(n,e,n.depth)}function d(e,t){var r=f.styles[t];return r?"["+f.colors[r][0]+"m"+e+"["+f.colors[r][1]+"m":e}function s(e,t){return e}function u(e,r,n){if(e.customInspect&&r&&k(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var a=r.inspect(n,e);return y(a)||(a=u(e,a,n)),a}var i=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(y(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(x(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,r);if(i)return i;var o=Object.keys(r),c=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),M(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return b(r);if(0===o.length){if(k(r)){var f=r.name?": "+r.name:"";return e.stylize("[Function"+f+"]","special")}if(g(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(M(r))return b(r)}var d,s="",w=!1,S=["{","}"];(l(r)&&(w=!0,S=["[","]"]),k(r))&&(s=" [Function"+(r.name?": "+r.name:"")+"]");return g(r)&&(s=" "+RegExp.prototype.toString.call(r)),_(r)&&(s=" "+Date.prototype.toUTCString.call(r)),M(r)&&(s=" "+b(r)),0!==o.length||w&&0!=r.length?n<0?g(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),d=w?function(e,t,r,n,a){for(var i=[],o=0,c=t.length;o=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(d,s,S)):S[0]+s+S[1]}function b(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,a,i){var o,c,f;if((f=Object.getOwnPropertyDescriptor(t,a)||{value:t[a]}).get?c=f.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):f.set&&(c=e.stylize("[Setter]","special")),O(n,a)||(o="["+a+"]"),c||(e.seen.indexOf(f.value)<0?(c=m(r)?u(e,f.value,null):u(e,f.value,r-1)).indexOf("\n")>-1&&(c=i?c.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+c.split("\n").map((function(e){return" "+e})).join("\n")):c=e.stylize("[Circular]","special")),v(o)){if(i&&a.match(/^\d+$/))return c;(o=JSON.stringify(""+a)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+c}function l(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function m(e){return null===e}function x(e){return"number"==typeof e}function y(e){return"string"==typeof e}function v(e){return void 0===e}function g(e){return w(e)&&"[object RegExp]"===S(e)}function w(e){return"object"===n(e)&&null!==e}function _(e){return w(e)&&"[object Date]"===S(e)}function M(e){return w(e)&&("[object Error]"===S(e)||e instanceof Error)}function k(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(v(o)&&(o=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!c[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var n=e.pid;c[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,n,e)}}else c[r]=function(){};return c[r]},t.inspect=f,f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=l,t.isBoolean=p,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=x,t.isString=y,t.isSymbol=function(e){return"symbol"===n(e)},t.isUndefined=v,t.isRegExp=g,t.isObject=w,t.isDate=_,t.isError=M,t.isFunction=k,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===n(e)||void 0===e},t.isBuffer=r(403);var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var e=new Date,t=[A(e.getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":");return[e.getDate(),E[e.getMonth()],t].join(" ")}function O(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",T(),t.format.apply(t,arguments))},t.inherits=r(404),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var P="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function j(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(P&&e[P]){var t;if("function"!=typeof(t=e[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),a=[],i=0;i=9007199254740991||t<=-9007199254740991)&&m("overflow","BigNumber.from",t),e.from(String(t));var r=t;if("bigint"==typeof r)return e.from(r.toString());if(Object(i.h)(r))return e.from(Object(i.g)(r));if(r)if(r.toHexString){var n=r.toHexString();if("string"==typeof n)return e.from(n)}else{var a=r._hex;if(null==a&&"BigNumber"===r.type&&(a=r.hex),"string"==typeof a&&(Object(i.j)(a)||"-"===a[0]&&Object(i.j)(a.substring(1))))return e.from(a)}return d.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}],(r=[{key:"fromTwos",value:function(e){return l(p(this).fromTwos(e))}},{key:"toTwos",value:function(e){return l(p(this).toTwos(e))}},{key:"abs",value:function(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}},{key:"add",value:function(e){return l(p(this).add(p(e)))}},{key:"sub",value:function(e){return l(p(this).sub(p(e)))}},{key:"div",value:function(t){return e.from(t).isZero()&&m("division-by-zero","div"),l(p(this).div(p(t)))}},{key:"mul",value:function(e){return l(p(this).mul(p(e)))}},{key:"mod",value:function(e){var t=p(e);return t.isNeg()&&m("division-by-zero","mod"),l(p(this).umod(t))}},{key:"pow",value:function(e){var t=p(e);return t.isNeg()&&m("negative-power","pow"),l(p(this).pow(t))}},{key:"and",value:function(e){var t=p(e);return(this.isNegative()||t.isNeg())&&m("unbound-bitwise-result","and"),l(p(this).and(t))}},{key:"or",value:function(e){var t=p(e);return(this.isNegative()||t.isNeg())&&m("unbound-bitwise-result","or"),l(p(this).or(t))}},{key:"xor",value:function(e){var t=p(e);return(this.isNegative()||t.isNeg())&&m("unbound-bitwise-result","xor"),l(p(this).xor(t))}},{key:"mask",value:function(e){return(this.isNegative()||e<0)&&m("negative-width","mask"),l(p(this).maskn(e))}},{key:"shl",value:function(e){return(this.isNegative()||e<0)&&m("negative-width","shl"),l(p(this).shln(e))}},{key:"shr",value:function(e){return(this.isNegative()||e<0)&&m("negative-width","shr"),l(p(this).shrn(e))}},{key:"eq",value:function(e){return p(this).eq(p(e))}},{key:"lt",value:function(e){return p(this).lt(p(e))}},{key:"lte",value:function(e){return p(this).lte(p(e))}},{key:"gt",value:function(e){return p(this).gt(p(e))}},{key:"gte",value:function(e){return p(this).gte(p(e))}},{key:"isNegative",value:function(){return"-"===this._hex[0]}},{key:"isZero",value:function(){return p(this).isZero()}},{key:"toNumber",value:function(){try{return p(this).toNumber()}catch(e){m("overflow","toNumber",this.toString())}return null}},{key:"toBigInt",value:function(){try{return BigInt(this.toString())}catch(e){}return d.throwError("this platform does not support BigInt",o.a.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}},{key:"toString",value:function(){return arguments.length>0&&(10===arguments[0]?u||(u=!0,d.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?d.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",o.a.errors.UNEXPECTED_ARGUMENT,{}):d.throwError("BigNumber.toString does not accept parameters",o.a.errors.UNEXPECTED_ARGUMENT,{})),p(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(e){return{type:"BigNumber",hex:this.toHexString()}}}])&&c(t.prototype,r),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function h(e){if("string"!=typeof e)return h(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&d.throwArgumentError("invalid hex","value",e),"0x00"===(e=h(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function l(e){return b.from(h(e))}function p(e){var t=b.from(e).toHexString();return"-"===t[0]?new f("-"+t.substring(3),16):new f(t.substring(2),16)}function m(e,t,r){var n={fault:e,operation:t};return null!=r&&(n.value=r),d.throwError(e,o.a.errors.NUMERIC_FAULT,n)}function x(e){return new f(e,36).toString(16)}function y(e){return new f(e,16).toString(36)}},function(e,t,r){"use strict";var n=r(103),a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var i=Object.create(r(83));i.inherits=r(4);var o=r(222),c=r(139);i.inherits(u,o);for(var f=a(c.prototype),d=0;d=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(39),o=r(68),c=r(107);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,a,i=[],o=!0,c=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);o=!0);}catch(e){c=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(c)throw a}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),f=r.call(i,"finallyLoc");if(c&&f){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;k(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),b}},e}function d(e,t,r,n,a,i,o){try{var c=e[i](o),f=c.value}catch(e){return void r(e)}c.done?t(f):Promise.resolve(f).then(n,a)}function s(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){d(i,n,a,o,c,"next",e)}function c(e){d(i,n,a,o,c,"throw",e)}o(void 0)}))}}function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var b=r(16).errors,h=r(16).formatters,l=r(24),p=r(108),m=r(109).subscriptions,x=r(872),y=function(e){if(!e.call||!e.name)throw new Error('When creating a method you need to provide at least the "name" and "call" property.');this.name=e.name,this.call=e.call,this.params=e.params||0,this.inputFormatter=e.inputFormatter,this.outputFormatter=e.outputFormatter,this.transformPayload=e.transformPayload,this.extraFormatters=e.extraFormatters,this.abiCoder=e.abiCoder,this.requestManager=e.requestManager,this.accounts=e.accounts,this.defaultBlock=e.defaultBlock||"latest",this.defaultAccount=e.defaultAccount||null,this.transactionBlockTimeout=e.transactionBlockTimeout||50,this.transactionConfirmationBlocks=e.transactionConfirmationBlocks||24,this.transactionPollingTimeout=e.transactionPollingTimeout||750,this.transactionPollingInterval=e.transactionPollingInterval||1e3,this.blockHeaderTimeout=e.blockHeaderTimeout||10,this.defaultCommon=e.defaultCommon,this.defaultChain=e.defaultChain,this.defaultHardfork=e.defaultHardfork,this.handleRevert=e.handleRevert};y.prototype.setRequestManager=function(e,t){this.requestManager=e,t&&(this.accounts=t)},y.prototype.createFunction=function(e,t){var r=this.buildCall();return Object.defineProperty(r,"call",{configurable:!0,writable:!0,value:this.call}),this.setRequestManager(e||this.requestManager,t||this.accounts),r},y.prototype.attachToObject=function(e){var t=this.buildCall();Object.defineProperty(t,"call",{configurable:!0,writable:!0,value:this.call});var r=this.name.split(".");r.length>1?(e[r[0]]=e[r[0]]||{},e[r[0]][r[1]]=t):e[r[0]]=t},y.prototype.getCall=function(e){return"function"==typeof this.call?this.call(e):this.call},y.prototype.extractCallback=function(e){if("function"==typeof e[e.length-1])return e.pop()},y.prototype.validateArgs=function(e){if(e.length!==this.params)throw b.InvalidNumberOfParams(e.length,this.params,this.name)},y.prototype.formatInput=function(e){var t=this;return this.inputFormatter?this.inputFormatter.map((function(r,n){return r?r.call(t,e[n]):e[n]})):e},y.prototype.formatOutput=function(e){var t=this;return Array.isArray(e)?e.map((function(e){return t.outputFormatter&&e?t.outputFormatter(e):e})):this.outputFormatter&&e?this.outputFormatter(e):e},y.prototype.toPayload=function(e){var t=this.getCall(e),r=this.extractCallback(e),n=this.formatInput(e);this.validateArgs(n);var a={method:t,params:n,callback:r};return this.transformPayload&&(a=this.transformPayload(a)),a},y.prototype._confirmTransaction=function(e,t,r){var n=this,a=!1,i=!0,o=0,c=0,d=null,v=null,g=null,w=r.params[0]&&"object"===u(r.params[0])&&r.params[0].gas?r.params[0].gas:null,_=!!r.params[0]&&"object"===u(r.params[0])&&r.params[0].data&&r.params[0].from&&!r.params[0].to,M=_&&r.params[0].data.length>2,k=[new y({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[h.inputBlockNumberFormatter,function(e){return!!e}],outputFormatter:h.outputBlockFormatter}),new y({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:h.outputTransactionReceiptFormatter}),new y({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[h.inputAddressFormatter,h.inputDefaultBlockNumberFormatter]}),new y({name:"getTransactionByHash",call:"eth_getTransactionByHash",params:1,inputFormatter:[null],outputFormatter:h.outputTransactionFormatter}),new m({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:h.outputBlockFormatter}}})],S={};k.forEach((function(e){e.attachToObject(S),e.requestManager=n.requestManager}));var A=function(u,m,y,k,A){if(!y)return A||(A={unsubscribe:function(){clearInterval(d),clearTimeout(v)}}),(u?p.resolve(u):S.getTransactionReceipt(t)).catch((function(t){A.unsubscribe(),a=!0,l._fireError({message:"Failed to check for transaction receipt:",data:t},e.eventEmitter,e.reject)})).then(function(){var t=s(f().mark((function t(r){var a,o,d;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r&&r.blockHash){t.next=2;break}throw new Error("Receipt missing or blockHash null");case 2:if(n.extraFormatters&&n.extraFormatters.receiptFormatter&&(r=n.extraFormatters.receiptFormatter(r)),!(e.eventEmitter.listeners("confirmation").length>0)){t.next=28;break}if(void 0!==u&&0===c){t.next=25;break}return t.next=7,S.getBlockByNumber("latest");case 7:if(o=t.sent,d=o?o.hash:null,!m){t.next=24;break}if(!g){t.next=17;break}return t.next=13,S.getBlockByNumber(g.number+1);case 13:(a=t.sent)&&(g=a,e.eventEmitter.emit("confirmation",c,r,d)),t.next=22;break;case 17:return t.next=19,S.getBlockByNumber(r.blockNumber);case 19:a=t.sent,g=a,e.eventEmitter.emit("confirmation",c,r,d);case 22:t.next=25;break;case 24:e.eventEmitter.emit("confirmation",c,r,d);case 25:(m&&a||!m)&&c++,i=!1,c===n.transactionConfirmationBlocks+1&&(A.unsubscribe(),e.eventEmitter.removeAllListeners());case 28:return t.abrupt("return",r);case 29:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).then(function(){var t=s(f().mark((function t(r){var o;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!_||a){t.next=19;break}if(r.contractAddress){t.next=5;break}return i&&(A.unsubscribe(),a=!0),l._fireError(b.NoContractAddressFoundError(r),e.eventEmitter,e.reject,null,r),t.abrupt("return");case 5:return t.prev=5,t.next=8,S.getCode(r.contractAddress);case 8:o=t.sent,t.next=13;break;case 11:t.prev=11,t.t0=t.catch(5);case 13:if(o){t.next=15;break}return t.abrupt("return");case 15:!0===r.status&&M||o.length>2?(e.eventEmitter.emit("receipt",r),n.extraFormatters&&n.extraFormatters.contractDeployFormatter?e.resolve(n.extraFormatters.contractDeployFormatter(r)):e.resolve(r),i&&e.eventEmitter.removeAllListeners()):l._fireError(b.ContractCodeNotStoredError(r),e.eventEmitter,e.reject,null,r),i&&A.unsubscribe(),a=!0;case 19:return t.abrupt("return",r);case 20:case"end":return t.stop()}}),t,null,[[5,11]])})));return function(e){return t.apply(this,arguments)}}()).then(function(){var t=s(f().mark((function t(o){var c,d,s,u;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(_||a){t.next=35;break}if(o.outOfGas||w&&w===o.gasUsed||!0!==o.status&&"0x1"!==o.status&&void 0!==o.status){t.next=7;break}e.eventEmitter.emit("receipt",o),e.resolve(o),i&&e.eventEmitter.removeAllListeners(),t.next=33;break;case 7:if(JSON.stringify(o,null,2),!1!==o.status&&"0x0"!==o.status){t.next=32;break}if(t.prev=9,c=null,!n.handleRevert||"eth_sendTransaction"!==n.call&&"eth_sendRawTransaction"!==n.call){t.next=24;break}return d=r.params[0],"eth_sendRawTransaction"===n.call&&(s=r.params[0],u=x.parse(s),d=h.inputTransactionFormatter({data:u.data,to:u.to,from:u.from,gas:u.gasLimit.toHexString(),gasPrice:u.gasPrice?u.gasPrice.toHexString():void 0,value:u.value.toHexString()})),t.next=16,n.getRevertReason(d,o.blockNumber);case 16:if(!(c=t.sent)){t.next=21;break}l._fireError(b.TransactionRevertInstructionError(c.reason,c.signature,o),e.eventEmitter,e.reject,null,o),t.next=22;break;case 21:throw!1;case 22:t.next=25;break;case 24:throw!1;case 25:t.next=30;break;case 27:t.prev=27,t.t0=t.catch(9),l._fireError(b.TransactionRevertedWithoutReasonError(o),e.eventEmitter,e.reject,null,o);case 30:t.next=33;break;case 32:l._fireError(b.TransactionOutOfGasError(o),e.eventEmitter,e.reject,null,o);case 33:i&&A.unsubscribe(),a=!0;case 35:case"end":return t.stop()}}),t,null,[[9,27]])})));return function(e){return t.apply(this,arguments)}}()).catch((function(){o++,m?o-1>=n.transactionPollingTimeout&&(A.unsubscribe(),a=!0,l._fireError(b.TransactionError("Transaction was not mined within "+n.transactionPollingTimeout+" seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),e.eventEmitter,e.reject)):o-1>=n.transactionBlockTimeout&&(A.unsubscribe(),a=!0,l._fireError(b.TransactionError("Transaction was not mined within "+n.transactionBlockTimeout+" blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),e.eventEmitter,e.reject))}));A.unsubscribe(),a=!0,l._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:y},e.eventEmitter,e.reject)},E=function(e){var t=!1,r=function(){d=setInterval(A.bind(null,e,!0),n.transactionPollingInterval)};if(!this.requestManager.provider.on)return r();S.subscribe("newBlockHeaders",(function(n,a,i){if(t=!0,n||!a)return r();A(e,!1,n,0,i)})),v=setTimeout((function(){t||r()}),1e3*this.blockHeaderTimeout)}.bind(this);S.getTransactionReceipt(t).then((function(t){t&&t.blockHash?(e.eventEmitter.listeners("confirmation").length>0&&E(t),A(t,!1)):a||E()})).catch((function(){a||E()}))};var v=function(e,t){return"number"==typeof e?t.wallet[e]:e&&"object"===u(e)&&e.address&&e.privateKey?e:t.wallet[e.toLowerCase()]};function g(e,t){return new Promise((function(r,a){try{var i=new y({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[function(e){return e?l.toHex(e):"latest"},function(){return!1}]}).createFunction(e.requestManager),o=new y({name:"getGasPrice",call:"eth_gasPrice",params:0}).createFunction(e.requestManager);Promise.all([i(),o()]).then((function(e){var a=n(e,2),i=a[0],o=a[1];if(("0x2"===t.type||void 0===t.type)&&i&&i.baseFeePerGas){var c,f;t.gasPrice?(c=t.gasPrice,f=t.gasPrice,delete t.gasPrice):(c=t.maxPriorityFeePerGas||"0x9502F900",f=t.maxFeePerGas||l.toHex(l.toBN(i.baseFeePerGas).mul(l.toBN(2)).add(l.toBN(c)))),r({maxFeePerGas:f,maxPriorityFeePerGas:c})}else{if(t.maxPriorityFeePerGas||t.maxFeePerGas)throw Error("Network doesn't support eip-1559");r({gasPrice:o})}}))}catch(e){a(e)}}))}y.prototype.buildCall=function(){var e=this,t="eth_sendTransaction"===e.call||"eth_sendRawTransaction"===e.call,r="eth_call"===e.call,n=function(){var n=p(!t),a=e.toPayload(Array.prototype.slice.call(arguments)),i=function(i,o){var c;if(e.handleRevert&&r&&e.abiCoder&&(!i&&e.isRevertReasonString(o)?c=o.substring(10):i&&i.data&&(c=i.data.substring(10)),c)){var f=e.abiCoder.decodeParameter("string","0x"+c);return void l._fireError(b.RevertInstructionError(f,"Error(String)"),n.eventEmitter,n.reject,a.callback,{reason:f,signature:"Error(String)"})}try{o=e.formatOutput(o)}catch(e){i=e}if(o instanceof Error&&(i=o),i)return i.error&&(i=i.error),l._fireError(i,n.eventEmitter,n.reject,a.callback);a.callback&&a.callback(null,o),t?(n.eventEmitter.emit("transactionHash",o),e._confirmTransaction(n,o,a)):i||n.resolve(o)},c=function(t){var r=Object.assign({},a.params[0]);r.transactionHash=t.transactionHash,n.eventEmitter.emit("presend",r);var c=o(o({},a),{},{method:"eth_sendRawTransaction",params:[t.rawTransaction]});e.requestManager.send(c,i)},f=function(e,t){var r;if(t&&t.accounts&&t.accounts.wallet&&t.accounts.wallet.length)if("eth_sendTransaction"===e.method){var a=e.params[0];if((r=v(a&&"object"===u(a)?a.from:null,t.accounts))&&r.privateKey)return delete(a=JSON.parse(JSON.stringify(a))).from,t.defaultChain&&!a.chain&&(a.chain=t.defaultChain),t.defaultHardfork&&!a.hardfork&&(a.hardfork=t.defaultHardfork),t.defaultCommon&&!a.common&&(a.common=t.defaultCommon),void t.accounts.signTransaction(a,r.privateKey).then(c).catch((function(e){if("function"==typeof n.eventEmitter.listeners&&n.eventEmitter.listeners("error").length){try{n.eventEmitter.emit("error",e)}catch(e){}n.eventEmitter.removeAllListeners(),n.eventEmitter.catch((function(){}))}n.reject(e)}))}else if("eth_sign"===e.method){var o=e.params[1];if((r=v(e.params[0],t.accounts))&&r.privateKey){var f=t.accounts.sign(o,r.privateKey);return e.callback&&e.callback(null,f.signature),void n.resolve(f.signature)}}return t.requestManager.send(e,i)};return t&&a.params[0]&&"object"===u(a.params[0])&&void 0===a.params[0].gasPrice&&(void 0===a.params[0].maxPriorityFeePerGas||void 0===a.params[0].maxFeePerGas)?g(e,a.params[0]).then((function(r){void 0!==r.gasPrice?a.params[0].gasPrice=r.gasPrice:void 0!==r.maxPriorityFeePerGas&&void 0!==r.maxFeePerGas&&(a.params[0].maxPriorityFeePerGas=r.maxPriorityFeePerGas,a.params[0].maxFeePerGas=r.maxFeePerGas),t&&setTimeout((function(){n.eventEmitter.emit("sending",a)}),0),f(a,e)})):(t&&setTimeout((function(){n.eventEmitter.emit("sending",a)}),0),f(a,e)),t&&setTimeout((function(){n.eventEmitter.emit("sent",a)}),0),n.eventEmitter};return n.method=e,n.request=this.request.bind(this),n},y.prototype.getRevertReason=function(e,t){var r=this;return new Promise((function(n,a){new y({name:"call",call:"eth_call",params:2,abiCoder:r.abiCoder,handleRevert:!0}).createFunction(r.requestManager)(e,l.numberToHex(t)).then((function(){n(!1)})).catch((function(e){e.reason?n({reason:e.reason,signature:e.signature}):a(e)}))}))},y.prototype.isRevertReasonString=function(e){return"string"==typeof e&&(e.length-2)/2%32==4&&"0x08c379a0"===e.substring(0,10)},y.prototype.request=function(){var e=this.toPayload(Array.prototype.slice.call(arguments));return e.format=this.formatOutput.bind(this),e},e.exports=y},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,a(r(281),t),a(r(282),t),a(r(605),t),a(r(163),t),a(r(606),t),a(r(55),t),a(r(607),t),a(r(40),t),a(r(164),t);var i=r(71);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return i.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return i.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return i.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return i.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return i.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return i.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return i.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return i.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return i.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return i.isHexString}})},function(e,t,r){"use strict";(function(e){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(40),o=r(71),c=r(115);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(41),o=r(73),c=r(116);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(42),o=r(74),c=r(117);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsync=void 0;var n,a=r(758),i=(n=a)&&n.__esModule?n:{default:n};var o="function"==typeof Symbol;function c(e){return o&&"AsyncFunction"===e[Symbol.toStringTag]}t.default=function(e){return c(e)?(0,i.default)(e):e},t.isAsync=c},function(e,t,r){"use strict";(function(e){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(43),o=r(77),c=r(122);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){var t,r,n,a,i,o,c;return r=(t=e).lib,n=r.WordArray,a=r.Hasher,i=t.algo,o=[],c=i.SHA1=a.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],a=r[1],i=r[2],c=r[3],f=r[4],d=0;d<80;d++){if(d<16)o[d]=0|e[t+d];else{var s=o[d-3]^o[d-8]^o[d-14]^o[d-16];o[d]=s<<1|s>>>31}var u=(n<<5|n>>>27)+f+o[d];u+=d<20?1518500249+(a&i|~a&c):d<40?1859775393+(a^i^c):d<60?(a&i|a&c|i&c)-1894007588:(a^i^c)-899497514,f=c,c=i,i=a<<30|a>>>2,a=n,n=u}r[0]=r[0]+n|0,r[1]=r[1]+a|0,r[2]=r[2]+i|0,r[3]=r[3]+c|0,r[4]=r[4]+f|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=a._createHelper(c),t.HmacSHA1=a._createHmacHelper(c),e.SHA1},"object"===c(t)?e.exports=t=o(r(2)):(a=[r(2)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return o}));var n=r(17);function a(e){return n.c.includes(e)}function i(e){return Object.keys(n.f).includes(e)?n.f[e]:n.f[n.a]}function o(e){var t=Object.values(n.f).find((function(t){return t.code===e}));return t||n.f[n.a]}},,function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a={};function i(e,t,r){r||(r=Error);var n=function(e){var r,n;function a(r,n,a){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,a))||this}return n=e,(r=a).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,a}(r);n.prototype.name=r.name,n.prototype.code=e,a[e]=n}function o(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,i,c,f;if("string"==typeof t&&(i="not ",t.substr(!c||c<0?0:+c,i.length)===i)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))f="The ".concat(e," ").concat(a," ").concat(o(t,"type"));else{var d=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";f='The "'.concat(e,'" ').concat(d," ").concat(a," ").concat(o(t,"type"))}return f+=". Received type ".concat(n(r))}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=d;var a=r(207),i=r(211);r(4)(d,a);for(var o=n(i.prototype),c=0;c2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,i,c,f;if("string"==typeof t&&(i="not ",t.substr(!c||c<0?0:+c,i.length)===i)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))f="The ".concat(e," ").concat(a," ").concat(o(t,"type"));else{var d=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";f='The "'.concat(e,'" ').concat(d," ").concat(a," ").concat(o(t,"type"))}return f+=". Received type ".concat(n(r))}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=d;var a=r(214),i=r(218);r(4)(d,a);for(var o=n(i.prototype),c=0;c=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,a=(r-n)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},a.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=a},function(e,t,r){"use strict";(function(e){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(r(e)));return"0"===e[0]&&"x"===e[1]}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=n;function a(e){var t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(r(t)));return t.length%2&&(t="0".concat(t)),t}t.stripHexPrefix=function(e){if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(r(e)));return n(e)?e.slice(2):e},t.padToEven=a,t.getBinarySize=function(t){if("string"!=typeof t)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(r(t)));return e.byteLength(t,"utf8")},t.arrayContainsArray=function(e,t,n){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(r(e),"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(r(t),"'"));return t[n?"some":"every"]((function(t){return e.indexOf(t)>=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,i,c,f;if("string"==typeof t&&(i="not ",t.substr(!c||c<0?0:+c,i.length)===i)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))f="The ".concat(e," ").concat(a," ").concat(o(t,"type"));else{var d=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";f='The "'.concat(e,'" ').concat(d," ").concat(a," ").concat(o(t,"type"))}return f+=". Received type ".concat(n(r))}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=d;var a=r(263),i=r(267);r(4)(d,a);for(var o=n(i.prototype),c=0;c=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r0&&"0"===r.toString();)r=(e=e.slice(1))[0];return e},t.toBuffer=function(e){if(!p.isBuffer(e))if(Array.isArray(e))e=p.from(e);else if("string"==typeof e)e=t.isHexString(e)?p.from(t.padToEven(t.stripHexPrefix(e)),"hex"):p.from(e);else if("number"==typeof e)e=t.intToBuffer(e);else if(null==e)e=p.allocUnsafe(0);else if(h.isBN(e))e=e.toArrayLike(p);else{if(!e.toArray)throw new Error("invalid type");e=p.from(e.toArray())}return e},t.bufferToInt=function(e){return new h(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new h(e).fromTwos(256)},t.toUnsigned=function(e){return p.from(e.toTwos(256).toArray())},t.keccak=function(e,r){switch(e=t.toBuffer(e),r||(r=256),r){case 224:return o(e);case 256:return f(e);case 384:return c(e);case 512:return d(e);default:throw new Error("Invald algorithm: keccak"+r)}},t.keccak256=function(e){return t.keccak(e)},t.sha3=t.keccak,t.sha256=function(e){return e=t.toBuffer(e),l("sha256").update(e).digest()},t.ripemd160=function(e,r){e=t.toBuffer(e);var n=l("rmd160").update(e).digest();return!0===r?t.setLength(n,32):n},t.rlphash=function(e){return t.keccak(b.encode(e))},t.isValidPrivate=function(e){return s.privateKeyVerify(e)},t.isValidPublic=function(e,t){return 64===e.length?s.publicKeyVerify(p.concat([p.from([4]),e])):!!t&&s.publicKeyVerify(e)},t.pubToAddress=t.publicToAddress=function(e,r){return e=t.toBuffer(e),r&&64!==e.length&&(e=s.publicKeyConvert(e,!1).slice(1)),u(64===e.length),t.keccak(e).slice(-20)};var m=t.privateToPublic=function(e){return e=t.toBuffer(e),s.publicKeyCreate(e,!1).slice(1)};t.importPublic=function(e){return 64!==(e=t.toBuffer(e)).length&&(e=s.publicKeyConvert(e,!1).slice(1)),e},t.ecsign=function(e,t){var r=s.sign(e,t),n={};return n.r=r.signature.slice(0,32),n.s=r.signature.slice(32,64),n.v=r.recovery+27,n},t.hashPersonalMessage=function(e){var r=t.toBuffer("Ethereum Signed Message:\n"+e.length.toString());return t.keccak(p.concat([r,e]))},t.ecrecover=function(e,r,n,a){var i=p.concat([t.setLength(n,32),t.setLength(a,32)],64),o=r-27;if(0!==o&&1!==o)throw new Error("Invalid signature v value");var c=s.recover(e,i,o);return s.publicKeyConvert(c,!1).slice(1)},t.toRpcSig=function(e,r,n){if(27!==e&&28!==e)throw new Error("Invalid recovery id");return t.bufferToHex(p.concat([t.setLengthLeft(r,32),t.setLengthLeft(n,32),t.toBuffer(e-27)]))},t.fromRpcSig=function(e){if(65!==(e=t.toBuffer(e)).length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},t.privateToAddress=function(e){return t.publicToAddress(m(e))},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){return t.zeroAddress()===t.addHexPrefix(e)},t.toChecksumAddress=function(e){e=t.stripHexPrefix(e).toLowerCase();for(var r=t.keccak(e).toString("hex"),n="0x",a=0;a=8?n+=e[a].toUpperCase():n+=e[a];return n},t.isValidChecksumAddress=function(e){return t.isValidAddress(e)&&t.toChecksumAddress(e)===e},t.generateAddress=function(e,r){return e=t.toBuffer(e),r=(r=new h(r)).isZero()?null:p.from(r.toArray()),t.rlphash([e,r]).slice(-20)},t.isPrecompiled=function(e){var r=t.unpad(e);return 1===r.length&&r[0]>=1&&r[0]<=8},t.addHexPrefix=function(e){return"string"!=typeof e||t.isHexPrefixed(e)?e:"0x"+e},t.isValidSignature=function(e,t,r,n){var a=new h("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),i=new h("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===t.length&&32===r.length&&((27===e||28===e)&&(t=new h(t),r=new h(r),!(t.isZero()||t.gt(i)||r.isZero()||r.gt(i))&&(!1!==n||1!==new h(r).cmp(a))))},t.baToJSON=function(e){if(p.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],n=0;n=a.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===a.length||!r.length||u(r.length===a.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[n]=a}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:a,set:i}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:i,get:a})})),n)if("string"==typeof n&&(n=p.from(t.stripHexPrefix(n),"hex")),p.isBuffer(n)&&(n=b.decode(n)),Array.isArray(n)){if(n.length>e._fields.length)throw new Error("wrong number of fields in data");n.forEach((function(r,n){e[e._fields[n]]=t.toBuffer(r)}))}else{if("object"!==(void 0===n?"undefined":a(n)))throw new Error("invalid data");var i=Object.keys(n);r.forEach((function(t){-1!==i.indexOf(t.name)&&(e[t.name]=n[t.name]),-1!==i.indexOf(t.alias)&&(e[t.alias]=n[t.alias])}))}}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{f(n.next(e))}catch(e){i(e)}}function c(e){try{f(n.throw(e))}catch(e){i(e)}}function f(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}f((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.universalChainCb=t.getJCErc721Info=t.getAddressByName=t.getTypeByAddress=t.toHexChainId=t.formatPrice=t.parsePrice=t.UNKNOW=void 0;var o=r(47),c=r(808),f=r(24);t.UNKNOW="unknow",t.parsePrice=function(e,t){return e+new Array(19-t).join("0")},t.formatPrice=function(e,t,r){if(void 0===r&&(r=2),!t)return e;var n=e+"",a=n.length;if(n=n.padStart(t,"0"),t>=a)n="0."+n;else{var i=a-t;n=n.slice(0,i)+"."+n.slice(i)}return n=n.slice(0,n.lastIndexOf(".")+r+1)},t.toHexChainId=function(e){return"0x"+e.toString(16)},t.getTypeByAddress=function(e){var t,r,n=jc.wallet.currentChainCfg,a="erc721";if(n&&n.tokens)try{for(var o=i(n.tokens),c=o.next();!c.done;c=o.next()){var f=c.value;f.address.toLowerCase()===e.toLowerCase()&&(a=f.type)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return{type:a}},t.getAddressByName=function(e){var t=jc.wallet.currentChainCfg,r="";if(t&&t.tokens){var n=t.tokens.find((function(t){return t.name===e||t.symbol===e}));n&&(r=n.address)}return r},t.getJCErc721Info=function(e){return n(this,void 0,void 0,(function(){var t;return a(this,(function(r){return t=""+o.BASE_TOKEN_URI+e,[2,fetch(t).then((function(e){return e.json()}))]}))}))},t.universalChainCb=function(e,t){return t.on("presend",(function(t){if(jc.wallet.isInternal){console.log("before send tran: ",JSON.stringify(t));var r=void 0;!t.gasPrice&&t.maxPriorityFeePerGas&&t.maxFeePerGas?r=f.toBN(t.maxFeePerGas).sub(f.toBN(t.maxPriorityFeePerGas)).div(f.toBN(2)).mul(f.toBN(1e9)):t.gasPrice&&(r=f.toBN(t.gasPrice)),e.gas=f.toBN(t.gas).toString(),e.gasPrice=r.toString(),e.transactionHash=t.transactionHash,e.chain=jc.wallet.currentChain.id,e.startTime=Date.now(),(new c.LoggerQueue).addLog(e)}})).on("transactionHash",(function(e){console.log("remote transactionHash: "+e)})).on("confirmation",(function(t,r){console.log("confirmation:: confirmationNumber: "+t+" , receipt: "+r),jc.wallet.isInternal&&t>=o.TX_CONFIRM_BLOCKS&&(e.status=2,e.confirmTime=Date.now(),(new c.LoggerQueue).addLog(e))})).on("receipt",(function(t){return console.log(t),jc.wallet.isInternal&&(e.status=t.status?1:10,e.blockNumber=t.blockNumber,e.blockHash=t.blockHash,e.gas=t.gasUsed,(new c.LoggerQueue).addLog(e)),Promise.resolve(t)})).on("error",(function(t,r){return console.log(t),jc.wallet.isInternal&&(e.status=11,(new c.LoggerQueue).addLog(e)),Promise.reject(t)}))}},function(e,t,r){"use strict";(function(e){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(r(e)));return"0"===e[0]&&"x"===e[1]}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=n;function a(e){var t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(r(t)));return t.length%2&&(t="0".concat(t)),t}t.stripHexPrefix=function(e){if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(r(e)));return n(e)?e.slice(2):e},t.padToEven=a,t.getBinarySize=function(t){if("string"!=typeof t)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(r(t)));return e.byteLength(t,"utf8")},t.arrayContainsArray=function(e,t,n){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(r(e),"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(r(t),"'"));return t[n?"some":"every"]((function(t){return e.indexOf(t)>=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r>>7)^(l<<14|l>>>18)^l>>>3,m=d[h-2],x=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;d[h]=p+d[h-7]+x+d[h-16]}var y=n&a^n&i^a&i,v=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),g=b+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&s^~c&u)+f[h]+d[h];b=u,u=s,s=c,c=o+g|0,o=i,i=a,a=n,n=g+(v+y)|0}r[0]=r[0]+n|0,r[1]=r[1]+a|0,r[2]=r[2]+i|0,r[3]=r[3]+o|0,r[4]=r[4]+c|0,r[5]=r[5]+s|0,r[6]=r[6]+u|0,r[7]=r[7]+b|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,a=8*e.sigBytes;return r[a>>>5]|=128<<24-a%32,r[14+(a+64>>>9<<4)]=t.floor(n/4294967296),r[15+(a+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=i._createHelper(s),r.HmacSHA256=i._createHmacHelper(s)}(Math),e.SHA256},"object"===c(t)?e.exports=t=o(r(2)):(a=[r(2)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){var t,r,n;r=(t=e).lib.Base,n=t.enc.Utf8,t.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=n.parse(t));var r=e.blockSize,a=4*r;t.sigBytes>a&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),c=i.words,f=o.words,d=0;d=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var a=0;a>>24&255,n[a++]=e>>>16&255,n[a++]=e>>>8&255,n[a++]=255&e}else for(n[a++]=255&e,n[a++]=e>>>8&255,n[a++]=e>>>16&255,n[a++]=e>>>24&255,n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=0,i=8;i0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(t){if(!e.isBuffer(t))if(Array.isArray(t))t=e.from(t);else if("string"==typeof t){if(!n.isHexString(t))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+t);t=e.from(n.padToEven(n.stripHexPrefix(t)),"hex")}else if("number"==typeof t)t=n.intToBuffer(t);else if(null==t)t=e.allocUnsafe(0);else if(a.isBN(t))t=t.toArrayLike(e);else{if(!t.toArray)throw new Error("invalid type");t=e.from(t.toArray())}return t},t.bufferToInt=function(e){return new a(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new a(e).fromTwos(256)},t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||n.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(r){if(e.isBuffer(r))return"0x"+r.toString("hex");if(r instanceof Array){for(var n=[],a=0;a0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(t){if(!e.isBuffer(t))if(Array.isArray(t))t=e.from(t);else if("string"==typeof t){if(!n.isHexString(t))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+t);t=e.from(n.padToEven(n.stripHexPrefix(t)),"hex")}else if("number"==typeof t)t=n.intToBuffer(t);else if(null==t)t=e.allocUnsafe(0);else if(a.isBN(t))t=t.toArrayLike(e);else{if(!t.toArray)throw new Error("invalid type");t=e.from(t.toArray())}return t},t.bufferToInt=function(e){return new a(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new a(e).fromTwos(256)},t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||n.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(r){if(e.isBuffer(r))return"0x"+r.toString("hex");if(r instanceof Array){for(var n=[],a=0;a",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(s),b=["%","/","?",";","#"].concat(u),h=["/","?","#"],l=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},x={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=r(479);function g(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+n(e));var o=e.indexOf("?"),f=-1!==o&&o127?C+="x":C+=R[I];if(!C.match(l)){var N=j.slice(0,T),U=j.slice(T+1),z=R.match(p);z&&(N.push(z[1]),U.unshift(z[2])),U.length&&(g="/"+U.join(".")+g),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=a.toASCII(this.hostname));var F=this.port?":"+this.port:"",q=this.hostname||"";this.host=q+F,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==g[0]&&(g="/"+g))}if(!m[M])for(T=0,B=u.length;T0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift());return r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!M.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var S=M.slice(-1)[0],A=(r.host||e.host||M.length>1)&&("."===S||".."===S)||""===S,E=0,T=M.length;T>=0;T--)"."===(S=M[T])?M.splice(T,1):".."===S?(M.splice(T,1),E++):E&&(M.splice(T,1),E--);if(!w&&!_)for(;E--;E)M.unshift("..");!w||""===M[0]||M[0]&&"/"===M[0].charAt(0)||M.unshift(""),A&&"/"!==M.join("/").substr(-1)&&M.push("");var O,P=""===M[0]||M[0]&&"/"===M[0].charAt(0);k&&(r.hostname=r.host=P?"":M.length?M.shift():"",(O=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift()));return(w=w||r.host&&M.length)&&!P&&M.unshift(""),M.length?r.pathname=M.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=f.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t){e.exports=function(){for(var e={},t=0;t0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(t){if(!e.isBuffer(t))if(Array.isArray(t))t=e.from(t);else if("string"==typeof t){if(!n.isHexString(t))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+t);t=e.from(n.padToEven(n.stripHexPrefix(t)),"hex")}else if("number"==typeof t)t=n.intToBuffer(t);else if(null==t)t=e.allocUnsafe(0);else if(a.isBN(t))t=t.toArrayLike(e);else{if(!t.toArray)throw new Error("invalid type");t=e.from(t.toArray())}return t},t.bufferToInt=function(e){return new a(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new a(e).fromTwos(256)},t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||n.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(r){if(e.isBuffer(r))return"0x"+r.toString("hex");if(r instanceof Array){for(var n=[],a=0;a0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.numberToBN=t.toWeiBn=t.stripHexPrefix=t.fastSplit=t.safeNumberToBN=t.addHexPrefix=t.toBN=t.isDecimal=t.calcTokenValueToSend=t.renderFromWei=t.fromTokenMinimalUnit=t.renderFromTokenMinimalUnit=void 0;var o=i(r(226)),c=r(75);function f(e,t){var r=s(e=d(Number(e).toString(16))),n=r.lt(new c.BN(0)),a=o.default.utils.toBN(Math.pow(10,t).toString());n&&(r=r.mul(new c.BN(-1)));for(var i=r.mod(a).toString(10);i.length0)n="< 0.00001";else{var o=Math.pow(10,r);n=(Math.round(i*o)/o).toString()}return n},t.fromTokenMinimalUnit=f,t.renderFromWei=function(e,t){void 0===t&&(t=5);var r="0";if(e){var n=o.default.utils.fromWei(e),a=parseFloat(n);if(a<1e-5&&a>0)r="< 0.00001";else{var i=Math.pow(10,t);r=(Math.round(a*i)/i).toString()}}return r},t.calcTokenValueToSend=function(e,t){return e?(e*Math.pow(10,t)).toString(16):0},t.isDecimal=function(e){return Number.isFinite(parseFloat(e))&&!Number.isNaN(parseFloat(e))&&!isNaN(+e)},t.toBN=function(e){return o.default.utils.toBN(e)},t.addHexPrefix=d,t.safeNumberToBN=s,t.fastSplit=u,t.stripHexPrefix=b,t.toWeiBn=function(e,t){var r=o.default.utils.toBN(o.default.utils.toWei(e+""));return t>18?r=r.mul(o.default.utils.toBN(10).pow(o.default.utils.toBN(t-18))):t<18&&(r=r.div(o.default.utils.toBN(10).pow(o.default.utils.toBN(18-t)))),r},t.numberToBN=h},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),a(r(707),t),a(r(708),t)},function(e,t,r){(function(e,n,a){var i;function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)} /** * [js-sha3]{@link https://github.com/emn178/js-sha3} *