Skip to content

fix(docs): correct SDK 0.9.0 code examples + clarify demo/production mode (audit 1/4) - #107

Merged
rz1989s merged 2 commits into
mainfrom
fix/docs-sdk-0.9-code-examples
Jun 6, 2026
Merged

fix(docs): correct SDK 0.9.0 code examples + clarify demo/production mode (audit 1/4)#107
rz1989s merged 2 commits into
mainfrom
fix/docs-sdk-0.9-code-examples

Conversation

@rz1989s

@rz1989s rz1989s commented Jun 6, 2026

Copy link
Copy Markdown
Member

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/sdk 0.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):

  • Viewing keyscreateViewingKey()/decryptWithViewingKey() don't exist → generateViewingKey(path) returning { key, path, hash }, encryptForViewing(data, ViewingKey), decryptWithViewing()
  • StealthderiveStealthPrivateKey 4→3 args; generateStealthMetaAddress(chain, label?) (no { curve } option); nested return .metaAddress.spendingKey; scanForStealthPayments (nonexistent) → getTransactionHistory (NEAR) / checkStealthAddress announcement loop (EVM)
  • NEAR IntentsOneClickClient.getQuotequote(); removed fabricated executeSwap; config endpoint/apiKey/networkbaseUrl/jwtToken/client
  • ZcashgetShieldedBalance/listShieldedTransactions → real ZcashShieldedService/RPC methods; ZcashRPCConfigZcashConfig
  • Intents/buildercreateShieldedIntent structured { input, output, privacy }; getQuotes(intent) (not intent.intent); .withProvider()/.recipient() (not .proofsProvider()/.viewingKey()/.recipientAddress())
  • ErrorsErrorCode.NETWORK_FAILED (not NETWORK_ERROR); error.context (not error.details)
  • Proofs — real Funding/Validity/Fulfillment param + OracleAttestation shapes; verifyProof(proof) 1-arg; NoirProofProvider subpath import @sip-protocol/sdk/proofs/noir
  • Specseip-5564 checkStealthAddress; wallet-adapter signMessage → Signature; sip-spec error-code table
  • 3 literal syntax errors in cookbook (space-in-identifier)

#1073 — demo vs production: the SDK defaults to mode: 'demo', so getQuotes() returns mock quotes. Added :::danger/:::note callouts + production-mode snippets to near-intents, getting-started, faq, glossary.

Verification

  • astro build green — 1277 pages built, Pagefind index + sitemap OK.
  • Every corrected API re-verified against packages/sdk/src by the fix agents; the highest-risk reframes (the scanForStealthPayments rewrites + the #1073 near-intents rewrite) were hand-reviewed.

Out of scope (follow-up PRs in this series)

  • PR2 — version/changelog/roadmap/known-limitations staleness (changelog still at 0.6.0; known-limitations falsely claims "proofs are mock / testnet-only")
  • PR3 — security-crypto accuracy (stealth scheme written backwards in crypto-assumptions/audit-checklist; UltraPlonk→UltraHonk) + design-doc banners + proof constraint counts
  • PR4 — sipher SENTINEL doc consistency → closes Monthly Docs Audit - June 2026 #96

Refs #96, #1073

…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.
@vercel

vercel Bot commented Jun 6, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
sip-docs Ready Ready Preview, Comment Jun 6, 2026 1:56am

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.
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.

Monthly Docs Audit - June 2026

1 participant