add package monero and do network check in validate address

This commit is contained in:
Julian 2024-05-27 13:40:42 -06:00
parent 5862ed1ed7
commit 88bda91d1b
2 changed files with 11 additions and 2 deletions

View file

@ -1,4 +1,3 @@
import 'package:cw_monero/api/wallet.dart' as monero_wallet;
import 'package:monero/monero.dart' as monero;
import '../../../models/node_model.dart';
@ -46,7 +45,12 @@ class Monero extends CryptonoteCurrency {
@override
bool validateAddress(String address) {
return monero.Wallet_addressValid(address, 0);
switch (network) {
case CryptoCurrencyNetwork.main:
return monero.Wallet_addressValid(address, 0);
default:
throw Exception("Unsupported network: $network");
}
}
@override

View file

@ -47,6 +47,11 @@ dependencies:
cw_core:
path: ./crypto_plugins/flutter_libmonero/cw_core
monero:
git:
url: https://git.mrcyjanek.net/mrcyjanek/monero.dart
ref: 6a17a405a1a260fa228b2f4fc94044088a4335ac
flutter_libepiccash:
path: ./crypto_plugins/flutter_libepiccash