fix(docs): correct SDK 0.9.0 code examples + clarify demo/production mode (audit 1/4) - #107
Merged
Merged
Conversation
…mode June 2026 docs audit, part 1/4 (#96). Fixes code examples and API references that drifted from @sip-protocol/sdk 0.9.0, and makes the demo-vs-production mode distinction explicit (delivers the near-intents clarification from #1073). All fixes verified against packages/sdk/src. Key corrections: - Viewing keys: createViewingKey/decryptWithViewingKey -> generateViewingKey(path) + encryptForViewing(ViewingKey) + decryptWithViewing - Stealth: deriveStealthPrivateKey 4->3 args; generateStealthMetaAddress(chain,label?); nested meta-address (.metaAddress.spendingKey); scanForStealthPayments -> getTransactionHistory (NEAR) / checkStealthAddress loop (EVM) - NEAR Intents: OneClickClient.getQuote -> quote(); drop nonexistent executeSwap; config endpoint/apiKey/network -> baseUrl/jwtToken/client - Zcash: getShieldedBalance/listShieldedTransactions -> real RPC/ShieldedService API; ZcashRPCConfig -> ZcashConfig - Intents: createShieldedIntent structured params; getQuotes(intent); builder withProvider/recipient (not proofsProvider/viewingKey/recipientAddress) - Errors: ErrorCode.NETWORK_FAILED (not NETWORK_ERROR); error.context (not details) - Proofs: real Funding/Validity/Fulfillment + OracleAttestation shapes; verifyProof 1-arg; NoirProofProvider subpath import - Specs: eip-5564 checkStealthAddress; wallet-adapter signMessage -> Signature; sip-spec error-code table - 3 space-in-identifier syntax errors in cookbook #1073: demo is the SDK default (mock quotes) -> added production-mode callouts to near-intents, getting-started, faq, glossary. astro build green (1277 pages). Out of scope (later PRs): version/changelog staleness, security-crypto prose, design banners, proof constraint counts, sentinel.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
npm 11 drops optional/peer dependency nodes that npm 10 (CI) requires, so `npm ci` failed with "Missing: utf-8-validate@5.0.10 from lock file" on every docs-sip PR. Regenerated via `npx npm@10 install` (package.json unchanged). Unblocks the Docs Validation check for this and the remaining docs-audit PRs.
This was referenced Jun 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part 1 of 4 of the comprehensive June 2026 documentation audit (#96). A parallel audit of all 59 hand-written pages against the live
@sip-protocol/sdk0.9.0 source surfaced substantial drift; this PR fixes the user-facing breakage — code examples referencing removed/renamed/nonexistent APIs — and makes the demo-vs-production mode distinction explicit (the clarification promised in #1073).What's fixed (30 files)
Broken / wrong-signature APIs (all re-verified against
packages/sdk/src):createViewingKey()/decryptWithViewingKey()don't exist →generateViewingKey(path)returning{ key, path, hash },encryptForViewing(data, ViewingKey),decryptWithViewing()deriveStealthPrivateKey4→3 args;generateStealthMetaAddress(chain, label?)(no{ curve }option); nested return.metaAddress.spendingKey;scanForStealthPayments(nonexistent) →getTransactionHistory(NEAR) /checkStealthAddressannouncement loop (EVM)OneClickClient.getQuote→quote(); removed fabricatedexecuteSwap; configendpoint/apiKey/network→baseUrl/jwtToken/clientgetShieldedBalance/listShieldedTransactions→ realZcashShieldedService/RPC methods;ZcashRPCConfig→ZcashConfigcreateShieldedIntentstructured{ input, output, privacy };getQuotes(intent)(notintent.intent);.withProvider()/.recipient()(not.proofsProvider()/.viewingKey()/.recipientAddress())ErrorCode.NETWORK_FAILED(notNETWORK_ERROR);error.context(noterror.details)Funding/Validity/Fulfillmentparam +OracleAttestationshapes;verifyProof(proof)1-arg;NoirProofProvidersubpath import@sip-protocol/sdk/proofs/noireip-5564checkStealthAddress;wallet-adaptersignMessage → Signature;sip-specerror-code table#1073 — demo vs production: the SDK defaults to
mode: 'demo', sogetQuotes()returns mock quotes. Added:::danger/:::notecallouts + production-mode snippets to near-intents, getting-started, faq, glossary.Verification
astro buildgreen — 1277 pages built, Pagefind index + sitemap OK.packages/sdk/srcby the fix agents; the highest-risk reframes (thescanForStealthPaymentsrewrites + the #1073 near-intents rewrite) were hand-reviewed.Out of scope (follow-up PRs in this series)
known-limitationsfalsely claims "proofs are mock / testnet-only")Refs #96, #1073