feat: add lud16 field

environments/review-set-lightn-7857tt/deployments/4635
P. Reis 2024-05-22 17:35:11 -03:00
rodzic e9b830afa6
commit 9aa160d687
2 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -128,6 +128,9 @@ interface AccountCredentials {
birthday?: string; birthday?: string;
/** Nostr NIP-05 identifier. */ /** Nostr NIP-05 identifier. */
nip05?: string; nip05?: string;
/** Lightning address.
* https://github.com/lnurl/luds/blob/luds/16.md */
lud16?: string;
} }
/** Convert an account into an update_credentials request object. */ /** Convert an account into an update_credentials request object. */
@ -151,6 +154,7 @@ const accountToCredentials = (account: Account): AccountCredentials => {
location: account.location, location: account.location,
birthday: account.pleroma?.birthday ?? undefined, birthday: account.pleroma?.birthday ?? undefined,
nip05: account.source?.nostr?.nip05 ?? '', nip05: account.source?.nostr?.nip05 ?? '',
lud16: account?.nostr?.lud16 ?? '',
}; };
}; };

Wyświetl plik

@ -63,6 +63,7 @@ const baseAccountSchema = z.object({
]).catch(null), ]).catch(null),
nostr: coerceObject({ nostr: coerceObject({
pubkey: n.id().optional().catch(undefined), pubkey: n.id().optional().catch(undefined),
lud16: z.string().email().optional().catch(undefined),
}), }),
note: contentSchema, note: contentSchema,
/** Fedibird extra settings. */ /** Fedibird extra settings. */
@ -183,4 +184,4 @@ const accountSchema = baseAccountSchema.extend({
type Account = Resolve<z.infer<typeof accountSchema>>; type Account = Resolve<z.infer<typeof accountSchema>>;
export { accountSchema, type Account }; export { accountSchema, type Account };