2015-06-08 07:50:11 -05:00
|
|
|
package api
|
|
|
|
|
|
|
|
const Net_JS = `
|
2015-06-10 02:42:14 -05:00
|
|
|
web3._extend({
|
2015-06-08 07:50:11 -05:00
|
|
|
property: 'network',
|
|
|
|
methods:
|
|
|
|
[
|
2015-06-10 02:42:14 -05:00
|
|
|
new web3._extend.Method({
|
2015-06-09 09:06:51 -05:00
|
|
|
name: 'addPeer',
|
|
|
|
call: 'net_addPeer',
|
|
|
|
params: 1,
|
2015-06-10 02:42:14 -05:00
|
|
|
inputFormatter: [web3._extend.utils.formatInputString],
|
|
|
|
outputFormatter: web3._extend.formatters.formatOutputBool
|
2015-06-09 09:06:51 -05:00
|
|
|
}),
|
2015-06-10 02:42:14 -05:00
|
|
|
new web3._extend.Method({
|
2015-06-08 07:50:11 -05:00
|
|
|
name: 'getPeerCount',
|
|
|
|
call: 'net_peerCount',
|
|
|
|
params: 0,
|
|
|
|
inputFormatter: [],
|
2015-06-10 02:42:14 -05:00
|
|
|
outputFormatter: web3._extend.formatters.formatOutputString
|
2015-06-08 07:50:11 -05:00
|
|
|
})
|
|
|
|
],
|
|
|
|
properties:
|
|
|
|
[
|
2015-06-10 02:42:14 -05:00
|
|
|
new web3._extend.Property({
|
2015-06-08 07:50:11 -05:00
|
|
|
name: 'listening',
|
|
|
|
getter: 'net_listening',
|
2015-06-10 02:42:14 -05:00
|
|
|
outputFormatter: web3._extend.formatters.formatOutputBool
|
2015-06-08 07:50:11 -05:00
|
|
|
}),
|
2015-06-10 02:42:14 -05:00
|
|
|
new web3._extend.Property({
|
2015-06-08 07:50:11 -05:00
|
|
|
name: 'peerCount',
|
|
|
|
getter: 'net_peerCount',
|
2015-06-10 02:42:14 -05:00
|
|
|
outputFormatter: web3._extend.utils.toDecimal
|
2015-06-10 04:29:52 -05:00
|
|
|
}),
|
|
|
|
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
|
2015-06-08 07:50:11 -05:00
|
|
|
})
|
|
|
|
]
|
|
|
|
});
|
|
|
|
`
|