if(!(thisinstanceofE))throwError("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:g(a,!0)}),this._prepare()};E.prototype._prepare=function(){vara=o[this.key.length];if(null==a)thrownewError("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(varb=0;b<=a;b++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(varc,d=4*(a+1),e=this.key.length/4,f=j(this.key),b=0;b<e;b++)c=b>>2,this._Ke[c][b%4]=f[b],this._Kd[a-c][b%4]=f[b];for(varg,h=0,i=e;i<d;){if(g=f[e-1],f[0]^=q[g>>16&255]<<24^q[g>>8&255]<<16^q[255&g]<<8^q[g>>24&255]^p[h]<<24,h+=1,8!=e)for(varb=1;b<e;b++)f[b]^=f[b-1];else{for(varb=1;b<e/2;b++)f[b]^=f[b-1];g=f[e/2-1],f[e/2]^=q[255&g]^q[g>>8&255]<<8^q[g>>16&255]<<16^q[g>>24&255]<<24;for(varb=e/2+1;b<e;b++)f[b]^=f[b-1]}for(vark,l,b=0;b<e&&i<d;)k=i>>2,l=i%4,this._Ke[k][l]=f[b],this._Kd[a-k][l]=f[b++],i++}for(vark=1;k<a;k++)for(varl=0;l<4;l++)g=this._Kd[k][l],this._Kd[k][l]=A[g>>24&255]^B[g>>16&255]^C[g>>8&255]^D[255&g]},E.prototype.encrypt=function(a){if(16!=a.length)thrownewError("invalid plaintext size (must be 16 bytes)");for(varb=this._Ke.length-1,c=[0,0,0,0],d=j(a),e=0;e<4;e++)d[e]^=this._Ke[0][e];for(varf=1;f<b;f++){for(vare=0;e<4;e++)c[e]=s[d[e]>>24&255]^t[d[(e+1)%4]>>16&255]^u[d[(e+2)%4]>>8&255]^v[255&d[(e+3)%4]]^this._Ke[f][e];d=c.slice()}for(varg,i=h(16),e=0;e<4;e++)g=this._Ke[b][e],i[4*e]=255&(q[d[e]>>24&255]^g>>24),i[4*e+1]=255&(q[d[(e+1)%4]>>16&255]^g>>16),i[4*e+2]=255&(q[d[(e+2)%4]>>8&255]^g>>8),i[4*e+3]=255&(q[255&d[(e+3)%4]]^g);returni},E.prototype.decrypt=function(a){if(16!=a.length)thrownewError("invalid ciphertext size (must be 16 bytes)");for(varb=this._Kd.length-1,c=[0,0,0,0],d=j(a),e=0;e<4;e++)d[e]^=this._Kd[0][e];for(varf=1;f<b;f++){for(vare=0;e<4;e++)c[e]=w[d[e]>>24&255]^x[d[(e+3)%4]>>16&255]^y[d[(e+2)%4]>>8&255]^z[255&d[(e+1)%4]]^this._Kd[f][e];d=c.slice()}for(varg,i=h(16),e=0;e<4;e++)g=this._Kd[b][e],i[4*e]=255&(r[d[e]>>24&255]^g>>24),i[4*e+1]=255&(r[d[(e+3)%4]>>16&255]^g>>16),i[4*e+2]=255&(r[d[(e+2)%4]>>8&255]^g>>8),i[4*e+3]=255&(r[255&d[(e+1)%4]]^g);returni};varF=function(a){if(!(thisinstanceofF))throwError("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=newE(a)};F.prototype.encrypt=function(a){if(a=g(a),a.length%16!==0)thrownewError("invalid plaintext size (must be multiple of 16 bytes)");for(varb=h(a.length),c=h(16),d=0;d<a.length;d+=16)i(a,c,0,d,d+16),c=this._aes.encrypt(c),i(c,b,d);returnb},F.prototype.decrypt=function(a){if(a=g(a),a.length%16!==0)thrownewError("invalid ciphertext size (must be multiple of 16 bytes)");for(varb=h(a.length),c=h(16),d=0;d<a.length;d+=16)i(a,c,0,d,d+16),c=this._aes.decrypt(c),i(c,b,d);returnb};varG=function(a,b){if(!(thisinstanceofG))throwError("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",b){if(16!=b.length)thrownewError("invalid initialation vector size (must be 16 bytes)")}elseb=h(16);this._lastCipherblock=g(b,!0),this._aes=newE(a)};G.prototype.encrypt=function(a){if(a=g(a),a.length%16!==0)thrownewError("invalid plaintext size (must be multiple of 16 bytes)");for(varb=h(a.length),c=h(16),d=0;d<a.length;d+=16){i(a,c,0,d,d+16);for(vare=0;e<16;e++)c[e]^=this._lastCipherblock[e];this._lastCipherblock=this._aes.encrypt(c),i(this._lastCipherblock,b,d)}returnb},G.prototype.decrypt=function(a){if(a=g(a),a.length%16!==0)thrownewError("invalid ciphertext size (must be multiple of 16 bytes)");for(varb=h(a.length),c=h(16),d=0;d<a.length;d+=16){i(a,c,0,d,d+16),c=this._aes.decrypt(c);for(vare=0;e<16;e++)b[d+e]=c[e]^this._lastCipherblock[e];i(a,this._lastCipherblock,0,d,d+16)}returnb};varH=function(a,b,c){if(!(thisinstanceofH))throwError("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",b){if(16!=b.length)thrownewError("invalid initialation vector size (must be 16 size)")}elseb=h(16);c||(c=1),this.segmentSize=c,this._shiftRegister=g(b,!0),this._aes=newE(a)};H.prototype.encrypt=function(a){if(a.length%
f>>>=13,c[2*g+1]=8191&f,f>>>=13;for(g=2*b;g<e;++g)c[g]=0;d(0===f),d(0===(f&-8192))},m.prototype.stub=function(a){for(varb=newArray(a),c=0;c<a;c++)b[c]=0;returnb},m.prototype.mulp=function(a,b,c){vard=2*this.guessLen13b(a.length,b.length),e=this.makeRBT(d),f=this.stub(d),g=newArray(d),h=newArray(d),i=newArray(d),j=newArray(d),k=newArray(d),l=newArray(d),m=c.words;m.length=d,this.convert13b(a.words,a.length,g,d),this.convert13b(b.words,b.length,j,d),this.transform(g,f,h,i,d,e),this.transform(j,f,k,l,d,e);for(varn=0;n<d;n++){varo=h[n]*k[n]-i[n]*l[n];i[n]=h[n]*l[n]+i[n]*k[n],h[n]=o}returnthis.conjugate(h,i,d),this.transform(h,i,m,f,d,e),this.conjugate(m,f,d),this.normalize13b(m,d),c.negative=a.negative^b.negative,c.length=a.length+b.length,c.strip()},f.prototype.mul=function(a){varb=newf(null);returnb.words=newArray(this.length+a.length),this.mulTo(a,b)},f.prototype.mulf=function(a){varb=newf(null);returnb.words=newArray(this.length+a.length),l(this,a,b)},f.prototype.imul=function(a){returnthis.clone().mulTo(a,this)},f.prototype.imuln=function(a){d("number"==typeofa),d(a<67108864);for(varb=0,c=0;c<this.length;c++){vare=(0|this.words[c])*a,f=(67108863&e)+(67108863&b);b>>=26,b+=e/67108864|0,b+=f>>>26,this.words[c]=67108863&f}return0!==b&&(this.words[c]=b,this.length++),this},f.prototype.muln=function(a){returnthis.clone().imuln(a)},f.prototype.sqr=function(){returnthis.mul(this)},f.prototype.isqr=function(){returnthis.imul(this.clone())},f.prototype.pow=function(a){varb=i(a);if(0===b.length)returnnewf(1);for(varc=this,d=0;d<b.length&&0===b[d];d++,c=c.sqr());if(++d<b.length)for(vare=c.sqr();d<b.length;d++,e=e.sqr())0!==b[d]&&(c=c.mul(e));returnc},f.prototype.iushln=function(a){d("number"==typeofa&&a>=0);varb,c=a%26,e=(a-c)/26,f=67108863>>>26-c<<26-c;if(0!==c){varg=0;for(b=0;b<this.length;b++){varh=this.words[b]&f,i=(0|this.words[b])-h<<c;this.words[b]=i|g,g=h>>>26-c}g&&(this.words[b]=g,this.length++)}if(0!==e){for(b=this.length-1;b>=0;b--)this.words[b+e]=this.words[b];for(b=0;b<e;b++)this.words[b]=0;this.length+=e}returnthis.strip()},f.prototype.ishln=function(a){returnd(0===this.negative),this.iushln(a)},f.prototype.iushrn=function(a,b,c){d("number"==typeofa&&a>=0);vare;e=b?(b-b%26)/26:0;varf=a%26,g=Math.min((a-f)/26,this.length),h=67108863^67108863>>>f<<f,i=c;if(e-=g,e=Math.max(0,e),i){for(varj=0;j<g;j++)i.words[j]=this.words[j];i.length=g}if(0===g);elseif(this.length>g)for(this.length-=g,j=0;j<this.length;j++)this.words[j]=this.words[j+g];elsethis.words[0]=0,this.length=1;vark=0;for(j=this.length-1;j>=0&&(0!==k||j>=e);j--){varl=0|this.words[j];this.words[j]=k<<26-f|l>>>f,k=l&h}returni&&0!==k&&(i.words[i.length++]=k),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(a,b,c){returnd(0===this.negative),this.iushrn(a,b,c)},f.prototype.shln=function(a){returnthis.clone().ishln(a)},f.prototype.ushln=function(a){returnthis.clone().iushln(a)},f.prototype.shrn=function(a){returnthis.clone().ishrn(a)},f.prototype.ushrn=function(a){returnthis.clone().iushrn(a)},f.prototype.testn=function(a){d("number"==typeofa&&a>=0);varb=a%26,c=(a-b)/26,e=1<<b;if(this.length<=c)return!1;varf=this.words[c];return!!(f&e)},f.prototype.imaskn=function(a){d("number"==typeofa&&a>=0);varb=a%26,c=(a-b)/26;if(d(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)returnthis;if(0!==b&&c++,this.length=Math.min(c,this.length),0!==b){vare=67108863^67108863>>>b<<b;this.words[this.length-1]&=e}returnthis.strip()},f.prototype.maskn=function(a){returnthis.clone().imaskn(a)},f.prototype.iaddn=function(a){returnd("number"==typeofa),d(a<67108864),a<0?this.isubn(-a):0!==this.negative?1===this.length&&(0|this.words[0])<a?(this.words[0]=a-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(a),this.negative=1,this):this._iaddn(a)},f.prototype._iaddn=function(a){this.words[0]+=a;for(varb=0;b<this.length&&this.words[b]>=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;returnthis.length=Math.
if(a[b]>=248){varc=a[b]-247;if(b+1+c>a.length)thrownewError("too short");vard=e(a,b+1,c);if(b+1+c+d>a.length)thrownewError("to short");returnh(a,b,b+1+c,c+d)}if(a[b]>=192){vard=a[b]-192;if(b+1+d>a.length)thrownewError("invalid rlp data");returnh(a,b,b+1,d)}if(a[b]>=184){varc=a[b]-183;if(b+1+c>a.length)thrownewError("invalid rlp data");vard=e(a,b+1,c);if(b+1+c+d>a.length)thrownewError("invalid rlp data");varf=k.hexlify(a.slice(b+1+c,b+1+c+d));return{consumed:1+c+d,result:f}}if(a[b]>=128){vard=a[b]-128;if(b+1+d>a.offset)thrownewError("invlaid rlp data");varf=k.hexlify(a.slice(b+1,b+1+d));return{consumed:1+d,result:f}}return{consumed:1,result:k.hexlify(a[b])}}functionj(a){a=k.arrayify(a);varb=i(a,0);if(b.consumed!==a.length)thrownewError("invalid rlp data");returnb.result}vark=a("./convert.js");b.exports={encode:g,decode:j}},{"./convert.js":60}],69:[function(a,b,c){"use strict";functiond(a){returna=g.arrayify(a),"0x"+f.sha256().update(a).digest("hex")}functione(a){returna=g.arrayify(a),"0x"+f.sha512().update(a).digest("hex")}varf=a("hash.js"),g=a("./convert.js");b.exports={sha256:d,sha512:e,createSha256:f.sha256,createSha512:f.sha512}},{"./convert.js":60,"hash.js":24}],70:[function(a,b,c){"use strict";functiond(a,b,c){switch(a){case"address":returnc?i.padZeros(b,32):i.arrayify(b);case"string":returnj.toUtf8Bytes(b);case"bytes":returni.arrayify(b);case"bool":returnb=b?"0x01":"0x00",c?i.padZeros(b,32):i.arrayify(b)}vare=a.match(n);if(e){varf=("int"===e[1],parseInt(e[2]||"256"));if(f%8!=0||0===f||f>256)thrownewError("invalid number type - "+a);returnc&&(f=256),b=h(b).toTwos(f),i.padZeros(b,f/8)}if(e=a.match(m)){varf=e[1];if(f!=parseInt(f)||0===f||f>32)thrownewError("invalid number type - "+a);if(f=parseInt(f),i.arrayify(b).byteLength!==f)thrownewError("invalid value for "+a);returnc?(b+p).substring(0,66):b}if(e=a.match(o)){varg=e[1],k=parseInt(e[2]||b.length);if(k!=b.length)thrownewError("invalid value for "+a);varl=[];returnb.forEach(function(a){a=d(g,a,!0),l.push(a)}),i.concat(l)}thrownewError("unknown type - "+a)}functione(a,b){if(a.length!=b.length)thrownewError("type/value count mismatch");varc=[];returna.forEach(function(a,e){c.push(d(a,b[e]))}),i.hexlify(i.concat(c))}functionf(a,b){returnk(e(a,b))}functiong(a,b){returnl(e(a,b))}varh=a("./bignumber").bigNumberify,i=a("./convert"),j=(a("./address").getAddress,a("./utf8")),k=a("./keccak256"),l=a("./sha2").sha256,m=newRegExp("^bytes([0-9]+)$"),n=newRegExp("^(u?int)([0-9]*)$"),o=newRegExp("^(.*)\\[([0-9]*)\\]$"),p="0000000000000000000000000000000000000000000000000000000000000000";b.exports={pack:e,keccak256:f,sha256:g}},{"./address":56,"./bignumber":57,"./convert":60,"./keccak256":64,"./sha2":69,"./utf8":73}],71:[function(a,b,c){"use strict";functiond(a,b){varc=newError(a);for(vardinb)c[d]=b[d];throwc}b.exports=d},{}],72:[function(a,b,c){functiond(a,b,c){"object"!=typeofb||c||(c=b,b=void0),null==b&&(b=18);vard=m(b);a=h(a),c||(c={});vare=a.lt(j);e&&(a=a.mul(k));for(varf=a.mod(d.tenPower).toString(10);f.length<d.decimals;)f="0"+f;c.pad||(f=f.match(/^([0-9]*[1-9]|0)(0*)/)[1]);varg=a.div(d.tenPower).toString(10);c.commify&&(g=g.replace(/\B(?=(\d{3})+(?!\d))/g,","));vara=g+"."+f;returne&&(a="-"+a),a}functione(a,b){varc=m(b||18);c||i("invalid unitType",{unitType:b}),"string"==typeofa&&a.match(/^-?[0-9.,]+$/)||i("invalid value",{input:a});vara=a.replace(/,/g,""),d="-"===a.substring(0,1);d&&(a=a.substring(1)),"."===a&&i("invalid value",{input:a});vare=a.split(".");e.length>2&&i("too many decimal points",{input:a});varf=e[0],g=e[1];for(f||(f="0"),g||(g="0"),g.length>c.decimals&&i("too many decimal places",{input:a,decimals:g.length});g.length<c.decimals;)g+="0";f=h(f),g=h(g);varj=f.mul(c.tenPower).add(g);returnd&&(j=j.mul(k)),j}functionf(a,b){returnd(a,18,b)}functiong(a){returne(a,18)}varh=a("./bignumber.js").bigNumberify,i=a("./throw-error"),j=newh(0),k=newh((-1)),l=["wei","kwei","Mwei","Gwei","szabo","finny","ether"],m=function(){vara={},b="1";returnl.forEach(function(c){vard={de