Add `fiatApiKey` (#858)

Justin Ehrenhofer committed Mar 31, 2023 at 13:22 UTC 7cd4e6583c6c5d1980762ccaf699f78ffb5fd2f6
3 files changed +7 -1
.github/workflows/pr_test_build.yml
+1
@@ -114,6 +114,7 @@ jobs:
114 echo "const trocadorApiKey = '${{ secrets.TROCADOR_API_KEY }}';" >> lib/.secrets.g.dart
115 echo "const trocadorExchangeMarkup = '${{ secrets.TROCADOR_EXCHANGE_MARKUP }}';" >> lib/.secrets.g.dart
116 echo "const anonPayReferralCode = '${{ secrets.ANON_PAY_REFERRAL_CODE }}';" >> lib/.secrets.g.dart
117 + echo "const fiatApiKey = '${{ secrets.FIAT_API_KEY }}';" >> lib/.secrets.g.dart
118
119 - name: Rename app
120 run: echo -e "id=com.cakewallet.test\nname=$GITHUB_HEAD_REF" > /opt/android/cake_wallet/android/app.properties
lib/core/fiat_conversion_service.dart
+3
@@ -3,6 +3,8 @@ import 'package:cake_wallet/entities/fiat_currency.dart';
3 import 'dart:convert';
4 import 'package:flutter/foundation.dart';
5 import 'package:http/http.dart';
6 +import 'package:cake_wallet/.secrets.g.dart' as secrets;
7 +
8
9 const _fiatApiClearNetAuthority = 'fiat-api.cakewallet.com';
10 const _fiatApiOnionAuthority = 'n4z7bdcmwk2oyddxvzaap3x2peqcplh3pzdy7tpkk5ejz5n4mhfvoxqd.onion';
@@ -17,6 +19,7 @@ Future<double> _fetchPrice(Map<String, dynamic> args) async {
19 'interval_count': '1',
20 'base': crypto.toString(),
21 'quote': fiat.toString(),
22 + 'key' : secrets.fiatApiKey,
23 };
24
25 double price = 0.0;
tool/utils/secret_key.dart
+3 -1
@@ -27,7 +27,9 @@ class SecretKey {
27 SecretKey('trocadorApiKey', () => ''),
28 SecretKey('trocadorExchangeMarkup', () => ''),
29 SecretKey('twitterBearerToken', () => ''),
30 - SecretKey('anonPayReferralCode', () => '')
30 + SecretKey('anonPayReferralCode', () => ''),
31 + SecretKey('fiatApiKey', () => '')
32 +
33 ];
34
35 final String name;