@@ -71,7 +71,7 @@ export function BalanceInput({
71
71
if ( token && ! Number . isNaN ( Number ( input ) ) ) {
72
72
parsed = parseValue ( input , token . decimals ) ;
73
73
insufficientRef . current = balance !== undefined && balance < parsed . value ? true : false ;
74
- exceededRef . current = max && max < parsed . value ? true : false ;
74
+ exceededRef . current = typeof max === "bigint" && max < parsed . value ? true : false ;
75
75
valid = ! ( insufficientRef . current || exceededRef . current ) ;
76
76
onChange ( { valid, ...parsed } ) ;
77
77
}
@@ -128,7 +128,7 @@ export function BalanceInput({
128
128
if ( token && token . decimals !== tokenRef . current ?. decimals ) {
129
129
const parsed = parseValue ( value . input , token . decimals ) ;
130
130
insufficientRef . current = balance !== undefined && balance < parsed . value ? true : false ;
131
- exceededRef . current = max && max < parsed . value ? true : false ;
131
+ exceededRef . current = typeof max === "bigint" && max < parsed . value ? true : false ;
132
132
const valid = ! ( insufficientRef . current || exceededRef . current ) ;
133
133
onChange ( { valid, ...parsed } ) ;
134
134
}
@@ -141,7 +141,7 @@ export function BalanceInput({
141
141
const decimals = token . decimals ;
142
142
const parsed = parseValue ( formatUnits ( max ?? 0n , decimals ) , decimals ) ;
143
143
insufficientRef . current = balance !== undefined && balance < parsed . value ? true : false ;
144
- exceededRef . current = max && max < parsed . value ? true : false ;
144
+ exceededRef . current = typeof max === "bigint" && max < parsed . value ? true : false ;
145
145
const valid = ! ( insufficientRef . current || exceededRef . current ) ;
146
146
onChange ( { valid, ...parsed } ) ;
147
147
}
0 commit comments