File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed
lib/wallets/crypto_currency/coins Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 1- import 'dart:typed_data' ;
2-
31import 'package:bech32/bech32.dart' ;
42import 'package:bitbox/bitbox.dart' as bitbox;
53import 'package:bs58check/bs58check.dart' as bs58check;
64import 'package:coinlib_flutter/coinlib_flutter.dart' as coinlib;
5+ import 'package:flutter/foundation.dart' ;
76
87import '../../../models/isar/models/blockchain_data/address.dart' ;
98import '../../../models/node_model.dart' ;
@@ -231,6 +230,17 @@ class Bitcoincash extends Bip39HDCurrency with ElectrumXCurrencyInterface {
231230 // Do not validate "p" (P2SH) addresses.
232231 }
233232
233+ @override
234+ AddressType ? getAddressType (String address) {
235+ final format = bitbox.Address .detectFormat (address);
236+
237+ return super .getAddressType (
238+ format == bitbox.Address .formatCashAddr
239+ ? bitbox.Address .toLegacyAddress (address)
240+ : address,
241+ );
242+ }
243+
234244 @override
235245 DerivePathType addressType ({required String address}) {
236246 Uint8List ? decodeBase58;
Original file line number Diff line number Diff line change @@ -222,6 +222,17 @@ class Ecash extends Bip39HDCurrency with ElectrumXCurrencyInterface {
222222 // Do not validate "p" (P2SH) addresses.
223223 }
224224
225+ @override
226+ AddressType ? getAddressType (String address) {
227+ final format = bitbox.Address .detectFormat (address);
228+
229+ return super .getAddressType (
230+ format == bitbox.Address .formatCashAddr
231+ ? bitbox.Address .toLegacyAddress (address)
232+ : address,
233+ );
234+ }
235+
225236 @override
226237 DerivePathType addressType ({required String address}) {
227238 Uint8List ? decodeBase58;
You can’t perform that action at this time.
0 commit comments