What changed, and why it matters
This commit simply deletes four unused files that handled Tezos cryptocurrency data fetching and account/transaction model classes. There is no indication this fixes or introduces a security problem; it is routine code cleanup.
No security action required. Treat as normal maintenance cleanup. Verify downstream code no longer imports these deleted files to avoid build errors.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit removes four Dart files under lib/services/coins/tezos/api/: tezos_account.dart, tezos_api.dart, tezos_rpc_api.dart, and tezos_transaction.dart. These files contained model classes and HTTP/RPC API wrappers for Tezos. The diff shows only deletions and no functional changes, bug fixes, or security-related modifications. No references indicate these files were involved in a vulnerability or disclosure.
Changed components
lib/services/coins/tezos/api/tezos_account.dartlib/services/coins/tezos/api/tezos_api.dartlib/services/coins/tezos/api/tezos_rpc_api.dartlib/services/coins/tezos/api/tezos_transaction.dartInspect captured patch +0 / −311
diff --git a/lib/services/coins/tezos/api/tezos_account.dart b/lib/services/coins/tezos/api/tezos_account.dart
deleted file mode 100644
index 8bf9a9f..0000000
--- a/lib/services/coins/tezos/api/tezos_account.dart
+++ /dev/null
@@ -1,58 +0,0 @@
-class TezosAccount {
- final int id;
- final String type;
- final String address;
- final String? publicKey;
- final bool revealed;
- final int balance;
- final int counter;
-
- TezosAccount({
- required this.id,
- required this.type,
- required this.address,
- required this.publicKey,
- required this.revealed,
- required this.balance,
- required this.counter,
- });
-
- TezosAccount copyWith({
- int? id,
- String? type,
- String? address,
- String? publicKey,
- bool? revealed,
- int? balance,
- int? counter,
- }) {
- return TezosAccount(
- id: id ?? this.id,
- type: type ?? this.type,
- address: address ?? this.address,
- publicKey: publicKey ?? this.publicKey,
- revealed: revealed ?? this.revealed,
- balance: balance ?? this.balance,
- counter: counter ?? this.counter,
- );
- }
-
- factory TezosAccount.fromMap(Map<String, dynamic> map) {
- return TezosAccount(
- id: map['id'] as int,
- type: map['type'] as String,
- address: map['address'] as String,
- publicKey: map['publicKey'] as String?,
- revealed: map['revealed'] as bool,
- balance: map['balance'] as int,
- counter: map['counter'] as int,
- );
- }
-
- @override
- String toString() {
- return 'UserData{id: $id, type: $type, address: $address, '
- 'publicKey: $publicKey, revealed: $revealed,'
- ' balance: $balance, counter: $counter}';
- }
-}
diff --git a/lib/services/coins/tezos/api/tezos_api.dart b/lib/services/coins/tezos/api/tezos_api.dart
deleted file mode 100644
index a85e6b2..0000000
--- a/lib/services/coins/tezos/api/tezos_api.dart
+++ /dev/null
@@ -1,131 +0,0 @@
-import 'dart:convert';
-
-import '../../../../app_config.dart';
-import '../../../../networking/http.dart';
-import '../../../../utilities/logger.dart';
-import '../../../../utilities/prefs.dart';
-import '../../../tor_service.dart';
-import 'tezos_account.dart';
-import 'tezos_transaction.dart';
-
-abstract final class TezosAPI {
- static final HTTP _client = HTTP();
- static const String _baseURL = 'https://api.tzkt.io';
-
- static Future<int> getCounter(String address) async {
- try {
- final uriString = "$_baseURL/v1/accounts/$address/counter";
- final response = await _client.get(
- url: Uri.parse(uriString),
- headers: {'Content-Type': 'application/json'},
- proxyInfo: !AppConfig.hasFeature(AppFeature.tor)
- ? null
- : Prefs.instance.useTor
- ? TorService.sharedInstance.getProxyInfo()
- : null,
- );
-
- final result = jsonDecode(response.body);
- return result as int;
- } catch (e, s) {
- Logging.instance.e(
- "Error occurred in TezosAPI while getting counter for $address: ",
- error: e,
- stackTrace: s,
- );
- rethrow;
- }
- }
-
- static Future<TezosAccount> getAccount(
- String address, {
- String type = "user",
- }) async {
- try {
- final uriString = "$_baseURL/v1/accounts/$address?legacy=false";
- final response = await _client.get(
- url: Uri.parse(uriString),
- headers: {'Content-Type': 'application/json'},
- proxyInfo: !AppConfig.hasFeature(AppFeature.tor)
- ? null
- : Prefs.instance.useTor
- ? TorService.sharedInstance.getProxyInfo()
- : null,
- );
-
- final result = jsonDecode(response.body) as Map;
-
- final account = TezosAccount.fromMap(Map<String, dynamic>.from(result));
-
- return account;
- } catch (e, s) {
- Logging.instance.e(
- "Error occurred in TezosAPI while getting account for $address: ",
- error: e,
- stackTrace: s,
- );
- rethrow;
- }
- }
-
- static Future<List<TezosTransaction>> getTransactions(String address) async {
- try {
- final transactionsCall =
- "$_baseURL/v1/accounts/$address/operations?type=transaction";
-
- final response = await _client.get(
- url: Uri.parse(transactionsCall),
- headers: {'Content-Type': 'application/json'},
- proxyInfo: !AppConfig.hasFeature(AppFeature.tor)
- ? null
- : Prefs.instance.useTor
- ? TorService.sharedInstance.getProxyInfo()
- : null,
- );
-
- final result = jsonDecode(response.body) as List;
-
- final List<TezosTransaction> txs = [];
- for (final tx in result) {
- if (tx["type"] == "transaction") {
- final theTx = TezosTransaction(
- id: tx["id"] as int,
- hash: tx["hash"] as String,
- type: tx["type"] as String,
- height: tx["level"] as int,
- timestamp:
- DateTime.parse(
- tx["timestamp"].toString(),
- ).toUtc().millisecondsSinceEpoch ~/
- 1000,
- cycle: tx["cycle"] as int?,
- counter: tx["counter"] as int,
- opN: tx["op_n"] as int?,
- opP: tx["op_p"] as int?,
- status: tx["status"] as String,
- gasLimit: tx["gasLimit"] as int,
- gasUsed: tx["gasUsed"] as int,
- storageLimit: tx["storageLimit"] as int?,
- amountInMicroTez: tx["amount"] as int,
- feeInMicroTez:
- (tx["bakerFee"] as int? ?? 0) +
- (tx["storageFee"] as int? ?? 0) +
- (tx["allocationFee"] as int? ?? 0),
- burnedAmountInMicroTez: tx["burned"] as int?,
- senderAddress: tx["sender"]["address"] as String,
- receiverAddress: tx["target"]["address"] as String,
- );
- txs.add(theTx);
- }
- }
- return txs;
- } catch (e, s) {
- Logging.instance.e(
- "Error occurred in TezosAPI while getting transactions for $address: ",
- error: e,
- stackTrace: s,
- );
- rethrow;
- }
- }
-}
diff --git a/lib/services/coins/tezos/api/tezos_rpc_api.dart b/lib/services/coins/tezos/api/tezos_rpc_api.dart
deleted file mode 100644
index 67316c2..0000000
--- a/lib/services/coins/tezos/api/tezos_rpc_api.dart
+++ /dev/null
@@ -1,79 +0,0 @@
-import 'dart:convert';
-
-import '../../../../app_config.dart';
-import '../../../../networking/http.dart';
-import '../../../../utilities/logger.dart';
-import '../../../../utilities/prefs.dart';
-import '../../../tor_service.dart';
-
-abstract final class TezosRpcAPI {
- static final HTTP _client = HTTP();
-
- static Future<BigInt?> getBalance({
- required ({String host, int port}) nodeInfo,
- required String address,
- }) async {
- try {
- final String balanceCall =
- "${nodeInfo.host}:${nodeInfo.port}/chains/main/blocks/head/context/contracts/$address/balance";
-
- final response = await _client.get(
- url: Uri.parse(balanceCall),
- headers: {'Content-Type': 'application/json'},
- proxyInfo: !AppConfig.hasFeature(AppFeature.tor)
- ? null
- : Prefs.instance.useTor
- ? TorService.sharedInstance.getProxyInfo()
- : null,
- );
-
- final balance = BigInt.parse(
- response.body.substring(1, response.body.length - 2),
- );
- return balance;
- } catch (e, s) {
- Logging.instance.e(
- "Error occurred in tezos_rpc_api.dart while getting balance for $address",
- error: e,
- stackTrace: s,
- );
- }
- return null;
- }
-
- static Future<int?> getChainHeight({
- required ({String host, int port}) nodeInfo,
- }) async {
- try {
- final api =
- "${nodeInfo.host}:${nodeInfo.port}/chains/main/blocks/head/header/shell";
-
- final response = await _client.get(
- url: Uri.parse(api),
- headers: {'Content-Type': 'application/json'},
- proxyInfo: !AppConfig.hasFeature(AppFeature.tor)
- ? null
- : Prefs.instance.useTor
- ? TorService.sharedInstance.getProxyInfo()
- : null,
- );
-
- final jsonParsedResponse = jsonDecode(response.body);
- return int.parse(jsonParsedResponse["level"].toString());
- } catch (e, s) {
- Logging.instance.e(
- "Error occurred in tezos_rpc_api.dart while getting chain height for tezos",
- error: e,
- stackTrace: s,
- );
- }
- return null;
- }
-
- static Future<bool> testNetworkConnection({
- required ({String host, int port}) nodeInfo,
- }) async {
- final result = await getChainHeight(nodeInfo: nodeInfo);
- return result != null;
- }
-}
diff --git a/lib/services/coins/tezos/api/tezos_transaction.dart b/lib/services/coins/tezos/api/tezos_transaction.dart
deleted file mode 100644
index e1e6bc8..0000000
--- a/lib/services/coins/tezos/api/tezos_transaction.dart
+++ /dev/null
@@ -1,43 +0,0 @@
-class TezosTransaction {
- final int? id;
- final String hash;
- final String? type;
- final int height;
- final int timestamp;
- final int? cycle;
- final int? counter;
- final int? opN;
- final int? opP;
- final String? status;
- final bool? isSuccess;
- final int? gasLimit;
- final int? gasUsed;
- final int? storageLimit;
- final int amountInMicroTez;
- final int feeInMicroTez;
- final int? burnedAmountInMicroTez;
- final String senderAddress;
- final String receiverAddress;
-
- TezosTransaction({
- this.id,
- required this.hash,
- this.type,
- required this.height,
- required this.timestamp,
- this.cycle,
- this.counter,
- this.opN,
- this.opP,
- this.status,
- this.isSuccess,
- this.gasLimit,
- this.gasUsed,
- this.storageLimit,
- required this.amountInMicroTez,
- required this.feeInMicroTez,
- this.burnedAmountInMicroTez,
- required this.senderAddress,
- required this.receiverAddress,
- });
-}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.