WIP sample epic wrapper

This commit is contained in:
julian 2023-09-18 15:56:57 -06:00
parent f30785616b
commit 9e194f2b45
2 changed files with 23 additions and 11 deletions

View file

@ -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);
}
}

View 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;
}
}
}