mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 06:06:44 +00:00
Merge 2bcf348c73 into f460b0217f
This commit is contained in:
commit
ec4553ce5c
3 changed files with 174 additions and 2991 deletions
|
|
@ -196,7 +196,7 @@ func (js *jsre) apiBindings() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// load only supported API's in javascript runtime
|
// load only supported API's in javascript runtime
|
||||||
shortcuts := "var eth = web3.eth; var personal = web3.personal; "
|
shortcuts := "var eth = web3.eth; "
|
||||||
for _, apiName := range apiNames {
|
for _, apiName := range apiNames {
|
||||||
if apiName == "web3" || apiName == "rpc" {
|
if apiName == "web3" || apiName == "rpc" {
|
||||||
continue // manually mapped or ignore
|
continue // manually mapped or ignore
|
||||||
|
|
|
||||||
3036
jsre/ethereum_js.go
3036
jsre/ethereum_js.go
File diff suppressed because it is too large
Load diff
|
|
@ -19,15 +19,48 @@ package rpc
|
||||||
var (
|
var (
|
||||||
// Holds geth specific RPC extends which can be used to extend web3
|
// Holds geth specific RPC extends which can be used to extend web3
|
||||||
WEB3Extensions = map[string]string{
|
WEB3Extensions = map[string]string{
|
||||||
"txpool": TxPool_JS,
|
|
||||||
"admin": Admin_JS,
|
"admin": Admin_JS,
|
||||||
"eth": Eth_JS,
|
"eth": Eth_JS,
|
||||||
"miner": Miner_JS,
|
"miner": Miner_JS,
|
||||||
"debug": Debug_JS,
|
"debug": Debug_JS,
|
||||||
"net": Net_JS,
|
"net": Net_JS,
|
||||||
|
"personal": Personal_JS,
|
||||||
|
"txpool": TxPool_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 = `
|
const TxPool_JS = `
|
||||||
web3._extend({
|
web3._extend({
|
||||||
property: 'txpool',
|
property: 'txpool',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue