{div:e,mod:h.mod}):0!==(this.negative&a.negative)?(h=this.neg().divmod(a.neg(),b),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.isub(a)),{div:h.div,mod:g}):a.length>this.length||this.cmp(a)<0?{div:newf(0),mod:this}:1===a.length?"div"===b?{div:this.divn(a.words[0]),mod:null}:"mod"===b?{div:null,mod:newf(this.modn(a.words[0]))}:{div:this.divn(a.words[0]),mod:newf(this.modn(a.words[0]))}:this._wordDiv(a,b)},f.prototype.div=function(a){returnthis.divmod(a,"div",!1).div},f.prototype.mod=function(a){returnthis.divmod(a,"mod",!1).mod},f.prototype.umod=function(a){returnthis.divmod(a,"mod",!0).mod},f.prototype.divRound=function(a){varb=this.divmod(a);if(b.mod.isZero())returnb.div;varc=0!==b.div.negative?b.mod.isub(a):b.mod,d=a.ushrn(1),e=a.andln(1),f=c.cmp(d);returnf<0||1===e&&0===f?b.div:0!==b.div.negative?b.div.isubn(1):b.div.iaddn(1)},f.prototype.modn=function(a){d(a<=67108863);for(varb=(1<<26)%a,c=0,e=this.length-1;e>=0;e--)c=(b*c+(0|this.words[e]))%a;returnc},f.prototype.idivn=function(a){d(a<=67108863);for(varb=0,c=this.length-1;c>=0;c--){vare=(0|this.words[c])+67108864*b;this.words[c]=e/a|0,b=e%a}returnthis.strip()},f.prototype.divn=function(a){returnthis.clone().idivn(a)},f.prototype.egcd=function(a){d(0===a.negative),d(!a.isZero());varb=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(vare=newf(1),g=newf(0),h=newf(0),i=newf(1),j=0;b.isEven()&&c.isEven();)b.iushrn(1),c.iushrn(1),++j;for(vark=c.clone(),l=b.clone();!b.isZero();){for(varm=0,n=1;0===(b.words[0]&n)&&m<26;++m,n<<=1);if(m>0)for(b.iushrn(m);m-->0;)(e.isOdd()||g.isOdd())&&(e.iadd(k),g.isub(l)),e.iushrn(1),g.iushrn(1);for(varo=0,p=1;0===(c.words[0]&p)&&o<26;++o,p<<=1);if(o>0)for(c.iushrn(o);o-->0;)(h.isOdd()||i.isOdd())&&(h.iadd(k),i.isub(l)),h.iushrn(1),i.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(h),g.isub(i)):(c.isub(b),h.isub(e),i.isub(g))}return{a:h,b:i,gcd:c.iushln(j)}},f.prototype._invmp=function(a){d(0===a.negative),d(!a.isZero());varb=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(vare=newf(1),g=newf(0),h=c.clone();b.cmpn(1)>0&&c.cmpn(1)>0;){for(vari=0,j=1;0===(b.words[0]&j)&&i<26;++i,j<<=1);if(i>0)for(b.iushrn(i);i-->0;)e.isOdd()&&e.iadd(h),e.iushrn(1);for(vark=0,l=1;0===(c.words[0]&l)&&k<26;++k,l<<=1);if(k>0)for(c.iushrn(k);k-->0;)g.isOdd()&&g.iadd(h),g.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(g)):(c.isub(b),g.isub(e))}varm;returnm=0===b.cmpn(1)?e:g,m.cmpn(0)<0&&m.iadd(a),m},f.prototype.gcd=function(a){if(this.isZero())returna.abs();if(a.isZero())returnthis.abs();varb=this.clone(),c=a.clone();b.negative=0,c.negative=0;for(vard=0;b.isEven()&&c.isEven();d++)b.iushrn(1),c.iushrn(1);for(;;){for(;b.isEven();)b.iushrn(1);for(;c.isEven();)c.iushrn(1);vare=b.cmp(c);if(e<0){varf=b;b=c,c=f}elseif(0===e||0===c.cmpn(1))break;b.isub(c)}returnc.iushln(d)},f.prototype.invm=function(a){returnthis.egcd(a).a.umod(a)},f.prototype.isEven=function(){return0===(1&this.words[0])},f.prototype.isOdd=function(){return1===(1&this.words[0])},f.prototype.andln=function(a){returnthis.words[0]&a},f.prototype.bincn=function(a){d("number"==typeofa);varb=a%26,c=(a-b)/26,e=1<<b;if(this.length<=c)returnthis._expand(c+1),this.words[c]|=e,this;for(varf=e,g=c;0!==f&&g<this.length;g++){varh=0|this.words[g];h+=f,f=h>>>26,h&=67108863,this.words[g]=h}return0!==f&&(this.words[g]=f,this.length++),this},f.prototype.isZero=function(){return1===this.length&&0===this.words[0]},f.prototype.cmpn=function(a){varb=a<0;if(0!==this.negative&&!b)return-1;if(0===this.negative&&b)return1;this.strip();varc;if(this.length>1)c=1;else{b&&(a=-a),d(a<=67108863,"Number is too big");vare=0|this.words[0];c=e===a?0:e<a?-1:1}return0!==this.negative?0|-c:c},f.prototype.cmp=function(a){if(0!==this.negative&&0===a.negative)return-1;if(0===this.negative&&0!==a.negative)return1;varb=this.ucmp(a);return0!==this.negative?0|-b:b},f.prototype.ucmp=function(a){if(this.length>a.length)return1;if(this.length<a.length)return-1;for(varb=0,c=this.length-1;c>=0;c--){vard=0|this.words[c],e=0|a.words[c];if(d!==e){d<e?b=-1:d>e&&(b=1);break}}returnb},f.pro
k.defineProperty(i.prototype,"getSigner",function(a){returnnewh(this,a)}),k.defineProperty(i.prototype,"listAccounts",function(){returnthis.send("eth_accounts",[]).then(function(a){returna.forEach(function(b,c){a[c]=k.getAddress(b)}),a})}),k.defineProperty(i.prototype,"send",function(a,b){varc={method:a,params:b,id:42,jsonrpc:"2.0"};returnj.fetchJSON(this.url,JSON.stringify(c),e)}),k.defineProperty(i.prototype,"perform",function(a,b){switch(a){case"getBlockNumber":returnthis.send("eth_blockNumber",[]);case"getGasPrice":returnthis.send("eth_gasPrice",[]);case"getBalance":returnthis.send("eth_getBalance",[g(b.address),b.blockTag]);case"getTransactionCount":returnthis.send("eth_getTransactionCount",[g(b.address),b.blockTag]);case"getCode":returnthis.send("eth_getCode",[g(b.address),b.blockTag]);case"getStorageAt":returnthis.send("eth_getStorageAt",[g(b.address),b.position,b.blockTag]);case"sendTransaction":returnthis.send("eth_sendRawTransaction",[b.signedTransaction]);case"getBlock":returnb.blockTag?this.send("eth_getBlockByNumber",[b.blockTag,!1]):b.blockHash?this.send("eth_getBlockByHash",[b.blockHash,!1]):Promise.reject(newError("invalid block tag or block hash"));case"getTransaction":returnthis.send("eth_getTransactionByHash",[b.transactionHash]);case"getTransactionReceipt":returnthis.send("eth_getTransactionReceipt",[b.transactionHash]);case"call":returnthis.send("eth_call",[f(b.transaction),"latest"]);case"estimateGas":returnthis.send("eth_estimateGas",[f(b.transaction)]);case"getLogs":returnb.filter&&null!=b.filter.address&&(b.filter.address=g(b.filter.address)),this.send("eth_getLogs",[b.filter])}returnPromise.reject(newError("not implemented - "+a))}),k.defineProperty(i.prototype,"_startPending",function(){if(null==this._pendingFilter){vara=this,b=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=b,b.then(function(c){functione(){a.send("eth_getFilterChanges",[c]).then(function(c){if(a._pendingFilter==b){vare=Promise.resolve();returnc.forEach(function(b){a._emitted["t:"+b.toLowerCase()]="pending",e=e.then(function(){returna.getTransaction(b).then(function(b){a.emit("pending",b)})})}),e.then(function(){returnd(1e3)})}}).then(function(){returna._pendingFilter!=b?voida.send("eth_uninstallFilter",[filterIf]):voidsetTimeout(function(){e()},0)})}returne(),c})}}),k.defineProperty(i.prototype,"_stopPending",function(){this._pendingFilter=null}),k.defineProperty(i,"_hexlifyTransaction",function(a){returnf(a)}),b.exports=i},{"../utils/address":15,"../utils/convert":19,"../utils/errors":21,"../utils/properties":24,"../utils/utf8":27,"./provider.js":13}],12:[function(a,b,c){b.exports={unspecified:{chainId:0,name:"unspecified"},homestead:{chainId:1,ensAddress:"0x314159265dd8dbb310642f98f50c066173c1259b",name:"homestead"},mainnet:{chainId:1,ensAddress:"0x314159265dd8dbb310642f98f50c066173c1259b",name:"homestead"},morden:{chainId:2,name:"morden"},ropsten:{chainId:3,ensAddress:"0x112234455c3a32fd11230c42e7bccd4a84e02010",name:"ropsten"},testnet:{chainId:3,ensAddress:"0x112234455c3a32fd11230c42e7bccd4a84e02010",name:"ropsten"},rinkeby:{chainId:4,name:"rinkeby"},kovan:{chainId:42,name:"kovan"},classic:{chainId:61,name:"classic"}}},{}],13:[function(a,b,c){"use strict";functiond(a){varb={};for(varcina)b[c]=a[c];returnb}functione(a,b){varc={};for(vardina)try{vare=a[d](b[d]);void0!==e&&(c[d]=e)}catch(f){throwf.checkKey=d,f.checkValue=b[d],f}returnc}functionf(a,b){returnfunction(c){returnnull==c?b:a(c)}}functiong(a,b){returnfunction(c){returnc?a(c):b}}functionh(a){returnfunction(b){if(!Array.isArray(b))thrownewError("not an array");varc=[];returnb.forEach(function(b){c.push(a(b))}),c}}functioni(a){if(!F.isHexString(a)||66!==a.length)thrownewError("invalid hash - "+a);returna}functionj(a){returnF.bigNumberify(a).toNumber()}functionk(a){varb=F.bigNumberify(a);try{b=b.toNumber()}catch(c){b=null}returnb}functionl(a){if("boolean"==typeofa)returna;if("string"==typeofa){if("true"===a)return!0;if("false"===a)return!1}thrownewError("invaid boolean - "+a)