@@ -14,13 +14,13 @@ import { ROUTE } from '@/dex/constants'
1414import { useGaugeManager , useGaugeRewardsDistributors } from '@/dex/entities/gauge'
1515import { useNetworkByChain } from '@/dex/entities/networks'
1616import usePoolAlert from '@/dex/hooks/usePoolAlert'
17+ import { usePoolIdByAddressOrId } from '@/dex/hooks/usePoolIdByAddressOrId'
1718import useTokensMapper from '@/dex/hooks/useTokensMapper'
1819import { getUserPoolActiveKey } from '@/dex/store/createUserSlice'
1920import useStore from '@/dex/store/useStore'
2021import { getChainPoolIdActiveKey } from '@/dex/utils'
2122import { getPath } from '@/dex/utils/utilsRouter'
2223import { ManageGauge } from '@/dex/widgets/manage-gauge'
23- import type { PoolUrlParams } from '@/dex/types/main.types'
2424import Stack from '@mui/material/Stack'
2525import AlertBox from '@ui/AlertBox'
2626import { AppFormContentWrapper } from '@ui/AppForm'
@@ -52,13 +52,14 @@ const { MaxWidth } = SizesAndSpaces
5252
5353const Transfer = ( pageTransferProps : PageTransferProps ) => {
5454 const { params, curve, hasDepositAndStake, poolData, poolDataCacheOrApi, routerParams } = pageTransferProps
55- const { rChainId, rFormType, rPoolId } = routerParams
55+ const { rChainId, rFormType, rPoolIdOrAddress } = routerParams
56+ const poolId = usePoolIdByAddressOrId ( { chainId : rChainId , poolIdOrAddress : rPoolIdOrAddress } )
5657 const { signerAddress } = curve ?? { }
5758 const push = useNavigate ( )
5859 const poolAlert = usePoolAlert ( poolData )
5960 const { tokensMapper } = useTokensMapper ( rChainId )
60- const userPoolActiveKey = curve && rPoolId ? getUserPoolActiveKey ( curve , rPoolId ) : ''
61- const chainIdPoolId = getChainPoolIdActiveKey ( rChainId , rPoolId )
61+ const userPoolActiveKey = curve && poolId ? getUserPoolActiveKey ( curve , poolId ) : ''
62+ const chainIdPoolId = getChainPoolIdActiveKey ( rChainId , poolId )
6263 const userPoolBalances = useStore ( ( state ) => state . user . walletBalances [ userPoolActiveKey ] )
6364 const userPoolBalancesLoading = useStore ( ( state ) => state . user . walletBalancesLoading )
6465 const currencyReserves = useStore ( ( state ) => state . pools . currencyReserves [ chainIdPoolId ] )
@@ -91,7 +92,6 @@ const Transfer = (pageTransferProps: PageTransferProps) => {
9192 const [ seed , setSeed ] = useState ( DEFAULT_SEED )
9293
9394 const { pool } = poolDataCacheOrApi
94- const poolId = poolData ?. pool ?. id
9595 const { data : network } = useNetworkByChain ( { chainId : rChainId } )
9696 const { networkId, isLite, pricesApi } = network
9797 const poolAddress = poolData ?. pool . address
@@ -186,7 +186,7 @@ const Transfer = (pageTransferProps: PageTransferProps) => {
186186
187187 const toggleForm = useCallback (
188188 ( updatedFormType : TransferFormType ) => {
189- push ( getPath ( params , `${ ROUTE . PAGE_POOLS } /${ params . pool } /${ updatedFormType } ` ) )
189+ push ( getPath ( params , `${ ROUTE . PAGE_POOLS } /${ params . poolIdOrAddress } /${ updatedFormType } ` ) )
190190 } ,
191191 [ push , params ] ,
192192 )
@@ -207,7 +207,7 @@ const Transfer = (pageTransferProps: PageTransferProps) => {
207207
208208 return (
209209 < >
210- < MonadBannerAlert params = { params as PoolUrlParams } />
210+ < MonadBannerAlert chainId = { rChainId } poolIdOrAddress = { rPoolIdOrAddress } />
211211 < AppPageFormContainer isAdvanceMode = { true } >
212212 < AppPageFormsWrapper className = "grid-transfer" >
213213 < Stack
0 commit comments