plugeth/rpc/api/net_js.go

52 lines
1.1 KiB
Go
Raw Normal View History

2015-06-08 12:50:11 +00:00
package api
const Net_JS = `
2015-06-10 07:42:14 +00:00
web3._extend({
2015-06-08 12:50:11 +00:00
property: 'network',
methods:
[
2015-06-10 07:42:14 +00:00
new web3._extend.Method({
2015-06-09 14:06:51 +00:00
name: 'addPeer',
call: 'net_addPeer',
params: 1,
2015-06-10 07:42:14 +00:00
inputFormatter: [web3._extend.utils.formatInputString],
outputFormatter: web3._extend.formatters.formatOutputBool
2015-06-09 14:06:51 +00:00
}),
2015-06-10 07:42:14 +00:00
new web3._extend.Method({
2015-06-08 12:50:11 +00:00
name: 'id',
call: 'net_id',
params: 0,
inputFormatter: [],
2015-06-10 07:42:14 +00:00
outputFormatter: web3._extend.formatters.formatOutputString
2015-06-08 12:50:11 +00:00
}),
2015-06-10 07:42:14 +00:00
new web3._extend.Method({
2015-06-08 12:50:11 +00:00
name: 'getPeerCount',
call: 'net_peerCount',
params: 0,
inputFormatter: [],
2015-06-10 07:42:14 +00:00
outputFormatter: web3._extend.formatters.formatOutputString
2015-06-08 12:50:11 +00:00
}),
2015-06-10 07:42:14 +00:00
new web3._extend.Method({
2015-06-08 12:50:11 +00:00
name: 'peers',
call: 'net_peers',
params: 0,
inputFormatter: [],
outputFormatter: function(obj) { return obj; }
})
],
properties:
[
2015-06-10 07:42:14 +00:00
new web3._extend.Property({
2015-06-08 12:50:11 +00:00
name: 'listening',
getter: 'net_listening',
2015-06-10 07:42:14 +00:00
outputFormatter: web3._extend.formatters.formatOutputBool
2015-06-08 12:50:11 +00:00
}),
2015-06-10 07:42:14 +00:00
new web3._extend.Property({
2015-06-08 12:50:11 +00:00
name: 'peerCount',
getter: 'net_peerCount',
2015-06-10 07:42:14 +00:00
outputFormatter: web3._extend.utils.toDecimal
2015-06-08 12:50:11 +00:00
})
]
});
`