feat(grid-visualizer): add SWIFT_ACCOUNT to accountTypeSpecs - #775
Closed
shreyav wants to merge 1 commit into
Closed
feat(grid-visualizer): add SWIFT_ACCOUNT to accountTypeSpecs#775shreyav wants to merge 1 commit into
shreyav wants to merge 1 commit into
Conversation
SWIFT_ACCOUNT is defined in the OpenAPI schemas, the Mintlify external account docs, the grid-api skill reference and the generated bank account fields for both wallet demos, but was missing from the visualizer's account type specs. Fields and required/optional split are derived from openapi/components/schemas/common/SwiftAccountInfoBase.yaml; example values match the Nigerian GTBank example in mintlify/snippets/external-accounts.mdx. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MMnjJ8yWJsui7jLqqrDrL4
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Contributor
Greptile SummaryAdds the missing SWIFT account metadata to the Grid visualizer.
Confidence Score: 5/5The PR appears safe to merge, with no actionable defect in the added static account-type metadata. The new entry matches the repository’s SWIFT field definitions, and its currently unreachable state prevents it from altering generated visualizer output.
|
| Filename | Overview |
|---|---|
| components/grid-visualizer/src/data/account-types.ts | Adds a schema-aligned SWIFT_ACCOUNT specification; it remains unreachable until the visualizer supports selecting alternate fiat account types. |
Reviews (1): Last reviewed commit: "feat(grid-visualizer): add SWIFT_ACCOUNT..." | Re-trigger Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SWIFT_ACCOUNTexists everywhere else in this repo — the OpenAPI schemas (SwiftAccountInfoBase.yaml,ExternalAccountType.yaml,ExternalAccountInfoOneOf.yaml,PaymentInstructions.yaml), the Mintlify docs (mintlify/snippets/external-accounts.mdxhas a SWIFT tab), the grid-api skill reference (.claude/skills/grid-api/references/account-types.md), and the generatedbankAccountFields.generated.tsin bothcomponents/grid-wallet-demoandcomponents/grid-wallet-prod.It was missing from exactly one place:
components/grid-visualizer/src/data/account-types.ts. This PR adds it.This supersedes the SWIFT portion of #478 and #531, both of which are being closed as largely superseded — the rest of their content already landed on
mainvia later syncs. This one entry is the genuine remainder.Fields
Derived from
openapi/components/schemas/common/SwiftAccountInfoBase.yamlrather than from the old PR descriptions:countryswiftCodebankNameaccountNumberibanaccountNumberandibanare conditionally exclusive. Both are listed with disambiguatingdescriptions, matching how the file already handles the same situation forPKR_ACCOUNT,EGP_ACCOUNT,SLV_ACCOUNTandCOP_ACCOUNT.beneficiaryRequired: true— every fiat bank account type in the file sets this, and the SWIFT example inmintlify/snippets/external-accounts.mdxincludes abeneficiaryblock.Example values match the Nigerian GTBank example already in the Mintlify SWIFT tab (
NG/GTBINGLA/Guaranty Trust Bank/1234567890) rather than inventing new ones. Theibanexample is the schema's own example.I investigated how
accountTypeSpecsis consumed. It is read in exactly one file,components/grid-visualizer/src/lib/code-generator.ts, always as a lookup keyed byCurrencySelection.accountType:buildAccountInfoBody()→accountTypeSpecs[sel.accountType]generateSteps()→accountTypeSpecs[destination.accountType]/accountTypeSpecs[source.accountType]Every
CurrencySelectionis constructed from one of only two data sources:data/currencies.ts—FiatCurrency.accountType, a single string per currency (built inCurrencyPicker.lookupSelection()andhooks/useFlowBuilder.ts)data/crypto.ts—CryptoAsset.accountTypes[].typeSWIFT_ACCOUNTis not a currency; it's a cross-currency correspondent-banking account type, so it appears in neither. Nothing in the visualizer can currently produceaccountType === 'SWIFT_ACCOUNT', so this spec is dead data until a follow-up lands.I am deliberately not fixing that here: two other PRs are in flight against
components/grid-visualizer/src/data/currencies.tsand touching it would create conflicts. Theaccount-types.tsentry is correct and needed either way, so it ships now.What the follow-up needs to do: allow a fiat currency to offer more than one account type, and let the user choose. Concretely:
data/currencies.ts, widenFiatCurrencybeyond the singleaccountType: string— e.g. add an optionalalternateAccountTypes?: { type: string; label: string }[]— and addSWIFT_ACCOUNTas an alternate on the currencies where an international wire is a real option.components/InputCard/InputCard.tsx, add a fiat equivalent of the existinggetNetworkOptions()/NetworkDropdownpattern (which already does exactly this for crypto assets with more than oneaccountTypesentry), so the selected account type flows intoCurrencySelection.accountType.CurrencyPicker.lookupSelection()andhooks/useFlowBuilder.ts, both of which currently hard-assignaccountType: fiat.accountType.Once that lands, the spec added here is picked up by
code-generator.tswith no further change.Testing / what I could not verify
npx tsc --noEmit --strict --ignoreConfig --ignoreDeprecations 6.0 --target es2020 --moduleResolution bundler --module esnext src/data/account-types.ts— clean. The file is pure TypeScript with no imports, so this is a complete check of it.npm ciincomponents/grid-visualizerfails because@central-icons-reactrequires aCENTRAL_LICENSE_KEYenv var that is not available in this environment. I have not run the app, the project-widetsc, ESLint, or any visual check.There are no tests covering
account-types.tsin this component.Generated by Claude Code