mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
new: add bor apis
This commit is contained in:
parent
b8c1fd2916
commit
236ec15f1b
2 changed files with 56 additions and 0 deletions
53
internal/web3ext/bor_ext.go
Normal file
53
internal/web3ext/bor_ext.go
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
package web3ext
|
||||
|
||||
// BorJs bor related apis
|
||||
const BorJs = `
|
||||
web3._extend({
|
||||
property: 'bor',
|
||||
methods: [
|
||||
new web3._extend.Method({
|
||||
name: 'getSnapshot',
|
||||
call: 'bor_getSnapshot',
|
||||
params: 1,
|
||||
inputFormatter: [null]
|
||||
}),
|
||||
new web3._extend.Method({
|
||||
name: 'getAuthor',
|
||||
call: 'bor_getAuthor',
|
||||
params: 1,
|
||||
inputFormatter: [null]
|
||||
}),
|
||||
new web3._extend.Method({
|
||||
name: 'getSnapshotAtHash',
|
||||
call: 'bor_getSnapshotAtHash',
|
||||
params: 1
|
||||
}),
|
||||
new web3._extend.Method({
|
||||
name: 'getSigners',
|
||||
call: 'bor_getSigners',
|
||||
params: 1,
|
||||
inputFormatter: [null]
|
||||
}),
|
||||
new web3._extend.Method({
|
||||
name: 'getSignersAtHash',
|
||||
call: 'bor_getSignersAtHash',
|
||||
params: 1
|
||||
}),
|
||||
new web3._extend.Method({
|
||||
name: 'getCurrentProposer',
|
||||
call: 'bor_getCurrentProposer',
|
||||
params: 0
|
||||
}),
|
||||
new web3._extend.Method({
|
||||
name: 'getCurrentValidators',
|
||||
call: 'bor_getCurrentValidators',
|
||||
params: 0
|
||||
}),
|
||||
new web3._extend.Method({
|
||||
name: 'getRootHash',
|
||||
call: 'bor_getRootHash',
|
||||
params: 2,
|
||||
}),
|
||||
]
|
||||
});
|
||||
`
|
||||
|
|
@ -34,6 +34,9 @@ var Modules = map[string]string{
|
|||
"txpool": TxpoolJs,
|
||||
"les": LESJs,
|
||||
"lespay": LESPayJs,
|
||||
|
||||
// Bor related apis
|
||||
"bor": BorJs,
|
||||
}
|
||||
|
||||
const ChequebookJs = `
|
||||
|
|
|
|||
Loading…
Reference in a new issue