diff --git a/internal/web3ext/bor_ext.go b/internal/web3ext/bor_ext.go new file mode 100644 index 0000000000000000000000000000000000000000..b7fe9b4886af4ebe3348f5aa23573cec97aad3a4 --- /dev/null +++ b/internal/web3ext/bor_ext.go @@ -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, + }), + ] +}); +` diff --git a/internal/web3ext/web3ext.go b/internal/web3ext/web3ext.go index 77954bbbf0011aeb30181f146b4887fe296158d0..682c262fc1bbcb97b6e19f8932e5a239c892d613 100644 --- a/internal/web3ext/web3ext.go +++ b/internal/web3ext/web3ext.go @@ -34,6 +34,9 @@ var Modules = map[string]string{ "txpool": TxpoolJs, "les": LESJs, "lespay": LESPayJs, + + // Bor related apis + "bor": BorJs, } const ChequebookJs = `