diff --git a/lib/pages/receive_view/generate_receiving_uri_qr_code_view.dart b/lib/pages/receive_view/generate_receiving_uri_qr_code_view.dart index bc1281156..46867c7e1 100644 --- a/lib/pages/receive_view/generate_receiving_uri_qr_code_view.dart +++ b/lib/pages/receive_view/generate_receiving_uri_qr_code_view.dart @@ -150,6 +150,7 @@ class _GenerateUriQrCodeViewState extends State { String receivingAddress = widget.receivingAddress; if ((widget.coin == Coin.bitcoincash || + widget.coin == Coin.eCash || widget.coin == Coin.bitcoincashTestnet) && receivingAddress.contains(":")) { // remove cash addr prefix @@ -246,6 +247,7 @@ class _GenerateUriQrCodeViewState extends State { String receivingAddress = widget.receivingAddress; if ((widget.coin == Coin.bitcoincash || + widget.coin == Coin.eCash || widget.coin == Coin.bitcoincashTestnet) && receivingAddress.contains(":")) { // remove cash addr prefix diff --git a/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart b/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart index 1ff1a1359..aa5461ab2 100644 --- a/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart +++ b/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart @@ -150,6 +150,7 @@ class _AddEditNodeViewState extends ConsumerState { case Coin.bitcoincash: case Coin.litecoin: case Coin.dogecoin: + case Coin.eCash: case Coin.firo: case Coin.namecoin: case Coin.particl: diff --git a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart index 5a0068c93..d3f8467cd 100644 --- a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart @@ -1033,6 +1033,7 @@ class _TransactionDetailsViewState final String height; if (widget.coin == Coin.bitcoincash || + widget.coin == Coin.eCash || widget.coin == Coin.bitcoincashTestnet) { height = "${_transaction.height != null && _transaction.height! > 0 ? _transaction.height! : "Pending"}"; diff --git a/lib/services/coins/ecash/ecash_wallet.dart b/lib/services/coins/ecash/ecash_wallet.dart index f45c23a73..ce04befe4 100644 --- a/lib/services/coins/ecash/ecash_wallet.dart +++ b/lib/services/coins/ecash/ecash_wallet.dart @@ -47,7 +47,7 @@ import 'package:stackwallet/widgets/crypto_notifications.dart'; import 'package:tuple/tuple.dart'; import 'package:uuid/uuid.dart'; -const int MINIMUM_CONFIRMATIONS = 1; +const int MINIMUM_CONFIRMATIONS = 0; const String GENESIS_HASH_MAINNET = "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"; @@ -361,9 +361,9 @@ class ECashWallet extends CoinServiceAPI print("format $format"); } - if (_coin == Coin.bitcoincashTestnet) { - return true; - } + // if (_coin == Coin.bitcoincashTestnet) { + // return true; + // } if (format == bitbox.Address.formatCashAddr) { return validateCashAddr(address); @@ -1899,7 +1899,7 @@ class ECashWallet extends CoinServiceAPI required List satoshiAmounts, }) async { final builder = bitbox.Bitbox.transactionBuilder( - testnet: coin == Coin.bitcoincashTestnet, + testnet: false, //coin == Coin.bitcoincashTestnet, ); // retrieve address' utxos from the rest api diff --git a/lib/services/coins/firo/firo_wallet.dart b/lib/services/coins/firo/firo_wallet.dart index 88af91067..16b382ce2 100644 --- a/lib/services/coins/firo/firo_wallet.dart +++ b/lib/services/coins/firo/firo_wallet.dart @@ -3361,33 +3361,33 @@ class FiroWallet extends CoinServiceAPI List> allTransactions = []; - final currentHeight = await chainHeight; + // final currentHeight = await chainHeight; for (final txHash in allTxHashes) { - final storedTx = await db - .getTransactions(walletId) - .filter() - .txidEqualTo(txHash["tx_hash"] as String) - .findFirst(); + // final storedTx = await db + // .getTransactions(walletId) + // .filter() + // .txidEqualTo(txHash["tx_hash"] as String) + // .findFirst(); - if (storedTx == null || - !storedTx.isConfirmed(currentHeight, MINIMUM_CONFIRMATIONS)) { - final tx = await cachedElectrumXClient.getTransaction( - txHash: txHash["tx_hash"] as String, - verbose: true, - coin: coin, - ); + // if (storedTx == null || + // !storedTx.isConfirmed(currentHeight, MINIMUM_CONFIRMATIONS)) { + final tx = await cachedElectrumXClient.getTransaction( + txHash: txHash["tx_hash"] as String, + verbose: true, + coin: coin, + ); - if (!_duplicateTxCheck(allTransactions, tx["txid"] as String)) { - tx["address"] = await db - .getAddresses(walletId) - .filter() - .valueEqualTo(txHash["address"] as String) - .findFirst(); - tx["height"] = txHash["height"]; - allTransactions.add(tx); - } + if (!_duplicateTxCheck(allTransactions, tx["txid"] as String)) { + tx["address"] = await db + .getAddresses(walletId) + .filter() + .valueEqualTo(txHash["address"] as String) + .findFirst(); + tx["height"] = txHash["height"]; + allTransactions.add(tx); } + // } } final List> txnsData = diff --git a/lib/services/coins/litecoin/litecoin_wallet.dart b/lib/services/coins/litecoin/litecoin_wallet.dart index 274520f1d..5f61ea96c 100644 --- a/lib/services/coins/litecoin/litecoin_wallet.dart +++ b/lib/services/coins/litecoin/litecoin_wallet.dart @@ -1793,6 +1793,18 @@ class LitecoinWallet extends CoinServiceAPI coin: coin, ); + bool shouldBlock = false; + String? blockReason; + String? label; + + final utxoAmount = jsonUTXO["value"] as int; + + if (utxoAmount <= 10000) { + shouldBlock = true; + blockReason = "May contain ordinal"; + label = "Possible ordinal"; + } + final vout = jsonUTXO["tx_pos"] as int; final outputs = txn["vout"] as List; @@ -1811,10 +1823,10 @@ class LitecoinWallet extends CoinServiceAPI walletId: walletId, txid: txn["txid"] as String, vout: vout, - value: jsonUTXO["value"] as int, - name: "", - isBlocked: false, - blockedReason: null, + value: utxoAmount, + name: label ?? "", + isBlocked: shouldBlock, + blockedReason: blockReason, isCoinbase: txn["is_coinbase"] as bool? ?? false, blockHash: txn["blockhash"] as String?, blockHeight: jsonUTXO["height"] as int?, @@ -1826,16 +1838,20 @@ class LitecoinWallet extends CoinServiceAPI } } - Logging.instance - .log('Outputs fetched: $outputArray', level: LogLevel.Info); + Logging.instance.log( + 'Outputs fetched: $outputArray', + level: LogLevel.Info, + ); await db.updateUTXOs(walletId, outputArray); // finally update balance await _updateBalance(); } catch (e, s) { - Logging.instance - .log("Output fetch unsuccessful: $e\n$s", level: LogLevel.Error); + Logging.instance.log( + "Output fetch unsuccessful: $e\n$s", + level: LogLevel.Error, + ); } } diff --git a/lib/utilities/enums/coin_enum.dart b/lib/utilities/enums/coin_enum.dart index f1109a626..2f06c7ba9 100644 --- a/lib/utilities/enums/coin_enum.dart +++ b/lib/utilities/enums/coin_enum.dart @@ -62,7 +62,7 @@ extension CoinExt on Coin { case Coin.epicCash: return "Epic Cash"; case Coin.eCash: - return "E-Cash"; + return "eCash"; case Coin.ethereum: return "Ethereum"; case Coin.firo: