File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -373,11 +373,15 @@ export const dexFormSchema = dexSchema
373373 . optional ( ) ,
374374 swapFeeBps : z
375375 . union ( [
376- z . number ( ) . int ( ) ,
376+ z . number ( ) . int ( ) . min ( 0 ) . max ( 100 ) ,
377377 z . string ( ) . transform ( val => {
378378 if ( ! val || val . trim ( ) === "" ) return null ;
379379 const parsed = parseInt ( val , 10 ) ;
380- return isNaN ( parsed ) ? null : parsed ;
380+ if ( isNaN ( parsed ) ) return null ;
381+ if ( parsed < 0 || parsed > 100 ) {
382+ throw new Error ( "Swap fee must be between 0 and 100 bps (1%)" ) ;
383+ }
384+ return parsed ;
381385 } ) ,
382386 z . null ( ) ,
383387 ] )
Original file line number Diff line number Diff line change @@ -840,6 +840,7 @@ export function useDexForm(): UseDexFormReturn {
840840 enableServiceDisclaimerDialog :
841841 response . enableServiceDisclaimerDialog || false ,
842842 enableCampaigns : response . enableCampaigns || false ,
843+ swapFeeBps : response . swapFeeBps ?? null ,
843844 chainIds : response . chainIds || [ ] ,
844845 defaultChain : response . defaultChain || undefined ,
845846 disableMainnet : response . disableMainnet || false ,
@@ -855,6 +856,7 @@ export function useDexForm(): UseDexFormReturn {
855856 seoTwitterHandle : response . seoTwitterHandle || "" ,
856857 seoThemeColor : response . seoThemeColor || "" ,
857858 seoKeywords : response . seoKeywords || "" ,
859+ analyticsScript : response . analyticsScript || "" ,
858860 themeCSS : response . themeCSS ,
859861 } ) ;
860862
You can’t perform that action at this time.
0 commit comments