diff --git a/src/components/AddWithdraw/AddWithdrawRouterView.tsx b/src/components/AddWithdraw/AddWithdrawRouterView.tsx
index 189747014..878848649 100644
--- a/src/components/AddWithdraw/AddWithdrawRouterView.tsx
+++ b/src/components/AddWithdraw/AddWithdrawRouterView.tsx
@@ -9,6 +9,7 @@ import { useUserStore } from '@/redux/hooks'
import { AccountType, Account } from '@/interfaces'
import { useWithdrawFlow } from '@/context/WithdrawFlowContext'
import { useOnrampFlow } from '@/context/OnrampFlowContext'
+import { isMantecaCountry } from '@/constants/manteca.consts'
import Card from '@/components/Global/Card'
import AvatarWithBadge from '@/components/Profile/AvatarWithBadge'
import { CountryList } from '../Common/CountryList'
@@ -33,7 +34,8 @@ export const AddWithdrawRouterView: FC
= ({
}) => {
const router = useRouter()
const { user } = useUserStore()
- const { setSelectedBankAccount, showAllWithdrawMethods, setShowAllWithdrawMethods } = useWithdrawFlow()
+ const { setSelectedBankAccount, showAllWithdrawMethods, setShowAllWithdrawMethods, setSelectedMethod } =
+ useWithdrawFlow()
const onrampFlowContext = useOnrampFlow()
const { setFromBankSelected } = onrampFlowContext
const [recentMethodsState, setRecentMethodsState] = useState([])
@@ -90,6 +92,23 @@ export const AddWithdrawRouterView: FC = ({
return
}
+ // NEW: For withdraw flow, set selected method in context instead of navigating
+ if (flow === 'withdraw') {
+ const methodType =
+ method.type === 'crypto' ? 'crypto' : isMantecaCountry(method.path) ? 'manteca' : 'bridge'
+
+ setSelectedMethod({
+ type: methodType,
+ countryPath: method.path,
+ currency: method.currency,
+ title: method.title,
+ })
+
+ // Don't navigate - let the main withdraw page handle the flow
+ return
+ }
+
+ // Original add flow logic
const newRecentMethod: RecentMethod = {
id: method.id,
type: method.type as 'crypto' | 'country',
@@ -168,6 +187,14 @@ export const AddWithdrawRouterView: FC = ({
savedAccounts={savedAccounts}
onAccountClick={(account, path) => {
setSelectedBankAccount(account)
+
+ // FIXED: For withdraw flow, route to saved account path
+ if (flow === 'withdraw') {
+ router.push(path)
+ return
+ }
+
+ // Original add flow
router.push(path)
}}
onSelectNewMethodClick={() => setShouldShowAllMethods(true)}
@@ -233,6 +260,14 @@ export const AddWithdrawRouterView: FC = ({
inputTitle={mainHeading}
viewMode="add-withdraw"
onCountryClick={(country) => {
+ if (flow === 'withdraw') {
+ // FIXED: Route directly to country page for method selection
+ const countryPath = `${baseRoute}/${country.path}`
+ router.push(countryPath)
+ return
+ }
+
+ // Original add flow
const countryPath = `${baseRoute}/${country.path}`
router.push(countryPath)
}}
@@ -240,8 +275,13 @@ export const AddWithdrawRouterView: FC = ({
if (flow === 'add') {
setIsDrawerOpen(true)
} else {
- const cryptoPath = `${baseRoute}/crypto`
- router.push(cryptoPath)
+ // Set crypto method and navigate to main page for amount input
+ setSelectedMethod({
+ type: 'crypto',
+ countryPath: 'crypto',
+ title: 'Crypto',
+ })
+ router.push('/withdraw')
}
}}
flow={flow}
diff --git a/src/components/TransactionDetails/transactionTransformer.ts b/src/components/TransactionDetails/transactionTransformer.ts
index ed65cd4e9..fc491cdd6 100644
--- a/src/components/TransactionDetails/transactionTransformer.ts
+++ b/src/components/TransactionDetails/transactionTransformer.ts
@@ -248,6 +248,7 @@ export function mapTransactionDataForDrawer(entry: HistoryEntry): MappedTransact
isPeerActuallyUser = false
break
case EHistoryEntryType.BRIDGE_OFFRAMP:
+ case EHistoryEntryType.MANTECA_OFFRAMP:
direction = 'bank_withdraw'
transactionCardType = 'bank_withdraw'
nameForDetails = 'Bank Account'
diff --git a/src/constants/loadingStates.consts.ts b/src/constants/loadingStates.consts.ts
index ee502f0c5..e0cd66b68 100644
--- a/src/constants/loadingStates.consts.ts
+++ b/src/constants/loadingStates.consts.ts
@@ -27,3 +27,4 @@ export type LoadingStates =
| 'Logging in'
| 'Logging out'
| 'Paying'
+ | 'Withdrawing'
diff --git a/src/constants/manteca.consts.ts b/src/constants/manteca.consts.ts
index 9330c63dd..ab2fb17ff 100644
--- a/src/constants/manteca.consts.ts
+++ b/src/constants/manteca.consts.ts
@@ -1 +1,23 @@
export const MANTECA_DEPOSIT_ADDRESS = '0x959e088a09f61aB01cb83b0eBCc74b2CF6d62053'
+
+// Countries that use Manteca for bank withdrawals instead of Bridge
+export const MANTECA_COUNTRIES = [
+ 'argentina', // ARS, USD, BRL (QR pix payments)
+ 'chile', // CLP
+ 'brazil', // BRL
+ 'colombia', // COP
+ 'panama', // PUSD
+ 'costa-rica', // CRC
+ 'guatemala', // GTQ
+ // 'mexico', // MXN - Keep as Bridge (CoDi disabled)
+ 'philippines', // PHP
+ 'bolivia', // BOB
+] as const
+
+// Type for Manteca countries
+export type MantecaCountry = (typeof MANTECA_COUNTRIES)[number]
+
+// Helper function to check if a country uses Manteca
+export const isMantecaCountry = (countryPath: string): boolean => {
+ return MANTECA_COUNTRIES.includes(countryPath as MantecaCountry)
+}
diff --git a/src/context/WithdrawFlowContext.tsx b/src/context/WithdrawFlowContext.tsx
index 2841df2f3..7b9ad71ce 100644
--- a/src/context/WithdrawFlowContext.tsx
+++ b/src/context/WithdrawFlowContext.tsx
@@ -4,6 +4,15 @@ import { ITokenPriceData, Account } from '@/interfaces'
import { interfaces as peanutInterfaces } from '@squirrel-labs/peanut-sdk'
import React, { createContext, ReactNode, useContext, useMemo, useState, useCallback } from 'react'
+export interface WithdrawMethod {
+ type: 'bridge' | 'manteca' | 'crypto'
+ countryPath?: string
+ currency?: string
+ minimumAmount?: number
+ savedAccount?: Account
+ title?: string
+}
+
export type WithdrawView = 'INITIAL' | 'CONFIRM' | 'STATUS'
export interface WithdrawData {
@@ -50,6 +59,8 @@ interface WithdrawFlowContextType {
setSelectedBankAccount: (account: Account | null) => void
showAllWithdrawMethods: boolean
setShowAllWithdrawMethods: (show: boolean) => void
+ selectedMethod: WithdrawMethod | null
+ setSelectedMethod: (method: WithdrawMethod | null) => void
resetWithdrawFlow: () => void
}
@@ -73,6 +84,7 @@ export const WithdrawFlowContextProvider: React.FC<{ children: ReactNode }> = ({
})
const [selectedBankAccount, setSelectedBankAccount] = useState(null)
const [showAllWithdrawMethods, setShowAllWithdrawMethods] = useState(false)
+ const [selectedMethod, setSelectedMethod] = useState(null)
const resetWithdrawFlow = useCallback(() => {
setAmountToWithdraw('')
@@ -84,6 +96,7 @@ export const WithdrawFlowContextProvider: React.FC<{ children: ReactNode }> = ({
setPaymentError(null)
setShowAllWithdrawMethods(false)
setUsdAmount('')
+ setSelectedMethod(null)
}, [])
const value = useMemo(
@@ -114,6 +127,8 @@ export const WithdrawFlowContextProvider: React.FC<{ children: ReactNode }> = ({
setSelectedBankAccount,
showAllWithdrawMethods,
setShowAllWithdrawMethods,
+ selectedMethod,
+ setSelectedMethod,
resetWithdrawFlow,
}),
[
@@ -130,6 +145,7 @@ export const WithdrawFlowContextProvider: React.FC<{ children: ReactNode }> = ({
error,
selectedBankAccount,
showAllWithdrawMethods,
+ selectedMethod,
setShowAllWithdrawMethods,
resetWithdrawFlow,
]
diff --git a/src/hooks/useTransactionHistory.ts b/src/hooks/useTransactionHistory.ts
index 5a6229727..68f17dac2 100644
--- a/src/hooks/useTransactionHistory.ts
+++ b/src/hooks/useTransactionHistory.ts
@@ -20,6 +20,7 @@ export enum EHistoryEntryType {
BRIDGE_ONRAMP = 'BRIDGE_ONRAMP',
BANK_SEND_LINK_CLAIM = 'BANK_SEND_LINK_CLAIM',
MANTECA_QR_PAYMENT = 'MANTECA_QR_PAYMENT',
+ MANTECA_OFFRAMP = 'MANTECA_OFFRAMP',
}
export enum EHistoryUserRole {
diff --git a/src/utils/withdraw.utils.ts b/src/utils/withdraw.utils.ts
index 16fb4d27a..53bfe0de7 100644
--- a/src/utils/withdraw.utils.ts
+++ b/src/utils/withdraw.utils.ts
@@ -145,3 +145,7 @@ export const getCountryCodeForWithdraw = (country: string) => {
return threeDigitCode || country
}
+
+export function validateCbuCvuAlias(value: string): boolean {
+ return true
+}