From d1ca804f31b124ff1f090b3acf10961ba4c32ba3 Mon Sep 17 00:00:00 2001 From: Zishan Mohd Date: Wed, 3 Sep 2025 20:14:05 +0530 Subject: [PATCH 01/10] setup component structure --- .../[country]/[regional-method]/page.tsx | 15 ++++++ .../add-money/[country]/bank/page.tsx | 4 ++ .../components/MantecaDepositCard.tsx | 36 +++++++++++++ .../MercadoPago/MercadoPagoDepositDetails.tsx | 52 +++++++++++++++++++ .../RegionalMethods/MercadoPago/index.tsx | 9 ++++ src/components/AddMoney/consts/index.ts | 5 +- .../Global/PeanutActionDetailsCard/index.tsx | 2 +- 7 files changed, 121 insertions(+), 2 deletions(-) create mode 100644 src/app/(mobile-ui)/add-money/[country]/[regional-method]/page.tsx create mode 100644 src/components/AddMoney/components/MantecaDepositCard.tsx create mode 100644 src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx create mode 100644 src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx diff --git a/src/app/(mobile-ui)/add-money/[country]/[regional-method]/page.tsx b/src/app/(mobile-ui)/add-money/[country]/[regional-method]/page.tsx new file mode 100644 index 000000000..b20726bf4 --- /dev/null +++ b/src/app/(mobile-ui)/add-money/[country]/[regional-method]/page.tsx @@ -0,0 +1,15 @@ +'use client' +import MercadoPagoDepositDetails from '@/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails' +import { useParams } from 'next/navigation' + +export default function AddMoneyRegionalMethodPage() { + const params = useParams() + const country = params.country as string + const method = params['regional-method'] as string + + if (country === 'argentina' && method === 'mercadopago') { + return + } + + return
Unsupported Method
+} diff --git a/src/app/(mobile-ui)/add-money/[country]/bank/page.tsx b/src/app/(mobile-ui)/add-money/[country]/bank/page.tsx index 55241865c..52393a74f 100644 --- a/src/app/(mobile-ui)/add-money/[country]/bank/page.tsx +++ b/src/app/(mobile-ui)/add-money/[country]/bank/page.tsx @@ -25,6 +25,7 @@ import { updateUserById } from '@/app/actions/users' import AddMoneyBankDetails from '@/components/AddMoney/components/AddMoneyBankDetails' import { getOnrampCurrencyConfig, getCurrencySymbol, getMinimumAmount } from '@/utils/bridge.utils' import { OnrampConfirmationModal } from '@/components/AddMoney/components/OnrampConfirmationModal' +import MercadoPagoDepositDetails from '@/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails' type AddStep = 'inputAmount' | 'kyc' | 'loading' | 'collectUserDetails' | 'showDetails' @@ -316,6 +317,9 @@ export default function OnrampBankPage() { } if (step === 'showDetails') { + if (selectedCountry.id === 'AR') { + return + } return } diff --git a/src/components/AddMoney/components/MantecaDepositCard.tsx b/src/components/AddMoney/components/MantecaDepositCard.tsx new file mode 100644 index 000000000..b021ec9fa --- /dev/null +++ b/src/components/AddMoney/components/MantecaDepositCard.tsx @@ -0,0 +1,36 @@ +import Card from '@/components/Global/Card' +import PeanutActionDetailsCard from '@/components/Global/PeanutActionDetailsCard' +import { PaymentInfoRow } from '@/components/Payment/PaymentInfoRow' +import { PEANUT_WALLET_TOKEN_SYMBOL } from '@/constants' + +interface MantecaDepositCardProps { + countryCodeForFlag: string + currencySymbol: string + amount: string +} + +const MantecaDepositCard = ({ countryCodeForFlag, currencySymbol, amount }: MantecaDepositCardProps) => { + return ( +
+ + +

Account details

+ + + + + +
+ ) +} + +export default MantecaDepositCard diff --git a/src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx b/src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx new file mode 100644 index 000000000..15ca47916 --- /dev/null +++ b/src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx @@ -0,0 +1,52 @@ +'use client' + +import NavHeader from '@/components/Global/NavHeader' +import { useParams, useRouter } from 'next/navigation' +import React, { useMemo } from 'react' +import { countryCodeMap, countryData } from '../../../consts' +import MantecaDepositCard from '../../MantecaDepositCard' +import ShareButton from '@/components/Global/ShareButton' + +const MercadoPagoDepositDetails = () => { + const router = useRouter() + const params = useParams() + const currentCountryName = params.country as string + + const currentCountryDetails = useMemo(() => { + // check if we have country params (from dynamic route) + if (currentCountryName) { + return countryData.find( + (country) => country.type === 'country' && country.path === currentCountryName.toLowerCase() + ) + } + // Default to Argentina + return countryData.find((c) => c.id === 'AR') + }, [currentCountryName]) + + const countryCodeForFlag = useMemo(() => { + const countryId = currentCountryDetails?.id || 'AR' + const countryCode = countryCodeMap[countryId] || countryId // if countryId is not in countryCodeMap, use countryId because for some countries countryId is of 2 digit and countryCodeMap is a mapping of 3 digit to 2 digit country codes + return countryCode?.toLowerCase() || 'ar' + }, [currentCountryDetails]) + + return ( +
+ router.back()} /> + + + + { + return `CBU: [CBU_NUMBER]\nFull name: Manuel Rodríguez Roldán\n[CUIL/CUIT]: 20-39951628-6` + }} + title="Bank Transfer Details" + variant="purple" + className="w-full" + > + Share Details + +
+ ) +} + +export default MercadoPagoDepositDetails diff --git a/src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx b/src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx new file mode 100644 index 000000000..719ff5010 --- /dev/null +++ b/src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx @@ -0,0 +1,9 @@ +import React from 'react' +import MercadoPagoDepositDetails from './MercadoPagoDepositDetails' + +const MercadoPago = () => { + // TODO: Add logic to get the details from the backend and amount input box + return +} + +export default MercadoPago diff --git a/src/components/AddMoney/consts/index.ts b/src/components/AddMoney/consts/index.ts index 114b6fa45..43a8a3098 100644 --- a/src/components/AddMoney/consts/index.ts +++ b/src/components/AddMoney/consts/index.ts @@ -2017,7 +2017,7 @@ export const countryCodeMap: { [key: string]: string } = { USA: 'US', } -const enabledBankTransferCountries = new Set([...Object.values(countryCodeMap), 'US', 'MX']) +const enabledBankTransferCountries = new Set([...Object.values(countryCodeMap), 'US', 'MX', 'AR']) // Helper function to check if a country code is enabled for bank transfers // Handles both 2-letter and 3-letter country codes @@ -2110,6 +2110,9 @@ countryData.forEach((country) => { } else if (newMethod.id === 'crypto-add') { newMethod.path = `/add-money/crypto` newMethod.isSoon = false + } else if (newMethod.id === 'mercado-pago-add' && countryCode === 'AR') { + newMethod.isSoon = false + newMethod.path = `/add-money/${country.path}/mercadopago` } else { newMethod.isSoon = true } diff --git a/src/components/Global/PeanutActionDetailsCard/index.tsx b/src/components/Global/PeanutActionDetailsCard/index.tsx index bc2741b00..0cf4ee8d2 100644 --- a/src/components/Global/PeanutActionDetailsCard/index.tsx +++ b/src/components/Global/PeanutActionDetailsCard/index.tsx @@ -92,7 +92,7 @@ export default function PeanutActionDetailsCard({ if (viewType === 'SUCCESS') title = `You just claimed` else title = `${renderRecipient()} sent you` } - if (transactionType === 'ADD_MONEY') title = `You're adding` + if (transactionType === 'ADD_MONEY' || transactionType === 'ADD_MONEY_BANK_ACCOUNT') title = `You're adding` if (transactionType === 'WITHDRAW' || transactionType === 'WITHDRAW_BANK_ACCOUNT') title = `You're withdrawing` if (transactionType === 'CLAIM_LINK_BANK_ACCOUNT') { if (viewType === 'SUCCESS') { From 9461aae24a5db8c849bee51f4bf8bd78235ad5b6 Mon Sep 17 00:00:00 2001 From: Zishan Mohd Date: Thu, 4 Sep 2025 12:27:36 +0530 Subject: [PATCH 02/10] integrate deposit API --- .../[country]/[regional-method]/page.tsx | 4 +- src/app/actions/onramp.ts | 48 +++++++++++++ .../AddMoney/components/InputAmountStep.tsx | 72 +++++++++++++++++++ .../RegionalMethods/MercadoPago/index.tsx | 55 +++++++++++++- 4 files changed, 175 insertions(+), 4 deletions(-) create mode 100644 src/components/AddMoney/components/InputAmountStep.tsx diff --git a/src/app/(mobile-ui)/add-money/[country]/[regional-method]/page.tsx b/src/app/(mobile-ui)/add-money/[country]/[regional-method]/page.tsx index b20726bf4..5126563c4 100644 --- a/src/app/(mobile-ui)/add-money/[country]/[regional-method]/page.tsx +++ b/src/app/(mobile-ui)/add-money/[country]/[regional-method]/page.tsx @@ -1,5 +1,5 @@ 'use client' -import MercadoPagoDepositDetails from '@/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails' +import MercadoPago from '@/components/AddMoney/components/RegionalMethods/MercadoPago' import { useParams } from 'next/navigation' export default function AddMoneyRegionalMethodPage() { @@ -8,7 +8,7 @@ export default function AddMoneyRegionalMethodPage() { const method = params['regional-method'] as string if (country === 'argentina' && method === 'mercadopago') { - return + return } return
Unsupported Method
diff --git a/src/app/actions/onramp.ts b/src/app/actions/onramp.ts index b00675f85..95c078b39 100644 --- a/src/app/actions/onramp.ts +++ b/src/app/actions/onramp.ts @@ -109,3 +109,51 @@ export async function createOnrampForGuest( return { error: 'An unexpected error occurred.' } } } + +interface CreateMantecaOnrampParams { + usdAmount: string + currency: string +} + +export async function createMantecaOnramp( + params: CreateMantecaOnrampParams +): Promise<{ data?: { success: boolean }; error?: string }> { + const apiUrl = process.env.PEANUT_API_URL + const cookieStore = cookies() + const jwtToken = (await cookieStore).get('jwt-token')?.value + + if (!apiUrl || !API_KEY) { + console.error('API URL or API Key is not configured.') + return { error: 'Server configuration error.' } + } + + try { + const response = await fetchWithSentry(`${apiUrl}/manteca/deposit`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${jwtToken}`, + 'api-key': API_KEY, + }, + body: JSON.stringify({ + usdAmount: params.usdAmount, + currency: params.currency, + }), + }) + + const data = await response.json() + + if (!response.ok) { + console.log('error', response) + return { error: data.error || 'Failed to create on-ramp transfer for guest.' } + } + + return { data } + } catch (error) { + console.error('Error calling create manteca on-ramp API:', error) + if (error instanceof Error) { + return { error: error.message } + } + return { error: 'An unexpected error occurred.' } + } +} diff --git a/src/components/AddMoney/components/InputAmountStep.tsx b/src/components/AddMoney/components/InputAmountStep.tsx new file mode 100644 index 000000000..e390b2670 --- /dev/null +++ b/src/components/AddMoney/components/InputAmountStep.tsx @@ -0,0 +1,72 @@ +'use client' + +import { Button } from '@/components/0_Bruddle' +import { Icon } from '@/components/Global/Icons/Icon' +import NavHeader from '@/components/Global/NavHeader' +import TokenAmountInput from '@/components/Global/TokenAmountInput' +import { useRouter } from 'next/navigation' +import { CountryData } from '../consts' +import { getCurrencySymbol } from '@/utils' +import ErrorAlert from '@/components/Global/ErrorAlert' + +interface InputAmountStepProps { + onSubmit: () => void + selectedCountry: CountryData | null | undefined + isLoading: boolean + tokenAmount: string + setTokenAmount: React.Dispatch> + error: string | null +} + +const InputAmountStep = ({ + tokenAmount, + setTokenAmount, + onSubmit, + selectedCountry, + isLoading, + error, +}: InputAmountStepProps) => { + const router = useRouter() + + return ( +
+ router.back()} /> +
+
How much do you want to add?
+ setTokenAmount(e ?? '')} + walletBalance={undefined} + hideCurrencyToggle + currency={ + selectedCountry + ? { + code: selectedCountry.id, + symbol: getCurrencySymbol(selectedCountry.id), + price: 1, + } + : undefined + } + hideBalance={true} + /> +
+ + This must exactly match what you send from your bank +
+ + {error && } +
+
+ ) +} + +export default InputAmountStep diff --git a/src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx b/src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx index 719ff5010..932c51214 100644 --- a/src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx +++ b/src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx @@ -1,8 +1,59 @@ -import React from 'react' +import React, { useMemo, useState } from 'react' import MercadoPagoDepositDetails from './MercadoPagoDepositDetails' +import InputAmountStep from '../../InputAmountStep' +import { createMantecaOnramp } from '@/app/actions/onramp' +import { useParams } from 'next/navigation' +import { countryData } from '@/components/AddMoney/consts' const MercadoPago = () => { - // TODO: Add logic to get the details from the backend and amount input box + const params = useParams() + const [step, setStep] = useState('inputAmount') + const [isCreatingDeposit, setIsCreatingDeposit] = useState(false) + const [tokenAmount, setTokenAmount] = useState('') + const [error, setError] = useState(null) + + const selectedCountryPath = params.country as string + const selectedCountry = useMemo(() => { + if (!selectedCountryPath) return null + return countryData.find((country) => country.type === 'country' && country.path === selectedCountryPath) + }, [selectedCountryPath]) + + const handleAmountSubmit = async () => { + if (!selectedCountry?.currency) return + + try { + setError(null) + setIsCreatingDeposit(true) + const depositData = await createMantecaOnramp({ + usdAmount: tokenAmount.replace(/,/g, ''), + currency: selectedCountry.currency, + }) + if (depositData.error) { + setError(depositData.error) + return + } + setStep('depositDetails') + } catch (error) { + console.log(error) + setError(error as string) + } finally { + setIsCreatingDeposit(false) + } + } + + if (step === 'inputAmount') { + return ( + + ) + } + return } From 7ae1406cc1119ddfc70944326f0a5e39034a6893 Mon Sep 17 00:00:00 2001 From: Zishan Mohd Date: Thu, 4 Sep 2025 23:00:40 +0530 Subject: [PATCH 03/10] Complete API integration and add Brazil support (disabled) --- .../[country]/[regional-method]/page.tsx | 4 ++++ .../add-money/[country]/bank/page.tsx | 6 ++--- src/app/actions/currency.ts | 22 +++++++++++++++---- src/app/actions/onramp.ts | 3 ++- .../AddMoney/components/InputAmountStep.tsx | 22 ++++++++++++++----- .../components/MantecaDepositCard.tsx | 21 ++++++++++++++---- .../MercadoPago/MercadoPagoDepositDetails.tsx | 11 ++++++++-- .../RegionalMethods/MercadoPago/index.tsx | 16 +++++++++++--- src/components/AddMoney/consts/index.ts | 13 +++++++++-- src/hooks/useCurrency.ts | 8 ++++++- src/types/manteca.types.ts | 5 +++++ 11 files changed, 105 insertions(+), 26 deletions(-) create mode 100644 src/types/manteca.types.ts diff --git a/src/app/(mobile-ui)/add-money/[country]/[regional-method]/page.tsx b/src/app/(mobile-ui)/add-money/[country]/[regional-method]/page.tsx index 5126563c4..981976742 100644 --- a/src/app/(mobile-ui)/add-money/[country]/[regional-method]/page.tsx +++ b/src/app/(mobile-ui)/add-money/[country]/[regional-method]/page.tsx @@ -11,5 +11,9 @@ export default function AddMoneyRegionalMethodPage() { return } + if (country === 'brazil' && method === 'pix') { + return + } + return
Unsupported Method
} diff --git a/src/app/(mobile-ui)/add-money/[country]/bank/page.tsx b/src/app/(mobile-ui)/add-money/[country]/bank/page.tsx index 52393a74f..54a483470 100644 --- a/src/app/(mobile-ui)/add-money/[country]/bank/page.tsx +++ b/src/app/(mobile-ui)/add-money/[country]/bank/page.tsx @@ -25,7 +25,7 @@ import { updateUserById } from '@/app/actions/users' import AddMoneyBankDetails from '@/components/AddMoney/components/AddMoneyBankDetails' import { getOnrampCurrencyConfig, getCurrencySymbol, getMinimumAmount } from '@/utils/bridge.utils' import { OnrampConfirmationModal } from '@/components/AddMoney/components/OnrampConfirmationModal' -import MercadoPagoDepositDetails from '@/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails' +import MercadoPago from '@/components/AddMoney/components/RegionalMethods/MercadoPago' type AddStep = 'inputAmount' | 'kyc' | 'loading' | 'collectUserDetails' | 'showDetails' @@ -317,8 +317,8 @@ export default function OnrampBankPage() { } if (step === 'showDetails') { - if (selectedCountry.id === 'AR') { - return + if (selectedCountry.id === 'AR' || selectedCountry.id === 'BR') { + return } return } diff --git a/src/app/actions/currency.ts b/src/app/actions/currency.ts index a2e98ae4f..c176784da 100644 --- a/src/app/actions/currency.ts +++ b/src/app/actions/currency.ts @@ -2,21 +2,35 @@ import { unstable_cache } from 'next/cache' import { fetchWithSentry } from '@/utils' +const SUPPORTED_CURRENCIES_DETAILS = { + ARS: { + apiURL: 'https://dolarapi.com/v1/dolares/cripto', + }, + BRL: { + apiURL: 'https://br.dolarapi.com/v1/cotacoes/usd', + }, +} + export const getCurrencyPrice = unstable_cache( async (currencyCode: string): Promise => { if (currencyCode === 'USD') return 1 - if (currencyCode !== 'ARS') { + + const currencyDetails = SUPPORTED_CURRENCIES_DETAILS[currencyCode as keyof typeof SUPPORTED_CURRENCIES_DETAILS] + if (!currencyDetails) { throw new Error('Unsupported currency') } - const response = await fetchWithSentry('https://dolarapi.com/v1/dolares/cripto') + const response = await fetchWithSentry(currencyDetails.apiURL) const data = await response.json() - if (!data.compra || !data.venta) { + const buy = data.compra + const sell = data.venta || data.venda + + if (!buy || !sell) { throw new Error('Invalid response from dolarapi') } // Average between buy and sell price - const price = (data.compra + data.venta) / 2 + const price = (buy + sell) / 2 return price }, diff --git a/src/app/actions/onramp.ts b/src/app/actions/onramp.ts index 95c078b39..1f450a3b5 100644 --- a/src/app/actions/onramp.ts +++ b/src/app/actions/onramp.ts @@ -4,6 +4,7 @@ import { cookies } from 'next/headers' import { fetchWithSentry } from '@/utils' import { CountryData } from '@/components/AddMoney/consts' import { getCurrencyConfig } from '@/utils/onramp.utils' +import { MantecaDepositDetails } from '@/types/manteca.types' const API_KEY = process.env.PEANUT_API_KEY! @@ -117,7 +118,7 @@ interface CreateMantecaOnrampParams { export async function createMantecaOnramp( params: CreateMantecaOnrampParams -): Promise<{ data?: { success: boolean }; error?: string }> { +): Promise<{ data?: MantecaDepositDetails; error?: string }> { const apiUrl = process.env.PEANUT_API_URL const cookieStore = cookies() const jwtToken = (await cookieStore).get('jwt-token')?.value diff --git a/src/components/AddMoney/components/InputAmountStep.tsx b/src/components/AddMoney/components/InputAmountStep.tsx index e390b2670..2c07421bb 100644 --- a/src/components/AddMoney/components/InputAmountStep.tsx +++ b/src/components/AddMoney/components/InputAmountStep.tsx @@ -6,15 +6,17 @@ import NavHeader from '@/components/Global/NavHeader' import TokenAmountInput from '@/components/Global/TokenAmountInput' import { useRouter } from 'next/navigation' import { CountryData } from '../consts' -import { getCurrencySymbol } from '@/utils' import ErrorAlert from '@/components/Global/ErrorAlert' +import { useCurrency } from '@/hooks/useCurrency' +import PeanutLoading from '@/components/Global/PeanutLoading' interface InputAmountStepProps { onSubmit: () => void - selectedCountry: CountryData | null | undefined + selectedCountry: CountryData isLoading: boolean tokenAmount: string setTokenAmount: React.Dispatch> + setTokenUSDAmount: React.Dispatch> error: string | null } @@ -25,25 +27,33 @@ const InputAmountStep = ({ selectedCountry, isLoading, error, + setTokenUSDAmount, }: InputAmountStepProps) => { const router = useRouter() + const currencyData = useCurrency(selectedCountry.currency ?? 'ARS') + + if (currencyData.isLoading) { + return + } return (
router.back()} />
How much do you want to add?
+ setTokenAmount(e ?? '')} walletBalance={undefined} hideCurrencyToggle + setUsdValue={(e) => setTokenUSDAmount(e)} currency={ - selectedCountry + currencyData ? { - code: selectedCountry.id, - symbol: getCurrencySymbol(selectedCountry.id), - price: 1, + code: currencyData.code!, + symbol: currencyData.symbol!, + price: currencyData.price!, } : undefined } diff --git a/src/components/AddMoney/components/MantecaDepositCard.tsx b/src/components/AddMoney/components/MantecaDepositCard.tsx index b021ec9fa..4a5f890ba 100644 --- a/src/components/AddMoney/components/MantecaDepositCard.tsx +++ b/src/components/AddMoney/components/MantecaDepositCard.tsx @@ -7,9 +7,21 @@ interface MantecaDepositCardProps { countryCodeForFlag: string currencySymbol: string amount: string + cbu?: string + alias?: string + depositAddress?: string + pixKey?: string } -const MantecaDepositCard = ({ countryCodeForFlag, currencySymbol, amount }: MantecaDepositCardProps) => { +const MantecaDepositCard = ({ + countryCodeForFlag, + currencySymbol, + amount, + cbu, + alias, + depositAddress, + pixKey, +}: MantecaDepositCardProps) => { return (
Account details - - - + {cbu && } + {alias && } + {depositAddress && } + {pixKey && }
) diff --git a/src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx b/src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx index 15ca47916..f42fdaea4 100644 --- a/src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx +++ b/src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx @@ -6,8 +6,9 @@ import React, { useMemo } from 'react' import { countryCodeMap, countryData } from '../../../consts' import MantecaDepositCard from '../../MantecaDepositCard' import ShareButton from '@/components/Global/ShareButton' +import { MantecaDepositDetails } from '@/types/manteca.types' -const MercadoPagoDepositDetails = () => { +const MercadoPagoDepositDetails = ({ depositDetails }: { depositDetails: MantecaDepositDetails }) => { const router = useRouter() const params = useParams() const currentCountryName = params.country as string @@ -33,7 +34,13 @@ const MercadoPagoDepositDetails = () => {
router.back()} /> - + { diff --git a/src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx b/src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx index 932c51214..c7dd60745 100644 --- a/src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx +++ b/src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx @@ -4,17 +4,19 @@ import InputAmountStep from '../../InputAmountStep' import { createMantecaOnramp } from '@/app/actions/onramp' import { useParams } from 'next/navigation' import { countryData } from '@/components/AddMoney/consts' +import { MantecaDepositDetails } from '@/types/manteca.types' const MercadoPago = () => { const params = useParams() const [step, setStep] = useState('inputAmount') const [isCreatingDeposit, setIsCreatingDeposit] = useState(false) const [tokenAmount, setTokenAmount] = useState('') + const [tokenUSDAmount, setTokenUSDAmount] = useState('') const [error, setError] = useState(null) + const [depositDetails, setDepositDetails] = useState() const selectedCountryPath = params.country as string const selectedCountry = useMemo(() => { - if (!selectedCountryPath) return null return countryData.find((country) => country.type === 'country' && country.path === selectedCountryPath) }, [selectedCountryPath]) @@ -25,13 +27,14 @@ const MercadoPago = () => { setError(null) setIsCreatingDeposit(true) const depositData = await createMantecaOnramp({ - usdAmount: tokenAmount.replace(/,/g, ''), + usdAmount: tokenUSDAmount.replace(/,/g, ''), currency: selectedCountry.currency, }) if (depositData.error) { setError(depositData.error) return } + setDepositDetails(depositData.data) setStep('depositDetails') } catch (error) { console.log(error) @@ -41,6 +44,8 @@ const MercadoPago = () => { } } + if (!selectedCountry) return null + if (step === 'inputAmount') { return ( { selectedCountry={selectedCountry} isLoading={isCreatingDeposit} error={error} + setTokenUSDAmount={setTokenUSDAmount} /> ) } - return + if (step === 'depositDetails' && depositDetails) { + return + } + + return null } export default MercadoPago diff --git a/src/components/AddMoney/consts/index.ts b/src/components/AddMoney/consts/index.ts index 43a8a3098..2f08db277 100644 --- a/src/components/AddMoney/consts/index.ts +++ b/src/components/AddMoney/consts/index.ts @@ -2122,13 +2122,22 @@ countryData.forEach((country) => { // Add country-specific add methods (same as withdraw methods for consistency) if (specificMethodDetails && specificMethodDetails.length > 0) { specificMethodDetails.forEach((method) => { - currentAddMethods.push({ + const currMethod = { id: `${countryCode.toLowerCase()}-${method.title.toLowerCase().replace(/\s+/g, '-')}-add`, icon: method.icon ?? undefined, title: method.title, description: method.description, isSoon: true, - }) + path: '', + } + + // TODO: Check with Jota regarding Brazil manteca support + + // if (method.title === 'Pix' && countryCode === 'BR') { + // currMethod.path = `/add-money/${country.path}/pix` + // currMethod.isSoon = false + // } + currentAddMethods.push(currMethod) }) } diff --git a/src/hooks/useCurrency.ts b/src/hooks/useCurrency.ts index 60905bd7d..e654cb6f1 100644 --- a/src/hooks/useCurrency.ts +++ b/src/hooks/useCurrency.ts @@ -4,12 +4,14 @@ import { getCurrencyPrice } from '@/app/actions/currency' const SIMBOLS_BY_CURRENCY_CODE: Record = { ARS: 'AR$', USD: '$', + BRL: 'R$', } export const useCurrency = (currencyCode: string | null) => { const [code, setCode] = useState(currencyCode?.toUpperCase() ?? null) const [symbol, setSymbol] = useState(null) const [price, setPrice] = useState(null) + const [isLoading, setIsLoading] = useState(true) useEffect(() => { if (!code) return @@ -17,12 +19,14 @@ export const useCurrency = (currencyCode: string | null) => { if (code === 'USD') { setSymbol('$') setPrice(1) + setIsLoading(false) return } // First iterations only pesos - if (code !== 'ARS') { + if (code !== 'ARS' && code !== 'BRL') { setCode(null) + setIsLoading(false) return } @@ -32,11 +36,13 @@ export const useCurrency = (currencyCode: string | null) => { setPrice(price) }) .catch(console.error) + .finally(() => setIsLoading(false)) }, [code]) return { code, symbol, price, + isLoading, } } diff --git a/src/types/manteca.types.ts b/src/types/manteca.types.ts new file mode 100644 index 000000000..0e9be9c30 --- /dev/null +++ b/src/types/manteca.types.ts @@ -0,0 +1,5 @@ +export interface MantecaDepositDetails { + depositAddress: string + depositAlias: string + depositAmount: string +} From 13662abd4f9337f2651ceba2eff8b048c87ff7aa Mon Sep 17 00:00:00 2001 From: Zishan Mohd Date: Fri, 5 Sep 2025 12:05:17 +0530 Subject: [PATCH 04/10] generate share button text --- .../MercadoPago/MercadoPagoDepositDetails.tsx | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx b/src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx index f42fdaea4..be0a728e2 100644 --- a/src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx +++ b/src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx @@ -30,6 +30,22 @@ const MercadoPagoDepositDetails = ({ depositDetails }: { depositDetails: Manteca return countryCode?.toLowerCase() || 'ar' }, [currentCountryDetails]) + const generateShareText = () => { + const textParts = [] + const currencySymbol = currentCountryDetails?.currency || 'ARS' + + textParts.push(`Amount: ${currencySymbol} ${depositDetails.depositAmount}`) + + if (depositDetails.depositAddress) { + textParts.push(`CBU: ${depositDetails.depositAddress}`) + } + if (depositDetails.depositAlias) { + textParts.push(`Alias: ${depositDetails.depositAlias}`) + } + + return textParts.join('\n') + } + return (
router.back()} /> @@ -43,9 +59,7 @@ const MercadoPagoDepositDetails = ({ depositDetails }: { depositDetails: Manteca /> { - return `CBU: [CBU_NUMBER]\nFull name: Manuel Rodríguez Roldán\n[CUIL/CUIT]: 20-39951628-6` - }} + generateText={async () => generateShareText()} title="Bank Transfer Details" variant="purple" className="w-full" From 58f66f32eb021539708ceec937d3fb0686966959 Mon Sep 17 00:00:00 2001 From: Zishan Mohd Date: Fri, 5 Sep 2025 14:51:50 +0530 Subject: [PATCH 05/10] comment unused code --- src/components/AddMoney/consts/index.ts | 38 +++++++++++++------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/components/AddMoney/consts/index.ts b/src/components/AddMoney/consts/index.ts index 2f08db277..6f7a8e155 100644 --- a/src/components/AddMoney/consts/index.ts +++ b/src/components/AddMoney/consts/index.ts @@ -2119,27 +2119,29 @@ countryData.forEach((country) => { return newMethod }) + // TODO: Test this flow properly + // Add country-specific add methods (same as withdraw methods for consistency) - if (specificMethodDetails && specificMethodDetails.length > 0) { - specificMethodDetails.forEach((method) => { - const currMethod = { - id: `${countryCode.toLowerCase()}-${method.title.toLowerCase().replace(/\s+/g, '-')}-add`, - icon: method.icon ?? undefined, - title: method.title, - description: method.description, - isSoon: true, - path: '', - } + // if (UPDATED_DEFAULT_ADD_MONEY_METHODS && UPDATED_DEFAULT_ADD_MONEY_METHODS.length > 0) { + // UPDATED_DEFAULT_ADD_MONEY_METHODS.forEach((method) => { + // const currMethod = { + // id: `${countryCode.toLowerCase()}-${method.title.toLowerCase().replace(/\s+/g, '-')}-add`, + // icon: method.icon ?? undefined, + // title: method.title, + // description: method.description, + // isSoon: true, + // path: '', + // } - // TODO: Check with Jota regarding Brazil manteca support + // // TODO: Check with Jota regarding Brazil manteca support - // if (method.title === 'Pix' && countryCode === 'BR') { - // currMethod.path = `/add-money/${country.path}/pix` - // currMethod.isSoon = false - // } - currentAddMethods.push(currMethod) - }) - } + // // if (method.title === 'Pix' && countryCode === 'BR') { + // // currMethod.path = `/add-money/${country.path}/pix` + // // currMethod.isSoon = false + // // } + // currentAddMethods.push(currMethod) + // }) + // } COUNTRY_SPECIFIC_METHODS[countryCode] = { add: currentAddMethods, From bfe4da51d69648c43bbfca2eff8bce52d5ebe704 Mon Sep 17 00:00:00 2001 From: Zishan Mohd Date: Fri, 5 Sep 2025 14:59:05 +0530 Subject: [PATCH 06/10] fix: build error --- src/components/Profile/components/ProfileHeader.tsx | 2 +- src/hooks/useDetermineBankRequestType.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Profile/components/ProfileHeader.tsx b/src/components/Profile/components/ProfileHeader.tsx index 05b505f6d..4780c231c 100644 --- a/src/components/Profile/components/ProfileHeader.tsx +++ b/src/components/Profile/components/ProfileHeader.tsx @@ -29,7 +29,7 @@ const ProfileHeader: React.FC = ({ haveSentMoneyToUser = false, }) => { const { user: authenticatedUser } = useAuth() - const isAuthenticatedUserVerified = authenticatedUser?.user.kycStatus === 'approved' + const isAuthenticatedUserVerified = authenticatedUser?.user.bridgeKycStatus === 'approved' const [isDrawerOpen, setIsDrawerOpen] = useState(false) const profileUrl = `${BASE_URL}/${username}` diff --git a/src/hooks/useDetermineBankRequestType.ts b/src/hooks/useDetermineBankRequestType.ts index e2a2746aa..4b19e277a 100644 --- a/src/hooks/useDetermineBankRequestType.ts +++ b/src/hooks/useDetermineBankRequestType.ts @@ -25,7 +25,7 @@ export function useDetermineBankRequestType(requesterUserId: string): { useEffect(() => { const determineBankRequestType = async () => { - const payerKycApproved = user?.user?.kycStatus === 'approved' + const payerKycApproved = user?.user?.bridgeKycStatus === 'approved' if (payerKycApproved) { setRequestType(BankRequestType.UserBankRequest) @@ -43,7 +43,7 @@ export function useDetermineBankRequestType(requesterUserId: string): { try { const requesterDetails = await getUserById(requesterUserId) - const requesterKycApproved = requesterDetails?.kycStatus === 'approved' + const requesterKycApproved = requesterDetails?.bridgeKycStatus === 'approved' if (requesterKycApproved) { setRequesterDetails(requesterDetails) From 21cc0f911f7c36bed48a1c1d5ecb13d4d009461b Mon Sep 17 00:00:00 2001 From: Zishan Mohd Date: Tue, 9 Sep 2025 16:30:20 +0530 Subject: [PATCH 07/10] Remove brazil flow --- .../[country]/[regional-method]/page.tsx | 6 +---- .../add-money/[country]/bank/page.tsx | 8 ++++--- src/app/actions/currency.ts | 9 ------- .../components/MantecaDepositCard.tsx | 4 ++++ .../MercadoPago/MercadoPagoDepositDetails.tsx | 9 ++++++- .../RegionalMethods/MercadoPago/index.tsx | 10 +++++--- src/components/AddMoney/consts/index.ts | 24 ------------------- .../Global/PeanutActionDetailsCard/index.tsx | 6 ++++- src/hooks/useCurrency.ts | 2 +- 9 files changed, 31 insertions(+), 47 deletions(-) diff --git a/src/app/(mobile-ui)/add-money/[country]/[regional-method]/page.tsx b/src/app/(mobile-ui)/add-money/[country]/[regional-method]/page.tsx index 981976742..204533ae2 100644 --- a/src/app/(mobile-ui)/add-money/[country]/[regional-method]/page.tsx +++ b/src/app/(mobile-ui)/add-money/[country]/[regional-method]/page.tsx @@ -8,11 +8,7 @@ export default function AddMoneyRegionalMethodPage() { const method = params['regional-method'] as string if (country === 'argentina' && method === 'mercadopago') { - return - } - - if (country === 'brazil' && method === 'pix') { - return + return } return
Unsupported Method
diff --git a/src/app/(mobile-ui)/add-money/[country]/bank/page.tsx b/src/app/(mobile-ui)/add-money/[country]/bank/page.tsx index 77bf004a9..00899daa9 100644 --- a/src/app/(mobile-ui)/add-money/[country]/bank/page.tsx +++ b/src/app/(mobile-ui)/add-money/[country]/bank/page.tsx @@ -317,12 +317,14 @@ export default function OnrampBankPage() { } if (step === 'showDetails') { - if (selectedCountry.id === 'AR' || selectedCountry.id === 'BR') { - return - } return } + // Show Mercado Pago flow for Argentina bank transfers + if (step === 'inputAmount' && selectedCountry.id === 'AR') { + return + } + if (step === 'inputAmount') { return (
diff --git a/src/app/actions/currency.ts b/src/app/actions/currency.ts index 3a05023b6..01db4cc26 100644 --- a/src/app/actions/currency.ts +++ b/src/app/actions/currency.ts @@ -4,15 +4,6 @@ import { fetchWithSentry } from '@/utils' import { getExchangeRate } from './exchange-rate' import { AccountType } from '@/interfaces' -const SUPPORTED_CURRENCIES_DETAILS = { - ARS: { - apiURL: 'https://dolarapi.com/v1/dolares/cripto', - }, - BRL: { - apiURL: 'https://br.dolarapi.com/v1/cotacoes/usd', - }, -} - export const getCurrencyPrice = unstable_cache( async (currencyCode: string): Promise => { let price: number diff --git a/src/components/AddMoney/components/MantecaDepositCard.tsx b/src/components/AddMoney/components/MantecaDepositCard.tsx index 4a5f890ba..25e26d825 100644 --- a/src/components/AddMoney/components/MantecaDepositCard.tsx +++ b/src/components/AddMoney/components/MantecaDepositCard.tsx @@ -1,3 +1,4 @@ +import { MERCADO_PAGO } from '@/assets' import Card from '@/components/Global/Card' import PeanutActionDetailsCard from '@/components/Global/PeanutActionDetailsCard' import { PaymentInfoRow } from '@/components/Payment/PaymentInfoRow' @@ -11,6 +12,7 @@ interface MantecaDepositCardProps { alias?: string depositAddress?: string pixKey?: string + isMercadoPago: boolean } const MantecaDepositCard = ({ @@ -21,6 +23,7 @@ const MantecaDepositCard = ({ alias, depositAddress, pixKey, + isMercadoPago, }: MantecaDepositCardProps) => { return (
@@ -33,6 +36,7 @@ const MantecaDepositCard = ({ tokenSymbol={PEANUT_WALLET_TOKEN_SYMBOL} countryCodeForFlag={countryCodeForFlag} currencySymbol={currencySymbol} + logo={isMercadoPago ? MERCADO_PAGO : undefined} />

Account details

diff --git a/src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx b/src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx index be0a728e2..4ec870e96 100644 --- a/src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx +++ b/src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx @@ -8,7 +8,13 @@ import MantecaDepositCard from '../../MantecaDepositCard' import ShareButton from '@/components/Global/ShareButton' import { MantecaDepositDetails } from '@/types/manteca.types' -const MercadoPagoDepositDetails = ({ depositDetails }: { depositDetails: MantecaDepositDetails }) => { +const MercadoPagoDepositDetails = ({ + depositDetails, + source, +}: { + depositDetails: MantecaDepositDetails + source: 'bank' | 'regionalMethod' +}) => { const router = useRouter() const params = useParams() const currentCountryName = params.country as string @@ -56,6 +62,7 @@ const MercadoPagoDepositDetails = ({ depositDetails }: { depositDetails: Manteca amount={depositDetails.depositAmount} cbu={depositDetails.depositAddress} alias={depositDetails.depositAlias} + isMercadoPago={source === 'regionalMethod'} /> { +interface MercadoPagoProps { + source: 'bank' | 'regionalMethod' +} + +const MercadoPago: FC = ({ source }) => { const params = useParams() const [step, setStep] = useState('inputAmount') const [isCreatingDeposit, setIsCreatingDeposit] = useState(false) @@ -61,7 +65,7 @@ const MercadoPago = () => { } if (step === 'depositDetails' && depositDetails) { - return + return } return null diff --git a/src/components/AddMoney/consts/index.ts b/src/components/AddMoney/consts/index.ts index 47a9513ec..ac27ca5c9 100644 --- a/src/components/AddMoney/consts/index.ts +++ b/src/components/AddMoney/consts/index.ts @@ -2599,30 +2599,6 @@ countryData.forEach((country) => { return newMethod }) - // TODO: Test this flow properly - - // Add country-specific add methods (same as withdraw methods for consistency) - // if (UPDATED_DEFAULT_ADD_MONEY_METHODS && UPDATED_DEFAULT_ADD_MONEY_METHODS.length > 0) { - // UPDATED_DEFAULT_ADD_MONEY_METHODS.forEach((method) => { - // const currMethod = { - // id: `${countryCode.toLowerCase()}-${method.title.toLowerCase().replace(/\s+/g, '-')}-add`, - // icon: method.icon ?? undefined, - // title: method.title, - // description: method.description, - // isSoon: true, - // path: '', - // } - - // // TODO: Check with Jota regarding Brazil manteca support - - // // if (method.title === 'Pix' && countryCode === 'BR') { - // // currMethod.path = `/add-money/${country.path}/pix` - // // currMethod.isSoon = false - // // } - // currentAddMethods.push(currMethod) - // }) - // } - COUNTRY_SPECIFIC_METHODS[countryCode] = { add: currentAddMethods, withdraw: withdrawList, diff --git a/src/components/Global/PeanutActionDetailsCard/index.tsx b/src/components/Global/PeanutActionDetailsCard/index.tsx index 1825010aa..0f1c2db58 100644 --- a/src/components/Global/PeanutActionDetailsCard/index.tsx +++ b/src/components/Global/PeanutActionDetailsCard/index.tsx @@ -11,6 +11,7 @@ import { Icon, IconName } from '../Icons/Icon' import RouteExpiryTimer from '../RouteExpiryTimer' import Image from 'next/image' import Loading from '../Loading' +import { StaticImport } from 'next/dist/shared/lib/get-img-props' export type PeanutActionDetailsCardTransactionType = | 'REQUEST' @@ -47,6 +48,7 @@ export interface PeanutActionDetailsCardProps { disableTimerRefetch?: boolean timerError?: string | null isLoading?: boolean + logo?: StaticImport } export default function PeanutActionDetailsCard({ @@ -70,6 +72,7 @@ export default function PeanutActionDetailsCard({ countryCodeForFlag, currencySymbol, isLoading = false, + logo, }: PeanutActionDetailsCardProps) { const renderRecipient = () => { if (recipientType === 'ADDRESS') return printableAddress(recipientName) @@ -158,12 +161,13 @@ export default function PeanutActionDetailsCard({ const isClaimLinkBankAccount = transactionType === 'CLAIM_LINK_BANK_ACCOUNT' && recipientType === 'BANK_ACCOUNT' const withdrawBankIcon = () => { + const imgSrc = logo ? logo : `https://flagcdn.com/w320/${countryCodeForFlag}.png` if (isWithdrawBankAccount || isAddBankAccount || isClaimLinkBankAccount) return (
{countryCodeForFlag && ( {`${countryCodeForFlag} { const [code, setCode] = useState(currencyCode?.toUpperCase() ?? null) const [symbol, setSymbol] = useState(null) const [price, setPrice] = useState(null) - const [isLoading, setIsLoading] = useState(false) + const [isLoading, setIsLoading] = useState(true) useEffect(() => { if (!code) { From 39742c83aea5ecb0462952ebe8d23f9328cc33f0 Mon Sep 17 00:00:00 2001 From: Zishan Mohd Date: Tue, 9 Sep 2025 16:35:02 +0530 Subject: [PATCH 08/10] fix: improve error handling in MercadoPago component --- .../AddMoney/components/RegionalMethods/MercadoPago/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx b/src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx index 21a844763..04dc8c249 100644 --- a/src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx +++ b/src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx @@ -26,6 +26,7 @@ const MercadoPago: FC = ({ source }) => { const handleAmountSubmit = async () => { if (!selectedCountry?.currency) return + if (isCreatingDeposit) return try { setError(null) @@ -42,7 +43,7 @@ const MercadoPago: FC = ({ source }) => { setStep('depositDetails') } catch (error) { console.log(error) - setError(error as string) + setError(error instanceof Error ? error.message : String(error)) } finally { setIsCreatingDeposit(false) } From de63db6ad721a3ca89cc05726931128e0e468c47 Mon Sep 17 00:00:00 2001 From: Zishan Mohd Date: Tue, 9 Sep 2025 16:46:44 +0530 Subject: [PATCH 09/10] use iso2 code for flag --- .../RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx b/src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx index 4ec870e96..2df420209 100644 --- a/src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx +++ b/src/components/AddMoney/components/RegionalMethods/MercadoPago/MercadoPagoDepositDetails.tsx @@ -32,8 +32,7 @@ const MercadoPagoDepositDetails = ({ const countryCodeForFlag = useMemo(() => { const countryId = currentCountryDetails?.id || 'AR' - const countryCode = countryCodeMap[countryId] || countryId // if countryId is not in countryCodeMap, use countryId because for some countries countryId is of 2 digit and countryCodeMap is a mapping of 3 digit to 2 digit country codes - return countryCode?.toLowerCase() || 'ar' + return countryId.toLowerCase() }, [currentCountryDetails]) const generateShareText = () => { From ea8bccfaf573c56dca156c84bbc6d7a830cff60c Mon Sep 17 00:00:00 2001 From: Zishan Mohd Date: Tue, 9 Sep 2025 20:12:17 +0530 Subject: [PATCH 10/10] fix: update button disabled state in InputAmountStep and add type for step state in MercadoPago component --- src/components/AddMoney/components/InputAmountStep.tsx | 2 +- .../AddMoney/components/RegionalMethods/MercadoPago/index.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/AddMoney/components/InputAmountStep.tsx b/src/components/AddMoney/components/InputAmountStep.tsx index 2c07421bb..d9229c64d 100644 --- a/src/components/AddMoney/components/InputAmountStep.tsx +++ b/src/components/AddMoney/components/InputAmountStep.tsx @@ -67,7 +67,7 @@ const InputAmountStep = ({ variant="purple" shadowSize="4" onClick={onSubmit} - disabled={!parseFloat(tokenAmount.replace(/,/g, ''))} + disabled={isLoading || !parseFloat(tokenAmount.replace(/,/g, ''))} className="w-full" loading={isLoading} > diff --git a/src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx b/src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx index 04dc8c249..d7e0ff9ee 100644 --- a/src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx +++ b/src/components/AddMoney/components/RegionalMethods/MercadoPago/index.tsx @@ -10,9 +10,11 @@ interface MercadoPagoProps { source: 'bank' | 'regionalMethod' } +type stepType = 'inputAmount' | 'depositDetails' + const MercadoPago: FC = ({ source }) => { const params = useParams() - const [step, setStep] = useState('inputAmount') + const [step, setStep] = useState('inputAmount') const [isCreatingDeposit, setIsCreatingDeposit] = useState(false) const [tokenAmount, setTokenAmount] = useState('') const [tokenUSDAmount, setTokenUSDAmount] = useState('')