feat: add ADDRESS_CHECK_REGEX (#415)

This commit is contained in:
Dream Hunter
2024-08-17 00:11:28 +08:00
committed by GitHub
parent 9888f98d74
commit 3664028e06
14 changed files with 74 additions and 20 deletions
+6 -1
View File
@@ -121,7 +121,12 @@ api.post('/api/new_address', async (c) => {
}
try {
const addressPrefix = await getAddressPrefix(c);
const res = await newAddress(c, name, domain, true, true, addressPrefix);
const res = await newAddress(c, {
name, domain,
enablePrefix: true,
checkLengthByConfig: true,
addressPrefix
});
return c.json(res);
} catch (e) {
return c.text(`Failed create address: ${(e as Error).message}`, 400)