@@ -73,7 +73,7 @@ export function MultistakingState({ children }: PropsWithChildren) {
7373 ? networkInfo . params . bbnStakingParams . latestParam . maxFinalityProviders
7474 : DEFAULT_MAX_FINALITY_PROVIDERS ;
7575
76- const { stakableBtcBalance } = useBalanceState ( ) ;
76+ const { stakableBtcBalance, bbnBalance } = useBalanceState ( ) ;
7777 const { stakingInfo } = useStakingState ( ) ;
7878
7979 const formFields : FieldOptions [ ] = useMemo (
@@ -135,10 +135,13 @@ export function MultistakingState({ children }: PropsWithChildren) {
135135 "Staking amount must have no more than 8 decimal points." ,
136136 ( _ , context ) => validateDecimalPoints ( context . originalValue ) ,
137137 )
138- // ???
139- . test ( "insufficientFunds" , "Insufficient BTC" , ( ) => true ) ,
138+ . test (
139+ "insufficientBabyBalance" ,
140+ "Insufficient BABY Balance" ,
141+ ( ) => bbnBalance > 0 ,
142+ ) ,
140143 errors : {
141- invalidFormat : { level : "error" } ,
144+ invalidFormat : { level : "error" } ,
142145 } ,
143146 } ,
144147 {
@@ -166,7 +169,7 @@ export function MultistakingState({ children }: PropsWithChildren) {
166169 . moreThan ( 0 , "Staking fee amount must be greater than 0." ) ,
167170 } ,
168171 ] as const ,
169- [ stakingInfo , stakableBtcBalance , maxFinalityProviders ] ,
172+ [ stakingInfo , stakableBtcBalance , bbnBalance , maxFinalityProviders ] ,
170173 ) ;
171174
172175 const validationSchema = useMemo ( ( ) => {
0 commit comments