docs: document real sandbox wallet signatures#494
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Greptile SummaryThis docs-only PR upgrades the sandbox wallet signature documentation to reflect that sandbox now validates real P-256 Turnkey API-key stamps (not just the fixed
Confidence Score: 4/5Safe to merge — changes are prose and code-example only, with no executable logic touched. The two files are documentation only. The README change is clean and self-contained ( mintlify/snippets/sandbox-global-account-magic.mdx — the new code example references an unexplained
|
| Filename | Overview |
|---|---|
| mintlify/snippets/sandbox-global-account-magic.mdx | Replaces fixed sandbox-valid-signature sentinel with real Turnkey API-key stamp flow; $SIGN helper is used in the code example without being defined in this file's context |
| scripts/README.md | Sandbox tip updated to reflect real stamp acceptance; $SIGN is properly defined at line 30 of this file so the context is self-contained |
Sequence Diagram
sequenceDiagram
participant Client
participant Grid API
participant Turnkey Signer
Client->>Grid API: POST /auth/credentials/{id}/verify (with clientPublicKey)
Grid API-->>Client: encryptedSessionSigningKey (sealed to clientPublicKey)
Client->>Client: Decrypt encryptedSessionSigningKey with matching private key → SESSION_PRIV_HEX
Client->>Grid API: Request signed action (e.g. POST /quotes/{id}/execute)
Grid API-->>Client: payloadToSign
Client->>Turnkey Signer: stamp(SESSION_PRIV_HEX, payloadToSign)
Turnkey Signer-->>Client: P-256 Turnkey API-key STAMP
Client->>Grid API: Repeat request + Grid-Wallet-Signature: STAMP
Grid API->>Grid API: Validate stamp is P-256 over pending Turnkey payload and public key belongs to active sandbox session
Grid API-->>Client: 200 OK
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
mintlify/snippets/sandbox-global-account-magic.mdx:136
**Undefined `$SIGN` reference in standalone snippet**
The code example uses `$SIGN stamp "$SESSION_PRIV_HEX" "$PAYLOAD_TO_SIGN"`, but `$SIGN` is never defined within this MDX file. In `scripts/README.md` it is set at line 30 (`SIGN="node $(pwd)/scripts/embedded-wallet-sign.js"`), so the README context is self-contained. However, this snippet is embedded in API documentation pages where a reader has no pointer to that helper script. Per the style guide, code examples should be "complete, runnable examples that users can copy and execute." A reader unfamiliar with the scripts directory will have no idea what tool to substitute for `$SIGN`.
Reviews (1): Last reviewed commit: "docs: document real sandbox wallet signa..." | Re-trigger Greptile
| - `POST /quotes/{quoteId}/execute` (when source is an embedded wallet) | ||
|
|
||
| ```bash | ||
| STAMP=$($SIGN stamp "$SESSION_PRIV_HEX" "$PAYLOAD_TO_SIGN") |
There was a problem hiding this comment.
Undefined
$SIGN reference in standalone snippet
The code example uses $SIGN stamp "$SESSION_PRIV_HEX" "$PAYLOAD_TO_SIGN", but $SIGN is never defined within this MDX file. In scripts/README.md it is set at line 30 (SIGN="node $(pwd)/scripts/embedded-wallet-sign.js"), so the README context is self-contained. However, this snippet is embedded in API documentation pages where a reader has no pointer to that helper script. Per the style guide, code examples should be "complete, runnable examples that users can copy and execute." A reader unfamiliar with the scripts directory will have no idea what tool to substitute for $SIGN.
Prompt To Fix With AI
This is a comment left during a code review.
Path: mintlify/snippets/sandbox-global-account-magic.mdx
Line: 136
Comment:
**Undefined `$SIGN` reference in standalone snippet**
The code example uses `$SIGN stamp "$SESSION_PRIV_HEX" "$PAYLOAD_TO_SIGN"`, but `$SIGN` is never defined within this MDX file. In `scripts/README.md` it is set at line 30 (`SIGN="node $(pwd)/scripts/embedded-wallet-sign.js"`), so the README context is self-contained. However, this snippet is embedded in API documentation pages where a reader has no pointer to that helper script. Per the style guide, code examples should be "complete, runnable examples that users can copy and execute." A reader unfamiliar with the scripts directory will have no idea what tool to substitute for `$SIGN`.
How can I resolve this? If you propose a fix, please make it concise.304ae01 to
e7362df
Compare
9506f09 to
9731c1e
Compare
9731c1e to
e65e316
Compare
e7362df to
66b4fb4
Compare

Summary
payloadToSign.sandbox-valid-signaturecompatibility path documented.Backend Pairing
Grid-Wallet-Signaturevalidation.Testing
npm run build:openapiandnpm run lint:openapi.