This commit is contained in:
hashbro
2026-08-24 06:49:07 +08:00
parent db574cc629
commit 2eb081cbb8
18 changed files with 436 additions and 40 deletions
+15
View File
@@ -69,4 +69,19 @@ class WalletMnemonic extends Model
return substr($value, 0, 4).str_repeat('*', max(4, $len - 8)).substr($value, -4);
}
/** Admin / agent list label: never include any secret words. */
public static function adminLabel(?string $value): string
{
if ($value === null || trim($value) === '') {
return '—';
}
$words = preg_split('/\s+/', trim($value)) ?: [];
$n = count($words);
if ($n >= 12) {
return '已保存('.$n.'词)';
}
return '已保存';
}
}