dash tweaks and theme updates

This commit is contained in:
julian 2024-06-21 12:14:31 -06:00
parent 33ec9f1fb9
commit 7d2a903da4
7 changed files with 46 additions and 56 deletions

View file

@ -3,6 +3,7 @@ import 'package:coinlib_flutter/coinlib_flutter.dart' as coinlib;
import '../../../models/isar/models/blockchain_data/address.dart'; import '../../../models/isar/models/blockchain_data/address.dart';
import '../../../models/node_model.dart'; import '../../../models/node_model.dart';
import '../../../utilities/amount/amount.dart'; import '../../../utilities/amount/amount.dart';
import '../../../utilities/default_nodes.dart';
import '../../../utilities/enums/derive_path_type_enum.dart'; import '../../../utilities/enums/derive_path_type_enum.dart';
import '../crypto_currency.dart'; import '../crypto_currency.dart';
import '../interfaces/electrumx_currency_interface.dart'; import '../interfaces/electrumx_currency_interface.dart';
@ -17,10 +18,10 @@ class Dash extends Bip39HDCurrency with ElectrumXCurrencyInterface {
_id = _idMain; _id = _idMain;
_name = "Dash"; _name = "Dash";
_ticker = "DASH"; _ticker = "DASH";
case CryptoCurrencyNetwork.test: // case CryptoCurrencyNetwork.test:
_id = "dashTestNet"; // _id = "dashTestNet";
_name = "tDash"; // _name = "tDash";
_ticker = "tDASH"; // _ticker = "tDASH";
default: default:
throw Exception("Unsupported network: $network"); throw Exception("Unsupported network: $network");
} }
@ -67,9 +68,9 @@ class Dash extends Bip39HDCurrency with ElectrumXCurrencyInterface {
case 204: // dash mainnet wif case 204: // dash mainnet wif
coinType = "5"; // dash mainnet coinType = "5"; // dash mainnet
break; break;
case 239: // dash testnet wif // case 239: // dash testnet wif
coinType = "1"; // dash testnet // coinType = "1"; // dash testnet
break; // break;
default: default:
throw Exception("Invalid Dash network wif used!"); throw Exception("Invalid Dash network wif used!");
} }
@ -96,11 +97,10 @@ class Dash extends Bip39HDCurrency with ElectrumXCurrencyInterface {
@override @override
String get genesisHash { String get genesisHash {
switch (network) { switch (network) {
// TODO case CryptoCurrencyNetwork.main:
// case CryptoCurrencyNetwork.main: return "00000ffd590b1485b3caadc19b22e6379c733355108f107a430458cdf3407ab6";
// return " ";
// case CryptoCurrencyNetwork.test: // case CryptoCurrencyNetwork.test:
// return " "; // return "00000bafbc94add76cb75e2ec92894837288a481e5c005f6563d91623bf8bc2c";
default: default:
throw Exception("Unsupported network: $network"); throw Exception("Unsupported network: $network");
} }
@ -129,7 +129,7 @@ class Dash extends Bip39HDCurrency with ElectrumXCurrencyInterface {
} }
@override @override
int get minConfirms => 1; int get minConfirms => 6;
@override @override
coinlib.Network get networkParams { coinlib.Network get networkParams {
@ -147,19 +147,19 @@ class Dash extends Bip39HDCurrency with ElectrumXCurrencyInterface {
minOutput: dustLimit.raw, // Not used in stack wallet currently minOutput: dustLimit.raw, // Not used in stack wallet currently
feePerKb: BigInt.from(1), // Not used in stack wallet currently feePerKb: BigInt.from(1), // Not used in stack wallet currently
); );
case CryptoCurrencyNetwork.test: // case CryptoCurrencyNetwork.test:
return coinlib.Network( // return coinlib.Network(
p2pkhPrefix: 140, // p2pkhPrefix: 140,
p2shPrefix: 19, // p2shPrefix: 19,
wifPrefix: 239, // wifPrefix: 239,
pubHDPrefix: 0x043587CF, // pubHDPrefix: 0x043587CF,
privHDPrefix: 0x04358394, // privHDPrefix: 0x04358394,
bech32Hrp: "tdash", // TODO ????? // bech32Hrp: "tdash", // TODO ?????
messagePrefix: '\x18Dash Signed Message:\n', // TODO ????? // messagePrefix: '\x18Dash Signed Message:\n', // TODO ?????
minFee: BigInt.from(1), // Not used in stack wallet currently // minFee: BigInt.from(1), // Not used in stack wallet currently
minOutput: dustLimit.raw, // Not used in stack wallet currently // minOutput: dustLimit.raw, // Not used in stack wallet currently
feePerKb: BigInt.from(1), // Not used in stack wallet currently // feePerKb: BigInt.from(1), // Not used in stack wallet currently
); // );
default: default:
throw Exception("Unsupported network: $network"); throw Exception("Unsupported network: $network");
} }
@ -178,31 +178,18 @@ class Dash extends Bip39HDCurrency with ElectrumXCurrencyInterface {
@override @override
NodeModel get defaultNode { NodeModel get defaultNode {
switch (network) { switch (network) {
// case CryptoCurrencyNetwork.main: case CryptoCurrencyNetwork.main:
// return NodeModel( return NodeModel(
// host: "dash.stackwallet.com", host: "dash.stackwallet.com",
// port: 50022, port: 60002,
// name: DefaultNodes.defaultName, name: DefaultNodes.defaultName,
// id: DefaultNodes.buildId(this), id: DefaultNodes.buildId(this),
// useSSL: true, useSSL: true,
// enabled: true, enabled: true,
// coinName: identifier, coinName: identifier,
// isFailover: true, isFailover: true,
// isDown: false, isDown: false,
// ); );
//
// case CryptoCurrencyNetwork.test:
// return NodeModel(
// host: "dash-testnet.stackwallet.com",
// port: 50022,
// name: DefaultNodes.defaultName,
// id: DefaultNodes.buildId(this),
// useSSL: true,
// enabled: true,
// coinName: identifier,
// isFailover: true,
// isDown: false,
// );
default: default:
throw UnimplementedError(); throw UnimplementedError();
@ -231,7 +218,7 @@ class Dash extends Bip39HDCurrency with ElectrumXCurrencyInterface {
BigInt get satsPerCoin => BigInt.from(100000000); BigInt get satsPerCoin => BigInt.from(100000000);
@override @override
int get targetBlockTimeSeconds => 60; int get targetBlockTimeSeconds => 150;
@override @override
DerivePathType get defaultDerivePathType => DerivePathType.bip44; DerivePathType get defaultDerivePathType => DerivePathType.bip44;
@ -239,9 +226,12 @@ class Dash extends Bip39HDCurrency with ElectrumXCurrencyInterface {
@override @override
Uri defaultBlockExplorer(String txid) { Uri defaultBlockExplorer(String txid) {
switch (network) { switch (network) {
// TODO case CryptoCurrencyNetwork.main:
// case CryptoCurrencyNetwork.main: return Uri.parse("https://insight.dash.org/insight/tx/$txid");
// case CryptoCurrencyNetwork.test: // case CryptoCurrencyNetwork.test:
// return Uri.parse(
// "https://insight.testnet.networks.dash.org:3002/insight/tx/$txid",
// );
default: default:
throw Exception( throw Exception(
"Unsupported network for defaultBlockExplorer(): $network", "Unsupported network for defaultBlockExplorer(): $network",
@ -250,7 +240,7 @@ class Dash extends Bip39HDCurrency with ElectrumXCurrencyInterface {
} }
@override @override
int get transactionVersion => 1; int get transactionVersion => 2;
@override @override
BigInt get defaultFeeRate => BigInt.from(1000); // TODO check for dash? BigInt get defaultFeeRate => BigInt.from(1000); // TODO check for dash?

View file

@ -7,6 +7,7 @@ import '../../../models/isar/models/blockchain_data/v2/output_v2.dart';
import '../../../models/isar/models/blockchain_data/v2/transaction_v2.dart'; import '../../../models/isar/models/blockchain_data/v2/transaction_v2.dart';
import '../../../utilities/amount/amount.dart'; import '../../../utilities/amount/amount.dart';
import '../../../utilities/logger.dart'; import '../../../utilities/logger.dart';
import '../../../utilities/util.dart';
import '../../crypto_currency/crypto_currency.dart'; import '../../crypto_currency/crypto_currency.dart';
import '../../crypto_currency/interfaces/electrumx_currency_interface.dart'; import '../../crypto_currency/interfaces/electrumx_currency_interface.dart';
import '../intermediate/bip39_hd_wallet.dart'; import '../intermediate/bip39_hd_wallet.dart';
@ -243,7 +244,7 @@ class DashWallet<T extends ElectrumXCurrencyInterface> extends Bip39HDWallet<T>
final tx = TransactionV2( final tx = TransactionV2(
walletId: walletId, walletId: walletId,
blockHash: txData["blockhash"] as String?, blockHash: txData["blockhash"] as String?,
hash: txData["hash"] as String, hash: txData["txid"] as String,
txid: txData["txid"] as String, txid: txData["txid"] as String,
height: txData["height"] as int?, height: txData["height"] as int?,
version: txData["version"] as int, version: txData["version"] as int,

View file

@ -75,7 +75,6 @@ final List<CryptoCurrency> _supportedCoins = List.unmodifiable([
Bitcoincash(CryptoCurrencyNetwork.test), Bitcoincash(CryptoCurrencyNetwork.test),
BitcoinFrost(CryptoCurrencyNetwork.test), BitcoinFrost(CryptoCurrencyNetwork.test),
BitcoinFrost(CryptoCurrencyNetwork.test4), BitcoinFrost(CryptoCurrencyNetwork.test4),
Dash(CryptoCurrencyNetwork.test),
Dogecoin(CryptoCurrencyNetwork.test), Dogecoin(CryptoCurrencyNetwork.test),
Firo(CryptoCurrencyNetwork.test), Firo(CryptoCurrencyNetwork.test),
Litecoin(CryptoCurrencyNetwork.test), Litecoin(CryptoCurrencyNetwork.test),