feat: add onChainTransaction to transaction source/destination#680
feat: add onChainTransaction to transaction source/destination#680ls-bolt[bot] wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
✱ 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-openapi studio · code · diff
✅ grid-ruby studio · code · diff
✅ grid-go studio · code · diff
✅ grid-kotlin studio · code · diff
|
| description: On-chain transaction hash of the crypto transfer for this leg of the transaction. | ||
| example: '4Nd1m6Qkq7RfKuE5vQ9qP9Tn6H94Ueqb4xXHzsAbd8WgpD9k6oRnJm2pQ7sT1uV3wX5yZ6aB8cD9eF0gH1i' | ||
| network: | ||
| type: string |
There was a problem hiding this comment.
Do we already have an enum like this anywhere in the API?
There was a problem hiding this comment.
Good question — I checked, and no, there's no existing enum for this. The only network-ish thing in the spec is cryptoNetwork on EstimateCryptoWithdrawalFeeRequest, and it's a free-form type: string with bare, non-environment-qualified example values (SOLANA, ETHEREUM, …) — no enum, no mainnet/devnet distinction.
So I've extracted this into a reusable named schema CryptoNetwork (openapi/components/schemas/crypto/CryptoNetwork.yaml) and onChainTransaction.network now $refs it, so it's not a one-off and future fields can share it. I kept it environment-qualified (SOLANA_MAINNET / SOLANA_DEVNET) because for an on-chain tx you need to know the environment to hit the right explorer — that's the one thing the existing bare string can't express.
I left the existing cryptoNetwork input string alone for now (converging it to this enum would change accepted input values = a breaking change on that endpoint), but it's the obvious candidate to adopt this enum later for consistency. Happy to do that convergence in a follow-up if you want it.
| Transaction hash of the settlement transfer that delivered funds to the | ||
| transaction's destination, when available. For UMA payments this is the inter-VASP | ||
| settlement leg (e.g. USDC on Solana to the receiving partner), not a transfer to a | ||
| customer's own wallet. When the destination is itself an external crypto wallet this |
There was a problem hiding this comment.
Should we actually remove the external wallet destination from this spot? It feels weird to explicitly specify that in two places.
There was a problem hiding this comment.
Agreed — specifying it in two places is confusing. Fixed: reconciliationInstructions.transactionHash is now scoped purely to the inter-VASP settlement leg of a UMA payment (the internal settlement detail), and no longer mentions the external-wallet destination. When the destination is an external crypto wallet, the hash lives only on destination.onChainTransaction — one home, no overlap.
I've also updated the sparkcore plan so the backend matches the docs: _gen_reconciliation_instructions will not populate transactionHash when the destination is an external crypto wallet (that hash goes to destination.onChainTransaction instead) — it stays populated only for the settlement-layer/UMA case. Note that's a small behavior change to the existing field for direct crypto withdrawals (hash moves from here to onChainTransaction); calling it out explicitly since it's technically observable.
Adds an optional onChainTransaction (transactionHash + network) to BaseTransactionSource and BaseTransactionDestination for legs whose counterparty is an external crypto wallet. network references a new reusable CryptoNetwork enum (environment-qualified: mainnet vs devnet/testnet/regtest). Reconciliation instructions' transactionHash is now scoped purely to the inter-VASP settlement leg, with the external-wallet endpoint hash living only on the source/destination. Additive, no version bump.
eab4de5 to
2da1605
Compare
Revision 2 (addressing review)
|
## Summary Adds an optional `onChainTransaction` (`transactionHash` + `network`) to `BaseTransactionSource` and `BaseTransactionDestination`, so every source/destination variant surfaces the on-chain transfer for a leg whose counterparty is an external crypto wallet. - `network` is environment-qualified (`SOLANA_MAINNET` vs `SOLANA_DEVNET`, etc.) so the hash can be looked up on the correct explorer. - Co-located with the leg it describes — the same place `RealtimeFundingTransactionSource` already carries `traceNumber`/`endToEndId` (the bank-rail analog). A bridge flow (crypto in on one chain → crypto out on another) populates both legs, each with its own hash/network. - Sharpens `ReconciliationInstructions` docs to distinguish its **settlement-layer** `transactionHash` (for UMA sends, the inter-VASP leg) from the new per-leg field. No deprecation. Additive change — no `info.version` bump. ## Context Grid should return on-chain transaction info for any transaction whose source or destination is an external crypto wallet, covering Fireblocks-settled and sandbox flows in both directions. This is the public-spec half; the sparkcore backend wiring + vendored SDK regen land in a separate webdev PR. Slack thread: https://lightsparkgroup.slack.com/archives/D0AHLSKKV8R/p1783721701181659 Reply with a comment (e.g. LGTM) to approve — emoji reactions don't notify me here. --- 🤖 [ionized-nexus](https://zeus.dev.dev.sparkinfra.net/#/arc?id=ionized-nexus)[(#1)](https://zeus.dev.dev.sparkinfra.net/#/instance?id=ionized-nexus) | [Feedback](https://zeus.dev.dev.sparkinfra.net/feedback) Original PR: #680 --------- Co-authored-by: Jeremy <jeremy@lightspark.com>

Summary
Adds an optional
onChainTransaction(transactionHash+network) toBaseTransactionSourceandBaseTransactionDestination, so every source/destination variant surfaces the on-chain transfer for a leg whose counterparty is an external crypto wallet.networkis environment-qualified (SOLANA_MAINNETvsSOLANA_DEVNET, etc.) so the hash can be looked up on the correct explorer.RealtimeFundingTransactionSourcealready carriestraceNumber/endToEndId(the bank-rail analog). A bridge flow (crypto in on one chain → crypto out on another) populates both legs, each with its own hash/network.ReconciliationInstructionsdocs to distinguish its settlement-layertransactionHash(for UMA sends, the inter-VASP leg) from the new per-leg field. No deprecation.Additive change — no
info.versionbump.Context
Grid should return on-chain transaction info for any transaction whose source or destination is an external crypto wallet, covering Fireblocks-settled and sandbox flows in both directions. This is the public-spec half; the sparkcore backend wiring + vendored SDK regen land in a separate webdev PR.
Slack thread: https://lightsparkgroup.slack.com/archives/D0AHLSKKV8R/p1783721701181659
Reply with a comment (e.g. LGTM) to approve — emoji reactions don't notify me here.
🤖 ionized-nexus(#1) | Feedback