Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/components/AddMoney/consts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2540,7 +2540,26 @@ export const ALL_COUNTRIES_ALPHA3_TO_ALPHA2: { [key: string]: string } = {
...MANTECA_ALPHA3_TO_ALPHA2,
}

const enabledBankWithdrawCountries = new Set([...Object.values(BRIDGE_ALPHA3_TO_ALPHA2), 'US', 'MX', 'AR'])
// identify sepa corridors where local currency is not eur and disable them temporarily for bank withdrawals
// this impacts withdraw and claim-to-bank flows (but not add-money from bank)
export const NON_EUR_SEPA_ALPHA2 = new Set(
countryData
.filter(
(c) =>
c.type === 'country' &&
!!c.iso3 &&
BRIDGE_ALPHA3_TO_ALPHA2[c.iso3] &&
// exclude usa explicitly; bridge map includes it but it's not sepa
c.iso3 !== 'USA'
)
.map((c) => ({ alpha2: BRIDGE_ALPHA3_TO_ALPHA2[c.iso3!], currency: c.currency }))
.filter((x) => x.alpha2 && x.currency && x.currency !== 'EUR')
.map((x) => x.alpha2 as string)
)

const enabledBankWithdrawCountries = new Set(
[...Object.values(BRIDGE_ALPHA3_TO_ALPHA2), 'US', 'MX', 'AR'].filter((code) => !NON_EUR_SEPA_ALPHA2.has(code))
)

const enabledBankDepositCountries = new Set([...Object.values(BRIDGE_ALPHA3_TO_ALPHA2), 'US', 'MX', 'AR'])

Expand Down
8 changes: 6 additions & 2 deletions src/components/Common/CountryList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
countryData,
MantecaSupportedExchanges,
ALL_COUNTRIES_ALPHA3_TO_ALPHA2,
NON_EUR_SEPA_ALPHA2,
} from '@/components/AddMoney/consts'
import EmptyState from '@/components/Global/EmptyStates/EmptyState'
import { SearchInput } from '@/components/SearchInput'
Expand Down Expand Up @@ -158,8 +159,11 @@ export const CountryList = ({
// withdraw
isSupported = true
} else if (viewMode === 'claim-request') {
// support all bridge and manteca supported countries
isSupported = isBridgeSupportedCountry || isMantecaSupportedCountry
// support bridge or manteca supported countries, but temporarily disable sepa corridors
// where local currency is not eur (show as soon)
const isDisabledNonEurSepa = NON_EUR_SEPA_ALPHA2.has(twoLetterCountryCode.toUpperCase())
const isBridgeAndNotDisabled = isBridgeSupportedCountry && !isDisabledNonEurSepa
isSupported = isBridgeAndNotDisabled || isMantecaSupportedCountry
} else {
// support all countries
isSupported = true
Expand Down
Loading