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

add eth_listTransactions #123

Merged
merged 1 commit into from
Apr 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions subproviders/etherscan.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*
* 2) Via non-native methods
* - eth_getBalance
* - eth_listTransactions (non-standard)
*/

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

case 'eth_listTransactions':
const props = [
'address',
'startblock',
'endblock',
'sort',
'page',
'offset'
]

const params = {}
for (let i = 0, l = Math.min(payload.params.length, props.length); i < l; i++) {
params[props[i]] = payload.params[i]
}

etherscanXHR(true, proto, network, 'account', 'txlist', params, end)
return

case 'eth_call':
etherscanXHR(true, proto, network, 'proxy', 'eth_call', payload.params[0], end)
return
Expand Down