UNPKG

@helena-pm/pm-js

Version:

A javascript library for building applications on top of Gnosis, the Ethereum prediction market platform

8 lines 708 kB
var Gnosis=function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=516)}([function(e,t,n){e.exports=function(){var e=e||function(e,t){var n=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),r={},a=r.lib={},i=a.Base={extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=a.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=t?t:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,a=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<a;i++){var o=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=o<<24-(r+i)%4*8}else for(var i=0;i<a;i+=4)t[r+i>>>2]=n[i>>>2];return this.sigBytes+=a,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n,r=[],a=function(t){var t=t,n=987654321,r=4294967295;return function(){var a=((n=36969*(65535&n)+(n>>16)&r)<<16)+(t=18e3*(65535&t)+(t>>16)&r)&r;return a/=4294967296,(a+=.5)*(e.random()>.5?1:-1)}},i=0;i<t;i+=4){var s=a(4294967296*(n||e.random()));n=987654071*s(),r.push(4294967296*s()|0)}return new o.init(r,t)}}),s=r.enc={},u=s.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],a=0;a<n;a++){var i=t[a>>>2]>>>24-a%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},c=s.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],a=0;a<n;a++){var i=t[a>>>2]>>>24-a%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},p=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},l=a.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,a=n.sigBytes,i=this.blockSize,s=4*i,u=a/s,c=(u=t?e.ceil(u):e.max((0|u)-this._minBufferSize,0))*i,p=e.min(4*c,a);if(c){for(var l=0;l<c;l+=i)this._doProcessBlock(r,l);var f=r.splice(0,c);n.sigBytes-=p}return new o.init(f,p)},clone:function(){var e=i.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),f=(a.Hasher=l.extend({cfg:i.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){e&&this._append(e);var t=this._doFinalize();return t},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new f.HMAC.init(e,n).finalize(t)}}}),r.algo={});return r}(Math);return e}()},function(e,t){var n=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},function(e,t,n){e.exports=function(e){e.lib.Cipher||function(t){var n=e,r=n.lib,a=r.Base,i=r.WordArray,o=r.BufferedBlockAlgorithm,s=n.enc,u=(s.Utf8,s.Base64),c=n.algo,p=c.EvpKDF,l=r.Cipher=o.extend({cfg:a.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){e&&this._append(e);var t=this._doFinalize();return t},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?M:w}return function(t){return{encrypt:function(n,r,a){return e(r).encrypt(t,n,r,a)},decrypt:function(n,r,a){return e(r).decrypt(t,n,r,a)}}}}()}),f=(r.StreamCipher=l.extend({_doFinalize:function(){var e=this._process(!0);return e},blockSize:1}),n.mode={}),d=r.BlockCipherMode=a.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=f.CBC=function(){var e=d.extend();function n(e,n,r){var a=this._iv;if(a){var i=a;this._iv=t}else var i=this._prevBlock;for(var o=0;o<r;o++)e[n+o]^=i[o]}return e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,a=r.blockSize;n.call(this,e,t,a),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+a)}}),e.Decryptor=e.extend({processBlock:function(e,t){var r=this._cipher,a=r.blockSize,i=e.slice(t,t+a);r.decryptBlock(e,t),n.call(this,e,t,a),this._prevBlock=i}}),e}(),m=n.pad={},y=m.Pkcs7={pad:function(e,t){for(var n=4*t,r=n-e.sigBytes%n,a=r<<24|r<<16|r<<8|r,o=[],s=0;s<r;s+=4)o.push(a);var u=i.create(o,r);e.concat(u)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},v=(r.BlockCipher=l.extend({cfg:l.cfg.extend({mode:h,padding:y}),reset:function(){l.reset.call(this);var e=this.cfg,t=e.iv,n=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=n.createEncryptor;else{var r=n.createDecryptor;this._minBufferSize=1}this._mode=r.call(n,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),r.CipherParams=a.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),g=n.format={},b=g.OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;if(n)var r=i.create([1398893684,1701076831]).concat(n).concat(t);else var r=t;return r.toString(u)},parse:function(e){var t=u.parse(e),n=t.words;if(1398893684==n[0]&&1701076831==n[1]){var r=i.create(n.slice(2,4));n.splice(0,4),t.sigBytes-=16}return v.create({ciphertext:t,salt:r})}},w=r.SerializableCipher=a.extend({cfg:a.extend({format:b}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var a=e.createEncryptor(n,r),i=a.finalize(t),o=a.cfg;return v.create({ciphertext:i,key:n,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var a=e.createDecryptor(n,r).finalize(t.ciphertext);return a},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),x=n.kdf={},_=x.OpenSSL={execute:function(e,t,n,r){r||(r=i.random(8));var a=p.create({keySize:t+n}).compute(e,r),o=i.create(a.words.slice(t),4*n);return a.sigBytes=4*t,v.create({key:a,iv:o,salt:r})}},M=r.PasswordBasedCipher=w.extend({cfg:w.cfg.extend({kdf:_}),encrypt:function(e,t,n,r){var a=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=a.iv;var i=w.encrypt.call(this,e,t,a.key,r);return i.mixIn(a),i},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var a=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);r.iv=a.iv;var i=w.decrypt.call(this,e,t,a.key,r);return i}})}()}(n(0))},function(e,t,n){var r=n(40),a=n(39),i=n(339),o={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"},s=function(e,t,n){return new Array(t-e.length+1).join(n||"0")+e},u=function(e,t){e=i.encode(e);for(var n="",r=0;r<e.length;r++){var a=e.charCodeAt(r);if(0===a){if(!t)break;n+="00"}else{var o=a.toString(16);n+=o.length<2?"0"+o:o}}return"0x"+n},c=function(e){var t=f(e),n=t.toString(16);return t.lessThan(0)?"-0x"+n.substr(1):"0x"+n},p=function(e){if(v(e))return c(+e);if(m(e))return c(e);if("object"==typeof e)return u(JSON.stringify(e));if(y(e)){if(0===e.indexOf("-0x"))return c(e);if(0===e.indexOf("0x"))return e;if(!isFinite(e))return u(e,1)}return c(e)},l=function(e){e=e?e.toLowerCase():"ether";var t=o[e];if(void 0===t)throw new Error("This unit doesn't exists, please use the one of the following units"+JSON.stringify(o,null,2));return new r(t,10)},f=function(e){return m(e=e||0)?e:!y(e)||0!==e.indexOf("0x")&&0!==e.indexOf("-0x")?new r(e.toString(10),10):new r(e.replace("0x",""),16)},d=function(e){return/^0x[0-9a-f]{40}$/i.test(e)},h=function(e){e=e.replace("0x","");for(var t=a(e.toLowerCase()),n=0;n<40;n++)if(parseInt(t[n],16)>7&&e[n].toUpperCase()!==e[n]||parseInt(t[n],16)<=7&&e[n].toLowerCase()!==e[n])return!1;return!0},m=function(e){return e instanceof r||e&&e.constructor&&"BigNumber"===e.constructor.name},y=function(e){return"string"==typeof e||e&&e.constructor&&"String"===e.constructor.name},v=function(e){return"boolean"==typeof e};e.exports={padLeft:s,padRight:function(e,t,n){return e+new Array(t-e.length+1).join(n||"0")},toHex:p,toDecimal:function(e){return f(e).toNumber()},fromDecimal:c,toUtf8:function(e){var t="",n=0,r=e.length;for("0x"===e.substring(0,2)&&(n=2);n<r;n+=2){var a=parseInt(e.substr(n,2),16);if(0===a)break;t+=String.fromCharCode(a)}return i.decode(t)},toAscii:function(e){var t="",n=0,r=e.length;for("0x"===e.substring(0,2)&&(n=2);n<r;n+=2){var a=parseInt(e.substr(n,2),16);t+=String.fromCharCode(a)}return t},fromUtf8:u,fromAscii:function(e,t){for(var n="",r=0;r<e.length;r++){var a=e.charCodeAt(r).toString(16);n+=a.length<2?"0"+a:a}return"0x"+n.padEnd(t,"0")},transformToFullName:function(e){if(-1!==e.name.indexOf("("))return e.name;var t=e.inputs.map(function(e){return e.type}).join();return e.name+"("+t+")"},extractDisplayName:function(e){var t=e.indexOf("("),n=e.indexOf(")");return-1!==t&&-1!==n?e.substr(0,t):e},extractTypeName:function(e){var t=e.indexOf("("),n=e.indexOf(")");return-1!==t&&-1!==n?e.substr(t+1,n-t-1).replace(" ",""):""},toWei:function(e,t){var n=f(e).times(l(t));return m(e)?n:n.toString(10)},fromWei:function(e,t){var n=f(e).dividedBy(l(t));return m(e)?n:n.toString(10)},toBigNumber:f,toTwosComplement:function(e){var t=f(e).round();return t.lessThan(0)?new r("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16).plus(t).plus(1):t},toAddress:function(e){return d(e)?e:/^[0-9a-f]{40}$/.test(e)?"0x"+e:"0x"+s(p(e).substr(2),40)},isBigNumber:m,isStrictAddress:d,isAddress:function(e){return!!/^(0x)?[0-9a-f]{40}$/i.test(e)&&(!(!/^(0x)?[0-9a-f]{40}$/.test(e)&&!/^(0x)?[0-9A-F]{40}$/.test(e))||h(e))},isChecksumAddress:h,toChecksumAddress:function(e){if(void 0===e)return"";e=e.toLowerCase().replace("0x","");for(var t=a(e),n="0x",r=0;r<e.length;r++)parseInt(t[r],16)>7?n+=e[r].toUpperCase():n+=e[r];return n},isFunction:function(e){return"function"==typeof e},isString:y,isObject:function(e){return null!==e&&!Array.isArray(e)&&"object"==typeof e},isBoolean:v,isArray:function(e){return Array.isArray(e)},isJson:function(e){try{return!!JSON.parse(e)}catch(e){return!1}},isBloom:function(e){return!(!/^(0x)?[0-9a-f]{512}$/i.test(e)||!/^(0x)?[0-9a-f]{512}$/.test(e)&&!/^(0x)?[0-9A-F]{512}$/.test(e))},isTopic:function(e){return!(!/^(0x)?[0-9a-f]{64}$/i.test(e)||!/^(0x)?[0-9a-f]{64}$/.test(e)&&!/^(0x)?[0-9A-F]{64}$/.test(e))}}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(94)("wks"),a=n(69),i=n(6).Symbol,o="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=o&&i[e]||(o?i:a)("Symbol."+e))}).store=r},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){"use strict";(function(e){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <http://feross.org> * @license MIT */ var r=n(372),a=n(371),i=n(120);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=f(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|h(t,n),a=(e=s(e,r)).write(t,n);a!==r&&(e=e.slice(0,a));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|d(t.length);return 0===(e=s(e,n)).length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||function(e){return e!=e}(t.length)?s(e,0):f(e,t);if("Buffer"===t.type&&i(t.data))return f(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function p(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t){if(p(t),e=s(e,t<0?0:0|d(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|d(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function d(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return H(e).length;default:if(r)return L(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,a){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,a);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,a);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,a){var i,o=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){var p=-1;for(i=n;i<s;i++)if(c(e,i)===c(t,-1===p?0:i-p)){if(-1===p&&(p=i),i-p+1===u)return p*o}else-1!==p&&(i-=i-p),p=-1}else for(n+u>s&&(n=s-u),i=n;i>=0;i--){for(var l=!0,f=0;f<u;f++)if(c(e,i+f)!==c(t,f)){l=!1;break}if(l)return i}return-1}function g(e,t,n,r){n=Number(n)||0;var a=e.length-n;r?(r=Number(r))>a&&(r=a):r=a;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[n+o]=s}return o}function b(e,t,n,r){return q(L(t,e.length-n),e,n,r)}function w(e,t,n,r){return q(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function x(e,t,n,r){return w(e,t,n,r)}function _(e,t,n,r){return q(H(t),e,n,r)}function M(e,t,n,r){return q(function(e,t){for(var n,r,a,i=[],o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,a=n%256,i.push(a),i.push(r);return i}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function E(e,t,n){n=Math.min(e.length,n);for(var r=[],a=t;a<n;){var i,o,s,u,c=e[a],p=null,l=c>239?4:c>223?3:c>191?2:1;if(a+l<=n)switch(l){case 1:c<128&&(p=c);break;case 2:128==(192&(i=e[a+1]))&&(u=(31&c)<<6|63&i)>127&&(p=u);break;case 3:i=e[a+1],o=e[a+2],128==(192&i)&&128==(192&o)&&(u=(15&c)<<12|(63&i)<<6|63&o)>2047&&(u<55296||u>57343)&&(p=u);break;case 4:i=e[a+1],o=e[a+2],s=e[a+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(p=u)}null===p?(p=65533,l=1):p>65535&&(p-=65536,r.push(p>>>10&1023|55296),p=56320|1023&p),r.push(p),a+=l}return function(e){var t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=S));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=o(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return p(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return l(null,e)},u.allocUnsafeSlow=function(e){return l(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,a=0,i=Math.min(n,r);a<i;++a)if(e[a]!==t[a]){n=e[a],r=t[a];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).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}},u.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var o=e[n];if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,a),a+=o.length}return r},u.byteLength=h,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?E(this,0,e):function(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return O(this,t,n);case"latin1":case"binary":return P(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,a){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),t<0||n>e.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,a>>>=0,this===e)return 0;for(var i=a-r,o=n-t,s=Math.min(i,o),c=this.slice(r,a),p=e.slice(t,n),l=0;l<s;++l)if(c[l]!==p[l]){i=c[l],o=p[l];break}return i<o?-1:o<i?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return y(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return y(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var a=this.length-t;if((void 0===n||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return g(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function O(e,t,n){var r="";n=Math.min(e.length,n);for(var a=t;a<n;++a)r+=String.fromCharCode(127&e[a]);return r}function P(e,t,n){var r="";n=Math.min(e.length,n);for(var a=t;a<n;++a)r+=String.fromCharCode(e[a]);return r}function A(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var a="",i=t;i<n;++i)a+=I(e[i]);return a}function T(e,t,n){for(var r=e.slice(t,n),a="",i=0;i<r.length;i+=2)a+=String.fromCharCode(r[i]+256*r[i+1]);return a}function C(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function U(e,t,n,r,a,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function N(e,t,n,r){t<0&&(t=65535+t+1);for(var a=0,i=Math.min(e.length-n,2);a<i;++a)e[n+a]=(t&255<<8*(r?a:1-a))>>>8*(r?a:1-a)}function F(e,t,n,r){t<0&&(t=4294967295+t+1);for(var a=0,i=Math.min(e.length-n,4);a<i;++a)e[n+a]=t>>>8*(r?a:3-a)&255}function R(e,t,n,r,a,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function j(e,t,n,r,i){return i||R(e,0,n,4),a.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,i){return i||R(e,0,n,8),a.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if(e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var a=t-e;n=new u(a,void 0);for(var i=0;i<a;++i)n[i]=this[i+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||C(e,t,this.length);for(var r=this[e],a=1,i=0;++i<t&&(a*=256);)r+=this[e+i]*a;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||C(e,t,this.length);for(var r=this[e+--t],a=1;t>0&&(a*=256);)r+=this[e+--t]*a;return r},u.prototype.readUInt8=function(e,t){return t||C(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||C(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||C(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||C(e,t,this.length);for(var r=this[e],a=1,i=0;++i<t&&(a*=256);)r+=this[e+i]*a;return r>=(a*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||C(e,t,this.length);for(var r=t,a=1,i=this[e+--r];r>0&&(a*=256);)i+=this[e+--r]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||C(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||C(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||C(e,4,this.length),a.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||C(e,4,this.length),a.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||C(e,8,this.length),a.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||C(e,8,this.length),a.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||U(this,e,t,n,Math.pow(2,8*n)-1,0);var a=1,i=0;for(this[t]=255&e;++i<n&&(a*=256);)this[t+i]=e/a&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||U(this,e,t,n,Math.pow(2,8*n)-1,0);var a=n-1,i=1;for(this[t+a]=255&e;--a>=0&&(i*=256);)this[t+a]=e/i&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):F(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var a=Math.pow(2,8*n-1);U(this,e,t,n,a-1,-a)}var i=0,o=1,s=0;for(this[t]=255&e;++i<n&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var a=Math.pow(2,8*n-1);U(this,e,t,n,a-1,-a)}var i=n-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):F(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return j(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return j(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var a,i=r-n;if(this===e&&n<t&&t<r)for(a=i-1;a>=0;--a)e[a+t]=this[a+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)e[a+t]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var a=e.charCodeAt(0);a<256&&(e=a)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var o=u.isBuffer(e)?e:L(new u(e,r).toString()),s=o.length;for(i=0;i<n-t;++i)this[i+t]=o[i%s]}return this};var D=/[^+\/0-9A-Za-z-_]/g;function I(e){return e<16?"0"+e.toString(16):e.toString(16)}function L(e,t){var n;t=t||1/0;for(var r=e.length,a=null,i=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&n<57344){if(!a){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&i.push(239,191,189);continue}a=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function H(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(D,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,n,r){for(var a=0;a<r&&!(a+n>=t.length||a>=e.length);++a)t[a+n]=e[a];return a}}).call(this,n(4))},function(e,t,n){var r=n(6),a=n(1),i=n(36),o=n(21),s=n(20),u=function(e,t,n){var c,p,l,f=e&u.F,d=e&u.G,h=e&u.S,m=e&u.P,y=e&u.B,v=e&u.W,g=d?a:a[t]||(a[t]={}),b=g.prototype,w=d?r:h?r[t]:(r[t]||{}).prototype;for(c in d&&(n=t),n)(p=!f&&w&&void 0!==w[c])&&s(g,c)||(l=p?w[c]:n[c],g[c]=d&&"function"!=typeof w[c]?n[c]:y&&p?i(l,r):v&&w[c]==l?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(l):m&&"function"==typeof l?i(Function.call,l):l,m&&((g.virtual||(g.virtual={}))[c]=l,e&u.R&&b&&!b[c]&&o(b,c,l)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){var r=n(40),a=n(3),i=n(57),o=n(114),s=function(e){r.config(i.ETH_BIGNUMBER_ROUNDING_MODE);var t=a.padLeft(a.toTwosComplement(e).toString(16),64);return new o(t)},u=function(e){var t=e.staticPart()||"0";return function(e){return"1"===new r(e.substr(0,1),16).toString(2).substr(0,1)}(t)?new r(t,16).minus(new r("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new r(t,16)},c=function(e){var t=e.staticPart()||"0";return new r(t,16)};e.exports={formatInputInt:s,formatInputBytes:function(e){var t=a.toHex(e).substr(2),n=Math.floor((t.length+63)/64);return t=a.padRight(t,64*n),new o(t)},formatInputDynamicBytes:function(e){var t=a.toHex(e).substr(2),n=t.length/2,r=Math.floor((t.length+63)/64);return t=a.padRight(t,64*r),new o(s(n).value+t)},formatInputString:function(e){var t=a.fromUtf8(e).substr(2),n=t.length/2,r=Math.floor((t.length+63)/64);return t=a.padRight(t,64*r),new o(s(n).value+t)},formatInputBool:function(e){return new o("000000000000000000000000000000000000000000000000000000000000000"+(e?"1":"0"))},formatInputReal:function(e){return s(new r(e).times(new r(2).pow(128)))},formatOutputInt:u,formatOutputUInt:c,formatOutputReal:function(e){return u(e).dividedBy(new r(2).pow(128))},formatOutputUReal:function(e){return c(e).dividedBy(new r(2).pow(128))},formatOutputBool:function(e){return"0000000000000000000000000000000000000000000000000000000000000001"===e.staticPart()},formatOutputBytes:function(e,t){var n=t.match(/^bytes([0-9]*)/),r=parseInt(n[1]);return"0x"+e.staticPart().slice(0,2*r)},formatOutputDynamicBytes:function(e){var t=2*new r(e.dynamicPart().slice(0,64),16).toNumber();return"0x"+e.dynamicPart().substr(64,t)},formatOutputString:function(e){var t=2*new r(e.dynamicPart().slice(0,64),16).toNumber();return a.toUtf8(e.dynamicPart().substr(64,t))},formatOutputAddress:function(e){var t=e.staticPart();return"0x"+t.slice(t.length-40,t.length)}}},function(e,t,n){e.exports=!n(35)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(16);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r=n(9),a=n(114),i=function(e){this._inputFormatter=e.inputFormatter,this._outputFormatter=e.outputFormatter};i.prototype.isType=function(e){throw"this method should be overrwritten for type "+e},i.prototype.staticPartLength=function(e){return(this.nestedTypes(e)||["[1]"]).map(function(e){return parseInt(e.slice(1,-1),10)||1}).reduce(function(e,t){return e*t},32)},i.prototype.isDynamicArray=function(e){var t=this.nestedTypes(e);return!!t&&!t[t.length-1].match(/[0-9]{1,}/g)},i.prototype.isStaticArray=function(e){var t=this.nestedTypes(e);return!!t&&!!t[t.length-1].match(/[0-9]{1,}/g)},i.prototype.staticArrayLength=function(e){var t=this.nestedTypes(e);return t?parseInt(t[t.length-1].match(/[0-9]{1,}/g)||1):1},i.prototype.nestedName=function(e){var t=this.nestedTypes(e);return t?e.substr(0,e.length-t[t.length-1].length):e},i.prototype.isDynamicType=function(){return!1},i.prototype.nestedTypes=function(e){return e.match(/(\[[0-9]*\])/g)},i.prototype.encode=function(e,t){var n=this;return this.isDynamicArray(t)?function(){var a=e.length,i=n.nestedName(t),o=[];return o.push(r.formatInputInt(a).encode()),e.forEach(function(e){o.push(n.encode(e,i))}),o}():this.isStaticArray(t)?function(){for(var r=n.staticArrayLength(t),a=n.nestedName(t),i=[],o=0;o<r;o++)i.push(n.encode(e[o],a));return i}():this._inputFormatter(e,t).encode()},i.prototype.decode=function(e,t,n){var r=this;if(this.isDynamicArray(n))return function(){for(var a=parseInt("0x"+e.substr(2*t,64)),i=parseInt("0x"+e.substr(2*a,64)),o=a+32,s=r.nestedName(n),u=r.staticPartLength(s),c=32*Math.floor((u+31)/32),p=[],l=0;l<i*c;l+=c)p.push(r.decode(e,o+l,s));return p}();if(this.isStaticArray(n))return function(){for(var a=r.staticArrayLength(n),i=t,o=r.nestedName(n),s=r.staticPartLength(o),u=32*Math.floor((s+31)/32),c=[],p=0;p<a*u;p+=u)c.push(r.decode(e,i+p,o));return c}();if(this.isDynamicType(n))return function(){var i=parseInt("0x"+e.substr(2*t,64)),o=parseInt("0x"+e.substr(2*i,64)),s=Math.floor((o+31)/32),u=new a(e.substr(2*i,64*(1+s)),0);return r._outputFormatter(u,n)}();var i=this.staticPartLength(n),o=new a(e.substr(2*t,2*i));return this._outputFormatter(o,n)},e.exports=i},function(e,t,n){var r=n(11),a=n(166),i=n(99),o=Object.defineProperty;t.f=n(10)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),a)try{return o(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){"use strict";var r=n(3),a=n(57),i=n(56),o=function(e){if(void 0!==e)return function(e){return"latest"===e||"pending"===e||"earliest"===e}(e)?e:r.toHex(e)},s=function(e){return null!==e.blockNumber&&(e.blockNumber=r.toDecimal(e.blockNumber)),null!==e.transactionIndex&&(e.transactionIndex=r.toDecimal(e.transactionIndex)),e.nonce=r.toDecimal(e.nonce),e.gas=r.toDecimal(e.gas),e.gasPrice=r.toBigNumber(e.gasPrice),e.value=r.toBigNumber(e.value),e},u=function(e){return e.blockNumber&&(e.blockNumber=r.toDecimal(e.blockNumber)),e.transactionIndex&&(e.transactionIndex=r.toDecimal(e.transactionIndex)),e.logIndex&&(e.logIndex=r.toDecimal(e.logIndex)),e},c=function(e){var t=new i(e);if(t.isValid()&&t.isDirect())return"0x"+t.address();if(r.isStrictAddress(e))return e;if(r.isAddress(e))return"0x"+e;throw new Error("invalid address")};e.exports={inputDefaultBlockNumberFormatter:function(e){return void 0===e?a.defaultBlock:o(e)},inputBlockNumberFormatter:o,inputCallFormatter:function(e){return e.from=e.from||a.defaultAccount,e.from&&(e.from=c(e.from)),e.to&&(e.to=c(e.to)),["gasPrice","gas","value","nonce"].filter(function(t){return void 0!==e[t]}).forEach(function(t){e[t]=r.fromDecimal(e[t])}),e},inputTransactionFormatter:function(e){return e.from=e.from||a.defaultAccount,e.from=c(e.from),e.to&&(e.to=c(e.to)),["gasPrice","gas","value","nonce"].filter(function(t){return void 0!==e[t]}).forEach(function(t){e[t]=r.fromDecimal(e[t])}),e},inputAddressFormatter:c,inputPostFormatter:function(e){return e.ttl=r.fromDecimal(e.ttl),e.workToProve=r.fromDecimal(e.workToProve),e.priority=r.fromDecimal(e.priority),r.isArray(e.topics)||(e.topics=e.topics?[e.topics]:[]),e.topics=e.topics.map(function(e){return 0===e.indexOf("0x")?e:r.fromUtf8(e)}),e},outputBigNumberFormatter:function(e){return r.toBigNumber(e)},outputTransactionFormatter:s,outputTransactionReceiptFormatter:function(e){return null!==e.blockNumber&&(e.blockNumber=r.toDecimal(e.blockNumber)),null!==e.transactionIndex&&(e.transactionIndex=r.toDecimal(e.transactionIndex)),e.cumulativeGasUsed=r.toDecimal(e.cumulativeGasUsed),e.gasUsed=r.toDecimal(e.gasUsed),r.isArray(e.logs)&&(e.logs=e.logs.map(function(e){return u(e)})),e},outputBlockFormatter:function(e){return e.gasLimit=r.toDecimal(e.gasLimit),e.gasUsed=r.toDecimal(e.gasUsed),e.size=r.toDecimal(e.size),e.timestamp=r.toDecimal(e.timestamp),null!==e.number&&(e.number=r.toDecimal(e.number)),e.difficulty=r.toBigNumber(e.difficulty),e.totalDifficulty=r.toBigNumber(e.totalDifficulty),r.isArray(e.transactions)&&e.transactions.forEach(function(e){if(!r.isString(e))return s(e)}),e},outputLogFormatter:u,outputPostFormatter:function(e){return e.expiry=r.toDecimal(e.expiry),e.sent=r.toDecimal(e.sent),e.ttl=r.toDecimal(e.ttl),e.workProved=r.toDecimal(e.workProved),e.topics||(e.topics=[]),e.topics=e.topics.map(function(e){return r.toAscii(e)}),e},outputSyncingFormatter:function(e){return e?(e.startingBlock=r.toDecimal(e.startingBlock),e.currentBlock=r.toDecimal(e.currentBlock),e.highestBlock=r.toDecimal(e.highestBlock),e.knownStates&&(e.knownStates=r.toDecimal(e.knownStates),e.pulledStates=r.toDecimal(e.pulledStates)),e):e}}},function(e,t){var n,r,a=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var u,c=[],p=!1,l=-1;function f(){p&&u&&(p=!1,u.length?c=u.concat(c):l=-1,c.length&&d())}function d(){if(!p){var e=s(f);p=!0;for(var t=c.length;t;){for(u=c,c=[];++l<t;)u&&u[l].run();l=-1,t=c.length}u=null,p=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new h(e,t)),1!==c.length||p||s(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=m,a.addListener=m,a.once=m,a.off=m,a.removeListener=m,a.removeAllListeners=m,a.emit=m,a.prependListener=m,a.prependOnceListener=m,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t,n){var r=n(3),a=n(24),i=function(e){this.name=e.name,this.call=e.call,this.params=e.params||0,this.inputFormatter=e.inputFormatter,this.outputFormatter=e.outputFormatter,this.requestManager=null};i.prototype.setRequestManager=function(e){this.requestManager=e},i.prototype.getCall=function(e){return r.isFunction(this.call)?this.call(e):this.call},i.prototype.extractCallback=function(e){if(r.isFunction(e[e.length-1]))return e.pop()},i.prototype.validateArgs=function(e){if(e.length!==this.params)throw a.InvalidNumberOfRPCParams()},i.prototype.formatInput=function(e){return this.inputFormatter?this.inputFormatter.map(function(t,n){return t?t(e[n]):e[n]}):e},i.prototype.formatOutput=function(e){return this.outputFormatter&&e?this.outputFormatter(e):e},i.prototype.toPayload=function(e){var t=this.getCall(e),n=this.extractCallback(e),r=this.formatInput(e);return this.validateArgs(r),{method:t,params:r,callback:n}},i.prototype.attachToObject=function(e){var t=this.buildCall();t.call=this.call;var n=this.name.split(".");n.length>1?(e[n[0]]=e[n[0]]||{},e[n[0]][n[1]]=t):e[n[0]]=t},i.prototype.buildCall=function(){var e=this,t=function(){var t=e.toPayload(Array.prototype.slice.call(arguments));return t.callback?e.requestManager.sendAsync(t,function(n,r){t.callback(n,e.formatOutput(r))}):e.formatOutput(e.requestManager.send(t))};return t.request=this.request.bind(this),t},i.prototype.request=function(){var e=this.toPayload(Array.prototype.slice.call(arguments));return e.format=this.formatOutput.bind(this),e},e.exports=i},function(e,t,n){var r=n(164),a=n(98);e.exports=function(e){return r(a(e))}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(13),a=n(52);e.exports=n(10)?function(e,t,n){return r.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){"use strict";var r=n(53),a=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=l;var i=Object.create(n(38));i.inherits=n(17);var o=n(108),s=n(104);i.inherits(l,o);for(var u=a(s.prototype),c=0;c<u.length;c++){var p=u[c];l.prototype[p]||(l.prototype[p]=s.prototype[p])}function l(e){if(!(this instanceof l))return new l(e);o.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",f)}function f(){this.allowHalfOpen||this._writableState.ended||r.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),l.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},function(e,t,n){var r=n(3),a=function(e){this.name=e.name,this.getter=e.getter,this.setter=e.setter,this.outputFormatter=e.outputFormatter,this.inputFormatter=e.inputFormatter,this.requestManager=null};a.prototype.setRequestManager=function(e){this.requestManager=e},a.prototype.formatInput=function(e){return this.inputFormatter?this.inputFormatter(e):e},a.prototype.formatOutput=function(e){return this.outputFormatter&&null!==e&&void 0!==e?this.outputFormatter(e):e},a.prototype.extractCallback=function(e){if(r.isFunction(e[e.length-1]))return e.pop()},a.prototype.attachToObject=function(e){var t={get:this.buildGet(),enumerable:!0},n=this.name.split("."),r=n[0];n.length>1&&(e[n[0]]=e[n[0]]||{},e=e[n[0]],r=n[1]),Object.defineProperty(e,r,t),e[i(r)]=this.buildAsyncGet()};var i=function(e){return"get"+e.charAt(0).toUpperCase()+e.slice(1)};a.prototype.buildGet=function(){var e=this;return function(){return e.formatOutput(e.requestManager.send({method:e.getter}))}},a.prototype.buildAsyncGet=function(){var e=this,t=function(t){e.requestManager.sendAsync({method:e.getter},function(n,r){t(n,e.formatOutput(r))})};return t.request=this.request.bind(this),t},a.prototype.request=function(){var e={method:this.getter,params:[],callback:this.extractCallback(Array.prototype.slice.call(arguments))};return e.format=this.formatOutput.bind(this),e},e.exports=a},function(e,t){e.exports={InvalidNumberOfSolidityArgs:function(){return new Error("Invalid number of arguments to Solidity function")},InvalidNumberOfRPCParams:function(){return new Error("Invalid number of input parameters to RPC method")},InvalidConnection:function(e){return new Error("CONNECTION ERROR: Couldn't connect to node "+e+".")},InvalidProvider:function(){return new Error("Provider not set or invalid")},InvalidResponse:function(e){var t=e&&e.error&&e.error.message?e.error.message:"Invalid JSON RPC response: "+JSON.stringify(e);return new Error(t)},ConnectionTimeout:function(e){return new Error("CONNECTION TIMEOUT: timeout of "+e+" ms achived")}}},function(e,t,n){e.exports=function(e){return function(){var t=e,n=t.lib,r=n.Base,a=n.WordArray,i=t.algo,o=i.MD5,s=i.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=n.hasher.create(),i=a.create(),o=i.words,s=n.keySize,u=n.iterations;o.length<s;){c&&r.update(c);var c=r.update(e).finalize(t);r.reset();for(var p=1;p<u;p++)c=r.finalize(c),r.reset();i.concat(c)}return i.sigBytes=4*s,i}});t.EvpKDF=function(e,t,n){return s.create(n).compute(e,t)}}(),e.EvpKDF}(n(0),n(75),n(74))},function(e,t,n){e.exports=function(e){return function(t){var n=e,r=n.lib,a=r.WordArray,i=r.Hasher,o=n.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var u=o.MD5=i.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,a=e[r];e[r]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}var i=this._hash.words,o=e[t+0],u=e[t+1],d=e[t+2],h=e[t+3],m=e[t+4],y=e[t+5],v=e[t+6],g=e[t+7],b=e[t+8],w=e[t+9],x=e[t+10],_=e[t+11],M=e[t+12],k=e[t+13],E=e[t+14],S=e[t+15],O=i[0],P=i[1],A=i[2],T=i[3];P=f(P=f(P=f(P=f(P=l(P=l(P=l(P=l(P=p(P=p(P=p(P=p(P=c(P=c(P=c(P=c(P,A=c(A,T=c(T,O=c(O,P,A,T,o,7,s[0]),P,A,u,12,s[1]),O,P,d,17,s[2]),T,O,h,22,s[3]),A=c(A,T=c(T,O=c(O,P,A,T,m,7,s[4]),P,