mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-26 20:26:02 +00:00
WIP e-cash
This commit is contained in:
parent
60c1152daa
commit
93b040bc5f
12 changed files with 2723 additions and 3 deletions
|
@ -717,6 +717,7 @@ class _NodeFormState extends ConsumerState<NodeForm> {
|
||||||
case Coin.firoTestNet:
|
case Coin.firoTestNet:
|
||||||
case Coin.dogecoinTestNet:
|
case Coin.dogecoinTestNet:
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
|
case Coin.eCash:
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
|
|
|
@ -7,6 +7,7 @@ import 'package:stackwallet/models/paymint/fee_object_model.dart';
|
||||||
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart';
|
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart';
|
||||||
import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_wallet.dart';
|
import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_wallet.dart';
|
||||||
import 'package:stackwallet/services/coins/dogecoin/dogecoin_wallet.dart';
|
import 'package:stackwallet/services/coins/dogecoin/dogecoin_wallet.dart';
|
||||||
|
import 'package:stackwallet/services/coins/ecash/ecash_wallet.dart';
|
||||||
import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart';
|
import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart';
|
||||||
import 'package:stackwallet/services/coins/ethereum/ethereum_wallet.dart';
|
import 'package:stackwallet/services/coins/ethereum/ethereum_wallet.dart';
|
||||||
import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
|
import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
|
||||||
|
@ -233,6 +234,17 @@ abstract class CoinServiceAPI {
|
||||||
cachedClient: cachedClient,
|
cachedClient: cachedClient,
|
||||||
tracker: tracker,
|
tracker: tracker,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
case Coin.eCash:
|
||||||
|
return ECashWallet(
|
||||||
|
walletId: walletId,
|
||||||
|
walletName: walletName,
|
||||||
|
coin: coin,
|
||||||
|
secureStore: secureStorageInterface,
|
||||||
|
client: client,
|
||||||
|
cachedClient: cachedClient,
|
||||||
|
tracker: tracker,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2655
lib/services/coins/ecash/ecash_wallet.dart
Normal file
2655
lib/services/coins/ecash/ecash_wallet.dart
Normal file
File diff suppressed because it is too large
Load diff
|
@ -5,6 +5,7 @@ import 'package:crypto/crypto.dart';
|
||||||
import 'package:flutter_libepiccash/epic_cash.dart';
|
import 'package:flutter_libepiccash/epic_cash.dart';
|
||||||
import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_wallet.dart';
|
import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_wallet.dart';
|
||||||
import 'package:stackwallet/services/coins/dogecoin/dogecoin_wallet.dart';
|
import 'package:stackwallet/services/coins/dogecoin/dogecoin_wallet.dart';
|
||||||
|
import 'package:stackwallet/services/coins/ecash/ecash_wallet.dart';
|
||||||
import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
|
import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
|
||||||
import 'package:stackwallet/services/coins/litecoin/litecoin_wallet.dart';
|
import 'package:stackwallet/services/coins/litecoin/litecoin_wallet.dart';
|
||||||
import 'package:stackwallet/services/coins/namecoin/namecoin_wallet.dart';
|
import 'package:stackwallet/services/coins/namecoin/namecoin_wallet.dart';
|
||||||
|
@ -61,6 +62,8 @@ class AddressUtils {
|
||||||
return true; //TODO - validate ETH address
|
return true; //TODO - validate ETH address
|
||||||
case Coin.firo:
|
case Coin.firo:
|
||||||
return Address.validateAddress(address, firoNetwork);
|
return Address.validateAddress(address, firoNetwork);
|
||||||
|
case Coin.eCash:
|
||||||
|
return Address.validateAddress(address, eCashNetwork);
|
||||||
case Coin.monero:
|
case Coin.monero:
|
||||||
return RegExp("[a-zA-Z0-9]{95}").hasMatch(address) ||
|
return RegExp("[a-zA-Z0-9]{95}").hasMatch(address) ||
|
||||||
RegExp("[a-zA-Z0-9]{106}").hasMatch(address);
|
RegExp("[a-zA-Z0-9]{106}").hasMatch(address);
|
||||||
|
|
|
@ -319,6 +319,8 @@ class _SVG {
|
||||||
return bitcoincash;
|
return bitcoincash;
|
||||||
case Coin.dogecoin:
|
case Coin.dogecoin:
|
||||||
return dogecoin;
|
return dogecoin;
|
||||||
|
case Coin.eCash:
|
||||||
|
return dogecoin;
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
return epicCash;
|
return epicCash;
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
|
@ -373,6 +375,8 @@ class _SVG {
|
||||||
return bitcoincashImage(context);
|
return bitcoincashImage(context);
|
||||||
case Coin.dogecoin:
|
case Coin.dogecoin:
|
||||||
return dogecoinImage(context);
|
return dogecoinImage(context);
|
||||||
|
case Coin.eCash:
|
||||||
|
return dogecoinImage(context);
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
return epicCashImage(context);
|
return epicCashImage(context);
|
||||||
case Coin.firo:
|
case Coin.firo:
|
||||||
|
|
|
@ -15,6 +15,8 @@ Uri getBlockExplorerTransactionUrlFor({
|
||||||
return Uri.parse("https://chain.so/tx/BTCTEST/$txid");
|
return Uri.parse("https://chain.so/tx/BTCTEST/$txid");
|
||||||
case Coin.dogecoin:
|
case Coin.dogecoin:
|
||||||
return Uri.parse("https://chain.so/tx/DOGE/$txid");
|
return Uri.parse("https://chain.so/tx/DOGE/$txid");
|
||||||
|
case Coin.eCash:
|
||||||
|
return Uri.parse("https://explorer.bitcoinabc.org/tx/$txid");
|
||||||
case Coin.dogecoinTestNet:
|
case Coin.dogecoinTestNet:
|
||||||
return Uri.parse("https://chain.so/tx/DOGETEST/$txid");
|
return Uri.parse("https://chain.so/tx/DOGETEST/$txid");
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
|
|
|
@ -57,6 +57,7 @@ abstract class Constants {
|
||||||
case Coin.firo:
|
case Coin.firo:
|
||||||
case Coin.bitcoinTestNet:
|
case Coin.bitcoinTestNet:
|
||||||
case Coin.dogecoinTestNet:
|
case Coin.dogecoinTestNet:
|
||||||
|
case Coin.eCash:
|
||||||
case Coin.firoTestNet:
|
case Coin.firoTestNet:
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
case Coin.namecoin:
|
case Coin.namecoin:
|
||||||
|
@ -86,6 +87,7 @@ abstract class Constants {
|
||||||
case Coin.bitcoinTestNet:
|
case Coin.bitcoinTestNet:
|
||||||
case Coin.dogecoinTestNet:
|
case Coin.dogecoinTestNet:
|
||||||
case Coin.firoTestNet:
|
case Coin.firoTestNet:
|
||||||
|
case Coin.eCash:
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
case Coin.namecoin:
|
case Coin.namecoin:
|
||||||
case Coin.particl:
|
case Coin.particl:
|
||||||
|
@ -115,6 +117,7 @@ abstract class Constants {
|
||||||
case Coin.bitcoinTestNet:
|
case Coin.bitcoinTestNet:
|
||||||
case Coin.dogecoinTestNet:
|
case Coin.dogecoinTestNet:
|
||||||
case Coin.firoTestNet:
|
case Coin.firoTestNet:
|
||||||
|
case Coin.eCash:
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
case Coin.namecoin:
|
case Coin.namecoin:
|
||||||
|
@ -137,10 +140,9 @@ abstract class Constants {
|
||||||
switch (coin) {
|
switch (coin) {
|
||||||
case Coin.bitcoin:
|
case Coin.bitcoin:
|
||||||
case Coin.bitcoinTestNet:
|
case Coin.bitcoinTestNet:
|
||||||
return 600;
|
|
||||||
|
|
||||||
case Coin.bitcoincash:
|
case Coin.bitcoincash:
|
||||||
case Coin.bitcoincashTestnet:
|
case Coin.bitcoincashTestnet:
|
||||||
|
case Coin.eCash:
|
||||||
return 600;
|
return 600;
|
||||||
|
|
||||||
case Coin.dogecoin:
|
case Coin.dogecoin:
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'package:stackwallet/models/node_model.dart';
|
import 'package:stackwallet/models/node_model.dart';
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
// import 'package:web3dart/browser.dart';
|
|
||||||
|
|
||||||
abstract class DefaultNodes {
|
abstract class DefaultNodes {
|
||||||
static const String defaultNodeIdPrefix = "default_";
|
static const String defaultNodeIdPrefix = "default_";
|
||||||
|
@ -13,6 +12,7 @@ abstract class DefaultNodes {
|
||||||
dogecoin,
|
dogecoin,
|
||||||
firo,
|
firo,
|
||||||
monero,
|
monero,
|
||||||
|
eCash,
|
||||||
epicCash,
|
epicCash,
|
||||||
ethereum,
|
ethereum,
|
||||||
bitcoincash,
|
bitcoincash,
|
||||||
|
@ -219,6 +219,18 @@ abstract class DefaultNodes {
|
||||||
isDown: false,
|
isDown: false,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
static NodeModel get eCash => NodeModel(
|
||||||
|
host: "electrum.bitcoinabc.org",
|
||||||
|
port: 50002,
|
||||||
|
name: defaultName,
|
||||||
|
id: _nodeId(Coin.eCash),
|
||||||
|
useSSL: true,
|
||||||
|
enabled: true,
|
||||||
|
coinName: Coin.eCash.name,
|
||||||
|
isFailover: true,
|
||||||
|
isDown: false,
|
||||||
|
);
|
||||||
|
|
||||||
static NodeModel getNodeFor(Coin coin) {
|
static NodeModel getNodeFor(Coin coin) {
|
||||||
switch (coin) {
|
switch (coin) {
|
||||||
case Coin.bitcoin:
|
case Coin.bitcoin:
|
||||||
|
@ -233,6 +245,9 @@ abstract class DefaultNodes {
|
||||||
case Coin.dogecoin:
|
case Coin.dogecoin:
|
||||||
return dogecoin;
|
return dogecoin;
|
||||||
|
|
||||||
|
case Coin.eCash:
|
||||||
|
return eCash;
|
||||||
|
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
return epicCash;
|
return epicCash;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_wallet.dart'
|
||||||
as bch;
|
as bch;
|
||||||
import 'package:stackwallet/services/coins/dogecoin/dogecoin_wallet.dart'
|
import 'package:stackwallet/services/coins/dogecoin/dogecoin_wallet.dart'
|
||||||
as doge;
|
as doge;
|
||||||
|
import 'package:stackwallet/services/coins/ecash/ecash_wallet.dart' as ecash;
|
||||||
import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart'
|
import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart'
|
||||||
as epic;
|
as epic;
|
||||||
import 'package:stackwallet/services/coins/ethereum/ethereum_wallet.dart'
|
import 'package:stackwallet/services/coins/ethereum/ethereum_wallet.dart'
|
||||||
|
@ -22,6 +23,7 @@ enum Coin {
|
||||||
bitcoin,
|
bitcoin,
|
||||||
bitcoincash,
|
bitcoincash,
|
||||||
dogecoin,
|
dogecoin,
|
||||||
|
eCash,
|
||||||
epicCash,
|
epicCash,
|
||||||
ethereum,
|
ethereum,
|
||||||
firo,
|
firo,
|
||||||
|
@ -59,6 +61,8 @@ extension CoinExt on Coin {
|
||||||
return "Dogecoin";
|
return "Dogecoin";
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
return "Epic Cash";
|
return "Epic Cash";
|
||||||
|
case Coin.eCash:
|
||||||
|
return "E-Cash";
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
return "Ethereum";
|
return "Ethereum";
|
||||||
case Coin.firo:
|
case Coin.firo:
|
||||||
|
@ -98,6 +102,8 @@ extension CoinExt on Coin {
|
||||||
return "EPIC";
|
return "EPIC";
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
return "ETH";
|
return "ETH";
|
||||||
|
case Coin.eCash:
|
||||||
|
return "XEC";
|
||||||
case Coin.firo:
|
case Coin.firo:
|
||||||
return "FIRO";
|
return "FIRO";
|
||||||
case Coin.monero:
|
case Coin.monero:
|
||||||
|
@ -136,6 +142,8 @@ extension CoinExt on Coin {
|
||||||
return "epic";
|
return "epic";
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
return "ethereum";
|
return "ethereum";
|
||||||
|
case Coin.eCash:
|
||||||
|
return "ecash";
|
||||||
case Coin.firo:
|
case Coin.firo:
|
||||||
return "firo";
|
return "firo";
|
||||||
case Coin.monero:
|
case Coin.monero:
|
||||||
|
@ -173,6 +181,7 @@ extension CoinExt on Coin {
|
||||||
case Coin.bitcoincashTestnet:
|
case Coin.bitcoincashTestnet:
|
||||||
case Coin.firoTestNet:
|
case Coin.firoTestNet:
|
||||||
case Coin.dogecoinTestNet:
|
case Coin.dogecoinTestNet:
|
||||||
|
case Coin.eCash:
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
|
@ -195,6 +204,7 @@ extension CoinExt on Coin {
|
||||||
case Coin.firo:
|
case Coin.firo:
|
||||||
case Coin.namecoin:
|
case Coin.namecoin:
|
||||||
case Coin.particl:
|
case Coin.particl:
|
||||||
|
case Coin.eCash:
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
case Coin.monero:
|
case Coin.monero:
|
||||||
case Coin.wownero:
|
case Coin.wownero:
|
||||||
|
@ -220,6 +230,7 @@ extension CoinExt on Coin {
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
case Coin.monero:
|
case Coin.monero:
|
||||||
case Coin.wownero:
|
case Coin.wownero:
|
||||||
|
case Coin.eCash:
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
case Coin.dogecoinTestNet:
|
case Coin.dogecoinTestNet:
|
||||||
|
@ -244,6 +255,7 @@ extension CoinExt on Coin {
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
case Coin.monero:
|
case Coin.monero:
|
||||||
case Coin.wownero:
|
case Coin.wownero:
|
||||||
|
case Coin.eCash:
|
||||||
return this;
|
return this;
|
||||||
|
|
||||||
case Coin.dogecoinTestNet:
|
case Coin.dogecoinTestNet:
|
||||||
|
@ -288,6 +300,9 @@ extension CoinExt on Coin {
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
return epic.MINIMUM_CONFIRMATIONS;
|
return epic.MINIMUM_CONFIRMATIONS;
|
||||||
|
|
||||||
|
case Coin.eCash:
|
||||||
|
return ecash.MINIMUM_CONFIRMATIONS;
|
||||||
|
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
return eth.MINIMUM_CONFIRMATIONS;
|
return eth.MINIMUM_CONFIRMATIONS;
|
||||||
|
|
||||||
|
@ -339,6 +354,11 @@ Coin coinFromPrettyName(String name) {
|
||||||
case "firo":
|
case "firo":
|
||||||
return Coin.firo;
|
return Coin.firo;
|
||||||
|
|
||||||
|
case "E-Cash":
|
||||||
|
case "ecash":
|
||||||
|
case "eCash":
|
||||||
|
return Coin.eCash;
|
||||||
|
|
||||||
case "Monero":
|
case "Monero":
|
||||||
case "monero":
|
case "monero":
|
||||||
return Coin.monero;
|
return Coin.monero;
|
||||||
|
|
|
@ -17,6 +17,7 @@ extension DerivePathTypeExt on DerivePathType {
|
||||||
case Coin.dogecoinTestNet:
|
case Coin.dogecoinTestNet:
|
||||||
case Coin.firo:
|
case Coin.firo:
|
||||||
case Coin.firoTestNet:
|
case Coin.firoTestNet:
|
||||||
|
case Coin.eCash:
|
||||||
return DerivePathType.bip44;
|
return DerivePathType.bip44;
|
||||||
|
|
||||||
case Coin.bitcoin:
|
case Coin.bitcoin:
|
||||||
|
|
|
@ -309,6 +309,7 @@ class CoinThemeColor {
|
||||||
Color get firo => const Color(0xFFFF897A);
|
Color get firo => const Color(0xFFFF897A);
|
||||||
Color get dogecoin => const Color(0xFFFFE079);
|
Color get dogecoin => const Color(0xFFFFE079);
|
||||||
Color get epicCash => const Color(0xFFC5C7CB);
|
Color get epicCash => const Color(0xFFC5C7CB);
|
||||||
|
Color get eCash => Colors.pink;
|
||||||
Color get ethereum => const Color(0xFFA7ADE9);
|
Color get ethereum => const Color(0xFFA7ADE9);
|
||||||
Color get monero => const Color(0xFFFF9E6B);
|
Color get monero => const Color(0xFFFF9E6B);
|
||||||
Color get namecoin => const Color(0xFF91B1E1);
|
Color get namecoin => const Color(0xFF91B1E1);
|
||||||
|
@ -331,6 +332,8 @@ class CoinThemeColor {
|
||||||
return dogecoin;
|
return dogecoin;
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
return epicCash;
|
return epicCash;
|
||||||
|
case Coin.eCash:
|
||||||
|
return eCash;
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
return ethereum;
|
return ethereum;
|
||||||
case Coin.firo:
|
case Coin.firo:
|
||||||
|
|
|
@ -1670,6 +1670,8 @@ class StackColors extends ThemeExtension<StackColors> {
|
||||||
return _coin.dogecoin;
|
return _coin.dogecoin;
|
||||||
case Coin.epicCash:
|
case Coin.epicCash:
|
||||||
return _coin.epicCash;
|
return _coin.epicCash;
|
||||||
|
case Coin.eCash:
|
||||||
|
return _coin.eCash;
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
return _coin.ethereum;
|
return _coin.ethereum;
|
||||||
case Coin.firo:
|
case Coin.firo:
|
||||||
|
|
Loading…
Reference in a new issue