Skip to content

Conversation

QuantumExplorer
Copy link
Member

@QuantumExplorer QuantumExplorer commented Jul 28, 2025

Summary by CodeRabbit

  • New Features

    • Added support for identity creation and top-up operations, allowing users to create new identities and top up balances using seed phrases and asset lock proofs.
    • Introduced seed phrase-based key derivation with dynamic key previews during identity creation.
  • Improvements

    • Enhanced the user interface for identity-related transitions with clearer input fields, dynamic feedback, and improved error handling.
    • Updated documentation to clarify parameter formats, provide detailed examples, and simplify token-related transition inputs.
  • Chores

    • Updated documentation timestamps for accuracy.

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

  • New Features

    • Added support for identity creation and top-up using seed phrase-based key derivation, with dynamic key preview and enhanced input handling in the web interface.
    • Introduced new SDK methods for identity creation and top-up, providing detailed feedback and error handling.
  • Documentation

    • Updated documentation to clarify parameter formats, add detailed examples, and reflect new identity creation and top-up workflows.
    • Revised token transition documentation to remove the "Key ID" parameter and update parameter requirements.
  • Refactor

    • Improved UI logic and input handling for identity-related transitions, including dynamic previews and validation.
    • Adjusted internal logic to use the configured network for key operations instead of a hardcoded value.
  • Chores

    • Updated documentation and manifest timestamps for accuracy.

Copy link
Contributor

coderabbitai bot commented Jul 28, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update overhauls the WASM SDK's identity creation and top-up flows, shifting from direct public key and asset lock proof inputs to a seed phrase-based key derivation approach. The UI, documentation, and transition definitions are updated for clarity and to support the new flow. Rust backend methods for identity creation and top-up are added.

Changes

Cohort / File(s) Change Summary
Documentation Updates
packages/wasm-sdk/AI_REFERENCE.md, packages/wasm-sdk/docs.html
Expanded and clarified parameter descriptions and examples for identity creation and top-up. Parameters now specify seed phrase/key derivation and asset lock proof handling. Token-related transitions remove the "keyId" parameter, and examples are updated accordingly.
Transition Input Definitions
packages/wasm-sdk/fixed_definitions.json
identityCreate and identityTopUp transitions now use seed phrase, identity index, key selection mode, and identity ID inputs instead of direct public key or asset lock proof inputs. UI elements for seed generation and key preview are defined and integrated.
Web UI & Logic
packages/wasm-sdk/index.html
The web interface is refactored to support seed phrase-based key derivation for identity creation. Dynamic key preview, seed validation, and new input logic are implemented. Identity top-up now requires identity ID input. Transition execution logic is updated accordingly. UI enhancements and error handling improvements are included.
Rust SDK Implementation
packages/wasm-sdk/src/state_transitions/identity/mod.rs
Two new async methods (identity_create, identity_top_up) are added to the SDK. They handle asset lock proof, private key, and key derivation, performing state transitions and returning results or errors. Existing contract signer creation logic is updated to use dynamic network configuration instead of hardcoded Testnet.
Manifest Update
packages/wasm-sdk/docs_manifest.json
Timestamp in the manifest's generated_at field updated. No other changes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI (index.html)
    participant WasmSdk (Rust)
    participant Platform

    User->>UI (index.html): Input seed phrase, identity index, select identityCreate
    UI (index.html)->>UI (index.html): Derive keys from seed phrase & index
    UI (index.html)->>WasmSdk (Rust): Call identity_create(assetLockProof, assetLockProofPrivateKey, publicKeys)
    WasmSdk (Rust)->>Platform: Submit put identity state transition
    Platform-->>WasmSdk (Rust): State transition result
    WasmSdk (Rust)-->>UI (index.html): Return identity details/result
    UI (index.html)-->>User: Display success, show identity info

    User->>UI (index.html): Input identityId, select identityTopUp
    UI (index.html)->>WasmSdk (Rust): Call identity_top_up(identityId, assetLockProof, assetLockProofPrivateKey)
    WasmSdk (Rust)->>Platform: Submit top-up state transition
    Platform-->>WasmSdk (Rust): State transition result
    WasmSdk (Rust)-->>UI (index.html): Return top-up result
    UI (index.html)-->>User: Display success, show updated balance
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

enhancement, js-sdk

Suggested reviewers

  • shumkov

Poem

A bunny with keys and a seed phrase anew,
Hopped through the docs and UI too.
With Rusty paws and HTML might,
It previewed keys in morning light.
Now identities bloom with a phrase and a click—
Oh, what a clever, cryptographic trick!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0541a8a and 3f14c52.

📒 Files selected for processing (2)
  • packages/wasm-sdk/AI_REFERENCE.md (2 hunks)
  • packages/wasm-sdk/docs.html (3 hunks)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/identityCreationForWasm

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.

@ktechmidas ktechmidas self-requested a review July 28, 2025 17:44
@QuantumExplorer QuantumExplorer added this to the v2.1 milestone Jul 28, 2025
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: 14

🔭 Outside diff range comments (1)
packages/wasm-sdk/src/state_transitions/identity/mod.rs (1)

921-921: Consistency: Network should be configurable in masternode_vote as well.

For consistency with the suggested changes in identity_create and identity_top_up, the hardcoded Network::Testnet should also be made configurable here.

Also applies to: 979-979

🧹 Nitpick comments (6)
packages/wasm-sdk/AI_REFERENCE.md (1)

1067-1068: Nit: clarify “optional” totalAgreedPrice

Good to note it is optional, but UX would benefit from the default behaviour (“fetches from pricing schedule”) being bold or moved to the help text so it’s not overlooked.

packages/wasm-sdk/docs.html (3)

2338-2354: Keep parameter-type labels consistent with the rest of the docs

Everywhere else parameter types are labelled text rather than string. Using two different labels for the same free-text input is confusing for readers and downstream tooling that crawls these pages.

-<span class="param-type">string</span>
+<span class="param-type">text</span>

Apply to the three occurrences inside the Identity Create parameter table.


3020-3023: Long label will overflow on narrow screens

The verbose description inside the <span class="param-name"> stretches the first column of the table and breaks layout on mobile. Consider moving the note to the <small> helper or shortening the label:

-<span class="param-name">Total Agreed Price (in credits) - Optional, fetches from pricing schedule if not provided</span>
+<span class="param-name">Total Agreed Price (credits)</span>
+<br><small>Optional – fetched from pricing schedule if omitted</small>

3055-3055: Huge option list decreases readability

Embedding the full list of config items in a single line makes diff-review and maintenance painful. Split into multiple lines or bullet list:

<br>
<small>
  Options:<br>
  – Conventions<br>
  – Max Supply<br>
  – Perpetual Distribution<br>
  – … (etc.)
</small>

This change has no functional impact but will keep future edits manageable.

packages/wasm-sdk/index.html (2)

2424-2431: Minor: placeholder option logic can mis-fire for falsy default values

if (!inputDef.value) { … } skips the placeholder when value is 0 (a perfectly valid default for many selects). Use value == null to check for “unset”.

-if (!inputDef.value) {
+if (inputDef.value == null) {

3521-3535: keyPreviewContainer id collision risk

createInput generates exactly one element with id keyPreviewContainer, but multiple identity-create forms could be rendered in the future (e.g., layered modals). Use a unique id or scope to the containing form to avoid duplicate-id issues.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5be67ee and 84f1dbb.

📒 Files selected for processing (6)
  • packages/wasm-sdk/AI_REFERENCE.md (2 hunks)
  • packages/wasm-sdk/docs.html (3 hunks)
  • packages/wasm-sdk/docs_manifest.json (1 hunks)
  • packages/wasm-sdk/fixed_definitions.json (2 hunks)
  • packages/wasm-sdk/index.html (7 hunks)
  • packages/wasm-sdk/src/state_transitions/identity/mod.rs (2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
packages/wasm-sdk/index.html

📄 CodeRabbit Inference Engine (CLAUDE.md)

Test the WASM SDK using the web interface at 'index.html' in 'packages/wasm-sdk'

Files:

  • packages/wasm-sdk/index.html
packages/wasm-sdk/**/index.html

📄 CodeRabbit Inference Engine (packages/wasm-sdk/CLAUDE.md)

packages/wasm-sdk/**/index.html: When adding new queries or state transitions, update the definitions in index.html.
The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.

Files:

  • packages/wasm-sdk/index.html
packages/wasm-sdk/src/**/*.rs

📄 CodeRabbit Inference Engine (packages/wasm-sdk/CLAUDE.md)

packages/wasm-sdk/src/**/*.rs: When implementing WASM SDK functionality, always refer to AI_REFERENCE.md first for accurate method signatures and examples.
For WASM builds, fix 'time not implemented on this platform' errors by using js_sys::Date::now().
Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.
The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.

Files:

  • packages/wasm-sdk/src/state_transitions/identity/mod.rs
🧠 Learnings (7)
📓 Common learnings
Learnt from: QuantumExplorer
PR: dashpay/platform#2673
File: packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_update/mod.rs:1164-1197
Timestamp: 2025-06-18T03:44:14.385Z
Learning: QuantumExplorer determined that a CodeRabbit suggestion about fixing signable_bytes calculation in identity update tests with contract-bound keys was incorrect - the code flow is working as intended without the suggested changes.
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/src/**/*.rs : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Learnt from: QuantumExplorer
PR: dashpay/platform#2215
File: packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs:19-30
Timestamp: 2024-10-06T16:11:34.946Z
Learning: In the Rust file `packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs`, within the `create_owner_identity_v1` function, the `add_public_keys` method of the `Identity` struct cannot fail and does not require explicit error handling.
Learnt from: QuantumExplorer
PR: dashpay/platform#2215
File: packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs:19-30
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In the Rust file `packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs`, within the `create_owner_identity_v1` function, the `add_public_keys` method of the `Identity` struct cannot fail and does not require explicit error handling.
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Use WASM bindings to connect Rust and JavaScript code for cross-language integration
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 : Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.
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: lklimek
PR: dashpay/platform#2277
File: packages/rs-sdk/tests/fetch/config.rs:233-233
Timestamp: 2024-10-30T11:19:59.163Z
Learning: In the Rust SDK's `rs-sdk/tests` integration tests (e.g., in `packages/rs-sdk/tests/fetch/config.rs`), we cannot create objects during tests because there is no support for object creation in this context. Therefore, hardcoded values for test identities must be used.
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: QuantumExplorer
PR: dashpay/platform#2257
File: packages/rs-drive-abci/src/mimic/test_quorum.rs:159-164
Timestamp: 2024-11-20T16:16:01.830Z
Learning: QuantumExplorer prefers not to receive auto-generated messages asking to post on social media.
Learnt from: QuantumExplorer
PR: dashpay/platform#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.
packages/wasm-sdk/docs_manifest.json (10)

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 : For WASM builds, fix 'time not implemented on this platform' errors by using js_sys::Date::now().

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: 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'

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/**/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 : Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.

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/src/**/*.rs : 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: Applies to packages/wasm-sdk/build.sh : Build the WASM SDK by running './build.sh' in 'packages/wasm-sdk'

packages/wasm-sdk/AI_REFERENCE.md (10)

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/**/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/**/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/**/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/src/**/*.rs : 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 : Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.

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: 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: 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'

packages/wasm-sdk/fixed_definitions.json (9)

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

Learnt from: QuantumExplorer
PR: #2673
File: packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_update/mod.rs:1164-1197
Timestamp: 2025-06-18T03:44:14.385Z
Learning: QuantumExplorer determined that a CodeRabbit suggestion about fixing signable_bytes calculation in identity update tests with contract-bound keys was incorrect - the code flow is working as intended without the suggested changes.

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: shumkov
PR: #2345
File: packages/wallet-utils-contract/schema/v1/wallet-utils-contract-documents.json:49-55
Timestamp: 2024-11-25T07:49:05.419Z
Learning: In the schema definitions for the wallet-utils-contract (file packages/wallet-utils-contract/schema/v1/wallet-utils-contract-documents.json), the $createdAt field is a system field augmented by DPP and does not need to be defined explicitly in the schema's properties.

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.

packages/wasm-sdk/docs.html (10)

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/**/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: 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/src/**/*.rs : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.

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: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.

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: 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'

packages/wasm-sdk/index.html (15)

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

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

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 : Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.

Learnt from: shumkov
PR: #2270
File: packages/dapi/lib/grpcServer/handlers/platform/broadcastStateTransitionHandlerFactory.js:90-96
Timestamp: 2024-10-24T05:01:51.097Z
Learning: In broadcastStateTransitionHandlerFactory.js, error handling when querying transaction status is handled in the API script.

Learnt from: shumkov
PR: #2186
File: packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_credit_withdrawal/mod.rs:48-54
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In the identity credit withdrawal transition code, the field platform_version.drive_abci.validation_and_processing.state_transitions.identity_credit_withdrawal_state_transition.transform_into_action is not an Option type, so handling None cases is unnecessary.

Learnt from: shumkov
PR: #2186
File: packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_credit_withdrawal/mod.rs:48-54
Timestamp: 2024-09-30T12:11:35.148Z
Learning: In the identity credit withdrawal transition code, the field platform_version.drive_abci.validation_and_processing.state_transitions.identity_credit_withdrawal_state_transition.transform_into_action is not an Option type, so handling None cases is unnecessary.

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: shumkov
PR: #2449
File: packages/dapi/lib/externalApis/drive/fetchProofForStateTransitionFactory.js:110-112
Timestamp: 2025-02-21T13:43:33.462Z
Learning: The getRecipientId() method has different signatures for mint and transfer token transitions - mint requires tokenConfiguration parameter while transfer does not, due to their different logic and states.

packages/wasm-sdk/src/state_transitions/identity/mod.rs (14)

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: QuantumExplorer
PR: #2215
File: packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs:19-30
Timestamp: 2024-10-06T16:11:34.946Z
Learning: In the Rust file packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs, within the create_owner_identity_v1 function, the add_public_keys method of the Identity struct cannot fail and does not require explicit error handling.

Learnt from: QuantumExplorer
PR: #2215
File: packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs:19-30
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In the Rust file packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs, within the create_owner_identity_v1 function, the add_public_keys method of the Identity struct cannot fail and does not require explicit error handling.

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 : Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.

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 : For WASM builds, fix 'time not implemented on this platform' errors by using js_sys::Date::now().

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 : 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: #2277
File: packages/rs-sdk/tests/fetch/config.rs:233-233
Timestamp: 2024-10-30T11:19:59.163Z
Learning: In the Rust SDK's rs-sdk/tests integration tests (e.g., in packages/rs-sdk/tests/fetch/config.rs), we cannot create objects during tests because there is no support for object creation in this context. Therefore, hardcoded values for test identities must be used.

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: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Use WASM bindings to connect Rust and JavaScript code for cross-language integration

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: QuantumExplorer
PR: #2235
File: packages/rs-dpp/src/identity/identity_public_key/v0/methods/mod.rs:8-9
Timestamp: 2024-10-10T05:10:50.059Z
Learning: In the codebase, importing Secp256k1 from dashcore::key::Secp256k1 is acceptable.

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-wasm-sdk
  • GitHub Check: build-and-test-wasm-sdk
🔇 Additional comments (5)
packages/wasm-sdk/docs_manifest.json (1)

2-2: Only timestamp touched – OK

Auto-generated manifest bumped generated_at. No further action.

packages/wasm-sdk/fixed_definitions.json (2)

1085-1131: New seed-phrase inputs break back-compat – verify end-to-end

Great UX improvement, but you removed every field related to assetLockProof / publicKeys. The Rust identity_create method added in this PR (per summary) still needs a derived key array & a funding proof built internally.

Please confirm:

  1. index.html actually derives keys from seedPhrase + identityIndex and feeds them to the wasm call.
  2. The wasm binding can build the asset-lock proof on its own (otherwise this form is incomplete).

If either step is missing the transition will fail at runtime.


1093-1097: Ensure generateTestSeed exists and is namespaced

The button references an action generateTestSeed. Verify that function is exported in index.html and doesn’t leak test seeds into production builds.

packages/wasm-sdk/docs.html (1)

2391-2408: Identity Top Up parameters look good

The added parameter descriptions align with the new WASM SDK signature and clearly indicate encoding requirements.

packages/wasm-sdk/src/state_transitions/identity/mod.rs (1)

3-3: LGTM! Imports are appropriate for the new functionality.

The added imports for identity creation, top-up functionality, and web console logging are necessary for the implementation.

Also applies to: 16-20

QuantumExplorer and others added 3 commits July 29, 2025 00:56
…reted as HTML

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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

♻️ Duplicate comments (5)
packages/wasm-sdk/src/state_transitions/identity/mod.rs (4)

47-47: Remove sensitive information from debug logs.

The debug logging includes references to the private key which should be redacted for security.

-        web_sys::console::log_1(&JsValue::from_str(&format!("  asset_lock_proof_private_key: [REDACTED] (length: {})", asset_lock_proof_private_key.len())));
+        web_sys::console::log_1(&JsValue::from_str(&format!("  asset_lock_proof_private_key: [REDACTED]")));

70-74: Remove private key from debug logs and error messages.

Similar to previous feedback, avoid logging private key information even for format validation.

-        web_sys::console::log_1(&JsValue::from_str(&format!("Private key format validation - length: {}", 
-            asset_lock_proof_private_key.len())));
-        
-        let private_key = PrivateKey::from_wif(&asset_lock_proof_private_key)
-            .map_err(|e| JsValue::from_str(&format!("Invalid private key: {}", e)))?;
+        let private_key = PrivateKey::from_wif(&asset_lock_proof_private_key)
+            .map_err(|e| JsValue::from_str(&format!("Invalid private key: {}", e)))?;

80-86: Add validation for public keys array size.

The code doesn't validate the maximum number of public keys, which could lead to resource exhaustion.

         let keys_array = keys_data.as_array()
             .ok_or_else(|| JsValue::from_str("public_keys must be a JSON array"))?;
         
+        // Validate array size to prevent resource exhaustion
+        if keys_array.len() > 100 {
+            return Err(JsValue::from_str("Too many public keys. Maximum 100 keys allowed"));
+        }
+        
         // Create identity public keys

264-268: Remove private key from debug logs and error messages.

Same security issue as in identity_create - private key information should not be logged.

-        web_sys::console::log_1(&JsValue::from_str(&format!("Private key format validation - length: {}", 
-            asset_lock_proof_private_key.len())));
-        
-        let private_key = PrivateKey::from_wif(&asset_lock_proof_private_key)
-            .map_err(|e| JsValue::from_str(&format!("Invalid private key: {}", e)))?;
+        let private_key = PrivateKey::from_wif(&asset_lock_proof_private_key)
+            .map_err(|e| JsValue::from_str(&format!("Invalid private key: {}", e)))?;
packages/wasm-sdk/docs.html (1)

2360-2381: Incorrect field name privateKeyHex in publicKeys example

privateKeyHex is not part of the Identity public-key schema accepted by the SDK (data/publicKeyHex is expected depending on keyType). Copy-pasting this snippet will make identityCreate fail at runtime.

-    privateKeyHex: "private_key_hex_here",
+    data: "public_key_hex_here",

Please drop the property entirely if you only want to demonstrate the structure.
(Placeholder values are fine, but field names must stay accurate.)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 37c4518 and 0541a8a.

📒 Files selected for processing (5)
  • packages/wasm-sdk/AI_REFERENCE.md (2 hunks)
  • packages/wasm-sdk/docs.html (3 hunks)
  • packages/wasm-sdk/index.html (10 hunks)
  • packages/wasm-sdk/src/state_transitions/contracts/mod.rs (2 hunks)
  • packages/wasm-sdk/src/state_transitions/identity/mod.rs (7 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/wasm-sdk/src/state_transitions/contracts/mod.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/wasm-sdk/index.html
🧰 Additional context used
📓 Path-based instructions (1)
packages/wasm-sdk/src/**/*.rs

📄 CodeRabbit Inference Engine (packages/wasm-sdk/CLAUDE.md)

packages/wasm-sdk/src/**/*.rs: When implementing WASM SDK functionality, always refer to AI_REFERENCE.md first for accurate method signatures and examples.
For WASM builds, fix 'time not implemented on this platform' errors by using js_sys::Date::now().
Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.
The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.

Files:

  • packages/wasm-sdk/src/state_transitions/identity/mod.rs
🧠 Learnings (4)
📓 Common learnings
Learnt from: QuantumExplorer
PR: dashpay/platform#2711
File: packages/wasm-sdk/AI_REFERENCE.md:771-783
Timestamp: 2025-07-28T20:00:08.459Z
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.272Z
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: QuantumExplorer
PR: dashpay/platform#2711
File: packages/wasm-sdk/index.html:4360-4416
Timestamp: 2025-07-28T20:04:48.415Z
Learning: In packages/wasm-sdk, the wallet helper `derive_key_from_seed_with_path` (Rust function in src/wallet/key_derivation.rs) is synchronous; its JS wrapper returns a value immediately, so `await` is unnecessary.
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/src/**/*.rs : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Learnt from: QuantumExplorer
PR: dashpay/platform#2215
File: packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs:19-30
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In the Rust file `packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs`, within the `create_owner_identity_v1` function, the `add_public_keys` method of the `Identity` struct cannot fail and does not require explicit error handling.
Learnt from: QuantumExplorer
PR: dashpay/platform#2215
File: packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs:19-30
Timestamp: 2024-10-06T16:11:34.946Z
Learning: In the Rust file `packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs`, within the `create_owner_identity_v1` function, the `add_public_keys` method of the `Identity` struct cannot fail and does not require explicit error handling.
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Use WASM bindings to connect Rust and JavaScript code for cross-language integration
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 : Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.
Learnt from: QuantumExplorer
PR: dashpay/platform#2257
File: packages/rs-drive-abci/src/mimic/test_quorum.rs:159-164
Timestamp: 2024-11-20T16:16:01.830Z
Learning: QuantumExplorer prefers not to receive auto-generated messages asking to post on social media.
Learnt from: QuantumExplorer
PR: dashpay/platform#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: QuantumExplorer
PR: dashpay/platform#2673
File: packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_update/mod.rs:1164-1197
Timestamp: 2025-06-18T03:44:14.385Z
Learning: QuantumExplorer determined that a CodeRabbit suggestion about fixing signable_bytes calculation in identity update tests with contract-bound keys was incorrect - the code flow is working as intended without the suggested changes.
packages/wasm-sdk/src/state_transitions/identity/mod.rs (29)

Learnt from: QuantumExplorer
PR: #2711
File: packages/wasm-sdk/AI_REFERENCE.md:771-783
Timestamp: 2025-07-28T20:00:08.459Z
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: #2215
File: packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs:19-30
Timestamp: 2024-10-06T16:11:34.946Z
Learning: In the Rust file packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs, within the create_owner_identity_v1 function, the add_public_keys method of the Identity struct cannot fail and does not require explicit error handling.

Learnt from: QuantumExplorer
PR: #2215
File: packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs:19-30
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In the Rust file packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs, within the create_owner_identity_v1 function, the add_public_keys method of the Identity struct cannot fail and does not require explicit error handling.

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/src/**/*.rs : Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.

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: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : For WASM builds, fix 'time not implemented on this platform' errors by using js_sys::Date::now().

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.

Learnt from: lklimek
PR: #2277
File: packages/rs-sdk/tests/fetch/config.rs:233-233
Timestamp: 2024-10-30T11:19:59.163Z
Learning: In the Rust SDK's rs-sdk/tests integration tests (e.g., in packages/rs-sdk/tests/fetch/config.rs), we cannot create objects during tests because there is no support for object creation in this context. Therefore, hardcoded values for test identities must be used.

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.

Learnt from: QuantumExplorer
PR: #2711
File: packages/wasm-sdk/docs.html:2359-2383
Timestamp: 2025-07-28T20:00:24.272Z
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: QuantumExplorer
PR: #2673
File: packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_update/mod.rs:1164-1197
Timestamp: 2025-06-18T03:44:14.385Z
Learning: QuantumExplorer determined that a CodeRabbit suggestion about fixing signable_bytes calculation in identity update tests with contract-bound keys was incorrect - the code flow is working as intended without the suggested changes.

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: shumkov
PR: #2449
File: packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs:107-150
Timestamp: 2025-03-13T07:24:37.295Z
Learning: In the RS SDK test data generation code, logging private keys is intentional and only enabled when a developer explicitly chooses to enable it, which is acceptable in test code contexts.

Learnt from: QuantumExplorer
PR: #2257
File: packages/rs-drive-abci/tests/strategy_tests/masternodes.rs:212-220
Timestamp: 2024-11-20T20:43:41.185Z
Learning: In packages/rs-drive-abci/tests/strategy_tests/masternodes.rs, the pattern of generating a PrivateKey, converting it to bytes, and reconstructing a BlsPrivateKey from those bytes is intentional. Avoid suggesting to simplify this code in future reviews.

Learnt from: QuantumExplorer
PR: #2711
File: packages/wasm-sdk/index.html:4360-4416
Timestamp: 2025-07-28T20:04:48.415Z
Learning: In packages/wasm-sdk, the wallet helper derive_key_from_seed_with_path (Rust function in src/wallet/key_derivation.rs) is synchronous; its JS wrapper returns a value immediately, so await is unnecessary.

Learnt from: QuantumExplorer
PR: #2257
File: packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving.rs:148-151
Timestamp: 2024-11-20T16:05:40.200Z
Learning: In packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving.rs, when converting public keys from QuorumForSavingV0 to VerificationQuorum, it's acceptable to use .expect() for public key conversion, as the conversion has been verified and panics are acceptable in this context.

Learnt from: QuantumExplorer
PR: #2227
File: packages/rs-dpp/src/core_types/validator_set/v0/mod.rs:299-299
Timestamp: 2024-10-21T01:03:42.458Z
Learning: In the test_serialize_deserialize_validator_set_v0 test within packages/rs-dpp/src/core_types/validator_set/v0/mod.rs, deterministic BLS keys cannot be easily used; therefore, using BlsPublicKey::generate() is acceptable.

Learnt from: pauldelucia
PR: #2523
File: packages/rs-drive/src/drive/contract/update/update_contract/v1/update_description/v1/mod.rs:147-151
Timestamp: 2025-04-11T09:08:05.652Z
Learning: Description length validation for data contracts (ensuring it's between 3 and 100 characters) is already handled at the data contract validation level in packages/rs-dpp/src/data_contract/methods/validate_update/v0/mod.rs, making additional checks in the update operations redundant.

Learnt from: lklimek
PR: #1924
File: packages/rs-sdk/src/sdk.rs:855-870
Timestamp: 2024-12-03T15:00:50.385Z
Learning: In packages/rs-sdk/src/sdk.rs, remember that rustls_pemfile::certs returns an iterator over Result, not a Result directly. Handle it accordingly in future code reviews.

Learnt from: QuantumExplorer
PR: #2690
File: packages/wasm-sdk/src/queries/document.rs:383-384
Timestamp: 2025-07-10T00:37:09.586Z
Learning: In the Dash platform, DPNS (Dash Platform Name Service) contracts have the same ID across all networks (mainnet, testnet, etc.), so hardcoding the DPNS contract ID is appropriate and doesn't need to be configurable.

Learnt from: lklimek
PR: #2318
File: .github/workflows/tests-build-image.yml:45-45
Timestamp: 2024-11-13T10:31:30.891Z
Learning: In the dashpay/platform repository, changes to .github/workflows/tests-build-image.yml that switch the Docker image platform from linux/arm64 to linux/amd64 for testing purposes are acceptable when required to run on GitHub-hosted runners. ARM64 testing is covered on the testnet.

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Use WASM bindings to connect Rust and JavaScript code for cross-language integration

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: QuantumExplorer
PR: #2235
File: packages/rs-dpp/src/identity/identity_public_key/v0/methods/mod.rs:8-9
Timestamp: 2024-10-10T05:10:50.059Z
Learning: In the codebase, importing Secp256k1 from dashcore::key::Secp256k1 is acceptable.

Learnt from: lklimek
PR: #2207
File: packages/rs-drive-proof-verifier/src/proof.rs:1646-1664
Timestamp: 2024-10-04T14:16:05.798Z
Learning: In the implementation of FromProof<platform::GetContestedResourceIdentityVotesRequest> in packages/rs-drive-proof-verifier/src/proof.rs, when matching maybe_votes, using .expect() on v.into_iter().next() is acceptable because the prior match arm Some(v) if v.is_empty() ensures that the map is not empty, preventing a panic.

Learnt from: lklimek
PR: #2207
File: packages/rs-drive-proof-verifier/src/proof.rs:1646-1664
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In the implementation of FromProof<platform::GetContestedResourceIdentityVotesRequest> in packages/rs-drive-proof-verifier/src/proof.rs, when matching maybe_votes, using .expect() on v.into_iter().next() is acceptable because the prior match arm Some(v) if v.is_empty() ensures that the map is not empty, preventing a panic.

packages/wasm-sdk/AI_REFERENCE.md (27)

Learnt from: QuantumExplorer
PR: #2711
File: packages/wasm-sdk/AI_REFERENCE.md:771-783
Timestamp: 2025-07-28T20:00:08.459Z
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: 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: QuantumExplorer
PR: #2711
File: packages/wasm-sdk/docs.html:2359-2383
Timestamp: 2025-07-28T20:00:24.272Z
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/**/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 : Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.

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/src/**/*.rs : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.

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

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: QuantumExplorer
PR: #2711
File: packages/wasm-sdk/index.html:4360-4416
Timestamp: 2025-07-28T20:04:48.415Z
Learning: In packages/wasm-sdk, the wallet helper derive_key_from_seed_with_path (Rust function in src/wallet/key_derivation.rs) is synchronous; its JS wrapper returns a value immediately, so await is unnecessary.

Learnt from: QuantumExplorer
PR: #2673
File: packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_update/mod.rs:1164-1197
Timestamp: 2025-06-18T03:44:14.385Z
Learning: QuantumExplorer determined that a CodeRabbit suggestion about fixing signable_bytes calculation in identity update tests with contract-bound keys was incorrect - the code flow is working as intended without the suggested changes.

Learnt from: QuantumExplorer
PR: #2257
File: packages/rs-drive-abci/tests/strategy_tests/masternodes.rs:212-220
Timestamp: 2024-11-20T20:43:41.185Z
Learning: In packages/rs-drive-abci/tests/strategy_tests/masternodes.rs, the pattern of generating a PrivateKey, converting it to bytes, and reconstructing a BlsPrivateKey from those bytes is intentional. Avoid suggesting to simplify this code in future reviews.

Learnt from: shumkov
PR: #2449
File: packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs:107-150
Timestamp: 2025-03-13T07:24:37.295Z
Learning: In the RS SDK test data generation code, logging private keys is intentional and only enabled when a developer explicitly chooses to enable it, which is acceptable in test code contexts.

Learnt from: lklimek
PR: #2381
File: packages/rs-sdk/scripts/connect_to_remote.sh:0-0
Timestamp: 2024-12-10T12:39:38.182Z
Learning: When reviewing scripts in packages/rs-sdk/scripts/, avoid suggesting additional error handling and timeout management that complicate the script without adding significant value.

Learnt from: shumkov
PR: #2345
File: packages/wallet-utils-contract/schema/v1/wallet-utils-contract-documents.json:27-48
Timestamp: 2024-11-25T07:48:48.027Z
Learning: The encryption implementation for AES-CBC-256 specified in packages/wallet-utils-contract/schema/v1/wallet-utils-contract-documents.json will be provided by another code, not included in this PR.

Learnt from: QuantumExplorer
PR: #2257
File: packages/rs-dpp/src/bls/native_bls.rs:45-49
Timestamp: 2024-11-20T09:55:15.990Z
Learning: The PublicKey<Bls12381G2Impl> library is external and cannot be modified. Suggestions to modify it are not applicable.

Learnt from: shumkov
PR: #2345
File: packages/wallet-utils-contract/schema/v1/wallet-utils-contract-documents.json:49-55
Timestamp: 2024-11-25T07:49:05.419Z
Learning: In the schema definitions for the wallet-utils-contract (file packages/wallet-utils-contract/schema/v1/wallet-utils-contract-documents.json), the $createdAt field is a system field augmented by DPP and does not need to be defined explicitly in the schema's properties.

Learnt from: QuantumExplorer
PR: #2215
File: packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs:19-30
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In the Rust file packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs, within the create_owner_identity_v1 function, the add_public_keys method of the Identity struct cannot fail and does not require explicit error handling.

Learnt from: QuantumExplorer
PR: #2215
File: packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs:19-30
Timestamp: 2024-10-06T16:11:34.946Z
Learning: In the Rust file packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs, within the create_owner_identity_v1 function, the add_public_keys method of the Identity struct cannot fail and does not require explicit error handling.

Learnt from: QuantumExplorer
PR: #2257
File: packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving.rs:148-151
Timestamp: 2024-11-20T16:05:40.200Z
Learning: In packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving.rs, when converting public keys from QuorumForSavingV0 to VerificationQuorum, it's acceptable to use .expect() for public key conversion, as the conversion has been verified and panics are acceptable in this context.

Learnt from: lklimek
PR: #2277
File: packages/rs-sdk/tests/fetch/config.rs:233-233
Timestamp: 2024-10-30T11:19:59.163Z
Learning: In the Rust SDK's rs-sdk/tests integration tests (e.g., in packages/rs-sdk/tests/fetch/config.rs), we cannot create objects during tests because there is no support for object creation in this context. Therefore, hardcoded values for test identities must be used.

Learnt from: QuantumExplorer
PR: #2644
File: packages/rs-drive/src/cache/system_contracts.rs:18-19
Timestamp: 2025-05-28T16:22:26.334Z
Learning: In packages/rs-drive/src/cache/system_contracts.rs, the active_since_protocol_version field in ActiveSystemDataContract struct is intentionally added for future use, not current implementation. QuantumExplorer confirmed this is "meant for later" when questioned about the #[allow(unused)] attribute.

Learnt from: lklimek
PR: #2277
File: packages/rs-sdk/src/core/transaction.rs:0-0
Timestamp: 2024-10-29T14:40:54.727Z
Learning: In packages/rs-sdk/src/platform/document_query.rs and packages/rs-sdk/src/core/transaction.rs, certain places don't implement IntoInner, so direct error mappings cannot be simplified using IntoInner. A TODO comment has been added to address this in a future PR.

Learnt from: shumkov
PR: #2305
File: packages/rs-drive-abci/src/abci/handler/finalize_block.rs:81-0
Timestamp: 2024-11-03T10:39:11.242Z
Learning: In packages/rs-drive-abci/src/abci/handler/finalize_block.rs, the use of .expect("commit transaction") after app.commit_transaction(platform_version) is intentional due to the provided comment explaining its necessity. Do not flag this usage in future reviews.

packages/wasm-sdk/docs.html (19)

Learnt from: QuantumExplorer
PR: #2711
File: packages/wasm-sdk/AI_REFERENCE.md:771-783
Timestamp: 2025-07-28T20:00:08.459Z
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.272Z
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/**/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: 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/src/**/*.rs : 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 : Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.

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: 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: QuantumExplorer
PR: #2257
File: packages/rs-drive-abci/tests/strategy_tests/masternodes.rs:212-220
Timestamp: 2024-11-20T20:43:41.185Z
Learning: In packages/rs-drive-abci/tests/strategy_tests/masternodes.rs, the pattern of generating a PrivateKey, converting it to bytes, and reconstructing a BlsPrivateKey from those bytes is intentional. Avoid suggesting to simplify this code in future reviews.

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.

Learnt from: shumkov
PR: #2449
File: packages/rs-drive-abci/src/execution/platform_events/initialization/create_genesis_state/test/tokens.rs:107-150
Timestamp: 2025-03-13T07:24:37.295Z
Learning: In the RS SDK test data generation code, logging private keys is intentional and only enabled when a developer explicitly chooses to enable it, which is acceptable in test code contexts.

Learnt from: QuantumExplorer
PR: #2673
File: packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_update/mod.rs:1164-1197
Timestamp: 2025-06-18T03:44:14.385Z
Learning: QuantumExplorer determined that a CodeRabbit suggestion about fixing signable_bytes calculation in identity update tests with contract-bound keys was incorrect - the code flow is working as intended without the suggested changes.

Learnt from: QuantumExplorer
PR: #2215
File: packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs:19-30
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In the Rust file packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs, within the create_owner_identity_v1 function, the add_public_keys method of the Identity struct cannot fail and does not require explicit error handling.

Learnt from: QuantumExplorer
PR: #2215
File: packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs:19-30
Timestamp: 2024-10-06T16:11:34.946Z
Learning: In the Rust file packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_masternode_identities/create_owner_identity/v1/mod.rs, within the create_owner_identity_v1 function, the add_public_keys method of the Identity struct cannot fail and does not require explicit error handling.

Learnt from: QuantumExplorer
PR: #2257
File: packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving.rs:148-151
Timestamp: 2024-11-20T16:05:40.200Z
Learning: In packages/rs-drive-abci/src/platform_types/signature_verification_quorum_set/v0/for_saving.rs, when converting public keys from QuorumForSavingV0 to VerificationQuorum, it's acceptable to use .expect() for public key conversion, as the conversion has been verified and panics are acceptable in this context.

Learnt from: QuantumExplorer
PR: #2711
File: packages/wasm-sdk/index.html:4360-4416
Timestamp: 2025-07-28T20:04:48.415Z
Learning: In packages/wasm-sdk, the wallet helper derive_key_from_seed_with_path (Rust function in src/wallet/key_derivation.rs) is synchronous; its JS wrapper returns a value immediately, so await is unnecessary.

Learnt from: QuantumExplorer
PR: #2644
File: packages/rs-drive/src/cache/system_contracts.rs:18-19
Timestamp: 2025-05-28T16:22:26.334Z
Learning: In packages/rs-drive/src/cache/system_contracts.rs, the active_since_protocol_version field in ActiveSystemDataContract struct is intentionally added for future use, not current implementation. QuantumExplorer confirmed this is "meant for later" when questioned about the #[allow(unused)] attribute.

🪛 Gitleaks (8.27.2)
packages/wasm-sdk/AI_REFERENCE.md

743-743: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


780-780: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

packages/wasm-sdk/docs.html

2361-2361: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


2414-2414: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

⏰ 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 (4)
packages/wasm-sdk/src/state_transitions/identity/mod.rs (3)

3-3: LGTM - Necessary imports for identity operations.

The new imports are appropriate for the identity creation and top-up functionality being added.

Also applies to: 16-20


142-142: Good use of configurable network.

Excellent improvement using self.network() instead of hardcoded Network::Testnet. This addresses the previous feedback about making network configuration dynamic.


415-415: Excellent improvement - dynamic network configuration.

Great work replacing hardcoded Network::Testnet with self.network(). This makes the network configurable and addresses previous feedback about network hardcoding across the codebase.

Also applies to: 556-556, 769-769, 919-919, 977-977

packages/wasm-sdk/AI_REFERENCE.md (1)

771-783: LGTM – parameters and example match current SDK signature

The identityTopUp section accurately reflects the underlying Rust/JS binding: identityId, assetLockProof, and assetLockProofPrivateKey. Nothing to change here.

@QuantumExplorer QuantumExplorer merged commit 4a4ff99 into v2.1-dev Jul 28, 2025
13 of 14 checks passed
@QuantumExplorer QuantumExplorer deleted the feat/identityCreationForWasm branch July 28, 2025 21:07
@coderabbitai coderabbitai bot mentioned this pull request Jul 29, 2025
12 tasks
thephez added a commit to thephez/platform that referenced this pull request Jul 29, 2025
The following output files are updated when running generate_docs.py after dashpay#2711 was merged
thephez added a commit that referenced this pull request Jul 29, 2025
The following output files are updated when running generate_docs.py after #2711 was merged
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