Skip to content

Add the 11 currencies account-types.ts already supports - #791

Merged
shreyav merged 1 commit into
mainfrom
claude/visualizer-missing-currencies
Aug 4, 2026
Merged

Add the 11 currencies account-types.ts already supports#791
shreyav merged 1 commit into
mainfrom
claude/visualizer-missing-currencies

Conversation

@shreyav

Copy link
Copy Markdown
Contributor

Summary

currencies.ts had drifted behind account-types.ts. Eleven account types had specs but no currency entry — AED, BDT, BWP, COP, EGP, GHS, GTQ, HTG, JMD, PKR, XAF.

That's not cosmetic. The picker iterates currencies, and CurrencySelection.accountType is only ever set from FiatCurrency.accountType or CryptoAsset.accountTypes[].type. A currency absent from this file cannot be selected, so its corridor cannot be built, previewed, or code-generated at all. Takes the list from 26 entries to 37.

This became more consequential after #776: rails are now sent to the API as destination.paymentRail, so entries have to carry real PaymentRail enum values, not display strings.

Where the rails came from

Each currency's rails are taken from its paymentRails enum in openapi/components/schemas/common/<Ccy>AccountInfo.yaml — the authoritative list of what that account type supports. Not inferred from the account-type field shapes, which only hint at it.

CurrencyRails
AED, GTQ, JMDBANK_TRANSFER
BWP, HTG, XAFMOBILE_MONEY
BDT, COP, EGP, GHS, PKRBANK_TRANSFER, MOBILE_MONEY

None of the eleven has an instant rail, so all carry instantRails: []. That has a behavioral consequence worth confirming: jitEligible is computed as instantRails.length > 0, so none of these currencies will offer just-in-time funding. That matches the schemas, but it's the kind of thing worth a second opinion from someone who knows the corridors.

Flags

Eight of the eleven had no flag asset, and getIconSrc returns /flags/<code>.svg unconditionally — they would have rendered broken. Added ae, bd, co, eg, gt, ht, jm, pk.

Sourced from circle-flags, which is already a dependency and is where the existing 39 came from — I verified an existing flag is byte-identical to the package's copy before using it, so these match the current set exactly rather than merely resembling it.

Also adds sv.svg, which fixes a pre-existing bug. The El Salvador entry has referenced a flag that was never committed, so it renders broken on main today. Unrelated to the eleven, but it's a one-file fix in exactly the area this PR touches. Happy to split it out if you'd rather keep the diff clean.

REGION_SHORT

Added the eight new two-letter codes in InputCard.tsx. Its lookup is REGION_SHORT[region] ?? region, so a missing entry already degrades to the raw currency code — this is display polish, not a fix. getCountryName in flow-path.ts needed nothing: its countryCode.toUpperCase() fallback already produces exactly the GT-style output its map contains.

Verification

Checked mechanically across the whole file, not just the new rows:

  • Strict typecheck of currencies.ts — clean
  • All 11 accountType values exist in account-types.ts
  • Every rail in the file is a valid PaymentRail member
  • Every countryCode in the file now resolves to a flag that exists

Not verified: no build or render check. npm ci fails here because @central-icons-react requires CENTRAL_LICENSE_KEY. The Vercel preview is the real check — worth eyeballing the picker for the 11 new rows and their flags.

Judgment calls to second-guess

  • accountLabel for dual-rail currencies. Used "<Country> Bank Account", following CNY_ACCOUNT. The other dual-rail precedent, SLV_ACCOUNT, uses "El Salvador Bank/Mobile". Mixed precedent in the file; I picked the more common form.
  • AED uses accountLabel: 'IBAN', matching EUR and DKK, because its account type is IBAN-based rather than account-number-based.
  • XAF uses countryCode: 'cm' (Cameroon) for a multi-country CFA zone, mirroring how XOF uses 'sn'.
  • Example people are invented, following the file's existing convention of one plausible local name per currency.

Related

Fills the currencies.ts half of the drift found while triaging the stale docs-sync PRs. The remaining known gap in this area is surfacing SWIFT_ACCOUNT, which needs FiatCurrency widened beyond a single accountType plus a fiat account-type dropdown — see closed#775 for the schema research.


Generated by Claude Code

currencies.ts had drifted behind account-types.ts: AED, BDT, BWP, COP,
EGP, GHS, GTQ, HTG, JMD, PKR and XAF all had account-type specs but no
currency entry, and the picker iterates currencies. None of these
corridors could be selected, so none could be built or code-generated.
Rails come from each currency's paymentRails enum in
openapi/components/schemas/common/<Ccy>AccountInfo.yaml, not from the
account-type field shapes. None of the eleven has an instant rail, so
all carry instantRails: [] and are not JIT-eligible.
Adds the eight missing flag assets, copied from circle-flags, which is
where the existing 39 came from (verified byte-identical). Also adds
sv.svg: El Salvador has been referencing a flag that was never
committed, so that entry renders broken on main today.
REGION_SHORT gains the eight new two-letter codes. Its lookup already
falls back to the raw currency code, so this is display polish rather
than a fix.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMnjJ8yWJsui7jLqqrDrL4
@vercel

vercelBot commented Aug 4, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
grid-flow-builderReadyReadyPreviewAug 4, 2026 3:30am
1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
grid-wallet-demoIgnoredIgnoredAug 4, 2026 3:30am

Request Review

@greptile-apps

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR brings the flow builder’s fiat-currency catalog into sync with its supported account types.

  • Adds eleven selectable fiat currencies with account types and payment rails matching the OpenAPI schemas.
  • Adds the required country flag assets, including the previously missing El Salvador flag.
  • Extends compact region labels for the newly introduced currency codes.

Confidence Score: 5/5

The PR appears safe to merge, with the newly exposed currency metadata matching the authoritative account types and payment rails.

The added account types exist in the current API contract, every configured payment rail matches its corresponding schema, non-instant rails remain ineligible for JIT funding, and the required flag assets are present.

Important Files Changed

FilenameOverview
components/grid-visualizer/src/data/currencies.tsAdds eleven fiat-currency definitions whose account types, supported rails, and non-JIT status align with the current OpenAPI contracts.
components/grid-visualizer/src/components/InputCard/InputCard.tsxAdds compact display labels for newly selectable currency regions while preserving the existing fallback behavior.
components/grid-visualizer/public/flags/ae.svgAdds the UAE flag asset referenced by the AED currency definition.
components/grid-visualizer/public/flags/bd.svgAdds the Bangladesh flag asset referenced by the BDT currency definition.
components/grid-visualizer/public/flags/co.svgAdds the Colombia flag asset referenced by the COP currency definition.
components/grid-visualizer/public/flags/eg.svgAdds the Egypt flag asset referenced by the EGP currency definition.
components/grid-visualizer/public/flags/gt.svgAdds the Guatemala flag asset referenced by the GTQ currency definition.
components/grid-visualizer/public/flags/ht.svgAdds the Haiti flag asset referenced by the HTG currency definition.
components/grid-visualizer/public/flags/jm.svgAdds the Jamaica flag asset referenced by the JMD currency definition.
components/grid-visualizer/public/flags/pk.svgAdds the Pakistan flag asset referenced by the PKR currency definition.
components/grid-visualizer/public/flags/sv.svgSupplies the previously missing El Salvador flag referenced by an existing currency entry.

Reviews (1): Last reviewed commit: "Add the 11 currencies account-types.ts a..." | Re-trigger Greptile

@shreyav
shreyav merged commit 8736012 into mainAug 4, 2026
9 checks passed
@shreyav
shreyav deleted the claude/visualizer-missing-currencies branch August 4, 2026 04:16
shreyav added a commit that referenced this pull request Aug 4, 2026
## Summary
`PaymentEthereumWalletInfo.yaml` declares `enum: [USDC, USDT]`, but
`crypto.ts` listed `ETHEREUM_WALLET` only under USDT. USDC-on-Ethereum
is supported by the API and simply could not be selected in the
visualizer, so that flow could not be built or code-generated.
One line. Ethereum is the only chain carrying both assets — Base and
Polygon are USDC-only per their own `Payment<Chain>WalletInfo.yaml`
enums — so this is the single missing entry, not the first of a batch.
| Chain | Schema enum | In `crypto.ts` before |
|---|---|---|
| Ethereum | `USDC`, `USDT` | USDT only ❌ |
| Base | `USDC` | USDC ✅ |
| Polygon | `USDC` | USDC ✅ |
## ⚠️ Missing network icon — please read
`NetworkDropdown` renders `/networks/${network.toLowerCase()}.svg` with
no error handling, and **`public/networks/ethereum.svg` does not
exist**. The new row will render without an icon.
This gap is pre-existing, not introduced here — `tron.svg` and
`plasma.svg` are missing too, so USDT's dropdown already shows three
iconless rows. But USDC's dropdown currently has all three of its icons
(`solana`, `polygon`, `base`), so this change does put the first broken
one there.
I did not add the asset: an Ethereum mark is brand artwork, and
inventing one that doesn't match the existing set is worse than leaving
the gap visible. Someone should drop in `ethereum.svg` — and `tron.svg`
/ `plasma.svg` while they're at it, since those are already broken
today.
If the missing icon is a blocker, holding this until the asset lands is
reasonable. The data being wrong is the more serious problem, so I'd
merge and follow up.
## Verification
- Strict typecheck of `crypto.ts` — clean
- Cross-checked all three EVM chains against their
`Payment<Chain>WalletInfo.yaml` enums, not just Ethereum
- **Not verified:** no build or render check — `npm ci` fails here
because `@central-icons-react` requires `CENTRAL_LICENSE_KEY`. The
Vercel preview is the real check; worth confirming the USDC dropdown now
offers Ethereum and seeing how the iconless row actually looks.
## Context
Found while triaging the stale docs-sync PRs. This is the one
genuinely-unlanded, non-documentation item from #288, whose other
changes are already on `main` (`ETHEREUM_WALLET` in `account-types.ts`,
the `businessType: FINTECH` → `FINANCE_AND_INSURANCE` fix) or superseded
(currency entries via #791, the supported-chain table via #777).
---
_Generated by [Claude
Code](https://claude.ai/code/session_01MMnjJ8yWJsui7jLqqrDrL4)_
Co-authored-by: Claude <noreply@anthropic.com>
shreyav added a commit that referenced this pull request Aug 4, 2026
## Summary
`external-accounts.mdx` documented **21 of the 45** account types in
`ExternalAccountType`. Because the page reads as an enumeration — a tab
per country or rail — a developer scanning it would reasonably conclude
the other 24 aren't supported. This documents all of them.
Docs-only, one file, +927 lines. Generated bundles untouched.
**Coverage is now 45/45**, verified by diffing the `accountType` values
in the page against `account-types.ts`.
| Added | Types |
|---|---|
| 18 fiat tabs | `AED` `BDT` `BWP` `CNY` `DKK` `EGP` `GHS` `GTQ` `HKD`
`HTG` `IDR` `JMD` `MYR` `PKR` `SGD` `THB` `VND` `XAF` |
| Cryptocurrency tab | Ethereum L1, Base, Polygon, Solana, Tron, Plasma,
Lightning — it previously showed Spark alone |
## Scope grew during the work — worth knowing
I started from a list of 17 missing types. A mechanical diff against
`account-types.ts` found **24**: `DKK`, `HKD`, `IDR`, `MYR`, `SGD`,
`THB`, `VND` and `LIGHTNING` weren't on my list. Stopping at 17 would
have reproduced the same partial-coverage problem in a PR whose entire
purpose is fixing it, so all 24 are here.
## Where the content comes from
Nothing is inferred from existing examples — each type was read from its
schema:
- **Fields and required/optional split** — `<Ccy>AccountInfoBase.yaml`
- **Beneficiary shape** — `<Ccy>Beneficiary.yaml`, which is where the
real variation lives. Most need only `fullName`, but **AED** and **JMD**
also require an `address`, **GTQ** requires `countryOfResidence` and
`phoneNumber`, and **JMD** requires `phoneNumber`. Those are easy to
miss and produce confusing validation failures.
- **Per-chain asset support** — each `Payment<Chain>WalletInfo.yaml`.
Ethereum carries `USDC` and `USDT`; Base and Polygon are USDC-only.
Stated per chain rather than assumed uniform.
- **Dual-rail currencies** (BDT, CNY, EGP, GHS, PKR) get separate
bank-transfer and mobile-money examples, following the existing Colombia
and El Salvador tabs.
**No example sends `paymentRails`.** It's response-only, and three
separate PRs (#351, #661, and the original #359 lineage) got that wrong.
The single occurrence of it in this file remains where it belongs — the
`GET` **response** example.
Example people match the entries added to `currencies.ts` in #791, so
the docs and the visualizer describe the same fictional customers.
## Verification
- **All 54 curl payloads in the file parse as JSON** — not just the new
ones
- **Every `accountType` used is a valid `ExternalAccountType` member**
- **Coverage diff is empty**: no type in `account-types.ts` is
undocumented
- MDX component tags and code fences balance
- All new curl examples use `-u`, consistent with #793
- `openapi.yaml` and `mintlify/openapi.yaml` byte-identical to `main`
**Not verified:** no visual render. This is 927 lines of new tabs, so
the **Mintlify preview is the meaningful review** — worth checking that
the tab strip doesn't overflow badly now that it holds 32 tabs. `make
lint` was not run; it fails on `main` regardless (`npx spectral lint`
resolves to a stub `spectral@0.0.0`).
## One thing this surfaces
`SWIFT_ACCOUNT` is documented here but **absent from
`account-types.ts`**, so the visualizer still can't produce it. That's
the known gap from closed#775 — the entry was correct but unreachable
without widening `FiatCurrency` past a single `accountType`. Unchanged
by this PR, but the asymmetry is now visible: the docs describe a type
the visualizer can't build.
## Left out deliberately
I had also listed adding SWIFT to `account-model.mdx`. **That item
doesn't hold up.** My earlier check used the wrong path — the file is at
`platform-overview/core-concepts/account-model.mdx`, not `snippets/`.
Looking at the real file, it's an explicitly illustrative page showing 8
representative types, not an enumeration. Singling out SWIFT there would
recreate the curated-list problem rather than fix one. Left alone.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01MMnjJ8yWJsui7jLqqrDrL4)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@shreyav@AaryamanBhute@claude