web3.js/dist/ethereum.min.js

2 lines
45 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

require=function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t,e){var n=t("../utils/utils"),r=t("../utils/config"),i=t("./types"),o=t("./formatters"),a=function(t){throw new Error("parser does not support type: "+t)},s=function(t){return"[]"===t.slice(-2)},u=function(t,e){return s(t)||"bytes"===t?o.formatInputInt(e.length):""},c=i.inputTypes(),l=function(t,e){var n="",r="",i="";return t.forEach(function(t,r){n+=u(t.type,e[r])}),t.forEach(function(n,o){for(var u=!1,l=0;l<c.length&&!u;l++)u=c[l].type(t[o].type,e[o]);u||a(t[o].type);var f=c[l-1].format;s(t[o].type)?i+=e[o].reduce(function(t,e){return t+f(e)},""):"bytes"===t[o].type?i+=f(e[o]):r+=f(e[o])}),n+=r+i},f=function(t){return s(t)||"bytes"===t?2*r.ETH_PADDING:0},p=i.outputTypes(),m=function(t,e){e=e.slice(2);var n=[],u=2*r.ETH_PADDING,c=t.reduce(function(t,e){return t+f(e.type)},0),l=e.slice(0,c);return e=e.slice(c),t.forEach(function(r,c){for(var f=!1,m=0;m<p.length&&!f;m++)f=p[m].type(t[c].type);f||a(t[c].type);var h=p[m-1].format;if(s(t[c].type)){var d=o.formatOutputUInt(l.slice(0,u));l=l.slice(u);for(var g=[],v=0;d>v;v++)g.push(h(e.slice(0,u))),e=e.slice(u);n.push(g)}else i.prefixedType("bytes")(t[c].type)?(l=l.slice(u),n.push(h(e.slice(0,u))),e=e.slice(u)):(n.push(h(e.slice(0,u))),e=e.slice(u))}),n},h=function(t){var e={};return t.forEach(function(t){var r=n.extractDisplayName(t.name),i=n.extractTypeName(t.name),o=function(){var e=Array.prototype.slice.call(arguments);return l(t.inputs,e)};void 0===e[r]&&(e[r]=o),e[r][i]=o}),e},d=function(t){var e={};return t.forEach(function(t){var r=n.extractDisplayName(t.name),i=n.extractTypeName(t.name),o=function(e){return m(t.outputs,e)};void 0===e[r]&&(e[r]=o),e[r][i]=o}),e};e.exports={inputParser:h,outputParser:d,formatInput:l,formatOutput:m}},{"../utils/config":5,"../utils/utils":6,"./formatters":2,"./types":3}],2:[function(t,e){var n=t("bignumber.js"),r=t("../utils/utils"),i=t("../utils/config"),o=function(t,e,n){return new Array(e-t.length+1).join(n?n:"0")+t},a=function(t){var e=2*i.ETH_PADDING;return n.config(i.ETH_BIGNUMBER_ROUNDING_MODE),o(r.toTwosComplement(t).round().toString(16),e)},s=function(t){return r.fromAscii(t,i.ETH_PADDING).substr(2)},u=function(t){return"000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0")},c=function(t){return a(new n(t).times(new n(2).pow(128)))},l=function(t){return"1"===new n(t.substr(0,1),16).toString(2).substr(0,1)},f=function(t){return t=t||"0",l(t)?new n(t,16).minus(new n("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new n(t,16)},p=function(t){return t=t||"0",new n(t,16)},m=function(t){return f(t).dividedBy(new n(2).pow(128))},h=function(t){return p(t).dividedBy(new n(2).pow(128))},d=function(t){return"0x"+t},g=function(t){return"0000000000000000000000000000000000000000000000000000000000000001"===t?!0:!1},v=function(t){return r.toAscii(t)},w=function(t){return"0x"+t.slice(t.length-40,t.length)};e.exports={formatInputInt:a,formatInputString:s,formatInputBool:u,formatInputReal:c,formatOutputInt:f,formatOutputUInt:p,formatOutputReal:m,formatOutputUReal:h,formatOutputHash:d,formatOutputBool:g,formatOutputString:v,formatOutputAddress:w}},{"../utils/config":5,"../utils/utils":6,"bignumber.js":"bignumber.js"}],3:[function(t,e){var n=t("./formatters"),r=function(t){return function(e){return 0===e.indexOf(t)}},i=function(t){return function(e){return t===e}},o=function(){return[{type:r("uint"),format:n.formatInputInt},{type:r("int"),format:n.formatInputInt},{type:r("bytes"),format:n.formatInputString},{type:r("real"),format:n.formatInputReal},{type:r("ureal"),format:n.formatInputReal},{type:i("address"),format:n.formatInputInt},{type:i("bool"),format:n.formatInputBool}]},a=function(){return[{type:r("uint"),format:n.formatOutputUInt},{type:r("int"),format:n.formatOutputInt},{type:r("bytes"),format:n.formatOutputString},{type:r("real"),format:n.formatOutputReal},{type:r("ureal"),format:n.formatOutputUReal},{type:i("address"),format:n.formatOutputAddress},{type:i("bool"),format:n.formatOutputBool}]};e.exports={prefixedType:r,namedType:i,inputTypes:o,outputTypes:a}},{"./formatters":2}],4:[function(t,e,n){"use strict";n.XMLHttpRequest=window.XMLHttpRequest},{}],5:[function(t,e){var n=t("bignumber.js"),r=["wei","Kwei","Mwei","Gwei","szabo","finney","ether","grand","Mether","Gether","Tether","Pether","Eether","Zether","Yether","Nether","Dether","Vether","Uether"];e.exports={ETH_PADDING:32,ETH_SIGNATURE_LENGTH:4,ETH_UNITS:r,ETH_BIGNUMBER_ROUNDING_MODE:{ROUNDING_MODE:n.ROUND_DOWN},ETH_POLLING_TIMEOUT:1e3,ETH_DEFAULTBLOCK:"latest"}},{"bignumber.js":"bignumber.js"}],6:[function(t,e){var n=t("bignumber.js"),r={wei:"1",kwei:"1000",ada:"1000",mwei:"1000000",babbage:"1000000",gwei:"1000000000",shannon:"1000000000",szabo:"1000000000000",finney:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",einstein:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"},i=function(t,e){for(var n=!1,r=0;r<t.length&&!n;r++)n=e(t[r]);return n?r-1:-1},o=function(t){var e="",n=0,r=t.length;for("0x"===t.substring(0,2)&&(n=2);r>n;n+=2){var i=parseInt(t.substr(n,2),16);if(0===i)break;e+=String.fromCharCode(i)}return e},a=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 e},s=function(t,e){e=void 0===e?0:e;for(var n=a(t);n.length<2*e;)n+="00";return"0x"+n},u=function(t){var e=t.indexOf("(");return-1!==e?t.substr(0,e):t},c=function(t){var e=t.indexOf("(");return-1!==e?t.substr(e+1,t.length-1-(e+1)).replace(" ",""):""},l=function(t){return t.filter(function(t){return"function"===t.type})},f=function(t){return t.filter(function(t){return"event"===t.type})},p=function(t){return w(t).toNumber()},m=function(t){var e=w(t),n=e.toString(16);return e.lessThan(0)?"-0x"+n.substr(1):"0x"+n},h=function(t){if(N(t))return t;if(x(t))return m(t);if(F(t))return s(JSON.stringify(t));if(_(t)){if(0===t.indexOf("-0x"))return m(t);if(!isFinite(t))return s(t)}return m(t)},d=function(t){t=t?t.toLowerCase():"ether";var e=r[t];if(void 0===e)throw new Error("This unit doesn't exists, please use the one of the following units"+JSON.stringify(r,null,2));return new n(e,10)},g=function(t,e){var n=w(t).dividedBy(d(e));return x(t)?n:n.toString(10)},v=function(t,e){var n=w(t).times(d(e));return x(t)?n:n.toString(10)},w=function(t){return t=t||0,x(t)?t:!_(t)||0!==t.indexOf("0x")&&0!==t.indexOf("-0x")?new n(t.toString(10),10):new n(t.replace("0x",""),16)},y=function(t){var e=w(t);return e.lessThan(0)?new n("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16).plus(e).plus(1):e},b=function(t){return _(t)?0===t.indexOf("0x")&&42===t.length||-1===t.indexOf("0x")&&40===t.length:!1},x=function(t){return t instanceof n||t&&t.constructor&&"BigNumber"===t.constructor.name},_=function(t){return"string"==typeof t||t&&t.constructor&&"String"===t.constructor.name},O=function(t){return"function"==typeof t},F=function(t){return"object"==typeof t},N=function(t){return"boolean"==typeof t},T=function(t){return t instanceof Array},A=function(t){try{JSON.parse(t)}catch(e){return!1}return!0};e.exports={findIndex:i,toHex:h,toDecimal:p,fromDecimal:m,toAscii:o,fromAscii:s,extractDisplayName:u,extractTypeName:c,filterFunctions:l,filterEvents:f,toWei:v,fromWei:g,toBigNumber:w,toTwosComplement:y,isBigNumber:x,isAddress:b,isFunction:O,isString:_,isObject:F,isBoolean:N,isArray:T,isJson:A}},{"bignumber.js":"bignumber.js"}],7:[function(t,e){e.exports={version:"0.1.3"}},{}],8:[function(t,e){var n=t("./version.json"),r=t("./web3/net"),i=t("./web3/eth"),o=t("./web3/db"),a=t("./web3/shh"),s=t("./web3/watches"),u=t("./web3/filter"),c=t("./utils/utils"),l=t("./web3/formatters"),f=t("./web3/requestmanager"),p=t("./utils/config"),m=t("./web3/method"),h=function(){var t=new m({name:"sha3",call:"web3_sha3",params:1,inputFormatter:[c.toHex]});return[t]},d=[{name:"version.client",getter:"web3_clientVersion"},{name:"version.network",getter:"net_version"}],g=function(t,e){e.forEach(function(e){var n=function(){var t=Array.prototype.slice.call(arguments),n=e.getCall(t),r=e.extractCallback(t);e.validateArgs(t);var i={method:n,params:e.formatInput(t)};return r?_.manager.sendAsync(i,function(t,n){r(null,e.formatOutput(n))}):e.formatOutput(_.manager.send(i))};e.attachToObject(t,n)})},v=function(t,e){e.forEach(function(e){var n=e.name.split("."),r={};r.get=function(){return _.manager.send({method:e.getter,outputFormatter:e.outputFormatter})},e.setter&&(r.set=function(t){return _.manager.send({method:e.setter,params:[t],inputFormatter:e.inputFormatter})}),r.enumerable=!e.newProperty,n.length>1?(t[n[0]]||(t[n[0]]={}),Object.defineProperty(t[n[0]],n[1],r)):Object.defineProperty(t,e.name,r)})},w=function(t,e,n,r){_.manager.startPolling({method:t,params:[e]},e,n,r)},y=function(t){_.manager.stopPolling(t)},b={startPolling:w.bind(null,"eth_getFilterChanges"),stopPolling:y},x={startPolling:w.bind(null,"shh_getFilterChanges"),stopPolling:y},_={version:{api:n.version},manager:new f,providers:{},setProvider:function(t){_.manager.setProvider(t)},reset:function(){_.manager.reset()},toHex:c.toHex,toAscii:c.toAscii,fromAscii:c.fromAscii,toDecimal:c.toDecimal,fromDecimal:c.fromDecimal,toBigNumber:c.toBigNumber,toWei:c.toWei,fromWei:c.fromWei,isAddress:c.isAddress,net:{},eth:{contractFromAbi:function(t){return console.warn("Initiating a contract like this is deprecated please use var MyContract = eth.contract(abi); new MyContract(address); instead."),function(e){e=e||"0xc6d9d2cd449a754c494264e1809c50e34d64562b";var n=_.eth.contract(e,t);return n.address=e,n}},filter:function(t,e,n){return t._isEvent?t(e,n):u(t,b,l.outputLogFormatter)},watch:function(t,e,n){return console.warn("eth.watch() is deprecated please use eth.filter() instead."),this.filter(t,e,n)}},db:{},shh:{filter:function(t){return u(t,x,l.outputPostFormatter)},watch:function(t){return console.warn("shh.watch() is deprecated please use shh.filter() instead."),this.filter(t)}}};Object.defineProperty(_.eth,"defaultBlock",{get:function(){return p.ETH_DEFAULTBLOCK},set:function(t){return p.ETH_DEFAULTBLOCK=t,p.ETH_DEFAULTBLOCK}}),g(_,h()),v(_,d),g(_.net,r.methods),v(_.net,r.properties),g(_.eth,i.methods),v(_.eth,i.properties),g(_.db,o.methods),g(_.shh,a.methods),g(b,s.eth()),g(x,s.shh()),e.exports=_},{"./utils/config":5,"./utils/utils":6,"./version.json":7,"./web3/db":10,"./web3/eth":12,"./web3/filter":14,"./web3/formatters":15,"./web3/method":18,"./web3/net":19,"./web3/requestmanager":21,"./web3/shh":22,"./web3/watches":24}],9:[function(t,e){function n(t,e){t.forEach(function(t){if(-1===t.name.indexOf("(")){var e=t.name,n=t.inputs.map(function(t){return t.type}).join();t.name=e+"("+n+")"}});var n={};return c(n),l(n,t,e),f(n,t,e),p(n,t,e),n}var r=t("../web3"),i=t("../solidity/abi"),o=t("../utils/utils"),a=t("./event"),s=t("./signature"),u=function(t){r._currentContractAbi=t.abi,r._currentContractAddress=t.address,r._currentContractMethodName=t.method,r._currentContractMethodParams=t.params},c=function(t){t.call=function(e){return t._isTransaction=!1,t._options=e,t},t.sendTransaction=function(e){return t._isTransaction=!0,t._options=e,t},t.transact=function(e){return console.warn("myContract.transact() is deprecated please use myContract.sendTransaction() instead."),t.sendTransaction(e)},t._options={},["gas","gasPrice","value","from"].forEach(function(e){t[e]=function(n){return t._options[e]=n,t}})},l=function(t,e,n){var a=i.inputParser(e),c=i.outputParser(e);o.filterFunctions(e).forEach(function(i){var l=o.extractDisplayName(i.name),f=o.extractTypeName(i.name),p=function(){var o=Array.prototype.slice.call(arguments),p=s.functionSignatureFromAscii(i.name),m=a[l][f].apply(null,o),h=t._options||{};h.to=n,h.data=p+m;var d=t._isTransaction===!0||t._isTransaction!==!1&&!i.constant,g=h.collapse!==!1;if(t._options={},t._isTransaction=null,d)return u({abi:e,address:n,method:i.name,params:o}),void r.eth.sendTransaction(h);var v=r.eth.call(h),w=c[l][f](v);return g&&(1===w.length?w=w[0]:0===w.length&&(w=null)),w};void 0===t[l]&&(t[l]=p),t[l][f]=p})},f=function(t,e,n){t.address=n,t._onWatchEventResult=function(t){var n=event.getMatchingEvent(o.filterEvents(e)),r=a.outputParser(n);return r(t)},Object.defineProperty(t,"topics",{get:function(){return o.filterEvents(e).map(function(t){return s.eventSignatureFromAscii(t.name)})}})},p=function(t,e,n){o.filterEvents(e).forEach(function(e){var i=function(){var t=Array.prototype.slice.call(arguments),i=s.eventSignatureFromAscii(e.name),o=a.inputParser(n,i,e),u=o.apply(null,t),c=function(t){var n=a.outputParser(e);return n(t)};return r.eth.filter(u,void 0,void 0,c)};i._isEvent=!0;var u=o.extractDisplayName(e.name),c=o.extractTypeName(e.name);void 0===t[u]&&(t[u]=i),t[u][c]=i})},m=function(t){return t instanceof Array&&1===arguments.length?n.bind(null,t):(console.warn("Initiating a contract like this is deprecated please use var MyContract = eth.contract(abi); new MyContract(address); instead."),new n(arguments[1],arguments[0]))};e.exports=m},{"../solidity/abi":1,"../utils/utils":6,"../web3":8,"./event":13,"./signature":23}],10:[function(t,e){var n=t("./method"),r=new n({name:"putString",call:"db_putString",params:3}),i=new n({name:"putHex",call:"db_putHex",params:3}),o=new n({name:"getString",call:"db_getString",params:2}),a=new n({name:"getHex",call:"db_getHex",params:2}),s=[r,i,o,a];e.exports={methods:s}},{"./method":18}],11:[function(t,e){e.exports={InvalidNumberOfParams:new Error("invalid number of input params"),InvalidProvider:new Error("invalid provider, it is not set or invalid"),InvalidResponse:new Error("invalid jsonrpc response")}},{}],12:[function(t,e){"use strict";var n=t("./formatters"),r=t("../utils/utils"),i=t("./method"),o=function(t){return r.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getBlockByHash":"eth_getBlockByNumber"},a=function(t){return r.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getTransactionByBlockHashAndIndex":"eth_getTransactionByBlockNumberAndIndex"},s=function(t){return r.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getUncleByBlockHashAndIndex":"eth_getUncleByBlockNumberAndIndex"},u=function(t){return r.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getBlockTransactionCountByHash":"eth_getBlockTransactionCountByNumber"},c=function(t){return r.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getUncleCountByBlockHash":"eth_getUncleCountByBlockNumber"},l=new i({name:"getBalance",call:"eth_getBalance",params:2,inputFormatter:[null,n.inputBlockNumberFormatter],outputFormatter:n.inputNumberFormatter}),f=new i({name:"getStorageAt",call:"eth_getStorageAt",params:3}),p=new i({name:"getCode",call:"eth_getCode",params:2}),m=new i({name:"getBlock",call:o,params:1,outputFormatter:n.outputBlockFormatter,inputFormatter:n.inputBlockFormatter}),h=new i({name:"getUncle",call:s,params:1,outputFormatter:n.outputBlockFormatter,inputFormatter:n.inputUncleFormatter}),d=new i({name:"getCompilers",call:"eth_getCompilers",params:0}),g=new i({name:"getBlockTransactionCount",call:u,params:1,outputFormatter:r.toDecimal,inputFormatter:r.toHex}),v=new i({name:"getBlockUncleCount",call:c,params:1,outputFormatter:r.toDecimal,inputFormatter:r.toHex}),w=new i({name:"getTransaction",call:"eth_getTransactionByHash",params:1,outputFormatter:n.outputTransactionFormatter}),y=new i({name:"getTransactionFromBlock",call:a,params:2,outputFormatter:n.outputTransactionFormatter,inputFormatter:r.toHex}),b=new i({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,outputFormatter:r.toDecimal}),x=new i({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:n.inputTransactionFormatter}),_=new i({name:"call",call:"eth_call",params:2,inputFormatter:n.inputCallFormatter}),O=new i({name:"compile.solidity",call:"eth_compileSolidity",params:1}),F=new i({name:"compile.lll",call:"eth_compileLLL",params:1,inputFormatter:r.toHex}),N=new i({name:"compile.serpent",call:"eth_compileSerpent",params:1,inputFormatter:r.toHex}),T=new i({name:"flush",call:"eth_flush",params:0}),A=[l,f,p,m,h,d,g,v,w,y,b,_,x,O,F,N,T],I=[{name:"coinbase",getter:"eth_coinbase"},{name:"mining",getter:"eth_mining"},{name:"gasPrice",getter:"eth_gasPrice",outputFormatter:n.inputNumberFormatter},{name:"accounts",getter:"eth_accounts"},{name:"blockNumber",getter:"eth_blockNumber",outputFormatter:r.toDecimal},{name:"listening",getter:"net_listening",setter:"eth_setListening",deprecated:"net.listening"},{name:"peerCount",getter:"net_peerCount",deprecated:"net.peerCount"},{name:"number",getter:"eth_number",deprecated:"eth.blockNumber"}];e.exports={methods:A,properties:I}},{"../utils/utils":6,"./formatters":15,"./method":18}],13:[function(t,e){var n=t("../solidity/abi"),r=t("../utils/utils"),i=t("./signature"),o=function(t,e){return t.filter(function(t){return t.indexed===e})},a=function(t,e){var n=r.findIndex(t,function(t){return t.name===e});return-1===n?void console.error("indexed param with name "+e+" not found"):t[n]},s=function(t,e){return Object.keys(e).map(function(r){var i=[a(o(t.inputs,!0),r)],s=e[r];return s instanceof Array?s.map(function(t){return n.formatInput(i,[t])}):n.formatInput(i,[s])})},u=function(t,e,n){return function(r,i){var o=i||{};return o.address=t,o.topics=[],o.topics.push(e),r&&(o.topics=o.topics.concat(s(n,r))),o}},c=function(t,e,n){var r=e.slice(),i=n.slice();return t.reduce(function(t,e){var n;return n=e.indexed?r.splice(0,1)[0]:i.splice(0,1)[0],t[e.name]=n,t},{})},l=function(t){return function(e){var i={event:r.extractDisplayName(t.name),number:e.number,hash:e.hash,args:{}};if(e.topics=e.topic,!e.topics)return i;var a=o(t.inputs,!0),s="0x"+e.topics.slice(1,e.topics.length).map(function(t){return t.slice(2)}).join(""),u=n.formatOutput(a,s),l=o(t.inputs,!1),f=n.formatOutput(l,e.data);return i.args=c(t.inputs,u,f),i}},f=function(t,e){for(var n=0;n<t.length;n++){var r=i.eventSignatureFromAscii(t[n].name);if(r===e.topics[0])return t[n]}return void 0};e.exports={inputParser:u,outputParser:l,getMatchingEvent:f}},{"../solidity/abi":1,"../utils/utils":6,"./signature":23}],14:[function(t,e){var n=t("../utils/utils"),r=function(t){return!!t&&"function"==typeof t.newFilter&&"function"==typeof t.getLogs&&"function"==typeof t.uninstallFilter&&"function"==typeof t.startPolling&&"function"==typeof t.stopPolling},i=function(t){return"string"==typeof t?t:(t=t||{},t.topic&&(console.warn('"topic" is deprecated, is "topics" instead'),t.topics=t.topic),t.earliest&&(console.warn('"earliest" is deprecated, is "fromBlock" instead'),t.fromBlock=t.earliest),t.latest&&(console.warn('"latest" is deprecated, is "toBlock" instead'),t.toBlock=t.latest),t.skip&&(console.warn('"skip" is deprecated, is "offset" instead'),t.offset=t.skip),t.max&&(console.warn('"max" is deprecated, is "limit" instead'),t.limit=t.max),t.topics instanceof Array&&(t.topics=t.topics.map(function(t){return n.toHex(t)})),{fromBlock:n.toHex(t.fromBlock),toBlock:n.toHex(t.toBlock),limit:n.toHex(t.limit),offset:n.toHex(t.offset),to:t.to,address:t.address,topics:t.topics})},o=function(t,e,o){if(!r(e))return void console.error("filter implemenation is invalid");t=i(t);var a=[],s=e.newFilter(t),u=function(t){t.forEach(function(t){t=o?o(t):t,a.forEach(function(e){e(t)})})},c=function(t){e.startPolling(s,u,e.uninstallFilter),a.push(t)},l=function(){e.stopPolling(s),a=[]},f=function(){e.stopPolling(s),e.uninstallFilter(s),a=[]},p=function(){var t=e.getLogs(s);return n.isArray(t)?t.map(function(t){return o?o(t):t}):t};return{watch:c,stopWatching:l,get:p,uninstall:f,changed:function(){return console.warn("watch().changed() is deprecated please use filter().watch() instead."),c.apply(this,arguments)},arrived:function(){return console.warn("watch().arrived() is deprecated please use filter().watch() instead."),c.apply(this,arguments)},happened:function(){return console.warn("watch().happened() is deprecated please use filter().watch() instead."),c.apply(this,arguments)},messages:function(){return console.warn("watch().messages() is deprecated please use filter().get() instead."),p.apply(this,arguments)},logs:function(){return console.warn("watch().logs() is deprecated please use filter().get() instead."),p.apply(this,arguments)}}};e.exports=o},{"../utils/utils":6}],15:[function(t,e){var n=t("../utils/utils"),r=function(t){return n.toBigNumber(t)},i=function(t){return null===t?-1:t},o=function(t){return t.code&&(t.data=t.code,delete t.code),["gasPrice","gas","value"].forEach(function(e){t[e]=n.fromDecimal(t[e])}),t},a=function(t){return t.gas=n.toDecimal(t.gas),t.gasPrice=n.toBigNumber(t.gasPrice),t.value=n.toBigNumber(t.value),t},s=function(t){return t.code&&(t.data=t.code,delete t.code),t},u=function(t){return t[0]=n.toHex(t[0]),t[1]=!!t[1],t},c=function(t){return t[0]=n.toHex(t[0]),t[1]=n.toHex(t[1]),t[2]=!!t[2],t},l=function(t){return t.gasLimit=n.toDecimal(t.gasLimit),t.gasUsed=n.toDecimal(t.gasUsed),t.size=n.toDecimal(t.size),t.timestamp=n.toDecimal(t.timestamp),t.number=n.toDecimal(t.number),t.minGasPrice=n.toBigNumber(t.minGasPrice),t.difficulty=n.toBigNumber(t.difficulty),t.totalDifficulty=n.toBigNumber(t.totalDifficulty),t.transactions instanceof Array&&t.transactions.forEach(function(t){return n.isString(t)?void 0:a(t)}),t},f=function(t){return t.blockNumber=n.toDecimal(t.blockNumber),t.transactionIndex=n.toDecimal(t.transactionIndex),t.logIndex=n.toDecimal(t.logIndex),t},p=function(t){return t.payload=n.toHex(t.payload),t.ttl=n.fromDecimal(t.ttl),t.priority=n.fromDecimal(t.priority),t.topics instanceof Array||(t.topics=[t.topics]),t.topics=t.topics.map(function(t){return n.fromAscii(t)}),t},m=function(t){if(t.expiry=n.toDecimal(t.expiry),t.sent=n.toDecimal(t.sent),t.ttl=n.toDecimal(t.ttl),t.workProved=n.toDecimal(t.workProved),t.payloadRaw=t.payload,t.payload=n.toAscii(t.payload),0===t.payload.indexOf("{")||0===t.payload.indexOf("["))try{t.payload=JSON.parse(t.payload)}catch(e){}return t.topics=t.topics.map(function(t){return n.toAscii(t)}),t};e.exports={inputBlockNumberFormatter:i,inputTransactionFormatter:o,inputCallFormatter:s,inputPostFormatter:p,inputBlockFormatter:u,inputUncleFormatter:c,outputNumberFormatter:r,outputTransactionFormatter:a,outputBlockFormatter:l,outputLogFormatter:f,outputPostFormatter:m}},{"../utils/utils":6}],16:[function(t,e){"use strict";var n=t("xmlhttprequest").XMLHttpRequest,r=function(t){this.host=t||"http://localhost:8080"};r.prototype.send=function(t){var e=new n;return e.open("POST",this.host,!1),e.send(JSON.stringify(t)),JSON.parse(e.responseText)},r.prototype.sendAsync=function(t,e){var r=new n;r.onreadystatechange=function(){4===r.readyState&&e(null,JSON.parse(r.responseText))},r.open("POST",this.host,!0),r.send(JSON.stringify(t))},e.exports=r},{xmlhttprequest:4}],17:[function(t,e){var n=function(){this.messageId=1};n.prototype.toPayload=function(t,e){return t||console.error("jsonrpc method should be specified!"),{jsonrpc:"2.0",method:t,params:e||[],id:this.messageId++}},n.prototype.isValidResponse=function(t){return!!t&&!t.error&&"2.0"===t.jsonrpc&&"number"==typeof t.id&&void 0!==t.result},n.prototype.toBatchPayload=function(t){var e=this;return t.map(function(t){return e.toPayload(t.method,t.params)})},e.exports=n},{}],18:[function(t,e){var n=t("../utils/utils"),r=t("./errors"),i=function(t){this.name=t.name,this.call=t.call,this.params=t.params||0,this.inputFormatter=t.inputFormatter,this.outputFormatter=t.outputFormatter};i.prototype.getCall=function(t){return n.isFunction(this.call)?this.call(t):this.call},i.prototype.extractCallback=function(t){return n.isFunction(t[t.length-1])?t.pop():null},i.prototype.validateArgs=function(t){if(t.length!==this.params)throw r.InvalidNumberOfParams},i.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter.map(function(e,n){return e?e(t[n]):t[n]}):t},i.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},i.prototype.attachToObject=function(t,e){var n=this.name.split(".");n.length>1?(t[n[0]]=t[n[0]]||{},t[n[0]][n[1]]=e):t[n[0]]=e},e.exports=i},{"../utils/utils":6,"./errors":11}],19:[function(t,e){var n=t("../utils/utils"),r=[],i=[{name:"listening",getter:"net_listening"},{name:"peerCount",getter:"net_peerCount",outputFormatter:n.toDecimal}];e.exports={methods:r,properties:i}},{"../utils/utils":6}],20:[function(t,e){var n=function(){};n.prototype.send=function(t){var e=navigator.qt.callMethod(JSON.stringify(t));return JSON.parse(e)},e.exports=n},{}],21:[function(t,e){var n=t("./jsonrpc"),r=t("../utils/utils"),i=t("../utils/config"),o=t("./errors"),a=function(t){this.jsonrpc=new n,this.provider=t,this.polls=[],this.timeout=null,this.poll()};a.prototype.send=function(t){if(!this.provider)return console.error(o.InvalidProvider),null;var e=this.jsonrpc.toPayload(t.method,t.params),n=this.provider.send(e);if(!this.jsonrpc.isValidResponse(n))throw o.InvalidResponse;return n.result},a.prototype.sendAsync=function(t,e){if(!this.provider)return e(o.InvalidProvider);var n=this.jsonrpc.toPayload(t.method,t.params),r=this;this.provider.sendAsync(n,function(t,n){return t?e(t):r.jsonrpc.isValidResponse(n)?void e(null,n.result):e(o.InvalidResponse)})},a.prototype.setProvider=function(t){this.provider=t},a.prototype.startPolling=function(t,e,n,r){this.polls.push({data:t,id:e,callback:n,uninstall:r})},a.prototype.stopPolling=function(t){for(var e=this.polls.length;e--;){var n=this.polls[e];n.id===t&&this.polls.splice(e,1)}},a.prototype.reset=function(){this.polls.forEach(function(t){t.uninstall(t.id)}),this.polls=[],this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.poll()},a.prototype.poll=function(){if(this.timeout=setTimeout(this.poll.bind(this),i.ETH_POLLING_TIMEOUT),!this.provider)return void console.error(o.InvalidProvider);var t=this.jsonrpc.toBatchPayload(this.polls.map(function(t){return t.data})),e=this;this.provider.sendAsync(t,function(t,n){return t?void 0:r.isArray(n)?void n.map(function(t,n){return t.callback=e.polls[n].callback,t}).filter(function(t){var n=e.jsonrpc.isValidResponse(t);return n||t.callback(o.InvalidResponse),n}).filter(function(t){return r.isArray(t.result)&&t.result.length>0}).forEach(function(t){t.callback(null,t)}):console.error(o.InvalidResponse)})},e.exports=a},{"../utils/config":5,"../utils/utils":6,"./errors":11,"./jsonrpc":17}],22:[function(t,e){var n=t("./method"),r=t("./formatters"),i=new n({name:"post",call:"shh_post",params:1,inputFormatter:r.inputPostFormatter}),o=new n({name:"newIdentity",call:"shh_newIdentity",params:0}),a=new n({name:"hasIdentity",call:"shh_hasIdentity",params:1}),s=new n({name:"newGroup",call:"shh_newGroup",params:0}),u=new n({name:"addToGroup",call:"shh_addToGroup",params:0}),c=[i,o,a,s,u];e.exports={methods:c}},{"./formatters":15,"./method":18}],23:[function(t,e){var n=t("../web3"),r=t("../utils/config"),i=function(t){return n.sha3(n.fromAscii(t)).slice(0,2+2*r.ETH_SIGNATURE_LENGTH)},o=function(t){return n.sha3(n.fromAscii(t))};e.exports={functionSignatureFromAscii:i,eventSignatureFromAscii:o}},{"../utils/config":5,"../web3":8}],24:[function(t,e){var n=t("./method"),r=function(){var t=function(t){return"string"==typeof t[0]?"eth_newBlockFilter":"eth_newFilter"},e=new n({name:"newFilter",call:t,params:1}),r=new n({name:"uninstallFilter",call:"eth_uninstallFilter",params:1}),i=new n({name:"getLogs",call:"eth_getFilterLogs",params:1});return[e,r,i]},i=function(){var t=new n({name:"newFilter",call:"shh_newFilter",params:1}),e=new n({name:"uninstallFilter",call:"shh_uninstallFilter",params:1}),r=new n({name:"getLogs",call:"shh_getMessages",params:1});return[t,e,r]};e.exports={eth:r,shh:i}},{"./method":18}],25:[function(){},{}],"bignumber.js":[function(t,e){!function(n){"use strict";function r(t){function e(t,r){var i,o,a,s,u,c,l=this;if(!(l instanceof e))return J&&D(26,"constructor call without new",t),new e(t,r);if(null!=r&&W(r,2,64,C,"base")){if(r=0|r,c=t+"",10==r)return l=new e(t instanceof e?t:c),S(l,U+l.e+1,L);if((s="number"==typeof t)&&0*t!=0||!new RegExp("^-?"+(i="["+_.slice(0,r)+"]+")+"(?:\\."+i+")?$",37>r?"i":"").test(c))return d(l,c,s,r);s?(l.s=0>1/t?(c=c.slice(1),-1):1,J&&c.replace(/^0\.0*|\./,"").length>15&&D(C,x,t),s=!1):l.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1,c=n(c,10,r,l.s)}else{if(t instanceof e)return l.s=t.s,l.e=t.e,l.c=(t=t.c)?t.slice():t,void(C=0);if((s="number"==typeof t)&&0*t==0){if(l.s=0>1/t?(t=-t,-1):1,t===~~t){for(o=0,a=t;a>=10;a/=10,o++);return l.e=o,l.c=[t],void(C=0)}c=t+""}else{if(!g.test(c=t+""))return d(l,c,s);l.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1}}for((o=c.indexOf("."))>-1&&(c=c.replace(".","")),(a=c.search(/e/i))>0?(0>o&&(o=a),o+=+c.slice(a+1),c=c.substring(0,a)):0>o&&(o=c.length),a=0;48===c.charCodeAt(a);a++);for(u=c.length;48===c.charCodeAt(--u););if(c=c.slice(a,u+1))if(u=c.length,s&&J&&u>15&&D(C,x,l.s*t),o=o-a-1,o>q)l.c=l.e=null;else if(G>o)l.c=[l.e=0];else{if(l.e=o,l.c=[],a=(o+1)%F,0>o&&(a+=F),u>a){for(a&&l.c.push(+c.slice(0,a)),u-=F;u>a;)l.c.push(+c.slice(a,a+=F));c=c.slice(a),a=F-c.length}else a-=u;for(;a--;c+="0");l.c.push(+c)}else l.c=[l.e=0];C=0}function n(t,n,r,i){var a,s,u,l,p,m,h,d=t.indexOf("."),g=U,v=L;for(37>r&&(t=t.toLowerCase()),d>=0&&(u=$,$=0,t=t.replace(".",""),h=new e(r),p=h.pow(t.length-d),$=u,h.c=c(f(o(p.c),p.e),10,n),h.e=h.c.length),m=c(t,r,n),s=u=m.length;0==m[--u];m.pop());if(!m[0])return"0";if(0>d?--s:(p.c=m,p.e=s,p.s=i,p=k(p,h,g,v,n),m=p.c,l=p.r,s=p.e),a=s+g+1,d=m[a],u=n/2,l=l||0>a||null!=m[a+1],l=4>v?(null!=d||l)&&(0==v||v==(p.s<0?3:2)):d>u||d==u&&(4==v||l||6==v&&1&m[a-1]||v==(p.s<0?8:7)),1>a||!m[0])t=l?f("1",-g):"0";else{if(m.length=a,l)for(--n;++m[--a]>n;)m[a]=0,a||(++s,m.unshift(1));for(u=m.length;!m[--u];);for(d=0,t="";u>=d;t+=_.charAt(m[d++]));t=f(t,s)}return t}function m(t,n,r,i){var a,s,u,c,p;if(r=null!=r&&W(r,0,8,i,b)?0|r:L,!t.c)return t.toString();if(a=t.c[0],u=t.e,null==n)p=o(t.c),p=19==i||24==i&&j>=u?l(p,u):f(p,u);else if(t=S(new e(t),n,r),s=t.e,p=o(t.c),c=p.length,19==i||24==i&&(s>=n||j>=s)){for(;n>c;p+="0",c++);p=l(p,s)}else if(n-=u,p=f(p,s),s+1>c){if(--n>0)for(p+=".";n--;p+="0");}else if(n+=s-c,n>0)for(s+1==c&&(p+=".");n--;p+="0");return t.s<0&&a?"-"+p:p}function E(t,n){var r,i,o=0;for(u(t[0])&&(t=t[0]),r=new e(t[0]);++o<t.length;){if(i=new e(t[o]),!i.s){r=i;break}n.call(r,i)&&(r=i)}return r}function B(t,e,n,r,i){return(e>t||t>n||t!=p(t))&&D(r,(i||"decimal places")+(e>t||t>n?" out of range":" not an integer"),t),!0}function P(t,e,n){for(var r=1,i=e.length;!e[--i];e.pop());for(i=e[0];i>=10;i/=10,r++);return(n=r+n*F-1)>q?t.c=t.e=null:G>n?t.c=[t.e=0]:(t.e=n,t.c=e),t}function D(t,e,n){var r=new Error(["new BigNumber","cmp","config","div","divToInt","eq","gt","gte","lt","lte","minus","mod","plus","precision","random","round","shift","times","toDigits","toExponential","toFixed","toFormat","toFraction","pow","toPrecision","toString","BigNumber"][t]+"() "+e+": "+n);throw r.name="BigNumber Error",C=0,r}function S(t,e,n,r){var i,o,a,s,u,c,l,f=t.c,p=T;if(f){t:{for(i=1,s=f[0];s>=10;s/=10,i++);if(o=e-i,0>o)o+=F,a=e,u=f[c=0],l=u/p[i-a-1]%10|0;else if(c=v((o+1)/F),c>=f.length){if(!r)break t;for(;f.length<=c;f.push(0));u=l=0,i=1,o%=F,a=o-F+1}else{for(u=s=f[c],i=1;s>=10;s/=10,i++);o%=F,a=o-F+i,l=0>a?0:u/p[i-a-1]%10|0}if(r=r||0>e||null!=f[c+1]||(0>a?u:u%p[i-a-1]),r=4>n?(l||r)&&(0==n||n==(t.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(o>0?a>0?u/p[i-a]:0:f[c-1])%10&1||n==(t.s<0?8:7)),1>e||!f[0])return f.length=0,r?(e-=t.e+1,f[0]=p[e%F],t.e=-e||0):f[0]=t.e=0,t;if(0==o?(f.length=c,s=1,c--):(f.length=c+1,s=p[F-o],f[c]=a>0?w(u/p[i-a]%p[a])*s:0),r)for(;;){if(0==c){for(o=1,a=f[0];a>=10;a/=10,o++);for(a=f[0]+=s,s=1;a>=10;a/=10,s++);o!=s&&(t.e++,f[0]==O&&(f[0]=1));
break}if(f[c]+=s,f[c]!=O)break;f[c--]=0,s=1}for(o=f.length;0===f[--o];f.pop());}t.e>q?t.c=t.e=null:t.e<G&&(t.c=[t.e=0])}return t}var k,C=0,H=e.prototype,R=new e(1),U=20,L=4,j=-7,M=21,G=-1e7,q=1e7,J=!0,W=B,z=!1,V=1,$=100,K={decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:" ",fractionGroupSize:0};return e.another=r,e.ROUND_UP=0,e.ROUND_DOWN=1,e.ROUND_CEIL=2,e.ROUND_FLOOR=3,e.ROUND_HALF_UP=4,e.ROUND_HALF_DOWN=5,e.ROUND_HALF_EVEN=6,e.ROUND_HALF_CEIL=7,e.ROUND_HALF_FLOOR=8,e.EUCLID=9,e.config=function(){var t,e,n=0,r={},i=arguments,o=i[0],a=o&&"object"==typeof o?function(){return o.hasOwnProperty(e)?null!=(t=o[e]):void 0}:function(){return i.length>n?null!=(t=i[n++]):void 0};return a(e="DECIMAL_PLACES")&&W(t,0,I,2,e)&&(U=0|t),r[e]=U,a(e="ROUNDING_MODE")&&W(t,0,8,2,e)&&(L=0|t),r[e]=L,a(e="EXPONENTIAL_AT")&&(u(t)?W(t[0],-I,0,2,e)&&W(t[1],0,I,2,e)&&(j=0|t[0],M=0|t[1]):W(t,-I,I,2,e)&&(j=-(M=0|(0>t?-t:t)))),r[e]=[j,M],a(e="RANGE")&&(u(t)?W(t[0],-I,-1,2,e)&&W(t[1],1,I,2,e)&&(G=0|t[0],q=0|t[1]):W(t,-I,I,2,e)&&(0|t?G=-(q=0|(0>t?-t:t)):J&&D(2,e+" cannot be zero",t))),r[e]=[G,q],a(e="ERRORS")&&(t===!!t||1===t||0===t?(C=0,W=(J=!!t)?B:s):J&&D(2,e+y,t)),r[e]=J,a(e="CRYPTO")&&(t===!!t||1===t||0===t?(z=!(!t||!h||"object"!=typeof h),t&&!z&&J&&D(2,"crypto unavailable",h)):J&&D(2,e+y,t)),r[e]=z,a(e="MODULO_MODE")&&W(t,0,9,2,e)&&(V=0|t),r[e]=V,a(e="POW_PRECISION")&&W(t,0,I,2,e)&&($=0|t),r[e]=$,a(e="FORMAT")&&("object"==typeof t?K=t:J&&D(2,e+" not an object",t)),r[e]=K,r},e.max=function(){return E(arguments,H.lt)},e.min=function(){return E(arguments,H.gt)},e.random=function(){var t=9007199254740992,n=Math.random()*t&2097151?function(){return w(Math.random()*t)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(t){var r,i,o,a,s,u=0,c=[],l=new e(R);if(t=null!=t&&W(t,0,I,14)?0|t:U,a=v(t/F),z)if(h&&h.getRandomValues){for(r=h.getRandomValues(new Uint32Array(a*=2));a>u;)s=131072*r[u]+(r[u+1]>>>11),s>=9e15?(i=h.getRandomValues(new Uint32Array(2)),r[u]=i[0],r[u+1]=i[1]):(c.push(s%1e14),u+=2);u=a/2}else if(h&&h.randomBytes){for(r=h.randomBytes(a*=7);a>u;)s=281474976710656*(31&r[u])+1099511627776*r[u+1]+4294967296*r[u+2]+16777216*r[u+3]+(r[u+4]<<16)+(r[u+5]<<8)+r[u+6],s>=9e15?h.randomBytes(7).copy(r,u):(c.push(s%1e14),u+=7);u=a/7}else J&&D(14,"crypto unavailable",h);if(!u)for(;a>u;)s=n(),9e15>s&&(c[u++]=s%1e14);for(a=c[--u],t%=F,a&&t&&(s=T[F-t],c[u]=w(a/s)*s);0===c[u];c.pop(),u--);if(0>u)c=[o=0];else{for(o=-1;0===c[0];c.shift(),o-=F);for(u=1,s=c[0];s>=10;s/=10,u++);F>u&&(o-=F-u)}return l.e=o,l.c=c,l}}(),k=function(){function t(t,e,n){var r,i,o,a,s=0,u=t.length,c=e%A,l=e/A|0;for(t=t.slice();u--;)o=t[u]%A,a=t[u]/A|0,r=l*o+a*c,i=c*o+r%A*A+s,s=(i/n|0)+(r/A|0)+l*a,t[u]=i%n;return s&&t.unshift(s),t}function n(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;n>i;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function r(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]<e[n]?1:0,t[n]=i*r+t[n]-e[n];for(;!t[0]&&t.length>1;t.shift());}return function(o,a,s,u,c){var l,f,p,m,h,d,g,v,y,b,x,_,N,T,A,I,E,B=o.s==a.s?1:-1,P=o.c,D=a.c;if(!(P&&P[0]&&D&&D[0]))return new e(o.s&&a.s&&(P?!D||P[0]!=D[0]:D)?P&&0==P[0]||!D?0*B:B/0:0/0);for(v=new e(B),y=v.c=[],f=o.e-a.e,B=s+f+1,c||(c=O,f=i(o.e/F)-i(a.e/F),B=B/F|0),p=0;D[p]==(P[p]||0);p++);if(D[p]>(P[p]||0)&&f--,0>B)y.push(1),m=!0;else{for(T=P.length,I=D.length,p=0,B+=2,h=w(c/(D[0]+1)),h>1&&(D=t(D,h,c),P=t(P,h,c),I=D.length,T=P.length),N=I,b=P.slice(0,I),x=b.length;I>x;b[x++]=0);E=D.slice(),E.unshift(0),A=D[0],D[1]>=c/2&&A++;do h=0,l=n(D,b,I,x),0>l?(_=b[0],I!=x&&(_=_*c+(b[1]||0)),h=w(_/A),h>1?(h>=c&&(h=c-1),d=t(D,h,c),g=d.length,x=b.length,l=n(d,b,g,x),1==l&&(h--,r(d,g>I?E:D,g,c))):(0==h&&(l=h=1),d=D.slice()),g=d.length,x>g&&d.unshift(0),r(b,d,x,c),-1==l&&(x=b.length,l=n(D,b,I,x),1>l&&(h++,r(b,x>I?E:D,x,c))),x=b.length):0===l&&(h++,b=[0]),y[p++]=h,l&&b[0]?b[x++]=P[N]||0:(b=[P[N]],x=1);while((N++<T||null!=b[0])&&B--);m=null!=b[0],y[0]||y.shift()}if(c==O){for(p=1,B=y[0];B>=10;B/=10,p++);S(v,s+(v.e=p+f*F-1)+1,u,m)}else v.e=f,v.r=+m;return v}}(),d=function(){var t=/^(-?)0([xbo])(?=\w[\w.]*$)/i,n=/^([^.]+)\.$/,r=/^\.([^.]+)$/,i=/^-?(Infinity|NaN)$/,o=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(a,s,u,c){var l,f=u?s:s.replace(o,"");if(i.test(f))a.s=isNaN(f)?null:0>f?-1:1;else{if(!u&&(f=f.replace(t,function(t,e,n){return l="x"==(n=n.toLowerCase())?16:"b"==n?2:8,c&&c!=l?t:e}),c&&(l=c,f=f.replace(n,"$1").replace(r,"0.$1")),s!=f))return new e(f,l);J&&D(C,"not a"+(c?" base "+c:"")+" number",s),a.s=null}a.c=a.e=null,C=0}}(),H.absoluteValue=H.abs=function(){var t=new e(this);return t.s<0&&(t.s=1),t},H.ceil=function(){return S(new e(this),this.e+1,2)},H.comparedTo=H.cmp=function(t,n){return C=1,a(this,new e(t,n))},H.decimalPlaces=H.dp=function(){var t,e,n=this.c;if(!n)return null;if(t=((e=n.length-1)-i(this.e/F))*F,e=n[e])for(;e%10==0;e/=10,t--);return 0>t&&(t=0),t},H.dividedBy=H.div=function(t,n){return C=3,k(this,new e(t,n),U,L)},H.dividedToIntegerBy=H.divToInt=function(t,n){return C=4,k(this,new e(t,n),0,1)},H.equals=H.eq=function(t,n){return C=5,0===a(this,new e(t,n))},H.floor=function(){return S(new e(this),this.e+1,3)},H.greaterThan=H.gt=function(t,n){return C=6,a(this,new e(t,n))>0},H.greaterThanOrEqualTo=H.gte=function(t,n){return C=7,1===(n=a(this,new e(t,n)))||0===n},H.isFinite=function(){return!!this.c},H.isInteger=H.isInt=function(){return!!this.c&&i(this.e/F)>this.c.length-2},H.isNaN=function(){return!this.s},H.isNegative=H.isNeg=function(){return this.s<0},H.isZero=function(){return!!this.c&&0==this.c[0]},H.lessThan=H.lt=function(t,n){return C=8,a(this,new e(t,n))<0},H.lessThanOrEqualTo=H.lte=function(t,n){return C=9,-1===(n=a(this,new e(t,n)))||0===n},H.minus=H.sub=function(t,n){var r,o,a,s,u=this,c=u.s;if(C=10,t=new e(t,n),n=t.s,!c||!n)return new e(0/0);if(c!=n)return t.s=-n,u.plus(t);var l=u.e/F,f=t.e/F,p=u.c,m=t.c;if(!l||!f){if(!p||!m)return p?(t.s=-n,t):new e(m?u:0/0);if(!p[0]||!m[0])return m[0]?(t.s=-n,t):new e(p[0]?u:3==L?-0:0)}if(l=i(l),f=i(f),p=p.slice(),c=l-f){for((s=0>c)?(c=-c,a=p):(f=l,a=m),a.reverse(),n=c;n--;a.push(0));a.reverse()}else for(o=(s=(c=p.length)<(n=m.length))?c:n,c=n=0;o>n;n++)if(p[n]!=m[n]){s=p[n]<m[n];break}if(s&&(a=p,p=m,m=a,t.s=-t.s),n=(o=m.length)-(r=p.length),n>0)for(;n--;p[r++]=0);for(n=O-1;o>c;){if(p[--o]<m[o]){for(r=o;r&&!p[--r];p[r]=n);--p[r],p[o]+=O}p[o]-=m[o]}for(;0==p[0];p.shift(),--f);return p[0]?P(t,p,f):(t.s=3==L?-1:1,t.c=[t.e=0],t)},H.modulo=H.mod=function(t,n){var r,i,o=this;return C=11,t=new e(t,n),!o.c||!t.s||t.c&&!t.c[0]?new e(0/0):!t.c||o.c&&!o.c[0]?new e(o):(9==V?(i=t.s,t.s=1,r=k(o,t,0,3),t.s=i,r.s*=i):r=k(o,t,0,V),o.minus(r.times(t)))},H.negated=H.neg=function(){var t=new e(this);return t.s=-t.s||null,t},H.plus=H.add=function(t,n){var r,o=this,a=o.s;if(C=12,t=new e(t,n),n=t.s,!a||!n)return new e(0/0);if(a!=n)return t.s=-n,o.minus(t);var s=o.e/F,u=t.e/F,c=o.c,l=t.c;if(!s||!u){if(!c||!l)return new e(a/0);if(!c[0]||!l[0])return l[0]?t:new e(c[0]?o:0*a)}if(s=i(s),u=i(u),c=c.slice(),a=s-u){for(a>0?(u=s,r=l):(a=-a,r=c),r.reverse();a--;r.push(0));r.reverse()}for(a=c.length,n=l.length,0>a-n&&(r=l,l=c,c=r,n=a),a=0;n;)a=(c[--n]=c[n]+l[n]+a)/O|0,c[n]%=O;return a&&(c.unshift(a),++u),P(t,c,u)},H.precision=H.sd=function(t){var e,n,r=this,i=r.c;if(null!=t&&t!==!!t&&1!==t&&0!==t&&(J&&D(13,"argument"+y,t),t!=!!t&&(t=null)),!i)return null;if(n=i.length-1,e=n*F+1,n=i[n]){for(;n%10==0;n/=10,e--);for(n=i[0];n>=10;n/=10,e++);}return t&&r.e+1>e&&(e=r.e+1),e},H.round=function(t,n){var r=new e(this);return(null==t||W(t,0,I,15))&&S(r,~~t+this.e+1,null!=n&&W(n,0,8,15,b)?0|n:L),r},H.shift=function(t){var n=this;return W(t,-N,N,16,"argument")?n.times("1e"+p(t)):new e(n.c&&n.c[0]&&(-N>t||t>N)?n.s*(0>t?0:1/0):n)},H.squareRoot=H.sqrt=function(){var t,n,r,a,s,u=this,c=u.c,l=u.s,f=u.e,p=U+4,m=new e("0.5");if(1!==l||!c||!c[0])return new e(!l||0>l&&(!c||c[0])?0/0:c?u:1/0);if(l=Math.sqrt(+u),0==l||l==1/0?(n=o(c),(n.length+f)%2==0&&(n+="0"),l=Math.sqrt(n),f=i((f+1)/2)-(0>f||f%2),l==1/0?n="1e"+f:(n=l.toExponential(),n=n.slice(0,n.indexOf("e")+1)+f),r=new e(n)):r=new e(l+""),r.c[0])for(f=r.e,l=f+p,3>l&&(l=0);;)if(s=r,r=m.times(s.plus(k(u,s,p,1))),o(s.c).slice(0,l)===(n=o(r.c)).slice(0,l)){if(r.e<f&&--l,n=n.slice(l-3,l+1),"9999"!=n&&(a||"4999"!=n)){(!+n||!+n.slice(1)&&"5"==n.charAt(0))&&(S(r,r.e+U+2,1),t=!r.times(r).eq(u));break}if(!a&&(S(s,s.e+U+2,0),s.times(s).eq(u))){r=s;break}p+=4,l+=4,a=1}return S(r,r.e+U+1,L,t)},H.times=H.mul=function(t,n){var r,o,a,s,u,c,l,f,p,m,h,d,g,v,w,y=this,b=y.c,x=(C=17,t=new e(t,n)).c;if(!(b&&x&&b[0]&&x[0]))return!y.s||!t.s||b&&!b[0]&&!x||x&&!x[0]&&!b?t.c=t.e=t.s=null:(t.s*=y.s,b&&x?(t.c=[0],t.e=0):t.c=t.e=null),t;for(o=i(y.e/F)+i(t.e/F),t.s*=y.s,l=b.length,m=x.length,m>l&&(g=b,b=x,x=g,a=l,l=m,m=a),a=l+m,g=[];a--;g.push(0));for(v=O,w=A,a=m;--a>=0;){for(r=0,h=x[a]%w,d=x[a]/w|0,u=l,s=a+u;s>a;)f=b[--u]%w,p=b[u]/w|0,c=d*f+p*h,f=h*f+c%w*w+g[s]+r,r=(f/v|0)+(c/w|0)+d*p,g[s--]=f%v;g[s]=r}return r?++o:g.shift(),P(t,g,o)},H.toDigits=function(t,n){var r=new e(this);return t=null!=t&&W(t,1,I,18,"precision")?0|t:null,n=null!=n&&W(n,0,8,18,b)?0|n:L,t?S(r,t,n):r},H.toExponential=function(t,e){return m(this,null!=t&&W(t,0,I,19)?~~t+1:null,e,19)},H.toFixed=function(t,e){return m(this,null!=t&&W(t,0,I,20)?~~t+this.e+1:null,e,20)},H.toFormat=function(t,e){var n=m(this,null!=t&&W(t,0,I,21)?~~t+this.e+1:null,e,21);if(this.c){var r,i=n.split("."),o=+K.groupSize,a=+K.secondaryGroupSize,s=K.groupSeparator,u=i[0],c=i[1],l=this.s<0,f=l?u.slice(1):u,p=f.length;if(a&&(r=o,o=a,a=r,p-=r),o>0&&p>0){for(r=p%o||o,u=f.substr(0,r);p>r;r+=o)u+=s+f.substr(r,o);a>0&&(u+=s+f.slice(r)),l&&(u="-"+u)}n=c?u+K.decimalSeparator+((a=+K.fractionGroupSize)?c.replace(new RegExp("\\d{"+a+"}\\B","g"),"$&"+K.fractionGroupSeparator):c):u}return n},H.toFraction=function(t){var n,r,i,a,s,u,c,l,f,p=J,m=this,h=m.c,d=new e(R),g=r=new e(R),v=c=new e(R);if(null!=t&&(J=!1,u=new e(t),J=p,(!(p=u.isInt())||u.lt(R))&&(J&&D(22,"max denominator "+(p?"out of range":"not an integer"),t),t=!p&&u.c&&S(u,u.e+1,1).gte(R)?u:null)),!h)return m.toString();for(f=o(h),a=d.e=f.length-m.e-1,d.c[0]=T[(s=a%F)<0?F+s:s],t=!t||u.cmp(d)>0?a>0?d:g:u,s=q,q=1/0,u=new e(f),c.c[0]=0;l=k(u,d,0,1),i=r.plus(l.times(v)),1!=i.cmp(t);)r=v,v=i,g=c.plus(l.times(i=g)),c=i,d=u.minus(l.times(i=d)),u=i;return i=k(t.minus(r),v,0,1),c=c.plus(i.times(g)),r=r.plus(i.times(v)),c.s=g.s=m.s,a*=2,n=k(g,v,a,L).minus(m).abs().cmp(k(c,r,a,L).minus(m).abs())<1?[g.toString(),v.toString()]:[c.toString(),r.toString()],q=s,n},H.toNumber=function(){var t=this;return+t||(t.s?0*t.s:0/0)},H.toPower=H.pow=function(t){var n,r,i=w(0>t?-t:+t),o=this;if(!W(t,-N,N,23,"exponent")&&(!isFinite(t)||i>N&&(t/=0)||parseFloat(t)!=t&&!(t=0/0)))return new e(Math.pow(+o,t));for(n=$?v($/F+2):0,r=new e(R);;){if(i%2){if(r=r.times(o),!r.c)break;n&&r.c.length>n&&(r.c.length=n)}if(i=w(i/2),!i)break;o=o.times(o),n&&o.c&&o.c.length>n&&(o.c.length=n)}return 0>t&&(r=R.div(r)),n?S(r,$,L):r},H.toPrecision=function(t,e){return m(this,null!=t&&W(t,1,I,24,"precision")?0|t:null,e,24)},H.toString=function(t){var e,r=this,i=r.s,a=r.e;return null===a?i?(e="Infinity",0>i&&(e="-"+e)):e="NaN":(e=o(r.c),e=null!=t&&W(t,2,64,25,"base")?n(f(e,a),0|t,10,i):j>=a||a>=M?l(e,a):f(e,a),0>i&&r.c[0]&&(e="-"+e)),e},H.truncated=H.trunc=function(){return S(new e(this),this.e+1,1)},H.valueOf=H.toJSON=function(){return this.toString()},null!=t&&e.config(t),e}function i(t){var e=0|t;return t>0||t===e?e:e-1}function o(t){for(var e,n,r=1,i=t.length,o=t[0]+"";i>r;){for(e=t[r++]+"",n=F-e.length;n--;e="0"+e);o+=e}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function a(t,e){var n,r,i=t.c,o=e.c,a=t.s,s=e.s,u=t.e,c=e.e;if(!a||!s)return null;if(n=i&&!i[0],r=o&&!o[0],n||r)return n?r?0:-s:a;if(a!=s)return a;if(n=0>a,r=u==c,!i||!o)return r?0:!i^n?1:-1;if(!r)return u>c^n?1:-1;for(s=(u=i.length)<(c=o.length)?u:c,a=0;s>a;a++)if(i[a]!=o[a])return i[a]>o[a]^n?1:-1;return u==c?0:u>c^n?1:-1}function s(t,e,n){return(t=p(t))>=e&&n>=t}function u(t){return"[object Array]"==Object.prototype.toString.call(t)}function c(t,e,n){for(var r,i,o=[0],a=0,s=t.length;s>a;){for(i=o.length;i--;o[i]*=e);for(o[r=0]+=_.indexOf(t.charAt(a++));r<o.length;r++)o[r]>n-1&&(null==o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}function l(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(0>e?"e":"e+")+e}function f(t,e){var n,r;if(0>e){for(r="0.";++e;r+="0");t=r+t}else if(n=t.length,++e>n){for(r="0",e-=n;--e;r+="0");t+=r}else n>e&&(t=t.slice(0,e)+"."+t.slice(e));return t}function p(t){return t=parseFloat(t),0>t?v(t):w(t)}var m,h,d,g=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,v=Math.ceil,w=Math.floor,y=" not a boolean or binary digit",b="rounding mode",x="number type has more than 15 significant digits",_="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",O=1e14,F=14,N=9007199254740991,T=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],A=1e7,I=1e9;if(m=r(),"function"==typeof define&&define.amd)define(function(){return m});else if("undefined"!=typeof e&&e.exports){if(e.exports=m,!h)try{h=t("crypto")}catch(E){}}else n.BigNumber=m}(this)},{crypto:25}],"ethereum.js":[function(t,e){var n=t("./lib/web3");n.providers.HttpProvider=t("./lib/web3/httpprovider"),n.providers.QtSyncProvider=t("./lib/web3/qtsync"),n.eth.contract=t("./lib/web3/contract"),n.abi=t("./lib/solidity/abi"),e.exports=n},{"./lib/solidity/abi":1,"./lib/web3":8,"./lib/web3/contract":9,"./lib/web3/httpprovider":16,"./lib/web3/qtsync":20}]},{},["ethereum.js"]);