Skip to content

Commit eb0b80d

Browse files
committed
fix: be able to receive ethereum related info
1 parent 2fee398 commit eb0b80d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
name: Build and deploy
22
on: [push, pull_request]
33
jobs:
4+
variables:
5+
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_DEV }}
6+
rules:
7+
- if: github.ref == 'refs/heads/master'
8+
variables:
9+
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_PROD }}
410
main:
511
runs-on: ubuntu-latest
612
env:
713
APP_NAME: wallet
14+
ETHERSCAN_API_KEY: $ETHERSCAN_API_KEY
815
WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
916
TOKEN_SALES_URL_MAINNET: ${{ secrets.TOKEN_SALES_URL_MAINNET }}
1017
TOKEN_SALES_URL_TESTNET: ${{ secrets.TOKEN_SALES_URL_TESTNET }}

src/protocols/ethereum/libs/EtherscanService.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class EtherscanService {
2828
apiUrl: string;
2929

3030
// TODO - update delay if we use paid API key
31-
freeVersionTimeDelay = ETHERSCAN_API_KEY ? 250 : 5300;
31+
freeVersionTimeDelay = 5000 + Math.floor(Math.random() * 1000);
3232

3333
constructor(apiUrl: string) {
3434
this.apiUrl = apiUrl;
@@ -40,7 +40,6 @@ export class EtherscanService {
4040
apikey: ETHERSCAN_API_KEY,
4141
}).toString();
4242

43-
// Without API key amount of calls are limited to one per every 5 seconds.
4443
// With free API key we can make 5 calls per second.
4544
// We're adding delays between calls to avoid getting empty results.
4645
// TODO: Use own node or paid version

0 commit comments

Comments
 (0)