Skip to content

Commit

Permalink
fix: be able to receive ethereum related info
Browse files Browse the repository at this point in the history
  • Loading branch information
CedrikNikita committed Nov 20, 2024
1 parent 2fee398 commit 8f039f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
name: Build and deploy
on: [push, pull_request]
jobs:
variables:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_DEV }}
rules:
- if: ${{ github.ref == 'refs/heads/master' }}
variables:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_PROD }}
main:
runs-on: ubuntu-latest
env:
APP_NAME: wallet
ETHERSCAN_API_KEY: $ETHERSCAN_API_KEY
WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
TOKEN_SALES_URL_MAINNET: ${{ secrets.TOKEN_SALES_URL_MAINNET }}
TOKEN_SALES_URL_TESTNET: ${{ secrets.TOKEN_SALES_URL_TESTNET }}
Expand Down
3 changes: 1 addition & 2 deletions src/protocols/ethereum/libs/EtherscanService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class EtherscanService {
apiUrl: string;

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

constructor(apiUrl: string) {
this.apiUrl = apiUrl;
Expand All @@ -40,7 +40,6 @@ export class EtherscanService {
apikey: ETHERSCAN_API_KEY,
}).toString();

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

0 comments on commit 8f039f6

Please sign in to comment.