mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 20:09:23 +00:00
WIP sample epic wrapper
This commit is contained in:
parent
f30785616b
commit
9e194f2b45
2 changed files with 23 additions and 11 deletions
|
@ -1,7 +1,7 @@
|
|||
import 'package:flutter_libepiccash/epic_cash.dart' as lib_epiccash;
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/wallets/crypto_currency/bip39_currency.dart';
|
||||
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
||||
import 'package:stackwallet/wallets/example/libepiccash.dart';
|
||||
|
||||
class Epiccash extends Bip39Currency {
|
||||
Epiccash(super.network) {
|
||||
|
@ -30,15 +30,6 @@ class Epiccash extends Bip39Currency {
|
|||
}
|
||||
}
|
||||
|
||||
final String validate = lib_epiccash.validateSendAddress(address);
|
||||
if (int.parse(validate) == 1) {
|
||||
// Check if address contains a domain
|
||||
if (address.contains("@")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return LibEpiccash.validateSendAddress(address: address);
|
||||
}
|
||||
}
|
||||
|
|
21
lib/wallets/example/libepiccash.dart
Normal file
21
lib/wallets/example/libepiccash.dart
Normal file
|
@ -0,0 +1,21 @@
|
|||
import 'package:flutter_libepiccash/epic_cash.dart' as lib_epiccash;
|
||||
|
||||
///
|
||||
/// Wrapped up calls to flutter_libepiccash.
|
||||
///
|
||||
/// Should all be static calls (no state stored in this class)
|
||||
///
|
||||
abstract class LibEpiccash {
|
||||
static bool validateSendAddress({required String address}) {
|
||||
final String validate = lib_epiccash.validateSendAddress(address);
|
||||
if (int.parse(validate) == 1) {
|
||||
// Check if address contains a domain
|
||||
if (address.contains("@")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue