cake_wallet/cw_zano/lib/zano_utils.dart

18 lines
431 B
Dart
Raw Normal View History

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