| 
									
										
										
										
											2014-11-05 19:46:01 +02:00
										 |  |  | /* | 
					
						
							| 
									
										
										
										
											2014-11-05 20:12:21 +02:00
										 |  |  |     This file is part of ethereum.js. | 
					
						
							| 
									
										
										
										
											2014-11-05 19:46:01 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-05 20:12:21 +02:00
										 |  |  |     ethereum.js is free software: you can redistribute it and/or modify | 
					
						
							|  |  |  |     it under the terms of the GNU Lesser General Public License as published by | 
					
						
							|  |  |  |     the Free Software Foundation, either version 3 of the License, or | 
					
						
							|  |  |  |     (at your option) any later version. | 
					
						
							| 
									
										
										
										
											2014-11-05 19:46:01 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-05 20:12:21 +02:00
										 |  |  |     ethereum.js is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |     but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  |     GNU Lesser General Public License for more details. | 
					
						
							| 
									
										
										
										
											2014-11-05 19:46:01 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-05 20:12:21 +02:00
										 |  |  |     You should have received a copy of the GNU Lesser General Public License | 
					
						
							|  |  |  |     along with ethereum.js.  If not, see <http://www.gnu.org/licenses/>.
 | 
					
						
							| 
									
										
										
										
											2014-11-05 19:46:01 +02:00
										 |  |  | */ | 
					
						
							| 
									
										
										
										
											2015-01-13 18:28:49 +01:00
										 |  |  | /** @file web3.js | 
					
						
							| 
									
										
										
										
											2014-11-11 10:30:21 +01:00
										 |  |  |  * @authors: | 
					
						
							|  |  |  |  *   Jeffrey Wilcke <jeff@ethdev.com> | 
					
						
							|  |  |  |  *   Marek Kotewicz <marek@ethdev.com> | 
					
						
							|  |  |  |  *   Marian Oancea <marian@ethdev.com> | 
					
						
							| 
									
										
										
										
											2014-12-22 01:13:49 +01:00
										 |  |  |  *   Gav Wood <g@ethdev.com> | 
					
						
							| 
									
										
										
										
											2014-11-11 10:30:21 +01:00
										 |  |  |  * @date 2014 | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2014-11-05 19:46:01 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-21 21:35:15 +01:00
										 |  |  | if (process.env.NODE_ENV !== 'build') { | 
					
						
							|  |  |  |     var BigNumber = require('bignumber.js'); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-31 13:54:39 +01:00
										 |  |  | var utils = require('./utils'); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-13 17:05:05 +01:00
										 |  |  | /// @returns an array of objects describing web3 api methods
 | 
					
						
							| 
									
										
										
										
											2014-12-22 01:13:49 +01:00
										 |  |  | var web3Methods = function () { | 
					
						
							|  |  |  |     return [ | 
					
						
							|  |  |  |     { name: 'sha3', call: 'web3_sha3' } | 
					
						
							|  |  |  |     ]; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-13 17:05:05 +01:00
										 |  |  | /// @returns an array of objects describing web3.eth api methods
 | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  | var ethMethods = function () { | 
					
						
							|  |  |  |     var blockCall = function (args) { | 
					
						
							|  |  |  |         return typeof args[0] === "string" ? "eth_blockByHash" : "eth_blockByNumber"; | 
					
						
							| 
									
										
										
										
											2014-11-05 19:46:01 +02:00
										 |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  |     var transactionCall = function (args) { | 
					
						
							| 
									
										
										
										
											2014-12-22 01:13:49 +01:00
										 |  |  |         return typeof args[0] === "string" ? 'eth_transactionByHash' : 'eth_transactionByNumber'; | 
					
						
							| 
									
										
										
										
											2014-11-05 19:46:01 +02:00
										 |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  |     var uncleCall = function (args) { | 
					
						
							| 
									
										
										
										
											2014-12-22 01:13:49 +01:00
										 |  |  |         return typeof args[0] === "string" ? 'eth_uncleByHash' : 'eth_uncleByNumber'; | 
					
						
							| 
									
										
										
										
											2014-11-05 19:46:01 +02:00
										 |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  |     var methods = [ | 
					
						
							|  |  |  |     { name: 'balanceAt', call: 'eth_balanceAt' }, | 
					
						
							|  |  |  |     { name: 'stateAt', call: 'eth_stateAt' }, | 
					
						
							| 
									
										
										
										
											2014-11-13 18:29:31 +01:00
										 |  |  |     { name: 'storageAt', call: 'eth_storageAt' }, | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  |     { name: 'countAt', call: 'eth_countAt'}, | 
					
						
							|  |  |  |     { name: 'codeAt', call: 'eth_codeAt' }, | 
					
						
							|  |  |  |     { name: 'transact', call: 'eth_transact' }, | 
					
						
							|  |  |  |     { name: 'call', call: 'eth_call' }, | 
					
						
							|  |  |  |     { name: 'block', call: blockCall }, | 
					
						
							|  |  |  |     { name: 'transaction', call: transactionCall }, | 
					
						
							|  |  |  |     { name: 'uncle', call: uncleCall }, | 
					
						
							| 
									
										
										
										
											2014-11-12 20:39:13 +01:00
										 |  |  |     { name: 'compilers', call: 'eth_compilers' }, | 
					
						
							| 
									
										
										
										
											2015-01-24 16:46:46 -08:00
										 |  |  |     { name: 'flush', call: 'eth_flush' }, | 
					
						
							| 
									
										
										
										
											2014-11-12 20:39:13 +01:00
										 |  |  |     { name: 'lll', call: 'eth_lll' }, | 
					
						
							| 
									
										
										
										
											2014-11-17 15:46:46 +01:00
										 |  |  |     { name: 'solidity', call: 'eth_solidity' }, | 
					
						
							| 
									
										
										
										
											2014-11-18 13:59:17 +01:00
										 |  |  |     { name: 'serpent', call: 'eth_serpent' }, | 
					
						
							|  |  |  |     { name: 'logs', call: 'eth_logs' } | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  |     ]; | 
					
						
							|  |  |  |     return methods; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-13 17:05:05 +01:00
										 |  |  | /// @returns an array of objects describing web3.eth api properties
 | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  | var ethProperties = function () { | 
					
						
							|  |  |  |     return [ | 
					
						
							|  |  |  |     { 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' }, | 
					
						
							|  |  |  |     { name: 'accounts', getter: 'eth_accounts' }, | 
					
						
							|  |  |  |     { name: 'peerCount', getter: 'eth_peerCount' }, | 
					
						
							|  |  |  |     { name: 'defaultBlock', getter: 'eth_defaultBlock', setter: 'eth_setDefaultBlock' }, | 
					
						
							|  |  |  |     { name: 'number', getter: 'eth_number'} | 
					
						
							|  |  |  |     ]; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-13 17:05:05 +01:00
										 |  |  | /// @returns an array of objects describing web3.db api methods
 | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  | var dbMethods = function () { | 
					
						
							|  |  |  |     return [ | 
					
						
							|  |  |  |     { name: 'put', call: 'db_put' }, | 
					
						
							|  |  |  |     { name: 'get', call: 'db_get' }, | 
					
						
							|  |  |  |     { name: 'putString', call: 'db_putString' }, | 
					
						
							|  |  |  |     { name: 'getString', call: 'db_getString' } | 
					
						
							|  |  |  |     ]; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-13 17:05:05 +01:00
										 |  |  | /// @returns an array of objects describing web3.shh api methods
 | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  | var shhMethods = function () { | 
					
						
							|  |  |  |     return [ | 
					
						
							|  |  |  |     { name: 'post', call: 'shh_post' }, | 
					
						
							|  |  |  |     { name: 'newIdentity', call: 'shh_newIdentity' }, | 
					
						
							|  |  |  |     { name: 'haveIdentity', call: 'shh_haveIdentity' }, | 
					
						
							|  |  |  |     { name: 'newGroup', call: 'shh_newGroup' }, | 
					
						
							|  |  |  |     { name: 'addToGroup', call: 'shh_addToGroup' } | 
					
						
							|  |  |  |     ]; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-13 17:05:05 +01:00
										 |  |  | /// @returns an array of objects describing web3.eth.watch api methods
 | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  | var ethWatchMethods = function () { | 
					
						
							|  |  |  |     var newFilter = function (args) { | 
					
						
							|  |  |  |         return typeof args[0] === 'string' ? 'eth_newFilterString' : 'eth_newFilter'; | 
					
						
							| 
									
										
										
										
											2014-11-05 19:46:01 +02:00
										 |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  |     return [ | 
					
						
							|  |  |  |     { name: 'newFilter', call: newFilter }, | 
					
						
							|  |  |  |     { name: 'uninstallFilter', call: 'eth_uninstallFilter' }, | 
					
						
							| 
									
										
										
										
											2014-11-18 13:59:17 +01:00
										 |  |  |     { name: 'getMessages', call: 'eth_filterLogs' } | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  |     ]; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-13 17:05:05 +01:00
										 |  |  | /// @returns an array of objects describing web3.shh.watch api methods
 | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  | var shhWatchMethods = function () { | 
					
						
							|  |  |  |     return [ | 
					
						
							|  |  |  |     { name: 'newFilter', call: 'shh_newFilter' }, | 
					
						
							|  |  |  |     { name: 'uninstallFilter', call: 'shh_uninstallFilter' }, | 
					
						
							| 
									
										
										
										
											2015-01-12 18:34:37 +01:00
										 |  |  |     { name: 'getMessages', call: 'shh_getMessages' } | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  |     ]; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-13 17:05:05 +01:00
										 |  |  | /// creates methods in a given object based on method description on input
 | 
					
						
							|  |  |  | /// setups api calls for these methods
 | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  | var setupMethods = function (obj, methods) { | 
					
						
							|  |  |  |     methods.forEach(function (method) { | 
					
						
							|  |  |  |         obj[method.name] = function () { | 
					
						
							| 
									
										
										
										
											2015-01-21 20:29:02 +01:00
										 |  |  |             var args = Array.prototype.slice.call(arguments); | 
					
						
							|  |  |  |             var call = typeof method.call === 'function' ? method.call(args) : method.call; | 
					
						
							| 
									
										
										
										
											2015-01-21 21:22:05 +01:00
										 |  |  |             return web3.provider.send({ | 
					
						
							| 
									
										
										
										
											2015-02-03 21:43:39 +01:00
										 |  |  |                 method: call, | 
					
						
							|  |  |  |                 params: args | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  |             }); | 
					
						
							| 
									
										
										
										
											2014-11-05 19:46:01 +02:00
										 |  |  |         }; | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  |     }); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-13 17:05:05 +01:00
										 |  |  | /// creates properties in a given object based on properties description on input
 | 
					
						
							|  |  |  | /// setups api calls for these properties
 | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  | var setupProperties = function (obj, properties) { | 
					
						
							|  |  |  |     properties.forEach(function (property) { | 
					
						
							|  |  |  |         var proto = {}; | 
					
						
							|  |  |  |         proto.get = function () { | 
					
						
							| 
									
										
										
										
											2015-01-21 21:22:05 +01:00
										 |  |  |             return web3.provider.send({ | 
					
						
							| 
									
										
										
										
											2015-02-03 21:43:39 +01:00
										 |  |  |                 method: property.getter | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  |             }); | 
					
						
							|  |  |  |         }; | 
					
						
							| 
									
										
										
										
											2015-01-21 21:22:05 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  |         if (property.setter) { | 
					
						
							|  |  |  |             proto.set = function (val) { | 
					
						
							| 
									
										
										
										
											2015-01-21 21:22:05 +01:00
										 |  |  |                 return web3.provider.send({ | 
					
						
							| 
									
										
										
										
											2015-02-03 21:43:39 +01:00
										 |  |  |                     method: property.setter, | 
					
						
							|  |  |  |                     params: [val] | 
					
						
							| 
									
										
										
										
											2014-11-05 19:46:01 +02:00
										 |  |  |                 }); | 
					
						
							|  |  |  |             }; | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  |         } | 
					
						
							|  |  |  |         Object.defineProperty(obj, property.name, proto); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-13 17:05:05 +01:00
										 |  |  | /// setups web3 object, and it's in-browser executed methods
 | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  | var web3 = { | 
					
						
							|  |  |  |     _callbacks: {}, | 
					
						
							|  |  |  |     _events: {}, | 
					
						
							|  |  |  |     providers: {}, | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-14 10:50:34 +01:00
										 |  |  |     /// @returns ascii string representation of hex value prefixed with 0x
 | 
					
						
							| 
									
										
										
										
											2015-01-31 13:54:39 +01:00
										 |  |  |     toAscii: utils.toAscii, | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-14 10:50:34 +01:00
										 |  |  |     /// @returns hex representation (prefixed by 0x) of ascii string
 | 
					
						
							| 
									
										
										
										
											2015-01-31 13:54:39 +01:00
										 |  |  |     fromAscii: utils.fromAscii, | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-14 10:50:34 +01:00
										 |  |  |     /// @returns decimal representaton of hex value prefixed by 0x
 | 
					
						
							| 
									
										
										
										
											2014-12-22 01:13:49 +01:00
										 |  |  |     toDecimal: function (val) { | 
					
						
							| 
									
										
										
										
											2015-01-27 15:20:22 +01:00
										 |  |  |         // remove 0x and place 0, if it's required
 | 
					
						
							|  |  |  |         val = val.length > 2 ? val.substring(2) : "0"; | 
					
						
							|  |  |  |         return (new BigNumber(val, 16).toString(10)); | 
					
						
							| 
									
										
										
										
											2014-12-22 01:13:49 +01:00
										 |  |  |     }, | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-14 10:50:34 +01:00
										 |  |  |     /// @returns hex representation (prefixed by 0x) of decimal value
 | 
					
						
							| 
									
										
										
										
											2014-12-22 01:13:49 +01:00
										 |  |  |     fromDecimal: function (val) { | 
					
						
							| 
									
										
										
										
											2015-01-21 21:35:15 +01:00
										 |  |  |         return "0x" + (new BigNumber(val).toString(16)); | 
					
						
							| 
									
										
										
										
											2014-12-22 01:13:49 +01:00
										 |  |  |     }, | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-14 10:50:34 +01:00
										 |  |  |     /// used to transform value/string to eth string
 | 
					
						
							| 
									
										
										
										
											2015-02-02 17:40:05 +01:00
										 |  |  |     toEth: utils.toEth, | 
					
						
							| 
									
										
										
										
											2014-12-22 01:13:49 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-14 10:50:34 +01:00
										 |  |  |     /// eth object prototype
 | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  |     eth: { | 
					
						
							| 
									
										
										
										
											2015-01-25 13:43:36 -08:00
										 |  |  |         contractFromAbi: function (abi) { | 
					
						
							|  |  |  |             return function(addr) { | 
					
						
							|  |  |  |                 // Default to address of Config. TODO: rremove prior to genesis.
 | 
					
						
							|  |  |  |                 addr = addr || '0xc6d9d2cd449a754c494264e1809c50e34d64562b'; | 
					
						
							|  |  |  |                 var ret = web3.eth.contract(addr, abi); | 
					
						
							|  |  |  |                 ret.address = addr; | 
					
						
							|  |  |  |                 return ret; | 
					
						
							|  |  |  |             }; | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2015-01-31 01:30:19 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |         /// @param filter may be a string, object or event
 | 
					
						
							| 
									
										
										
										
											2015-01-31 16:01:41 +01:00
										 |  |  |         /// @param indexed is optional, this is an object with optional event indexed params
 | 
					
						
							|  |  |  |         /// @param options is optional, this is an object with optional event options ('max'...)
 | 
					
						
							|  |  |  |         watch: function (filter, indexed, options) { | 
					
						
							| 
									
										
										
										
											2015-01-31 04:09:48 +01:00
										 |  |  |             if (filter._isEvent) { | 
					
						
							| 
									
										
										
										
											2015-01-31 16:01:41 +01:00
										 |  |  |                 return filter(indexed, options); | 
					
						
							| 
									
										
										
										
											2015-01-31 04:09:48 +01:00
										 |  |  |             } | 
					
						
							|  |  |  |             return new web3.filter(filter, ethWatch); | 
					
						
							| 
									
										
										
										
											2014-11-05 19:46:01 +02:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  |     }, | 
					
						
							| 
									
										
										
										
											2014-11-05 19:46:01 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-14 10:50:34 +01:00
										 |  |  |     /// db object prototype
 | 
					
						
							|  |  |  |     db: {}, | 
					
						
							| 
									
										
										
										
											2014-11-05 19:46:01 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-14 10:50:34 +01:00
										 |  |  |     /// shh object prototype
 | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  |     shh: { | 
					
						
							| 
									
										
										
										
											2015-01-31 01:30:19 +01:00
										 |  |  |          | 
					
						
							|  |  |  |         /// @param filter may be a string, object or event
 | 
					
						
							|  |  |  |         watch: function (filter, indexed) { | 
					
						
							| 
									
										
										
										
											2015-01-31 04:09:48 +01:00
										 |  |  |             return new web3.filter(filter, shhWatch); | 
					
						
							| 
									
										
										
										
											2014-11-05 19:46:01 +02:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  |     }, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-13 17:05:05 +01:00
										 |  |  | /// setups all api methods
 | 
					
						
							| 
									
										
										
										
											2014-12-22 01:13:49 +01:00
										 |  |  | setupMethods(web3, web3Methods()); | 
					
						
							| 
									
										
										
										
											2014-11-14 13:11:47 +01:00
										 |  |  | setupMethods(web3.eth, ethMethods()); | 
					
						
							|  |  |  | setupProperties(web3.eth, ethProperties()); | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  | setupMethods(web3.db, dbMethods()); | 
					
						
							|  |  |  | setupMethods(web3.shh, shhMethods()); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | var ethWatch = { | 
					
						
							|  |  |  |     changed: 'eth_changed' | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2015-01-13 17:05:05 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  | setupMethods(ethWatch, ethWatchMethods()); | 
					
						
							| 
									
										
										
										
											2015-01-13 17:05:05 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  | var shhWatch = { | 
					
						
							|  |  |  |     changed: 'shh_changed' | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2015-01-13 17:05:05 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-11-11 11:46:46 +01:00
										 |  |  | setupMethods(shhWatch, shhWatchMethods()); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | web3.setProvider = function(provider) { | 
					
						
							|  |  |  |     web3.provider.set(provider); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-01-16 15:49:36 +01:00
										 |  |  | module.exports = web3; | 
					
						
							|  |  |  | 
 |