UNPKG

ethjs-query

Version:

A simple query layer for the Ethereum RPC.

2 lines 109 kB
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("Eth",[],r):"object"==typeof exports?exports.Eth=r():t.Eth=r()}(this,function(){return function(t){function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}var e={};return r.m=t,r.c=e,r.i=function(t){return t},r.d=function(t,r,e){Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:e})},r.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},r.p="",r(r.s=51)}([function(t,r){var e=t.exports={version:"2.5.4"};"number"==typeof __e&&(__e=e)},function(t,r){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(t,r,e){var n=e(39)("wks"),i=e(43),o=e(1).Symbol,u="function"==typeof o,s=t.exports=function(t){return n[t]||(n[t]=u&&o[t]||(u?o:i)("Symbol."+t))};s.store=n},function(t,r,e){var n=e(7);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},function(t,r,e){var n=e(1),i=e(0),o=e(12),u=e(6),s=e(14),h="prototype",a=function(t,r,e){var f,l,c,p=t&a.F,m=t&a.G,d=t&a.S,g=t&a.P,v=t&a.B,y=t&a.W,w=m?i:i[r]||(i[r]={}),M=w[h],b=m?n:d?n[r]:(n[r]||{})[h];m&&(e=r);for(f in e)l=!p&&b&&void 0!==b[f],l&&s(w,f)||(c=l?b[f]:e[f],w[f]=m&&"function"!=typeof b[f]?e[f]:v&&l?o(c,n):y&&b[f]==c?function(t){var r=function(r,e,n){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(r);case 2:return new t(r,e)}return new t(r,e,n)}return t.apply(this,arguments)};return r[h]=t[h],r}(c):g&&"function"==typeof c?o(Function.call,c):c,g&&((w.virtual||(w.virtual={}))[f]=c,t&a.R&&M&&!M[f]&&u(M,f,c)))};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,r,e){t.exports=!e(13)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,r,e){var n=e(9),i=e(38);t.exports=e(5)?function(t,r,e){return n.f(t,r,i(1,e))}:function(t,r,e){return t[r]=e,t}},function(t,r){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,r){t.exports={}},function(t,r,e){var n=e(3),i=e(65),o=e(86),u=Object.defineProperty;r.f=e(5)?Object.defineProperty:function(t,r,e){if(n(t),r=o(r,!0),n(e),i)try{return u(t,r,e)}catch(s){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[r]=e.value),t}},function(t,r){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,r){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,r,e){var n=e(10);t.exports=function(t,r,e){if(n(t),void 0===r)return t;switch(e){case 1:return function(e){return t.call(r,e)};case 2:return function(e,n){return t.call(r,e,n)};case 3:return function(e,n,i){return t.call(r,e,n,i)}}return function(){return t.apply(r,arguments)}}},function(t,r){t.exports=function(t){try{return!!t()}catch(r){return!0}}},function(t,r){var e={}.hasOwnProperty;t.exports=function(t,r){return e.call(t,r)}},function(t,r,e){"use strict";var n=e(29);t.exports=function(t){return"string"!=typeof t?t:n(t)?t.slice(2):t}},function(t,r,e){"use strict";(function(t,n){function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(r){return!1}}function o(){return t.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(r,e){if(o()<e)throw new RangeError("Invalid typed array length");return t.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=t.prototype):(null===r&&(r=new t(e)),r.length=e),r}function t(r,e,n){if(!(t.TYPED_ARRAY_SUPPORT||this instanceof t))return new t(r,e,n);if("number"==typeof r){if("string"==typeof e)throw Error("If encoding is specified then the first argument must be a string");return f(this,r)}return s(this,r,e,n)}function s(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?p(t,r,e,n):"string"==typeof r?l(t,r,e):m(t,r)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(0>t)throw new RangeError('"size" argument must not be negative')}function a(t,r,e,n){return h(r),r>0&&void 0!==e?"string"==typeof n?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}function f(r,e){if(h(e),r=u(r,0>e?0:0|d(e)),!t.TYPED_ARRAY_SUPPORT)for(var n=0;e>n;++n)r[n]=0;return r}function l(r,e,n){if("string"==typeof n&&""!==n||(n="utf8"),!t.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=0|v(e,n);r=u(r,i);var o=r.write(e,n);return o!==i&&(r=r.slice(0,o)),r}function c(t,r){var e=0>r.length?0:0|d(r.length);t=u(t,e);for(var n=0;e>n;n+=1)t[n]=255&r[n];return t}function p(r,e,n,i){if(0>n||n>e.byteLength)throw new RangeError("'offset' is out of bounds");if(n+(i||0)>e.byteLength)throw new RangeError("'length' is out of bounds");return e=void 0===n&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,n):new Uint8Array(e,n,i),t.TYPED_ARRAY_SUPPORT?(r=e,r.__proto__=t.prototype):r=c(r,e),r}function m(r,e){if(t.isBuffer(e)){var n=0|d(e.length);return r=u(r,n),0===r.length?r:(e.copy(r,0,0,n),r)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||$(e.length)?u(r,0):c(r,e);if("Buffer"===e.type&&X(e.data))return c(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function d(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function g(r){return+r!=r&&(r=0),t.alloc(+r)}function v(r,e){if(t.isBuffer(r))return r.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;"string"!=typeof r&&(r=""+r);var n=r.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Z(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(r).length;default:if(i)return Z(r).length;e=(""+e).toLowerCase(),i=!0}}function y(t,r,e){var n=!1;if((void 0===r||0>r)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),0>=e)return"";if(e>>>=0,r>>>=0,r>=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,r,e);case"utf8":case"utf-8":return B(this,r,e);case"ascii":return j(this,r,e);case"latin1":case"binary":return D(this,r,e);case"base64":return P(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function w(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function M(r,e,n,i,o){if(0===r.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:-2147483648>n&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:r.length-1),0>n&&(n=r.length+n),r.length>n){if(0>n){if(!o)return-1;n=0}}else{if(o)return-1;n=r.length-1}if("string"==typeof e&&(e=t.from(e,i)),t.isBuffer(e))return 0===e.length?-1:b(r,e,n,i,o);if("number"==typeof e)return e=255&e,t.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(r,e,n):Uint8Array.prototype.lastIndexOf.call(r,e,n):b(r,[e],n,i,o);throw new TypeError("val must be string, number or Buffer")}function b(t,r,e,n,i){function o(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}var u=1,s=t.length,h=r.length;if(void 0!==n&&(n=(n+"").toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(2>t.length||2>r.length)return-1;u=2,s/=2,h/=2,e/=2}var a;if(i){var f=-1;for(a=e;s>a;a++)if(o(t,a)===o(r,f===-1?0:a-f)){if(f===-1&&(f=a),a-f+1===h)return f*u}else f!==-1&&(a-=a-f),f=-1}else for(e+h>s&&(e=s-h),a=e;a>=0;a--){for(var l=!0,c=0;h>c;c++)if(o(t,a+c)!==o(r,c)){l=!1;break}if(l)return a}return-1}function _(t,r,e,n){e=+e||0;var i=t.length-e;n?(n=+n,n>i&&(n=i)):n=i;var o=r.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;n>u;++u){var s=parseInt(r.substr(2*u,2),16);if(isNaN(s))return u;t[e+u]=s}return u}function x(t,r,e,n){return J(Z(r,t.length-e),t,e,n)}function A(t,r,e,n){return J(z(r),t,e,n)}function E(t,r,e,n){return A(t,r,e,n)}function S(t,r,e,n){return J(V(r),t,e,n)}function T(t,r,e,n){return J(G(r,t.length-e),t,e,n)}function P(t,r,e){return K.fromByteArray(0===r&&e===t.length?t:t.slice(r,e))}function B(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;e>i;){var o=t[i],u=null,s=o>239?4:o>223?3:o>191?2:1;if(e>=i+s){var h,a,f,l;switch(s){case 1:128>o&&(u=o);break;case 2:h=t[i+1],128===(192&h)&&(l=(31&o)<<6|63&h,l>127&&(u=l));break;case 3:h=t[i+1],a=t[i+2],128===(192&h)&&128===(192&a)&&(l=(15&o)<<12|(63&h)<<6|63&a,l>2047&&(55296>l||l>57343)&&(u=l));break;case 4:h=t[i+1],a=t[i+2],f=t[i+3],128===(192&h)&&128===(192&a)&&128===(192&f)&&(l=(15&o)<<18|(63&h)<<12|(63&a)<<6|63&f,l>65535&&1114112>l&&(u=l))}}null===u?(u=65533,s=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=s}return R(n)}function R(t){var r=t.length;if(tt>=r)return String.fromCharCode.apply(String,t);for(var e="",n=0;r>n;)e+=String.fromCharCode.apply(String,t.slice(n,n+=tt));return e}function j(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;e>i;++i)n+=String.fromCharCode(127&t[i]);return n}function D(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;e>i;++i)n+=String.fromCharCode(t[i]);return n}function k(t,r,e){var n=t.length;r&&r>=0||(r=0),(!e||0>e||e>n)&&(e=n);for(var i="",o=r;e>o;++o)i+=H(t[o]);return i}function O(t,r,e){for(var n=t.slice(r,e),i="",o=0;n.length>o;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function L(t,r,e){if(t%1!==0||0>t)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function I(r,e,n,i,o,u){if(!t.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||u>e)throw new RangeError('"value" argument is out of bounds');if(n+i>r.length)throw new RangeError("Index out of range")}function C(t,r,e,n){0>r&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);o>i;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function Q(t,r,e,n){0>r&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);o>i;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function N(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(0>e)throw new RangeError("Index out of range")}function U(t,r,e,n,i){return i||N(t,r,e,4,3.4028234663852886e38,-3.4028234663852886e38),W.write(t,r,e,n,23,4),e+4}function F(t,r,e,n,i){return i||N(t,r,e,8,1.7976931348623157e308,-1.7976931348623157e308),W.write(t,r,e,n,52,8),e+8}function q(t){if(t=Y(t).replace(rt,""),2>t.length)return"";for(;t.length%4!==0;)t+="=";return t}function Y(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function H(t){return 16>t?"0"+t.toString(16):t.toString(16)}function Z(t,r){r=r||1/0;for(var e,n=t.length,i=null,o=[],u=0;n>u;++u){if(e=t.charCodeAt(u),e>55295&&57344>e){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(56320>e){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,128>e){if((r-=1)<0)break;o.push(e)}else if(2048>e){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(65536>e){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(e>=1114112)throw Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function z(t){for(var r=[],e=0;t.length>e;++e)r.push(255&t.charCodeAt(e));return r}function G(t,r){for(var e,n,i,o=[],u=0;t.length>u&&(r-=2)>=0;++u)e=t.charCodeAt(u),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function V(t){return K.toByteArray(q(t))}function J(t,r,e,n){for(var i=0;n>i&&(i+e<r.length&&i<t.length);++i)r[i+e]=t[i];return i}function $(t){return t!==t}var K=e(54),W=e(99),X=e(101);r.Buffer=t,r.SlowBuffer=g,r.INSPECT_MAX_BYTES=50,t.TYPED_ARRAY_SUPPORT=void 0!==n.TYPED_ARRAY_SUPPORT?n.TYPED_ARRAY_SUPPORT:i(),r.kMaxLength=o(),t.poolSize=8192,t._augment=function(r){return r.__proto__=t.prototype,r},t.from=function(t,r,e){return s(null,t,r,e)},t.TYPED_ARRAY_SUPPORT&&(t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0})),t.alloc=function(t,r,e){return a(null,t,r,e)},t.allocUnsafe=function(t){return f(null,t)},t.allocUnsafeSlow=function(t){return f(null,t)},t.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.compare=function(r,e){if(!t.isBuffer(r)||!t.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var n=r.length,i=e.length,o=0,u=Math.min(n,i);u>o;++o)if(r[o]!==e[o]){n=r[o],i=e[o];break}return i>n?-1:n>i?1:0},t.isEncoding=function(t){switch((t+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},t.concat=function(r,e){if(!X(r))throw new TypeError('"list" argument must be an Array of Buffers');if(0===r.length)return t.alloc(0);var n;if(void 0===e)for(e=0,n=0;r.length>n;++n)e+=r[n].length;var i=t.allocUnsafe(e),o=0;for(n=0;r.length>n;++n){var u=r[n];if(!t.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,o),o+=u.length}return i},t.byteLength=v,t.prototype._isBuffer=!0,t.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;t>r;r+=2)w(this,r,r+1);return this},t.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;t>r;r+=4)w(this,r,r+3),w(this,r+1,r+2);return this},t.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;t>r;r+=8)w(this,r,r+7),w(this,r+1,r+6),w(this,r+2,r+5),w(this,r+3,r+4);return this},t.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?B(this,0,t):y.apply(this,arguments)},t.prototype.equals=function(r){if(!t.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r||0===t.compare(this,r)},t.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},t.prototype.compare=function(r,e,n,i,o){if(!t.isBuffer(r))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=r?r.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),0>e||n>r.length||0>i||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;for(var u=o-i,s=n-e,h=Math.min(u,s),a=this.slice(i,o),f=r.slice(e,n),l=0;h>l;++l)if(a[l]!==f[l]){u=a[l],s=f[l];break}return s>u?-1:u>s?1:0},t.prototype.includes=function(t,r,e){return this.indexOf(t,r,e)!==-1},t.prototype.indexOf=function(t,r,e){return M(this,t,r,e,!0)},t.prototype.lastIndexOf=function(t,r,e){return M(this,t,r,e,!1)},t.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r=0|r,isFinite(e)?(e=0|e,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(0>e||0>r)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return _(this,t,r,e);case"utf8":case"utf-8":return x(this,t,r,e);case"ascii":return A(this,t,r,e);case"latin1":case"binary":return E(this,t,r,e);case"base64":return S(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;t.prototype.slice=function(r,e){var n=this.length;r=~~r,e=void 0===e?n:~~e,0>r?(r+=n,0>r&&(r=0)):r>n&&(r=n),0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),r>e&&(e=r);var i;if(t.TYPED_ARRAY_SUPPORT)i=this.subarray(r,e),i.__proto__=t.prototype;else{var o=e-r;i=new t(o,(void 0));for(var u=0;o>u;++u)i[u]=this[u+r]}return i},t.prototype.readUIntLE=function(t,r,e){t=0|t,r=0|r,e||L(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},t.prototype.readUIntBE=function(t,r,e){t=0|t,r=0|r,e||L(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},t.prototype.readUInt8=function(t,r){return r||L(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,r){return r||L(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,r){return r||L(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,r){return r||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,r){return r||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readIntLE=function(t,r,e){t=0|t,r=0|r,e||L(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return i*=128,i>n||(n-=Math.pow(2,8*r)),n},t.prototype.readIntBE=function(t,r,e){t=0|t,r=0|r,e||L(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,i>o||(o-=Math.pow(2,8*r)),o},t.prototype.readInt8=function(t,r){return r||L(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},t.prototype.readInt16LE=function(t,r){r||L(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},t.prototype.readInt16BE=function(t,r){r||L(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},t.prototype.readInt32LE=function(t,r){return r||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,r){return r||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,r){return r||L(t,4,this.length),W.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,r){return r||L(t,4,this.length),W.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,r){return r||L(t,8,this.length),W.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,r){return r||L(t,8,this.length),W.read(this,t,!1,52,8)},t.prototype.writeUIntLE=function(t,r,e,n){if(t=+t,r=0|r,e=0|e,!n){var i=Math.pow(2,8*e)-1;I(this,t,r,e,i,0)}var o=1,u=0;for(this[r]=255&t;++u<e&&(o*=256);)this[r+u]=t/o&255;return r+e},t.prototype.writeUIntBE=function(t,r,e,n){if(t=+t,r=0|r,e=0|e,!n){var i=Math.pow(2,8*e)-1;I(this,t,r,e,i,0)}var o=e-1,u=1;for(this[r+o]=255&t;--o>=0&&(u*=256);)this[r+o]=t/u&255;return r+e},t.prototype.writeUInt8=function(r,e,n){return r=+r,e=0|e,n||I(this,r,e,1,255,0),t.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=255&r,e+1},t.prototype.writeUInt16LE=function(r,e,n){return r=+r,e=0|e,n||I(this,r,e,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[e]=255&r,this[e+1]=r>>>8):C(this,r,e,!0),e+2},t.prototype.writeUInt16BE=function(r,e,n){return r=+r,e=0|e,n||I(this,r,e,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=255&r):C(this,r,e,!1),e+2},t.prototype.writeUInt32LE=function(r,e,n){return r=+r,e=0|e,n||I(this,r,e,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=255&r):Q(this,r,e,!0),e+4},t.prototype.writeUInt32BE=function(r,e,n){return r=+r,e=0|e,n||I(this,r,e,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=255&r):Q(this,r,e,!1),e+4},t.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r=0|r,!n){var i=Math.pow(2,8*e-1);I(this,t,r,e,i-1,-i)}var o=0,u=1,s=0;for(this[r]=255&t;++o<e&&(u*=256);)0>t&&0===s&&0!==this[r+o-1]&&(s=1),this[r+o]=(t/u>>0)-s&255;return r+e},t.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r=0|r,!n){var i=Math.pow(2,8*e-1);I(this,t,r,e,i-1,-i)}var o=e-1,u=1,s=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)0>t&&0===s&&0!==this[r+o+1]&&(s=1),this[r+o]=(t/u>>0)-s&255;return r+e},t.prototype.writeInt8=function(r,e,n){return r=+r,e=0|e,n||I(this,r,e,1,127,-128),t.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),0>r&&(r=255+r+1),this[e]=255&r,e+1},t.prototype.writeInt16LE=function(r,e,n){return r=+r,e=0|e,n||I(this,r,e,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[e]=255&r,this[e+1]=r>>>8):C(this,r,e,!0),e+2},t.prototype.writeInt16BE=function(r,e,n){return r=+r,e=0|e,n||I(this,r,e,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=255&r):C(this,r,e,!1),e+2},t.prototype.writeInt32LE=function(r,e,n){return r=+r,e=0|e,n||I(this,r,e,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[e]=255&r,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):Q(this,r,e,!0),e+4},t.prototype.writeInt32BE=function(r,e,n){return r=+r,e=0|e,n||I(this,r,e,4,2147483647,-2147483648),0>r&&(r=4294967295+r+1),t.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=255&r):Q(this,r,e,!1),e+4},t.prototype.writeFloatLE=function(t,r,e){return U(this,t,r,!0,e)},t.prototype.writeFloatBE=function(t,r,e){return U(this,t,r,!1,e)},t.prototype.writeDoubleLE=function(t,r,e){return F(this,t,r,!0,e)},t.prototype.writeDoubleBE=function(t,r,e){return F(this,t,r,!1,e)},t.prototype.copy=function(r,e,n,i){if(n||(n=0),i||0===i||(i=this.length),r.length>e||(e=r.length),e||(e=0),i>0&&n>i&&(i=n),i===n)return 0;if(0===r.length||0===this.length)return 0;if(0>e)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("sourceStart out of bounds");if(0>i)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),i-n>r.length-e&&(i=r.length-e+n);var o,u=i-n;if(this===r&&e>n&&i>e)for(o=u-1;o>=0;--o)r[o+e]=this[o+n];else if(1e3>u||!t.TYPED_ARRAY_SUPPORT)for(o=0;u>o;++o)r[o+e]=this[o+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+u),e);return u},t.prototype.fill=function(r,e,n,i){if("string"==typeof r){if("string"==typeof e?(i=e,e=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===r.length){var o=r.charCodeAt(0);256>o&&(r=o)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!t.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof r&&(r=255&r);if(0>e||e>this.length||n>this.length)throw new RangeError("Out of range index");if(e>=n)return this;e>>>=0,n=void 0===n?this.length:n>>>0,r||(r=0);var u;if("number"==typeof r)for(u=e;n>u;++u)this[u]=r;else{var s=t.isBuffer(r)?r:Z(""+new t(r,i)),h=s.length;for(u=0;n-e>u;++u)this[u+e]=s[u%h]}return this};var rt=/[^+\/0-9A-Za-z-_]/g}).call(r,e(16).Buffer,e(107))},function(t,r){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,r,e){var n=e(7),i=e(1).document,o=n(i)&&n(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,r,e){"use strict";function n(t){var r,e;this.promise=new t(function(t,n){if(void 0!==r||void 0!==e)throw TypeError("Bad Promise constructor");r=t,e=n}),this.resolve=i(r),this.reject=i(e)}var i=e(10);t.exports.f=function(t){return new n(t)}},function(t,r,e){var n=e(78),i=e(31);t.exports=Object.keys||function(t){return n(t,i)}},function(t,r,e){var n=e(9).f,i=e(14),o=e(2)("toStringTag");t.exports=function(t,r,e){t&&!i(t=e?t:t.prototype,o)&&n(t,o,{configurable:!0,value:r})}},function(t,r,e){var n=e(39)("keys"),i=e(43);t.exports=function(t){return n[t]||(n[t]=i(t))}},function(t,r){var e=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:e)(t)}},function(t,r,e){var n=e(33),i=e(17);t.exports=function(t){return n(i(t))}},function(t,r,e){var n=e(17);t.exports=function(t){return Object(n(t))}},function(t,r,e){(function(t,n){function i(t,r){this._id=t,this._clearFn=r}var o=e(106).nextTick,u=Function.prototype.apply,s=Array.prototype.slice,h={},a=0;r.setTimeout=function(){return new i(u.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new i(u.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,r){clearTimeout(t._idleTimeoutId),t._idleTimeout=r},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var r=t._idleTimeout;0>r||(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},r))},r.setImmediate="function"==typeof t?t:function(t){var e=a++,n=arguments.length>=2&&s.call(arguments,1);return h[e]=!0,o(function(){h[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))}),e},r.clearImmediate="function"==typeof n?n:function(t){delete h[t]}}).call(r,e(26).setImmediate,e(26).clearImmediate)},function(t,r,e){t.exports={"default":e(56),__esModule:!0}},function(t,r,e){"use strict";var n=e(100),i=e(105);t.exports=function(t){if(!n(t.then))throw new TypeError("Expected a promise");return function(r){t.then(function(t){i(r,null,t)},function(t){i(r,t)})}}},function(t,r){"use strict";t.exports=function(t){if("string"!=typeof t)throw Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return"0x"===t.slice(0,2)}},function(t,r,e){var n=e(11),i=e(2)("toStringTag"),o="Arguments"==n(function(){return arguments}()),u=function(t,r){try{return t[r]}catch(e){}};t.exports=function(t){var r,e,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=u(r=Object(t),i))?e:o?n(r):"Object"==(s=n(r))&&"function"==typeof r.callee?"Arguments":s}},function(t,r){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,r,e){var n=e(1).document;t.exports=n&&n.documentElement},function(t,r,e){var n=e(11);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},function(t,r,e){"use strict";var n=e(35),i=e(4),o=e(82),u=e(6),s=e(8),h=e(69),a=e(21),f=e(77),l=e(2)("iterator"),c=!([].keys&&"next"in[].keys()),p="@@iterator",m="keys",d="values",g=function(){return this};t.exports=function(t,r,e,v,y,w,M){h(e,r,v);var b,_,x,A=function(t){if(!c&&t in P)return P[t];switch(t){case m:return function(){return new e(this,t)};case d:return function(){return new e(this,t)}}return function(){return new e(this,t)}},E=r+" Iterator",S=y==d,T=!1,P=t.prototype,B=P[l]||P[p]||y&&P[y],R=B||A(y),j=y?S?A("entries"):R:void 0,D="Array"==r?P.entries||B:B;if(D&&(x=f(D.call(new t)),x!==Object.prototype&&x.next&&(a(x,E,!0),n||"function"==typeof x[l]||u(x,l,g))),S&&B&&B.name!==d&&(T=!0,R=function(){return B.call(this)}),n&&!M||!c&&!T&&P[l]||u(P,l,R),s[r]=R,s[E]=g,y)if(b={values:S?R:A(d),keys:w?R:A(m),entries:j},M)for(_ in b)_ in P||o(P,_,b[_]);else i(i.P+i.F*(c||T),r,b);return b}},function(t,r){t.exports=!0},function(t,r){t.exports=function(t){try{return{e:!1,v:t()}}catch(r){return{e:!0,v:r}}}},function(t,r,e){var n=e(3),i=e(7),o=e(19);t.exports=function(t,r){if(n(t),i(r)&&r.constructor===t)return r;var e=o.f(t),u=e.resolve;return u(r),e.promise}},function(t,r){t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},function(t,r,e){var n=e(1),i="__core-js_shared__",o=n[i]||(n[i]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,r,e){var n=e(3),i=e(10),o=e(2)("species");t.exports=function(t,r){var e,u=n(t).constructor;return void 0===u||void 0==(e=n(u)[o])?r:i(e)}},function(t,r,e){var n,i,o,u=e(12),s=e(66),h=e(32),a=e(18),f=e(1),l=f.process,c=f.setImmediate,p=f.clearImmediate,m=f.MessageChannel,d=f.Dispatch,g=0,v={},y="onreadystatechange",w=function(){var t=+this;if(v.hasOwnProperty(t)){var r=v[t];delete v[t],r()}},M=function(t){w.call(t.data)};c&&p||(c=function(t){for(var r=[],e=1;arguments.length>e;)r.push(arguments[e++]);return v[++g]=function(){s("function"==typeof t?t:Function(t),r)},n(g),g},p=function(t){delete v[t]},"process"==e(11)(l)?n=function(t){l.nextTick(u(w,t,1))}:d&&d.now?n=function(t){d.now(u(w,t,1))}:m?(i=new m,o=i.port2,i.port1.onmessage=M,n=u(o.postMessage,o,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(n=function(t){f.postMessage(t+"","*")},f.addEventListener("message",M,!1)):n=y in a("script")?function(t){h.appendChild(a("script"))[y]=function(){h.removeChild(this),w.call(t)}}:function(t){setTimeout(u(w,t,1),0)}),t.exports={set:c,clear:p}},function(t,r,e){var n=e(23),i=Math.min;t.exports=function(t){return t>0?i(n(t),9007199254740991):0}},function(t,r){var e=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+n).toString(36))}},function(t,r,e){t.exports={"default":e(57),__esModule:!0}},function(t,r,e){t.exports={"default":e(58),__esModule:!0}},function(t,r,e){t.exports={"default":e(59),__esModule:!0}},function(t,r,e){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}r.__esModule=!0;var i=e(53),o=n(i);r["default"]=function(t){return function(){var r=t.apply(this,arguments);return new o["default"](function(t,e){function n(i,u){try{var s=r[i](u),h=s.value}catch(a){return void e(a)}return s.done?void t(h):o["default"].resolve(h).then(function(t){n("next",t)},function(t){n("throw",t)})}return n("next")})}}},function(t,r,e){t.exports=e(103)},function(t,r,e){"use strict";function n(t,r,e){if(["string","number","object"].indexOf(typeof t)===-1||null===t)return t;var n=p(t),i=e&&n.toString(16).length%2?"0":"";if(p(t).isNeg())throw Error("[ethjs-format] while formatting quantity '"+n.toString(10)+"', invalid negative number. Number must be positive or zero.");return r?"0x"+i+n.toString(16):n}function i(t,r){var e=t;return l.tags.indexOf(t)===-1&&(e=n(t,r)),e}function o(t,r){var e=t,n=0;if("string"==typeof t&&(e="0x"+d(m(t)),n=v(e)),"0x00"===e&&(e="0x0"),"number"==typeof r&&null!==t&&"0x"!==e&&"0x0"!==e&&(!/^[0-9A-Fa-f]+$/.test(m(e))||n!==2+2*r))throw Error("[ethjs-format] hex string '"+e+"' must be an alphanumeric "+(2+2*r)+" utf8 byte hex (chars: a-fA-F) string, is "+n+" bytes");return e}function u(t,r,e){var n=Object.assign({},r),i=null;if("string"==typeof t&&(i="Boolean|EthSyncing"===t?Object.assign({},l.objects.EthSyncing):"DATA|Transaction"===t?Object.assign({},l.objects.Transaction):Object.assign({},l.objects[t])),!g(Object.keys(r),i.__required))throw Error("[ethjs-format] object "+JSON.stringify(r)+" must contain properties: "+i.__required.join(", "));return Object.keys(i).forEach(function(t){"__required"!==t&&void 0!==r[t]&&(n[t]=h(i[t],r[t],e))}),n}function s(t,r,e,n){var i=r.slice(),o=t;if("Array|DATA"===t&&(o=["D"]),"FilterChange"===t&&"string"==typeof r[0]&&(o=["D32"]),e===!0&&"number"==typeof n&&n>r.length)throw Error("array "+JSON.stringify(r)+" must contain at least "+n+" params, but only contains "+r.length+".");return o=o.slice(),r.forEach(function(t,r){var n=0;o.length>1&&(n=r),i[r]=h(o[n],t,e)}),i}function h(t,r,e,h){var a=r;return"Q"===t?a=n(r,e):"QP"===t?a=n(r,e,!0):"Q|T"===t?a=i(r,e):"D"===t?a=o(r):"D20"===t?a=o(r,20):"D32"===t?a=o(r,32):"object"==typeof r&&null!==r&&Array.isArray(r)===!1?a=u(t,r,e):Array.isArray(r)&&(a=s(t,r,e,h)),a}function a(t,r){return h(l.methods[t][0],r,!0,l.methods[t][2])}function f(t,r){return h(l.methods[t][1],r,!1)}var l=e(102),c=e(98),p=e(52),m=e(15),d=c.padToEven,g=c.arrayContainsArray,v=c.getBinarySize;t.exports={schema:l,formatQuantity:n,formatQuantityOrTag:i,formatObject:u,formatArray:s,format:h,formatInputs:a,formatOutputs:f}},function(t,r,e){ "use strict";function n(t,r){var e=this,i=r||{};if(!(this instanceof n))throw Error('[ethjs-rpc] the EthRPC object requires the "new" flag in order to function normally (i.e. `const eth = new EthRPC(provider);`).');e.options=Object.assign({jsonSpace:i.jsonSpace||0,max:i.max||9999999999999}),e.idCounter=Math.floor(Math.random()*e.options.max),(e.setProvider=function(t){if("object"!=typeof t)throw Error("[ethjs-rpc] the EthRPC object requires that the first input 'provider' must be an object, got '"+typeof t+"' (i.e. 'const eth = new EthRPC(provider);')");e.currentProvider=t})(t)}function i(t,r){return Object.assign({},{id:r,jsonrpc:"2.0",params:[]},t)}var o=e(28);t.exports=n,n.prototype.sendAsync=function(t,r){var e=this;e.idCounter=e.idCounter%e.options.max;var n=i(t,e.idCounter++),u=new Promise(function(t,r){e.currentProvider.sendAsync(n,function(i,o){var u=o||{};if(i||u.error){var s="[ethjs-rpc] "+(u.error&&"rpc"||"")+" error with payload "+JSON.stringify(n,null,e.options.jsonSpace)+" "+(i?i+"":JSON.stringify(u.error,null,e.options.jsonSpace)),h=Error(s);return h.value=i||u.error,void r(h)}t(u.result)})});return r?o(u)(r):u}},function(t,r,e){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t,r){var e=this,n=r||{};if(!(this instanceof i))throw Error('[ethjs-query] the Eth object requires the "new" flag in order to function normally (i.e. `const eth = new Eth(provider);`).');if("object"!=typeof t)throw Error("[ethjs-query] the Eth object requires that the first input 'provider' must be an object, got '"+typeof t+"' (i.e. 'const eth = new Eth(provider);')");e.options=(0,v["default"])({debug:n.debug||!1,logger:n.logger||console,jsonSpace:n.jsonSpace||0}),e.rpc=new w(t),e.setProvider=e.rpc.setProvider}function o(t,r){return function(){var e=function(){var e=(0,l["default"])(s["default"].mark(function n(){var e,f,l;return s["default"].wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(r[2]<=u.length){n.next=2;break}throw Error("[ethjs-query] method '"+h+"' requires at least "+r[2]+" input (format type "+r[0][0]+"), "+u.length+" provided. For more information visit: https://github.com/ethereum/wiki/wiki/JSON-RPC#"+t.toLowerCase());case 2:if(u.length<=r[0].length){n.next=4;break}throw Error("[ethjs-query] method '"+h+"' requires at most "+r[0].length+" params, "+u.length+" provided '"+(0,a["default"])(u,null,o.options.jsonSpace)+"'. For more information visit: https://github.com/ethereum/wiki/wiki/JSON-RPC#"+t.toLowerCase());case 4:r[3]&&r[3]>u.length&&u.push("latest"),this.log("attempting method formatting for '"+h+"' with inputs "+(0,a["default"])(u,null,this.options.jsonSpace)),n.prev=6,i=y.formatInputs(t,u),this.log("method formatting success for '"+h+"' with formatted result: "+(0,a["default"])(i,null,this.options.jsonSpace)),n.next=14;break;case 11:throw n.prev=11,n.t0=n["catch"](6),Error("[ethjs-query] while formatting inputs '"+(0,a["default"])(u,null,this.options.jsonSpace)+"' for method '"+h+"' error: "+n.t0);case 14:return n.next=16,this.rpc.sendAsync({method:t,params:i});case 16:return e=n.sent,n.prev=17,this.log("attempting method formatting for '"+h+"' with raw outputs: "+(0,a["default"])(e,null,this.options.jsonSpace)),f=y.formatOutputs(t,e),this.log("method formatting success for '"+h+"' formatted result: "+(0,a["default"])(f,null,this.options.jsonSpace)),n.abrupt("return",f);case 24:throw n.prev=24,n.t1=n["catch"](17),l=Error("[ethjs-query] while formatting outputs from RPC '"+(0,a["default"])(e,null,this.options.jsonSpace)+"' for method '"+h+"' "+n.t1);case 28:case"end":return n.stop()}},n,this,[[6,11],[17,24]])}));return function(){return e.apply(this,arguments)}}(),n=null,i=null,o=this,u=[].slice.call(arguments),h=t.replace("eth_","");u.length>0&&"function"==typeof u[u.length-1]&&(n=u.pop());var f=e.call(this);return n?M(f)(n):f}}var u=e(48),s=n(u),h=e(27),a=n(h),f=e(47),l=n(f),c=e(45),p=n(c),m=e(46),d=n(m),g=e(44),v=n(g),y=e(49),w=e(50),M=e(28);t.exports=i,i.prototype.log=function(t){var r=this;r.options.debug&&r.options.logger.log("[ethjs-query log] "+t)},(0,d["default"])(y.schema.methods).forEach(function(t){(0,p["default"])(i.prototype,t.replace("eth_",""),{enumerable:!0,value:o(t,y.schema.methods[t])})})},function(t,r,e){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}var i=e(27),o=n(i),u=e(55),s=e(15);t.exports=function(t){if("string"==typeof t||"number"==typeof t){var r=new u(1),e=(t+"").toLowerCase().trim(),n="0x"===e.substr(0,2)||"-0x"===e.substr(0,3),i=s(e);if("-"===i.substr(0,1)&&(i=s(i.slice(1)),r=new u((-1),10)),i=""===i?"0":i,!i.match(/^-?[0-9]+$/)&&i.match(/^[0-9A-Fa-f]+$/)||i.match(/^[a-fA-F]+$/)||n===!0&&i.match(/^[0-9A-Fa-f]+$/))return new u(i,16).mul(r);if((i.match(/^-?[0-9]+$/)||""===i)&&n===!1)return new u(i,10).mul(r)}else if("object"==typeof t&&t.toString&&!t.pop&&!t.push&&t.toString(10).match(/^-?[0-9]+$/)&&(t.mul||t.dividedToIntegerBy))return new u(t.toString(10),10);throw Error("[number-to-bn] while converting number "+(0,o["default"])(t)+" to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.")}},function(t,r,e){t.exports={"default":e(60),__esModule:!0}},function(t,r){"use strict";function e(t){var r=t.length;if(r%4>0)throw Error("Invalid string. Length must be a multiple of 4");return"="===t[r-2]?2:"="===t[r-1]?1:0}function n(t){return 3*t.length/4-e(t)}function i(t){var r,n,i,o,u,s=t.length;o=e(t),u=new f(3*s/4-o),n=o>0?s-4:s;var h=0;for(r=0;n>r;r+=4)i=a[t.charCodeAt(r)]<<18|a[t.charCodeAt(r+1)]<<12|a[t.charCodeAt(r+2)]<<6|a[t.charCodeAt(r+3)],u[h++]=i>>16&255,u[h++]=i>>8&255,u[h++]=255&i;return 2===o?(i=a[t.charCodeAt(r)]<<2|a[t.charCodeAt(r+1)]>>4,u[h++]=255&i):1===o&&(i=a[t.charCodeAt(r)]<<10|a[t.charCodeAt(r+1)]<<4|a[t.charCodeAt(r+2)]>>2,u[h++]=i>>8&255,u[h++]=255&i),u}function o(t){return h[t>>18&63]+h[t>>12&63]+h[t>>6&63]+h[63&t]}function u(t,r,e){for(var n,i=[],u=r;e>u;u+=3)n=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),i.push(o(n));return i.join("")}function s(t){for(var r,e=t.length,n=e%3,i="",o=[],s=16383,a=0,f=e-n;f>a;a+=s)o.push(u(t,a,a+s>f?f:a+s));return 1===n?(r=t[e-1],i+=h[r>>2],i+=h[r<<4&63],i+="=="):2===n&&(r=(t[e-2]<<8)+t[e-1],i+=h[r>>10],i+=h[r>>4&63],i+=h[r<<2&63],i+="="),o.push(i),o.join("")}r.byteLength=n,r.toByteArray=i,r.fromByteArray=s;for(var h=[],a=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,p=l.length;p>c;++c)h[c]=l[c],a[l.charCodeAt(c)]=c;a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},function(t,r,e){(function(t){!function(t,r){"use strict";function n(t,r){if(!t)throw Error(r||"Assertion failed")}function i(t,r){t.super_=r;var e=function(){};e.prototype=r.prototype,t.prototype=new e,t.prototype.constructor=t}function o(t,r,e){return o.isBN(t)?t:(this.negative=0,this.words=null,this.length=0,this.red=null,void(null!==t&&("le"!==r&&"be"!==r||(e=r,r=10),this._init(t||0,r||10,e||"be"))))}function u(t,r,e){for(var n=0,i=Math.min(t.length,e),o=r;i>o;o++){var u=t.charCodeAt(o)-48;n<<=4,n|=49>u||u>54?17>u||u>22?15&u:u-17+10:u-49+10}return n}function s(t,r,e,n){for(var i=0,o=Math.min(t.length,e),u=r;o>u;u++){var s=t.charCodeAt(u)-48;i*=n,i+=49>s?17>s?s:s-17+10:s-49+10}return i}function h(t){for(var r=Array(t.bitLength()),e=0;r.length>e;e++){var n=e/26|0,i=e%26;r[e]=(t.words[n]&1<<i)>>>i}return r}function a(t,r,e){e.negative=r.negative^t.negative;var n=t.length+r.length|0;e.length=n,n=n-1|0;var i=0|t.words[0],o=0|r.words[0],u=i*o,s=67108863&u,h=u/67108864|0;e.words[0]=s;for(var a=1;n>a;a++){for(var f=h>>>26,l=67108863&h,c=Math.min(a,r.length-1),p=Math.max(0,a-t.length+1);c>=p;p++){var m=a-p|0;i=0|t.words[m],o=0|r.words[p],u=i*o+l,f+=u/67108864|0,l=67108863&u}e.words[a]=0|l,h=0|f}return 0!==h?e.words[a]=0|h:e.length--,e.strip()}function f(t,r,e){e.negative=r.negative^t.negative,e.length=t.length+r.length;for(var n=0,i=0,o=0;e.length-1>o;o++){var u=i;i=0;for(var s=67108863&n,h=Math.min(o,r.length-1),a=Math.max(0,o-t.length+1);h>=a;a++){var f=o-a,l=0|t.words[f],c=0|r.words[a],p=l*c,m=67108863&p;u=u+(p/67108864|0)|0,m=m+s|0,s=67108863&m,u=u+(m>>>26)|0,i+=u>>>26,u&=67108863}e.words[o]=s,n=u,u=i}return 0!==n?e.words[o]=n:e.length--,e.strip()}function l(t,r,e){var n=new c;return n.mulp(t,r,e)}function c(t,r){this.x=t,this.y=r}function p(t,r){this.name=t,this.p=new o(r,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function m(){p.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function d(){p.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function g(){p.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function v(){p.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function y(t){if("string"==typeof t){var r=o._prime(t);this.m=r.p,this.prime=r}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function w(t){y.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"==typeof t?t.exports=o:r.BN=o,o.BN=o,o.wordSize=26;var M;try{M=e(16).Buffer}catch(b){}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,r){return t.cmp(r)>0?t:r},o.min=function(t,r){return t.cmp(r)<0?t:r},o.prototype._init=function(t,r,e){if("number"==typeof t)return this._initNumber(t,r,e);if("object"==typeof t)return this._initArray(t,r,e);"hex"===r&&(r=16),n(r===(0|r)&&r>=2&&36>=r),t=(""+t).replace(/\s+/g,"");var i=0;"-"===t[0]&&i++,16===r?this._parseHex(t,i):this._parseBase(t,r,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===e&&this._initArray(this.toArray(),r,e)},o.prototype._initNumber=function(t,r,e){0>t&&(this.negative=1,t=-t),67108864>t?(this.words=[67108863&t],this.length=1):4503599627370496>t?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(9007199254740992>t),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===e&&this._initArray(this.toArray(),r,e)},o.prototype._initArray=function(t,r,e){if(n("number"==typeof t.length),0>=t.length)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=Array(this.length);for(var i=0;this.length>i;i++)this.words[i]=0;var o,u,s=0;if("be"===e)for(i=t.length-1,o=0;i>=0;i-=3)u=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=u<<s&67108863,this.words[o+1]=u>>>26-s&67108863,s+=24,26>s||(s-=26,o++);else if("le"===e)for(i=0,o=0;t.length>i;i+=3)u=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=u<<s&67108863,this.words[o+1]=u>>>26-s&67108863,s+=24,26>s||(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,r){this.length=Math.ceil((t.length-r)/6),this.words=Array(this.length);for(var e=0;this.length>e;e++)this.words[e]=0;var n,i,o=0;for(e=t.length-6,n=0;e>=r;e-=6)i=u(t,e,e+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,o+=24,26>o||(o-=26,n++);e+6!==r&&(i=u(t,r,e+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,r,e){this.words=[0],this.length=1;for(var n=0,i=1;67108863>=i;i*=r)n++;n--,i=i/r|0;for(var o=t.length-e,u=o%n,h=Math.min(o,o-u)+e,a=0,f=e;h>f;f+=n)a=s(t,f,f+n,r),this.imuln(i),67108864>this.words[0]+a?this.words[0]+=a:this._iaddn(a);if(0!==u){var l=1;for(a=s(t,f,t.length,r),f=0;u>f;f++)l*=r;this.imuln(l),67108864>this.words[0]+a?this.words[0]+=a:this._iaddn(a)}},o.prototype.copy=function(t){t.words=Array(this.length);for(var r=0;this.length>r;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;t>this.length;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var _=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(t,r){t=t||10,r=0|r||1;var e;if(16===t||"hex"===t){e="";for(var i=0,o=0,u=0;this.length>u;u++){var s=this.words[u],h=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,e=0!==o||u!==this.length-1?_[6-h.length]+h+e:h+e,i+=2,26>i||(i-=26,u--)}for(0!==o&&(e=o.toString(16)+e);e.length%r!==0;)e="0"+e;return 0!==this.negative&&(e="-"+e),e}if(t===(0|t)&&t>=2&&36>=t){var a=x[t],f=A[t];e="";var l=this.clone();for(l.negative=0;!l.isZero();){var c=l.modn(f).toString(t);l=l.idivn(f),e=l.isZero()?c+e:_[a-c.length]+c+e}for(this.isZero()&&(e="0"+e);e.length%r!==0;)e="0"+e;return 0!==this.negative&&(e="-"+e),e}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,r){return n(void 0!==M),this.toArrayLike(M,t,r)},o.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},o.prototype.toArrayLike=function(t,r,e){var i=this.byteLength(),o=e||Math.max(1,i);n(o>=i,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var u,s,h="le"===r,a=new t(o),f=this.clone();if(h){for(s=0;!f.isZero();s++)u=f.andln(255),f.iushrn(8),a[s]=u;for(;o>s;s++)a[s]=0}else{for(s=0;o-i>s;s++)a[s]=0;for(s=0;!f.isZero();s++)u=f.andln(255),f.iushrn(8),a[o-s-1]=u}return a},o.prototype._countBits=Math.clz32?function(t){return 32-Math.clz32(t)}:function(t){var r=t,e=0;return 4096>r||(e+=13,r>>>=13),64>r||(e+=7,r>>>=7),8>r||(e+=4,r>>>=4),2>r||(e+=2,r>>>=2),e+r},o.prototype._zeroBits=function(t){if(0===t)return 26;var r=t,e=0;return 0===(8191&r)&&(e+=13,r>>>=13),0===(127&r)&&(e+=7,r>>>=7),0===(15&r)&&(e+=4,r>>>=4),0===(3&r)&&(e+=2,r>>>=2),0===(1&r)&&e++,e},o.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return 26*(this.length-1)+r},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;this.length>r;r++){var e=this._zeroBits(this.words[r]);if(t+=e,26!==e)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;t.length>this.length;)this.words[this.length++]=0;for(var r=0;t.length>r;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},o.prototype.ior=function(t){return n(0===(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var r;r=this.length>t.length?t:this;for(var e=0;r.length>e;e++)this.words[e]=this.words[e]&t.words[e];return this.length=r.length,this.strip()},o.prototype.iand=function(t){return n(0===(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var r,e;this.length>t.length?(r=this,e=t):(r=t,e=this);for(var n=0;e.length>n;n++)this.words[n]=r.words[n]^e.words[n];if(this!==r)for(;r.length>n;n++)this.words[n]=r.words[n];return this.length=r.length,this.strip()},o.prototype.ixor=function(t){return n(0===(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var r=0|Math.ceil(t/26),e=t%26;this._expand(r),e>0&&r--;for(var i=0;r>i;i++)this.words[i]=67108863&~this.words[i];return e>0&&(this.words[i]=~this.words[i]&67108863>>26-e),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,r){n("number"==typeof t&&t>=0);var e=t/26|0,i=t%26;return this._expand(e+1),this.words[e]=r?this.words[e]|1<<i:this.words[e]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var r;if(0!==this.negative&&0===t.negative)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.