Skip to content
This repository was archived by the owner on Apr 22, 2024. It is now read-only.

Commit 7bd6430

Browse files
authored
Merge pull request #123 from mvayngrib/listtxs
add eth_listTransactions
2 parents 4564d12 + 250a6b3 commit 7bd6430

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

subproviders/etherscan.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
*
2020
* 2) Via non-native methods
2121
* - eth_getBalance
22+
* - eth_listTransactions (non-standard)
2223
*/
2324

2425
const xhr = process.browser ? require('xhr') : require('request')
@@ -99,6 +100,24 @@ function handlePayload(proto, network, payload, next, end){
99100
tag: payload.params[1] }, end)
100101
return
101102

103+
case 'eth_listTransactions':
104+
const props = [
105+
'address',
106+
'startblock',
107+
'endblock',
108+
'sort',
109+
'page',
110+
'offset'
111+
]
112+
113+
const params = {}
114+
for (let i = 0, l = Math.min(payload.params.length, props.length); i < l; i++) {
115+
params[props[i]] = payload.params[i]
116+
}
117+
118+
etherscanXHR(true, proto, network, 'account', 'txlist', params, end)
119+
return
120+
102121
case 'eth_call':
103122
etherscanXHR(true, proto, network, 'proxy', 'eth_call', payload.params[0], end)
104123
return

0 commit comments

Comments
 (0)