File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,10 @@ const TESTNET_API_URL_MAP = {
2121 homestead : 'https://api.etherscan.io'
2222} ;
2323
24- module . exports = function ( chain ) {
24+ module . exports = function ( chain , timeout ) {
2525 var client = axios . create ( {
2626 baseURL : pickChainUrl ( chain ) ,
27- timeout : 3000
27+ timeout : timeout
2828 } ) ;
2929
3030 /**
Original file line number Diff line number Diff line change @@ -14,13 +14,18 @@ const account = require('./account');
1414 * @param {string } apiKey - (optional) Your Etherscan APIkey
1515 * @param {string } chain - (optional) Testnet chain keys [ropsten, rinkeby, kovan]
1616 */
17- module . exports = function ( apiKey , chain ) {
17+ module . exports = function ( apiKey , chain , timeout ) {
1818
1919 if ( ! apiKey ) {
2020 apiKey = 'YourApiKeyToken' ;
2121 }
2222
23- var getRequest = require ( './get-request' ) ( chain ) ;
23+
24+ if ( ! timeout ) {
25+ apiKey = 3000 ;
26+ }
27+
28+ var getRequest = require ( './get-request' ) ( chain , timeout ) ;
2429
2530 /** @lends module:etherscan/api */
2631 return {
You can’t perform that action at this time.
0 commit comments