mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
feat(tor): add Tor endpoints for fiat-api and service-api (#2339)
This commit is contained in:
parent
1a5601f755
commit
73588071ba
2 changed files with 12 additions and 8 deletions
|
@ -5,8 +5,7 @@ import 'dart:convert';
|
|||
import 'package:cake_wallet/.secrets.g.dart' as secrets;
|
||||
|
||||
const _fiatApiClearNetAuthority = 'fiat-api.cakewallet.com';
|
||||
// const _fiatApiOnionAuthority = 'n4z7bdcmwk2oyddxvzaap3x2peqcplh3pzdy7tpkk5ejz5n4mhfvoxqd.onion';
|
||||
const _fiatApiOnionAuthority = _fiatApiClearNetAuthority;
|
||||
const _fiatApiOnionAuthority = 'kfkyguqtz5vcnbvar5pjgddkaeawbo4j3r4fj3e22k3tzqageplosiid.onion';
|
||||
const _fiatApiPath = '/v2/rates';
|
||||
|
||||
Future<double> _fetchPrice(String crypto, String fiat, bool torOnly) async {
|
||||
|
|
|
@ -1123,13 +1123,18 @@ abstract class DashboardViewModelBase with Store {
|
|||
Future<ServicesResponse> _getServicesStatus() async {
|
||||
try {
|
||||
if (isEnabledBulletinAction) {
|
||||
final uri = Uri.https(
|
||||
final res = await ProxyWrapper().get(
|
||||
clearnetUri: Uri.https(
|
||||
"service-api.cakewallet.com",
|
||||
"/v1/active-notices",
|
||||
{'key': secrets.fiatApiKey},
|
||||
),
|
||||
onionUri: Uri.http(
|
||||
"jpirgl4lrwzjgdqj2nsv3g7twhp2efzty5d3cnypktyczzqfc5qcwwyd.onion",
|
||||
"/v1/active-notices",
|
||||
{'key': secrets.fiatApiKey},
|
||||
),
|
||||
);
|
||||
|
||||
final res = await ProxyWrapper().get(clearnetUri: uri);
|
||||
if (res.statusCode < 200 || res.statusCode >= 300) {
|
||||
throw res.body;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue