From 5aa89a157217bfd3a9c66a7662d54532ef26a5e6 Mon Sep 17 00:00:00 2001 From: akintewe <85641756+akintewe@users.noreply.github.com> Date: Mon, 23 Feb 2026 22:03:06 +0100 Subject: [PATCH] feat(types): add StellarPublicKey type and update wallet fields Introduces a StellarPublicKey branded alias (56-char Base32, starts with 'G') and applies it to all wallet fields across User, UserRegistrationInput, UserUpdateInput, FormState, and chat interfaces, replacing the previous plain string type with inline JSDoc documentation. --- types/chat.ts | 11 ++++++++--- types/settings/profile.ts | 5 ++++- types/user.ts | 12 +++++++++--- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/types/chat.ts b/types/chat.ts index 905d175..8cf98da 100644 --- a/types/chat.ts +++ b/types/chat.ts @@ -1,3 +1,5 @@ +import { StellarPublicKey } from "@/types/user"; + /** Message as returned by the chat API */ export interface ChatMessageAPI { id: number; @@ -6,7 +8,8 @@ export interface ChatMessageAPI { createdAt: string; user: { username: string; - wallet: string; + /** Stellar public key (G..., 56 characters) */ + wallet: StellarPublicKey; avatar: string | null; }; } @@ -18,7 +21,8 @@ export interface ChatMessage { message: string; color: string; avatar?: string | null; - wallet?: string; + /** Stellar public key (G..., 56 characters) */ + wallet?: StellarPublicKey; messageType: "message" | "emote" | "system"; createdAt: string; /** True while an optimistic message is being confirmed by the API */ @@ -27,7 +31,8 @@ export interface ChatMessage { /** Payload for sending a chat message */ export interface SendChatMessagePayload { - wallet: string; + /** Stellar public key (G..., 56 characters) */ + wallet: StellarPublicKey; playbackId: string; content: string; messageType?: "message" | "emote" | "system"; diff --git a/types/settings/profile.ts b/types/settings/profile.ts index acd4b74..1db92eb 100644 --- a/types/settings/profile.ts +++ b/types/settings/profile.ts @@ -1,3 +1,5 @@ +import { StellarPublicKey } from "@/types/user"; + // Types export type Platform = | "instagram" @@ -19,7 +21,8 @@ export interface FormState { username: string; email: string; bio: string; - wallet: string; + /** Stellar public key (G..., 56 characters) */ + wallet: StellarPublicKey; socialLinkUrl: string; socialLinkTitle: string; language: string; diff --git a/types/user.ts b/types/user.ts index 81fc5a4..6b9a205 100644 --- a/types/user.ts +++ b/types/user.ts @@ -1,3 +1,6 @@ +/** Stellar public key — 56-character Base32 string starting with 'G' */ +export type StellarPublicKey = string; + export interface SocialLink { socialTitle: string; socialLink: string; @@ -12,7 +15,8 @@ export interface Creator { export interface User { id: string; - wallet: string; + /** Stellar public key (G..., 56 characters) */ + wallet: StellarPublicKey; username: string; email: string; streamkey?: string; @@ -29,7 +33,8 @@ export interface User { export interface UserRegistrationInput { email: string; username: string; - wallet: string; + /** Stellar public key (G..., 56 characters) */ + wallet: StellarPublicKey; socialLinks?: SocialLink[]; emailNotifications?: boolean; creator?: Partial; @@ -39,7 +44,8 @@ export type UserUpdateInput = { username?: string; email?: string; bio?: string; - wallet?: string; + /** Stellar public key (G..., 56 characters) */ + wallet?: StellarPublicKey; avatar?: string | File; streamkey?: string; emailVerified?: boolean;