mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-01 12:04:21 +01:00
privacy: only domain-anchored address resolvers; drop Cake endpoints
Address-field input no longer leaves the device except toward infrastructure implied by the typed name itself: - remove Twitter, Mastodon, Nostr, Yat, Unstoppable Domains, FIO, ThorChain-name, zcash.me, and Zano alias lookups (Nostr and FIO ran with no setting gate at all; Zano is not even a supported chain) - keep OpenAlias, BIP-353, .well-known, LNURL, and ENS, each toggleable in Settings -> Domain lookups - BTC fee/block/restore-height queries move from mempool.cakewallet.com to public mempool.space (also fixes two /api/v1 paths that 404 on standard mempool deployments) - PRIVACY.md updated to disclose the remaining flows (mempool.space, name lookups, opt-in silent payments and payjoin); issue templates and the translation prompt de-Caked
This commit is contained in:
@@ -1,55 +0,0 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:hash_wallet/entities/yat_record.dart';
|
||||
import 'package:cw_core/utils/proxy_wrapper.dart';
|
||||
|
||||
class YatService {
|
||||
static bool isDevMode = false;
|
||||
|
||||
static String get apiUrl =>
|
||||
YatService.isDevMode ? YatService.apiDevUrl : YatService.apiReleaseUrl;
|
||||
static const apiReleaseUrl = "https://a.y.at";
|
||||
static const apiDevUrl = 'https://a.yat.fyi';
|
||||
|
||||
static String lookupEmojiUrl(String emojiId) =>
|
||||
"$apiUrl/emoji_id/$emojiId/payment";
|
||||
|
||||
static const String MONERO_SUB_ADDRESS = '0x1002';
|
||||
static const String MONERO_STD_ADDRESS = '0x1001';
|
||||
static const tags = {
|
||||
'XMR': "$MONERO_STD_ADDRESS,$MONERO_SUB_ADDRESS",
|
||||
'BTC': '0x1003',
|
||||
'LTC': '0x1019'
|
||||
};
|
||||
|
||||
Future<List<YatRecord>> fetchYatAddress(String emojiId, String ticker) async {
|
||||
final formattedTicker = ticker.toUpperCase();
|
||||
final formattedEmojiId = emojiId.replaceAll(' ', '');
|
||||
final tag = tags[formattedTicker];
|
||||
final uri = Uri.parse(lookupEmojiUrl(formattedEmojiId)).replace(
|
||||
queryParameters: <String, dynamic>{
|
||||
"tags": tag
|
||||
});
|
||||
final yatRecords = <YatRecord>[];
|
||||
|
||||
try {
|
||||
final response = await ProxyWrapper().get(clearnetUri: uri);
|
||||
|
||||
final resBody = json.decode(response.body) as Map<String, dynamic>;
|
||||
final results = resBody["result"] as Map<dynamic, dynamic>;
|
||||
// Favour a subaddress over a standard address.
|
||||
final yatRecord = (
|
||||
results[MONERO_SUB_ADDRESS] ??
|
||||
results[MONERO_STD_ADDRESS] ??
|
||||
results[tag]) as Map<String, dynamic>;
|
||||
|
||||
if (yatRecord.isNotEmpty) {
|
||||
yatRecords.add(YatRecord.fromJson(yatRecord));
|
||||
}
|
||||
|
||||
return yatRecords;
|
||||
} catch (_) {
|
||||
return yatRecords;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user