From 250a6b3f7929620d35b5c568d59a14cadd433ae5 Mon Sep 17 00:00:00 2001 From: Mark Vayngrib Date: Thu, 9 Mar 2017 00:11:06 -0500 Subject: [PATCH] add eth_listTransactions --- subproviders/etherscan.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/subproviders/etherscan.js b/subproviders/etherscan.js index 223b333b..23051a3c 100644 --- a/subproviders/etherscan.js +++ b/subproviders/etherscan.js @@ -19,6 +19,7 @@ * * 2) Via non-native methods * - eth_getBalance + * - eth_listTransactions (non-standard) */ const xhr = process.browser ? require('xhr') : require('request') @@ -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