Skip to content

Conversation

thephez
Copy link
Collaborator

@thephez thephez commented Jul 29, 2025

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:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Summary by CodeRabbit

  • Documentation
    • Updated identity-related state transition documentation to reflect simplified parameters and usage examples.
    • Replaced asset lock proof and private key references with seed phrase and key management options in identity creation and top-up instructions.
    • Improved example formats for identity updates and other transitions for clarity and ease of use.

@thephez thephez requested a review from QuantumExplorer as a code owner July 29, 2025 17:13
Copy link
Contributor

coderabbitai bot commented Jul 29, 2025

Walkthrough

The documentation for identity-related state transitions in the WASM SDK was updated. Parameter lists and example usages for transitions like identityCreate, identityTopUp, and identityUpdate were revised to use seed phrase and key management concepts instead of asset lock proofs and explicit public key arrays. No code or API signatures were changed.

Changes

Cohort / File(s) Change Summary
WASM SDK Identity Docs
packages/wasm-sdk/AI_REFERENCE.md
Revised documentation for identity transitions: replaced asset lock proof and public key parameters with seed phrase, key management, and simplified examples.
WASM SDK HTML Docs
packages/wasm-sdk/docs.html
Updated HTML documentation for "Identity Create" and "Identity Top Up": new parameter descriptions, UI inputs, and generic example code.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • feat(sdk): identity creation in wasm #2711: This PR previously introduced asset lock proof and public key parameters for identity transitions, which are now replaced by seed phrase-based inputs and key selection modes in the current documentation update.

Suggested reviewers

  • ktechmidas
  • QuantumExplorer

Poem

In the warren of docs, a change hops through,
Seed phrases now lead, as old keys bid adieu.
Identity flows, with less proof to show,
Simpler examples, for all bunnies to know.
🥕✨ Documentation renewed, the SDK’s garden grew!

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
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pr-2711-follow-up

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

The following output files are updated when running generate_docs.py after #2711 was merged
@thephez thephez force-pushed the pr-2711-follow-up branch from 5779518 to 07e1595 Compare July 29, 2025 21:26
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 disagree

The list introduces an explicit identityId, yet the example passes only identityHex (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 set

You switched keyType and purpose 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 signature

Both 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1e5107b and 07e1595.

📒 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 yet

The example still follows the generic pattern sdk.identityCreate(identityHex, /* params */, privateKeyHex), but a brand-new identity has no identityHex nor a signing key. Conversely, the parameter list does not contain an initial credit amount that identityCreate historically required. Either:

  1. Update the example to the true call signature (likely sdk.identityCreate(seedPhrase, identityIndex, …)), or
  2. 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 inputs

The new parameter set drops anything related to the initial credit deposit (previously provided through an asset-lock proof / amount field).
If the underlying sdk.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.

Comment on lines +734 to +740
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
Copy link
Contributor

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.

@thephez
Copy link
Collaborator Author

thephez commented Aug 19, 2025

Closed by #2730

@thephez thephez closed this Aug 19, 2025
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.

1 participant