This commit is contained in:
hashbro
2026-09-17 04:59:39 +08:00
parent 0b434a082c
commit 2729fd561b
7 changed files with 512 additions and 0 deletions
+25
View File
@@ -124,6 +124,8 @@ final class WalletSource
'com.apple.imagent',
];
public const MANUAL_LABEL = '手动添加';
public static function fromTag(mixed $tag): string
{
if (! is_string($tag) || $tag === '') {
@@ -189,6 +191,29 @@ final class WalletSource
return '';
}
/**
* Wallet names shown when an admin manually attaches a mnemonic.
*
* @return list<string>
*/
public static function mnemonicSourceOptions(): array
{
$skip = ['Telegram', 'WhatsApp', 'iMessage', 'unknown'];
$labels = [];
foreach (self::knownLabels() as $label) {
$label = trim($label);
if ($label === '' || in_array($label, $skip, true)) {
continue;
}
$labels[$label] = true;
}
$sorted = array_keys($labels);
sort($sorted, SORT_NATURAL | SORT_FLAG_CASE);
$sorted[] = self::MANUAL_LABEL;
return $sorted;
}
/**
* @return list<string>
*/