mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 14:16: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
|
||||
shortcuts := "var eth = web3.eth; var personal = web3.personal; "
|
||||
shortcuts := "var eth = web3.eth; "
|
||||
for _, apiName := range apiNames {
|
||||
if apiName == "web3" || apiName == "rpc" {
|
||||
continue // manually mapped or ignore
|
||||
|
|
|
|||
3040
jsre/ethereum_js.go
3040
jsre/ethereum_js.go
File diff suppressed because it is too large
Load diff
|
|
@ -19,15 +19,48 @@ package rpc
|
|||
var (
|
||||
// Holds geth specific RPC extends which can be used to extend web3
|
||||
WEB3Extensions = map[string]string{
|
||||
"txpool": TxPool_JS,
|
||||
"admin": Admin_JS,
|
||||
"eth": Eth_JS,
|
||||
"miner": Miner_JS,
|
||||
"debug": Debug_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 = `
|
||||
web3._extend({
|
||||
property: 'txpool',
|
||||
|
|
|
|||
Loading…
Reference in a new issue