From 88bda91d1b0ee2743d51687b4d8466c9e5763106 Mon Sep 17 00:00:00 2001 From: Julian Date: Mon, 27 May 2024 13:40:42 -0600 Subject: [PATCH] add package monero and do network check in validate address --- lib/wallets/crypto_currency/coins/monero.dart | 8 ++++++-- scripts/app_config/templates/pubspec.template | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/wallets/crypto_currency/coins/monero.dart b/lib/wallets/crypto_currency/coins/monero.dart index 8d55cff65..fa7e32886 100644 --- a/lib/wallets/crypto_currency/coins/monero.dart +++ b/lib/wallets/crypto_currency/coins/monero.dart @@ -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 diff --git a/scripts/app_config/templates/pubspec.template b/scripts/app_config/templates/pubspec.template index d7e07cc1a..a77535133 100644 --- a/scripts/app_config/templates/pubspec.template +++ b/scripts/app_config/templates/pubspec.template @@ -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