-
Notifications
You must be signed in to change notification settings - Fork 44
docs(sdk): updates missing from 2711 #2713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe documentation for identity-related state transitions in the WASM SDK was updated. Parameter lists and example usages for transitions like Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
The following output files are updated when running generate_docs.py after #2711 was merged
5779518
to
07e1595
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
packages/wasm-sdk/AI_REFERENCE.md (2)
750-757
: identityTopUp parameter list & example disagreeThe list introduces an explicit
identityId
, yet the example passes onlyidentityHex
(plus the generic auth tuple). Align these two; otherwise integrators will not know which identifier the function consumes. A quick fix is to keep only one canonical identifier name across both docs and code snippets.
764-765
: Enumerated values changed to free-form strings—document allowed setYou switched
keyType
andpurpose
from numeric/enum to string literals ("ECDSA_HASH160"
,"AUTHENTICATION"
). Please list every accepted value (or link to the enum) so users don’t guess and trigger runtime validation errors.packages/wasm-sdk/docs.html (1)
2375-2377
: Example snippets still use the old placeholder signatureBoth example blocks keep the generic
identityCreate(identityHex, /* params */, privateKeyHex)
/identityTopUp(identityHex, /* params */, …)
form, which no longer matches the new human-readable parameter list (seed phrase, index, etc.). Consider updating the examples so readers can copy-paste working code.-const result = await sdk.identityCreate(identityHex, /* params */, privateKeyHex); +const result = await sdk.identityCreate(seedPhrase, identityIndex, keySelectionMode, keysToAdd /*, ... */);Also applies to: 2393-2395
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/wasm-sdk/AI_REFERENCE.md
(1 hunks)packages/wasm-sdk/docs.html
(2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/generate_docs.py : Keep documentation for the WASM SDK in sync by running 'python3 generate_docs.py' in 'packages/wasm-sdk'
Learnt from: QuantumExplorer
PR: dashpay/platform#2711
File: packages/wasm-sdk/AI_REFERENCE.md:771-783
Timestamp: 2025-07-28T20:00:08.502Z
Learning: In packages/wasm-sdk/AI_REFERENCE.md, the documentation correctly shows the actual SDK method signatures (including identityCreate and identityTopUp with their full parameter lists), which may differ from the UI inputs shown in fixed_definitions.json. The UI may collect fewer parameters from users while handling additional requirements internally.
Learnt from: QuantumExplorer
PR: dashpay/platform#2711
File: packages/wasm-sdk/docs.html:2359-2383
Timestamp: 2025-07-28T20:00:24.323Z
Learning: In packages/wasm-sdk/docs.html, QuantumExplorer confirmed that placeholder private keys in documentation examples are acceptable as they are not real keys, though field name accuracy for the SDK API should still be maintained.
Learnt from: shumkov
PR: dashpay/platform#2201
File: packages/rs-platform-version/src/version/v2.rs:1186-1188
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In the `IdentityTransitionVersions` structure within `packages/rs-platform-version/src/version/v2.rs`, the field `credit_withdrawal` does not need the `identity_` prefix since it is already encompassed within identity state transitions.
Learnt from: shumkov
PR: dashpay/platform#2201
File: packages/rs-platform-version/src/version/v2.rs:1186-1188
Timestamp: 2024-10-03T11:51:06.980Z
Learning: In the `IdentityTransitionVersions` structure within `packages/rs-platform-version/src/version/v2.rs`, the field `credit_withdrawal` does not need the `identity_` prefix since it is already encompassed within identity state transitions.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : When adding new queries or state transitions, update the definitions in index.html.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/generate_docs.py : When adding new queries or state transitions, run python3 generate_docs.py to regenerate documentation.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Documents and data contracts should use state transitions for updates
Learnt from: lklimek
PR: dashpay/platform#2405
File: packages/wasm-sdk/src/verify.rs:26-68
Timestamp: 2025-02-10T11:26:36.709Z
Learning: In the wasm-sdk package, empty vectors and placeholder values are intentionally used in verification functions during the proof-of-concept stage to ensure proper compilation and type checking.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
packages/wasm-sdk/docs.html (10)
Learnt from: QuantumExplorer
PR: #2711
File: packages/wasm-sdk/AI_REFERENCE.md:771-783
Timestamp: 2025-07-28T20:00:08.502Z
Learning: In packages/wasm-sdk/AI_REFERENCE.md, the documentation correctly shows the actual SDK method signatures (including identityCreate and identityTopUp with their full parameter lists), which may differ from the UI inputs shown in fixed_definitions.json. The UI may collect fewer parameters from users while handling additional requirements internally.
Learnt from: QuantumExplorer
PR: #2711
File: packages/wasm-sdk/docs.html:2359-2383
Timestamp: 2025-07-28T20:00:24.323Z
Learning: In packages/wasm-sdk/docs.html, QuantumExplorer confirmed that placeholder private keys in documentation examples are acceptable as they are not real keys, though field name accuracy for the SDK API should still be maintained.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : When adding new queries or state transitions, update the definitions in index.html.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/generate_docs.py : When adding new queries or state transitions, run python3 generate_docs.py to regenerate documentation.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : When implementing WASM SDK functionality, always refer to AI_REFERENCE.md first for accurate method signatures and examples.
Learnt from: shumkov
PR: #2201
File: packages/rs-platform-version/src/version/v2.rs:1186-1188
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In the IdentityTransitionVersions
structure within packages/rs-platform-version/src/version/v2.rs
, the field credit_withdrawal
does not need the identity_
prefix since it is already encompassed within identity state transitions.
Learnt from: shumkov
PR: #2201
File: packages/rs-platform-version/src/version/v2.rs:1186-1188
Timestamp: 2024-10-03T11:51:06.980Z
Learning: In the IdentityTransitionVersions
structure within packages/rs-platform-version/src/version/v2.rs
, the field credit_withdrawal
does not need the identity_
prefix since it is already encompassed within identity state transitions.
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/index.html : Test the WASM SDK using the web interface at 'index.html' in 'packages/wasm-sdk'
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/generate_docs.py : Keep documentation for the WASM SDK in sync by running 'python3 generate_docs.py' in 'packages/wasm-sdk'
packages/wasm-sdk/AI_REFERENCE.md (10)
Learnt from: QuantumExplorer
PR: #2711
File: packages/wasm-sdk/AI_REFERENCE.md:771-783
Timestamp: 2025-07-28T20:00:08.502Z
Learning: In packages/wasm-sdk/AI_REFERENCE.md, the documentation correctly shows the actual SDK method signatures (including identityCreate and identityTopUp with their full parameter lists), which may differ from the UI inputs shown in fixed_definitions.json. The UI may collect fewer parameters from users while handling additional requirements internally.
Learnt from: QuantumExplorer
PR: #2711
File: packages/wasm-sdk/docs.html:2359-2383
Timestamp: 2025-07-28T20:00:24.323Z
Learning: In packages/wasm-sdk/docs.html, QuantumExplorer confirmed that placeholder private keys in documentation examples are acceptable as they are not real keys, though field name accuracy for the SDK API should still be maintained.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : When adding new queries or state transitions, update the definitions in index.html.
Learnt from: shumkov
PR: #2201
File: packages/rs-platform-version/src/version/v2.rs:1186-1188
Timestamp: 2024-10-03T11:51:06.980Z
Learning: In the IdentityTransitionVersions
structure within packages/rs-platform-version/src/version/v2.rs
, the field credit_withdrawal
does not need the identity_
prefix since it is already encompassed within identity state transitions.
Learnt from: shumkov
PR: #2201
File: packages/rs-platform-version/src/version/v2.rs:1186-1188
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In the IdentityTransitionVersions
structure within packages/rs-platform-version/src/version/v2.rs
, the field credit_withdrawal
does not need the identity_
prefix since it is already encompassed within identity state transitions.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : When implementing WASM SDK functionality, always refer to AI_REFERENCE.md first for accurate method signatures and examples.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/generate_docs.py : When adding new queries or state transitions, run python3 generate_docs.py to regenerate documentation.
Learnt from: QuantumExplorer
PR: #2439
File: packages/rs-dpp/src/errors/consensus/state/token/mod.rs:4-22
Timestamp: 2025-01-23T02:10:08.979Z
Learning: The user QuantumExplorer prefers to handle documentation of breaking changes separately from the code changes, particularly for token-related error types and validation rules.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Learnt from: lklimek
PR: #2405
File: packages/wasm-sdk/src/verify.rs:26-68
Timestamp: 2025-02-10T11:26:36.709Z
Learning: In the wasm-sdk package, empty vectors and placeholder values are intentionally used in verification functions during the proof-of-concept stage to ensure proper compilation and type checking.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Build JS packages / Build JS
- GitHub Check: build-and-test-wasm-sdk
- GitHub Check: build-wasm-sdk
🔇 Additional comments (3)
packages/wasm-sdk/AI_REFERENCE.md (1)
742-745
: Inconsistent argument order: identityCreate has no identity yetThe example still follows the generic pattern
sdk.identityCreate(identityHex, /* params */, privateKeyHex)
, but a brand-new identity has noidentityHex
nor a signing key. Conversely, the parameter list does not contain an initial credit amount thatidentityCreate
historically required. Either:
- Update the example to the true call signature (likely
sdk.identityCreate(seedPhrase, identityIndex, …)
), or- Clarify in prose how
identityHex
/privateKeyHex
are derived before the call.packages/wasm-sdk/docs.html (2)
2346-2371
: Creation flow is missing funding/amount inputsThe new parameter set drops anything related to the initial credit deposit (previously provided through an asset-lock proof / amount field).
If the underlyingsdk.identityCreate(...)
call still expects an amount (or uses implicit defaults) this doc will mis-lead integrators.Please confirm the actual WASM SDK signature and restore/audit the relevant funding parameter(s) if still required.
2385-2389
: Top-up transition shows only the identity ID – where is the amount?
identityTopUp
historically needs at least an “amount”/credits value. With just “Identity ID” the call cannot know how much to credit.Double-check the generated docs against the real method signature and add the missing argument(s) or update the example accordingly.
Parameters (in addition to identity/key): | ||
- `seedPhrase` (textarea, required) - Seed Phrase | ||
- Example: `Enter seed phrase (12-24 words) or click Generate` | ||
- `generateSeedButton` (button, optional) - Generate New Seed | ||
- `identityIndex` (number, required) - Identity Index | ||
- `keySelectionMode` (select, required) - Key Selection Mode | ||
- `keyPreview` (keyPreview, optional) - Keys to be added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Parameter list mixes UI-only fields with actual SDK inputs
generateSeedButton
, keyPreview
and even keySelectionMode
look like UI controls rather than values the SDK accepts at runtime. Including them here blurs the line between API contract and the app’s HTML form, making the reference hard to consume programmatically. Please trim the list to the real arguments the identityCreate
WASM binding expects and move UI affordances to a separate “UI-only” note.
🤖 Prompt for AI Agents
In packages/wasm-sdk/AI_REFERENCE.md around lines 734 to 740, the parameter list
for identityCreate includes UI-only fields like generateSeedButton, keyPreview,
and keySelectionMode, which are not actual SDK inputs. Remove these UI-related
parameters from the main parameter list to clearly separate the SDK's runtime
API contract. Instead, create a separate section or note for UI-only controls to
keep the documentation focused and easier to consume programmatically.
Closed by #2730 |
Issue being fixed or feature implemented
The following output files are updated when running generate_docs.py after #2711 was merged
What was done?
Ran
generate_docs.py
How Has This Been Tested?
Not tested
Breaking Changes
N/A
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit