Fix BSC and ARB QR scan in pay-anything flow (#3075)

David Adegoke committed Mar 13, 2026 at 17:47 UTC c72f6fd6276b8bdc467941d5e7f25b30d3997fa4
2 files changed +13 -3
cw_core/lib/crypto_currency.dart
+1
@@ -303,6 +303,7 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> implemen
303 'lightning': btcln,
304 'base': baseEth,
305 'arbitrum': arbEth,
306 + 'bsc': bnb,
307 };
308
309 static CryptoCurrency deserialize({required int raw}) {
lib/core/universal_address_detector.dart
+12 -3
@@ -2,6 +2,7 @@ import 'package:cake_wallet/utils/payment_request.dart';
2 import 'package:cake_wallet/core/address_validator.dart';
3 import 'package:cw_core/crypto_currency.dart';
4 import 'package:cw_core/lnurl.dart';
5 +import 'package:cw_core/payment_uris.dart';
6 import 'package:cw_core/wallet_type.dart';
7 import 'package:cw_core/currency_for_wallet_type.dart';
8
@@ -72,10 +73,18 @@ class UniversalAddressDetector {
73
74 final paymentRequest = PaymentRequest.fromUri(uri);
75
75 - // Determine currency from scheme
76 - final currency = CryptoCurrency.fromString(uri.scheme.toLowerCase());
76 + CryptoCurrency currency;
77 + int? chainId;
78 + if (uri.scheme.toLowerCase() == 'ethereum') {
79 + final erc681 = ERC681URI.fromUri(uri);
80 + chainId = erc681.chainId;
81 + currency = getCryptoCurrencyByChainId(chainId);
82 + } else {
83 + currency = CryptoCurrency.fromString(uri.scheme.toLowerCase());
84 + chainId = getChainIdByCryptoCurrency(currency);
85 + }
86 +
87 final walletType = cryptoCurrencyOrTokenToWalletType(currency);
78 - final chainId = getChainIdByCryptoCurrency(currency);
88
89 return AddressDetectionResult(
90 address: paymentRequest.address,