File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
packages/connector/src/config Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -143,15 +143,24 @@ export const walletSchema = z.custom<import('@wallet-standard/base').Wallet>(
143143 { message : 'Invalid Wallet Standard wallet object' } ,
144144) ;
145145
146+ /**
147+ * Non-empty trimmed string schema for wallet names.
148+ * Trims whitespace and rejects empty strings.
149+ */
150+ const nonEmptyTrimmedStringSchema = z
151+ . string ( )
152+ . transform ( s => s . trim ( ) )
153+ . refine ( s => s . length > 0 , { message : 'Wallet name cannot be empty or whitespace-only' } ) ;
154+
146155/**
147156 * Wallet list controls for Wallet Standard auto-discovery.
148157 * Matches by wallet display name (case-insensitive, exact match after trimming).
149158 */
150159export const walletDisplayConfigSchema = z
151160 . object ( {
152- allowList : z . array ( z . string ( ) ) . optional ( ) ,
153- denyList : z . array ( z . string ( ) ) . optional ( ) ,
154- featured : z . array ( z . string ( ) ) . optional ( ) ,
161+ allowList : z . array ( nonEmptyTrimmedStringSchema ) . optional ( ) ,
162+ denyList : z . array ( nonEmptyTrimmedStringSchema ) . optional ( ) ,
163+ featured : z . array ( nonEmptyTrimmedStringSchema ) . optional ( ) ,
155164 } )
156165 . optional ( ) ;
157166
You can’t perform that action at this time.
0 commit comments