Skip to content

Add 200/PROCESSING to the wallet export endpoint - #854

Open
carsonp6 wants to merge 1 commit into
sp3579-wallet-operation-processingfrom
export-processing-response
Open

Add 200/PROCESSING to the wallet export endpoint#854
carsonp6 wants to merge 1 commit into
sp3579-wallet-operation-processingfrom
export-processing-response

Conversation

@carsonp6

Copy link
Copy Markdown
Contributor

POST /internal-accounts/{internalAccountId}/export is the last signed-retry endpoint left off the 200/PROCESSING contract, and the gap was not cosmetic: its wallet-provider activity is only optimistically synchronous like the rest, but the spec documented a single terminal 200, so an approval- or consensus-gated export had no documented shape — and the undocumented one it answered (202 + operationId) was a dead end, since no fetch endpoint exists, the encrypted credentials are deliberately never stored, and the challenge had already been consumed, making every re-send a 401. This widens the 200 to a new InternalAccountExportResult wrapper (anyOf: InternalAccountExportResponse | WalletOperationProcessing) — the competing-200 case, following the verify endpoint's named-wrapper pattern from #850, with the existing 202 challenge leg untouched. The prose calls out the one way export differs from the other six endpoints: because the credentials are never stored, re-sending the signed retry is the only way to receive them, so the "stop retrying and check back later" advice that holds elsewhere does not hold here, and the challenge is consumed only by the attempt that actually returns credentials.

Sequencing: companion to the webdev PR that makes the endpoint behave this way (branch grid-turnkey-export-processing, stacked on the session-refresh reconcile-finalize branch). Both sides are behind Knob.GRID_TURNKEY_ASYNC_EXPORT, default off, so this documents the contract the knob-on path will honor. Stacked on #853 (sp3579-wallet-operation-processing) — review that first. make build and make lint are green (0 errors; the 148 warnings / 515 infos are the repo-wide pre-existing baseline, unchanged by this diff).

🤖 Generated with Claude Code

POST /internal-accounts/{internalAccountId}/export (exportInternalAccount,
EXPORT_WALLET) is the last signed-retry endpoint left off the 200/PROCESSING
contract (SP-3579). Its wallet-provider activity is only optimistically
synchronous like the rest, but the spec documented a single terminal 200 — so
an approval- or consensus-gated export had no documented shape at all, and the
undocumented one it used to answer (202 + operationId) was a dead end: no fetch
endpoint exists, the encrypted credentials are deliberately never stored, and
the challenge had already been consumed, so every re-send was a 401.

The 200 widens to a new InternalAccountExportResult wrapper — anyOf:
[InternalAccountExportResponse, WalletOperationProcessing] — the competing-200
case, same shape and same anyOf-over-oneOf reasoning as the verify endpoint
(neither member shares a discriminator field with WalletOperationProcessing's
`status`, and this repo's spectral rules require a discriminator on every
oneOf). The existing 202 (SignedRequestChallenge) is untouched: that is the
sign-and-resubmit leg, a different state.

Export differs from the other six endpoints in one integrator-visible way, so
the prose says it: because the credentials are never stored server-side,
re-sending the signed retry is the only way to receive them. Grid's own
reconciliation settles the operation but has nothing to hand back, so the
"stop retrying and check back later" advice that holds for the others does not
hold here — the completion webhook tells the client when a re-send will
succeed. The challenge is consumed only by the attempt that actually returns
credentials, so a PROCESSING response leaves it usable and a delivered export
still refuses a second one.

Docs: export joins the still-processing endpoint table and the shares-its-200
callout in authentication.mdx, and the export walkthrough gets the branch in
its sequence diagram plus the pointer every other flow already has. The
bundled openapi.yaml moves WalletOperationProcessing earlier in components —
generator ordering follows first reference, and export now references it
before the auth paths do.

Sequencing: companion to the webdev export PR that makes the endpoint behave
this way (branch grid-turnkey-export-processing). Behind
Knob.GRID_TURNKEY_ASYNC_EXPORT, default off.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 21, 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 Aug 21, 2026 8:50pm
grid-wallet-demo Ignored Ignored Aug 21, 2026 8:50pm

Request Review

@github-actions

github-actions Bot commented Aug 21, 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 processing state to customers Export response

kotlin

fix(types): return CustomerExportResponse union from customers export method

openapi

fix(types): update export internal account return type to support PROCESSING response

php

feat(api): add WalletOperationProcessing response to customers export method

python

feat(api): add processing status to customers export response

ruby

feat(api): add processing status response to customers export method

typescript

feat(api): add PROCESSING status to customers export response

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 "warning" diagnostic, but this did not represent a regression.
generate ⚠️build ✅lint ❗test ✅

npm install https://pkg.stainless.com/s/grid-typescript/aea534749f8881453d9da0a057c74478bb16c64c/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 "warning" diagnostic, but this did not represent a regression.
generate ⚠️build ✅lint ✅test ✅

grid-go studio · code · diff

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

go get github.com/stainless-sdks/grid-go@4e15d7a6c97aa51c9774c1e3de567d2a9d38d0ce
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 (1 note)
💡 Java/SchemaUnionDiscriminatorMissing: Union has object variants but no discriminator.
grid-python studio · code · diff

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

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

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

grid-cli studio · code · diff

Your SDK build had at least one "warning" diagnostic, but this did not represent a regression.
generate ⚠️build ⏭️ (prev: build ❗) → lint ⏭️ (prev: 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-08-21 20:56:25 UTC

@carsonp6
carsonp6 marked this pull request as ready for review August 21, 2026 20:56
@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR expands wallet export’s successful response contract to include a PROCESSING result and documents how clients should repeat the signed retry to collect credentials.

  • Adds an InternalAccountExportResult union for terminal credentials or WalletOperationProcessing.
  • Updates generated OpenAPI bundles and Mintlify signed-retry/export guidance.
  • Introduces event-based retry advice referencing a webhook type that is not defined by the API contract.

Confidence Score: 4/5

The response-schema change appears sound, but the undefined wallet_operation.completed event must be corrected or formally added before merging so clients do not miss the export retry window.

The new API union and generated bundles are internally consistent, while the public retry instructions currently direct clients to a webhook type that the API does not define.

Files Needing Attention: openapi/paths/internal_accounts/internal_accounts_{id}_export.yaml; mintlify/snippets/global-accounts/exporting-wallet.mdx

Important Files Changed

Filename Overview
openapi/components/schemas/internal_accounts/InternalAccountExportResult.yaml Adds an anyOf wrapper matching existing competing-200 response patterns.
openapi/paths/internal_accounts/internal_accounts_{id}_export.yaml Documents and exposes the PROCESSING response correctly, but recommends an undefined completion event.
mintlify/snippets/global-accounts/authentication.mdx Adds export to the common PROCESSING guidance and explains its challenge-expiry exception.
mintlify/snippets/global-accounts/exporting-wallet.mdx Adds the PROCESSING retry loop but repeats the undefined webhook subscription advice.
openapi.yaml Generated bundle faithfully reflects the modular schema and path changes.
mintlify/openapi.yaml Generated Mintlify bundle remains synchronized with the root OpenAPI bundle.

Sequence Diagram

sequenceDiagram
  participant Client
  participant Grid
  Client->>Grid: Initial export request
  Grid-->>Client: 202 challenge
  Client->>Grid: Signed retry
  alt Wallet activity still settling
    Grid-->>Client: 200 PROCESSING
    Client->>Grid: Repeat identical signed retry
  else Activity settled
    Grid-->>Client: 200 encryptedWalletCredentials
  end
Loading

Reviews (1): Last reviewed commit: "feat: add 200/PROCESSING to the wallet e..." | Re-trigger Greptile

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants