feat: add cryptoNetwork field to RealtimeFundingQuoteSource#236
feat: add cryptoNetwork field to RealtimeFundingQuoteSource#236
Conversation
Callers depositing stablecoins (USDC, USDT) via realtime funding need to specify which network they are depositing on so the correct vault deposit address can be generated. Without this field, the server would have to guess or hardcode the network. cryptoNetwork is optional for backward compatibility — existing fiat realtime funding sources (USD, MXN, etc.) are unaffected. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
✱ Stainless preview buildsThis PR will update the kotlin openapi python typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-openapi studio · code · diff
✅ grid-python studio · code · diff
✅ grid-kotlin studio · code · diff
✅ grid-typescript studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
Greptile SummaryAdded optional
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/quotes/RealtimeFundingQuoteSource.yaml | Added optional cryptoNetwork field with clear documentation and examples for stablecoin network selection |
| openapi.yaml | Generated bundle correctly updated with new cryptoNetwork field from source schema |
| mintlify/openapi.yaml | Generated bundle correctly updated with new cryptoNetwork field for documentation |
Last reviewed commit: a14bb9d
| for the full list of supported fiat and crypto currencies. | ||
| example: USD | ||
| cryptoNetwork: | ||
| type: string |
There was a problem hiding this comment.
@wuvictor-95 I thought we were going to return an array of all supported networks in the quote response payment instructions?
There was a problem hiding this comment.
It's what we are doing currently since we only have one network. In the future though, as we expand our capabilities to many networks, it makes less sense to do. We wouldn't want to create 3+ garbage deposit addresses for different networks everytime we create a quote
There was a problem hiding this comment.
Oh man. This is another breaking change. And I thought address generation was cheap and we were going to use that pattern for other payment instructions.
There was a problem hiding this comment.
This could be handled via config e.g. platform specifies which networks they care about when funding payments. Default is solana.
Yea, it's cheap but not 0. We have to check in each address to be watched on Alchemy, and alchemy has limits. It's definitely not scalable to, say, spin up 5 addresses for every payment. But perhaps we can manage that complexity and clean up all the addresses after 24 hours.
There was a problem hiding this comment.
It's better to get breaking changes in now. I do think it's a better experience to be able to accept across multiple chains. As an example if I'm depositing to Uniswap, I generate the address once and can send to it from any network. Vs needing to specify the network prior to address generation.
There was a problem hiding this comment.
Yea, I think it really depends on the use case. I can totally see a platform who can fulfill payments on behalf of users, and gives the user multiple options on how to fund the payment.
It's possible to manage the complexity on our side and always present multiple deposit addresses. I'm ok with leaving as is if you see viable use cases.
There was a problem hiding this comment.
This isn't actually technically a breaking change though from an API standpoint since we're adding a new optional field. We could just return all available networks if no network is specified, right? Or we could just error out and then the like 3 people testing sandbox will see it and we can flag that we're adding this in sandbox. Not a huge deal imo.
Summary
Adds an optional
cryptoNetworkfield toRealtimeFundingQuoteSource.Callers depositing stablecoins (USDC, USDT) via realtime funding need to specify which network they are depositing on so the server can generate a deposit address on the correct network. Without this field, the server has to hardcode the network (e.g. Solana devnet for sandbox), which won't work when production supports multiple networks.
The field is optional for backward compatibility — existing fiat realtime funding sources (USD, MXN, etc.) are unaffected.
Usage
{ "source": { "sourceType": "REALTIME_FUNDING", "currency": "USDC", "cryptoNetwork": "SOLANA_MAINNET", "customerId": "Customer:..." } }Test plan
cryptoNetworkrequired)cryptoNetwork: "SOLANA_MAINNET"returns a Solana deposit addressmake lint)🤖 Generated with Claude Code