fix: db
This commit is contained in:
@@ -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>
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user