UNPKG

@parity/parity.js

Version:

The Parity Promise-based API & ABI library for interfacing with Ethereum over RPC

1 lines 193 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("node-fetch")):"function"==typeof define&&define.amd?define("parity",["node-fetch"],e):"object"==typeof exports?exports.parity=e(require("node-fetch")):t.parity=e(t["node-fetch"])}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=236)}([function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n(160),u=r(i);e.default=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,u.default)(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}()},function(t,e){var n=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(60)("wks"),i=n(38),u=n(4).Symbol,o="function"==typeof u;(t.exports=function(t){return r[t]||(r[t]=o&&u[t]||(o?u:i)("Symbol."+t))}).store=r},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t){return(0,S.default)(t).reduce(function(e,n){var r=t[n],i=u(n);return e[i]={name:r.name},r.meta&&(e[i].uuid=r.uuid,e[i].meta=JSON.parse(r.meta)),e},{})}function u(t){return(0,C.toChecksumAddress)(t)}function o(t){return(t||[]).map(u)}function s(t){return t&&(0,S.default)(t).forEach(function(e){switch(e){case"author":case"miner":t[e]=u(t[e]);break;case"difficulty":case"gasLimit":case"gasUsed":case"nonce":case"number":case"totalDifficulty":t[e]=p(t[e]);break;case"timestamp":t[e]=c(t[e])}}),t}function a(t){return t&&(0,S.default)(t).forEach(function(e){switch(e){case"blockGap":t[e]=t[e]?t[e].map(p):t[e]}}),t}function c(t){if("function"==typeof t.toISOString)return t;try{if("string"==typeof t&&new Date(t).toISOString()===t)return new Date(t)}catch(t){}return new Date(1e3*p(t).toNumber())}function f(t){return t&&(0,S.default)(t).forEach(function(e){switch(e){case"bucketBounds":case"counts":t[e]=t[e].map(p)}}),t}function l(t){return(0,S.default)(t).forEach(function(e){switch(e){case"blockNumber":case"logIndex":case"transactionIndex":t[e]=p(t[e]);break;case"address":t[e]=u(t[e])}}),t}function d(t){return(0,S.default)(t).reduce(function(e,n){return e[u(n)]=t[n],e},{})}function h(t){return t}function p(t){return new B.default(t||0)}function _(t){var e=(0,S.default)(t.protocols).reduce(function(e,n){return t.protocols[n]&&(e[n]=(0,E.default)({},t.protocols[n],{difficulty:p(t.protocols[n].difficulty)})),e},{});return(0,E.default)({},t,{protocols:e})}function v(t){return{active:p(t.active),connected:p(t.connected),max:p(t.max),peers:t.peers.map(function(t){return _(t)})}}function y(t){return t&&(0,S.default)(t).forEach(function(e){switch(e){case"blockNumber":case"cumulativeGasUsed":case"gasUsed":case"transactionIndex":t[e]=p(t[e]);break;case"contractAddress":t[e]=u(t[e])}}),t}function g(t){return t&&(0,S.default)(t).forEach(function(e){t[e]=c(t[e])}),t}function b(t){return t&&(0,S.default)(t).forEach(function(e){switch(e){case"id":t[e]=p(t[e]);break;case"payload":t[e].decrypt=x(t[e].decrypt),t[e].sign=x(t[e].sign),t[e].signTransaction=w(t[e].signTransaction),t[e].sendTransaction=w(t[e].sendTransaction);break;case"origin":var n=(0,S.default)(t[e])[0],r=t[e][n];t[e]={type:n,details:r}}}),t}function m(t){return t&&"false"!==t&&(0,S.default)(t).forEach(function(e){switch(e){case"currentBlock":case"highestBlock":case"startingBlock":case"warpChunksAmount":case"warpChunksProcessed":t[e]=p(t[e]);break;case"blockGap":t[e]=t[e]?t[e].map(p):t[e]}}),t}function k(t){return t&&(t.block?t.block=p(t.block):t.time&&(t.time=c(t.time))),t}function w(t){return t&&(0,S.default)(t).forEach(function(e){switch(e){case"blockNumber":case"gasPrice":case"gas":case"nonce":case"transactionIndex":case"value":t[e]=p(t[e]);break;case"condition":t[e]=k(t[e]);break;case"creates":case"from":case"to":t[e]=u(t[e])}}),t}function x(t){return t&&(0,S.default)(t).forEach(function(e){switch(e){case"address":t[e]=u(t[e])}}),t}function A(t){return t&&(t.action&&(0,S.default)(t.action).forEach(function(e){switch(e){case"gas":case"value":case"balance":t.action[e]=p(t.action[e]);break;case"from":case"to":case"address":case"refundAddress":t.action[e]=u(t.action[e])}}),t.result&&(0,S.default)(t.result).forEach(function(e){switch(e){case"gasUsed":t.result[e]=p(t.result[e]);break;case"address":t.action[e]=u(t.action[e])}}),t.traceAddress&&t.traceAddress.forEach(function(e,n){t.traceAddress[n]=p(e)}),(0,S.default)(t).forEach(function(e){switch(e){case"subtraces":case"transactionPosition":case"blockNumber":t[e]=p(t[e])}})),t}function T(t){return t?t.map(A):t}function O(t){return t&&(0,S.default)(t).forEach(function(e){switch(e){case"trace":t[e]=T(t[e])}}),t}function P(t){if((0,I.isString)(t))try{return JSON.parse(t)}catch(t){return{}}return t||{}}Object.defineProperty(e,"__esModule",{value:!0});var M=n(50),E=r(M),j=n(24),S=r(j);e.outAccountInfo=i,e.outAddress=u,e.outAddresses=o,e.outBlock=s,e.outChainStatus=a,e.outDate=c,e.outHistogram=f,e.outLog=l,e.outHwAccountInfo=d,e.outNodeKind=h,e.outNumber=p,e.outPeer=_,e.outPeers=v,e.outReceipt=y,e.outRecentDapps=g,e.outSignerRequest=b,e.outSyncing=m,e.outTransactionCondition=k,e.outTransaction=w,e.outSigningPayload=x,e.outTrace=A,e.outTraces=T,e.outTraceReplay=O,e.outVaultMeta=P;var N=n(20),B=r(N),C=n(45),I=n(12)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t){return l(t)}function u(t){return(t||[]).map(i)}function o(t){if((0,P.isString)(t))switch(t){case"earliest":case"latest":case"pending":return t}return h(t)}function s(t){return t&&t.length&&!(0,P.isHex)(t)&&(t=t.split("").map(function(t){return("0"+t.charCodeAt(0).toString(16)).slice(-2)}).join("")),l(t)}function a(t){return l(t)}function c(t){return(t||[]).filter(function(t){return null===t||t}).map(function(t){return null===t?null:Array.isArray(t)?c(t):(0,M.padLeft)(t,32)})}function f(t){return t&&(0,A.default)(t).forEach(function(e){switch(e){case"address":(0,P.isArray)(t[e])?t[e]=t[e].map(i):t[e]=i(t[e]);break;case"fromBlock":case"toBlock":t[e]=o(t[e]);break;case"limit":t[e]=d(t[e]);break;case"topics":t[e]=c(t[e])}}),t}function l(t){return(0,M.toHex)(t)}function d(t){return(0,P.isInstanceOf)(t,O.default)?t.toNumber():new O.default(t||0).toNumber()}function h(t){var e=(0,P.isInstanceOf)(t,O.default)?t:new O.default(t||0);if(!e.isInteger())throw new Error("[format/input::inNumber16] the given number is not an integer: "+e.toFormat());return l(e.toString(16))}function p(t){return t&&(t.block?t.block=t.block?d(t.block):null:t.time&&(t.time=d(Math.floor(t.time.getTime()/1e3)))),t}function _(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(0,w.default)({},t);return(0,A.default)(e).forEach(function(t){switch(t){case"to":e[t]&&(e.to=i(e[t]));break;case"from":e[t]=i(e[t]);break;case"condition":e[t]=p(e[t]);break;case"gas":case"gasPrice":e[t]=h(new O.default(e[t]).round());break;case"value":case"nonce":e[t]=h(e[t]);break;case"data":e[t]=s(e[t])}}),e}function v(t){return t&&(0,A.default)(t).forEach(function(e){switch(e){case"fromAddress":case"toAddress":t[e]=[].concat(t[e]).map(function(t){return i(t)});break;case"toBlock":case"fromBlock":t[e]=o(t[e])}}),t}function y(t){return(0,P.isString)(t)?[t]:t}function g(t){return t&&"hard"===t.type?"hard":"soft"}function b(t){var e=t&&t.hash?t.hash:t,n=g(t);return{hash:l(e),type:n}}function m(t){return t?((0,P.isArray)(t)||(t=[t]),t.map(function(t){return{index:d(t&&t.index?t.index:t),type:g(t)}})):[]}Object.defineProperty(e,"__esModule",{value:!0});var k=n(50),w=r(k),x=n(24),A=r(x);e.inAddress=i,e.inAddresses=u,e.inBlockNumber=o,e.inData=s,e.inHash=a,e.inTopics=c,e.inFilter=f,e.inHex=l,e.inNumber10=d,e.inNumber16=h,e.inOptionsCondition=p,e.inOptions=_,e.inTraceFilter=v,e.inTraceType=y,e.inDeriveHash=b,e.inDeriveIndex=m;var T=n(20),O=r(T),P=n(12),M=n(32)},function(t,e,n){t.exports={default:n(171),__esModule:!0}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n(161),u=r(i),o=n(159),s=r(o),a=n(78),c=r(a);e.default=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":(0,c.default)(e)));t.prototype=(0,s.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(u.default?(0,u.default)(t,e):t.__proto__=e)}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n(78),u=r(i);e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==(void 0===e?"undefined":(0,u.default)(e))&&"function"!=typeof e?t:e}},function(t,e,n){var r=n(22);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var r=n(4),i=n(2),u=n(26),o=n(18),s="prototype",a=function(t,e,n){var c,f,l,d=t&a.F,h=t&a.G,p=t&a.S,_=t&a.P,v=t&a.B,y=t&a.W,g=h?i:i[e]||(i[e]={}),b=g[s],m=h?r:p?r[e]:(r[e]||{})[s];h&&(n=e);for(c in n)(f=!d&&m&&void 0!==m[c])&&c in g||(l=f?m[c]:n[c],g[c]=h&&"function"!=typeof m[c]?n[c]:v&&f?u(l,r):y&&m[c]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e[s]=t[s],e}(l):_&&"function"==typeof l?u(Function.call,l):l,_&&((g.virtual||(g.virtual={}))[c]=l,t&a.R&&b&&!b[c]&&o(b,c,l)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e,n){"use strict";function r(t){return"[object Array]"===Object.prototype.toString.call(t)}function i(t){return"[object Error]"===Object.prototype.toString.call(t)}function u(t){return"[object Function]"===Object.prototype.toString.call(t)}function o(t){if(!a(t))return!1;if("0x"===t.substr(0,2))return o(t.slice(2));for(var e=t.toLowerCase(),n=!0,r=0;n&&r<e.length;r++)n=f.includes(e[r]);return n}function s(t){return"[object Object]"===Object.prototype.toString.call(t)}function a(t){return"[object String]"===Object.prototype.toString.call(t)}function c(t,e){return t instanceof e}Object.defineProperty(e,"__esModule",{value:!0}),e.isArray=r,e.isError=i,e.isFunction=u,e.isHex=o,e.isObject=s,e.isString=a,e.isInstanceOf=c;var f=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"]},function(t,e,n){t.exports=!n(21)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(10),i=n(80),u=n(62),o=Object.defineProperty;e.f=n(13)?Object.defineProperty:function(t,e,n){if(r(t),e=u(e,!0),r(n),i)try{return o(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(81),i=n(54);t.exports=function(t){return r(i(t))}},function(t,e,n){t.exports={default:n(175),__esModule:!0}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(14),i=n(35);t.exports=n(13)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(86),i=n(56);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){var r;!function(i){"use strict";function u(t){function e(t,r){var i,u,o,s,a,c,f=this;if(!(f instanceof e))return V&&S(26,"constructor call without new",t),new e(t,r);if(null!=r&&G(r,2,64,C,"base")){if(r|=0,c=t+"",10==r)return f=new e(t instanceof e?t:c),N(f,D+f.e+1,R);if((s="number"==typeof t)&&0*t!=0||!new RegExp("^-?"+(i="["+x.slice(0,r)+"]+")+"(?:\\."+i+")?$",r<37?"i":"").test(c))return v(f,c,s,r);s?(f.s=1/t<0?(c=c.slice(1),-1):1,V&&c.replace(/^0\.0*|\./,"").length>15&&S(C,w,t),s=!1):f.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1,c=n(c,10,r,f.s)}else{if(t instanceof e)return f.s=t.s,f.e=t.e,f.c=(t=t.c)?t.slice():t,void(C=0);if((s="number"==typeof t)&&0*t==0){if(f.s=1/t<0?(t=-t,-1):1,t===~~t){for(u=0,o=t;o>=10;o/=10,u++);return f.e=u,f.c=[t],void(C=0)}c=t+""}else{if(!y.test(c=t+""))return v(f,c,s);f.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1}}for((u=c.indexOf("."))>-1&&(c=c.replace(".","")),(o=c.search(/e/i))>0?(u<0&&(u=o),u+=+c.slice(o+1),c=c.substring(0,o)):u<0&&(u=c.length),o=0;48===c.charCodeAt(o);o++);for(a=c.length;48===c.charCodeAt(--a););if(c=c.slice(o,a+1))if(a=c.length,s&&V&&a>15&&(t>O||t!==b(t))&&S(C,w,f.s*t),(u=u-o-1)>q)f.c=f.e=null;else if(u<H)f.c=[f.e=0];else{if(f.e=u,f.c=[],o=(u+1)%T,u<0&&(o+=T),o<a){for(o&&f.c.push(+c.slice(0,o)),a-=T;o<a;)f.c.push(+c.slice(o,o+=T));c=c.slice(o),o=T-c.length}else o-=a;for(;o--;c+="0");f.c.push(+c)}else f.c=[f.e=0];C=0}function n(t,n,r,i){var u,o,a,c,f,d,p,_=t.indexOf("."),v=D,y=R;for(r<37&&(t=t.toLowerCase()),_>=0&&(a=z,z=0,t=t.replace(".",""),p=new e(r),f=p.pow(t.length-_),z=a,p.c=l(h(s(f.c),f.e),10,n),p.e=p.c.length),d=l(t,r,n),o=a=d.length;0==d[--a];d.pop());if(!d[0])return"0";if(_<0?--o:(f.c=d,f.e=o,f.s=i,f=B(f,p,v,y,n),d=f.c,c=f.r,o=f.e),u=o+v+1,_=d[u],a=n/2,c=c||u<0||null!=d[u+1],c=y<4?(null!=_||c)&&(0==y||y==(f.s<0?3:2)):_>a||_==a&&(4==y||c||6==y&&1&d[u-1]||y==(f.s<0?8:7)),u<1||!d[0])t=c?h("1",-v):"0";else{if(d.length=u,c)for(--n;++d[--u]>n;)d[u]=0,u||(++o,d.unshift(1));for(a=d.length;!d[--a];);for(_=0,t="";_<=a;t+=x.charAt(d[_++]));t=h(t,o)}return t}function r(t,n,r,i){var u,o,a,c,f;if(r=null!=r&&G(r,0,8,i,k)?0|r:R,!t.c)return t.toString();if(u=t.c[0],a=t.e,null==n)f=s(t.c),f=19==i||24==i&&a<=F?d(f,a):h(f,a);else if(t=N(new e(t),n,r),o=t.e,f=s(t.c),c=f.length,19==i||24==i&&(n<=o||o<=F)){for(;c<n;f+="0",c++);f=d(f,o)}else if(n-=a,f=h(f,o),o+1>c){if(--n>0)for(f+=".";n--;f+="0");}else if((n+=o-c)>0)for(o+1==c&&(f+=".");n--;f+="0");return t.s<0&&u?"-"+f:f}function i(t,n){var r,i,u=0;for(f(t[0])&&(t=t[0]),r=new e(t[0]);++u<t.length;){if(i=new e(t[u]),!i.s){r=i;break}n.call(r,i)&&(r=i)}return r}function _(t,e,n,r,i){return(t<e||t>n||t!=p(t))&&S(r,(i||"decimal places")+(t<e||t>n?" out of range":" not an integer"),t),!0}function j(t,e,n){for(var r=1,i=e.length;!e[--i];e.pop());for(i=e[0];i>=10;i/=10,r++);return(n=r+n*T-1)>q?t.c=t.e=null:n<H?t.c=[t.e=0]:(t.e=n,t.c=e),t}function S(t,e,n){var r=new Error(["new BigNumber","cmp","config","div","divToInt","eq","gt","gte","lt","lte","minus","mod","plus","precision","random","round","shift","times","toDigits","toExponential","toFixed","toFormat","toFraction","pow","toPrecision","toString","BigNumber"][t]+"() "+e+": "+n);throw r.name="BigNumber Error",C=0,r}function N(t,e,n,r){var i,u,o,s,a,c,f,l=t.c,d=P;if(l){t:{for(i=1,s=l[0];s>=10;s/=10,i++);if((u=e-i)<0)u+=T,o=e,a=l[c=0],f=a/d[i-o-1]%10|0;else if((c=g((u+1)/T))>=l.length){if(!r)break t;for(;l.length<=c;l.push(0));a=f=0,i=1,u%=T,o=u-T+1}else{for(a=s=l[c],i=1;s>=10;s/=10,i++);u%=T,o=u-T+i,f=o<0?0:a/d[i-o-1]%10|0}if(r=r||e<0||null!=l[c+1]||(o<0?a:a%d[i-o-1]),r=n<4?(f||r)&&(0==n||n==(t.s<0?3:2)):f>5||5==f&&(4==n||r||6==n&&(u>0?o>0?a/d[i-o]:0:l[c-1])%10&1||n==(t.s<0?8:7)),e<1||!l[0])return l.length=0,r?(e-=t.e+1,l[0]=d[(T-e%T)%T],t.e=-e||0):l[0]=t.e=0,t;if(0==u?(l.length=c,s=1,c--):(l.length=c+1,s=d[T-u],l[c]=o>0?b(a/d[i-o]%d[o])*s:0),r)for(;;){if(0==c){for(u=1,o=l[0];o>=10;o/=10,u++);for(o=l[0]+=s,s=1;o>=10;o/=10,s++);u!=s&&(t.e++,l[0]==A&&(l[0]=1));break}if(l[c]+=s,l[c]!=A)break;l[c--]=0,s=1}for(u=l.length;0===l[--u];l.pop());}t.e>q?t.c=t.e=null:t.e<H&&(t.c=[t.e=0])}return t}var B,C=0,I=e.prototype,L=new e(1),D=20,R=4,F=-7,U=21,H=-1e7,q=1e7,V=!0,G=_,W=!1,K=1,z=0,$={decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:" ",fractionGroupSize:0};return e.another=u,e.ROUND_UP=0,e.ROUND_DOWN=1,e.ROUND_CEIL=2,e.ROUND_FLOOR=3,e.ROUND_HALF_UP=4,e.ROUND_HALF_DOWN=5,e.ROUND_HALF_EVEN=6,e.ROUND_HALF_CEIL=7,e.ROUND_HALF_FLOOR=8,e.EUCLID=9,e.config=e.set=function(){var t,e,n=0,r={},i=arguments,u=i[0],o=u&&"object"==typeof u?function(){if(u.hasOwnProperty(e))return null!=(t=u[e])}:function(){if(i.length>n)return null!=(t=i[n++])};return o(e="DECIMAL_PLACES")&&G(t,0,E,2,e)&&(D=0|t),r[e]=D,o(e="ROUNDING_MODE")&&G(t,0,8,2,e)&&(R=0|t),r[e]=R,o(e="EXPONENTIAL_AT")&&(f(t)?G(t[0],-E,0,2,e)&&G(t[1],0,E,2,e)&&(F=0|t[0],U=0|t[1]):G(t,-E,E,2,e)&&(F=-(U=0|(t<0?-t:t)))),r[e]=[F,U],o(e="RANGE")&&(f(t)?G(t[0],-E,-1,2,e)&&G(t[1],1,E,2,e)&&(H=0|t[0],q=0|t[1]):G(t,-E,E,2,e)&&(0|t?H=-(q=0|(t<0?-t:t)):V&&S(2,e+" cannot be zero",t))),r[e]=[H,q],o(e="ERRORS")&&(t===!!t||1===t||0===t?(C=0,G=(V=!!t)?_:c):V&&S(2,e+m,t)),r[e]=V,o(e="CRYPTO")&&(t===!0||t===!1||1===t||0===t?t?(t="undefined"==typeof crypto,!t&&crypto&&(crypto.getRandomValues||crypto.randomBytes)?W=!0:V?S(2,"crypto unavailable",t?void 0:crypto):W=!1):W=!1:V&&S(2,e+m,t)),r[e]=W,o(e="MODULO_MODE")&&G(t,0,9,2,e)&&(K=0|t),r[e]=K,o(e="POW_PRECISION")&&G(t,0,E,2,e)&&(z=0|t),r[e]=z,o(e="FORMAT")&&("object"==typeof t?$=t:V&&S(2,e+" not an object",t)),r[e]=$,r},e.max=function(){return i(arguments,I.lt)},e.min=function(){return i(arguments,I.gt)},e.random=function(){var t=9007199254740992,n=Math.random()*t&2097151?function(){return b(Math.random()*t)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(t){var r,i,u,o,s,a=0,c=[],f=new e(L);if(t=null!=t&&G(t,0,E,14)?0|t:D,o=g(t/T),W)if(crypto.getRandomValues){for(r=crypto.getRandomValues(new Uint32Array(o*=2));a<o;)s=131072*r[a]+(r[a+1]>>>11),s>=9e15?(i=crypto.getRandomValues(new Uint32Array(2)),r[a]=i[0],r[a+1]=i[1]):(c.push(s%1e14),a+=2);a=o/2}else if(crypto.randomBytes){for(r=crypto.randomBytes(o*=7);a<o;)s=281474976710656*(31&r[a])+1099511627776*r[a+1]+4294967296*r[a+2]+16777216*r[a+3]+(r[a+4]<<16)+(r[a+5]<<8)+r[a+6],s>=9e15?crypto.randomBytes(7).copy(r,a):(c.push(s%1e14),a+=7);a=o/7}else W=!1,V&&S(14,"crypto unavailable",crypto);if(!W)for(;a<o;)(s=n())<9e15&&(c[a++]=s%1e14);for(o=c[--a],t%=T,o&&t&&(s=P[T-t],c[a]=b(o/s)*s);0===c[a];c.pop(),a--);if(a<0)c=[u=0];else{for(u=-1;0===c[0];c.shift(),u-=T);for(a=1,s=c[0];s>=10;s/=10,a++);a<T&&(u-=T-a)}return f.e=u,f.c=c,f}}(),B=function(){function t(t,e,n){var r,i,u,o,s=0,a=t.length,c=e%M,f=e/M|0;for(t=t.slice();a--;)u=t[a]%M,o=t[a]/M|0,r=f*u+o*c,i=c*u+r%M*M+s,s=(i/n|0)+(r/M|0)+f*o,t[a]=i%n;return s&&t.unshift(s),t}function n(t,e,n,r){var i,u;if(n!=r)u=n>r?1:-1;else for(i=u=0;i<n;i++)if(t[i]!=e[i]){u=t[i]>e[i]?1:-1;break}return u}function r(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]<e[n]?1:0,t[n]=i*r+t[n]-e[n];for(;!t[0]&&t.length>1;t.shift());}return function(i,u,s,a,c){var f,l,d,h,p,_,v,y,g,m,k,w,x,O,P,M,E,j=i.s==u.s?1:-1,S=i.c,B=u.c;if(!(S&&S[0]&&B&&B[0]))return new e(i.s&&u.s&&(S?!B||S[0]!=B[0]:B)?S&&0==S[0]||!B?0*j:j/0:NaN);for(y=new e(j),g=y.c=[],l=i.e-u.e,j=s+l+1,c||(c=A,l=o(i.e/T)-o(u.e/T),j=j/T|0),d=0;B[d]==(S[d]||0);d++);if(B[d]>(S[d]||0)&&l--,j<0)g.push(1),h=!0;else{for(O=S.length,M=B.length,d=0,j+=2,p=b(c/(B[0]+1)),p>1&&(B=t(B,p,c),S=t(S,p,c),M=B.length,O=S.length),x=M,m=S.slice(0,M),k=m.length;k<M;m[k++]=0);E=B.slice(),E.unshift(0),P=B[0],B[1]>=c/2&&P++;do{if(p=0,(f=n(B,m,M,k))<0){if(w=m[0],M!=k&&(w=w*c+(m[1]||0)),(p=b(w/P))>1)for(p>=c&&(p=c-1),_=t(B,p,c),v=_.length,k=m.length;1==n(_,m,v,k);)p--,r(_,M<v?E:B,v,c),v=_.length,f=1;else 0==p&&(f=p=1),_=B.slice(),v=_.length;if(v<k&&_.unshift(0),r(m,_,k,c),k=m.length,f==-1)for(;n(B,m,M,k)<1;)p++,r(m,M<k?E:B,k,c),k=m.length}else 0===f&&(p++,m=[0]);g[d++]=p,m[0]?m[k++]=S[x]||0:(m=[S[x]],k=1)}while((x++<O||null!=m[0])&&j--);h=null!=m[0],g[0]||g.shift()}if(c==A){for(d=1,j=g[0];j>=10;j/=10,d++);N(y,s+(y.e=d+l*T-1)+1,a,h)}else y.e=l,y.r=+h;return y}}(),v=function(){var t=/^(-?)0([xbo])(?=\w[\w.]*$)/i,n=/^([^.]+)\.$/,r=/^\.([^.]+)$/,i=/^-?(Infinity|NaN)$/,u=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(o,s,a,c){var f,l=a?s:s.replace(u,"");if(i.test(l))o.s=isNaN(l)?null:l<0?-1:1;else{if(!a&&(l=l.replace(t,function(t,e,n){return f="x"==(n=n.toLowerCase())?16:"b"==n?2:8,c&&c!=f?t:e}),c&&(f=c,l=l.replace(n,"$1").replace(r,"0.$1")),s!=l))return new e(l,f);V&&S(C,"not a"+(c?" base "+c:"")+" number",s),o.s=null}o.c=o.e=null,C=0}}(),I.absoluteValue=I.abs=function(){var t=new e(this);return t.s<0&&(t.s=1),t},I.ceil=function(){return N(new e(this),this.e+1,2)},I.comparedTo=I.cmp=function(t,n){return C=1,a(this,new e(t,n))},I.decimalPlaces=I.dp=function(){var t,e,n=this.c;if(!n)return null;if(t=((e=n.length-1)-o(this.e/T))*T,e=n[e])for(;e%10==0;e/=10,t--);return t<0&&(t=0),t},I.dividedBy=I.div=function(t,n){return C=3,B(this,new e(t,n),D,R)},I.dividedToIntegerBy=I.divToInt=function(t,n){return C=4,B(this,new e(t,n),0,1)},I.equals=I.eq=function(t,n){return C=5,0===a(this,new e(t,n))},I.floor=function(){return N(new e(this),this.e+1,3)},I.greaterThan=I.gt=function(t,n){return C=6,a(this,new e(t,n))>0},I.greaterThanOrEqualTo=I.gte=function(t,n){return C=7,1===(n=a(this,new e(t,n)))||0===n},I.isFinite=function(){return!!this.c},I.isInteger=I.isInt=function(){return!!this.c&&o(this.e/T)>this.c.length-2},I.isNaN=function(){return!this.s},I.isNegative=I.isNeg=function(){return this.s<0},I.isZero=function(){return!!this.c&&0==this.c[0]},I.lessThan=I.lt=function(t,n){return C=8,a(this,new e(t,n))<0},I.lessThanOrEqualTo=I.lte=function(t,n){return C=9,(n=a(this,new e(t,n)))===-1||0===n},I.minus=I.sub=function(t,n){var r,i,u,s,a=this,c=a.s;if(C=10,t=new e(t,n),n=t.s,!c||!n)return new e(NaN);if(c!=n)return t.s=-n,a.plus(t);var f=a.e/T,l=t.e/T,d=a.c,h=t.c;if(!f||!l){if(!d||!h)return d?(t.s=-n,t):new e(h?a:NaN);if(!d[0]||!h[0])return h[0]?(t.s=-n,t):new e(d[0]?a:3==R?-0:0)}if(f=o(f),l=o(l),d=d.slice(),c=f-l){for((s=c<0)?(c=-c,u=d):(l=f,u=h),u.reverse(),n=c;n--;u.push(0));u.reverse()}else for(i=(s=(c=d.length)<(n=h.length))?c:n,c=n=0;n<i;n++)if(d[n]!=h[n]){s=d[n]<h[n];break}if(s&&(u=d,d=h,h=u,t.s=-t.s),(n=(i=h.length)-(r=d.length))>0)for(;n--;d[r++]=0);for(n=A-1;i>c;){if(d[--i]<h[i]){for(r=i;r&&!d[--r];d[r]=n);--d[r],d[i]+=A}d[i]-=h[i]}for(;0==d[0];d.shift(),--l);return d[0]?j(t,d,l):(t.s=3==R?-1:1,t.c=[t.e=0],t)},I.modulo=I.mod=function(t,n){var r,i,u=this;return C=11,t=new e(t,n),!u.c||!t.s||t.c&&!t.c[0]?new e(NaN):!t.c||u.c&&!u.c[0]?new e(u):(9==K?(i=t.s,t.s=1,r=B(u,t,0,3),t.s=i,r.s*=i):r=B(u,t,0,K),u.minus(r.times(t)))},I.negated=I.neg=function(){var t=new e(this);return t.s=-t.s||null,t},I.plus=I.add=function(t,n){var r,i=this,u=i.s;if(C=12,t=new e(t,n),n=t.s,!u||!n)return new e(NaN);if(u!=n)return t.s=-n,i.minus(t);var s=i.e/T,a=t.e/T,c=i.c,f=t.c;if(!s||!a){if(!c||!f)return new e(u/0);if(!c[0]||!f[0])return f[0]?t:new e(c[0]?i:0*u)}if(s=o(s),a=o(a),c=c.slice(),u=s-a){for(u>0?(a=s,r=f):(u=-u,r=c),r.reverse();u--;r.push(0));r.reverse()}for(u=c.length,n=f.length,u-n<0&&(r=f,f=c,c=r,n=u),u=0;n;)u=(c[--n]=c[n]+f[n]+u)/A|0,c[n]=A===c[n]?0:c[n]%A;return u&&(c.unshift(u),++a),j(t,c,a)},I.precision=I.sd=function(t){var e,n,r=this,i=r.c;if(null!=t&&t!==!!t&&1!==t&&0!==t&&(V&&S(13,"argument"+m,t),t!=!!t&&(t=null)),!i)return null;if(n=i.length-1,e=n*T+1,n=i[n]){for(;n%10==0;n/=10,e--);for(n=i[0];n>=10;n/=10,e++);}return t&&r.e+1>e&&(e=r.e+1),e},I.round=function(t,n){var r=new e(this);return(null==t||G(t,0,E,15))&&N(r,~~t+this.e+1,null!=n&&G(n,0,8,15,k)?0|n:R),r},I.shift=function(t){var n=this;return G(t,-O,O,16,"argument")?n.times("1e"+p(t)):new e(n.c&&n.c[0]&&(t<-O||t>O)?n.s*(t<0?0:1/0):n)},I.squareRoot=I.sqrt=function(){var t,n,r,i,u,a=this,c=a.c,f=a.s,l=a.e,d=D+4,h=new e("0.5");if(1!==f||!c||!c[0])return new e(!f||f<0&&(!c||c[0])?NaN:c?a:1/0);if(f=Math.sqrt(+a),0==f||f==1/0?(n=s(c),(n.length+l)%2==0&&(n+="0"),f=Math.sqrt(n),l=o((l+1)/2)-(l<0||l%2),f==1/0?n="1e"+l:(n=f.toExponential(),n=n.slice(0,n.indexOf("e")+1)+l),r=new e(n)):r=new e(f+""),r.c[0])for(l=r.e,f=l+d,f<3&&(f=0);;)if(u=r,r=h.times(u.plus(B(a,u,d,1))),s(u.c).slice(0,f)===(n=s(r.c)).slice(0,f)){if(r.e<l&&--f,"9999"!=(n=n.slice(f-3,f+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(N(r,r.e+D+2,1),t=!r.times(r).eq(a));break}if(!i&&(N(u,u.e+D+2,0),u.times(u).eq(a))){r=u;break}d+=4,f+=4,i=1}return N(r,r.e+D+1,R,t)},I.times=I.mul=function(t,n){var r,i,u,s,a,c,f,l,d,h,p,_,v,y,g,b=this,m=b.c,k=(C=17,t=new e(t,n)).c;if(!(m&&k&&m[0]&&k[0]))return!b.s||!t.s||m&&!m[0]&&!k||k&&!k[0]&&!m?t.c=t.e=t.s=null:(t.s*=b.s,m&&k?(t.c=[0],t.e=0):t.c=t.e=null),t;for(i=o(b.e/T)+o(t.e/T),t.s*=b.s,f=m.length,h=k.length,f<h&&(v=m,m=k,k=v,u=f,f=h,h=u),u=f+h,v=[];u--;v.push(0));for(y=A,g=M,u=h;--u>=0;){for(r=0,p=k[u]%g,_=k[u]/g|0,a=f,s=u+a;s>u;)l=m[--a]%g,d=m[a]/g|0,c=_*l+d*p,l=p*l+c%g*g+v[s]+r,r=(l/y|0)+(c/g|0)+_*d,v[s--]=l%y;v[s]=r}return r?++i:v.shift(),j(t,v,i)},I.toDigits=function(t,n){var r=new e(this);return t=null!=t&&G(t,1,E,18,"precision")?0|t:null,n=null!=n&&G(n,0,8,18,k)?0|n:R,t?N(r,t,n):r},I.toExponential=function(t,e){return r(this,null!=t&&G(t,0,E,19)?1+~~t:null,e,19)},I.toFixed=function(t,e){return r(this,null!=t&&G(t,0,E,20)?~~t+this.e+1:null,e,20)},I.toFormat=function(t,e){var n=r(this,null!=t&&G(t,0,E,21)?~~t+this.e+1:null,e,21);if(this.c){var i,u=n.split("."),o=+$.groupSize,s=+$.secondaryGroupSize,a=$.groupSeparator,c=u[0],f=u[1],l=this.s<0,d=l?c.slice(1):c,h=d.length;if(s&&(i=o,o=s,s=i,h-=i),o>0&&h>0){for(i=h%o||o,c=d.substr(0,i);i<h;i+=o)c+=a+d.substr(i,o);s>0&&(c+=a+d.slice(i)),l&&(c="-"+c)}n=f?c+$.decimalSeparator+((s=+$.fractionGroupSize)?f.replace(new RegExp("\\d{"+s+"}\\B","g"),"$&"+$.fractionGroupSeparator):f):c}return n},I.toFraction=function(t){var n,r,i,u,o,a,c,f,l,d=V,h=this,p=h.c,_=new e(L),v=r=new e(L),y=c=new e(L);if(null!=t&&(V=!1,a=new e(t),V=d,(d=a.isInt())&&!a.lt(L)||(V&&S(22,"max denominator "+(d?"out of range":"not an integer"),t),t=!d&&a.c&&N(a,a.e+1,1).gte(L)?a:null)),!p)return h.toString();for(l=s(p),u=_.e=l.length-h.e-1,_.c[0]=P[(o=u%T)<0?T+o:o],t=!t||a.cmp(_)>0?u>0?_:v:a,o=q,q=1/0,a=new e(l),c.c[0]=0;f=B(a,_,0,1),i=r.plus(f.times(y)),1!=i.cmp(t);)r=y,y=i,v=c.plus(f.times(i=v)),c=i,_=a.minus(f.times(i=_)),a=i;return i=B(t.minus(r),y,0,1),c=c.plus(i.times(v)),r=r.plus(i.times(y)),c.s=v.s=h.s,u*=2,n=B(v,y,u,R).minus(h).abs().cmp(B(c,r,u,R).minus(h).abs())<1?[v.toString(),y.toString()]:[c.toString(),r.toString()],q=o,n},I.toNumber=function(){return+this},I.toPower=I.pow=function(t,n){var r,i,u,o=b(t<0?-t:+t),s=this;if(null!=n&&(C=23,n=new e(n)),!G(t,-O,O,23,"exponent")&&(!isFinite(t)||o>O&&(t/=0)||parseFloat(t)!=t&&!(t=NaN))||0==t)return r=Math.pow(+s,t),new e(n?r%n:r);for(n?t>1&&s.gt(L)&&s.isInt()&&n.gt(L)&&n.isInt()?s=s.mod(n):(u=n,n=null):z&&(r=g(z/T+2)),i=new e(L);;){if(o%2){if(i=i.times(s),!i.c)break;r?i.c.length>r&&(i.c.length=r):n&&(i=i.mod(n))}if(!(o=b(o/2)))break;s=s.times(s),r?s.c&&s.c.length>r&&(s.c.length=r):n&&(s=s.mod(n))}return n?i:(t<0&&(i=L.div(i)),u?i.mod(u):r?N(i,z,R):i)},I.toPrecision=function(t,e){return r(this,null!=t&&G(t,1,E,24,"precision")?0|t:null,e,24)},I.toString=function(t){var e,r=this,i=r.s,u=r.e;return null===u?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(e=s(r.c),e=null!=t&&G(t,2,64,25,"base")?n(h(e,u),0|t,10,i):u<=F||u>=U?d(e,u):h(e,u),i<0&&r.c[0]&&(e="-"+e)),e},I.truncated=I.trunc=function(){return N(new e(this),this.e+1,1)},I.valueOf=I.toJSON=function(){var t,e=this,n=e.e;return null===n?e.toString():(t=s(e.c),t=n<=F||n>=U?d(t,n):h(t,n),e.s<0?"-"+t:t)},null!=t&&e.config(t),e}function o(t){var e=0|t;return t>0||t===e?e:e-1}function s(t){for(var e,n,r=1,i=t.length,u=t[0]+"";r<i;){for(e=t[r++]+"",n=T-e.length;n--;e="0"+e);u+=e}for(i=u.length;48===u.charCodeAt(--i););return u.slice(0,i+1||1)}function a(t,e){var n,r,i=t.c,u=e.c,o=t.s,s=e.s,a=t.e,c=e.e;if(!o||!s)return null;if(n=i&&!i[0],r=u&&!u[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=a==c,!i||!u)return r?0:!i^n?1:-1;if(!r)return a>c^n?1:-1;for(s=(a=i.length)<(c=u.length)?a:c,o=0;o<s;o++)if(i[o]!=u[o])return i[o]>u[o]^n?1:-1;return a==c?0:a>c^n?1:-1}function c(t,e,n){return(t=p(t))>=e&&t<=n}function f(t){return"[object Array]"==Object.prototype.toString.call(t)}function l(t,e,n){for(var r,i,u=[0],o=0,s=t.length;o<s;){for(i=u.length;i--;u[i]*=e);for(u[r=0]+=x.indexOf(t.charAt(o++));r<u.length;r++)u[r]>n-1&&(null==u[r+1]&&(u[r+1]=0),u[r+1]+=u[r]/n|0,u[r]%=n)}return u.reverse()}function d(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function h(t,e){var n,r;if(e<0){for(r="0.";++e;r+="0");t=r+t}else if(n=t.length,++e>n){for(r="0",e-=n;--e;r+="0");t+=r}else e<n&&(t=t.slice(0,e)+"."+t.slice(e));return t}function p(t){return t=parseFloat(t),t<0?g(t):b(t)}var _,v,y=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,g=Math.ceil,b=Math.floor,m=" not a boolean or binary digit",k="rounding mode",w="number type has more than 15 significant digits",x="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",A=1e14,T=14,O=9007199254740991,P=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],M=1e7,E=1e9;_=u(),_.default=_.BigNumber=_,void 0!==(r=function(){return _}.call(e,n,e,t))&&(t.exports=r)}()},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports={}},function(t,e,n){t.exports={default:n(172),__esModule:!0}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(52);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if("]"===t[t.length-1]){var n=t.lastIndexOf("["),r=t.substr(n+1,t.length-n-2),u=i(t.substr(0,n));return 0===r.length?new s.default("array",u,0,e):new s.default("fixedArray",u,parseInt(r,10),e)}switch(t){case"address":case"bool":case"bytes":case"string":return new s.default(t,null,0,e);case"int":case"uint":return new s.default(t,null,256,e);default:if(0===t.indexOf("uint"))return new s.default("uint",null,parseInt(t.substr(4),10),e);if(0===t.indexOf("int"))return new s.default("int",null,parseInt(t.substr(3),10),e);if(0===t.indexOf("bytes"))return new s.default("fixedBytes",null,parseInt(t.substr(5),10),e);throw new Error("Cannot convert "+t+" to valid ParamType")}}function u(t){switch(t.type){case"address":case"bool":case"bytes":case"string":return t.type;case"int":case"uint":return""+t.type+t.length;case"fixedBytes":return"bytes"+t.length;case"fixedArray":return u(t.subtype)+"["+t.length+"]";case"array":return u(t.subtype)+"[]";default:throw new Error("Cannot convert from ParamType "+t.type)}}Object.defineProperty(e,"__esModule",{value:!0}),e.toParamType=i,e.fromParamType=u;var o=n(44),s=r(o)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(0),u=r(i),o=n(1),s=r(o),a=n(69),c=r(a),f=function(){function t(e,n){(0,u.default)(this,t),t.validateType(e),this._type=e,this._value=n}return(0,s.default)(t,[{key:"type",get:function(){return this._type}},{key:"value",get:function(){return this._value}}],[{key:"validateType",value:function(t){if(c.default.filter(function(e){return t===e}).length)return!0;throw new Error("Invalid type "+t+" received for Token")}}]),t}();e.default=f},function(t,e,n){"use strict";function r(t){return"[object Array]"===Object.prototype.toString.call(t)}function i(t){return"[object String]"===Object.prototype.toString.call(t)}function u(t,e){return t instanceof e}Object.defineProperty(e,"__esModule",{value:!0}),e.isArray=r,e.isString=i,e.isInstanceOf=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Logging=void 0;var i=n(72),u=r(i),o=n(145),s=r(o);e.Logging=u.default,e.default=s.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t){return"0x"+Buffer.from(t).toString("hex")}function u(t,e){if(t instanceof Array&&e.match(/bytes[0-9]+/)){for(var n="",r=0,u=!1;r<t.length&&null!==n;++r){var o=t[r];0===o?u=!0:n+=String.fromCharCode(o),(u&&0!==o||!u&&(o<32||o>=128))&&(n=null)}t=null===n?i(t):n}return"uint"===e.substr(0,4)&&+e.substr(4)<=48&&(t=+t),t}function o(t){for(var e=d(t).slice(2),n=[],r=0;r<e.length;r+=2)n.push(parseInt(e.substr(r,2),16));return n}function s(t){return o(t).map(function(t){return String.fromCharCode(t)}).join("")}function a(t){return t.map(function(t){return String.fromCharCode(t%512)}).join("")}function c(t){return"0x"+t.split("").map(function(t){return t.charCodeAt(0).toString(16)}).join("")}function f(t,e){var n=d(t).substr(2,2*e);return"0x"+n+(0,p.default)(2*e-n.length).map(function(){return"0"}).join("")}function l(t,e){var n=d(t).substr(2,2*e);return"0x"+(0,p.default)(2*e-n.length).map(function(){return"0"}).join("")+n}function d(t){return t&&t.toString&&(t=t.toString(16)),t&&"0x"===t.substr(0,2)?t.toLowerCase():"0x"+(t||"").toLowerCase()}Object.defineProperty(e,"__esModule",{value:!0});var h=n(232),p=r(h);e.bytesToHex=i,e.cleanupValue=u,e.hexToBytes=o,e.hexToAscii=s,e.bytesToAscii=a,e.asciiToHex=c,e.padRight=f,e.padLeft=l,e.toHex=d},function(t,e,n){t.exports={default:n(167),__esModule:!0}},function(t,e){t.exports=!0},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(14).f,i=n(17),u=n(3)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,u)&&r(t,u,{configurable:!0,value:e})}},function(t,e,n){var r=n(54);t.exports=function(t){return Object(r(t))}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){"use strict";var r=n(201)(!0);n(82)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){n(205);for(var r=n(4),i=n(18),u=n(23),o=n(3)("toStringTag"),s=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],a=0;a<5;a++){var c=s[a],f=r[c],l=f&&f.prototype;l&&!l[o]&&i(l,o,c),u[c]=u.Array}},function(t,e){!function(e){"use strict";function n(t,e,n){this.blocks=[],this.s=[],this.padding=e,this.outputBits=n,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}"object"==typeof process&&process.versions&&process.versions.node&&(e=global);for(var r=!e.JS_SHA3_TEST&&"object"==typeof t&&t.exports,i="0123456789abcdef".split(""),u=[31,7936,2031616,520093696],o=[1,256,65536,16777216],s=[6,1536,393216,100663296],a=[0,8,16,24],c=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],f=[224,256,384,512],l=[128,256],d=["hex","buffer","arrayBuffer","array"],h=function(t,e,r){return function(i){return new n(t,e,t).update(i)[r]()}},p=function(t,e,r){return function(i,u){return new n(t,e,u).update(i)[r]()}},_=function(t,e){var r=h(t,e,"hex");r.create=function(){return new n(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i<d.length;++i){var u=d[i];r[u]=h(t,e,u)}return r},v=function(t,e){var r=p(t,e,"hex");r.create=function(r){return new n(t,e,r)},r.update=function(t,e){return r.create(e).update(t)};for(var i=0;i<d.length;++i){var u=d[i];r[u]=p(t,e,u)}return r},y=[{name:"keccak",padding:o,bits:f,createMethod:_},{name:"sha3",padding:s,bits:f,createMethod:_},{name:"shake",padding:u,bits:l,createMethod:v}],g={},b=0;b<y.length;++b)for(var m=y[b],k=m.bits,w=0;w<k.length;++w)g[m.name+"_"+k[w]]=m.createMethod(k[w],m.padding);n.prototype.update=function(t){var n="string"!=typeof t;n&&t.constructor==e.ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,u=t.length,o=this.blocks,s=this.byteCount,c=this.blockCount,f=0,l=this.s;f<u;){if(this.reset)for(this.reset=!1,o[0]=this.block,r=1;r<c+1;++r)o[r]=0;if(n)for(r=this.start;f<u&&r<s;++f)o[r>>2]|=t[f]<<a[3&r++];else for(r=this.start;f<u&&r<s;++f)i=t.charCodeAt(f),i<128?o[r>>2]|=i<<a[3&r++]:i<2048?(o[r>>2]|=(192|i>>6)<<a[3&r++],o[r>>2]|=(128|63&i)<<a[3&r++]):i<55296||i>=57344?(o[r>>2]|=(224|i>>12)<<a[3&r++],o[r>>2]|=(128|i>>6&63)<<a[3&r++],o[r>>2]|=(128|63&i)<<a[3&r++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++f)),o[r>>2]|=(240|i>>18)<<a[3&r++],o[r>>2]|=(128|i>>12&63)<<a[3&r++],o[r>>2]|=(128|i>>6&63)<<a[3&r++],o[r>>2]|=(128|63&i)<<a[3&r++]);if(this.lastByteIndex=r,r>=s){for(this.start=r-s,this.block=o[c],r=0;r<c;++r)l[r]^=o[r];x(l),this.reset=!0}else this.start=r}return this},n.prototype.finalize=function(){var t=this.blocks,e=this.lastByteIndex,n=this.blockCount,r=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex==this.byteCount)for(t[0]=t[n],e=1;e<n+1;++e)t[e]=0;for(t[n-1]|=2147483648,e=0;e<n;++e)r[e]^=t[e];x(r)},n.prototype.toString=n.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,n=this.s,r=this.outputBlocks,u=this.extraBytes,o=0,s=0,a="";s<r;){for(o=0;o<e&&s<r;++o,++s)t=n[o],a+=i[t>>4&15]+i[15&t]+i[t>>12&15]+i[t>>8&15]+i[t>>20&15]+i[t>>16&15]+i[t>>28&15]+i[t>>24&15];s%e==0&&(x(n),o=0)}return u&&(t=n[o],u>0&&(a+=i[t>>4&15]+i[15&t]),u>1&&(a+=i[t>>12&15]+i[t>>8&15]),u>2&&(a+=i[t>>20&15]+i[t>>16&15])),a},n.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,u=0,o=0,s=this.outputBits>>3;t=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var a=new Uint32Array(t);o<r;){for(u=0;u<e&&o<r;++u,++o)a[o]=n[u];o%e==0&&x(n)}return i&&(a[u]=n[u],t=t.slice(0,s)),t},n.prototype.buffer=n.prototype.arrayBuffer,n.prototype.digest=n.prototype.array=function(){this.finalize();for(var t,e,n=this.blockCount,r=this.s,i=this.outputBlocks,u=this.extraBytes,o=0,s=0,a=[];s<i;){for(o=0;o<n&&s<i;++o,++s)t=s<<2,e=r[o],a[t]=255&e,a[t+1]=e>>8&255,a[t+2]=e>>16&255,a[t+3]=e>>24&255;s%n==0&&x(r)}return u&&(t=s<<2,e=r[o],u>0&&(a[t]=255&e),u>1&&(a[t+1]=e>>8&255),u>2&&(a[t+2]=e>>16&255)),a};var x=function(t){var e,n,r,i,u,o,s,a,f,l,d,h,p,_,v,y,g,b,m,k,w,x,A,T,O,P,M,E,j,S,N,B,C,I,L,D,R,F,U,H,q,V,G,W,K,z,$,J,Q,Y,X,Z,tt,et,nt,rt,it,ut,ot,st,at,ct,ft;for(r=0;r<48;r+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],u=t[1]^t[11]^t[21]^t[31]^t[41],o=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],a=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],d=t[7]^t[17]^t[27]^t[37]^t[47],h=t[8]^t[18]^t[28]^t[38]^t[48],p=t[9]^t[19]^t[29]^t[39]^t[49],e=h^(o<<1|s>>>31),n=p^(s<<1|o>>>31),t[0]^=e,t[1]^=n,t[10]^=e,t[11]^=n,t[20]^=e,t[21]^=n,t[30]^=e,t[31]^=n,t[40]^=e,t[41]^=n,e=i^(a<<1|f>>>31),n=u^(f<<1|a>>>31),t[2]^=e,t[3]^=n,t[12]^=e,t[13]^=n,t[22]^=e,t[23]^=n,t[32]^=e,t[33]^=n,t[42]^=e,t[43]^=n,e=o^(l<<1|d>>>31),n=s^(d<<1|l>>>31),t[4]^=e,t[5]^=n,t[14]^=e,t[15]^=n,t[24]^=e,t[25]^=n,t[34]^=e,t[35]^=n,t[44]^=e,t[45]^=n,e=a^(h<<1|p>>>31),n=f^(p<<1|h>>>31),t[6]^=e,t[7]^=n,t[16]^=e,t[17]^=n,t[26]^=e,t[27]^=n,t[36]^=e,t[37]^=n,t[46]^=e,t[47]^=n,e=l^(i<<1|u>>>31),n=d^(u<<1|i>>>31),t[8]^=e,t[9]^=n,t[18]^=e,t[19]^=n,t[28]^=e,t[29]^=n,t[38]^=e,t[39]^=n,t[48]^=e,t[49]^=n,_=t[0],v=t[1],z=t[11]<<4|t[10]>>>28,$=t[10]<<4|t[11]>>>28,E=t[20]<<3|t[21]>>>29,j=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,G=t[41]<<18|t[40]>>>14,I=t[2]<<1|t[3]>>>31,L=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,Q=t[23]<<10|t[22]>>>22,S=t[33]<<13|t[32]>>>19,N=t[32]<<13|t[33]>>>19,ct=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,nt=t[4]<<30|t[5]>>>2,D=t[14]<<6|t[15]>>>26,R=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,m=t[24]<<11|t[25]>>>21,Y=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,B=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,T=t[6]<<28|t[7]>>>4,O=t[7]<<28|t[6]>>>4,rt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,k=t[36]<<21|t[37]>>>11,w=t[37]<<21|t[36]>>>11,Z=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,W=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,P=t[18]<<20|t[19]>>>12,M=t[19]<<20|t[18]>>>12,ut=t[29]<<7|t[28]>>>25,ot=t[28]<<7|t[29]>>>25,H=t[38]<<8|t[39]>>>24,q=t[39]<<8|t[38]>>>24,x=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=_^~y&b,t[1]=v^~g&m,t[10]=T^~P&E,t[11]=O^~M&j,t[20]=I^~D&F,t[21]=L^~R&U,t[30]=W^~z&J,t[31]=K^~$&Q,t[40]=et^~rt&ut,t[41]=nt^~it&ot,t[2]=y^~b&k,t[3]=g^~m&w,t[12]=P^~E&S,t[13]=M^~j&N,t[22]=D^~F&H,t[23]=R^~U&q,t[32]=z^~J&Y,t[33]=$^~Q&X,t[42]=rt^~ut&st,t[43]=it^~ot&at,t[4]=b^~k&x,t[5]=m^~w&A,t[14]=E^~S&B,t[15]=j^~N&C,t[24]=F^~H&V,t[25]=U^~q&G,t[34]=J^~Y&Z,t[35]=Q^~X&tt,t[44]=ut^~st&ct,t[45]=ot^~at&ft,t[6]=k^~x&_,t[7]=w^~A&v,t[16]=S^~B&T,t[17]=N^~C&O,t[26]=H^~V&I,t[27]=q^~G&L,t[36]=Y^~Z&W,t[37]=X^~tt&K,t[46]=st^~ct&et,t[47]=at^~ft&nt,t[8]=x^~_&y,t[9]=A^~v&g,t[18]=B^~T&P,t[19]=C^~O&M,t[28]=V^~I&D,t[29]=G^~L&R,t[38]=Z^~W&z,t[39]=tt^~K&$,t[48]=ct^~et&rt,t[49]=ft^~nt&it,t[0]^=c[r],t[1]^=c[r+1]};if(r)t.exports=g;else if(e)for(var A in g)e[A]=g[A]}(this)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(101),u=r(i);e.default=u.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(0),u=r(i),o=n(1),s=r(o),a=n(66),c=r(a),f=n(67),l=r(f),d=n(68),h=r(d),p=n(70),_=function(){function t(e){(0,u.default)(this,t),this._abi=e,this._constant=!!e.constant,this._payable=e.payable,this._inputs=h.default.toParams(e.inputs||[]),this._outputs=h.default.toParams(e.outputs||[]);var n=(0,p.methodSignature)(e.name,this.inputParamTypes()),r=n.id,i=n.name,o=n.signature;this._id=r,this._name=i,this._signature=o}return(0,s.default)(t,[{key:"inputParamTypes",value:function(){return this._inputs.map(function(t){return t.kind})}},{key:"outputParamTypes",value:function(){return this._outputs.map(function(t){return t.kind})}},{key:"encodeCall",value:function(t){return""+this._signature+l.default.encode(t)}},{key:"decodeInput",value:function(t){return c.default.decode(this.inputParamTypes(),t)}},{key:"decodeOutput",value:function(t){return c.default.decode(this.outputParamTypes(),t)}},{key:"abi",get:function(){return this._abi}},{key:"constant",get:function(){return this._constant}},{key:"name",get:function(){return this._name}},{key:"id",get:function(){return this._id}},{key:"payable",get:function(){return this._payable}},{key:"inputs",get:function(){return this._inputs}},{key:"outputs",get:function(){return this._outputs}},{key:"signature",get:function(){return this._signature}}]),t}();e.default=_},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(0),u=r(i),o=n(1),s=r(o),a=n(69),c=r(a),f=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(0,u.default)(this,t),t.validateType(e),this._type=e,this._subtype=n,this._length=r,this._indexed=i}return(0,s.default)(t,[{key:"type",get:function(){return this._type}},{key:"subtype",get:function(){return this._subtype}},{key:"length",get:function(){return this._length}},{key:"indexed",get:function(){return this._indexed}}],[{key:"validateType",value:function(t){if(c.default.filter(function(e){return t===e}).length)return!0;throw new Error("Invalid type "+t+" received for ParamType")}}]),t}();e.default=f},function(t,e,n){"use strict";function r(t){for(var e=t.replace("0x",""),n=(0,o.keccak_256)(e.toLowerCase()),r=0;r<40;r++){var i=e[r],u=i!==i.toUpperCase(),s=i!==i.toLowerCase(),a=parseInt(n[r],16);if(a>7&&u||a<=7&&s)return!1}return!0}function i(t){return!(!t||42!==t.length)&&(!!/^(0x)?[0-9a-f]{40}$/i.test(t)&&(!(!/^(0x)?[0-9a-f]{40}$/.test(t)&&!/^(0x)?[0-9A-F]{40}$/.test(t))||r(t)))}function u(t){var e=(t||"").toLowerCase();if(!i(e))return"";for(var n=(0,o.keccak_256)(e.slice(-40)),r="0x",u=0;u<40;u++)r=""+r+(parseInt(n[u],16)>7?e[u+2].toUpperCase():e[u+2]);return r}Object.defineProperty(e,"__esModule",{value:!0}),e.isChecksumValid=r,e.isAddress=i,e.toChecksumAddress=u;var o=n(41)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t){var e="0x"===t.substr(0,2)?t.substr(2):t;return(""+v+e).slice(-64)}function u(t){return(v+(t?"1":"0")).slice(-64)}function o(t){var e=new d.default(t);return e.lessThan(0)&&(e=new d.default("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16).plus(e).plus(1)),(""+v+e.toString(16)).slice(-64)}function s(t){if((0,_.isArray)(t))return t;if("0x"===t.substr(0,2)){return(t.substr(2).toLowerCase().match(/.{1,2}/g)||[]).map(function(t){return parseInt(t,16)})}return t.split("").map(function(t){return t.charCodeAt(0)})}function a(t){var e=s(t);return""+o(e.length)+c(e)}function c(t){var e=s(t),n=e.map(function(t){return("0"+t.toString(16)).slice(-2)}).join(""),r=64*Math.floor((n.length+63)/64);return(""+n+v).substr(0,r)}function f(t){return a(p.default.encode(t).split("").map(function(t){return t.charCodeAt(0)}))}Object.defineProperty(e,"__esModule",{value:!0}),e.padAddress=i,e.padBool=u,e.padU32=o,e.padBytes=a,e.padFixedBytes=c,e.padString=f;var l=n(20),d=r(l),h=n(96),p=r(h),_=n(30),v="0000000000000000000000000000000000000000000000000000000000000000"},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(0),u=r(i),o=n(1),s=r(o),a=function(){function t(e){(0,u.default)(this,t),this._transport=e}return(0,s.default)(t,[{key:"addListener",value:function(t,e,n,r){return r?this._transport.subscribe(t,n,e,r):this._transport.subscribe(t,n,e,[])}},{key:"removeListener",value:function(t){return this._transport.unsubscribe(t)}},{key:"unsubscribe",value:function(t){return this.removeListener(t)}}]),t}();e.default=a},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.ERROR_CODES=void 0;var i=n(24),u=r(i),o=n(7),s=r(o),a=n(0),c=r(a),f=n(9),l=r(f),d=n(1),h=r(d),p=n(8),_=r(p),v=n(217),y=r(v),g=e.ERROR_CODES={UNSUPPORTED_REQUEST:-32e3,NO_WORK:-32001,NO_AUTHOR:-32002,NO_NEW_WORK:-32003,NO_WORK_REQUIRED:-32004,NOT_ENOUGH_DATA:-32006,UNKNOWN_ERROR:-32009,TRANSACTION_ERROR:-32010,EXECUTION_ERROR:-32015,EXCEPTION_ERROR:-32016,ACCOUNT_LOCKED:-32020,PASSWORD_INVALID:-32021,ACCOUNT_ERROR:-32023,SIGNER_DISABLED:-32030,DAPPS_DISABLED:-32031,NETWORK_DISABLED:-32035,REQUEST_REJECTED:-32040,REQUEST_REJECTED_LIMIT:-32041,REQUEST_NOT_FOUND:-32042,COMPILATION_ERROR:-32050,ENCRYPTION_ERROR:-32055,FETCH_ERROR:-32060,INVALID_PARAMS:-32602},b=function(t){function e(t,n,r){(0,c.default)(this,e);var i=t+": "+n+": "+r,o=(0,l.default)(this,(e.__proto__||(0,s.default)(e)).call(this,i));return o.code=n,o.type=(0,u.default)(g).find(function(t){return g[t]===n})||"",o.method=t,o.text=r,o}return(0,_.default)(e,t),(0,h.default)(e,null,[{key:"requestRejected",value:function(){return new e(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,g.REQUEST_REJECTED,"Request has been rejected.")}}]),e}(y.default);e.default=b},function(t,e,n){t.exports={default:n(174),__esModule:!0}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n(77),u=r(i);e.default=u.default||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=n(158),u=r(i),o=n(76),s=r(o);e.default=function(){function t(t,e){var n=[],r=!0,i=!1,u=void 0;try{for(var o,a=(0,s.default)(t);!(r=(o=a.next()).done)&&(n.push(o.value),!e||n.length!==e);r=!0);}catch(t){i=!0,u=t}finally{try{!r&&a.return&&a.return()}finally{if(i)throw u}}return n}return function(e,n){if(Array.isArray(e))return e;if((0,u.default)(Object(e)))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(25),i=n(3)("toStringTag"),u="Arguments"==r(function(){return arguments}()),o=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=o(e=Object(t),i))?n:u?r(e):"Object"==(s=r(e))&&"function"==typeof e.callee?"Arguments":s}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(22),i=n(4).document,u=r(i)&&r(i.createElement);t.exports=function(t){return u?i.createElement(t):{}}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(10),i=n(194),u=n(56),o=n(59)("IE_PROTO"),s=function(){},a="prototype",c=function(){var t,e=n(55)("iframe"),r=u.length,i="<",o=">";for(e.style.display="none",n(79).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.ope