Skip to content

feat: enable SEPA bank rail for AL/MD/ME/MK/RS + treat Bulgaria as Eurozone - #2408

Merged
Hugo0 merged 4 commits into
mainfrom
feat/sepa-balkans-bg-eur
Jul 13, 2026
Merged

feat: enable SEPA bank rail for AL/MD/ME/MK/RS + treat Bulgaria as Eurozone#2408
Hugo0 merged 4 commits into
mainfrom
feat/sepa-balkans-bg-eur

Conversation

@abalinda

@abalinda abalinda commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

image

from: https://apidocs.bridge.xyz/platform/orchestration/more/rail-specific#eur-sepa-standard-credit-sepa-instant

Bridge now supports SEPA for Albania, Moldova, Montenegro, North Macedonia, Serbia (TASK-20580), but the FE still greys the bank rail out as "Soon" — availability is a static FE map. This PR adds the 5 entries to BRIDGE_ALPHA3_TO_ALPHA2, enabling the rail for both deposit and withdraw (SEPA support is bidirectional; both enabled-sets derive from this one map).

Separately, Bulgaria adopted the euro in Jan 2026: the deposit/withdraw list badge now reads EUR instead of BGN, and the stale "EUR accounts only" warning (driven by the countryCurrencyMapping.ts BGN row) is removed — Bulgarian bank accounts are EUR now.

The 4 new countries that keep a domestic currency (ALL/MDL/MKD/RSD) get the standard non-EUR SEPA warning rows, consistent with Czechia/Poland/Denmark/etc., so users know to send EUR.

Data-only change — no logic touched. The bank deposit page already renders EUR/SEPA for all of these via getCurrencyConfig().

Risks / breaking changes

  • ⚠️ Cross-repo dependency: merge/deploy peanutprotocol/peanut-api-ts#1175 first. The BE IBAN allowlist (src/utils/iban.tssepaCountries) contained ME but not AL/MD/MK/RS; FE-only would show withdraw as available while validate-iban rejects those IBANs. Fix: Daimo bug and activity receipt bug #1175 adds the four codes (Bridge support verified: sandbox external accounts accepted for RS/AL; Bridge docs list the countries). Deposit has no such dependency (users send to a Bridge-issued EUR IBAN).
  • Removing the BGN mapping row also stops FX-rate widgets treating Bulgaria as non-EUR — intended (euro adoption). Legacy exposure checked: the BE has zero BGN references (Bulgarian activity was always denominated EUR via SEPA), so no stored records lose flag/country resolution; a stale ?from=BGN deep-link degrades gracefully to the generic add-money route.
  • The BE capability gate is unchanged and coarse (railJurisdictionForBank collapses these countries to EU), so it cannot express per-country SEPA support — the FE map is the only per-country switch, which is why the BE allowlist above must move in lockstep.

Design notes / accepted trade-offs

  • Enabling via BRIDGE_ALPHA3_TO_ALPHA2 flips deposit and withdraw together — intentional (SEPA admission is bidirectional), but it means withdraw availability rides on the BE allowlist noted above.
  • The map's comment was retitled: it was labeled "bridge EAA country codes" while already holding US/GB/CH — the old label invited a "clean up non-EEA entries" edit that would disable live rails.
  • Follow-up (not this PR): nonEurSepaCurrencies inside isNonEuroSepaCountry() duplicates the non-Eurozone rows of countryCurrencyMappings in the same file (identical 14-code set, must be edited in pairs). Could be derived via a discriminator field.

QA

  • npm test (124 suites) + npm run typecheck green; flag-asset test auto-covers the 4 new mapping rows (al/md/mk/rs.svg exist).
  • Manual: add-money country list → Albania / Moldova / Montenegro / North Macedonia / Serbia bank rail not greyed "Soon" (deposit + withdraw); Bulgaria badge reads EUR.
  • Bulgaria → bank deposit page: no "EUR accounts only" banner. Serbia → bank page: banner does show.

…rozone

Bridge now supports SEPA for Albania, Moldova, Montenegro, North Macedonia
and Serbia (TASK-20580) — surface the bank rail as available instead of
'Soon' for deposit and withdraw, and show the standard EUR-accounts-only
warning for the four that keep a domestic currency.

Bulgaria adopted the euro in Jan 2026: badge EUR instead of BGN and drop
the stale non-EUR SEPA warning.
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
peanut-wallet Ready Ready Preview, Comment Jul 13, 2026 6:00pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: edfb8788-2553-4f67-99a4-8e784b726e46

📥 Commits

Reviewing files that changed from the base of the PR and between eccdb7d and 976d8f4.

📒 Files selected for processing (1)
  • src/components/AddMoney/consts/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/AddMoney/consts/index.ts

Walkthrough

Updated country currency data and alpha-3 flag mappings for Bulgaria, Albania, Moldova, Montenegro, and Serbia. Adjusted non-EUR SEPA currency detection to reflect the revised currency set.

Changes

Regional currency mappings

Layer / File(s) Summary
Country currency and flag data
src/components/AddMoney/consts/index.ts, src/constants/countryCurrencyMapping.ts
Bulgaria now uses EUR, new country-to-currency entries were added for ALL, MDL, MKD, and RSD, and alpha-3 country mappings were expanded.
Non-EUR SEPA detection
src/constants/countryCurrencyMapping.ts
The whitelist now includes ALL, MDL, MKD, and RSD and removes BGN.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: enhancement

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: enabling SEPA for five countries and updating Bulgaria to EUR.
Description check ✅ Passed The description is directly related to the code changes and explains the SEPA and Bulgaria currency updates clearly.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 6096.83 → 6096.37 (-0.46)
Findings: +1 net (+5 new, -4 resolved)

🆕 New findings (5)

  • critical complexity — src/components/AddMoney/consts/index.ts — CC 31, MI 24.01, SLOC 2255
  • medium high-mdd — src/components/AddMoney/consts/index.ts:2681 — : MDD 31.8 (uses across many lines from declarations)
  • medium complexity — src/constants/countryCurrencyMapping.ts — CC 28, MI 51.95, SLOC 160
  • medium method-complexity — src/constants/countryCurrencyMapping.ts:93 — getBankAccountCountryCode CC 15 SLOC 32
  • low high-mdd — src/constants/countryCurrencyMapping.ts:142 — isNonEuroSepaCountry: MDD 10.3 (uses across many lines from declarations)

✅ Resolved (4)

  • src/components/AddMoney/consts/index.ts — CC 31, MI 24.04, SLOC 2250
  • src/components/AddMoney/consts/index.ts:2675 — : MDD 31.8 (uses across many lines from declarations)
  • src/constants/countryCurrencyMapping.ts — CC 28, MI 53.11, SLOC 145
  • src/constants/countryCurrencyMapping.ts:84 — getBankAccountCountryCode CC 15 SLOC 32

📈 Painscore deltas (top movers)

File Before After Δ
src/constants/countryCurrencyMapping.ts 8.4 9.1 +0.7

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • unit: 1820 ran, 0 failed, 0 skipped, 32.0s

📊 Coverage (unit)

metric %
statements 57.7%
branches 41.8%
functions 46.1%
lines 57.8%
⏱ 10 slowest test cases
time test
4.1s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › never places two stickers in heavy overlap (broad seed sweep)
0.5s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › every sticker stays within canvas at any count
0.4s src/lib/url-parser/parse-token-amount.test.ts › should throw for invalid amount formats
0.3s src/app/actions/__tests__/api-headers-extended.test.ts › should not include apiKey in updateUserById body
0.3s src/app/actions/__tests__/api-headers.test.ts › should include Content-Type in updateUserById
0.2s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › keeps stickers off the username pill (final pass respects the keep-out)
0.1s src/components/Card/__tests__/CardCountryConfirmScreen.test.tsx › renders candidate country names and disables Continue until a pick
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle valid 9-digit US account
0.1s src/components/Global/GeneralRecipientInput/__tests__/GeneralRecipientInput.test.tsx › should handle too long for US account
0.1s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › Perk claimed shows shake class + go home button
📍 Inline annotations are in the **Unit test report** check above. Coverage artifact: `coverage-unit`. Generated by `.github/workflows/tests.yml`.

@abalinda

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

The map already carried US/GB/CH and now the 2025/26 SEPA joiners; the old
label invited a 'clean up non-EEA entries' edit that would disable live
rails.
@abalinda
abalinda marked this pull request as ready for review July 13, 2026 17:18
@abalinda

Copy link
Copy Markdown
Contributor Author

Bulgaria to have adopted EUR reported by the user roletna666 (email: roletna666@gmail.com)

Signed-off-by: ab <78670703+abalinda@users.noreply.github.com>
@coderabbitai coderabbitai Bot added the enhancement New feature or request label Jul 13, 2026
@Hugo0
Hugo0 merged commit 8316bdd into main Jul 13, 2026
23 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants