mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-10 20:54:33 +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.dogecoinTestNet:
|
||||
case Coin.epicCash:
|
||||
case Coin.eCash:
|
||||
return false;
|
||||
|
||||
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/bitcoincash/bitcoincash_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/ethereum/ethereum_wallet.dart';
|
||||
import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
|
||||
|
@ -233,6 +234,17 @@ abstract class CoinServiceAPI {
|
|||
cachedClient: cachedClient,
|
||||
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:stackwallet/services/coins/bitcoincash/bitcoincash_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/litecoin/litecoin_wallet.dart';
|
||||
import 'package:stackwallet/services/coins/namecoin/namecoin_wallet.dart';
|
||||
|
@ -61,6 +62,8 @@ class AddressUtils {
|
|||
return true; //TODO - validate ETH address
|
||||
case Coin.firo:
|
||||
return Address.validateAddress(address, firoNetwork);
|
||||
case Coin.eCash:
|
||||
return Address.validateAddress(address, eCashNetwork);
|
||||
case Coin.monero:
|
||||
return RegExp("[a-zA-Z0-9]{95}").hasMatch(address) ||
|
||||
RegExp("[a-zA-Z0-9]{106}").hasMatch(address);
|
||||
|
|
|
@ -319,6 +319,8 @@ class _SVG {
|
|||
return bitcoincash;
|
||||
case Coin.dogecoin:
|
||||
return dogecoin;
|
||||
case Coin.eCash:
|
||||
return dogecoin;
|
||||
case Coin.epicCash:
|
||||
return epicCash;
|
||||
case Coin.ethereum:
|
||||
|
@ -373,6 +375,8 @@ class _SVG {
|
|||
return bitcoincashImage(context);
|
||||
case Coin.dogecoin:
|
||||
return dogecoinImage(context);
|
||||
case Coin.eCash:
|
||||
return dogecoinImage(context);
|
||||
case Coin.epicCash:
|
||||
return epicCashImage(context);
|
||||
case Coin.firo:
|
||||
|
|
|
@ -15,6 +15,8 @@ Uri getBlockExplorerTransactionUrlFor({
|
|||
return Uri.parse("https://chain.so/tx/BTCTEST/$txid");
|
||||
case Coin.dogecoin:
|
||||
return Uri.parse("https://chain.so/tx/DOGE/$txid");
|
||||
case Coin.eCash:
|
||||
return Uri.parse("https://explorer.bitcoinabc.org/tx/$txid");
|
||||
case Coin.dogecoinTestNet:
|
||||
return Uri.parse("https://chain.so/tx/DOGETEST/$txid");
|
||||
case Coin.epicCash:
|
||||
|
|
|
@ -57,6 +57,7 @@ abstract class Constants {
|
|||
case Coin.firo:
|
||||
case Coin.bitcoinTestNet:
|
||||
case Coin.dogecoinTestNet:
|
||||
case Coin.eCash:
|
||||
case Coin.firoTestNet:
|
||||
case Coin.epicCash:
|
||||
case Coin.namecoin:
|
||||
|
@ -86,6 +87,7 @@ abstract class Constants {
|
|||
case Coin.bitcoinTestNet:
|
||||
case Coin.dogecoinTestNet:
|
||||
case Coin.firoTestNet:
|
||||
case Coin.eCash:
|
||||
case Coin.epicCash:
|
||||
case Coin.namecoin:
|
||||
case Coin.particl:
|
||||
|
@ -115,6 +117,7 @@ abstract class Constants {
|
|||
case Coin.bitcoinTestNet:
|
||||
case Coin.dogecoinTestNet:
|
||||
case Coin.firoTestNet:
|
||||
case Coin.eCash:
|
||||
case Coin.epicCash:
|
||||
case Coin.ethereum:
|
||||
case Coin.namecoin:
|
||||
|
@ -137,10 +140,9 @@ abstract class Constants {
|
|||
switch (coin) {
|
||||
case Coin.bitcoin:
|
||||
case Coin.bitcoinTestNet:
|
||||
return 600;
|
||||
|
||||
case Coin.bitcoincash:
|
||||
case Coin.bitcoincashTestnet:
|
||||
case Coin.eCash:
|
||||
return 600;
|
||||
|
||||
case Coin.dogecoin:
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:stackwallet/models/node_model.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
// import 'package:web3dart/browser.dart';
|
||||
|
||||
abstract class DefaultNodes {
|
||||
static const String defaultNodeIdPrefix = "default_";
|
||||
|
@ -13,6 +12,7 @@ abstract class DefaultNodes {
|
|||
dogecoin,
|
||||
firo,
|
||||
monero,
|
||||
eCash,
|
||||
epicCash,
|
||||
ethereum,
|
||||
bitcoincash,
|
||||
|
@ -219,6 +219,18 @@ abstract class DefaultNodes {
|
|||
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) {
|
||||
switch (coin) {
|
||||
case Coin.bitcoin:
|
||||
|
@ -233,6 +245,9 @@ abstract class DefaultNodes {
|
|||
case Coin.dogecoin:
|
||||
return dogecoin;
|
||||
|
||||
case Coin.eCash:
|
||||
return eCash;
|
||||
|
||||
case Coin.epicCash:
|
||||
return epicCash;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_wallet.dart'
|
|||
as bch;
|
||||
import 'package:stackwallet/services/coins/dogecoin/dogecoin_wallet.dart'
|
||||
as doge;
|
||||
import 'package:stackwallet/services/coins/ecash/ecash_wallet.dart' as ecash;
|
||||
import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart'
|
||||
as epic;
|
||||
import 'package:stackwallet/services/coins/ethereum/ethereum_wallet.dart'
|
||||
|
@ -22,6 +23,7 @@ enum Coin {
|
|||
bitcoin,
|
||||
bitcoincash,
|
||||
dogecoin,
|
||||
eCash,
|
||||
epicCash,
|
||||
ethereum,
|
||||
firo,
|
||||
|
@ -59,6 +61,8 @@ extension CoinExt on Coin {
|
|||
return "Dogecoin";
|
||||
case Coin.epicCash:
|
||||
return "Epic Cash";
|
||||
case Coin.eCash:
|
||||
return "E-Cash";
|
||||
case Coin.ethereum:
|
||||
return "Ethereum";
|
||||
case Coin.firo:
|
||||
|
@ -98,6 +102,8 @@ extension CoinExt on Coin {
|
|||
return "EPIC";
|
||||
case Coin.ethereum:
|
||||
return "ETH";
|
||||
case Coin.eCash:
|
||||
return "XEC";
|
||||
case Coin.firo:
|
||||
return "FIRO";
|
||||
case Coin.monero:
|
||||
|
@ -136,6 +142,8 @@ extension CoinExt on Coin {
|
|||
return "epic";
|
||||
case Coin.ethereum:
|
||||
return "ethereum";
|
||||
case Coin.eCash:
|
||||
return "ecash";
|
||||
case Coin.firo:
|
||||
return "firo";
|
||||
case Coin.monero:
|
||||
|
@ -173,6 +181,7 @@ extension CoinExt on Coin {
|
|||
case Coin.bitcoincashTestnet:
|
||||
case Coin.firoTestNet:
|
||||
case Coin.dogecoinTestNet:
|
||||
case Coin.eCash:
|
||||
return true;
|
||||
|
||||
case Coin.epicCash:
|
||||
|
@ -195,6 +204,7 @@ extension CoinExt on Coin {
|
|||
case Coin.firo:
|
||||
case Coin.namecoin:
|
||||
case Coin.particl:
|
||||
case Coin.eCash:
|
||||
case Coin.epicCash:
|
||||
case Coin.monero:
|
||||
case Coin.wownero:
|
||||
|
@ -220,6 +230,7 @@ extension CoinExt on Coin {
|
|||
case Coin.ethereum:
|
||||
case Coin.monero:
|
||||
case Coin.wownero:
|
||||
case Coin.eCash:
|
||||
return false;
|
||||
|
||||
case Coin.dogecoinTestNet:
|
||||
|
@ -244,6 +255,7 @@ extension CoinExt on Coin {
|
|||
case Coin.ethereum:
|
||||
case Coin.monero:
|
||||
case Coin.wownero:
|
||||
case Coin.eCash:
|
||||
return this;
|
||||
|
||||
case Coin.dogecoinTestNet:
|
||||
|
@ -288,6 +300,9 @@ extension CoinExt on Coin {
|
|||
case Coin.epicCash:
|
||||
return epic.MINIMUM_CONFIRMATIONS;
|
||||
|
||||
case Coin.eCash:
|
||||
return ecash.MINIMUM_CONFIRMATIONS;
|
||||
|
||||
case Coin.ethereum:
|
||||
return eth.MINIMUM_CONFIRMATIONS;
|
||||
|
||||
|
@ -339,6 +354,11 @@ Coin coinFromPrettyName(String name) {
|
|||
case "firo":
|
||||
return Coin.firo;
|
||||
|
||||
case "E-Cash":
|
||||
case "ecash":
|
||||
case "eCash":
|
||||
return Coin.eCash;
|
||||
|
||||
case "Monero":
|
||||
case "monero":
|
||||
return Coin.monero;
|
||||
|
|
|
@ -17,6 +17,7 @@ extension DerivePathTypeExt on DerivePathType {
|
|||
case Coin.dogecoinTestNet:
|
||||
case Coin.firo:
|
||||
case Coin.firoTestNet:
|
||||
case Coin.eCash:
|
||||
return DerivePathType.bip44;
|
||||
|
||||
case Coin.bitcoin:
|
||||
|
|
|
@ -309,6 +309,7 @@ class CoinThemeColor {
|
|||
Color get firo => const Color(0xFFFF897A);
|
||||
Color get dogecoin => const Color(0xFFFFE079);
|
||||
Color get epicCash => const Color(0xFFC5C7CB);
|
||||
Color get eCash => Colors.pink;
|
||||
Color get ethereum => const Color(0xFFA7ADE9);
|
||||
Color get monero => const Color(0xFFFF9E6B);
|
||||
Color get namecoin => const Color(0xFF91B1E1);
|
||||
|
@ -331,6 +332,8 @@ class CoinThemeColor {
|
|||
return dogecoin;
|
||||
case Coin.epicCash:
|
||||
return epicCash;
|
||||
case Coin.eCash:
|
||||
return eCash;
|
||||
case Coin.ethereum:
|
||||
return ethereum;
|
||||
case Coin.firo:
|
||||
|
|
|
@ -1670,6 +1670,8 @@ class StackColors extends ThemeExtension<StackColors> {
|
|||
return _coin.dogecoin;
|
||||
case Coin.epicCash:
|
||||
return _coin.epicCash;
|
||||
case Coin.eCash:
|
||||
return _coin.eCash;
|
||||
case Coin.ethereum:
|
||||
return _coin.ethereum;
|
||||
case Coin.firo:
|
||||
|
|
Loading…
Reference in a new issue