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

Commit

Permalink
Merge pull request #123 from mvayngrib/listtxs
Browse files Browse the repository at this point in the history
add eth_listTransactions
  • Loading branch information
FlySwatter authored Apr 20, 2017
2 parents 4564d12 + 250a6b3 commit 7bd6430
Showing 1 changed file with 19 additions and 0 deletions.
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

0 comments on commit 7bd6430

Please sign in to comment.