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 = {
21
21
homestead : 'https://api.etherscan.io'
22
22
} ;
23
23
24
- module . exports = function ( chain ) {
24
+ module . exports = function ( chain , timeout ) {
25
25
var client = axios . create ( {
26
26
baseURL : pickChainUrl ( chain ) ,
27
- timeout : 3000
27
+ timeout : timeout
28
28
} ) ;
29
29
30
30
/**
Original file line number Diff line number Diff line change @@ -14,13 +14,18 @@ const account = require('./account');
14
14
* @param {string } apiKey - (optional) Your Etherscan APIkey
15
15
* @param {string } chain - (optional) Testnet chain keys [ropsten, rinkeby, kovan]
16
16
*/
17
- module . exports = function ( apiKey , chain ) {
17
+ module . exports = function ( apiKey , chain , timeout ) {
18
18
19
19
if ( ! apiKey ) {
20
20
apiKey = 'YourApiKeyToken' ;
21
21
}
22
22
23
- var getRequest = require ( './get-request' ) ( chain ) ;
23
+
24
+ if ( ! timeout ) {
25
+ apiKey = 3000 ;
26
+ }
27
+
28
+ var getRequest = require ( './get-request' ) ( chain , timeout ) ;
24
29
25
30
/** @lends module:etherscan/api */
26
31
return {
You can’t perform that action at this time.
0 commit comments