mirror of https://github.com/status-im/web3.js.git
1 line
23 KiB
JavaScript
1 line
23 KiB
JavaScript
require=function t(e,n,r){function o(i,u){if(!n[i]){if(!e[i]){var s="function"==typeof require&&require;if(!u&&s)return s(i,!0);if(a)return a(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[i]={exports:{}};e[i][0].call(f.exports,function(t){var n=e[i][1][t];return o(n?n:t)},f,f.exports,t,e,n,r)}return n[i].exports}for(var a="function"==typeof require&&require,i=0;i<r.length;i++)o(r[i]);return o}({1:[function(t,e){var n=t("./web3"),r=t("./utils"),o=t("./types"),a=t("./const"),i=t("./formatters"),u=function(t){console.error("parser does not support type: "+t)},s=function(t){return"[]"===t.slice(-2)},c=function(t,e){return s(t)||"string"===t?i.formatInputInt(e.length):""},f=o.inputTypes(),l=function(t,e){var n="";return t.forEach(function(t,r){n+=c(t.type,e[r])}),t.forEach(function(r,o){for(var a=!1,i=0;i<f.length&&!a;i++)a=f[i].type(t[o].type,e[o]);a||u(t[o].type);var c=f[i-1].format,l="";l=s(t[o].type)?e[o].reduce(function(t,e){return t+c(e)},""):c(e[o]),n+=l}),n},p=function(t){return s(t)||"string"===t?2*a.ETH_PADDING:0},m=o.outputTypes(),h=function(t,e){e=e.slice(2);var n=[],r=2*a.ETH_PADDING,c=t.reduce(function(t,e){return t+p(e.type)},0),f=e.slice(0,c);return e=e.slice(c),t.forEach(function(a,c){for(var l=!1,p=0;p<m.length&&!l;p++)l=m[p].type(t[c].type);l||u(t[c].type);var h=m[p-1].format;if(s(t[c].type)){var d=i.formatOutputUInt(f.slice(0,r));f=f.slice(r);for(var g=[],y=0;d>y;y++)g.push(h(e.slice(0,r))),e=e.slice(r);n.push(g)}else o.prefixedType("string")(t[c].type)?(f=f.slice(r),n.push(h(e.slice(0,r))),e=e.slice(r)):(n.push(h(e.slice(0,r))),e=e.slice(r))}),n},d=function(t){var e={};return t.forEach(function(t){var n=r.extractDisplayName(t.name),o=r.extractTypeName(t.name),a=function(){var e=Array.prototype.slice.call(arguments);return l(t.inputs,e)};void 0===e[n]&&(e[n]=a),e[n][o]=a}),e},g=function(t){var e={};return t.forEach(function(t){var n=r.extractDisplayName(t.name),o=r.extractTypeName(t.name),a=function(e){return h(t.outputs,e)};void 0===e[n]&&(e[n]=a),e[n][o]=a}),e},y=function(t){return n.sha3(n.fromAscii(t)).slice(0,2+2*a.ETH_SIGNATURE_LENGTH)},v=function(t){return n.sha3(n.fromAscii(t))};e.exports={inputParser:d,outputParser:g,formatInput:l,formatOutput:h,signatureFromAscii:y,eventSignatureFromAscii:v}},{"./const":2,"./formatters":8,"./types":14,"./utils":15,"./web3":17}],2:[function(t,e){var n=["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:n,ETH_BIGNUMBER_ROUNDING_MODE:{ROUNDING_MODE:BigNumber.ROUND_DOWN},ETH_POLLING_TIMEOUT:1e3}},{}],3:[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 s(n),c(n,t,e),f(n,t,e),l(n,t,e),n}var r=t("./web3"),o=t("./abi"),a=t("./utils"),i=t("./event"),u=function(t){r._currentContractAbi=t.abi,r._currentContractAddress=t.address,r._currentContractMethodName=t.method,r._currentContractMethodParams=t.params},s=function(t){t.call=function(e){return t._isTransaction=!1,t._options=e,t},t.sendTransaction=function(e){return t._isTransaction=!0,t._options=e,t},t.transact=function(e){return console.warn("myContract.transact() is deprecated please use myContract.sendTransaction() instead."),t.sendTransaction(e)},t._options={},["gas","gasPrice","value","from"].forEach(function(e){t[e]=function(n){return t._options[e]=n,t}})},c=function(t,e,n){var i=o.inputParser(e),s=o.outputParser(e);a.filterFunctions(e).forEach(function(c){var f=a.extractDisplayName(c.name),l=a.extractTypeName(c.name),p=function(){var a=Array.prototype.slice.call(arguments),p=o.signatureFromAscii(c.name),m=i[f][l].apply(null,a),h=t._options||{};h.to=n,h.data=p+m;var d=t._isTransaction===!0||t._isTransaction!==!1&&!c.constant,g=h.collapse!==!1;if(t._options={},t._isTransaction=null,d)return u({abi:e,address:n,method:c.name,params:a}),void r.eth.sendTransaction(h);var y=r.eth.call(h),v=s[f][l](y);return g&&(1===v.length?v=v[0]:0===v.length&&(v=null)),v};void 0===t[f]&&(t[f]=p),t[f][l]=p})},f=function(t,e,n){t.address=n,t._onWatchEventResult=function(t){var n=event.getMatchingEvent(a.filterEvents(e)),r=i.outputParser(n);return r(t)},Object.defineProperty(t,"topic",{get:function(){return a.filterEvents(e).map(function(t){return o.eventSignatureFromAscii(t.name)})}})},l=function(t,e,n){a.filterEvents(e).forEach(function(e){var u=function(){var t=Array.prototype.slice.call(arguments),a=o.eventSignatureFromAscii(e.name),u=i.inputParser(n,a,e),s=u.apply(null,t),c=function(t){var n=i.outputParser(e);return n(t)};return r.eth.filter(s,void 0,void 0,c)};u._isEvent=!0;var s=a.extractDisplayName(e.name),c=a.extractTypeName(e.name);void 0===t[s]&&(t[s]=u),t[s][c]=u})},p=function(t){return t instanceof Array&&1===arguments.length?n.bind(null,t):(console.warn("Initiating a contract like this is deprecated please use var MyContract = eth.contract(abi); new MyContract(address); instead."),new n(arguments[1],arguments[0]))};e.exports=p},{"./abi":1,"./event":6,"./utils":15,"./web3":17}],4:[function(t,e){var n=function(){return[{name:"put",call:"db_put"},{name:"get",call:"db_get"},{name:"putString",call:"db_putString"},{name:"getString",call:"db_getString"}]};e.exports={methods:n}},{}],5:[function(t,e){var n=t("./formatters"),r=function(t){return"string"==typeof t[0]?"eth_blockByHash":"eth_blockByNumber"},o=function(t){return"string"==typeof t[0]?"eth_transactionByHash":"eth_transactionByNumber"},a=function(t){return"string"==typeof t[0]?"eth_uncleByHash":"eth_uncleByNumber"},i=function(t){return"string"==typeof t[0]?"eth_transactionCountByHash":"eth_transactionCountByNumber"},u=function(t){return"string"==typeof t[0]?"eth_uncleCountByHash":"eth_uncleCountByNumber"},s=[{name:"getBalance",call:"eth_balanceAt",outputFormatter:n.convertToBigNumber},{name:"getState",call:"eth_stateAt"},{name:"getStorage",call:"eth_storageAt"},{name:"getData",call:"eth_codeAt"},{name:"getBlock",call:r,outputFormatter:n.outputBlockFormatter},{name:"getUncle",call:a,outputFormatter:n.outputBlockFormatter},{name:"getCompilers",call:"eth_compilers"},{name:"getBlockTransactionCount",call:i},{name:"getBlockUncleCount",call:u},{name:"getTransaction",call:o,outputFormatter:n.outputTransactionFormatter},{name:"getTransactionCount",call:"eth_countAt"},{name:"sendTransaction",call:"eth_transact",inputFormatter:n.inputTransactionFormatter},{name:"call",call:"eth_call"},{name:"compile.solidity",call:"eth_solidity"},{name:"compile.lll",call:"eth_lll"},{name:"compile.serpent",call:"eth_serpent"},{name:"flush",call:"eth_flush"},{name:"balanceAt",call:"eth_balanceAt",newMethod:"getBalance"},{name:"stateAt",call:"eth_stateAt",newMethod:"getState"},{name:"storageAt",call:"eth_storageAt",newMethod:"getStorage"},{name:"countAt",call:"eth_countAt",newMethod:"getTransactionCount"},{name:"codeAt",call:"eth_codeAt",newMethod:"getData"},{name:"transact",call:"eth_transact",newMethod:"sendTransaction"},{name:"block",call:r,newMethod:"getBlock"},{name:"transaction",call:o,newMethod:"getTransaction"},{name:"uncle",call:a,newMethod:"getUncle"},{name:"compilers",call:"eth_compilers",newMethod:"getCompilers"},{name:"solidity",call:"eth_solidity",newMethod:"compile.solidity"},{name:"lll",call:"eth_lll",newMethod:"compile.lll"},{name:"serpent",call:"eth_serpent",newMethod:"compile.serpent"},{name:"transactionCount",call:i,newMethod:"getBlockTransactionCount"},{name:"uncleCount",call:u,newMethod:"getBlockUncleCount"},{name:"logs",call:"eth_logs"}],c=[{name:"coinbase",getter:"eth_coinbase",setter:"eth_setCoinbase"},{name:"listening",getter:"eth_listening",setter:"eth_setListening"},{name:"mining",getter:"eth_mining",setter:"eth_setMining"},{name:"gasPrice",getter:"eth_gasPrice",outputFormatter:n.convertToBigNumber},{name:"accounts",getter:"eth_accounts"},{name:"peerCount",getter:"eth_peerCount"},{name:"defaultBlock",getter:"eth_defaultBlock",setter:"eth_setDefaultBlock"},{name:"blockNumber",getter:"eth_number"},{name:"number",getter:"eth_number",newProperty:"blockNumber"}];e.exports={methods:s,properties:c}},{"./formatters":8}],6:[function(t,e){var n=t("./abi"),r=t("./utils"),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]},i=function(t,e){return Object.keys(e).map(function(r){var i=[a(o(t.inputs,!0),r)],u=e[r];return u instanceof Array?u.map(function(t){return n.formatInput(i,[t])}):n.formatInput(i,[u])})},u=function(t,e,n){return function(r,o){var a=o||{};return a.address=t,a.topic=[],a.topic.push(e),r&&(a.topic=a.topic.concat(i(n,r))),a}},s=function(t,e,n){var r=e.slice(),o=n.slice();return t.reduce(function(t,e){var n;return n=e.indexed?r.splice(0,1)[0]:o.splice(0,1)[0],t[e.name]=n,t},{})},c=function(t){return function(e){var a={event:r.extractDisplayName(t.name),number:e.number,args:{}};if(e.topics=e.topic,!e.topic)return a;var i=o(t.inputs,!0),u="0x"+e.topic.slice(1,e.topic.length).map(function(t){return t.slice(2)}).join(""),c=n.formatOutput(i,u),f=o(t.inputs,!1),l=n.formatOutput(f,e.data);return a.args=s(t.inputs,c,l),a}},f=function(t,e){for(var r=0;r<t.length;r++){var o=n.eventSignatureFromAscii(t[r].name);if(o===e.topic[0])return t[r]}return void 0};e.exports={inputParser:u,outputParser:c,getMatchingEvent:f}},{"./abi":1,"./utils":15}],7:[function(t,e){var n=function(t){return!!t&&"function"==typeof t.newFilter&&"function"==typeof t.getLogs&&"function"==typeof t.uninstallFilter&&"function"==typeof t.startPolling&&"function"==typeof t.stopPolling},r=function(t){return"string"==typeof t?t:(t=t||{},t.topics&&console.warn('"topics" is deprecated, is "topic" instead'),{to:t.to,topic:t.topic,earliest:t.earliest,latest:t.latest,max:t.max,skip:t.skip,address:t.address})},o=function(t,e,o){if(!n(e))return void console.error("filter implemenation is invalid");t=r(t);var a=[],i=e.newFilter(t),u=function(t){t.forEach(function(t){t=o?o(t):t,a.forEach(function(e){e(t)})})};e.startPolling(i,u,e.uninstallFilter);var s=function(t){a.push(t)},c=function(){e.stopPolling(i),e.uninstallFilter(i),a=[]},f=function(){return e.getLogs(i)};return{watch:s,stopWatching:c,get:f,changed:function(){return console.warn("watch().changed() is deprecated please use filter().watch() instead."),s.apply(this,arguments)},arrived:function(){return console.warn("watch().arrived() is deprecated please use filter().watch() instead."),s.apply(this,arguments)},happened:function(){return console.warn("watch().happened() is deprecated please use filter().watch() instead."),s.apply(this,arguments)},uninstall:function(){return console.warn("watch().uninstall() is deprecated please use filter().stopWatching() instead."),c.apply(this,arguments)},messages:function(){return console.warn("watch().messages() is deprecated please use filter().get() instead."),f.apply(this,arguments)},logs:function(){return console.warn("watch().logs() is deprecated please use filter().get() instead."),f.apply(this,arguments)}}};e.exports=o},{}],8:[function(t,e){var n=t("./utils"),r=t("./const"),o=function(t,e,n){return new Array(e-t.length+1).join(n?n:"0")+t},a=function(t){var e=2*r.ETH_PADDING;return t instanceof BigNumber||"number"==typeof t?("number"==typeof t&&(t=new BigNumber(t)),BigNumber.config(r.ETH_BIGNUMBER_ROUNDING_MODE),t=t.round(),t.lessThan(0)&&(t=new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16).plus(t).plus(1)),t=t.toString(16)):t=0===t.indexOf("0x")?t.substr(2):"string"==typeof t?a(new BigNumber(t)):(+t).toString(16),o(t,e)},i=function(t){return n.fromAscii(t,r.ETH_PADDING).substr(2)},u=function(t){return"000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0")},s=function(t){return a(new BigNumber(t).times(new BigNumber(2).pow(128)))},c=function(t){return"1"===new BigNumber(t.substr(0,1),16).toString(2).substr(0,1)},f=function(t){return t=t||"0",c(t)?new BigNumber(t,16).minus(new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new BigNumber(t,16)},l=function(t){return t=t||"0",new BigNumber(t,16)},p=function(t){return f(t).dividedBy(new BigNumber(2).pow(128))},m=function(t){return l(t).dividedBy(new BigNumber(2).pow(128))},h=function(t){return"0x"+t},d=function(t){return"0000000000000000000000000000000000000000000000000000000000000001"===t?!0:!1},g=function(t){return n.toAscii(t)},y=function(t){return"0x"+t.slice(t.length-40,t.length)},v=function(t){return"string"==typeof t&&(t=t.replace("0x","")),t=t||"0",new BigNumber(t,16)},b=function(t){return t.code&&(t.data=t.code,delete t.code),t.endowment&&(t.value=t.endowment,delete t.endowment),["gasPrice","gas","value"].forEach(function(e){"string"==typeof t[e]?-1===t[e].indexOf("0x")&&(t[e]=n.fromDecimal(t[e])):"number"==typeof t[e]?t[e]=n.fromDecimal(t[e]):t[e]instanceof BigNumber&&(t[e]="0x"+t[e].toString(16))}),t},w=function(t){return t.gas=n.toDecimal(t.gas),t.gasPrice=n.toBigNumber(t.gasPrice),t.value=n.toBigNumber(t.value),t},_=function(t){return t.gasLimit=n.toDecimal(t.gasLimit),t.gasUsed=n.toDecimal(t.gasUsed),t.size=n.toDecimal(t.size),t.timestamp=n.toDecimal(t.timestamp),t.number=n.toDecimal(t.number),t.minGasPrice=n.toBigNumber(t.minGasPrice),t.difficulty=n.toBigNumber(t.difficulty),t.totalDifficulty=n.toBigNumber(t.totalDifficulty),t};e.exports={formatInputInt:a,formatInputString:i,formatInputBool:u,formatInputReal:s,formatOutputInt:f,formatOutputUInt:l,formatOutputReal:p,formatOutputUReal:m,formatOutputHash:h,formatOutputBool:d,formatOutputString:g,formatOutputAddress:y,convertToBigNumber:v,inputTransactionFormatter:b,outputTransactionFormatter:w,outputBlockFormatter:_}},{"./const":2,"./utils":15}],9:[function(t,e){var n=function(t){this.handlers=[],this.host=t||"http://localhost:8080"};n.prototype.send=function(t){var e=new XMLHttpRequest;e.open("POST",this.host,!1),e.send(JSON.stringify(t));var n=e.responseText;return 200===e.status?JSON.parse(n):void 0},e.exports=n},{}],10:[function(t,e){var n=1,r=function(t,e){return t||console.error("jsonrpc method should be specified!"),{jsonrpc:"2.0",method:t,params:e||[],id:n++}},o=function(t){return!!t&&!t.error&&"2.0"===t.jsonrpc&&"number"==typeof t.id&&void 0!==t.result},a=function(t){return t.map(function(t){return r(t.method,t.params)})};e.exports={toPayload:r,isValidResponse:o,toBatchPayload:a}},{}],11:[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},{}],12:[function(t,e){var n=t("./jsonrpc"),r=t("./const"),o=function(){var t,e=[],o=function(e){"function"==typeof e.inputFormatter&&(e.params=Array.prototype.map.call(e.params,function(t){return e.inputFormatter(t)}));var r=n.toPayload(e.method,e.params);if(!t)return console.error("provider is not set"),null;var o=t.send(r);return n.isValidResponse(o)?"function"==typeof e.outputFormatter?e.outputFormatter(o.result):o.result:(console.log(o),"object"==typeof o&&o.error&&o.error.message&&console.error(o.error.message),null)},a=function(e){t=e},i=function(t,n,r,o){e.push({data:t,id:n,callback:r,uninstall:o})},u=function(t){for(var n=e.length;n--;){var r=e[n];r.id===t&&e.splice(n,1)}},s=function(){e.forEach(function(t){t.uninstall(t.id)}),e=[]},c=function(){e.forEach(function(t){var e=o(t.data);e instanceof Array&&0!==e.length&&t.callback(e)}),setTimeout(c,r.ETH_POLLING_TIMEOUT)};return c(),{send:o,setProvider:a,startPolling:i,stopPolling:u,reset:s}};e.exports=o},{"./const":2,"./jsonrpc":10}],13:[function(t,e){var n=function(){return[{name:"post",call:"shh_post"},{name:"newIdentity",call:"shh_newIdentity"},{name:"hasIdentity",call:"shh_haveIdentity"},{name:"newGroup",call:"shh_newGroup"},{name:"addToGroup",call:"shh_addToGroup"},{name:"haveIdentity",call:"shh_haveIdentity",newMethod:"hasIdentity"}]};e.exports={methods:n}},{}],14:[function(t,e){var n=t("./formatters"),r=function(t){return function(e){return 0===e.indexOf(t)}},o=function(t){return function(e){return t===e}},a=function(){return[{type:r("uint"),format:n.formatInputInt},{type:r("int"),format:n.formatInputInt},{type:r("hash"),format:n.formatInputInt},{type:r("string"),format:n.formatInputString},{type:r("real"),format:n.formatInputReal},{type:r("ureal"),format:n.formatInputReal},{type:o("address"),format:n.formatInputInt},{type:o("bool"),format:n.formatInputBool}]},i=function(){return[{type:r("uint"),format:n.formatOutputUInt},{type:r("int"),format:n.formatOutputInt},{type:r("hash"),format:n.formatOutputHash},{type:r("string"),format:n.formatOutputString},{type:r("real"),format:n.formatOutputReal},{type:r("ureal"),format:n.formatOutputUReal},{type:o("address"),format:n.formatOutputAddress},{type:o("bool"),format:n.formatOutputBool}]};e.exports={prefixedType:r,namedType:o,inputTypes:a,outputTypes:i}},{"./formatters":8}],15:[function(t,e){var n=t("./const"),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"},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 o=parseInt(t.substr(n,2),16);if(0===o)break;e+=String.fromCharCode(o)}return e},i=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=i(t);n.length<2*e;)n+="00";return"0x"+n},s=function(t){var e=t.indexOf("(");return-1!==e?t.substr(0,e):t},c=function(t){var e=t.indexOf("(");return-1!==e?t.substr(e+1,t.length-1-(e+1)).replace(" ",""):""},f=function(t){return t.filter(function(t){return"function"===t.type})},l=function(t){return t.filter(function(t){return"event"===t.type})},p=function(t){for(var e="string"==typeof t?0===t.indexOf("0x")?parseInt(t.substr(2),16):parseInt(t):t,r=0,o=n.ETH_UNITS;e>3e3&&r<o.length-1;)e/=1e3,r++;for(var a=e.toString().length<e.toFixed(2).length?e.toString():e.toFixed(2),i=function(t,e,n){return e+","+n};;){var u=a;if(a=a.replace(/(\d)(\d\d\d[\.\,])/,i),u===a)break}return a+" "+o[r]},m=function(t){return"number"==typeof t||"string"==typeof t&&-1===t.indexOf("0x")?t:(t=t.length>2?t.substring(2):"0",new BigNumber(t,16).toString(10))},h=function(t){return"0x"+new BigNumber(t).toString(16)},d=function(t,e){e=e.toLowerCase();var n=!0;return r[e]?t?("string"==typeof t&&0===t.indexOf("0x")&&(n=!1,t=new BigNumber(t,16)),t instanceof BigNumber||(n=!1,t=new BigNumber(t.toString(10),10)),t=t.dividedBy(new BigNumber(r[e],10)),n?t:t.toString(10)):t:(console.warn("This unit doesn't exists, please use the one of the following units",r),t)},g=function(t,e){e=e.toLowerCase();var n=!0;return r[e]?t?("string"==typeof t&&0===t.indexOf("0x")&&(n=!1,t=new BigNumber(t,16)),t instanceof BigNumber||(n=!1,t=new BigNumber(t.toString(10),10)),t=t.times(new BigNumber(r[e],10)),n?t:t.toString(10)):t:(console.warn("This unit doesn't exists, please use the one of the following units",r),t)},y=function(t){return 0===t.indexOf("0x")&&42!==t.length?!1:-1===t.indexOf("0x")&&40!==t.length?!1:/^\w+$/.test(t)},v=function(t){return t instanceof BigNumber?t:(t&&(t="string"==typeof t&&0===t.indexOf("0x")?new BigNumber(t,16):new BigNumber(t.toString(10),10)),t)};e.exports={findIndex:o,toDecimal:m,fromDecimal:h,toAscii:a,fromAscii:u,extractDisplayName:s,extractTypeName:c,filterFunctions:f,filterEvents:l,toEth:p,toWei:g,fromWei:d,toBigNumber:v,isAddress:y}},{"./const":2}],16:[function(t,e){var n=function(){var t=function(t){return"string"==typeof t[0]?"eth_newFilterString":"eth_newFilter"};return[{name:"newFilter",call:t},{name:"uninstallFilter",call:"eth_uninstallFilter"},{name:"getLogs",call:"eth_filterLogs"}]},r=function(){return[{name:"newFilter",call:"shh_newFilter"},{name:"uninstallFilter",call:"shh_uninstallFilter"},{name:"getLogs",call:"shh_getMessages"}]};e.exports={eth:n,shh:r}},{}],17:[function(t,e){var n=t("./eth"),r=t("./db"),o=t("./shh"),a=t("./watches"),i=t("./filter"),u=t("./utils"),s=t("./requestmanager"),c=function(){return[{name:"sha3",call:"web3_sha3"}]},f=function(t,e){e.forEach(function(e){var n=e.name.split("."),r=function(){var t=Array.prototype.slice.call(arguments),n="function"==typeof e.call?e.call(t):e.call;return e.newMethod&&console.warn("This method is deprecated please use eth."+e.newMethod+"() instead."),g.manager.send({method:n,params:t,outputFormatter:e.outputFormatter,inputFormatter:e.inputFormatter})};n.length>1?(t[n[0]]||(t[n[0]]={}),t[n[0]][n[1]]=r):t[n[0]]=r})},l=function(t,e){e.forEach(function(e){var n={};n.get=function(){return e.newProperty&&console.warn("This property is deprecated please use eth."+e.newProperty+" instead."),g.manager.send({method:e.getter,outputFormatter:e.outputFormatter})},e.setter&&(n.set=function(t){return e.newProperty&&console.warn("This property is deprecated please use eth."+e.newProperty+" instead."),g.manager.send({method:e.setter,params:[t],inputFormatter:e.inputFormatter})}),n.enumerable=!e.newProperty,Object.defineProperty(t,e.name,n)})},p=function(t,e,n,r){g.manager.startPolling({method:t,params:[e]},e,n,r)},m=function(t){g.manager.stopPolling(t)},h={startPolling:p.bind(null,"eth_changed"),stopPolling:m},d={startPolling:p.bind(null,"shh_changed"),stopPolling:m},g={manager:s(),providers:{},setProvider:function(t){g.manager.setProvider(t)},reset:function(){g.manager.reset()},toAscii:u.toAscii,fromAscii:u.fromAscii,toDecimal:u.toDecimal,fromDecimal:u.fromDecimal,toBigNumber:u.toBigNumber,toEth:function(t){return console.warn("This method is deprecated please use eth.fromWei(BigNumberOrNumber, unit) instead."),u.toEth(t)},toWei:u.toWei,fromWei:u.fromWei,isAddress:u.isAddress,eth:{contractFromAbi:function(t){return console.warn("Initiating a contract like this is deprecated please use var MyContract = eth.contract(abi); new MyContract(address); instead."),function(e){e=e||"0xc6d9d2cd449a754c494264e1809c50e34d64562b";var n=g.eth.contract(e,t);return n.address=e,n}},filter:function(t,e,n,r){return t._isEvent?t(e,n):i(t,h,r)},watch:function(t,e,n,r){return console.warn("eth.watch() is deprecated please use eth.filter() instead."),this.filter(t,e,n,r)}},db:{},shh:{filter:function(t){return i(t,d)},watch:function(t){return console.warn("shh.watch() is deprecated please use shh.filter() instead."),this.filter(t)}}};f(g,c()),f(g.eth,n.methods),l(g.eth,n.properties),f(g.db,r.methods()),f(g.shh,o.methods()),f(h,a.eth()),f(d,a.shh()),e.exports=g},{"./db":4,"./eth":5,"./filter":7,"./requestmanager":12,"./shh":13,"./utils":15,"./watches":16}],web3:[function(t,e){var n=t("./lib/web3");n.providers.HttpSyncProvider=t("./lib/httpsync"),n.providers.QtSyncProvider=t("./lib/qtsync"),n.eth.contract=t("./lib/contract"),n.abi=t("./lib/abi"),e.exports=n},{"./lib/abi":1,"./lib/contract":3,"./lib/httpsync":9,"./lib/qtsync":11,"./lib/web3":17}]},{},["web3"]); |