feat(spec): add sender-denominated bounds to receiver lookup CurrencyPreference - #868
feat(spec): add sender-denominated bounds to receiver lookup CurrencyPreference#868ls-bolt[bot] wants to merge 1 commit into
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
55769d0 to
19ae9ea
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
✱ Stainless preview builds for gridThis PR will update the cli go kotlin openapi php python ruby typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-typescript studio · code · diff
✅ grid-openapi studio · code · diff
✅ grid-ruby studio · code · diff
✅ grid-go studio · code · diff
✅ grid-kotlin studio · code · diff
✅ grid-python studio · code · diff
✅ grid-php studio · code · diff
✅ grid-cli studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
Greptile SummaryThe PR adds optional sender-denominated minimum and maximum amounts to receiver lookup currency preferences and synchronizes both bundled specifications. The response contract currently omits the sender currency needed to interpret those minor-unit values. Confidence Score: 4/5The response contract should identify the sender currency before merging so clients can safely interpret the new minor-unit bounds. Receiver lookups can return sender-denominated integer bounds without exposing the currency or decimal scale that gives those integers meaning, while the analogous exchange-rate representation includes sourceCurrency. Files Needing Attention: openapi/components/schemas/receiver/CurrencyPreference.yaml
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/receiver/CurrencyPreference.yaml | Adds the two optional bounds, but their sender-currency denomination is not represented in the lookup response. |
| openapi.yaml | Correctly mirrors the source schema addition, including the same missing denomination context. |
| mintlify/openapi.yaml | Keeps the documentation bundle synchronized but propagates the ambiguous sender-denominated fields. |
Prompt To Fix All With AI
### Issue 1
openapi/components/schemas/receiver/CurrencyPreference.yaml:30-41
**Sender currency is missing**
When a receiver lookup returns `minSendingAmount` or `maxSendingAmount`, the response does not identify the sender currency whose minor units define these values, causing clients to display or validate sending limits using the wrong denomination. The analogous exchange-rate response avoids this ambiguity by including `sourceCurrency` alongside its bounds.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat(spec): add sender-denominated bound..." | Re-trigger Greptile
| minSendingAmount: | ||
| type: integer | ||
| format: int64 | ||
| description: >- | ||
| The minimum amount that can be sent for this currency, in the smallest | ||
| unit of the sender's currency (e.g. cents for USD). Same semantics as | ||
| `minSendingAmount` on the exchange rates endpoint. This is an estimate | ||
| based on the current exchange rate and is subject to change when calling | ||
| the quotes endpoint. Omitted when the sending-side bound cannot be | ||
| resolved. | ||
| minimum: 0 | ||
| example: 100 |
There was a problem hiding this comment.
When a receiver lookup returns minSendingAmount or maxSendingAmount, the response does not identify the sender currency whose minor units define these values, causing clients to display or validate sending limits using the wrong denomination. The analogous exchange-rate response avoids this ambiguity by including sourceCurrency alongside its bounds.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/receiver/CurrencyPreference.yaml
Line: 30-41
Comment:
**Sender currency is missing**
When a receiver lookup returns `minSendingAmount` or `maxSendingAmount`, the response does not identify the sender currency whose minor units define these values, causing clients to display or validate sending limits using the wrong denomination. The analogous exchange-rate response avoids this ambiguity by including `sourceCurrency` alongside its bounds.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Good catch — fixed. A sender-denominated integer isn't interpretable without naming its currency.
Added an optional sendingCurrency to ReceiverLookupResponse (the shared base for both the UMA and external-account lookups) rather than putting it on each CurrencyPreference: the sender is the same for every entry in one lookup, so repeating it per currency would invite the two from disagreeing. That mirrors how /exchange-rates carries sourceCurrency alongside its bounds.
19ae9ea to
42bf775
Compare

Summary
GET /exchange-ratesreports its bounds asminSendingAmount/maxSendingAmountin the sender's currency, but the receiver lookup endpoints reportmin/maxin the receiver's currency. Integrators that need both sides end up recomputing the sending-side bound client-side, which they cannot do correctly — the real sending bound is the intersection of an FX-converted receiver cap and a sending-leg cap the client never sees.This adds the sender-denominated pair to
CurrencyPreference, matching the semantics/exchange-ratesalready uses.Approach
Purely additive and optional.
CurrencyPreferenceis shared byReceiverUmaLookupResponseandReceiverExternalAccountLookupResponse(bothallOfReceiverLookupResponse), so one schema change covers both lookup endpoints.Existing
min/maxare unchanged and stay required. The new fields are optional so a server that cannot resolve the sending-side bound omits them rather than publishing a wrong number, and no existing client breaks.Both descriptions carry the same "estimate, subject to change when calling the quotes endpoint" caveat that
estimatedExchangeRatealready documents — onlyPOST /quotesproduces a locked rate.A sending-denominated integer is meaningless without naming its currency, so
ReceiverLookupResponsealso gains an optionalsendingCurrency./exchange-ratessolves the same problem withsourceCurrency; the sender is identical for every entry in one lookup, so it belongs on the response rather than repeated on eachCurrencyPreference. (Raised by Greptile — good catch.)Changes: 4 files
openapi/components/schemas/receiver/CurrencyPreference.yaml— add optionalminSendingAmount/maxSendingAmount(int64, sender-currency minor units)openapi/components/schemas/receiver/ReceiverLookupResponse.yaml— add optionalsendingCurrencyso those minor units are interpretableopenapi.yaml— rebundled (make build)mintlify/openapi.yaml— rebundlednpm run lintpasses with 0 errors.The sparkcore implementation that populates these fields is a separate PR in webdev.
Reply with a comment (e.g. LGTM) to approve — emoji reactions don't notify me here.