mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-16 17:27:39 +00:00
Add images for bch
This commit is contained in:
parent
e365bb0c16
commit
6fab5c9976
12 changed files with 63 additions and 57 deletions
BIN
assets/images/bitcoincash.png
Normal file
BIN
assets/images/bitcoincash.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 354 KiB |
1
assets/svg/coin_icons/Bitcoincash.svg
Normal file
1
assets/svg/coin_icons/Bitcoincash.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 511.76 511.76"><title>bitcoin-cash-bch</title><circle style="fill:#0ac18e;" cx="255.88" cy="255.88" r="255.88"/><path id="symbol" style="fill:#fff;" d="M335.94,170.3c-12.86-29.16-42.41-35.4-78.59-29.36L245.73,95.87,218.32,103l11.43,44.94c-7.21,1.82-14.61,3.38-21.95,5.46l-11.43-44.68L169,115.75l11.63,45.07c-5.91,1.69-55.33,14.35-55.33,14.35l7.53,29.35s20.13-5.65,19.94-5.19c11.17-2.92,16.43,2.66,18.9,7.92l32,123.53c.39,3.57-.26,9.67-7.92,11.75.45.26-19.94,5.13-19.94,5.13l3,34.23s49-12.54,55.4-14.16l11.76,45.59,27.4-7.08-11.75-45.91q11.3-2.64,22-5.46l11.69,45.66,27.4-7.08-11.75-45.53c42.21-10.26,72-36.89,65.92-77.61-3.9-24.55-30.72-44.68-53-46.95,13.7-12.15,20.65-29.88,12.15-53.06ZM322.75,277.78c5.46,40.33-50.59,45.27-69.1,50.14l-16.11-60.33C256.12,262.71,313.53,242.26,322.75,277.78ZM289,195.63c5.78,35.85-42.15,40-57.61,44L216.7,184.85C232.22,181,277.23,162.44,289,195.63Z" transform="translate(-0.24 -0.34)"/></svg>
|
After Width: | Height: | Size: 978 B |
|
@ -113,9 +113,9 @@ class _AddEditNodeViewState extends ConsumerState<AddEditNodeView> {
|
|||
break;
|
||||
|
||||
case Coin.bitcoin:
|
||||
case Coin.bitcoincash:
|
||||
case Coin.dogecoin:
|
||||
case Coin.firo:
|
||||
case Coin.bitcoincash:
|
||||
case Coin.bitcoinTestNet:
|
||||
case Coin.firoTestNet:
|
||||
case Coin.dogecoinTestNet:
|
||||
|
|
|
@ -1938,6 +1938,7 @@ class BitcoinCashWallet extends CoinServiceAPI {
|
|||
unconfirmedCachedTransactions
|
||||
.removeWhere((key, value) => value.confirmedStatus);
|
||||
|
||||
print("CACHED_TRANSACTIONS_IS $cachedTransactions");
|
||||
if (cachedTransactions != null) {
|
||||
for (final tx in allTxHashes.toList(growable: false)) {
|
||||
final txHeight = tx["height"] as int;
|
||||
|
|
|
@ -98,6 +98,16 @@ abstract class CoinServiceAPI {
|
|||
tracker: tracker,
|
||||
);
|
||||
|
||||
case Coin.bitcoincash:
|
||||
return BitcoinCashWallet(
|
||||
walletId: walletId,
|
||||
walletName: walletName,
|
||||
coin: coin,
|
||||
client: client,
|
||||
cachedClient: cachedClient,
|
||||
tracker: tracker,
|
||||
);
|
||||
|
||||
case Coin.dogecoin:
|
||||
return DogecoinWallet(
|
||||
walletId: walletId,
|
||||
|
@ -133,16 +143,6 @@ abstract class CoinServiceAPI {
|
|||
cachedClient: cachedClient,
|
||||
tracker: tracker,
|
||||
);
|
||||
|
||||
case Coin.bitcoincash:
|
||||
return BitcoinCashWallet(
|
||||
walletId: walletId,
|
||||
walletName: walletName,
|
||||
coin: coin,
|
||||
client: client,
|
||||
cachedClient: cachedClient,
|
||||
tracker: tracker,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,8 @@ class AddressUtils {
|
|||
switch (coin) {
|
||||
case Coin.bitcoin:
|
||||
return Address.validateAddress(address, bitcoin);
|
||||
case Coin.bitcoincash:
|
||||
return Address.validateAddress(address, bitcoincash);
|
||||
case Coin.dogecoin:
|
||||
return Address.validateAddress(address, dogecoin);
|
||||
case Coin.epicCash:
|
||||
|
@ -50,8 +52,6 @@ class AddressUtils {
|
|||
case Coin.monero:
|
||||
return RegExp("[a-zA-Z0-9]{95}").hasMatch(address) ||
|
||||
RegExp("[a-zA-Z0-9]{106}").hasMatch(address);
|
||||
case Coin.bitcoincash:
|
||||
return Address.validateAddress(address, bitcoincash);
|
||||
case Coin.bitcoinTestNet:
|
||||
return Address.validateAddress(address, testnet);
|
||||
case Coin.firoTestNet:
|
||||
|
|
|
@ -101,6 +101,7 @@ class _SVG {
|
|||
String get txExchangeFailed => "assets/svg/tx-exchange-icon-failed.svg";
|
||||
|
||||
String get bitcoin => "assets/svg/coin_icons/Bitcoin.svg";
|
||||
String get bitcoincash => "assets/svg/coin_icons/Bitcoincash.svg";
|
||||
String get dogecoin => "assets/svg/coin_icons/Dogecoin.svg";
|
||||
String get epicCash => "assets/svg/coin_icons/EpicCash.svg";
|
||||
String get firo => "assets/svg/coin_icons/Firo.svg";
|
||||
|
@ -110,12 +111,13 @@ class _SVG {
|
|||
String get bitcoinTestnet => "assets/svg/coin_icons/Bitcoin.svg";
|
||||
String get firoTestnet => "assets/svg/coin_icons/Firo.svg";
|
||||
String get dogecoinTestnet => "assets/svg/coin_icons/Dogecoin.svg";
|
||||
String get bitcoincash => "assets/svg/coin_icons/Bitcoin.svg";
|
||||
|
||||
String iconFor({required Coin coin}) {
|
||||
switch (coin) {
|
||||
case Coin.bitcoin:
|
||||
return bitcoin;
|
||||
case Coin.bitcoincash:
|
||||
return bitcoincash;
|
||||
case Coin.dogecoin:
|
||||
return dogecoin;
|
||||
case Coin.epicCash:
|
||||
|
@ -124,8 +126,6 @@ class _SVG {
|
|||
return firo;
|
||||
case Coin.monero:
|
||||
return monero;
|
||||
case Coin.bitcoincash:
|
||||
return bitcoincash;
|
||||
case Coin.bitcoinTestNet:
|
||||
return bitcoinTestnet;
|
||||
case Coin.firoTestNet:
|
||||
|
@ -147,21 +147,22 @@ class _PNG {
|
|||
String get dogecoin => "assets/images/doge.png";
|
||||
String get bitcoin => "assets/images/bitcoin.png";
|
||||
String get epicCash => "assets/images/epic-cash.png";
|
||||
String get bitcoincash => "assets/images/bitcoin.png";
|
||||
String get bitcoincash => "assets/images/bitcoincash.png";
|
||||
|
||||
String imageFor({required Coin coin}) {
|
||||
switch (coin) {
|
||||
case Coin.bitcoin:
|
||||
case Coin.bitcoinTestNet:
|
||||
return bitcoin;
|
||||
case Coin.bitcoincash:
|
||||
return bitcoincash;
|
||||
case Coin.dogecoin:
|
||||
case Coin.dogecoinTestNet:
|
||||
return dogecoin;
|
||||
case Coin.epicCash:
|
||||
return epicCash;
|
||||
case Coin.firo:
|
||||
case Coin.bitcoincash:
|
||||
return bitcoincash;
|
||||
return firo;
|
||||
case Coin.firoTestNet:
|
||||
return firo;
|
||||
case Coin.monero:
|
||||
|
|
|
@ -6,17 +6,19 @@ class _CoinThemeColor {
|
|||
const _CoinThemeColor();
|
||||
|
||||
Color get bitcoin => const Color(0xFFFCC17B);
|
||||
Color get bitcoincash => const Color(0xFFFCC17B);
|
||||
Color get firo => const Color(0xFFFF897A);
|
||||
Color get dogecoin => const Color(0xFFFFE079);
|
||||
Color get epicCash => const Color(0xFFC1C1FF);
|
||||
Color get monero => const Color(0xFFB1C5FF);
|
||||
Color get bitcoincash => const Color(0xFFFCC17B);
|
||||
|
||||
Color forCoin(Coin coin) {
|
||||
switch (coin) {
|
||||
case Coin.bitcoin:
|
||||
case Coin.bitcoinTestNet:
|
||||
return bitcoin;
|
||||
case Coin.bitcoincash:
|
||||
return bitcoincash;
|
||||
case Coin.dogecoin:
|
||||
case Coin.dogecoinTestNet:
|
||||
return dogecoin;
|
||||
|
@ -27,8 +29,6 @@ class _CoinThemeColor {
|
|||
return firo;
|
||||
case Coin.monero:
|
||||
return monero;
|
||||
case Coin.bitcoincash:
|
||||
return bitcoincash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,13 +39,13 @@ abstract class Constants {
|
|||
final List<int> values = [];
|
||||
switch (coin) {
|
||||
case Coin.bitcoin:
|
||||
case Coin.bitcoincash:
|
||||
case Coin.dogecoin:
|
||||
case Coin.firo:
|
||||
case Coin.bitcoinTestNet:
|
||||
case Coin.dogecoinTestNet:
|
||||
case Coin.firoTestNet:
|
||||
case Coin.epicCash:
|
||||
case Coin.bitcoincash:
|
||||
values.addAll([24, 21, 18, 15, 12]);
|
||||
break;
|
||||
|
||||
|
@ -63,6 +63,9 @@ abstract class Constants {
|
|||
case Coin.bitcoinTestNet:
|
||||
return 600;
|
||||
|
||||
case Coin.bitcoincash:
|
||||
return 600;
|
||||
|
||||
case Coin.dogecoin:
|
||||
case Coin.dogecoinTestNet:
|
||||
return 60;
|
||||
|
@ -76,8 +79,6 @@ abstract class Constants {
|
|||
|
||||
case Coin.monero:
|
||||
return 120;
|
||||
case Coin.bitcoincash:
|
||||
return 600;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,18 @@ abstract class DefaultNodes {
|
|||
isDown: false,
|
||||
);
|
||||
|
||||
static NodeModel get bitcoincash => NodeModel(
|
||||
host: "electrum1.cipig.net",
|
||||
port: 20055,
|
||||
name: defaultName,
|
||||
id: _nodeId(Coin.bitcoincash),
|
||||
useSSL: true,
|
||||
enabled: true,
|
||||
coinName: Coin.bitcoincash.name,
|
||||
isFailover: true,
|
||||
isDown: false,
|
||||
);
|
||||
|
||||
static NodeModel get dogecoin => NodeModel(
|
||||
host: "dogecoin.stackwallet.com",
|
||||
port: 50022,
|
||||
|
@ -81,18 +93,6 @@ abstract class DefaultNodes {
|
|||
isDown: false,
|
||||
);
|
||||
|
||||
static NodeModel get bitcoincash => NodeModel(
|
||||
host: "electrum1.cipig.net",
|
||||
port: 20055,
|
||||
name: defaultName,
|
||||
id: _nodeId(Coin.bitcoincash),
|
||||
useSSL: true,
|
||||
enabled: true,
|
||||
coinName: Coin.bitcoincash.name,
|
||||
isFailover: true,
|
||||
isDown: false,
|
||||
);
|
||||
|
||||
static NodeModel get bitcoinTestnet => NodeModel(
|
||||
host: "electrumx-testnet.cypherstack.com",
|
||||
port: 51002,
|
||||
|
@ -134,6 +134,9 @@ abstract class DefaultNodes {
|
|||
case Coin.bitcoin:
|
||||
return bitcoin;
|
||||
|
||||
case Coin.bitcoincash:
|
||||
return bitcoincash;
|
||||
|
||||
case Coin.dogecoin:
|
||||
return dogecoin;
|
||||
|
||||
|
@ -146,9 +149,6 @@ abstract class DefaultNodes {
|
|||
case Coin.monero:
|
||||
return monero;
|
||||
|
||||
case Coin.bitcoincash:
|
||||
return bitcoincash;
|
||||
|
||||
case Coin.bitcoinTestNet:
|
||||
return bitcoinTestnet;
|
||||
|
||||
|
|
|
@ -10,11 +10,11 @@ import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_wallet.dart'
|
|||
|
||||
enum Coin {
|
||||
bitcoin,
|
||||
bitcoincash,
|
||||
dogecoin,
|
||||
epicCash,
|
||||
firo,
|
||||
monero,
|
||||
bitcoincash,
|
||||
|
||||
///
|
||||
///
|
||||
|
@ -33,6 +33,8 @@ extension CoinExt on Coin {
|
|||
switch (this) {
|
||||
case Coin.bitcoin:
|
||||
return "Bitcoin";
|
||||
case Coin.bitcoincash:
|
||||
return "Bitcoin Cash";
|
||||
case Coin.dogecoin:
|
||||
return "Dogecoin";
|
||||
case Coin.epicCash:
|
||||
|
@ -41,8 +43,6 @@ extension CoinExt on Coin {
|
|||
return "Firo";
|
||||
case Coin.monero:
|
||||
return "Monero";
|
||||
case Coin.bitcoincash:
|
||||
return "Bitcoin Cash";
|
||||
case Coin.bitcoinTestNet:
|
||||
return "tBitcoin";
|
||||
case Coin.firoTestNet:
|
||||
|
@ -56,6 +56,8 @@ extension CoinExt on Coin {
|
|||
switch (this) {
|
||||
case Coin.bitcoin:
|
||||
return "BTC";
|
||||
case Coin.bitcoincash:
|
||||
return "BCH";
|
||||
case Coin.dogecoin:
|
||||
return "DOGE";
|
||||
case Coin.epicCash:
|
||||
|
@ -64,8 +66,6 @@ extension CoinExt on Coin {
|
|||
return "FIRO";
|
||||
case Coin.monero:
|
||||
return "XMR";
|
||||
case Coin.bitcoincash:
|
||||
return "BCH";
|
||||
case Coin.bitcoinTestNet:
|
||||
return "tBTC";
|
||||
case Coin.firoTestNet:
|
||||
|
@ -79,6 +79,8 @@ extension CoinExt on Coin {
|
|||
switch (this) {
|
||||
case Coin.bitcoin:
|
||||
return "bitcoin";
|
||||
case Coin.bitcoincash:
|
||||
return "bitcoincash";
|
||||
case Coin.dogecoin:
|
||||
return "dogecoin";
|
||||
case Coin.epicCash:
|
||||
|
@ -88,8 +90,6 @@ extension CoinExt on Coin {
|
|||
return "firo";
|
||||
case Coin.monero:
|
||||
return "monero";
|
||||
case Coin.bitcoincash:
|
||||
return "bitcoincash";
|
||||
case Coin.bitcoinTestNet:
|
||||
return "bitcoin";
|
||||
case Coin.firoTestNet:
|
||||
|
@ -102,9 +102,9 @@ extension CoinExt on Coin {
|
|||
bool get isElectrumXCoin {
|
||||
switch (this) {
|
||||
case Coin.bitcoin:
|
||||
case Coin.bitcoincash:
|
||||
case Coin.dogecoin:
|
||||
case Coin.firo:
|
||||
case Coin.bitcoincash:
|
||||
case Coin.bitcoinTestNet:
|
||||
case Coin.firoTestNet:
|
||||
case Coin.dogecoinTestNet:
|
||||
|
@ -122,6 +122,9 @@ extension CoinExt on Coin {
|
|||
case Coin.bitcoinTestNet:
|
||||
return btc.MINIMUM_CONFIRMATIONS;
|
||||
|
||||
case Coin.bitcoincash:
|
||||
return bch.MINIMUM_CONFIRMATIONS;
|
||||
|
||||
case Coin.firo:
|
||||
case Coin.firoTestNet:
|
||||
return firo.MINIMUM_CONFIRMATIONS;
|
||||
|
@ -135,9 +138,6 @@ extension CoinExt on Coin {
|
|||
|
||||
case Coin.monero:
|
||||
return xmr.MINIMUM_CONFIRMATIONS;
|
||||
|
||||
case Coin.bitcoincash:
|
||||
return bch.MINIMUM_CONFIRMATIONS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -147,6 +147,10 @@ Coin coinFromPrettyName(String name) {
|
|||
case "Bitcoin":
|
||||
case "bitcoin":
|
||||
return Coin.bitcoin;
|
||||
case "Bitcoincash":
|
||||
case "bitcoincash":
|
||||
case "Bitcoin Cash":
|
||||
return Coin.bitcoincash;
|
||||
case "Dogecoin":
|
||||
case "dogecoin":
|
||||
return Coin.dogecoin;
|
||||
|
@ -159,10 +163,6 @@ Coin coinFromPrettyName(String name) {
|
|||
case "Monero":
|
||||
case "monero":
|
||||
return Coin.monero;
|
||||
case "Bitcoincash":
|
||||
case "bitcoincash":
|
||||
case "Bitcoin Cash":
|
||||
return Coin.bitcoincash;
|
||||
case "Bitcoin Testnet":
|
||||
case "tBitcoin":
|
||||
case "bitcoinTestNet":
|
||||
|
@ -185,6 +185,8 @@ Coin coinFromTickerCaseInsensitive(String ticker) {
|
|||
switch (ticker.toLowerCase()) {
|
||||
case "btc":
|
||||
return Coin.bitcoin;
|
||||
case "bch":
|
||||
return Coin.bitcoincash;
|
||||
case "doge":
|
||||
return Coin.dogecoin;
|
||||
case "epic":
|
||||
|
@ -193,8 +195,6 @@ Coin coinFromTickerCaseInsensitive(String ticker) {
|
|||
return Coin.firo;
|
||||
case "xmr":
|
||||
return Coin.monero;
|
||||
case "bch":
|
||||
return Coin.bitcoincash;
|
||||
case "tbtc":
|
||||
return Coin.bitcoinTestNet;
|
||||
case "tfiro":
|
||||
|
|
|
@ -185,6 +185,7 @@ flutter:
|
|||
- assets/images/doge.png
|
||||
- assets/images/bitcoin.png
|
||||
- assets/images/epic-cash.png
|
||||
- assets/images/bitcoincash.png
|
||||
- assets/svg/plus.svg
|
||||
- assets/svg/gear.svg
|
||||
- assets/svg/bell.svg
|
||||
|
@ -261,6 +262,7 @@ flutter:
|
|||
- assets/svg/envelope.svg
|
||||
# coin icons
|
||||
- assets/svg/coin_icons/Bitcoin.svg
|
||||
- assets/svg/coin_icons/Bitcoincash.svg
|
||||
- assets/svg/coin_icons/Dogecoin.svg
|
||||
- assets/svg/coin_icons/EpicCash.svg
|
||||
- assets/svg/coin_icons/Firo.svg
|
||||
|
|
Loading…
Reference in a new issue