web3.js/dist/web3.min.js
2015-04-20 18:16:15 +02:00

2 lines
49 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,u){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[a]={exports:{}};e[a][0].call(f.exports,function(t){var n=e[a][1][t];return i(n?n:t)},f,f.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,n){var r=t("../utils/utils"),i=t("./coder"),o=t("./utils"),a=function(t,e){var n=t.map(function(t){return t.type});return i.encodeParams(n,e)},u=function(t,e){var n=t.map(function(t){return t.type});return i.decodeParams(n,e)},s=function(t){var e={};return t.forEach(function(t){var n=r.extractDisplayName(t.name),i=r.extractTypeName(t.name),o=function(){var e=Array.prototype.slice.call(arguments);return a(t.inputs,e)};void 0===e[n]&&(e[n]=o),e[n][i]=o}),e},c=function(t){var e={};return t.forEach(function(t){var n=r.extractDisplayName(t.name),i=r.extractTypeName(t.name),o=function(e){return u(t.outputs,e)};void 0===e[n]&&(e[n]=o),e[n][i]=o}),e},f=function(t,e){var n=o.getConstructor(t,e.length);return n?a(n.inputs,e):(e.length>0&&console.warn("didn't found matching constructor, using default one"),"")};e.exports={inputParser:s,outputParser:c,formatInput:a,formatOutput:u,formatConstructorParams:f}},{"../utils/utils":8,"./coder":2,"./utils":5}],2:[function(t,e,n){var r=t("bignumber.js"),i=t("../utils/utils"),o=t("./formatters"),a=t("./param"),u=function(t){return"[]"===t.slice(-2)},s=function(t){this._name=t.name,this._match=t.match,this._mode=t.mode,this._inputFormatter=t.inputFormatter,this._outputFormatter=t.outputFormatter};s.prototype.isType=function(t){return"strict"===this._match?this._name===t||0===t.indexOf(this._name)&&"[]"===t.slice(this._name.length):"prefix"===this._match?0===t.indexOf(this._name):void 0},s.prototype.formatInput=function(t,e){if(i.isArray(t)&&e){var n=this;return t.map(function(t){return n._inputFormatter(t)}).reduce(function(t,e){return t.appendArrayElement(e),t},new a("",o.formatInputInt(t.length).value))}return this._inputFormatter(t)},s.prototype.formatOutput=function(t,e){if(e){for(var n=[],i=new r(t.prefix,16),o=0;64*i>o;o+=64)n.push(this._outputFormatter(new a(t.suffix.slice(o,o+64))));return n}return this._outputFormatter(t)},s.prototype.isVariadicType=function(t){return u(t)||"bytes"===this._mode},s.prototype.shiftParam=function(t,e){if("bytes"===this._mode)return e.shiftBytes();if(u(t)){var n=new r(e.prefix.slice(0,64),16);return e.shiftArray(n)}return e.shiftValue()};var c=function(t){this._types=t};c.prototype._requireType=function(t){var e=this._types.filter(function(e){return e.isType(t)})[0];if(!e)throw Error("invalid solidity type!: "+t);return e},c.prototype._bytesToParam=function(t,e){var n=this,r=t.reduce(function(t,e){return n._requireType(e).isVariadicType(e)?t+1:t},0),i=t.length-r,o=e.slice(0,64*r);e=e.slice(64*r);var u=e.slice(0,64*i),s=e.slice(64*i);return new a(u,o,s)},c.prototype._formatInput=function(t,e){return this._requireType(t).formatInput(e,u(t))},c.prototype.encodeParam=function(t,e){return this._formatInput(t,e).encode()},c.prototype.encodeParams=function(t,e){var n=this;return t.map(function(t,r){return n._formatInput(t,e[r])}).reduce(function(t,e){return t.append(e),t},new a).encode()},c.prototype._formatOutput=function(t,e){return this._requireType(t).formatOutput(e,u(t))},c.prototype.decodeParam=function(t,e){return this._formatOutput(t,this._bytesToParam([t],e))},c.prototype.decodeParams=function(t,e){var n=this,r=this._bytesToParam(t,e);return t.map(function(t){var e=n._requireType(t),i=e.shiftParam(t,r);return e.formatOutput(i,u(t))})};var f=new c([new s({name:"address",match:"strict",mode:"value",inputFormatter:o.formatInputInt,outputFormatter:o.formatOutputAddress}),new s({name:"bool",match:"strict",mode:"value",inputFormatter:o.formatInputBool,outputFormatter:o.formatOutputBool}),new s({name:"int",match:"prefix",mode:"value",inputFormatter:o.formatInputInt,outputFormatter:o.formatOutputInt}),new s({name:"uint",match:"prefix",mode:"value",inputFormatter:o.formatInputInt,outputFormatter:o.formatOutputUInt}),new s({name:"bytes",match:"prefix",mode:"bytes",inputFormatter:o.formatInputString,outputFormatter:o.formatOutputString}),new s({name:"real",match:"prefix",mode:"value",inputFormatter:o.formatInputReal,outputFormatter:o.formatOutputReal}),new s({name:"ureal",match:"prefix",mode:"value",inputFormatter:o.formatInputReal,outputFormatter:o.formatOutputUReal})]);e.exports=f},{"../utils/utils":8,"./formatters":3,"./param":4,"bignumber.js":"bignumber.js"}],3:[function(t,e,n){var r=t("bignumber.js"),i=t("../utils/utils"),o=t("../utils/config"),a=t("./param"),u=function(t){var e=2*o.ETH_PADDING;r.config(o.ETH_BIGNUMBER_ROUNDING_MODE);var n=i.padLeft(i.toTwosComplement(t).round().toString(16),e);return new a(n)},s=function(t){var e=i.fromAscii(t,o.ETH_PADDING).substr(2);return new a("",u(t.length).value,e)},c=function(t){var e="000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0");return new a(e)},f=function(t){return u(new r(t).times(new r(2).pow(128)))},l=function(t){return"1"===new r(t.substr(0,1),16).toString(2).substr(0,1)},p=function(t){var e=t.value||"0";return l(e)?new r(e,16).minus(new r("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new r(e,16)},m=function(t){var e=t.value||"0";return new r(e,16)},h=function(t){return p(t).dividedBy(new r(2).pow(128))},d=function(t){return m(t).dividedBy(new r(2).pow(128))},g=function(t){return"0x"+t.value},v=function(t){return"0000000000000000000000000000000000000000000000000000000000000001"===t.value?!0:!1},y=function(t){return i.toAscii(t.suffix)},w=function(t){var e=t.value;return"0x"+e.slice(e.length-40,e.length)};e.exports={formatInputInt:u,formatInputString:s,formatInputBool:c,formatInputReal:f,formatOutputInt:p,formatOutputUInt:m,formatOutputReal:h,formatOutputUReal:d,formatOutputHash:g,formatOutputBool:v,formatOutputString:y,formatOutputAddress:w}},{"../utils/config":7,"../utils/utils":8,"./param":4,"bignumber.js":"bignumber.js"}],4:[function(t,e,n){var r=function(t,e,n){this.prefix=e||"",this.value=t||"",this.suffix=n||""};r.prototype.append=function(t){this.prefix+=t.prefix,this.value+=t.value,this.suffix+=t.suffix},r.prototype.appendArrayElement=function(t){this.suffix+=t.value,this.prefix+=t.prefix},r.prototype.encode=function(){return this.prefix+this.value+this.suffix},r.prototype.shiftValue=function(){var t=this.value.slice(0,64);return this.value=this.value.slice(64),new r(t)},r.prototype.shiftBytes=function(){return this.shiftArray(1)},r.prototype.shiftArray=function(t){var e=this.prefix.slice(0,64);this.prefix=this.value.slice(64);var n=this.suffix.slice(0,64*t);return this.suffix=this.suffix.slice(64*t),new r("",e,n)},r.prototype.empty=function(){return!this.value.length&&!this.prefix.length&&!this.suffix.length},e.exports=r},{}],5:[function(t,e,n){var r=function(t,e){return t.filter(function(t){return"constructor"===t.type&&t.inputs.length===e})[0]},i=function(t){return t.filter(function(t){return"function"===t.type})},o=function(t){return t.filter(function(t){return"event"===t.type})};e.exports={getConstructor:r,filterFunctions:i,filterEvents:o}},{}],6:[function(t,e,n){"use strict";n.XMLHttpRequest="undefined"==typeof XMLHttpRequest?{}:XMLHttpRequest},{}],7:[function(t,e,n){var r=t("bignumber.js"),i=["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:i,ETH_BIGNUMBER_ROUNDING_MODE:{ROUNDING_MODE:r.ROUND_DOWN},ETH_POLLING_TIMEOUT:1e3,defaultBlock:"latest",defaultAccount:void 0}},{"bignumber.js":"bignumber.js"}],8:[function(t,e,n){var r=t("bignumber.js"),i={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"},o=function(t,e,n){return new Array(e-t.length+1).join(n?n:"0")+t},a=function(t,e){for(var n=!1,r=0;r<t.length&&!n;r++)n=e(t[r]);return n?r-1:-1},u=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},c=function(t,e){e=void 0===e?0:e;for(var n=s(t);n.length<2*e;)n+="00";return"0x"+n},f=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(" ",""):""},p=function(t){return y(t).toNumber()},m=function(t){var e=y(t),n=e.toString(16);return e.lessThan(0)?"-0x"+n.substr(1):"0x"+n},h=function(t){if(T(t))return m(+t);if(F(t))return m(t);if(O(t))return c(JSON.stringify(t));if(I(t)){if(0===t.indexOf("-0x"))return m(t);if(!isFinite(t))return c(t)}return m(t)},d=function(t){t=t?t.toLowerCase():"ether";var e=i[t];if(void 0===e)throw new Error("This unit doesn't exists, please use the one of the following units"+JSON.stringify(i,null,2));return new r(e,10)},g=function(t,e){var n=y(t).dividedBy(d(e));return F(t)?n:n.toString(10)},v=function(t,e){var n=y(t).times(d(e));return F(t)?n:n.toString(10)},y=function(t){return t=t||0,F(t)?t:!I(t)||0!==t.indexOf("0x")&&0!==t.indexOf("-0x")?new r(t.toString(10),10):new r(t.replace("0x",""),16)},w=function(t){var e=y(t);return e.lessThan(0)?new r("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16).plus(e).plus(1):e},b=function(t){return/^0x[0-9a-f]{40}$/.test(t)},x=function(t){return/^(0x)?[0-9a-f]{40}$/.test(t)},_=function(t){return b(t)?t:/^[0-9a-f]{40}$/.test(t)?"0x"+t:"0x"+o(h(t).substr(2),40)},F=function(t){return t instanceof r||t&&t.constructor&&"BigNumber"===t.constructor.name},I=function(t){return"string"==typeof t||t&&t.constructor&&"String"===t.constructor.name},N=function(t){return"function"==typeof t},O=function(t){return"object"==typeof t},T=function(t){return"boolean"==typeof t},A=function(t){return t instanceof Array},B=function(t){try{return!!JSON.parse(t)}catch(e){return!1}};e.exports={padLeft:o,findIndex:a,toHex:h,toDecimal:p,fromDecimal:m,toAscii:u,fromAscii:c,extractDisplayName:f,extractTypeName:l,toWei:v,fromWei:g,toBigNumber:y,toTwosComplement:w,toAddress:_,isBigNumber:F,isStrictAddress:b,isAddress:x,isFunction:N,isString:I,isObject:O,isBoolean:T,isArray:A,isJson:B}},{"bignumber.js":"bignumber.js"}],9:[function(t,e,n){e.exports={version:"0.2.8"}},{}],10:[function(t,e,n){var r=t("./version.json"),i=t("./web3/net"),o=t("./web3/eth"),a=t("./web3/db"),u=t("./web3/shh"),s=t("./web3/watches"),c=t("./web3/filter"),f=t("./utils/utils"),l=t("./web3/formatters"),p=t("./web3/requestmanager"),m=t("./utils/config"),h=t("./web3/method"),d=t("./web3/property"),g=[new h({name:"sha3",call:"web3_sha3",params:1})],v=[new d({name:"version.client",getter:"web3_clientVersion"}),new d({name:"version.network",getter:"net_version",inputFormatter:f.toDecimal}),new d({name:"version.ethereum",getter:"eth_protocolVersion",inputFormatter:f.toDecimal}),new d({name:"version.whisper",getter:"shh_version",inputFormatter:f.toDecimal})],y=function(t,e){e.forEach(function(e){e.attachToObject(t)})},w=function(t,e){e.forEach(function(e){e.attachToObject(t)})},b={};b.providers={},b.version={},b.version.api=r.version,b.eth={},b.eth.filter=function(t,e,n,r){return t._isEvent?t(e,n):new c(t,s.eth(),r||l.outputLogFormatter)},b.shh={},b.shh.filter=function(t){return new c(t,s.shh(),l.outputPostFormatter)},b.net={},b.db={},b.setProvider=function(t){p.getInstance().setProvider(t)},b.reset=function(){p.getInstance().reset(),m.defaultBlock="latest",m.defaultAccount=void 0},b.toHex=f.toHex,b.toAscii=f.toAscii,b.fromAscii=f.fromAscii,b.toDecimal=f.toDecimal,b.fromDecimal=f.fromDecimal,b.toBigNumber=f.toBigNumber,b.toWei=f.toWei,b.fromWei=f.fromWei,b.isAddress=f.isAddress,Object.defineProperty(b.eth,"defaultBlock",{get:function(){return m.defaultBlock},set:function(t){return m.defaultBlock=t,t}}),Object.defineProperty(b.eth,"defaultAccount",{get:function(){return m.defaultAccount},set:function(t){return m.defaultAccount=t,t}}),y(b,g),w(b,v),y(b.net,i.methods),w(b.net,i.properties),y(b.eth,o.methods),w(b.eth,o.properties),y(b.db,a.methods),y(b.shh,u.methods),e.exports=b},{"./utils/config":7,"./utils/utils":8,"./version.json":9,"./web3/db":12,"./web3/eth":14,"./web3/filter":16,"./web3/formatters":17,"./web3/method":21,"./web3/net":22,"./web3/property":23,"./web3/requestmanager":25,"./web3/shh":26,"./web3/watches":28}],11:[function(t,e,n){var r=t("../web3"),i=t("../solidity/abi"),o=t("../utils/utils"),a=t("../solidity/utils"),u=t("./event"),s=t("./signature"),c=t("./function"),f=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}},l=function(t,e,n){e.filter(function(t){return"function"===t.type}).map(function(t){return new c(t)}).forEach(function(e){e.attachToContract(t)})},p=function(t,e,n){t._onWatchEventResult=function(t){var n=event.getMatchingEvent(a.filterEvents(e)),r=u.outputParser(n);return r(t)},Object.defineProperty(t,"topics",{get:function(){return a.filterEvents(e).map(function(t){return s.eventSignatureFromAscii(t.name)})}})},m=function(t,e,n){a.filterEvents(e).forEach(function(e){var i=function(){var t=Array.prototype.slice.call(arguments),i=s.eventSignatureFromAscii(e.name),o=u.inputParser(n,i,e),a=o.apply(null,t),c=function(t){var n=u.outputParser(e);return n(t)};return r.eth.filter(a,void 0,void 0,c)};i._isEvent=!0;var a=o.extractDisplayName(e.name),c=o.extractTypeName(e.name);void 0===t[a]&&(t[a]=i),t[a][c]=i})},h=function(t){return d.bind(null,t)},d=function(t,e){if(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+")"}}),this.address="",o.isAddress(e))this.address=e;else{e=e||{};var n=Array.prototype.slice.call(arguments,2),a=i.formatConstructorParams(t,n);e.data+=a,this.address=r.eth.sendTransaction(e)}f(this),l(this,t,this.address),p(this,t,this.address),m(this,t,this.address)};e.exports=h},{"../solidity/abi":1,"../solidity/utils":5,"../utils/utils":8,"../web3":10,"./event":15,"./function":18,"./signature":27}],12:[function(t,e,n){var r=t("./method"),i=new r({name:"putString",call:"db_putString",params:3}),o=new r({name:"getString",call:"db_getString",params:2}),a=new r({name:"putHex",call:"db_putHex",params:3}),u=new r({name:"getHex",call:"db_getHex",params:2}),s=[i,o,a,u];e.exports={methods:s}},{"./method":21}],13:[function(t,e,n){e.exports={InvalidNumberOfParams:function(){return new Error("Invalid number of input parameters")},InvalidConnection:function(t){return new Error("CONNECTION ERROR: Couldn't connect to node "+t+", is it running?")},InvalidProvider:function(){return new Error("Providor not set or invalid")},InvalidResponse:function(t){var e=t&&t.error&&t.error.message?t.error.message:"Invalid JSON RPC response";return new Error(e)}}},{}],14:[function(t,e,n){"use strict";var r=t("./formatters"),i=t("../utils/utils"),o=t("./method"),a=t("./property"),u=function(t){return i.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getBlockByHash":"eth_getBlockByNumber"},s=function(t){return i.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getTransactionByBlockHashAndIndex":"eth_getTransactionByBlockNumberAndIndex"},c=function(t){return i.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getUncleByBlockHashAndIndex":"eth_getUncleByBlockNumberAndIndex"},f=function(t){return i.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getBlockTransactionCountByHash":"eth_getBlockTransactionCountByNumber"},l=function(t){return i.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getUncleCountByBlockHash":"eth_getUncleCountByBlockNumber"},p=new o({name:"getBalance",call:"eth_getBalance",params:2,inputFormatter:[i.toAddress,r.inputDefaultBlockNumberFormatter],outputFormatter:r.outputBigNumberFormatter}),m=new o({name:"getStorageAt",call:"eth_getStorageAt",params:3,inputFormatter:[null,i.toHex,r.inputDefaultBlockNumberFormatter]}),h=new o({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[i.toAddress,r.inputDefaultBlockNumberFormatter]}),d=new o({name:"getBlock",call:u,params:2,inputFormatter:[i.toHex,function(t){return!!t}],outputFormatter:r.outputBlockFormatter}),g=new o({name:"getUncle",call:c,params:2,inputFormatter:[i.toHex,i.toHex],outputFormatter:r.outputBlockFormatter}),v=new o({name:"getCompilers",call:"eth_getCompilers",params:0}),y=new o({name:"getBlockTransactionCount",call:f,params:1,inputFormatter:[r.inputBlockNumberFormatter],outputFormatter:i.toDecimal}),w=new o({name:"getBlockUncleCount",call:l,params:1,inputFormatter:[r.inputBlockNumberFormatter],outputFormatter:i.toDecimal}),b=new o({name:"getTransaction",call:"eth_getTransactionByHash",params:1,outputFormatter:r.outputTransactionFormatter}),x=new o({name:"getTransactionFromBlock",call:s,params:2,inputFormatter:[i.toHex,i.toHex],outputFormatter:r.outputTransactionFormatter}),_=new o({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[null,r.inputDefaultBlockNumberFormatter],outputFormatter:i.toDecimal}),F=new o({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[r.inputTransactionFormatter]}),I=new o({name:"call",call:"eth_call",params:2,inputFormatter:[r.inputTransactionFormatter,r.inputDefaultBlockNumberFormatter]}),N=new o({name:"compile.solidity",call:"eth_compileSolidity",params:1}),O=new o({name:"compile.lll",call:"eth_compileLLL",params:1}),T=new o({name:"compile.serpent",call:"eth_compileSerpent",params:1}),A=new o({name:"flush",call:"eth_flush",params:0}),B=[p,m,h,d,g,v,y,w,b,x,_,I,F,N,O,T,A],P=[new a({name:"coinbase",getter:"eth_coinbase"}),new a({name:"mining",getter:"eth_mining"}),new a({name:"gasPrice",getter:"eth_gasPrice",outputFormatter:r.outputBigNumberFormatter}),new a({name:"accounts",getter:"eth_accounts"}),new a({name:"blockNumber",getter:"eth_blockNumber",outputFormatter:i.toDecimal})];e.exports={methods:B,properties:P}},{"../utils/utils":8,"./formatters":17,"./method":21,"./property":23}],15:[function(t,e,n){var r=t("../solidity/abi"),i=t("../utils/utils"),o=t("./signature"),a=function(t,e){return t.filter(function(t){return t.indexed===e})},u=function(t,e){var n=i.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(n){var i=[u(a(t.inputs,!0),n)],o=e[n];return o instanceof Array?o.map(function(t){return r.formatInput(i,[t])}):"0x"+r.formatInput(i,[o])})},c=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}},f=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 n={event:i.extractDisplayName(t.name),number:e.number,hash:e.hash,args:{}};if(!e.topics)return n;e.data=e.data||"";var o=a(t.inputs,!0),u=e.topics.slice(1).map(function(t){return t.slice(2)}).join(""),s=r.formatOutput(o,u),c=a(t.inputs,!1),l=r.formatOutput(c,e.data.slice(2));return n.args=f(t.inputs,s,l),n}},p=function(t,e){for(var n=0;n<t.length;n++){var r=o.eventSignatureFromAscii(t[n].name);if(r===e.topics[0])return t[n]}return void 0};e.exports={inputParser:c,outputParser:l,getMatchingEvent:p}},{"../solidity/abi":1,"../utils/utils":8,"./signature":27}],16:[function(t,e,n){var r=t("./requestmanager"),i=t("./formatters"),o=t("../utils/utils"),a=function(t){return o.isString(t)?t:(t=t||{},t.topics=t.topics||[],t.topics=t.topics.map(function(t){return o.toHex(t)}),{topics:t.topics,to:t.to,address:t.address,fromBlock:i.inputBlockNumberFormatter(t.fromBlock),toBlock:i.inputBlockNumberFormatter(t.toBlock)})},u=function(t,e,n){var r={};e.forEach(function(t){t.attachToObject(r)}),this.options=a(t),this.implementation=r,this.callbacks=[],this.formatter=n,this.filterId=this.implementation.newFilter(this.options)};u.prototype.watch=function(t){this.callbacks.push(t);var e=this,n=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)})})};o.isString(this.options)||this.get(function(e,n){e&&t(e),n.forEach(function(e){t(null,e)})}),r.getInstance().startPolling({method:this.implementation.poll.call,params:[this.filterId]},this.filterId,n,this.stopWatching.bind(this))},u.prototype.stopWatching=function(){r.getInstance().stopPolling(this.filterId),this.implementation.uninstallFilter(this.filterId),this.callbacks=[]},u.prototype.get=function(t){var e=this;if(!o.isFunction(t)){var n=this.implementation.getLogs(this.filterId);return n.map(function(t){return e.formatter?e.formatter(t):t})}this.implementation.getLogs(this.filterId,function(n,r){n?t(n):t(null,r.map(function(t){return e.formatter?e.formatter(t):t}))})},e.exports=u},{"../utils/utils":8,"./formatters":17,"./requestmanager":25}],17:[function(t,e,n){var r=t("../utils/utils"),i=t("../utils/config"),o=function(t){return r.toBigNumber(t)},a=function(t){return"latest"===t||"pending"===t||"earliest"===t},u=function(t){return void 0===t?i.defaultBlock:s(t)},s=function(t){return void 0===t?void 0:a(t)?t:r.toHex(t)},c=function(t){return t.from=t.from||i.defaultAccount,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]=r.fromDecimal(t[e])}),t},f=function(t){return t.blockNumber=r.toDecimal(t.blockNumber),t.transactionIndex=r.toDecimal(t.transactionIndex),t.gas=r.toDecimal(t.gas),t.gasPrice=r.toBigNumber(t.gasPrice),t.value=r.toBigNumber(t.value),t},l=function(t){return t.gasLimit=r.toDecimal(t.gasLimit),t.gasUsed=r.toDecimal(t.gasUsed),t.size=r.toDecimal(t.size),t.timestamp=r.toDecimal(t.timestamp),t.number=r.toDecimal(t.number),t.minGasPrice=r.toBigNumber(t.minGasPrice),t.difficulty=r.toBigNumber(t.difficulty),t.totalDifficulty=r.toBigNumber(t.totalDifficulty),r.isArray(t.transactions)&&t.transactions.forEach(function(t){return r.isString(t)?void 0:f(t)}),t},p=function(t){return null===t?null:(t.blockNumber=r.toDecimal(t.blockNumber),t.transactionIndex=r.toDecimal(t.transactionIndex),t.logIndex=r.toDecimal(t.logIndex),t)},m=function(t){return t.payload=r.toHex(t.payload),t.ttl=r.fromDecimal(t.ttl),t.workToProve=r.fromDecimal(t.workToProve),t.priority=r.fromDecimal(t.priority),r.isArray(t.topics)||(t.topics=t.topics?[t.topics]:[]),t.topics=t.topics.map(function(t){return r.fromAscii(t)}),t},h=function(t){return t.expiry=r.toDecimal(t.expiry),t.sent=r.toDecimal(t.sent),t.ttl=r.toDecimal(t.ttl),t.workProved=r.toDecimal(t.workProved),t.payloadRaw=t.payload,t.payload=r.toAscii(t.payload),r.isJson(t.payload)&&(t.payload=JSON.parse(t.payload)),t.topics||(t.topics=[]),t.topics=t.topics.map(function(t){return r.toAscii(t)}),t};e.exports={inputDefaultBlockNumberFormatter:u,inputBlockNumberFormatter:s,inputTransactionFormatter:c,inputPostFormatter:m,outputBigNumberFormatter:o,outputTransactionFormatter:f,outputBlockFormatter:l,outputLogFormatter:p,outputPostFormatter:h}},{"../utils/config":7,"../utils/utils":8}],18:[function(t,e,n){var r=t("../web3"),i=t("../solidity/coder"),o=t("../utils/utils"),a=function(t){this._inputTypes=t.inputs.map(function(t){return t.type}),this._outputTypes=t.outputs.map(function(t){return t.type}),this._constant=t.constant,this._name=t.name};a.prototype.signature=function(){return r.sha3(r.fromAscii(this._name)).slice(2,10)},a.prototype.call=function(t){return r.eth.call(t)},a.prototype.sendTransaction=function(t){r.eth.sendTransaction(t)},a.prototype.displayName=function(){return o.extractDisplayName(this._name)},a.prototype.typeName=function(){return o.extractTypeName(this._name)},a.prototype.execute=function(t){var e=Array.prototype.slice.call(arguments,1),n=t._options||{};n.to=t.address,n.data="0x"+this.signature()+i.encodeParams(this._inputTypes,e);var r=t._isTransaction===!0||t._isTransaction!==!1&&!this._constant;if(t._options={},t._isTransaction=null,r)return this.sendTransaction(n);var o=this.call(n);return i.decodeParams(this._outputTypes,o)},a.prototype.attachToContract=function(t){var e=this.execute.bind(this,t),n=this.displayName();t[n]||(t[n]=e),t[n][this.typeName()]=this.execute.bind(this,t)},e.exports=a},{"../solidity/coder":2,"../utils/utils":8,"../web3":10}],19:[function(t,e,n){"use strict";var r=t("xmlhttprequest").XMLHttpRequest,i=t("./errors"),o=function(t){this.host=t||"http://localhost:8080"};o.prototype.send=function(t){var e=new r;e.open("POST",this.host,!1);try{e.send(JSON.stringify(t))}catch(n){throw i.InvalidConnection(this.host)}return JSON.parse(e.responseText)},o.prototype.sendAsync=function(t,e){var n=new r;n.onreadystatechange=function(){4===n.readyState&&e(null,JSON.parse(n.responseText))},n.open("POST",this.host,!0);try{n.send(JSON.stringify(t))}catch(o){e(i.InvalidConnection(this.host))}},e.exports=o},{"./errors":13,xmlhttprequest:6}],20:[function(t,e,n){var r=function(){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,void(this.messageId=1))};r.getInstance=function(){var t=new r;return t},r.prototype.toPayload=function(t,e){return t||console.error("jsonrpc method should be specified!"),{jsonrpc:"2.0",method:t,params:e||[],id:this.messageId++}},r.prototype.isValidResponse=function(t){return!!t&&!t.error&&"2.0"===t.jsonrpc&&"number"==typeof t.id&&void 0!==t.result},r.prototype.toBatchPayload=function(t){var e=this;return t.map(function(t){return e.toPayload(t.method,t.params)})},e.exports=r},{}],21:[function(t,e,n){var r=t("./requestmanager"),i=t("../utils/utils"),o=t("./errors"),a=function(t){this.name=t.name,this.call=t.call,this.params=t.params||0,this.inputFormatter=t.inputFormatter,this.outputFormatter=t.outputFormatter};a.prototype.getCall=function(t){return i.isFunction(this.call)?this.call(t):this.call},a.prototype.extractCallback=function(t){return i.isFunction(t[t.length-1])?t.pop():null},a.prototype.validateArgs=function(t){if(t.length!==this.params)throw o.InvalidNumberOfParams()},a.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter.map(function(e,n){return e?e(t[n]):t[n]}):t},a.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},a.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},a.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}},a.prototype.send=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));if(t.callback){var e=this;return r.getInstance().sendAsync(t,function(n,r){t.callback(null,e.formatOutput(r))})}return this.formatOutput(r.getInstance().send(t))},e.exports=a},{"../utils/utils":8,"./errors":13,"./requestmanager":25}],22:[function(t,e,n){var r=t("../utils/utils"),i=t("./property"),o=[],a=[new i({name:"listening",getter:"net_listening"}),new i({name:"peerCount",getter:"net_peerCount",outputFormatter:r.toDecimal})];e.exports={methods:o,properties:a}},{"../utils/utils":8,"./property":23}],23:[function(t,e,n){var r=t("./requestmanager"),i=function(t){this.name=t.name,this.getter=t.getter,this.setter=t.setter,this.outputFormatter=t.outputFormatter,this.inputFormatter=t.inputFormatter};i.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter(t):t},i.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},i.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)},i.prototype.get=function(){return this.formatOutput(r.getInstance().send({method:this.getter}))},i.prototype.set=function(t){return r.getInstance().send({method:this.setter,params:[this.formatInput(t)]})},e.exports=i},{"./requestmanager":25}],24:[function(t,e,n){var r=function(){};r.prototype.send=function(t){var e=navigator.qt.callMethod(JSON.stringify(t));return JSON.parse(e)},e.exports=r},{}],25:[function(t,e,n){var r=t("./jsonrpc"),i=t("../utils/utils"),o=t("../utils/config"),a=t("./errors"),u=function(t){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,this.provider=t,this.polls=[],this.timeout=null,void this.poll())};u.getInstance=function(){var t=new u;return t},u.prototype.send=function(t){if(!this.provider)return console.error(a.InvalidProvider()),null;var e=r.getInstance().toPayload(t.method,t.params),n=this.provider.send(e);if(!r.getInstance().isValidResponse(n))throw a.InvalidResponse(n);return n.result},u.prototype.sendAsync=function(t,e){if(!this.provider)return e(a.InvalidProvider());var n=r.getInstance().toPayload(t.method,t.params);this.provider.sendAsync(n,function(t,n){return t?e(t):r.getInstance().isValidResponse(n)?void e(null,n.result):e(a.InvalidResponse(n))})},u.prototype.setProvider=function(t){this.provider=t},u.prototype.startPolling=function(t,e,n,r){this.polls.push({data:t,id:e,callback:n,uninstall:r})},u.prototype.stopPolling=function(t){for(var e=this.polls.length;e--;){var n=this.polls[e];n.id===t&&this.polls.splice(e,1)}},u.prototype.reset=function(){this.polls.forEach(function(t){t.uninstall(t.id)}),this.polls=[],this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.poll()},u.prototype.poll=function(){if(this.timeout=setTimeout(this.poll.bind(this),o.ETH_POLLING_TIMEOUT),this.polls.length){if(!this.provider)return void console.error(a.InvalidProvider());var t=r.getInstance().toBatchPayload(this.polls.map(function(t){return t.data})),e=this;this.provider.sendAsync(t,function(t,n){if(!t){if(!i.isArray(n))throw a.InvalidResponse(n);n.map(function(t,n){return t.callback=e.polls[n].callback,t}).filter(function(t){var e=r.getInstance().isValidResponse(t);return e||t.callback(a.InvalidResponse(t)),e}).filter(function(t){return i.isArray(t.result)&&t.result.length>0}).forEach(function(t){t.callback(null,t.result)})}})}},e.exports=u},{"../utils/config":7,"../utils/utils":8,"./errors":13,"./jsonrpc":20}],26:[function(t,e,n){var r=t("./method"),i=t("./formatters"),o=new r({name:"post",call:"shh_post",params:1,inputFormatter:[i.inputPostFormatter]}),a=new r({name:"newIdentity",call:"shh_newIdentity",params:0}),u=new r({name:"hasIdentity",call:"shh_hasIdentity",params:1}),s=new r({name:"newGroup",call:"shh_newGroup",params:0}),c=new r({name:"addToGroup",call:"shh_addToGroup",params:0}),f=[o,a,u,s,c];e.exports={methods:f}},{"./formatters":17,"./method":21}],27:[function(t,e,n){var r=t("../web3"),i=t("../utils/config"),o=function(t){return r.sha3(r.fromAscii(t)).slice(0,2+2*i.ETH_SIGNATURE_LENGTH)},a=function(t){return r.sha3(r.fromAscii(t))};e.exports={functionSignatureFromAscii:o,eventSignatureFromAscii:a}},{"../utils/config":7,"../web3":10}],28:[function(t,e,n){var r=t("./method"),i=function(){var t=function(t){return"string"==typeof t[0]?"eth_newBlockFilter":"eth_newFilter"},e=new r({name:"newFilter",call:t,params:1}),n=new r({name:"uninstallFilter",call:"eth_uninstallFilter",params:1}),i=new r({name:"getLogs",call:"eth_getFilterLogs",params:1}),o=new r({name:"poll",call:"eth_getFilterChanges",params:1});return[e,n,i,o]},o=function(){var t=new r({name:"newFilter",
call:"shh_newFilter",params:1}),e=new r({name:"uninstallFilter",call:"shh_uninstallFilter",params:1}),n=new r({name:"getLogs",call:"shh_getMessages",params:1}),i=new r({name:"poll",call:"shh_getFilterChanges",params:1});return[t,e,n,i]};e.exports={eth:i,shh:o}},{"./method":21}],29:[function(t,e,n){},{}],"bignumber.js":[function(t,e,n){!function(n){"use strict";function r(t){function e(t,r){var i,o,a,u,s,c,f=this;if(!(f instanceof e))return V&&E(26,"constructor call without new",t),new e(t,r);if(null!=r&&J(r,2,64,R,"base")){if(r=0|r,c=t+"",10==r)return f=new e(t instanceof e?t:c),S(f,j+f.e+1,L);if((u="number"==typeof t)&&0*t!=0||!new RegExp("^-?"+(i="["+_.slice(0,r)+"]+")+"(?:\\."+i+")?$",37>r?"i":"").test(c))return d(f,c,u,r);u?(f.s=0>1/t?(c=c.slice(1),-1):1,V&&c.replace(/^0\.0*|\./,"").length>15&&E(R,x,t),u=!1):f.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1,c=n(c,10,r,f.s)}else{if(t instanceof e)return f.s=t.s,f.e=t.e,f.c=(t=t.c)?t.slice():t,void(R=0);if((u="number"==typeof t)&&0*t==0){if(f.s=0>1/t?(t=-t,-1):1,t===~~t){for(o=0,a=t;a>=10;a/=10,o++);return f.e=o,f.c=[t],void(R=0)}c=t+""}else{if(!g.test(c=t+""))return d(f,c,u);f.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(s=c.length;48===c.charCodeAt(--s););if(c=c.slice(a,s+1))if(s=c.length,u&&V&&s>15&&E(R,x,f.s*t),o=o-a-1,o>G)f.c=f.e=null;else if(M>o)f.c=[f.e=0];else{if(f.e=o,f.c=[],a=(o+1)%I,0>o&&(a+=I),s>a){for(a&&f.c.push(+c.slice(0,a)),s-=I;s>a;)f.c.push(+c.slice(a,a+=I));c=c.slice(a),a=I-c.length}else a-=s;for(;a--;c+="0");f.c.push(+c)}else f.c=[f.e=0];R=0}function n(t,n,r,i){var a,u,s,f,p,m,h,d=t.indexOf("."),g=j,v=L;for(37>r&&(t=t.toLowerCase()),d>=0&&(s=z,z=0,t=t.replace(".",""),h=new e(r),p=h.pow(t.length-d),z=s,h.c=c(l(o(p.c),p.e),10,n),h.e=h.c.length),m=c(t,r,n),u=s=m.length;0==m[--s];m.pop());if(!m[0])return"0";if(0>d?--u:(p.c=m,p.e=u,p.s=i,p=k(p,h,g,v,n),m=p.c,f=p.r,u=p.e),a=u+g+1,d=m[a],s=n/2,f=f||0>a||null!=m[a+1],f=4>v?(null!=d||f)&&(0==v||v==(p.s<0?3:2)):d>s||d==s&&(4==v||f||6==v&&1&m[a-1]||v==(p.s<0?8:7)),1>a||!m[0])t=f?l("1",-g):"0";else{if(m.length=a,f)for(--n;++m[--a]>n;)m[a]=0,a||(++u,m.unshift(1));for(s=m.length;!m[--s];);for(d=0,t="";s>=d;t+=_.charAt(m[d++]));t=l(t,u)}return t}function m(t,n,r,i){var a,u,s,c,p;if(r=null!=r&&J(r,0,8,i,b)?0|r:L,!t.c)return t.toString();if(a=t.c[0],s=t.e,null==n)p=o(t.c),p=19==i||24==i&&U>=s?f(p,s):l(p,s);else if(t=S(new e(t),n,r),u=t.e,p=o(t.c),c=p.length,19==i||24==i&&(u>=n||U>=u)){for(;n>c;p+="0",c++);p=f(p,u)}else if(n-=s,p=l(p,u),u+1>c){if(--n>0)for(p+=".";n--;p+="0");}else if(n+=u-c,n>0)for(u+1==c&&(p+=".");n--;p+="0");return t.s<0&&a?"-"+p:p}function B(t,n){var r,i,o=0;for(s(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 P(t,e,n,r,i){return(e>t||t>n||t!=p(t))&&E(r,(i||"decimal places")+(e>t||t>n?" out of range":" not an integer"),t),!0}function D(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*I-1)>G?t.c=t.e=null:M>n?t.c=[t.e=0]:(t.e=n,t.c=e),t}function E(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",R=0,r}function S(t,e,n,r){var i,o,a,u,s,c,f,l=t.c,p=O;if(l){t:{for(i=1,u=l[0];u>=10;u/=10,i++);if(o=e-i,0>o)o+=I,a=e,s=l[c=0],f=s/p[i-a-1]%10|0;else if(c=v((o+1)/I),c>=l.length){if(!r)break t;for(;l.length<=c;l.push(0));s=f=0,i=1,o%=I,a=o-I+1}else{for(s=u=l[c],i=1;u>=10;u/=10,i++);o%=I,a=o-I+i,f=0>a?0:s/p[i-a-1]%10|0}if(r=r||0>e||null!=l[c+1]||(0>a?s:s%p[i-a-1]),r=4>n?(f||r)&&(0==n||n==(t.s<0?3:2)):f>5||5==f&&(4==n||r||6==n&&(o>0?a>0?s/p[i-a]:0:l[c-1])%10&1||n==(t.s<0?8:7)),1>e||!l[0])return l.length=0,r?(e-=t.e+1,l[0]=p[e%I],t.e=-e||0):l[0]=t.e=0,t;if(0==o?(l.length=c,u=1,c--):(l.length=c+1,u=p[I-o],l[c]=a>0?y(s/p[i-a]%p[a])*u:0),r)for(;;){if(0==c){for(o=1,a=l[0];a>=10;a/=10,o++);for(a=l[0]+=u,u=1;a>=10;a/=10,u++);o!=u&&(t.e++,l[0]==F&&(l[0]=1));break}if(l[c]+=u,l[c]!=F)break;l[c--]=0,u=1}for(o=l.length;0===l[--o];l.pop());}t.e>G?t.c=t.e=null:t.e<M&&(t.c=[t.e=0])}return t}var k,R=0,C=e.prototype,H=new e(1),j=20,L=4,U=-7,q=21,M=-1e7,G=1e7,V=!0,J=P,W=!1,$=1,z=100,X={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")&&J(t,0,A,2,e)&&(j=0|t),r[e]=j,a(e="ROUNDING_MODE")&&J(t,0,8,2,e)&&(L=0|t),r[e]=L,a(e="EXPONENTIAL_AT")&&(s(t)?J(t[0],-A,0,2,e)&&J(t[1],0,A,2,e)&&(U=0|t[0],q=0|t[1]):J(t,-A,A,2,e)&&(U=-(q=0|(0>t?-t:t)))),r[e]=[U,q],a(e="RANGE")&&(s(t)?J(t[0],-A,-1,2,e)&&J(t[1],1,A,2,e)&&(M=0|t[0],G=0|t[1]):J(t,-A,A,2,e)&&(0|t?M=-(G=0|(0>t?-t:t)):V&&E(2,e+" cannot be zero",t))),r[e]=[M,G],a(e="ERRORS")&&(t===!!t||1===t||0===t?(R=0,J=(V=!!t)?P:u):V&&E(2,e+w,t)),r[e]=V,a(e="CRYPTO")&&(t===!!t||1===t||0===t?(W=!(!t||!h||"object"!=typeof h),t&&!W&&V&&E(2,"crypto unavailable",h)):V&&E(2,e+w,t)),r[e]=W,a(e="MODULO_MODE")&&J(t,0,9,2,e)&&($=0|t),r[e]=$,a(e="POW_PRECISION")&&J(t,0,A,2,e)&&(z=0|t),r[e]=z,a(e="FORMAT")&&("object"==typeof t?X=t:V&&E(2,e+" not an object",t)),r[e]=X,r},e.max=function(){return B(arguments,C.lt)},e.min=function(){return B(arguments,C.gt)},e.random=function(){var t=9007199254740992,n=Math.random()*t&2097151?function(){return y(Math.random()*t)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(t){var r,i,o,a,u,s=0,c=[],f=new e(H);if(t=null!=t&&J(t,0,A,14)?0|t:j,a=v(t/I),W)if(h&&h.getRandomValues){for(r=h.getRandomValues(new Uint32Array(a*=2));a>s;)u=131072*r[s]+(r[s+1]>>>11),u>=9e15?(i=h.getRandomValues(new Uint32Array(2)),r[s]=i[0],r[s+1]=i[1]):(c.push(u%1e14),s+=2);s=a/2}else if(h&&h.randomBytes){for(r=h.randomBytes(a*=7);a>s;)u=281474976710656*(31&r[s])+1099511627776*r[s+1]+4294967296*r[s+2]+16777216*r[s+3]+(r[s+4]<<16)+(r[s+5]<<8)+r[s+6],u>=9e15?h.randomBytes(7).copy(r,s):(c.push(u%1e14),s+=7);s=a/7}else V&&E(14,"crypto unavailable",h);if(!s)for(;a>s;)u=n(),9e15>u&&(c[s++]=u%1e14);for(a=c[--s],t%=I,a&&t&&(u=O[I-t],c[s]=y(a/u)*u);0===c[s];c.pop(),s--);if(0>s)c=[o=0];else{for(o=-1;0===c[0];c.shift(),o-=I);for(s=1,u=c[0];u>=10;u/=10,s++);I>s&&(o-=I-s)}return f.e=o,f.c=c,f}}(),k=function(){function t(t,e,n){var r,i,o,a,u=0,s=t.length,c=e%T,f=e/T|0;for(t=t.slice();s--;)o=t[s]%T,a=t[s]/T|0,r=f*o+a*c,i=c*o+r%T*T+u,u=(i/n|0)+(r/T|0)+f*a,t[s]=i%n;return u&&t.unshift(u),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,u,s,c){var f,l,p,m,h,d,g,v,w,b,x,_,N,O,T,A,B,P=o.s==a.s?1:-1,D=o.c,E=a.c;if(!(D&&D[0]&&E&&E[0]))return new e(o.s&&a.s&&(D?!E||D[0]!=E[0]:E)?D&&0==D[0]||!E?0*P:P/0:0/0);for(v=new e(P),w=v.c=[],l=o.e-a.e,P=u+l+1,c||(c=F,l=i(o.e/I)-i(a.e/I),P=P/I|0),p=0;E[p]==(D[p]||0);p++);if(E[p]>(D[p]||0)&&l--,0>P)w.push(1),m=!0;else{for(O=D.length,A=E.length,p=0,P+=2,h=y(c/(E[0]+1)),h>1&&(E=t(E,h,c),D=t(D,h,c),A=E.length,O=D.length),N=A,b=D.slice(0,A),x=b.length;A>x;b[x++]=0);B=E.slice(),B.unshift(0),T=E[0],E[1]>=c/2&&T++;do{if(h=0,f=n(E,b,A,x),0>f){if(_=b[0],A!=x&&(_=_*c+(b[1]||0)),h=y(_/T),h>1)for(h>=c&&(h=c-1),d=t(E,h,c),g=d.length,x=b.length;1==n(d,b,g,x);)h--,r(d,g>A?B:E,g,c),g=d.length,f=1;else 0==h&&(f=h=1),d=E.slice(),g=d.length;if(x>g&&d.unshift(0),r(b,d,x,c),x=b.length,-1==f)for(;n(E,b,A,x)<1;)h++,r(b,x>A?B:E,x,c),x=b.length}else 0===f&&(h++,b=[0]);w[p++]=h,b[0]?b[x++]=D[N]||0:(b=[D[N]],x=1)}while((N++<O||null!=b[0])&&P--);m=null!=b[0],w[0]||w.shift()}if(c==F){for(p=1,P=w[0];P>=10;P/=10,p++);S(v,u+(v.e=p+l*I-1)+1,s,m)}else v.e=l,v.r=+m;return v}}(),d=function(){var t=/^(-?)0([xbo])/i,n=/^([^.]+)\.$/,r=/^\.([^.]+)$/,i=/^-?(Infinity|NaN)$/,o=/^\s*\+|^\s+|\s+$/g;return function(a,u,s,c){var f,l=s?u:u.replace(o,"");if(i.test(l))a.s=isNaN(l)?null:0>l?-1:1;else{if(!s&&(l=l.replace(t,function(t,e,n){return f="x"==(n=n.toLowerCase())?16:"b"==n?2:8,c&&c!=f?t:e}),c&&(f=c,l=l.replace(n,"$1").replace(r,"0.$1")),u!=l))return new e(l,f);V&&E(R,"not a"+(c?" base "+c:"")+" number",u),a.s=null}a.c=a.e=null,R=0}}(),C.absoluteValue=C.abs=function(){var t=new e(this);return t.s<0&&(t.s=1),t},C.ceil=function(){return S(new e(this),this.e+1,2)},C.comparedTo=C.cmp=function(t,n){return R=1,a(this,new e(t,n))},C.decimalPlaces=C.dp=function(){var t,e,n=this.c;if(!n)return null;if(t=((e=n.length-1)-i(this.e/I))*I,e=n[e])for(;e%10==0;e/=10,t--);return 0>t&&(t=0),t},C.dividedBy=C.div=function(t,n){return R=3,k(this,new e(t,n),j,L)},C.dividedToIntegerBy=C.divToInt=function(t,n){return R=4,k(this,new e(t,n),0,1)},C.equals=C.eq=function(t,n){return R=5,0===a(this,new e(t,n))},C.floor=function(){return S(new e(this),this.e+1,3)},C.greaterThan=C.gt=function(t,n){return R=6,a(this,new e(t,n))>0},C.greaterThanOrEqualTo=C.gte=function(t,n){return R=7,1===(n=a(this,new e(t,n)))||0===n},C.isFinite=function(){return!!this.c},C.isInteger=C.isInt=function(){return!!this.c&&i(this.e/I)>this.c.length-2},C.isNaN=function(){return!this.s},C.isNegative=C.isNeg=function(){return this.s<0},C.isZero=function(){return!!this.c&&0==this.c[0]},C.lessThan=C.lt=function(t,n){return R=8,a(this,new e(t,n))<0},C.lessThanOrEqualTo=C.lte=function(t,n){return R=9,-1===(n=a(this,new e(t,n)))||0===n},C.minus=C.sub=function(t,n){var r,o,a,u,s=this,c=s.s;if(R=10,t=new e(t,n),n=t.s,!c||!n)return new e(0/0);if(c!=n)return t.s=-n,s.plus(t);var f=s.e/I,l=t.e/I,p=s.c,m=t.c;if(!f||!l){if(!p||!m)return p?(t.s=-n,t):new e(m?s:0/0);if(!p[0]||!m[0])return m[0]?(t.s=-n,t):new e(p[0]?s:3==L?-0:0)}if(f=i(f),l=i(l),p=p.slice(),c=f-l){for((u=0>c)?(c=-c,a=p):(l=f,a=m),a.reverse(),n=c;n--;a.push(0));a.reverse()}else for(o=(u=(c=p.length)<(n=m.length))?c:n,c=n=0;o>n;n++)if(p[n]!=m[n]){u=p[n]<m[n];break}if(u&&(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=F-1;o>c;){if(p[--o]<m[o]){for(r=o;r&&!p[--r];p[r]=n);--p[r],p[o]+=F}p[o]-=m[o]}for(;0==p[0];p.shift(),--l);return p[0]?D(t,p,l):(t.s=3==L?-1:1,t.c=[t.e=0],t)},C.modulo=C.mod=function(t,n){var r,i,o=this;return R=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==$?(i=t.s,t.s=1,r=k(o,t,0,3),t.s=i,r.s*=i):r=k(o,t,0,$),o.minus(r.times(t)))},C.negated=C.neg=function(){var t=new e(this);return t.s=-t.s||null,t},C.plus=C.add=function(t,n){var r,o=this,a=o.s;if(R=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 u=o.e/I,s=t.e/I,c=o.c,f=t.c;if(!u||!s){if(!c||!f)return new e(a/0);if(!c[0]||!f[0])return f[0]?t:new e(c[0]?o:0*a)}if(u=i(u),s=i(s),c=c.slice(),a=u-s){for(a>0?(s=u,r=f):(a=-a,r=c),r.reverse();a--;r.push(0));r.reverse()}for(a=c.length,n=f.length,0>a-n&&(r=f,f=c,c=r,n=a),a=0;n;)a=(c[--n]=c[n]+f[n]+a)/F|0,c[n]%=F;return a&&(c.unshift(a),++s),D(t,c,s)},C.precision=C.sd=function(t){var e,n,r=this,i=r.c;if(null!=t&&t!==!!t&&1!==t&&0!==t&&(V&&E(13,"argument"+w,t),t!=!!t&&(t=null)),!i)return null;if(n=i.length-1,e=n*I+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},C.round=function(t,n){var r=new e(this);return(null==t||J(t,0,A,15))&&S(r,~~t+this.e+1,null!=n&&J(n,0,8,15,b)?0|n:L),r},C.shift=function(t){var n=this;return J(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)},C.squareRoot=C.sqrt=function(){var t,n,r,a,u,s=this,c=s.c,f=s.s,l=s.e,p=j+4,m=new e("0.5");if(1!==f||!c||!c[0])return new e(!f||0>f&&(!c||c[0])?0/0:c?s:1/0);if(f=Math.sqrt(+s),0==f||f==1/0?(n=o(c),(n.length+l)%2==0&&(n+="0"),f=Math.sqrt(n),l=i((l+1)/2)-(0>l||l%2),f==1/0?n="1e"+l:(n=f.toExponential(),n=n.slice(0,n.indexOf("e")+1)+l),r=new e(n)):r=new e(f+""),r.c[0])for(l=r.e,f=l+p,3>f&&(f=0);;)if(u=r,r=m.times(u.plus(k(s,u,p,1))),o(u.c).slice(0,f)===(n=o(r.c)).slice(0,f)){if(r.e<l&&--f,n=n.slice(f-3,f+1),"9999"!=n&&(a||"4999"!=n)){(!+n||!+n.slice(1)&&"5"==n.charAt(0))&&(S(r,r.e+j+2,1),t=!r.times(r).eq(s));break}if(!a&&(S(u,u.e+j+2,0),u.times(u).eq(s))){r=u;break}p+=4,f+=4,a=1}return S(r,r.e+j+1,L,t)},C.times=C.mul=function(t,n){var r,o,a,u,s,c,f,l,p,m,h,d,g,v,y,w=this,b=w.c,x=(R=17,t=new e(t,n)).c;if(!(b&&x&&b[0]&&x[0]))return!w.s||!t.s||b&&!b[0]&&!x||x&&!x[0]&&!b?t.c=t.e=t.s=null:(t.s*=w.s,b&&x?(t.c=[0],t.e=0):t.c=t.e=null),t;for(o=i(w.e/I)+i(t.e/I),t.s*=w.s,f=b.length,m=x.length,m>f&&(g=b,b=x,x=g,a=f,f=m,m=a),a=f+m,g=[];a--;g.push(0));for(v=F,y=T,a=m;--a>=0;){for(r=0,h=x[a]%y,d=x[a]/y|0,s=f,u=a+s;u>a;)l=b[--s]%y,p=b[s]/y|0,c=d*l+p*h,l=h*l+c%y*y+g[u]+r,r=(l/v|0)+(c/y|0)+d*p,g[u--]=l%v;g[u]=r}return r?++o:g.shift(),D(t,g,o)},C.toDigits=function(t,n){var r=new e(this);return t=null!=t&&J(t,1,A,18,"precision")?0|t:null,n=null!=n&&J(n,0,8,18,b)?0|n:L,t?S(r,t,n):r},C.toExponential=function(t,e){return m(this,null!=t&&J(t,0,A,19)?~~t+1:null,e,19)},C.toFixed=function(t,e){return m(this,null!=t&&J(t,0,A,20)?~~t+this.e+1:null,e,20)},C.toFormat=function(t,e){var n=m(this,null!=t&&J(t,0,A,21)?~~t+this.e+1:null,e,21);if(this.c){var r,i=n.split("."),o=+X.groupSize,a=+X.secondaryGroupSize,u=X.groupSeparator,s=i[0],c=i[1],f=this.s<0,l=f?s.slice(1):s,p=l.length;if(a&&(r=o,o=a,a=r,p-=r),o>0&&p>0){for(r=p%o||o,s=l.substr(0,r);p>r;r+=o)s+=u+l.substr(r,o);a>0&&(s+=u+l.slice(r)),f&&(s="-"+s)}n=c?s+X.decimalSeparator+((a=+X.fractionGroupSize)?c.replace(new RegExp("\\d{"+a+"}\\B","g"),"$&"+X.fractionGroupSeparator):c):s}return n},C.toFraction=function(t){var n,r,i,a,u,s,c,f,l,p=V,m=this,h=m.c,d=new e(H),g=r=new e(H),v=c=new e(H);if(null!=t&&(V=!1,s=new e(t),V=p,(!(p=s.isInt())||s.lt(H))&&(V&&E(22,"max denominator "+(p?"out of range":"not an integer"),t),t=!p&&s.c&&S(s,s.e+1,1).gte(H)?s:null)),!h)return m.toString();for(l=o(h),a=d.e=l.length-m.e-1,d.c[0]=O[(u=a%I)<0?I+u:u],t=!t||s.cmp(d)>0?a>0?d:g:s,u=G,G=1/0,s=new e(l),c.c[0]=0;f=k(s,d,0,1),i=r.plus(f.times(v)),1!=i.cmp(t);)r=v,v=i,g=c.plus(f.times(i=g)),c=i,d=s.minus(f.times(i=d)),s=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()],G=u,n},C.toNumber=function(){var t=this;return+t||(t.s?0*t.s:0/0)},C.toPower=C.pow=function(t){var n,r,i=y(0>t?-t:+t),o=this;if(!J(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=z?v(z/I+2):0,r=new e(H);;){if(i%2){if(r=r.times(o),!r.c)break;n&&r.c.length>n&&(r.c.length=n)}if(i=y(i/2),!i)break;o=o.times(o),n&&o.c&&o.c.length>n&&(o.c.length=n)}return 0>t&&(r=H.div(r)),n?S(r,z,L):r},C.toPrecision=function(t,e){return m(this,null!=t&&J(t,1,A,24,"precision")?0|t:null,e,24)},C.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&&J(t,2,64,25,"base")?n(l(e,a),0|t,10,i):U>=a||a>=q?f(e,a):l(e,a),0>i&&r.c[0]&&(e="-"+e)),e},C.truncated=C.trunc=function(){return S(new e(this),this.e+1,1)},C.valueOf=C.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=I-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,u=e.s,s=t.e,c=e.e;if(!a||!u)return null;if(n=i&&!i[0],r=o&&!o[0],n||r)return n?r?0:-u:a;if(a!=u)return a;if(n=0>a,r=s==c,!i||!o)return r?0:!i^n?1:-1;if(!r)return s>c^n?1:-1;for(u=(s=i.length)<(c=o.length)?s:c,a=0;u>a;a++)if(i[a]!=o[a])return i[a]>o[a]^n?1:-1;return s==c?0:s>c^n?1:-1}function u(t,e,n){return(t=p(t))>=e&&n>=t}function s(t){return"[object Array]"==Object.prototype.toString.call(t)}function c(t,e,n){for(var r,i,o=[0],a=0,u=t.length;u>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 f(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(0>e?"e":"e+")+e}function l(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):y(t)}var m,h,d,g=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,v=Math.ceil,y=Math.floor,w=" not a boolean or binary digit",b="rounding mode",x="number type has more than 15 significant digits",_="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",F=1e14,I=14,N=9007199254740991,O=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],T=1e7,A=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(B){}}else n.BigNumber=m}(this)},{crypto:29}],web3:[function(t,e,n){var r=t("./lib/web3");r.providers.HttpProvider=t("./lib/web3/httpprovider"),r.providers.QtSyncProvider=t("./lib/web3/qtsync"),r.eth.contract=t("./lib/web3/contract"),r.abi=t("./lib/solidity/abi"),"undefined"!=typeof window&&"undefined"==typeof window.web3&&(window.web3=r),e.exports=r},{"./lib/solidity/abi":1,"./lib/web3":10,"./lib/web3/contract":11,"./lib/web3/httpprovider":19,"./lib/web3/qtsync":24}]},{},["web3"]);