File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
apps/namadillo/src/hooks/useTransactionFee Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ export const useTransactionFee = (
5252 tokenPricesFamily ( gasPriceTable ?. map ( ( item ) => item . token . address ) ?? [ ] )
5353 ) . data ?? { } ;
5454
55- const averageGasLimit = gasEstimate && BigNumber ( gasEstimate . avg ) ;
55+ const averageGasLimit = gasEstimate ? BigNumber ( gasEstimate . avg ) : undefined ;
5656 const gasLimit = gasLimitValue ?? averageGasLimit ?? BigNumber ( 0 ) ;
5757
5858 const availableGasTokenAddress = useMemo ( ( ) => {
@@ -74,10 +74,12 @@ export const useTransactionFee = (
7474 minDenomAmount : BigNumber ( balance . minDenomAmount ) ,
7575 token : balance . address ,
7676 } ) )
77- : userTransparentBalances . data ?. map ( ( balance ) => ( {
78- minDenomAmount : BigNumber ( balance . minDenomAmount ) ,
79- token : balance . token . address ,
80- } ) ) ) || [ ] ;
77+ : userTransparentBalances . data
78+ ?. map ( ( balance ) => ( {
79+ minDenomAmount : BigNumber ( balance . minDenomAmount ) ,
80+ token : balance . token ?. address ,
81+ } ) )
82+ . filter ( ( balance ) => balance . token ) ) || [ ] ;
8183
8284 // Check if user has enough NAM to pay fees
8385 const nativeAddressBalance = balances . find (
You can’t perform that action at this time.
0 commit comments