cake_wallet/cw_zano/lib/zano_utils.dart

18 lines
438 B
Dart
Raw Normal View History

2023-12-16 15:00:22 +00:00
import 'dart:convert';
2024-03-06 06:48:59 +00:00
import 'package:cw_zano/api/api_calls.dart';
2023-12-16 15:00:22 +00:00
import 'package:cw_zano/api/model/get_address_info_result.dart';
class ZanoUtils {
static bool validateAddress(String address) {
try {
final result = GetAddressInfoResult.fromJson(
2024-03-06 06:48:59 +00:00
jsonDecode(ApiCalls.getAddressInfo(address: address)) as Map<String, dynamic>,
2023-12-16 15:00:22 +00:00
);
return result.valid;
} catch (err) {
return false;
}
}
}