Skip to content

docs(CPL-279): document ChainSecured HTTP endpoints, drop orphan api_direct#321

Merged
GTC6244 merged 2 commits intonextfrom
feature/cpl-279-update-api-documents
Apr 28, 2026
Merged

docs(CPL-279): document ChainSecured HTTP endpoints, drop orphan api_direct#321
GTC6244 merged 2 commits intonextfrom
feature/cpl-279-update-api-documents

Conversation

@GTC6244
Copy link
Copy Markdown
Contributor

@GTC6244 GTC6244 commented Apr 28, 2026

Summary

Audit of every Rocket route in lit-api-server/src/, every public method in lit-static/core_sdk.js, and the published API docs surfaced two HTTP endpoints with no formal reference docs and one orphaned doc file. CPL-279 asked for a scan; this is the resulting cleanup.

Documents two ChainSecured HTTP endpoints in docs/management/api_direct.mdx:

  • POST /create_wallet_with_signature — SIWE-signed PKP minting via DStack MPC. Request/response shapes, the Address/Chain ID/Issued At message format, the ±5-min replay window, the follow-up on-chain registerWalletDerivation step, and a curl example.
  • POST /convert_to_chain_secured_account — Flips a managed account to unmanaged, preserving apiKeyHash (and therefore groups, PKPs, action metadata, usage keys, Stripe balance). Request shape and curl example. Cross-links to account_modes.mdx for the dashboard flow, SDK wrapper, and post-conversion verification checklist.

Cross-links rather than duplicates sovereign-mode SDK content already covered by the new docs/management/account_modes.mdx (merged from next during this branch). The four sovereign SDK methods (newChainSecuredAccount, accountExistsByHash, connectSigner, the mode: 'sovereign' constructor) live there; api_direct.mdx now points at it for context instead of restating it.

Deletes orphan docs/api_direct.mdx — slim duplicate not referenced in docs.json nav, no inbound links from any other doc, drifted from docs/management/api_direct.mdx. Net change: -403 / +63.

Audit findings (per CPL-279)

Cross-referenced 33 endpoints under /core/v1/, 35 SDK methods on LitNodeSimpleApiClient, and the docs. Already-documented endpoints/methods omitted from this PR:

Category Items
Now documented (this PR) create_wallet_with_signature, convert_to_chain_secured_account
Already documented in account_modes.mdx newChainSecuredAccount, accountExistsByHash, connectSigner, sovereign-mode SDK constructor
Out of scope (utility/internal — not customer-facing) /health, /attestation, /info, /dstack/v1/*, /version, /get_lit_action_client_config, /get_chain_config_keys, /openapi.json
SDK-only, no HTTP equivalent (intentional) checkAbiDrift (local pinned-bytecode integrity check)

Pre-Landing Review

Docs-only diff. No code paths, no SQL, no LLM trust boundaries. Internal links verified (/management/account_modes and the #converting-an-api-account-to-chainsecured anchor both exist post-merge). Request/response JSON shapes match the Rust structs (CreateWalletWithSignatureRequest, ConvertToChainSecuredAccountRequest) verbatim.

Test plan

  • Mintlify renders docs/management/api_direct.mdx without broken links to /management/account_modes or its #converting-an-api-account-to-chainsecured anchor.
  • docs/api_direct.mdx removal does not 404 anywhere — confirmed via grep that no .mdx, .html, or docs.json references the path.
  • curl examples copy-paste cleanly (escaped newlines render as \n in the JSON body).

🤖 Generated with Claude Code

…direct

Adds reference entries for `POST /create_wallet_with_signature` and
`POST /convert_to_chain_secured_account` in docs/management/api_direct.mdx
— the two HTTP endpoints backing ChainSecured mode that had no formal
documentation. Both include request/response shapes and curl examples.
Cross-links to the new account_modes.mdx for the SDK-side workflow so
the same content isn't documented twice.

Deletes the orphaned docs/api_direct.mdx (not in docs.json nav, no
inbound links, drifted from the management/ canonical version).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Docs cleanup and coverage expansion for ChainSecured (sovereign) flows by documenting previously-undocumented HTTP endpoints and removing an orphaned duplicate doc page.

Changes:

  • Add reference docs for POST /create_wallet_with_signature and POST /convert_to_chain_secured_account to docs/management/api_direct.mdx.
  • Cross-link to /management/account_modes for the full ChainSecured SDK workflow (avoid duplicating sovereign-mode SDK docs).
  • Delete the unreferenced/orphaned docs/api_direct.mdx page.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
docs/management/api_direct.mdx Adds documentation for the two ChainSecured-mode HTTP endpoints and links to account mode docs for the broader flow.
docs/api_direct.mdx Removes an orphaned duplicate API reference page.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/management/api_direct.mdx Outdated
Comment thread docs/management/api_direct.mdx Outdated
Stripe credit balance does NOT automatically carry over when an account
is converted to ChainSecured. The balance lookup chains through
get_account_wallet_address(apiKeyHash) which returns the *current*
on-chain admin wallet, so post-conversion the same API key resolves to
a different (empty) Stripe customer. Caught by Copilot review.

Also widens the auth-header phrasing to mention both X-Api-Key and
Authorization: Bearer for consistency with the doc's preamble.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@GTC6244 GTC6244 merged commit 88b59b3 into next Apr 28, 2026
14 checks passed
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