You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
42 KiB
2 lines
42 KiB
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 g=o.formatOutputUInt(l.slice(0,u));l=l.slice(u);for(var d=[],v=0;g>v;v++)d.push(h(e.slice(0,u))),e=e.slice(u);n.push(d)}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},g=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:g,formatInput:l,formatOutput:m}},{"../utils/config":6,"../utils/utils":7,"./formatters":2,"./types":3}],2:[function(t,e){var n=t("bignumber.js"),r=t("../utils/utils"),i=t("../utils/config"),o=function(t){var e=2*i.ETH_PADDING;return n.config(i.ETH_BIGNUMBER_ROUNDING_MODE),r.padLeft(r.toTwosComplement(t).round().toString(16),e)},a=function(t){return r.fromAscii(t,i.ETH_PADDING).substr(2)},s=function(t){return"000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0")},u=function(t){return o(new n(t).times(new n(2).pow(128)))},c=function(t){return"1"===new n(t.substr(0,1),16).toString(2).substr(0,1)},l=function(t){return t=t||"0",c(t)?new n(t,16).minus(new n("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new n(t,16)},f=function(t){return t=t||"0",new n(t,16)},p=function(t){return l(t).dividedBy(new n(2).pow(128))},m=function(t){return f(t).dividedBy(new n(2).pow(128))},h=function(t){return"0x"+t},g=function(t){return"0000000000000000000000000000000000000000000000000000000000000001"===t?!0:!1},d=function(t){return r.toAscii(t)},v=function(t){return"0x"+t.slice(t.length-40,t.length)};e.exports={formatInputInt:o,formatInputString:a,formatInputBool:s,formatInputReal:u,formatOutputInt:l,formatOutputUInt:f,formatOutputReal:p,formatOutputUReal:m,formatOutputHash:h,formatOutputBool:g,formatOutputString:d,formatOutputAddress:v}},{"../utils/config":6,"../utils/utils":7,"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){"use strict";e.exports=BigNumber},{}],5:[function(t,e,n){"use strict";n.XMLHttpRequest="undefined"==typeof XMLHttpRequest?{}:XMLHttpRequest},{}],6:[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"}],7:[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,n){return new Array(e-t.length+1).join(n?n:"0")+t},o=function(t,e){for(var n=!1,r=0;r<t.length&&!n;r++)n=e(t[r]);return n?r-1:-1},a=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},s=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},u=function(t,e){e=void 0===e?0:e;for(var n=s(t);n.length<2*e;)n+="00";return"0x"+n},c=function(t){var e=t.indexOf("(");return-1!==e?t.substr(0,e):t},l=function(t){var e=t.indexOf("(");return-1!==e?t.substr(e+1,t.length-1-(e+1)).replace(" ",""):""},f=function(t){return t.filter(function(t){return"function"===t.type})},p=function(t){return t.filter(function(t){return"event"===t.type})},m=function(t){return y(t).toNumber()},h=function(t){var e=y(t),n=e.toString(16);return e.lessThan(0)?"-0x"+n.substr(1):"0x"+n},g=function(t){if(T(t))return h(+t);if(N(t))return h(t);if(O(t))return u(JSON.stringify(t));if(I(t)){if(0===t.indexOf("-0x"))return h(t);if(!isFinite(t))return u(t)}return h(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)},v=function(t,e){var n=y(t).dividedBy(d(e));return N(t)?n:n.toString(10)},b=function(t,e){var n=y(t).times(d(e));return N(t)?n:n.toString(10)},y=function(t){return t=t||0,N(t)?t:!I(t)||0!==t.indexOf("0x")&&0!==t.indexOf("-0x")?new n(t.toString(10),10):new n(t.replace("0x",""),16)},w=function(t){var e=y(t);return e.lessThan(0)?new n("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16).plus(e).plus(1):e},x=function(t){return/^0x[0-9a-f]{40}$/.test(t)},F=function(t){return x(t)?t:/^[0-9a-f]{40}$/.test(t)?"0x"+t:"0x"+i(g(t).substr(2),40)},N=function(t){return t instanceof n||t&&t.constructor&&"BigNumber"===t.constructor.name},I=function(t){return"string"==typeof t||t&&t.constructor&&"String"===t.constructor.name},_=function(t){return"function"==typeof t},O=function(t){return"object"==typeof t},T=function(t){return"boolean"==typeof t},E=function(t){return t instanceof Array},B=function(t){try{return!!JSON.parse(t)}catch(e){return!1}};e.exports={padLeft:i,findIndex:o,toHex:g,toDecimal:m,fromDecimal:h,toAscii:a,fromAscii:u,extractDisplayName:c,extractTypeName:l,filterFunctions:f,filterEvents:p,toWei:b,fromWei:v,toBigNumber:y,toTwosComplement:w,toAddress:F,isBigNumber:N,isAddress:x,isFunction:_,isString:I,isObject:O,isBoolean:T,isArray:E,isJson:B}},{"bignumber.js":"bignumber.js"}],8:[function(t,e){e.exports={version:"0.2.5"}},{}],9:[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=t("./web3/property"),g=[new m({name:"sha3",call:"web3_sha3",params:1})],d=[new h({name:"version.client",getter:"web3_clientVersion"}),new h({name:"version.network",getter:"net_version",inputFormatter:c.toDecimal}),new h({name:"version.ethereum",getter:"eth_version",inputFormatter:c.toDecimal}),new h({name:"version.whisper",getter:"shh_version",inputFormatter:c.toDecimal})],v=function(t,e){e.forEach(function(e){e.attachToObject(t)})},b=function(t,e){e.forEach(function(e){e.attachToObject(t)})},y={};y.providers={},y.version={},y.version.api=n.version,y.eth={},y.eth.filter=function(t,e,n,r){return t._isEvent?t(e,n):new u(t,s.eth(),r||l.outputLogFormatter)},y.shh={},y.shh.filter=function(t){return new u(t,s.shh(),l.outputPostFormatter)},y.net={},y.db={},y.setProvider=function(t){f.getInstance().setProvider(t)},y.reset=function(){f.getInstance().reset()},y.toHex=c.toHex,y.toAscii=c.toAscii,y.fromAscii=c.fromAscii,y.toDecimal=c.toDecimal,y.fromDecimal=c.fromDecimal,y.toBigNumber=c.toBigNumber,y.toWei=c.toWei,y.fromWei=c.fromWei,y.isAddress=c.isAddress,Object.defineProperty(y.eth,"defaultBlock",{get:function(){return p.ETH_DEFAULTBLOCK},set:function(t){return p.ETH_DEFAULTBLOCK=t,p.ETH_DEFAULTBLOCK}}),v(y,g),b(y,d),v(y.net,r.methods),b(y.net,r.properties),v(y.eth,i.methods),b(y.eth,i.properties),v(y.db,o.methods),v(y.shh,a.methods),e.exports=y},{"./utils/config":6,"./utils/utils":7,"./version.json":8,"./web3/db":11,"./web3/eth":13,"./web3/filter":15,"./web3/formatters":16,"./web3/method":19,"./web3/net":20,"./web3/property":21,"./web3/requestmanager":23,"./web3/shh":24,"./web3/watches":26}],10:[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 u(n),c(n,t,e),l(n,t,e),f(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){t.call=function(e){return t._isTransaction=!1,t._options=e,t},t.sendTransaction=function(e){return t._isTransaction=!0,t._options=e,t}},c=function(t,e,n){var a=i.inputParser(e),u=i.outputParser(e);o.filterFunctions(e).forEach(function(e){var i=o.extractDisplayName(e.name),c=o.extractTypeName(e.name),l=function(){var o=Array.prototype.slice.call(arguments),l=s.functionSignatureFromAscii(e.name),f=a[i][c].apply(null,o),p=t._options||{};p.to=n,p.data=l+f;var m=t._isTransaction===!0||t._isTransaction!==!1&&!e.constant,h=p.collapse!==!1;if(t._options={},t._isTransaction=null,m)return void r.eth.sendTransaction(p);var g=r.eth.call(p),d=u[i][c](g);return h&&(1===d.length?d=d[0]:0===d.length&&(d=null)),d};void 0===t[i]&&(t[i]=l),t[i][c]=l})},l=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)})}})},f=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})},p=function(t){return n.bind(null,t)};e.exports=p},{"../solidity/abi":1,"../utils/utils":7,"../web3":9,"./event":14,"./signature":25}],11:[function(t,e){var n=t("./method"),r=new n({name:"putString",call:"db_putString",params:3}),i=new n({name:"getString",call:"db_getString",params:2}),o=new n({name:"putHex",call:"db_putHex",params:3}),a=new n({name:"getHex",call:"db_getHex",params:2}),s=[r,i,o,a];e.exports={methods:s}},{"./method":19}],12:[function(t,e){var n=t("../utils/utils");e.exports={InvalidNumberOfParams:new Error("Invalid number of input parameters"),InvalidProvider:new Error("Providor not set or invalid"),InvalidResponse:function(t){var e="Invalid JSON RPC response";return n.isObject(t)&&t.error&&t.error.message&&(e=t.error.message),new Error(e)}}},{"../utils/utils":7}],13:[function(t,e){"use strict";var n=t("./formatters"),r=t("../utils/utils"),i=t("./method"),o=t("./property"),a=function(t){return r.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getBlockByHash":"eth_getBlockByNumber"},s=function(t){return r.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getTransactionByBlockHashAndIndex":"eth_getTransactionByBlockNumberAndIndex"},u=function(t){return r.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getUncleByBlockHashAndIndex":"eth_getUncleByBlockNumberAndIndex"},c=function(t){return r.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getBlockTransactionCountByHash":"eth_getBlockTransactionCountByNumber"},l=function(t){return r.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getUncleCountByBlockHash":"eth_getUncleCountByBlockNumber"},f=new i({name:"getBalance",call:"eth_getBalance",params:2,inputFormatter:[r.toAddress,n.inputDefaultBlockNumberFormatter],outputFormatter:n.outputBigNumberFormatter}),p=new i({name:"getStorageAt",call:"eth_getStorageAt",params:3,inputFormatter:[null,r.toHex,n.inputDefaultBlockNumberFormatter]}),m=new i({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[r.toAddress,n.inputDefaultBlockNumberFormatter]}),h=new i({name:"getBlock",call:a,params:2,inputFormatter:[n.inputBlockNumberFormatter,function(t){return!!t}],outputFormatter:n.outputBlockFormatter}),g=new i({name:"getUncle",call:u,params:3,inputFormatter:[n.inputBlockNumberFormatter,r.toHex,function(t){return!!t}],outputFormatter:n.outputBlockFormatter}),d=new i({name:"getCompilers",call:"eth_getCompilers",params:0}),v=new i({name:"getBlockTransactionCount",call:c,params:1,inputFormatter:[n.inputBlockNumberFormatter],outputFormatter:r.toDecimal}),b=new i({name:"getBlockUncleCount",call:l,params:1,inputFormatter:[n.inputBlockNumberFormatter],outputFormatter:r.toDecimal}),y=new i({name:"getTransaction",call:"eth_getTransactionByHash",params:1,outputFormatter:n.outputTransactionFormatter}),w=new i({name:"getTransactionFromBlock",call:s,params:2,inputFormatter:[r.toHex,r.toHex],outputFormatter:n.outputTransactionFormatter}),x=new i({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[null,n.inputDefaultBlockNumberFormatter],outputFormatter:r.toDecimal}),F=new i({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[n.inputTransactionFormatter]}),N=new i({name:"call",call:"eth_call",params:2,inputFormatter:[n.inputTransactionFormatter,n.inputDefaultBlockNumberFormatter]}),I=new i({name:"compile.solidity",call:"eth_compileSolidity",params:1}),_=new i({name:"compile.lll",call:"eth_compileLLL",params:1}),O=new i({name:"compile.serpent",call:"eth_compileSerpent",params:1}),T=new i({name:"flush",call:"eth_flush",params:0}),E=[f,p,m,h,g,d,v,b,y,w,x,N,F,I,_,O,T],B=[new o({name:"coinbase",getter:"eth_coinbase"}),new o({name:"mining",getter:"eth_mining"}),new o({name:"gasPrice",getter:"eth_gasPrice",outputFormatter:n.inputNumberFormatter}),new o({name:"accounts",getter:"eth_accounts"}),new o({name:"blockNumber",getter:"eth_blockNumber",outputFormatter:r.toDecimal})];e.exports={methods:E,properties:B}},{"../utils/utils":7,"./formatters":16,"./method":19,"./property":21}],14:[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])}):"0x"+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)return i;e.data=e.data||"";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":7,"./signature":25}],15:[function(t,e){var n=t("./requestmanager"),r=t("./formatters"),i=t("../utils/utils"),o=function(t){return i.isString(t)?t:(t=t||{},t.topics=t.topics||[],t.topics=t.topics.map(function(t){return i.toHex(t)}),{topics:t.topics,to:t.to,address:t.address,fromBlock:r.inputBlockNumberFormatter(t.fromBlock),toBlock:r.inputBlockNumberFormatter(t.toBlock)})},a=function(t,e,n){var r={};e.forEach(function(t){t.attachToObject(r)}),this.options=o(t),this.implementation=r,this.callbacks=[],this.formatter=n,this.filterId=this.implementation.newFilter(this.options)};a.prototype.watch=function(t){this.callbacks.push(t);var e=this,r=function(t,n){return t?e.callbacks.forEach(function(e){e(t)}):void n.forEach(function(t){t=e.formatter?e.formatter(t):t,e.callbacks.forEach(function(e){e(null,t)})})};n.getInstance().startPolling({method:this.implementation.poll.call,params:[this.filterId]},this.filterId,r,this.stopWatching.bind(this))},a.prototype.stopWatching=function(){n.getInstance().stopPolling(this.filterId),this.implementation.uninstallFilter(this.filterId),this.callbacks=[]},a.prototype.get=function(){var t=this.implementation.getLogs(this.filterId),e=this;return t.map(function(t){return e.formatter?e.formatter(t):t})},e.exports=a},{"../utils/utils":7,"./formatters":16,"./requestmanager":23}],16:[function(t,e){var n=t("../utils/utils"),r=t("../utils/config"),i=function(t){return n.toBigNumber(t)},o=function(t){return"latest"===t||"pending"===t||"earliest"===t},a=function(t){return void 0===t?r.ETH_DEFAULTBLOCK:s(t)},s=function(t){return void 0===t?void 0:o(t)?t:n.toHex(t)},u=function(t){return t.code&&(t.data=t.code,delete t.code),["gasPrice","gas","value"].filter(function(e){return void 0!==t[e]}).forEach(function(e){t[e]=n.fromDecimal(t[e])}),t},c=function(t){return t.blockNumber=n.toDecimal(t.blockNumber),t.transactionIndex=n.toDecimal(t.transactionIndex),t.gas=n.toDecimal(t.gas),t.gasPrice=n.toBigNumber(t.gasPrice),t.value=n.toBigNumber(t.value),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),n.isArray(t.transactions)&&t.transactions.forEach(function(t){return n.isString(t)?void 0:c(t)}),t},f=function(t){return null===t?null:(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),n.isArray(t.topics)||(t.topics=[t.topics]),t.topics=t.topics.map(function(t){return n.fromAscii(t)}),t},m=function(t){return 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),n.isJson(t.payload)&&(t.payload=JSON.parse(t.payload)),t.topics=t.topics.map(function(t){return n.toAscii(t)}),t};e.exports={inputDefaultBlockNumberFormatter:a,inputBlockNumberFormatter:s,inputTransactionFormatter:u,inputPostFormatter:p,outputBigNumberFormatter:i,outputTransactionFormatter:c,outputBlockFormatter:l,outputLogFormatter:f,outputPostFormatter:m}},{"../utils/config":6,"../utils/utils":7}],17:[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:5}],18:[function(t,e){var n=function(){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,void(this.messageId=1))};n.getInstance=function(){var t=new n;return t},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},{}],19:[function(t,e){var n=t("./requestmanager"),r=t("../utils/utils"),i=t("./errors"),o=function(t){this.name=t.name,this.call=t.call,this.params=t.params||0,this.inputFormatter=t.inputFormatter,this.outputFormatter=t.outputFormatter};o.prototype.getCall=function(t){return r.isFunction(this.call)?this.call(t):this.call},o.prototype.extractCallback=function(t){return r.isFunction(t[t.length-1])?t.pop():null},o.prototype.validateArgs=function(t){if(t.length!==this.params)throw i.InvalidNumberOfParams},o.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter.map(function(e,n){return e?e(t[n]):t[n]}):t},o.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},o.prototype.attachToObject=function(t){var e=this.send.bind(this);e.call=this.call;var n=this.name.split(".");n.length>1?(t[n[0]]=t[n[0]]||{},t[n[0]][n[1]]=e):t[n[0]]=e},o.prototype.toPayload=function(t){var e=this.getCall(t),n=this.extractCallback(t),r=this.formatInput(t);return this.validateArgs(r),{method:e,params:r,callback:n}},o.prototype.send=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));if(t.callback){var e=this;return n.getInstance().sendAsync(t,function(n,r){t.callback(null,e.formatOutput(r))})}return this.formatOutput(n.getInstance().send(t))},e.exports=o},{"../utils/utils":7,"./errors":12,"./requestmanager":23}],20:[function(t,e){var n=t("../utils/utils"),r=t("./property"),i=[],o=[new r({name:"listening",getter:"net_listening"}),new r({name:"peerCount",getter:"net_peerCount",outputFormatter:n.toDecimal})];e.exports={methods:i,properties:o}},{"../utils/utils":7,"./property":21}],21:[function(t,e){var n=t("./requestmanager"),r=function(t){this.name=t.name,this.getter=t.getter,this.setter=t.setter,this.outputFormatter=t.outputFormatter,this.inputFormatter=t.inputFormatter};r.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter(t):t},r.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},r.prototype.attachToObject=function(t){var e={get:this.get.bind(this),set:this.set.bind(this)},n=this.name.split(".");n.length>1?(t[n[0]]=t[n[0]]||{},Object.defineProperty(t[n[0]],n[1],e)):Object.defineProperty(t,n[0],e)},r.prototype.get=function(){return this.formatOutput(n.getInstance().send({method:this.getter}))},r.prototype.set=function(t){return n.getInstance().send({method:this.setter,params:[this.formatInput(t)]})},e.exports=r},{"./requestmanager":23}],22:[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},{}],23:[function(t,e){var n=t("./jsonrpc"),r=t("../utils/utils"),i=t("../utils/config"),o=t("./errors"),a=function(t){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,this.provider=t,this.polls=[],this.timeout=null,void this.poll())};a.getInstance=function(){var t=new a;return t},a.prototype.send=function(t){if(!this.provider)return console.error(o.InvalidProvider),null;var e=n.getInstance().toPayload(t.method,t.params),r=this.provider.send(e);if(!n.getInstance().isValidResponse(r))throw o.InvalidResponse(r);return r.result},a.prototype.sendAsync=function(t,e){if(!this.provider)return e(o.InvalidProvider);var r=n.getInstance().toPayload(t.method,t.params);this.provider.sendAsync(r,function(t,r){return t?e(t):n.getInstance().isValidResponse(r)?void e(null,r.result):e(o.InvalidResponse(r))})},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.polls.length){if(!this.provider)return void console.error(o.InvalidProvider);var t=n.getInstance().toBatchPayload(this.polls.map(function(t){return t.data})),e=this;this.provider.sendAsync(t,function(t,i){if(!t){if(!r.isArray(i))throw o.InvalidResponse(i);i.map(function(t,n){return t.callback=e.polls[n].callback,t}).filter(function(t){var e=n.getInstance().isValidResponse(t);return e||t.callback(o.InvalidResponse(t)),e}).filter(function(t){return r.isArray(t.result)&&t.result.length>0}).forEach(function(t){t.callback(null,t.result)})}})}},e.exports=a},{"../utils/config":6,"../utils/utils":7,"./errors":12,"./jsonrpc":18}],24:[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":16,"./method":19}],25:[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":6,"../web3":9}],26:[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}),o=new n({name:"poll",call:"eth_getFilterChanges",params:1});return[e,r,i,o]},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}),i=new n({name:"poll",call:"shh_getFilterChanges",params:1});return[t,e,r,i]};e.exports={eth:r,shh:i}},{"./method":19}],"bignumber.js":[function(t,e){!function(t){"use strict";function n(t,e){var r,i,o,s,f,p,g=this;if(!(g instanceof n))return new n(t,e);if(t instanceof n){if(null==e)return I=0,g.s=t.s,g.e=t.e,void(g.c=(t=t.c)?t.slice():t);t+=""}else if(s="number"==(f=typeof t)){if(null==e&&t===~~t){for(g.s=0>1/t?(t=-t,-1):1,i=I=0,o=t;o>=10;o/=10,i++);return g.e=i,void(g.c=[t])}t=0===t&&0>1/t?"-0":t+""}else"string"!=f&&(t+="");if(f=t,null==e&&O.test(f))g.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;else{if(10==e)return g=new n(f),c(g,m+g.e+1,h);if(f=T.call(f).replace(/^\+(?!-)/,""),g.s=45===f.charCodeAt(0)?(f=f.replace(/^-(?!-)/,""),-1):1,null!=e?e!=~~e&&y||(l=!(e>=2&&65>e))?(u(e,2),p=O.test(f)):(r="["+N.slice(0,e=0|e)+"]+",f=f.replace(/\.$/,"").replace(/^\./,"0."),(p=new RegExp("^"+r+"(?:\\."+r+")?$",37>e?"i":"").test(f))?(s&&(f.replace(/^0\.0*|\./,"").length>15&&u(t,0),s=!s),f=a(f,10,e,g.s)):"Infinity"!=f&&"NaN"!=f&&(u(t,1,e),t="NaN")):p=O.test(f),!p)return g.c=g.e=null,"Infinity"!=f&&("NaN"!=f&&u(t,3),g.s=null),void(I=0)}for((i=f.indexOf("."))>-1&&(f=f.replace(".","")),(o=f.search(/e/i))>0?(0>i&&(i=o),i+=+f.slice(o+1),f=f.substring(0,o)):0>i&&(i=f.length),o=0;48===f.charCodeAt(o);o++);for(e=f.length;48===f.charCodeAt(--e););if(f=f.slice(o,e+1))if(e=f.length,s&&e>15&&u(t,0),i=i-o-1,i>b)g.c=g.e=null;else if(v>i)g.c=[g.e=0];else{if(g.e=i,g.c=[],o=(i+1)%B,0>i&&(o+=B),e>o){for(o&&g.c.push(+f.slice(0,o)),e-=B;e>o;g.c.push(+f.slice(o,o+=B)));f=f.slice(o),o=B-f.length}else o-=e;for(;o--;f+="0");g.c.push(+f)}else g.c=[g.e=0];I=0}function r(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*B-1)>b?t.c=t.e=null:v>n?t.c=[t.e=0]:(t.e=n,t.c=e),t}function i(t){for(var e,n,r=1,i=t.length,o=t[0]+"";i>r;){for(e=t[r++]+"",n=B-e.length;n--;e="0"+e);o+=e}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function o(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]+=N.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 a(t,e,r,i){var a,s,u,c,l,f,p,g=t.indexOf("."),d=h;for(37>r&&(t=t.toLowerCase()),g>=0&&(t=t.replace(".",""),p=new n(r),l=p.pow(t.length-g),p.c=o(l.toFixed(),10,e),p.e=p.c.length),f=o(t,r,e),s=u=f.length;0==f[--u];f.pop());if(!f[0])return"0";if(0>g?--s:(l.c=f,l.e=s,l.s=i,l=k(l,p,m,d,e),f=l.c,c=l.r,s=l.e),a=s+m+1,g=f[a],u=e/2,c=c||0>a||null!=f[a+1],c=4>d?(null!=g||c)&&(0==d||d==(l.s<0?3:2)):g>u||g==u&&(4==d||c||6==d&&1&f[a-1]||d==(l.s<0?8:7)),1>a||!f[0])f.length=1,u=0,c?(f[0]=1,s=-m):s=f[0]=0;else{if(f.length=a,c)for(--e;++f[--a]>e;)f[a]=0,a||(++s,f.unshift(1));for(u=f.length;!f[--u];);}for(g=0,t="";u>=g;t+=N.charAt(f[g++]));if(0>s){for(;++s;t="0"+t);t="0."+t}else if(g=t.length,++s>g)for(s-=g;s--;t+="0");else g>s&&(t=t.slice(0,s)+"."+t.slice(s));return t}function s(t,e,r){var o,a,s,u=(t=new n(t)).e;if(null==e?o=0:(c(t,++e,h),o=r?e:e+t.e-u,u=t.e),a=i(t.c),1==r||2==r&&(u>=e||g>=u)){for(;a.length<o;a+="0");a.length>1&&(a=a.charAt(0)+"."+a.slice(1)),a+=(0>u?"e":"e+")+u}else{if(r=a.length,0>u){for(s=o-r;++u;a="0"+a);a="0."+a}else if(++u>r){for(s=o-u,u-=r;u--;a+="0");s>0&&(a+=".")}else s=o-r,r>u?a=a.slice(0,u)+"."+a.slice(u):s>0&&(a+=".");if(s>0)for(;s--;a+="0");}return t.s<0&&t.c[0]?"-"+a:a}function u(t,e,n,r,i,o){if(y){var a,s=["new BigNumber","cmp","div","eq","gt","gte","lt","lte","minus","mod","plus","times","toFraction","divToInt"][I?0>I?-I:I:0>1/I?1:0]+"()",u=l?" out of range":" not a"+(i?" non-zero":"n")+" integer";throw u=([s+" number type has more than 15 significant digits",s+" not a base "+n+" number",s+" base"+u,s+" not a number"][e]||n+"() "+e+(o?" not a boolean or binary digit":u+(r?" or not ["+(l?" negative, positive":" integer, integer")+" ]":"")))+": "+t,l=I=0,a=new Error(u),a.name="BigNumber Error",a}}function c(t,e,n,r){var i,o,a,s,u,c,l,f,p=D;if(f=t.c){t:{for(i=1,s=f[0];s>=10;s/=10,i++);if(o=e-i,0>o)o+=B,a=e,u=f[c=0],l=u/p[i-a-1]%10|0;else if(c=Math.ceil((o+1)/B),c>=f.length){if(!r)break t;for(;f.length<=c;f.push(0));u=l=0,i=1,o%=B,a=o-B+1}else{for(u=s=f[c],i=1;s>=10;s/=10,i++);o%=B,a=o-B+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%B],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[B-o],f[c]=a>0?_(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]==E&&(f[0]=1));break}if(f[c]+=s,f[c]!=E)break;f[c--]=0,s=1}for(o=f.length;0===f[--o];f.pop());}t.e>b?t.c=t.e=null:t.e<v&&(t.c=[t.e=0])}return t}var l,f=1e9,p=1e6,m=20,h=4,g=-7,d=21,v=-f,b=f,y=!0,w=parseInt,x={decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:" ",fractionGroupSize:0},F=n.prototype,N="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",I=0,_=Math.floor,O=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,T=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},E=1e14,B=14,A=1e7,D=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],S=new n(1);n.ROUND_UP=0,n.ROUND_DOWN=1,n.ROUND_CEIL=2,n.ROUND_FLOOR=3,n.ROUND_HALF_UP=4,n.ROUND_HALF_DOWN=5,n.ROUND_HALF_EVEN=6,n.ROUND_HALF_CEIL=7,n.ROUND_HALF_FLOOR=8,n.config=function(){var t,e,n=0,r={},i=arguments,o=i[0],a="config",s=function(t,e,n){return!((l=e>t||t>n)||w(t)!=t&&0!==t)},c=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};if(c(e="DECIMAL_PLACES")&&(s(t,0,f)?m=0|t:u(t,e,a)),r[e]=m,c(e="ROUNDING_MODE")&&(s(t,0,8)?h=0|t:u(t,e,a)),r[e]=h,c(e="EXPONENTIAL_AT")&&(s(t,-f,f)?g=-(d=~~(0>t?-t:+t)):!l&&t&&s(t[0],-f,0)&&s(t[1],0,f)?(g=~~t[0],d=~~t[1]):u(t,e,a,1)),r[e]=[g,d],c(e="RANGE")&&(s(t,-f,f)&&~~t?v=-(b=~~(0>t?-t:+t)):!l&&t&&s(t[0],-f,-1)&&s(t[1],1,f)?(v=~~t[0],b=~~t[1]):u(t,e,a,1,1)),r[e]=[v,b],c(e="ERRORS")&&(t===!!t||1===t||0===t?(l=I=0,w=(y=!!t)?parseInt:parseFloat):u(t,e,a,0,0,1)),r[e]=y,c(e="FORMAT"))if("object"==typeof t)x=t;else if(y)throw r=new Error(a+"() "+e+" not an object: "+t),r.name="BigNumber Error",r;return r[e]=x,r};var 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 e(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(i,o,a,s,u){var l,f,p,m,h,g,d,v,b,y,w,x,F,N,I,O,T,A=i.s==o.s?1:-1,D=i.c,S=o.c;if(!(D&&D[0]&&S&&S[0]))return new n(i.s&&o.s&&(D?!S||D[0]!=S[0]:S)?D&&0==D[0]||!S?0*A:A/0:0/0);for(v=new n(A),b=v.c=[],f=i.e-o.e,A=a+f+1,u||(u=E,N=i.e/B,p=0|N,f=(N>0||N===p?p:p-1)-(O=o.e/B,p=0|O,O>0||O===p?p:p-1),A=A/B|0),p=0;S[p]==(D[p]||0);p++);if(S[p]>(D[p]||0)&&f--,0>A)b.push(1),m=!0;else{for(N=D.length,O=S.length,p=0,A+=2,h=_(u/(S[0]+1)),h>1&&(S=t(S,h,u),D=t(D,h,u),O=S.length,N=D.length),F=O,y=D.slice(0,O),w=y.length;O>w;y[w++]=0);T=S.slice(),T.unshift(0),I=S[0],S[1]>=u/2&&I++;do h=0,l=e(S,y,O,w),0>l?(x=y[0],O!=w&&(x=x*u+(y[1]||0)),h=_(x/I),h>1?(h>=u&&(h=u-1),g=t(S,h,u),d=g.length,w=y.length,l=e(g,y,d,w),1==l&&(h--,r(g,d>O?T:S,d,u))):(0==h&&(l=h=1),g=S.slice()),d=g.length,w>d&&g.unshift(0),r(y,g,w,u),-1==l&&(w=y.length,l=e(S,y,O,w),1>l&&(h++,r(y,w>O?T:S,w,u))),w=y.length):0===l&&(h++,y=[0]),b[p++]=h,l&&y[0]?y[w++]=D[F]||0:(y=[D[F]],w=1);while((F++<N||null!=y[0])&&A--);m=null!=y[0],b[0]||b.shift()}if(u==E){for(p=1,A=b[0];A>=10;A/=10,p++);c(v,a+(v.e=p+f*B-1)+1,s,m)}else v.e=f,v.r=+m;return v}}();F.absoluteValue=F.abs=function(){var t=new n(this);return t.s<0&&(t.s=1),t},F.ceil=function(){return c(new n(this),this.e+1,2)},F.comparedTo=F.cmp=function(t,e){var r,i=this,o=i.c,a=(I=-I,t=new n(t,e)).c,s=i.s,u=t.s,c=i.e,l=t.e;if(!s||!u)return null;if(r=o&&!o[0],e=a&&!a[0],r||e)return r?e?0:-u:s;if(s!=u)return s;if(r=0>s,e=c==l,!o||!a)return e?0:!o^r?1:-1;if(!e)return c>l^r?1:-1;for(s=-1,u=(c=o.length)<(l=a.length)?c:l;++s<u;)if(o[s]!=a[s])return o[s]>a[s]^r?1:-1;return c==l?0:c>l^r?1:-1},F.decimalPlaces=F.dp=function(){var t,e,n=this.c;if(!n)return null;if(t=((e=n.length-1)-_(this.e/B))*B,e=n[e])for(;e%10==0;e/=10,t--);return 0>t&&(t=0),t},F.dividedBy=F.div=function(t,e){return I=2,k(this,new n(t,e),m,h)},F.dividedToIntegerBy=F.divToInt=function(t,e){return I=13,k(this,new n(t,e),0,1)},F.equals=F.eq=function(t,e){return I=3,0===this.cmp(t,e)},F.floor=function(){return c(new n(this),this.e+1,3)},F.greaterThan=F.gt=function(t,e){return I=4,this.cmp(t,e)>0},F.greaterThanOrEqualTo=F.gte=function(t,e){return I=5,1==(e=this.cmp(t,e))||0===e},F.isFinite=function(){return!!this.c},F.isInteger=F.isInt=function(){return!!this.c&&_(this.e/B)>this.c.length-2},F.isNaN=function(){return!this.s},F.isNegative=F.isNeg=function(){return this.s<0},F.isZero=function(){return!!this.c&&0==this.c[0]},F.lessThan=F.lt=function(t,e){return I=6,this.cmp(t,e)<0},F.lessThanOrEqualTo=F.lte=function(t,e){return I=7,-1==(e=this.cmp(t,e))||0===e},F.minus=function(t,e){var i,o,a,s,u=this,c=u.s;if(I=8,t=new n(t,e),e=t.s,!c||!e)return new n(0/0);if(c!=e)return t.s=-e,u.plus(t);var l=u.e/B,f=t.e/B,p=u.c,m=t.c;if(!l||!f){if(!p||!m)return p?(t.s=-e,t):new n(m?u:0/0);if(!p[0]||!m[0])return m[0]?(t.s=-e,t):new n(p[0]?u:3==h?-0:0)}if(i=0|l,l=l>0||l===i?i:i-1,i=0|f,f=f>0||f===i?i:i-1,p=p.slice(),c=l-f){for((s=0>c)?(c=-c,a=p):(f=l,a=m),a.reverse(),e=c;e--;a.push(0));a.reverse()}else for(o=(s=(c=p.length)<(e=m.length))?c:e,c=e=0;o>e;e++)if(p[e]!=m[e]){s=p[e]<m[e];break}if(s&&(a=p,p=m,m=a,t.s=-t.s),e=(o=m.length)-(i=p.length),e>0)for(;e--;p[i++]=0);for(e=E-1;o>c;){if(p[--o]<m[o]){for(i=o;i&&!p[--i];p[i]=e);--p[i],p[o]+=E}p[o]-=m[o]}for(;0==p[0];p.shift(),--f);return p[0]?r(t,p,f):(t.s=3==h?-1:1,t.c=[t.e=0],t)},F.modulo=F.mod=function(t,e){I=9;var r=this,i=r.c,o=(t=new n(t,e)).c,a=r.s,s=t.s;return e=!a||!s||o&&!o[0],e||i&&!i[0]?new n(e?0/0:r):(r.s=t.s=1,e=1==t.cmp(r),r.s=a,t.s=s,e?new n(r):r.minus(k(r,t,0,1).times(t)))},F.negated=F.neg=function(){var t=new n(this);return t.s=-t.s||null,t},F.plus=function(t,e){var i,o=this,a=o.s;if(I=10,t=new n(t,e),e=t.s,!a||!e)return new n(0/0);if(a!=e)return t.s=-e,o.minus(t);var s=o.e/B,u=t.e/B,c=o.c,l=t.c;if(!s||!u){if(!c||!l)return new n(a/0);if(!c[0]||!l[0])return l[0]?t:new n(c[0]?o:0*a)}if(a=0|s,s=s>0||s===a?a:a-1,a=0|u,u=u>0||u===a?a:a-1,c=c.slice(),a=s-u){for(a>0?(u=s,i=l):(a=-a,i=c),i.reverse();a--;i.push(0));i.reverse()}for(a=c.length,e=l.length,0>a-e&&(i=l,l=c,c=i,e=a),a=0;e;)a=(c[--e]=c[e]+l[e]+a)/E|0,c[e]%=E;return a&&(c.unshift(a),++u),r(t,c,u)},F.round=function(t,e){return t=null==t||((l=0>t||t>f)||w(t)!=t)&&!u(t,"decimal places","round")?0:0|t,e=null==e||((l=0>e||e>8)||w(e)!=e&&0!==e)&&!u(e,"mode","round")?h:0|e,c(new n(this),t+this.e+1,e)},F.squareRoot=F.sqrt=function(){var t,e,r,o,a,s=this,u=s.c,l=s.s,f=s.e,p=m+4,g=new n("0.5");if(1!==l||!u||!u[0])return new n(!l||0>l&&(!u||u[0])?0/0:u?s:1/0);if(l=Math.sqrt(+s),0==l||l==1/0?(e=i(u),(e.length+f)%2==0&&(e+="0"),l=Math.sqrt(e),f=_((f+1)/2)-(0>f||f%2),l==1/0?e="1e"+f:(e=l.toExponential(),e=e.slice(0,e.indexOf("e")+1)+f),r=new n(e)):r=new n(l.toString()),r.c[0])for(f=r.e,l=f+p,3>l&&(l=0);;)if(a=r,r=g.times(a.plus(k(s,a,p,1))),i(a.c).slice(0,l)===(e=i(r.c)).slice(0,l)){if(r.e<f&&--l,e=e.slice(l-3,l+1),"9999"!=e&&(o||"4999"!=e)){(!+e||!+e.slice(1)&&"5"==e.charAt(0))&&(c(r,r.e+m+2,1),t=!r.times(r).eq(s));break}if(!o&&(c(a,a.e+m+2,0),a.times(a).eq(s))){r=a;break}p+=4,l+=4,o=1}return c(r,r.e+m+1,h,t)},F.times=function(t,e){var i,o,a,s,u,c,l,f,p,m=this,h=m.c,g=(I=11,t=new n(t,e)).c,d=m.e/B,v=t.e/B,b=m.s;if(t.s=b==(e=t.s)?1:-1,!((d||h&&h[0])&&(v||g&&g[0])))return new n(!b||!e||h&&!h[0]&&!g||g&&!g[0]&&!h?0/0:h&&g?0*t.s:t.s/0);for(o=0|d,o=(d>0||d===o?o:o-1)+(o=0|v,v>0||v===o?o:o-1),b=h.length,e=g.length,e>b&&(u=h,h=g,g=u,v=b,b=e,e=v),v=b+e,u=[];v--;u.push(0));for(d=e;--d>=0;){for(i=0,v=b+d,a=b,f=g[d]%A,p=g[d]/A|0;v>d;)c=h[--a]%A,l=h[a]/A|0,s=p*c+l*f,c=f*c+s%A*A+u[v]+i,i=(c/E|0)+(s/A|0)+p*l,u[v--]=c%E;u[v]=i}return i?++o:u.shift(),r(t,u,o)},F.toExponential=function(t){var e=this;return e.c?s(e,null==t||((l=0>t||t>f)||w(t)!=t&&0!==t)&&!u(t,"decimal places","toExponential")?null:0|t,1):e.toString()},F.toFixed=function(t){var e,n=this,r=g,i=d;return t=null==t||((l=0>t||t>f)||w(t)!=t&&0!==t)&&!u(t,"decimal places","toFixed")?null:n.e+(0|t),g=-(d=1/0),null!=t&&n.c?(e=s(n,t),n.s<0&&n.c&&(n.c[0]?e.indexOf("-")<0&&(e="-"+e):e=e.replace("-",""))):e=n.toString(),g=r,d=i,e},F.toFormat=function(t){var e=this;if(!e.c)return e.toString();var n,r=e.s<0,i=x.groupSeparator,o=+x.groupSize,a=+x.secondaryGroupSize,s=e.toFixed(t).split("."),u=s[0],c=s[1],l=r?u.slice(1):u,f=l.length;if(a&&(n=o,o=a,a=n,f-=n),o>0&&f>0){for(n=f%o||o,u=l.substr(0,n);f>n;n+=o)u+=i+l.substr(n,o);a>0&&(u+=i+l.slice(n)),r&&(u="-"+u)}return c?u+x.decimalSeparator+((a=+x.fractionGroupSize)?c.replace(new RegExp("\\d{"+a+"}\\B","g"),"$&"+x.fractionGroupSeparator):c):u},F.toFraction=function(t){var e,r,o,a,s,c,f,p,m,g=r=new n(S),d=f=new n(S),v=this,w=v.c,x=new n(S);if(!w)return v.toString();for(m=i(w),a=x.e=m.length-v.e-1,x.c[0]=D[(s=a%B)<0?B+s:s],(null==t||(!(I=12,c=new n(t)).s||(l=c.cmp(g)<0||!c.c)||y&&_(c.e/B)<c.c.length-1)&&!u(t,"max denominator","toFraction")||(t=c).cmp(x)>0)&&(t=a>0?x:g),s=b,b=1/0,c=new n(m),f.c[0]=0;p=k(c,x,0,1),o=r.plus(p.times(d)),1!=o.cmp(t);)r=d,d=o,g=f.plus(p.times(o=g)),f=o,x=c.minus(p.times(o=x)),c=o;return o=k(t.minus(r),d,0,1),f=f.plus(o.times(g)),r=r.plus(o.times(d)),f.s=g.s=v.s,a*=2,e=k(g,d,a,h).minus(v).abs().cmp(k(f,r,a,h).minus(v).abs())<1?[g.toString(),d.toString()]:[f.toString(),r.toString()],b=s,e},F.toNumber=function(){var t=this;return+t||(t.s?0*t.s:0/0)},F.toPower=F.pow=function(t){var e=0*t==0?~~t:t,r=new n(this),i=new n(S);if(((l=-p>t||t>p)&&(e=1*t/0)||w(t)!=t&&0!==t&&!(e=0/0))&&!u(t,"exponent","pow")||!e)return new n(Math.pow(+r,e));for(e=0>e?-e:e;1&e&&(i=i.times(r)),e>>=1,e;)r=r.times(r);return 0>t?S.div(i):i},F.toPrecision=function(t){var e=this;return null!=t&&(!(l=1>t||t>f)&&w(t)==t||u(t,"precision","toPrecision"))&&e.c?s(e,0|--t,2):e.toString()},F.toString=function(t){var e,n,r,o=this,c=o.e;if(null===c)n=o.s?"Infinity":"NaN";else{if(t==e&&(g>=c||c>=d))return s(o,e,1);if(n=i(o.c),0>c){for(;++c;n="0"+n);n="0."+n}else if(r=n.length,c>0)if(++c>r)for(c-=r;c--;n+="0");else r>c&&(n=n.slice(0,c)+"."+n.slice(c));else if(e=n.charAt(0),r>1)n=e+"."+n.slice(1);else if("0"==e)return e;if(null!=t)if((l=!(t>=2&&65>t))||t!=~~t&&y)u(t,"base","toS");else if(n=a(n,0|t,10,o.s),"0"==n)return n}return o.s<0?"-"+n:n},F.valueOf=F.toJSON=function(){return this.toString()},"undefined"!=typeof e&&e.exports?e.exports=n:"function"==typeof define&&define.amd?define(function(){return n}):t.BigNumber=n}(this)},{}],web3:[function(t,e){if("undefined"!=typeof n)var n;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":9,"./lib/web3/contract":10,"./lib/web3/httpprovider":17,"./lib/web3/qtsync":22}]},{},["web3"]);
|