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