Skip to content

feat: add Bitcoin L1 deposit-address instruction + refundAddress to quotes#736

Open
peterrojs wants to merge 1 commit into
mainfrom
07-23-grid-api-btc-l1-quote-execute-fields
Open

feat: add Bitcoin L1 deposit-address instruction + refundAddress to quotes#736
peterrojs wants to merge 1 commit into
mainfrom
07-23-grid-api-btc-l1-quote-execute-fields

Conversation

@peterrojs

@peterrojs peterrojs commented Jul 23, 2026

Copy link
Copy Markdown

Summary

Adds the public API surface for a Bitcoin L1 crypto on/off-ramp on the quote/execute flow. All changes are additive and optional (non-breaking), so no version bump.

Changes

  • New PaymentBitcoinDepositAddressInfo payment instruction — a member of the PaymentInstructions.accountOrWalletInfo oneOf with a new BITCOIN_L1 discriminator value. Carries the on-chain deposit address and an optional network (fixed to BITCOIN). The member is self-contained (its accountType is a local single-value enum), so the shared PaymentAccountType enum is left unchanged and the discriminator mapping remains the source of truth for BITCOIN_L1.
  • Optional refundAddress on RealtimeFundingQuoteSource — the caller's address to return funds to if a crypto deposit cannot be routed to complete the payment (on-ramp).
  • Optional refundAddress on AccountDestination — the address to return funds to if a crypto payout cannot be completed (off-ramp).
  • BITCOIN is already a valid cryptoNetwork for RealtimeFundingQuoteSource (currency=BTC, cryptoNetwork=BITCOIN); no change needed.

Notes

  • Unblocks the server-side Bitcoin L1 quote/execute ramp, which currently uses stopgaps for these types.
  • The Detect breaking changes (oasdiff) check flags the new oneOf member as a breaking response change and applies the breaking-change label — this is expected for any additive payment-instruction member and is gated by API-reviewer approval, per the repo's workflow design.
  • SDKs (grid-typescript, grid-kotlin) are regenerated by the Stainless GitHub Action from the bundled spec + config; no SDK code is hand-edited in this PR.

Test plan

  • npm run lint:openapi (redocly bundle + redocly lint + spectral lint): passes with 0 errors.
  • oasdiff breaking (v1.16.0, base=main): only the intended additive oneOf-member findings remain; no property removals.

Original PR: #732

Add a Bitcoin L1 on/off-ramp surface to the quote/execute flow:

- New self-contained PaymentBitcoinDepositAddressInfo member in the
  PaymentInstructions oneOf (accountType=BITCOIN_L1 discriminator value,
  on-chain address, optional network fixed to BITCOIN).
- Optional refundAddress on RealtimeFundingQuoteSource (on-ramp crypto
  funding) and AccountDestination (off-ramp crypto payout).

The member is self-contained rather than composing BasePaymentAccountInfo,
so it does not extend the shared PaymentAccountType enum; the discriminator
mapping is the source of truth for the BITCOIN_L1 value.

All additions are optional / additive, so no version bump. SDKs are
regenerated by the Stainless CI action from the bundled spec + config.

Co-Authored-By: peterrojs <[email protected]>
@ls-bolt ls-bolt Bot added bolt breaking-change Introduces a breaking change to the OpenAPI spec labels Jul 23, 2026
@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
grid-flow-builder Ignored Ignored Preview Jul 23, 2026 4:49pm
grid-wallet-demo Ignored Ignored Preview Jul 23, 2026 4:49pm

Request Review

@peterrojs
peterrojs marked this pull request as ready for review July 23, 2026 16:39
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Breaking OpenAPI changes detected

This PR introduces breaking changes to openapi.yaml:

API Changelog 2025-10-13 vs. 2025-10-13

API Changes

GET /agents/approvals

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the data/items/quote/allOf[#/components/schemas/Quote]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200
  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the data/items/transaction/allOf[#/components/schemas/TransactionOneOf]/oneOf[subschema #2: Outgoing Transaction]/allOf[subschema #2]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

GET /agents/me/actions

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the data/items/quote/allOf[#/components/schemas/Quote]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200
  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the data/items/transaction/allOf[#/components/schemas/TransactionOneOf]/oneOf[subschema #2: Outgoing Transaction]/allOf[subschema #2]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

GET /agents/me/actions/{actionId}

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the quote/allOf[#/components/schemas/Quote]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200
  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the transaction/allOf[#/components/schemas/TransactionOneOf]/oneOf[subschema #2: Outgoing Transaction]/allOf[subschema #2]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

GET /agents/me/internal-accounts

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the data/items/fundingPaymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

POST /agents/me/quotes

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 201

GET /agents/me/quotes/{quoteId}

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

POST /agents/me/quotes/{quoteId}/execute

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the quote/allOf[#/components/schemas/Quote]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200
  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the transaction/allOf[#/components/schemas/TransactionOneOf]/oneOf[subschema #2: Outgoing Transaction]/allOf[subschema #2]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

GET /agents/me/transactions

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the data/items/oneOf[subschema #2: Outgoing Transaction]/allOf[subschema #2]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

GET /agents/me/transactions/{transactionId}

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the oneOf[subschema #2: Outgoing Transaction]/allOf[subschema #2]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

POST /agents/me/transfer-in

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the quote/allOf[#/components/schemas/Quote]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 201
  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the transaction/allOf[#/components/schemas/TransactionOneOf]/oneOf[subschema #2: Outgoing Transaction]/allOf[subschema #2]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 201

POST /agents/me/transfer-out

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the quote/allOf[#/components/schemas/Quote]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 201
  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the transaction/allOf[#/components/schemas/TransactionOneOf]/oneOf[subschema #2: Outgoing Transaction]/allOf[subschema #2]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 201

POST /agents/{agentId}/actions/{actionId}/approve

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the quote/allOf[#/components/schemas/Quote]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200
  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the transaction/allOf[#/components/schemas/TransactionOneOf]/oneOf[subschema #2: Outgoing Transaction]/allOf[subschema #2]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

POST /agents/{agentId}/actions/{actionId}/reject

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the quote/allOf[#/components/schemas/Quote]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200
  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the transaction/allOf[#/components/schemas/TransactionOneOf]/oneOf[subschema #2: Outgoing Transaction]/allOf[subschema #2]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

GET /config

  • ⚠️ removed the optional property cardTokenization2faConfig from the response with the 200 status

PATCH /config

  • ⚠️ removed the request property cardTokenization2faConfig
  • ⚠️ removed the optional property cardTokenization2faConfig from the response with the 200 status

GET /customers/internal-accounts

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the data/items/fundingPaymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

PATCH /internal-accounts/{id}

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the fundingPaymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

GET /platform/internal-accounts

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the data/items/fundingPaymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

POST /quotes

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 201
  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 202

GET /quotes/{quoteId}

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

POST /quotes/{quoteId}/authorize

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

POST /quotes/{quoteId}/execute

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

POST /sandbox/internal-accounts/{accountId}/fund

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the fundingPaymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

POST /sandbox/send

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the oneOf[subschema #2: Outgoing Transaction]/allOf[subschema #2]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

GET /transactions

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the data/items/oneOf[subschema #2: Outgoing Transaction]/allOf[subschema #2]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

GET /transactions/{transactionId}

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the oneOf[subschema #2: Outgoing Transaction]/allOf[subschema #2]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

POST /transactions/{transactionId}/cancel

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the oneOf[subschema #2: Outgoing Transaction]/allOf[subschema #2]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

POST /transactions/{transactionId}/confirm

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the oneOf[subschema #2: Outgoing Transaction]/allOf[subschema #2]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 200

POST /transfer-in

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the oneOf[subschema #2: Outgoing Transaction]/allOf[subschema #2]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 201

POST /transfer-out

  • ⚠️ added #/components/schemas/PaymentBitcoinDepositAddressInfo to the oneOf[subschema #2: Outgoing Transaction]/allOf[subschema #2]/paymentInstructions/items/accountOrWalletInfo response property oneOf list for the response status 201

POST webhook:agent-action

  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_PENDING of the request property allOf[#/components/schemas/BaseWebhook]/type

POST webhook:bulk-upload

  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_PENDING of the request property allOf[#/components/schemas/BaseWebhook]/type

POST webhook:card-funding-source-change

  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_PENDING of the request property allOf[#/components/schemas/BaseWebhook]/type

POST webhook:card-state-change

  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_PENDING of the request property allOf[#/components/schemas/BaseWebhook]/type

POST webhook:card-transaction

  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_PENDING of the request property allOf[#/components/schemas/BaseWebhook]/type

POST webhook:customer-update

  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_PENDING of the request property allOf[#/components/schemas/BaseWebhook]/type

POST webhook:incoming-payment

  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_COMPLETED of the request property allOf[subschema #2]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_FAILED of the request property allOf[subschema #2]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_PENDING of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_PENDING of the request property allOf[subschema #2]/type

POST webhook:internal-account-status

  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_PENDING of the request property allOf[#/components/schemas/BaseWebhook]/type

POST webhook:invitation-claimed

  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_PENDING of the request property allOf[#/components/schemas/BaseWebhook]/type

POST webhook:outgoing-payment

  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_PENDING of the request property allOf[#/components/schemas/BaseWebhook]/type

POST webhook:test-webhook

  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_PENDING of the request property allOf[#/components/schemas/BaseWebhook]/type

POST webhook:verification-update

  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_COMPLETED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_FAILED of the request property allOf[#/components/schemas/BaseWebhook]/type
  • ⚠️ removed the enum value INCOMING_PAYMENT.REFUND_PENDING of the request property allOf[#/components/schemas/BaseWebhook]/type

Detected by oasdiff. This PR will need approval from an API reviewer before merge.

akanter commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

✱ Stainless preview builds for grid

This PR will update the grid SDKs with the following commit messages.

cli

chore(internal): regenerate SDK with no functional changes

go

feat(api): add Bitcoin L1 variant to payment instructions

kotlin

feat(api): add BitcoinL1 variant to PaymentInstructions AccountOrWalletInfo

openapi

feat(api): add Bitcoin deposit address info, refundAddress to quote source/destination

php

feat(api): add BitcoinL1DepositAddress variant to payment instructions

python

feat(api): add Bitcoin L1 deposit address to payment instructions

ruby

feat(api): add BitcoinL1 variant to PaymentInstructions AccountOrWalletInfo

typescript

feat(api): add BITCOIN_L1 payment instruction type to quotes

Edit this comment to update them. They will appear in their respective SDK's changelogs.

grid-typescript studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ✅lint ❗test ✅

npm install https://pkg.stainless.com/s/grid-typescript/29563106da1eade2e690a7e7bcf5a1c64e2adbf5/dist.tar.gz
grid-openapi studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️

grid-ruby studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ✅lint ✅test ✅

grid-go studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ✅build ✅lint ❗test ❗

go get github.com/stainless-sdks/grid-go@a5377124f2de4c782d41a7b5fbee10c1fd77860f
New diagnostics (3 note)
💡 Schema/EnumHasOneMember: Confirm intentional use of `enum` with single member.
💡 Schema/EnumHasOneMember: Confirm intentional use of `enum` with single member.
💡 Schema/EnumHasOneMember: Confirm intentional use of `enum` with single member.
grid-kotlin studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ⚠️build ✅lint ✅test ❗

New diagnostics (2 note)
💡 Schema/EnumHasOneMember: Confirm intentional use of `enum` with single member.
💡 Schema/EnumHasOneMember: Confirm intentional use of `enum` with single member.
grid-python studio · code · diff

Your SDK build had at least one "note" diagnostic, but this did not represent a regression.
generate ✅build ✅lint ❗test ❗

pip install https://pkg.stainless.com/s/grid-python/90c86dd35d76cd92aa0f73ae01b7f09ea380def1/grid-0.0.1-py3-none-any.whl
grid-php studio · code · diff

Your SDK build had at least one new note diagnostic, which is a regression from the base state.
generate ✅lint ✅test ✅

New diagnostics (2 note)
💡 Schema/EnumHasOneMember: Confirm intentional use of `enum` with single member.
💡 Schema/EnumHasOneMember: Confirm intentional use of `enum` with single member.
grid-cli studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️build ❗lint ❗test ❗


This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-07-23 16:57:50 UTC

@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds the public API types for Bitcoin L1 quote and execution flows. The main changes are:

  • A Bitcoin L1 deposit-address payment instruction.
  • A BITCOIN_L1 payment-instruction discriminator mapping.
  • Optional refund addresses for crypto funding sources and account destinations.
  • Updated generated OpenAPI bundles for the API reference.

Confidence Score: 5/5

The API additions look mergeable after aligning the Bitcoin discriminator with the shared account-type contract.

  • The source schemas and generated bundles are consistent.
  • The refund-address fields are additive and optional.
  • Some generated clients may not represent BITCOIN_L1 while it remains absent from the shared account-type enum.

openapi/components/schemas/common/PaymentBitcoinDepositAddressInfo.yaml and the shared PaymentAccountType schema

Important Files Changed

Filename Overview
openapi/components/schemas/common/PaymentBitcoinDepositAddressInfo.yaml Adds the Bitcoin L1 instruction but defines its discriminator outside the shared payment account-type enum.
openapi/components/schemas/common/PaymentInstructions.yaml Adds the Bitcoin L1 schema to the instruction union and discriminator mapping.
openapi/components/schemas/quotes/RealtimeFundingQuoteSource.yaml Adds an optional refund address for on-chain real-time funding.
openapi/components/schemas/quotes/AccountDestination.yaml Adds an optional refund address for crypto payout destinations.
openapi.yaml Updates the generated root bundle with the new public schema fields.
mintlify/openapi.yaml Updates the Mintlify bundle to match the source OpenAPI changes.
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
openapi/components/schemas/common/PaymentBitcoinDepositAddressInfo.yaml:7-12
**Discriminator Bypasses Shared Enum**

This defines `BITCOIN_L1` only in a local enum while the shared `PaymentAccountType` used by the other payment-info models does not include it. SDK generators or consumers that expose `accountType` through that shared enum cannot represent a valid Bitcoin L1 instruction, causing compile-time rejection or failed response deserialization.

Reviews (1): Last reviewed commit: "feat(quotes): add Bitcoin L1 deposit-add..." | Re-trigger Greptile

@ls-bolt

ls-bolt Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Revision — align Bitcoin L1 with the shared account-type contract

Addressed Greptile's inline finding (Discriminator Bypasses Shared Enum) in 847f94c0:

  • Added BITCOIN_L1 to the shared PaymentAccountType enum.
  • Refactored PaymentBitcoinDepositAddressInfo to allOf: [BasePaymentAccountInfo, { narrow accountType → BITCOIN_L1, address, network }] — the same pattern every other accountOrWalletInfo member follows. It was previously the sole member defining a standalone local accountType with a value absent from the shared enum.
  • Regenerated the OpenAPI bundles (openapi.yaml, mintlify/openapi.yaml) via make build; make lint-openapi passes (0 errors).

Net effect: generated SDK clients that surface accountType via the shared enum can now represent a Bitcoin L1 instruction. PaymentAccountType is referenced only through BasePaymentAccountInfo, so the new value is scoped to payment-instruction members only.


🤖 resonant-reactor(#1) | Feedback

@ls-bolt

ls-bolt Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Correction — reverted the Greptile "shared enum" change

My previous revision comment is superseded. I applied Greptile's Discriminator Bypasses Shared Enum suggestion in 847f94c0, but it broke the Detect breaking changes check, so I reverted it. The branch is back at 699ff8c6 (the state you published), which is green.

Why it broke: moving BITCOIN_L1 into the shared PaymentAccountType enum makes oasdiff flag a new enum value on every account subschema inheriting BasePaymentAccountInfo (~50 × 2 response paths). The 100+-finding breaking-changes comment then overflowed the OS arg limit in the sticky-comment step (Argument list too long).

Why the original design is right: accountOrWalletInfo is a discriminated oneOf, so each variant carries its own accountType literal — SDK generators represent BITCOIN_L1 from the member's own enum without it being in the shared type. Adding it to the shared enum would also falsely imply a USD/EUR/etc. account could return accountType: BITCOIN_L1. The self-contained local enum is the more precise contract and keeps the breaking-diff minimal.

Full reasoning is in the inline thread. No code change vs. what you published — CI should return to green.


🤖 resonant-reactor(#1) | Feedback

@@ -0,0 +1,21 @@
title: Bitcoin L1 Deposit Address

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.

Should this be using BasePaymentAccountInfo.yaml ?

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.

You're right on consistency grounds — every cousin model does allOf: [BasePaymentAccountInfo, { narrow accountType to its discriminator value }], and this is the only member that rolls its own standalone accountType. I actually made exactly this change earlier (commit 847f94c: inherit BasePaymentAccountInfo + add BITCOIN_L1 to the shared PaymentAccountType enum), but reverted it because it broke the Detect breaking changes job — and I want to flag that trade-off before redoing it, because the two are inseparable.

Why they're coupled: inheriting BasePaymentAccountInfo pins accountType to the shared PaymentAccountType enum, so narrowing to BITCOIN_L1 is only valid if BITCOIN_L1 is in that shared enum (otherwise the allOf intersection is empty). So "use BasePaymentAccountInfo" necessarily means "add BITCOIN_L1 to PaymentAccountType."

Why it broke CI: adding the value to the shared enum makes oasdiff report a new enum value on the accountType of every cousin that inherits the base (~50 currencies × the quote + transaction response paths = 100+ findings). The breaking detection is fine — that step runs --fail-on ERR and these are all WARN — but the downstream marocchino/sticky-pull-request-comment step then fails with Argument list too long trying to post that 100+-line body. The standalone enum keeps it to the single "added oneOf member" finding, so the job stays green.

I can't fix that workflow myself (the bot lacks the GitHub Actions workflows permission).

So it's a real trade-off:

  • Your approach (inherit base + shared enum): matches the cousin convention, but the Detect breaking changes check goes red on the comment step until the workflow is made large-body-safe (or that check is overridden/not required for merge).
  • Standalone enum (current): the lone structural deviation, but CI stays green — and it's arguably a tighter contract, since a discriminated oneOf variant carries its own accountType literal (generators key off the discriminator), and it avoids implying a USD/EUR/etc. account could ever return accountType: BITCOIN_L1.

Happy to push the BasePaymentAccountInfo version if you'd prefer consistency and are OK with that check being red pending a workflow fix — just say the word and I'll redo it. Which way do you want to go?


🤖 resonant-reactor(#2) | Feedback

Comment on lines +7 to +12
accountType:
type: string
description: Type of payment account or wallet
enum:
- BITCOIN_L1
example: BITCOIN_L1

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.

I think we don't need this if we're using PaymentAccountType.yaml? and I think we should be doing that based on my read of the cousin models

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.

Same underlying decision as the thread above — full context there. Short version: dropping this local accountType enum in favor of the shared PaymentAccountType requires adding BITCOIN_L1 to that shared enum, which is what turns the Detect breaking changes job red (100+ oasdiff findings overflow the sticky-comment step with Argument list too long). It's a consistency-vs-green-CI trade-off; let me know which you'd like and I'll push it.


🤖 resonant-reactor(#2) | Feedback

@ls-bolt

ls-bolt Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

📌 Bolt Status

2026-07-24 20:29:53 UTC — ⚡ Agent resonant-reactor-2(#2) started


Feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bolt breaking-change Introduces a breaking change to the OpenAPI spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants