From 8b19da6c4116c5f2193bddc439c68df5fb900c2a Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 08:22:16 +0000 Subject: [PATCH] Sync Grid Visualizer with PaymentRail enum values Update currencies.ts to use SCREAMING_SNAKE_CASE payment rail values that match the PaymentRail enum in the OpenAPI spec (e.g., FEDNOW, FASTER_PAYMENTS, SEPA_INSTANT, BANK_TRANSFER, MOBILE_MONEY). Add paymentRails field to generated external account creation requests in code-generator.ts to match documented workflow examples. Co-Authored-By: Claude Opus 4.5 --- .../grid-visualizer/src/data/currencies.ts | 52 +++++++++---------- .../grid-visualizer/src/lib/code-generator.ts | 8 +++ 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/components/grid-visualizer/src/data/currencies.ts b/components/grid-visualizer/src/data/currencies.ts index fc14d4a4..a06916ff 100644 --- a/components/grid-visualizer/src/data/currencies.ts +++ b/components/grid-visualizer/src/data/currencies.ts @@ -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' }, }, { @@ -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' }, }, { @@ -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' }, }, { @@ -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' }, }, { @@ -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' }, }, { @@ -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' }, }, { @@ -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' }, }, { @@ -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' }, }, { @@ -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' }, }, { @@ -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' }, }, { @@ -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' }, }, { @@ -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' }, }, { @@ -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' }, }, { @@ -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' }, }, { @@ -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' }, }, { @@ -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' }, }, { @@ -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' }, }, { @@ -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' }, }, { @@ -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' }, }, { @@ -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' }, }, { @@ -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' }, }, ]; diff --git a/components/grid-visualizer/src/lib/code-generator.ts b/components/grid-visualizer/src/lib/code-generator.ts index 85146a0c..cdf3fdcc 100644 --- a/components/grid-visualizer/src/lib/code-generator.ts +++ b/components/grid-visualizer/src/lib/code-generator.ts @@ -48,6 +48,14 @@ function buildAccountInfoBody(sel: CurrencySelection): Record { 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; + } + } + // Beneficiary goes inside accountInfo per API spec if (spec.beneficiaryRequired) { info.beneficiary = {