过滤币安 Web3 注入提供者,引导用户使用 WalletConnect 支付

This commit is contained in:
2569718930@qq.com
2026-05-20 19:00:07 +08:00
parent 871d21792e
commit edf41efad6
@@ -394,6 +394,13 @@ function detectWalletLabel(
) {
return "Bitget Wallet";
}
if (
(provider as any)?.isBinance ||
announcedName.toLowerCase().includes("binance") ||
announcedRdns.includes("binance")
) {
return "Binance Web3 Wallet";
}
if (announcedName) return announcedName;
return "EVM 钱包";
}
@@ -469,6 +476,9 @@ function listInjectedProviders(): InjectedProviderOption[] {
candidates.forEach((provider, index) => {
const detail = detailByProvider.get(provider);
const label = detectWalletLabel(provider, detail);
// Binance Web3 Wallet injected provider does not support eth_sendTransaction;
// users should use WalletConnect mode instead.
if (label.toLowerCase().includes("binance")) return;
const key = getInjectedProviderStableId(provider, index, detail);
if (seen.has(key)) return;
const normalizedLabel = label.trim().toLowerCase();