Skip to content
Open
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
52 changes: 26 additions & 26 deletions components/grid-visualizer/src/data/currencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export const currencies: FiatCurrency[] = [
countryCode: 'us',
accountType: 'USD_ACCOUNT',
accountLabel: 'US Bank Account',
instantRails: ['RTP', 'FedNow'],
allRails: ['ACH', 'Wire', 'RTP', 'FedNow'],
instantRails: ['RTP', 'FEDNOW'],
allRails: ['ACH', 'WIRE', 'RTP', 'FEDNOW'],
examplePerson: { fullName: 'Jane Doe', nationality: 'US' },
},
{
Expand All @@ -31,8 +31,8 @@ export const currencies: FiatCurrency[] = [
countryCode: 'eu',
accountType: 'EUR_ACCOUNT',
accountLabel: 'IBAN',
instantRails: ['SEPA Instant'],
allRails: ['SEPA', 'SEPA Instant'],
instantRails: ['SEPA_INSTANT'],
allRails: ['SEPA', 'SEPA_INSTANT'],
examplePerson: { fullName: 'Anna Müller', nationality: 'DE' },
},
{
Expand All @@ -41,8 +41,8 @@ export const currencies: FiatCurrency[] = [
countryCode: 'gb',
accountType: 'GBP_ACCOUNT',
accountLabel: 'UK Bank Account',
instantRails: ['Faster Payments'],
allRails: ['Faster Payments'],
instantRails: ['FASTER_PAYMENTS'],
allRails: ['FASTER_PAYMENTS'],
examplePerson: { fullName: 'James Wilson', nationality: 'GB' },
},
{
Expand Down Expand Up @@ -81,8 +81,8 @@ export const currencies: FiatCurrency[] = [
countryCode: 'dk',
accountType: 'DKK_ACCOUNT',
accountLabel: 'IBAN',
instantRails: ['SEPA Instant'],
allRails: ['SEPA', 'SEPA Instant'],
instantRails: ['SEPA_INSTANT'],
allRails: ['SEPA', 'SEPA_INSTANT'],
examplePerson: { fullName: 'Lars Jensen', nationality: 'DK' },
},
{
Expand All @@ -92,7 +92,7 @@ export const currencies: FiatCurrency[] = [
accountType: 'NGN_ACCOUNT',
accountLabel: 'Nigerian Bank Account',
instantRails: [],
allRails: ['Bank Transfer'],
allRails: ['BANK_TRANSFER'],
examplePerson: { fullName: 'Chioma Okafor', nationality: 'NG' },
},
{
Expand All @@ -102,7 +102,7 @@ export const currencies: FiatCurrency[] = [
accountType: 'CAD_ACCOUNT',
accountLabel: 'Canadian Bank Account',
instantRails: [],
allRails: ['Bank Transfer'],
allRails: ['BANK_TRANSFER'],
examplePerson: { fullName: 'Sophie Tremblay', nationality: 'CA' },
},
{
Expand All @@ -112,7 +112,7 @@ export const currencies: FiatCurrency[] = [
accountType: 'PHP_ACCOUNT',
accountLabel: 'Philippine Bank Account',
instantRails: [],
allRails: ['Bank Transfer'],
allRails: ['BANK_TRANSFER'],
examplePerson: { fullName: 'Maria Santos', nationality: 'PH' },
},
{
Expand All @@ -121,8 +121,8 @@ export const currencies: FiatCurrency[] = [
countryCode: 'sg',
accountType: 'SGD_ACCOUNT',
accountLabel: 'Singapore Bank Account',
instantRails: ['PayNow', 'FAST'],
allRails: ['PayNow', 'FAST', 'Bank Transfer'],
instantRails: ['PAYNOW', 'FAST'],
allRails: ['PAYNOW', 'FAST', 'BANK_TRANSFER'],
examplePerson: { fullName: 'Wei Lin Tan', nationality: 'SG' },
},
{
Expand All @@ -132,7 +132,7 @@ export const currencies: FiatCurrency[] = [
accountType: 'HKD_ACCOUNT',
accountLabel: 'Hong Kong Bank Account',
instantRails: [],
allRails: ['Bank Transfer'],
allRails: ['BANK_TRANSFER'],
examplePerson: { fullName: 'Emily Chan', nationality: 'HK' },
},
{
Expand All @@ -142,7 +142,7 @@ export const currencies: FiatCurrency[] = [
accountType: 'IDR_ACCOUNT',
accountLabel: 'Indonesian Bank Account',
instantRails: [],
allRails: ['Bank Transfer'],
allRails: ['BANK_TRANSFER'],
examplePerson: { fullName: 'Siti Rahayu', nationality: 'ID' },
},
{
Expand All @@ -152,7 +152,7 @@ export const currencies: FiatCurrency[] = [
accountType: 'KES_ACCOUNT',
accountLabel: 'M-Pesa',
instantRails: [],
allRails: ['Mobile Money'],
allRails: ['MOBILE_MONEY'],
examplePerson: { fullName: 'Wanjiku Kamau', nationality: 'KE' },
},
{
Expand All @@ -162,7 +162,7 @@ export const currencies: FiatCurrency[] = [
accountType: 'MYR_ACCOUNT',
accountLabel: 'Malaysian Bank Account',
instantRails: [],
allRails: ['Bank Transfer'],
allRails: ['BANK_TRANSFER'],
examplePerson: { fullName: 'Nurul Aisyah', nationality: 'MY' },
},
{
Expand All @@ -172,7 +172,7 @@ export const currencies: FiatCurrency[] = [
accountType: 'RWF_ACCOUNT',
accountLabel: 'Mobile Money',
instantRails: [],
allRails: ['Mobile Money'],
allRails: ['MOBILE_MONEY'],
examplePerson: { fullName: 'Jean Uwimana', nationality: 'RW' },
},
{
Expand All @@ -182,7 +182,7 @@ export const currencies: FiatCurrency[] = [
accountType: 'THB_ACCOUNT',
accountLabel: 'Thai Bank Account',
instantRails: [],
allRails: ['Bank Transfer'],
allRails: ['BANK_TRANSFER'],
examplePerson: { fullName: 'Somchai Prasert', nationality: 'TH' },
},
{
Expand All @@ -192,7 +192,7 @@ export const currencies: FiatCurrency[] = [
accountType: 'TZS_ACCOUNT',
accountLabel: 'Mobile Money',
instantRails: [],
allRails: ['Mobile Money'],
allRails: ['MOBILE_MONEY'],
examplePerson: { fullName: 'Halima Mwanga', nationality: 'TZ' },
},
{
Expand All @@ -202,7 +202,7 @@ export const currencies: FiatCurrency[] = [
accountType: 'VND_ACCOUNT',
accountLabel: 'Vietnamese Bank Account',
instantRails: [],
allRails: ['Bank Transfer'],
allRails: ['BANK_TRANSFER'],
examplePerson: { fullName: 'Nguyen Thi Lan', nationality: 'VN' },
},
{
Expand All @@ -212,7 +212,7 @@ export const currencies: FiatCurrency[] = [
accountType: 'ZAR_ACCOUNT',
accountLabel: 'South African Bank Account',
instantRails: [],
allRails: ['Bank Transfer'],
allRails: ['BANK_TRANSFER'],
examplePerson: { fullName: 'Thabo Nkosi', nationality: 'ZA' },
},
{
Expand All @@ -222,7 +222,7 @@ export const currencies: FiatCurrency[] = [
accountType: 'ZMW_ACCOUNT',
accountLabel: 'Mobile Money',
instantRails: [],
allRails: ['Mobile Money'],
allRails: ['MOBILE_MONEY'],
examplePerson: { fullName: 'Mwila Tembo', nationality: 'ZM' },
},
{
Expand All @@ -232,7 +232,7 @@ export const currencies: FiatCurrency[] = [
accountType: 'MWK_ACCOUNT',
accountLabel: 'Mobile Money',
instantRails: [],
allRails: ['Mobile Money'],
allRails: ['MOBILE_MONEY'],
examplePerson: { fullName: 'Chimwemwe Banda', nationality: 'MW' },
},
{
Expand All @@ -242,7 +242,7 @@ export const currencies: FiatCurrency[] = [
accountType: 'UGX_ACCOUNT',
accountLabel: 'Mobile Money',
instantRails: [],
allRails: ['Mobile Money'],
allRails: ['MOBILE_MONEY'],
examplePerson: { fullName: 'Grace Namugga', nationality: 'UG' },
},
{
Expand All @@ -252,7 +252,7 @@ export const currencies: FiatCurrency[] = [
accountType: 'XOF_ACCOUNT',
accountLabel: 'Mobile Money',
instantRails: [],
allRails: ['Mobile Money'],
allRails: ['MOBILE_MONEY'],
examplePerson: { fullName: 'Amadou Diallo', nationality: 'SN' },
},
];
8 changes: 8 additions & 0 deletions components/grid-visualizer/src/lib/code-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ function buildAccountInfoBody(sel: CurrencySelection): Record<string, unknown> {
info[field.name] = field.example;
}

// Add paymentRails for fiat currencies
if (sel.type === 'fiat') {
const fiat = currencies.find((c) => c.code === sel.code);
if (fiat && fiat.allRails.length > 0) {
info.paymentRails = fiat.allRails;
}
}
Comment on lines +51 to +57
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 paymentRails is a response-only field

paymentRails is not part of the external account creation request schema. Every *ExternalAccountCreateInfo schema (e.g. UsdExternalAccountCreateInfo) extends *AccountInfoBase, and none of those base schemas include paymentRails. The field only appears in the response-side *AccountInfo schemas (e.g. UsdAccountInfo) that the API returns after creation.

Sending paymentRails inside accountInfo will either cause a 400 validation error or be silently ignored — either way it generates misleading example code for developers using this visualizer as a reference. The OpenAPI spec examples in customers_external_accounts.yaml also omit it from create request bodies.

Prompt To Fix With AI
This is a comment left during a code review.
Path: components/grid-visualizer/src/lib/code-generator.ts
Line: 51-57

Comment:
**`paymentRails` is a response-only field**

`paymentRails` is not part of the external account creation request schema. Every `*ExternalAccountCreateInfo` schema (e.g. `UsdExternalAccountCreateInfo`) extends `*AccountInfoBase`, and none of those base schemas include `paymentRails`. The field only appears in the response-side `*AccountInfo` schemas (e.g. `UsdAccountInfo`) that the API returns after creation.

Sending `paymentRails` inside `accountInfo` will either cause a 400 validation error or be silently ignored — either way it generates misleading example code for developers using this visualizer as a reference. The OpenAPI spec examples in `customers_external_accounts.yaml` also omit it from create request bodies.

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claude fix this


// Beneficiary goes inside accountInfo per API spec
if (spec.beneficiaryRequired) {
info.beneficiary = {
Expand Down
Loading