aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/javascript.go
diff options
context:
space:
mode:
authorBas van Kervel <bas@ethdev.com>2016-03-14 16:38:54 +0800
committerBas van Kervel <bas@ethdev.com>2016-04-12 17:02:39 +0800
commitaa9fff3e68b1def0a9a22009c233150bf9ba481f (patch)
tree926c241574d6d80dfe4ffd6d2e447a9f7f84dc8b /rpc/javascript.go
parent7e02105672cda92889a78db864a5701d78f45eb2 (diff)
downloadgo-tangerine-aa9fff3e68b1def0a9a22009c233150bf9ba481f.tar
go-tangerine-aa9fff3e68b1def0a9a22009c233150bf9ba481f.tar.gz
go-tangerine-aa9fff3e68b1def0a9a22009c233150bf9ba481f.tar.bz2
go-tangerine-aa9fff3e68b1def0a9a22009c233150bf9ba481f.tar.lz
go-tangerine-aa9fff3e68b1def0a9a22009c233150bf9ba481f.tar.xz
go-tangerine-aa9fff3e68b1def0a9a22009c233150bf9ba481f.tar.zst
go-tangerine-aa9fff3e68b1def0a9a22009c233150bf9ba481f.zip
rpc: various fixes/enhancements
rpc: be less restrictive on the request id rpc: improved documentation console: upgrade web3.js to version 0.16.0 rpc: cache http connections rpc: rename wsDomains parameter to wsOrigins
Diffstat (limited to 'rpc/javascript.go')
-rw-r--r--rpc/javascript.go68
1 files changed, 17 insertions, 51 deletions
diff --git a/rpc/javascript.go b/rpc/javascript.go
index c4fa80c0b..64af8968f 100644
--- a/rpc/javascript.go
+++ b/rpc/javascript.go
@@ -19,48 +19,15 @@ package rpc
var (
// Holds geth specific RPC extends which can be used to extend web3
WEB3Extensions = map[string]string{
- "personal": Personal_JS,
- "txpool": TxPool_JS,
- "admin": Admin_JS,
- "eth": Eth_JS,
- "miner": Miner_JS,
- "debug": Debug_JS,
- "net": Net_JS,
+ "txpool": TxPool_JS,
+ "admin": Admin_JS,
+ "eth": Eth_JS,
+ "miner": Miner_JS,
+ "debug": Debug_JS,
+ "net": Net_JS,
}
)
-const Personal_JS = `
-web3._extend({
- property: 'personal',
- methods:
- [
- new web3._extend.Method({
- name: 'newAccount',
- call: 'personal_newAccount',
- params: 1,
- outputFormatter: web3._extend.utils.toAddress
- }),
- new web3._extend.Method({
- name: 'unlockAccount',
- call: 'personal_unlockAccount',
- params: 3,
- }),
- new web3._extend.Method({
- name: 'lockAccount',
- call: 'personal_lockAccount',
- params: 1
- })
- ],
- properties:
- [
- new web3._extend.Property({
- name: 'listAccounts',
- getter: 'personal_listAccounts'
- })
- ]
-});
-`
-
const TxPool_JS = `
web3._extend({
property: 'txpool',
@@ -124,22 +91,22 @@ web3._extend({
new web3._extend.Method({
name: 'startRPC',
call: 'admin_startRPC',
- params: 4
+ params: 4,
+ inputFormatter: [null, null, null, null]
}),
new web3._extend.Method({
name: 'stopRPC',
- call: 'admin_stopRPC',
- params: 0
+ call: 'admin_stopRPC'
}),
new web3._extend.Method({
name: 'startWS',
call: 'admin_startWS',
- params: 4
+ params: 4,
+ inputFormatter: [null, null, null, null]
}),
new web3._extend.Method({
name: 'stopWS',
- call: 'admin_stopWS',
- params: 0
+ call: 'admin_stopWS'
}),
new web3._extend.Method({
name: 'setGlobalRegistrar',
@@ -219,7 +186,7 @@ web3._extend({
name: 'sign',
call: 'eth_sign',
params: 2,
- inputFormatter: [web3._extend.utils.toAddress, null]
+ inputFormatter: [web3._extend.formatters.inputAddressFormatter, null]
}),
new web3._extend.Method({
name: 'resend',
@@ -414,19 +381,18 @@ web3._extend({
new web3._extend.Method({
name: 'start',
call: 'miner_start',
- params: 1
+ params: 1,
+ inputFormatter: [null]
}),
new web3._extend.Method({
name: 'stop',
- call: 'miner_stop',
- params: 1
+ call: 'miner_stop'
}),
new web3._extend.Method({
name: 'setEtherbase',
call: 'miner_setEtherbase',
params: 1,
- inputFormatter: [web3._extend.formatters.formatInputInt],
- outputFormatter: web3._extend.formatters.formatOutputBool
+ inputFormatter: [web3._extend.formatters.inputAddressFormatter]
}),
new web3._extend.Method({
name: 'setExtra',