mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-03 17:29:23 +00:00
add package monero and do network check in validate address
This commit is contained in:
parent
5862ed1ed7
commit
88bda91d1b
2 changed files with 11 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue