cleanup of javascript API

This commit is contained in:
Bas van Kervel
2015-06-10 11:29:52 +02:00
committed by Bas van Kervel
parent 87b62f75a7
commit bd38428f33
10 changed files with 91 additions and 89 deletions

View File

@ -12,26 +12,12 @@ web3._extend({
inputFormatter: [web3._extend.utils.formatInputString],
outputFormatter: web3._extend.formatters.formatOutputBool
}),
new web3._extend.Method({
name: 'id',
call: 'net_id',
params: 0,
inputFormatter: [],
outputFormatter: web3._extend.formatters.formatOutputString
}),
new web3._extend.Method({
name: 'getPeerCount',
call: 'net_peerCount',
params: 0,
inputFormatter: [],
outputFormatter: web3._extend.formatters.formatOutputString
}),
new web3._extend.Method({
name: 'peers',
call: 'net_peers',
params: 0,
inputFormatter: [],
outputFormatter: function(obj) { return obj; }
})
],
properties:
@ -45,6 +31,16 @@ web3._extend({
name: 'peerCount',
getter: 'net_peerCount',
outputFormatter: web3._extend.utils.toDecimal
}),
new web3._extend.Property({
name: 'peers',
getter: 'net_peers',
outputFormatter: function(obj) { return obj; }
}),
new web3._extend.Property({
name: 'version',
getter: 'net_version',
outputFormatter: web3._extend.formatters.formatOutputString
})
]
});