@gnosis.pm/pm-js
Version:
A javascript library for building applications on top of Gnosis, the Ethereum prediction market platform
8 lines • 855 kB
JavaScript
var Gnosis=function(t){var e={};function n(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=609)}([function(t,e,n){var r;t.exports=(r=r||function(t,e){var n=Object.create||function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}}(),r={},a=r.lib={},i=a.Base={extend:function(t){var e=n(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},o=a.WordArray=i.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=void 0!=e?e:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,a=t.sigBytes;if(this.clamp(),r%4)for(var i=0;i<a;i++){var o=n[i>>>2]>>>24-i%4*8&255;e[r+i>>>2]|=o<<24-(r+i)%4*8}else for(var i=0;i<a;i+=4)e[r+i>>>2]=n[i>>>2];return this.sigBytes+=a,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=i.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var n,r=[],a=function(e){var e=e,n=987654321,r=4294967295;return function(){var a=((n=36969*(65535&n)+(n>>16)&r)<<16)+(e=18e3*(65535&e)+(e>>16)&r)&r;return a/=4294967296,(a+=.5)*(t.random()>.5?1:-1)}},i=0;i<e;i+=4){var s=a(4294967296*(n||t.random()));n=987654071*s(),r.push(4294967296*s()|0)}return new o.init(r,e)}}),s=r.enc={},u=s.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],a=0;a<n;a++){var i=e[a>>>2]>>>24-a%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new o.init(n,e/2)}},c=s.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],a=0;a<n;a++){var i=e[a>>>2]>>>24-a%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new o.init(n,e)}},l=s.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},p=a.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=l.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n=this._data,r=n.words,a=n.sigBytes,i=this.blockSize,s=4*i,u=a/s,c=(u=e?t.ceil(u):t.max((0|u)-this._minBufferSize,0))*i,l=t.min(4*c,a);if(c){for(var p=0;p<c;p+=i)this._doProcessBlock(r,p);var f=r.splice(0,c);n.sigBytes-=l}return new o.init(f,l)},clone:function(){var t=i.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),f=(a.Hasher=p.extend({cfg:i.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},blockSize:16,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new f.HMAC.init(t,n).finalize(e)}}}),r.algo={});return r}(Math),r)},function(t,e){var n=t.exports={version:"2.5.6"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(53),a=n(52),i=n(103),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(t,e,n){return new Array(e-t.length+1).join(n||"0")+t},u=function(t,e){t=i.encode(t);for(var n="",r=0;r<t.length;r++){var a=t.charCodeAt(r);if(0===a){if(!e)break;n+="00"}else{var o=a.toString(16);n+=o.length<2?"0"+o:o}}return"0x"+n},c=function(t){var e=f(t),n=e.toString(16);return e.lessThan(0)?"-0x"+n.substr(1):"0x"+n},l=function(t){if(b(t))return c(+t);if(m(t))return c(t);if("object"==typeof t)return u(JSON.stringify(t));if(y(t)){if(0===t.indexOf("-0x"))return c(t);if(0===t.indexOf("0x"))return t;if(!isFinite(t))return u(t,1)}return c(t)},p=function(t){t=t?t.toLowerCase():"ether";var e=o[t];if(void 0===e)throw new Error("This unit doesn't exists, please use the one of the following units"+JSON.stringify(o,null,2));return new r(e,10)},f=function(t){return m(t=t||0)?t:!y(t)||0!==t.indexOf("0x")&&0!==t.indexOf("-0x")?new r(t.toString(10),10):new r(t.replace("0x",""),16)},d=function(t){return/^0x[0-9a-f]{40}$/i.test(t)},h=function(t){t=t.replace("0x","");for(var e=a(t.toLowerCase()),n=0;n<40;n++)if(parseInt(e[n],16)>7&&t[n].toUpperCase()!==t[n]||parseInt(e[n],16)<=7&&t[n].toLowerCase()!==t[n])return!1;return!0},m=function(t){return t instanceof r||t&&t.constructor&&"BigNumber"===t.constructor.name},y=function(t){return"string"==typeof t||t&&t.constructor&&"String"===t.constructor.name},b=function(t){return"boolean"==typeof t};t.exports={padLeft:s,padRight:function(t,e,n){return t+new Array(e-t.length+1).join(n||"0")},toHex:l,toDecimal:function(t){return f(t).toNumber()},fromDecimal:c,toUtf8:function(t){var e="",n=0,r=t.length;for("0x"===t.substring(0,2)&&(n=2);n<r;n+=2){var a=parseInt(t.substr(n,2),16);if(0===a)break;e+=String.fromCharCode(a)}return i.decode(e)},toAscii:function(t){var e="",n=0,r=t.length;for("0x"===t.substring(0,2)&&(n=2);n<r;n+=2){var a=parseInt(t.substr(n,2),16);e+=String.fromCharCode(a)}return e},fromUtf8:u,fromAscii:function(t,e){for(var n="",r=0;r<t.length;r++){var a=t.charCodeAt(r).toString(16);n+=a.length<2?"0"+a:a}return"0x"+n.padEnd(e,"0")},transformToFullName:function(t){if(-1!==t.name.indexOf("("))return t.name;var e=t.inputs.map(function(t){return t.type}).join();return t.name+"("+e+")"},extractDisplayName:function(t){var e=t.indexOf("("),n=t.indexOf(")");return-1!==e&&-1!==n?t.substr(0,e):t},extractTypeName:function(t){var e=t.indexOf("("),n=t.indexOf(")");return-1!==e&&-1!==n?t.substr(e+1,n-e-1).replace(" ",""):""},toWei:function(t,e){var n=f(t).times(p(e));return m(t)?n:n.toString(10)},fromWei:function(t,e){var n=f(t).dividedBy(p(e));return m(t)?n:n.toString(10)},toBigNumber:f,toTwosComplement:function(t){var e=f(t).round();return e.lessThan(0)?new r("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16).plus(e).plus(1):e},toAddress:function(t){return d(t)?t:/^[0-9a-f]{40}$/.test(t)?"0x"+t:"0x"+s(l(t).substr(2),40)},isBigNumber:m,isStrictAddress:d,isAddress:function(t){return!!/^(0x)?[0-9a-f]{40}$/i.test(t)&&(!(!/^(0x)?[0-9a-f]{40}$/.test(t)&&!/^(0x)?[0-9A-F]{40}$/.test(t))||h(t))},isChecksumAddress:h,toChecksumAddress:function(t){if(void 0===t)return"";t=t.toLowerCase().replace("0x","");for(var e=a(t),n="0x",r=0;r<t.length;r++)parseInt(e[r],16)>7?n+=t[r].toUpperCase():n+=t[r];return n},isFunction:function(t){return"function"==typeof t},isString:y,isObject:function(t){return null!==t&&!Array.isArray(t)&&"object"==typeof t},isBoolean:b,isArray:function(t){return Array.isArray(t)},isJson:function(t){try{return!!JSON.parse(t)}catch(t){return!1}},isBloom:function(t){return!(!/^(0x)?[0-9a-f]{512}$/i.test(t)||!/^(0x)?[0-9a-f]{512}$/.test(t)&&!/^(0x)?[0-9A-F]{512}$/.test(t))},isTopic:function(t){return!(!/^(0x)?[0-9a-f]{64}$/i.test(t)||!/^(0x)?[0-9a-f]{64}$/.test(t)&&!/^(0x)?[0-9A-F]{64}$/.test(t))}}},function(t,e,n){var r=n(55),a=n(54),i=n(103),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(t,e,n){return new Array(e-t.length+1).join(n||"0")+t},u=function(t,e){t=i.encode(t);for(var n="",r=0;r<t.length;r++){var a=t.charCodeAt(r);if(0===a){if(!e)break;n+="00"}else{var o=a.toString(16);n+=o.length<2?"0"+o:o}}return"0x"+n},c=function(t){var e=f(t),n=e.toString(16);return e.lessThan(0)?"-0x"+n.substr(1):"0x"+n},l=function(t){if(b(t))return c(+t);if(m(t))return c(t);if("object"==typeof t)return u(JSON.stringify(t));if(y(t)){if(0===t.indexOf("-0x"))return c(t);if(0===t.indexOf("0x"))return t;if(!isFinite(t))return u(t,1)}return c(t)},p=function(t){t=t?t.toLowerCase():"ether";var e=o[t];if(void 0===e)throw new Error("This unit doesn't exists, please use the one of the following units"+JSON.stringify(o,null,2));return new r(e,10)},f=function(t){return m(t=t||0)?t:!y(t)||0!==t.indexOf("0x")&&0!==t.indexOf("-0x")?new r(t.toString(10),10):new r(t.replace("0x",""),16)},d=function(t){return/^0x[0-9a-f]{40}$/i.test(t)},h=function(t){t=t.replace("0x","");for(var e=a(t.toLowerCase()),n=0;n<40;n++)if(parseInt(e[n],16)>7&&t[n].toUpperCase()!==t[n]||parseInt(e[n],16)<=7&&t[n].toLowerCase()!==t[n])return!1;return!0},m=function(t){return t instanceof r||t&&t.constructor&&"BigNumber"===t.constructor.name},y=function(t){return"string"==typeof t||t&&t.constructor&&"String"===t.constructor.name},b=function(t){return"boolean"==typeof t};t.exports={padLeft:s,padRight:function(t,e,n){return t+new Array(e-t.length+1).join(n||"0")},toHex:l,toDecimal:function(t){return f(t).toNumber()},fromDecimal:c,toUtf8:function(t){var e="",n=0,r=t.length;for("0x"===t.substring(0,2)&&(n=2);n<r;n+=2){var a=parseInt(t.substr(n,2),16);if(0===a)break;e+=String.fromCharCode(a)}return i.decode(e)},toAscii:function(t){var e="",n=0,r=t.length;for("0x"===t.substring(0,2)&&(n=2);n<r;n+=2){var a=parseInt(t.substr(n,2),16);e+=String.fromCharCode(a)}return e},fromUtf8:u,fromAscii:function(t){for(var e="",n=0;n<t.length;n++){var r=t.charCodeAt(n).toString(16);e+=r.length<2?"0"+r:r}return"0x"+e},transformToFullName:function(t){if(-1!==t.name.indexOf("("))return t.name;var e=t.inputs.map(function(t){return t.type}).join();return t.name+"("+e+")"},extractDisplayName:function(t){var e=t.indexOf("("),n=t.indexOf(")");return-1!==e&&-1!==n?t.substr(0,e):t},extractTypeName:function(t){var e=t.indexOf("("),n=t.indexOf(")");return-1!==e&&-1!==n?t.substr(e+1,n-e-1).replace(" ",""):""},toWei:function(t,e){var n=f(t).times(p(e));return m(t)?n:n.toString(10)},fromWei:function(t,e){var n=f(t).dividedBy(p(e));return m(t)?n:n.toString(10)},toBigNumber:f,toTwosComplement:function(t){var e=f(t).round();return e.lessThan(0)?new r("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16).plus(e).plus(1):e},toAddress:function(t){return d(t)?t:/^[0-9a-f]{40}$/.test(t)?"0x"+t:"0x"+s(l(t).substr(2),40)},isBigNumber:m,isStrictAddress:d,isAddress:function(t){return!!/^(0x)?[0-9a-f]{40}$/i.test(t)&&(!(!/^(0x)?[0-9a-f]{40}$/.test(t)&&!/^(0x)?[0-9A-F]{40}$/.test(t))||h(t))},isChecksumAddress:h,toChecksumAddress:function(t){if(void 0===t)return"";t=t.toLowerCase().replace("0x","");for(var e=a(t),n="0x",r=0;r<t.length;r++)parseInt(e[r],16)>7?n+=t[r].toUpperCase():n+=t[r];return n},isFunction:function(t){return"function"==typeof t},isString:y,isObject:function(t){return null!==t&&!Array.isArray(t)&&"object"==typeof t},isBoolean:b,isArray:function(t){return Array.isArray(t)},isJson:function(t){try{return!!JSON.parse(t)}catch(t){return!1}},isBloom:function(t){return!(!/^(0x)?[0-9a-f]{512}$/i.test(t)||!/^(0x)?[0-9a-f]{512}$/.test(t)&&!/^(0x)?[0-9A-F]{512}$/.test(t))},isTopic:function(t){return!(!/^(0x)?[0-9a-f]{64}$/i.test(t)||!/^(0x)?[0-9a-f]{64}$/.test(t)&&!/^(0x)?[0-9A-F]{64}$/.test(t))}}},function(t,e,n){var r;t.exports=(r=n(0),void(r.lib.Cipher||function(t){var e=r,n=e.lib,a=n.Base,i=n.WordArray,o=n.BufferedBlockAlgorithm,s=e.enc,u=(s.Utf8,s.Base64),c=e.algo,l=c.EvpKDF,p=n.Cipher=o.extend({cfg:a.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,n){this.cfg=this.cfg.extend(n),this._xformMode=t,this._key=e,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?M:w}return function(e){return{encrypt:function(n,r,a){return t(r).encrypt(e,n,r,a)},decrypt:function(n,r,a){return t(r).decrypt(e,n,r,a)}}}}()}),f=(n.StreamCipher=p.extend({_doFinalize:function(){var t=this._process(!0);return t},blockSize:1}),e.mode={}),d=n.BlockCipherMode=a.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),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(t,e){var r=this._cipher,a=r.blockSize;n.call(this,t,e,a),r.encryptBlock(t,e),this._prevBlock=t.slice(e,e+a)}}),e.Decryptor=e.extend({processBlock:function(t,e){var r=this._cipher,a=r.blockSize,i=t.slice(e,e+a);r.decryptBlock(t,e),n.call(this,t,e,a),this._prevBlock=i}}),e}(),m=e.pad={},y=m.Pkcs7={pad:function(t,e){for(var n=4*e,r=n-t.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);t.concat(u)},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},b=(n.BlockCipher=p.extend({cfg:p.cfg.extend({mode:h,padding:y}),reset:function(){p.reset.call(this);var t=this.cfg,e=t.iv,n=t.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,e&&e.words)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else{var e=this._process(!0);t.unpad(e)}return e},blockSize:4}),n.CipherParams=a.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),v=e.format={},g=v.OpenSSL={stringify:function(t){var e=t.ciphertext,n=t.salt;if(n)var r=i.create([1398893684,1701076831]).concat(n).concat(e);else var r=e;return r.toString(u)},parse:function(t){var e=u.parse(t),n=e.words;if(1398893684==n[0]&&1701076831==n[1]){var r=i.create(n.slice(2,4));n.splice(0,4),e.sigBytes-=16}return b.create({ciphertext:e,salt:r})}},w=n.SerializableCipher=a.extend({cfg:a.extend({format:g}),encrypt:function(t,e,n,r){r=this.cfg.extend(r);var a=t.createEncryptor(n,r),i=a.finalize(e),o=a.cfg;return b.create({ciphertext:i,key:n,iv:o.iv,algorithm:t,mode:o.mode,padding:o.padding,blockSize:t.blockSize,formatter:r.format})},decrypt:function(t,e,n,r){r=this.cfg.extend(r),e=this._parse(e,r.format);var a=t.createDecryptor(n,r).finalize(e.ciphertext);return a},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),x=e.kdf={},_=x.OpenSSL={execute:function(t,e,n,r){r||(r=i.random(8));var a=l.create({keySize:e+n}).compute(t,r),o=i.create(a.words.slice(e),4*n);return a.sigBytes=4*e,b.create({key:a,iv:o,salt:r})}},M=n.PasswordBasedCipher=w.extend({cfg:w.cfg.extend({kdf:_}),encrypt:function(t,e,n,r){var a=(r=this.cfg.extend(r)).kdf.execute(n,t.keySize,t.ivSize);r.iv=a.iv;var i=w.encrypt.call(this,t,e,a.key,r);return i.mixIn(a),i},decrypt:function(t,e,n,r){r=this.cfg.extend(r),e=this._parse(e,r.format);var a=r.kdf.execute(n,t.keySize,t.ivSize,e.salt);r.iv=a.iv;var i=w.decrypt.call(this,t,e,a.key,r);return i}})}()))},function(t,e,n){var r=n(57),a=n(56),i=n(103),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(t,e,n){return new Array(e-t.length+1).join(n||"0")+t},u=function(t,e){t=i.encode(t);for(var n="",r=0;r<t.length;r++){var a=t.charCodeAt(r);if(0===a){if(!e)break;n+="00"}else{var o=a.toString(16);n+=o.length<2?"0"+o:o}}return"0x"+n},c=function(t){var e=f(t),n=e.toString(16);return e.lessThan(0)?"-0x"+n.substr(1):"0x"+n},l=function(t){if(b(t))return c(+t);if(m(t))return c(t);if("object"==typeof t)return u(JSON.stringify(t));if(y(t)){if(0===t.indexOf("-0x"))return c(t);if(0===t.indexOf("0x"))return t;if(!isFinite(t))return u(t,1)}return c(t)},p=function(t){t=t?t.toLowerCase():"ether";var e=o[t];if(void 0===e)throw new Error("This unit doesn't exists, please use the one of the following units"+JSON.stringify(o,null,2));return new r(e,10)},f=function(t){return m(t=t||0)?t:!y(t)||0!==t.indexOf("0x")&&0!==t.indexOf("-0x")?new r(t.toString(10),10):new r(t.replace("0x",""),16)},d=function(t){return/^0x[0-9a-f]{40}$/i.test(t)},h=function(t){t=t.replace("0x","");for(var e=a(t.toLowerCase()),n=0;n<40;n++)if(parseInt(e[n],16)>7&&t[n].toUpperCase()!==t[n]||parseInt(e[n],16)<=7&&t[n].toLowerCase()!==t[n])return!1;return!0},m=function(t){return t instanceof r||t&&t.constructor&&"BigNumber"===t.constructor.name},y=function(t){return"string"==typeof t||t&&t.constructor&&"String"===t.constructor.name},b=function(t){return"boolean"==typeof t};t.exports={padLeft:s,padRight:function(t,e,n){return t+new Array(e-t.length+1).join(n||"0")},toHex:l,toDecimal:function(t){return f(t).toNumber()},fromDecimal:c,toUtf8:function(t){var e="",n=0,r=t.length;for("0x"===t.substring(0,2)&&(n=2);n<r;n+=2){var a=parseInt(t.substr(n,2),16);if(0===a)break;e+=String.fromCharCode(a)}return i.decode(e)},toAscii:function(t){var e="",n=0,r=t.length;for("0x"===t.substring(0,2)&&(n=2);n<r;n+=2){var a=parseInt(t.substr(n,2),16);e+=String.fromCharCode(a)}return e},fromUtf8:u,fromAscii:function(t){for(var e="",n=0;n<t.length;n++){var r=t.charCodeAt(n).toString(16);e+=r.length<2?"0"+r:r}return"0x"+e},transformToFullName:function(t){if(-1!==t.name.indexOf("("))return t.name;var e=t.inputs.map(function(t){return t.type}).join();return t.name+"("+e+")"},extractDisplayName:function(t){var e=t.indexOf("("),n=t.indexOf(")");return-1!==e&&-1!==n?t.substr(0,e):t},extractTypeName:function(t){var e=t.indexOf("("),n=t.indexOf(")");return-1!==e&&-1!==n?t.substr(e+1,n-e-1).replace(" ",""):""},toWei:function(t,e){var n=f(t).times(p(e));return m(t)?n:n.toString(10)},fromWei:function(t,e){var n=f(t).dividedBy(p(e));return m(t)?n:n.toString(10)},toBigNumber:f,toTwosComplement:function(t){var e=f(t).round();return e.lessThan(0)?new r("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16).plus(e).plus(1):e},toAddress:function(t){return d(t)?t:/^[0-9a-f]{40}$/.test(t)?"0x"+t:"0x"+s(l(t).substr(2),40)},isBigNumber:m,isStrictAddress:d,isAddress:function(t){return!!/^(0x)?[0-9a-f]{40}$/i.test(t)&&(!(!/^(0x)?[0-9a-f]{40}$/.test(t)&&!/^(0x)?[0-9A-F]{40}$/.test(t))||h(t))},isChecksumAddress:h,toChecksumAddress:function(t){if(void 0===t)return"";t=t.toLowerCase().replace("0x","");for(var e=a(t),n="0x",r=0;r<t.length;r++)parseInt(e[r],16)>7?n+=t[r].toUpperCase():n+=t[r];return n},isFunction:function(t){return"function"==typeof t},isString:y,isObject:function(t){return null!==t&&!Array.isArray(t)&&"object"==typeof t},isBoolean:b,isArray:function(t){return Array.isArray(t)},isJson:function(t){try{return!!JSON.parse(t)}catch(t){return!1}},isBloom:function(t){return!(!/^(0x)?[0-9a-f]{512}$/i.test(t)||!/^(0x)?[0-9a-f]{512}$/.test(t)&&!/^(0x)?[0-9A-F]{512}$/.test(t))},isTopic:function(t){return!(!/^(0x)?[0-9a-f]{64}$/i.test(t)||!/^(0x)?[0-9a-f]{64}$/.test(t)&&!/^(0x)?[0-9A-F]{64}$/.test(t))}}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(124)("wks"),a=n(97),i=n(8).Symbol,o="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=o&&i[t]||(o?i:a)("Symbol."+t))}).store=r},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){"use strict";(function(t){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var r=n(465),a=n(464),i=n(156);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(o()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return p(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=f(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,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(e,n),a=(t=s(t,r)).write(e,n);a!==r&&(t=t.slice(0,a));return t}(t,e,n):function(t,e){if(u.isBuffer(e)){var n=0|d(e.length);return 0===(t=s(t,n)).length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?s(t,0):f(t,e);if("Buffer"===e.type&&i(e.data))return f(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function p(t,e){if(l(e),t=s(t,e<0?0:0|d(e)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function f(t,e){var n=e.length<0?0:0|d(e.length);t=s(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}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 h(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return H(t).length;default:if(r)return L(t).length;e=(""+e).toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function y(t,e,n,r,a){if(0===t.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:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(a)return-1;n=t.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:b(t,e,n,r,a);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):b(t,[e],n,r,a);throw new TypeError("val must be string, number or Buffer")}function b(t,e,n,r,a){var i,o=1,s=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;o=2,s/=2,u/=2,n/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(a){var l=-1;for(i=n;i<s;i++)if(c(t,i)===c(e,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*o}else-1!==l&&(i-=i-l),l=-1}else for(n+u>s&&(n=s-u),i=n;i>=0;i--){for(var p=!0,f=0;f<u;f++)if(c(t,i+f)!==c(e,f)){p=!1;break}if(p)return i}return-1}function v(t,e,n,r){n=Number(n)||0;var a=t.length-n;r?(r=Number(r))>a&&(r=a):r=a;var i=e.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(e.substr(2*o,2),16);if(isNaN(s))return o;t[n+o]=s}return o}function g(t,e,n,r){return q(L(e,t.length-n),t,n,r)}function w(t,e,n,r){return q(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function x(t,e,n,r){return w(t,e,n,r)}function _(t,e,n,r){return q(H(e),t,n,r)}function M(t,e,n,r){return q(function(t,e){for(var n,r,a,i=[],o=0;o<t.length&&!((e-=2)<0);++o)n=t.charCodeAt(o),r=n>>8,a=n%256,i.push(a),i.push(r);return i}(e,t.length-n),t,n,r)}function k(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function E(t,e,n){n=Math.min(t.length,n);for(var r=[],a=e;a<n;){var i,o,s,u,c=t[a],l=null,p=c>239?4:c>223?3:c>191?2:1;if(a+p<=n)switch(p){case 1:c<128&&(l=c);break;case 2:128==(192&(i=t[a+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=t[a+1],o=t[a+2],128==(192&i)&&128==(192&o)&&(u=(15&c)<<12|(63&i)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=t[a+1],o=t[a+2],s=t[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&&(l=u)}null===l?(l=65533,p=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),a+=p}return function(t){var e=t.length;if(e<=P)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=P));return n}(r)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){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(t){return!1}}(),e.kMaxLength=o(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,n){return c(null,t,e,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(t,e,n){return function(t,e,n,r){return l(e),e<=0?s(t,e):void 0!==n?"string"==typeof r?s(t,e).fill(n,r):s(t,e).fill(n):s(t,e)}(null,t,e,n)},u.allocUnsafe=function(t){return p(null,t)},u.allocUnsafeSlow=function(t){return p(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,a=0,i=Math.min(n,r);a<i;++a)if(t[a]!==e[a]){n=t[a],r=e[a];break}return n<r?-1:r<n?1:0},u.isEncoding=function(t){switch(String(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}},u.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=u.allocUnsafe(e),a=0;for(n=0;n<t.length;++n){var o=t[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 t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},u.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 e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.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 e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?E(this,0,t):function(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return A(this,e,n);case"utf8":case"utf-8":return E(this,e,n);case"ascii":return S(this,e,n);case"latin1":case"binary":return O(this,e,n);case"base64":return k(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,n,r,a){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),e<0||n>t.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&e>=n)return 0;if(r>=a)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,a>>>=0,this===t)return 0;for(var i=a-r,o=n-e,s=Math.min(i,o),c=this.slice(r,a),l=t.slice(e,n),p=0;p<s;++p)if(c[p]!==l[p]){i=c[p],o=l[p];break}return i<o?-1:o<i?1:0},u.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},u.prototype.indexOf=function(t,e,n){return y(this,t,e,n,!0)},u.prototype.lastIndexOf=function(t,e,n){return y(this,t,e,n,!1)},u.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var a=this.length-e;if((void 0===n||n>a)&&(n=a),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return v(this,t,e,n);case"utf8":case"utf-8":return g(this,t,e,n);case"ascii":return w(this,t,e,n);case"latin1":case"binary":return x(this,t,e,n);case"base64":return _(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,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 P=4096;function S(t,e,n){var r="";n=Math.min(t.length,n);for(var a=e;a<n;++a)r+=String.fromCharCode(127&t[a]);return r}function O(t,e,n){var r="";n=Math.min(t.length,n);for(var a=e;a<n;++a)r+=String.fromCharCode(t[a]);return r}function A(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var a="",i=e;i<n;++i)a+=j(t[i]);return a}function T(t,e,n){for(var r=t.slice(e,n),a="",i=0;i<r.length;i+=2)a+=String.fromCharCode(r[i]+256*r[i+1]);return a}function C(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function F(t,e,n,r,a,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||e<i)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function N(t,e,n,r){e<0&&(e=65535+e+1);for(var a=0,i=Math.min(t.length-n,2);a<i;++a)t[n+a]=(e&255<<8*(r?a:1-a))>>>8*(r?a:1-a)}function R(t,e,n,r){e<0&&(e=4294967295+e+1);for(var a=0,i=Math.min(t.length-n,4);a<i;++a)t[n+a]=e>>>8*(r?a:3-a)&255}function U(t,e,n,r,a,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function B(t,e,n,r,i){return i||U(t,0,n,4),a.write(t,e,n,r,23,4),n+4}function I(t,e,n,r,i){return i||U(t,0,n,8),a.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if(t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=u.prototype;else{var a=e-t;n=new u(a,void 0);for(var i=0;i<a;++i)n[i]=this[i+t]}return n},u.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=this[t],a=1,i=0;++i<e&&(a*=256);)r+=this[t+i]*a;return r},u.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=this[t+--e],a=1;e>0&&(a*=256);)r+=this[t+--e]*a;return r},u.prototype.readUInt8=function(t,e){return e||C(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||C(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||C(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=this[t],a=1,i=0;++i<e&&(a*=256);)r+=this[t+i]*a;return r>=(a*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||C(t,e,this.length);for(var r=e,a=1,i=this[t+--r];r>0&&(a*=256);)i+=this[t+--r]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||C(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||C(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||C(t,4,this.length),a.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||C(t,4,this.length),a.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||C(t,8,this.length),a.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||C(t,8,this.length),a.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||F(this,t,e,n,Math.pow(2,8*n)-1,0);var a=1,i=0;for(this[e]=255&t;++i<n&&(a*=256);)this[e+i]=t/a&255;return e+n},u.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||F(this,t,e,n,Math.pow(2,8*n)-1,0);var a=n-1,i=1;for(this[e+a]=255&t;--a>=0&&(i*=256);)this[e+a]=t/i&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):R(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var a=Math.pow(2,8*n-1);F(this,t,e,n,a-1,-a)}var i=0,o=1,s=0;for(this[e]=255&t;++i<n&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var a=Math.pow(2,8*n-1);F(this,t,e,n,a-1,-a)}var i=n-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):R(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return B(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return B(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return I(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return I(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<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),t.length-e<r-n&&(r=t.length-e+n);var a,i=r-n;if(this===t&&n<e&&e<r)for(a=i-1;a>=0;--a)t[a+e]=this[a+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(a=0;a<i;++a)t[a+e]=this[a+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+i),e);return i},u.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var a=t.charCodeAt(0);a<256&&(t=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 t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{var o=u.isBuffer(t)?t:L(new u(t,r).toString()),s=o.length;for(i=0;i<n-e;++i)this[i+e]=o[i%s]}return this};var D=/[^+\/0-9A-Za-z-_]/g;function j(t){return t<16?"0"+t.toString(16):t.toString(16)}function L(t,e){var n;e=e||1/0;for(var r=t.length,a=null,i=[],o=0;o<r;++o){if((n=t.charCodeAt(o))>55295&&n<57344){if(!a){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(o+1===r){(e-=3)>-1&&i.push(239,191,189);continue}a=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(e-=3)>-1&&i.push(239,191,189);if(a=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=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((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function H(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,n,r){for(var a=0;a<r&&!(a+n>=e.length||a>=t.length);++a)e[a+n]=t[a];return a}}).call(this,n(6))},function(t,e,n){var r=n(8),a=n(1),i=n(49),o=n(31),s=n(30),u=function(t,e,n){var c,l,p,f=t&u.F,d=t&u.G,h=t&u.S,m=t&u.P,y=t&u.B,b=t&u.W,v=d?a:a[e]||(a[e]={}),g=v.prototype,w=d?r:h?r[e]:(r[e]||{}).prototype;for(c in d&&(n=e),n)(l=!f&&w&&void 0!==w[c])&&s(v,c)||(p=l?w[c]:n[c],v[c]=d&&"function"!=typeof w[c]?n[c]:y&&l?i(p,r):b&&w[c]==p?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(p):m&&"function"==typeof p?i(Function.call,p):p,m&&((v.virtual||(v.virtual={}))[c]=p,t&u.R&&g&&!g[c]&&o(g,c,p)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e,n){var r=n(53),a=n(2),i=n(76),o=n(144),s=function(t){r.config(i.ETH_BIGNUMBER_ROUNDING_MODE);var e=a.padLeft(a.toTwosComplement(t).toString(16),64);return new o(e)},u=function(t){var e=t.staticPart()||"0";return function(t){return"1"===new r(t.substr(0,1),16).toString(2).substr(0,1)}(e)?new r(e,16).minus(new r("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new r(e,16)},c=function(t){var e=t.staticPart()||"0";return new r(e,16)};t.exports={formatInputInt:s,formatInputBytes:function(t){var e=a.toHex(t).substr(2),n=Math.floor((e.length+63)/64);return e=a.padRight(e,64*n),new o(e)},formatInputDynamicBytes:function(t){var e=a.toHex(t).substr(2),n=e.length/2,r=Math.floor((e.length+63)/64);return e=a.padRight(e,64*r),new o(s(n).value+e)},formatInputString:function(t){var e=a.fromUtf8(t).substr(2),n=e.length/2,r=Math.floor((e.length+63)/64);return e=a.padRight(e,64*r),new o(s(n).value+e)},formatInputBool:function(t){return new o("000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0"))},formatInputReal:function(t){return s(new r(t).times(new r(2).pow(128)))},formatOutputInt:u,formatOutputUInt:c,formatOutputReal:function(t){return u(t).dividedBy(new r(2).pow(128))},formatOutputUReal:function(t){return c(t).dividedBy(new r(2).pow(128))},formatOutputBool:function(t){return"0000000000000000000000000000000000000000000000000000000000000001"===t.staticPart()},formatOutputBytes:function(t,e){var n=e.match(/^bytes([0-9]*)/),r=parseInt(n[1]);return"0x"+t.staticPart().slice(0,2*r)},formatOutputDynamicBytes:function(t){var e=2*new r(t.dynamicPart().slice(0,64),16).toNumber();return"0x"+t.dynamicPart().substr(64,e)},formatOutputString:function(t){var e=2*new r(t.dynamicPart().slice(0,64),16).toNumber();return a.toUtf8(t.dynamicPart().substr(64,e))},formatOutputAddress:function(t){var e=t.staticPart();return"0x"+e.slice(e.length-40,e.length)}}},function(t,e,n){var r=n(55),a=n(3),i=n(80),o=n(147),s=function(t){r.config(i.ETH_BIGNUMBER_ROUNDING_MODE);var e=a.padLeft(a.toTwosComplement(t).toString(16),64);return new o(e)},u=function(t){var e=t.staticPart()||"0";return function(t){return"1"===new r(t.substr(0,1),16).toString(2).substr(0,1)}(e)?new r(e,16).minus(new r("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new r(e,16)},c=function(t){var e=t.staticPart()||"0";return new r(e,16)};t.exports={formatInputInt:s,formatInputBytes:function(t){var e=a.toHex(t).substr(2),n=Math.floor((e.length+63)/64);return e=a.padRight(e,64*n),new o(e)},formatInputDynamicBytes:function(t){var e=a.toHex(t).substr(2),n=e.length/2,r=Math.floor((e.length+63)/64);return e=a.padRight(e,64*r),new o(s(n).value+e)},formatInputString:function(t){var e=a.fromUtf8(t).substr(2),n=e.length/2,r=Math.floor((e.length+63)/64);return e=a.padRight(e,64*r),new o(s(n).value+e)},formatInputBool:function(t){return new o("000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0"))},formatInputReal:function(t){return s(new r(t).times(new r(2).pow(128)))},formatOutputInt:u,formatOutputUInt:c,formatOutputReal:function(t){return u(t).dividedBy(new r(2).pow(128))},formatOutputUReal:function(t){return c(t).dividedBy(new r(2).pow(128))},formatOutputBool:function(t){return"0000000000000000000000000000000000000000000000000000000000000001"===t.staticPart()},formatOutputBytes:function(t,e){var n=e.match(/^bytes([0-9]*)/),r=parseInt(n[1]);return"0x"+t.staticPart().slice(0,2*r)},formatOutputDynamicBytes:function(t){var e=2*new r(t.dynamicPart().slice(0,64),16).toNumber();return"0x"+t.dynamicPart().substr(64,e)},formatOutputString:function(t){var e=2*new r(t.dynamicPart().slice(0,64),16).toNumber();return a.toUtf8(t.dynamicPart().substr(64,e))},formatOutputAddress:function(t){var e=t.staticPart();return"0x"+e.slice(e.length-40,e.length)}}},function(t,e,n){var r=n(57),a=n(5),i=n(84),o=n(151),s=function(t){r.config(i.ETH_BIGNUMBER_ROUNDING_MODE);var e=a.padLeft(a.toTwosComplement(t).toString(16),64);return new o(e)},u=function(t){var e=t.staticPart()||"0";return function(t){return"1"===new r(t.substr(0,1),16).toString(2).substr(0,1)}(e)?new r(e,16).minus(new r("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new r(e,16)},c=function(t){var e=t.staticPart()||"0";return new r(e,16)};t.exports={formatInputInt:s,formatInputBytes:function(t){var e=a.toHex(t).substr(2),n=Math.floor((e.length+63)/64);return e=a.padRight(e,64*n),new o(e)},formatInputDynamicBytes:function(t){var e=a.toHex(t).substr(2),n=e.length/2,r=Math.floor((e.length+63)/64);return e=a.padRight(e,64*r),new o(s(n).value+e)},formatInputString:function(t){var e=a.fromUtf8(t).substr(2),n=e.length/2,r=Math.floor((e.length+63)/64);return e=a.padRight(e,64*r),new o(s(n).value+e)},formatInputBool:function(t){return new o("000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0"))},formatInputReal:function(t){return s(new r(t).times(new r(2).pow(128)))},formatOutputInt:u,formatOutputUInt:c,formatOutputReal:function(t){return u(t).dividedBy(new r(2).pow(128))},formatOutputUReal:function(t){return c(t).dividedBy(new r(2).pow(128))},formatOutputBool:function(t){return"0000000000000000000000000000000000000000000000000000000000000001"===t.staticPart()},formatOutputBytes:function(t,e){var n=e.match(/^bytes([0-9]*)/),r=parseInt(n[1]);return"0x"+t.staticPart().slice(0,2*r)},formatOutputDynamicBytes:function(t){var e=2*new r(t.dynamicPart().slice(0,64),16).toNumber();return"0x"+t.dynamicPart().substr(64,e)},formatOutputString:function(t){var e=2*new r(t.dynamicPart().slice(0,64),16).toNumber();return a.toUtf8(t.dynamicPart().substr(64,e))},formatOutputAddress:function(t){var e=t.staticPart();return"0x"+e.slice(e.length-40,e.length)}}},function(t,e,n){var r=n(24);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var r=n(11),a=n(144),i=function(t){this._inputFormatter=t.inputFormatter,this._outputFormatter=t.outputFormatter};i.prototype.isType=function(t){throw"this method should be overrwritten for type "+t},i.prototype.staticPartLength=function(t){return(this.nestedTypes(t)||["[1]"]).map(function(t){return parseInt(t.slice(1,-1),10)||1}).reduce(function(t,e){return t*e},32)},i.prototype.isDynamicArray=function(t){var e=this.nestedTypes(t);return!!e&&!e[e.length-1].match(/[0-9]{1,}/g)},i.prototype.isStaticArray=function(t){var e=this.nestedTypes(t);return!!e&&!!e[e.length-1].match(/[0-9]{1,}/g)},i.prototype.staticArrayLength=function(t){var e=this.nestedTypes(t);return e?parseInt(e[e.length-1].match(/[0-9]{1,}/g)||1):1},i.prototype.nestedName=function(t){var e=this.nestedTypes(t);return e?t.substr(0,t.length-e[e.length-1].length):t},i.prototype.isDynamicType=function(){return!1},i.prototype.nestedTypes=function(t){return t.match(/(\[[0-9]*\])/g)},i.prototype.encode=function(t,e){var n,a,i,o=this;return this.isDynamicArray(e)?(n=t.length,a=o.nestedName(e),(i=[]).push(r.formatInputInt(n).encode()),t.forEach(function(t){i.push(o.encode(t,a))}),i):this.isStaticArray(e)?function(){for(var n=o.staticArrayLength(e),r=o.nestedName(e),a=[],i=0;i<n;i++)a.push(o.encode(t[i],r));return a}():this._inputFormatter(t,e).encode()},i.prototype.decode=function(t,e,n){var r=this;if(this.isDynamicArray(n))return function(){for(var a=parseInt("0x"+t.substr(2*e,64)),i=parseInt("0x"+t.substr(2*a,64)),o=a+32,s=r.nestedName(n),u=r.staticPartLength(s),c=32*Math.floor((u+31)/32),l=[],p=0;p<i*c;p+=c)l.push(r.decode(t,o+p,s));return l}();if(this.isStaticArray(n))return function(){for(var a=r.staticArrayLength(n),i=e,o=r.nestedName(n)