diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-10-28 20:40:50 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-10-28 20:42:55 +0800 |
commit | 3119be908c0d637bdc579f0a025da79efeae0cbe (patch) | |
tree | 76faa33cc950790e96433e07ef61fb1595cba981 | |
parent | 28d4250866cdd88f127635647583ec7c801f8b2c (diff) | |
download | dexon-3119be908c0d637bdc579f0a025da79efeae0cbe.tar dexon-3119be908c0d637bdc579f0a025da79efeae0cbe.tar.gz dexon-3119be908c0d637bdc579f0a025da79efeae0cbe.tar.bz2 dexon-3119be908c0d637bdc579f0a025da79efeae0cbe.tar.lz dexon-3119be908c0d637bdc579f0a025da79efeae0cbe.tar.xz dexon-3119be908c0d637bdc579f0a025da79efeae0cbe.tar.zst dexon-3119be908c0d637bdc579f0a025da79efeae0cbe.zip |
db and shh
-rw-r--r-- | main.js | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -83,6 +83,25 @@ ]; }; + var dbMethods = function () { + return [ + { name: 'put', call: 'put' }, + { name: 'get', call: 'get' }, + { name: 'putString', call: 'putString' }, + { name: 'getString', call: 'getString' } + ]; + }; + + var shhMethods = function () { + return [ + { name: 'post', call: 'post' }, + { name: 'newIdentity', call: 'newIdentity' }, + { name: 'haveIdentity', call: 'haveIdentity' }, + { name: 'newGroup', call: 'newGroup' }, + { name: 'addToGroup', call: 'addToGroup' } + ]; + }; + var setupMethods = function (obj, methods) { methods.forEach(function (method) { obj[method.name] = function () { @@ -187,6 +206,14 @@ }, }, + db: { + prototype: Object() + }, + + shh: { + prototype: Object() + }, + on: function(event, cb) { if(web3._events[event] === undefined) { web3._events[event] = []; @@ -229,6 +256,8 @@ var eth = web3.eth; setupMethods(eth, ethMethods()); setupProperties(eth, ethProperties()); + setupMethods(web3.db, dbMethods()); + setupMethods(web3.shh, shhMethods()); var ProviderManager = function() { this.queued = []; |