From e5dea740963a444c95482efae93da67342fb594d Mon Sep 17 00:00:00 2001 From: sneurlax Date: Mon, 30 Dec 2024 19:50:25 -0600 Subject: [PATCH] fix: override identifier WIP because this causes issues with BIP48Bitcoin not being in the configured list of supported coins as per AppConfig but we don't want it to appear as a distinct coin so that could be an issue --- .../crypto_currency/coins/bip48_bitcoin.dart | 43 ++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/lib/wallets/crypto_currency/coins/bip48_bitcoin.dart b/lib/wallets/crypto_currency/coins/bip48_bitcoin.dart index c17c9bb5f..8947d58cc 100644 --- a/lib/wallets/crypto_currency/coins/bip48_bitcoin.dart +++ b/lib/wallets/crypto_currency/coins/bip48_bitcoin.dart @@ -1,8 +1,47 @@ import '../../../utilities/enums/derive_path_type_enum.dart'; -import 'bitcoin.dart'; +import '../crypto_currency.dart'; class BIP48Bitcoin extends Bitcoin { - BIP48Bitcoin(super.network); + BIP48Bitcoin(super.network) { + _idMain = "bip48Bitcoin"; + _uriScheme = "bitcoin"; + switch (network) { + case CryptoCurrencyNetwork.main: + _id = _idMain; + _name = "Bitcoin"; + _ticker = "BTC"; + case CryptoCurrencyNetwork.test: + _id = "bip48BitcoinTestNet"; + _name = "tBitcoin"; + _ticker = "tBTC"; + case CryptoCurrencyNetwork.test4: + _id = "bip48BitcoinTestNet4"; + _name = "t4Bitcoin"; + _ticker = "t4BTC"; + default: + throw Exception("Unsupported network: $network"); + } + } + + late final String _id; + @override + String get identifier => _id; + + late final String _idMain; + @override + String get mainNetId => _idMain; + + late final String _name; + @override + String get prettyName => _name; + + late final String _uriScheme; + @override + String get uriScheme => _uriScheme; + + late final String _ticker; + @override + String get ticker => _ticker; @override List get supportedDerivationPathTypes => [