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 f2a3447
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ jobs:
run: npm run build:android
- name: Build android apk
run: cd android && ./gradlew assembleDebug
- run: |
- name: Build other platforms
if: github.ref != 'refs/heads/master'
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_DEV }}
if: github.ref == 'refs/heads/master'
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_PROD }}
run: |
npm run build:web
npm run build:extension
npm run build-zip
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 f2a3447

Please sign in to comment.