-
Notifications
You must be signed in to change notification settings - Fork 44
fix(sdk): fix documentation examples #2710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixed HTML structure issue where Example 2 was nested inside Example 1 in the Get Identity Keys endpoint documentation. Both examples are now properly displayed at the same level. Changes: - Updated generate_docs.py to close the first example container before starting the second one - Regenerated docs.html with correct HTML structure - Updated AI_REFERENCE.md and docs_manifest.json accordingly 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixed HTML container structure where the special handling for Get Identity Keys was causing improper container closing, making all subsequent query sections display as new columns instead of normal layout. Changes: - Added early return for getIdentityKeys special case to prevent double closing - Both examples now have proper result div placement within their containers - Subsequent query sections now display with correct layout 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…ontract ID Updated the getDataContractHistory example to use contract ID HLY575cNazmc5824FxqaEMEBuzFeE4a98GDRNKbyJqCM instead of the default test contract. This provides a better example for testing contract history functionality. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…P flag - Fix BTreeMap serialization issue by using String keys instead of u64 - Update example to use specific contract ID HLY575cNazmc5824FxqaEMEBuzFeE4a98GDRNKbyJqCM - Remove "Work in Progress" notification from getDataContractHistory - Regenerate documentation with updated parameters 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
WalkthroughThis update modifies the WASM SDK documentation to clarify and expand example usage, particularly for identity and token operations. It also adjusts internal SDK code for token queries, updates request parameter handling, and changes serialization types for data contract history responses. No public API signatures are altered. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant WASM Docs UI
participant WASM SDK
User->>WASM Docs UI: Selects example and runs code
WASM Docs UI->>WASM SDK: Calls query or state transition (e.g., identityCreate, getIdentityKeys)
WASM SDK-->>WASM Docs UI: Returns result (uses updated parameters and example data)
WASM Docs UI-->>User: Displays result in updated UI container
sequenceDiagram
participant WASM SDK
participant gRPC Client
participant DAPI Server
WASM SDK->>gRPC Client: Build and send GetTokenPerpetualDistributionLastClaimRequest (prove: false)
gRPC Client->>DAPI Server: Send request
DAPI Server-->>gRPC Client: Return protobuf response
gRPC Client-->>WASM SDK: Deliver response
WASM SDK->>WASM SDK: Parse response, extract claim info or handle raw bytes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
…onality Add Example 3 - Search Keys by Purpose to getIdentityKeys documentation, demonstrating how to use the search key request type with purpose mapping for authentication and encryption keys. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Returns no results but doesn't error
…roofs to get example working Claude identified an issue in the rs-drive-proof-verifier preventing the SDK from properly handling the proof
@coderabbitai reveiw |
Tip For best results, initiate chat on the files or code changes. @thephez I'll review the changes in this PR that fixes the WASM SDK documentation examples and getDataContractHistory issues. [review] 🧠 Learnings used
|
…ecoding - Implement direct gRPC calls with prove: false to bypass proof verification issues - Fix raw bytes decoding to properly parse 8-byte server response format: - First 4 bytes: timestamp (u32, in seconds) - Last 4 bytes: block height (u32) - Update test parameters to use identity/token with actual completed claims - Function now returns actual claim data instead of errors or zero values 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (3)
packages/wasm-sdk/src/sdk.rs (1)
58-62
: Helper method duplicates existingAsRef
/Deref
functionality
inner_sdk()
returns the same&Sdk
reference already obtainable through
wasm_sdk.as_ref()
(via theAsRef<Sdk>
impl) or*wasm_sdk
(viaDeref
).
Unless there is a caller that cannot rely on those trait APIs, this method adds
surface area without new capability and may confuse future maintainers.packages/wasm-sdk/docs.html (2)
1377-1378
: Update the parameter hint to match the new contract IDThe example now uses contract
HLY575c…
, but the “Example” note under the Parameters table (lines 1357-1361) still showsGWRSAVF…
.
Synchronise those two values to avoid copy-paste confusion.
2034-2035
:🚧 Work in Progress
marker is no longer accurate
get_token_perpetual_distribution_last_claim
was fixed in the Rust code and now returns data.
Consider dropping the WIP badge or adding a short note explaining any remaining limitation (e.g. “proof verification disabled”).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
packages/wasm-sdk/docs.html
(5 hunks)packages/wasm-sdk/generate_docs.py
(3 hunks)packages/wasm-sdk/src/context_provider.rs
(1 hunks)packages/wasm-sdk/src/queries/data_contract.rs
(3 hunks)packages/wasm-sdk/src/queries/identity.rs
(2 hunks)packages/wasm-sdk/src/queries/token.rs
(1 hunks)packages/wasm-sdk/src/sdk.rs
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
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/queries/data_contract.rs
packages/wasm-sdk/src/sdk.rs
packages/wasm-sdk/src/queries/identity.rs
packages/wasm-sdk/src/context_provider.rs
packages/wasm-sdk/src/queries/token.rs
packages/wasm-sdk/generate_docs.py
📄 CodeRabbit Inference Engine (CLAUDE.md)
Keep documentation for the WASM SDK in sync by running 'python3 generate_docs.py' in 'packages/wasm-sdk'
Files:
packages/wasm-sdk/generate_docs.py
packages/wasm-sdk/**/generate_docs.py
📄 CodeRabbit Inference Engine (packages/wasm-sdk/CLAUDE.md)
When adding new queries or state transitions, run python3 generate_docs.py to regenerate documentation.
Files:
packages/wasm-sdk/generate_docs.py
🧠 Learnings (8)
📓 Common learnings
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: 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: 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: 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: 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: 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: 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 : 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.
packages/wasm-sdk/src/queries/data_contract.rs (16)
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 : 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-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: 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: 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: 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 is already handled in the data contract validation process, specifically in packages/rs-dpp/src/data_contract/methods/validate_update/v0/mod.rs.
Learnt from: QuantumExplorer
PR: #2227
File: packages/rs-drive-abci/src/platform_types/platform_state/mod.rs:141-141
Timestamp: 2024-10-08T13:28:03.529Z
Learning: When converting PlatformStateV0
to PlatformStateForSavingV1
in packages/rs-drive-abci/src/platform_types/platform_state/mod.rs
, only version 0
needs to be handled in the match on platform_state_for_saving_structure_default
because the changes are retroactive.
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: lklimek
PR: #2277
File: packages/dapi-grpc/src/mock.rs:125-145
Timestamp: 2024-10-29T14:16:00.141Z
Learning: Using serde_json
encoding produces deterministic output required to identify requests and responses by hash, therefore serde_json
is used as the basic serialization algorithm for mocking.
Learnt from: lklimek
PR: #2139
File: packages/rs-drive-proof-verifier/src/types.rs:0-0
Timestamp: 2024-09-27T08:25:11.059Z
Learning: Build failures are intended when new versions are added to the Version
enum in TryFrom
implementations, so that developers are forced to handle them explicitly. Therefore, it's acceptable not to include a wildcard arm for Some(_)
when matching on response.version
.
Learnt from: lklimek
PR: #2139
File: packages/rs-drive-proof-verifier/src/types.rs:0-0
Timestamp: 2024-10-09T00:22:57.778Z
Learning: Build failures are intended when new versions are added to the Version
enum in TryFrom
implementations, so that developers are forced to handle them explicitly. Therefore, it's acceptable not to include a wildcard arm for Some(_)
when matching on response.version
.
Learnt from: shumkov
PR: #2345
File: packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs:93-99
Timestamp: 2024-11-22T08:19:14.448Z
Learning: In packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs
, the insert_contract
method requires an owned BlockInfo
, so cloning block_info
is necessary when calling it.
Learnt from: QuantumExplorer
PR: #2182
File: packages/rs-drive/src/util/grove_operations/batch_insert_if_not_exists_return_existing_element/mod.rs:46-50
Timestamp: 2024-09-28T20:43:05.154Z
Learning: In this codebase, match statements for versions are intentionally designed to handle known versions and treat unknown versions as mismatches.
Learnt from: QuantumExplorer
PR: #2182
File: packages/rs-drive/src/util/grove_operations/batch_insert_if_not_exists_return_existing_element/mod.rs:46-50
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In this codebase, match statements for versions are intentionally designed to handle known versions and treat unknown versions as mismatches.
packages/wasm-sdk/src/sdk.rs (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/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: 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: 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: lklimek
PR: #2232
File: packages/rs-sdk/src/mock/sdk.rs:90-95
Timestamp: 2024-10-10T10:30:19.883Z
Learning: In packages/rs-sdk/src/mock/sdk.rs
, the load_expectations
method in MockDashPlatformSdk
remains asynchronous (async
) for backward compatibility, even though it now delegates to the synchronous load_expectations_sync
method.
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: 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: #2254
File: packages/rs-sdk/src/sdk.rs:585-585
Timestamp: 2024-10-18T15:39:51.172Z
Learning: The 'platform' project uses Rust version 1.80, so code in 'packages/rs-sdk' can use features available in Rust 1.80, such as the abs_diff()
method.
Learnt from: lklimek
PR: #2232
File: packages/rs-sdk/src/mock/sdk.rs:129-130
Timestamp: 2024-10-10T10:30:25.283Z
Learning: In the codebase packages/rs-sdk/src/mock/sdk.rs
, tokio::sync::Mutex
is used instead of std::sync::Mutex
because std::sync::MutexGuard
is not Send
and cannot be used in async contexts.
packages/wasm-sdk/src/queries/identity.rs (11)
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: #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 : 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: #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: 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/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-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: 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: lklimek
PR: #2277
File: packages/rs-sdk/src/platform/fetch_unproved.rs:0-0
Timestamp: 2024-10-30T11:04:33.634Z
Learning: In packages/rs-sdk/src/platform/fetch_unproved.rs
, the execute()
method consumes the request object, so cloning the request is necessary before passing it to execute()
and maybe_from_unproved_with_metadata
.
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 : 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/**/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/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: 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 : Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.
packages/wasm-sdk/src/context_provider.rs (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 : 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 : 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 : For WASM builds, fix 'time not implemented on this platform' errors by using js_sys::Date::now().
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: lklimek
PR: #2380
File: packages/rs-drive-proof-verifier/src/error.rs:122-125
Timestamp: 2024-12-06T14:15:49.367Z
Learning: All error variants in ContextProviderError
within packages/rs-drive-proof-verifier/src/error.rs
are designed to take String
as their parameter.
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: 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: 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/queries/token.rs (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 : 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 : 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 : 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/src/platform/fetch_unproved.rs:0-0
Timestamp: 2024-10-30T11:04:33.634Z
Learning: In packages/rs-sdk/src/platform/fetch_unproved.rs
, the execute()
method consumes the request object, so cloning the request is necessary before passing it to execute()
and maybe_from_unproved_with_metadata
.
Learnt from: QuantumExplorer
PR: #2215
File: packages/rs-drive-abci/src/execution/engine/run_block_proposal/mod.rs:105-105
Timestamp: 2024-10-06T16:17:34.571Z
Learning: In run_block_proposal
in packages/rs-drive-abci/src/execution/engine/run_block_proposal/mod.rs
, when retrieving last_block_time_ms
, it's acceptable to use platform_state
instead of block_platform_state
, even after updating the protocol version.
Learnt from: QuantumExplorer
PR: #2215
File: packages/rs-drive-abci/src/execution/engine/run_block_proposal/mod.rs:105-105
Timestamp: 2024-10-09T00:22:57.778Z
Learning: In run_block_proposal
in packages/rs-drive-abci/src/execution/engine/run_block_proposal/mod.rs
, when retrieving last_block_time_ms
, it's acceptable to use platform_state
instead of block_platform_state
, even after updating the protocol version.
Learnt from: QuantumExplorer
PR: #2711
File: packages/wasm-sdk/index.html:4360-4416
Timestamp: 2025-07-28T20:04:48.458Z
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: #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: 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.
packages/wasm-sdk/generate_docs.py (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: 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: #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/**/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: 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/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/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: 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'
🪛 Gitleaks (8.27.2)
packages/wasm-sdk/generate_docs.py
156-156: 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). (2)
- GitHub Check: Build JS packages / Build JS
- GitHub Check: Rust crates security audit
🔇 Additional comments (13)
packages/wasm-sdk/src/queries/data_contract.rs (2)
60-63
: Key type switched toString
; be mindful of ordering & downstream expectationsMoving from
BTreeMap<u64, _>
toBTreeMap<String, _>
fixes the JSON-
serialization issue (non-string keys are invalid).
Note, however, that the resulting map will now sort lexicographically
("10"
<"2"
), which differs from numeric ordering.
If any consumer relies on revision order, consider:
- Returning a
Vec<(u64, Value)>
instead, or- Retaining a numeric map internally and converting to a
serde_json::Map
right before serialization.
95-99
: Consistent conversion pattern – looks goodUsing
revision.to_string()
at insertion points aligns with the new schema and
keeps the code self-contained. No further issues spotted.Also applies to: 184-187
packages/wasm-sdk/src/queries/identity.rs (2)
160-162
: LGTM! Systematic improvements to query reliability.The changes consistently disable proof verification and enforce proper parameter handling:
- Setting
prove: false
avoids proof verification issues in WASM context- Enforcing a default limit of 100 ensures queries have reasonable bounds
- Explicitly setting
offset: None
with clear documentation about lack of support when prove=falseThese changes align with the PR objectives to fix WASM SDK issues and improve reliability.
257-259
: LGTM! Consistent parameter handling across request types.These changes mirror the improvements made to the "specific" request type, ensuring consistent behavior across all key request methods. The systematic approach to disabling proof verification and enforcing parameter constraints improves the overall reliability of the identity key queries.
packages/wasm-sdk/src/context_provider.rs (1)
48-62
: Excellent improvement in transparency and user guidance.The enhanced implementation addresses several important aspects:
- Parameter usage: Now properly utilizes the
token_id
parameter instead of ignoring it- Clear documentation: Comprehensive comments explain the current limitations and future enhancement needs
- User guidance: The warning log appropriately informs users about proof verification implications and suggests using trusted context builders
- Maintainability: The TODO comment clearly marks future work needed
This change significantly improves the developer experience by providing clear feedback about why token configuration is unavailable and how to work around it.
packages/wasm-sdk/generate_docs.py (5)
147-148
: LGTM! Improved test data specificity.The parameter mapping updates provide more precise test values for specific queries, which aligns with the PR objectives of fixing examples and using concrete IDs for better documentation.
156-156
: LGTM! Static analysis false positive addressed.The updated token ID parameter mapping is correct for the
getTokenPerpetualDistributionLastClaim
example. The static analysis hint about a "Generic API Key" is a false positive - this is a public token identifier used for documentation examples, not a sensitive credential.
209-212
: LGTM! Consistent example generation for getDataContractHistory.The special case handling ensures that
getDataContractHistory
always uses the specific contract ID mentioned in the PR objectives, providing consistent and working examples. The parameter structure (id, limit, offset) is appropriate for this query.
406-406
: LGTM! Correctly updated Work in Progress status.Removing
getDataContractHistory
from the Work in Progress list aligns with the PR objectives. The function has been fixed and should no longer display the WIP warning to users.
411-429
: LGTM! Fixed HTML structure for identity keys examples.This change addresses the HTML structure issue mentioned in the PR objectives by creating properly separated example containers for "Get Identity Keys Example 2" and "Example 3". Each example now has its own code block, run button, and result div with unique IDs, preventing the nesting issue that existed before.
The example code demonstrates appropriate usage of the
get_identity_keys
function with different parameter combinations (specific key IDs and purpose-based search).packages/wasm-sdk/src/queries/token.rs (1)
544-568
: Successfully addresses proof verification issuesThe refactoring to use direct gRPC calls with
prove: false
effectively resolves the token configuration and proof verification errors mentioned in the PR objectives. This approach bypasses the context provider dependency while still retrieving the claim data.packages/wasm-sdk/docs.html (2)
1038-1047
: No functional issues – restructure looks goodSplitting Example 1 from Example 2/3 removes the accidental nesting and the IDs are still unique (
getIdentityKeys
,getIdentityKeys2
,getIdentityKeys3
).
Everything will render correctly andrunExample()
will continue to find the right code blocks.
1049-1053
: get_identity_keys intentionally takes a JSON string forpurpose_map
The JS binding for get_identity_keys is defined as
pub async fn get_identity_keys( …, search_purpose_map: Option<String>, // JSON string … )so the example’s use of a literal JSON string is correct and required by the current wasm-bindgen signature. You can ignore the suggestion to pass a JS object here.
Likely an incorrect or invalid review comment.
…w bytes parsing - Document exact 8-byte format specification for PaidAt::RawBytes parsing - Add validation ranges for timestamp (>= Jan 1, 2021) and block height (>= 1) - Include defensive programming with console warnings for invalid values - Implement graceful fallbacks to safe defaults instead of silent failures - Maintain backward compatibility while improving robustness 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Remove WIP note and sync contract id in getDataContractHistory example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/wasm-sdk/generate_docs.py (1)
148-149
: Parameter mapping updates are correct but consider refactoring.The conditional logic properly handles the specific requirements for
getDataContractHistory
andgetTokenPerpetualDistributionLastClaim
functions as outlined in the PR objectives.Consider extracting these function-specific mappings into a separate dictionary to improve readability:
function_specific_mappings = { 'getDataContractHistory': { 'id': f"'{test_data['data_contract_history_id']}'" }, 'getTokenPerpetualDistributionLastClaim': { 'identityId': "'5RG84o6KsTaZudDqS8ytbaRB8QP4YYQ2uwzb6Hj8cfjX'" } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
packages/wasm-sdk/docs.html
(6 hunks)packages/wasm-sdk/fixed_definitions.json
(1 hunks)packages/wasm-sdk/generate_docs.py
(4 hunks)packages/wasm-sdk/update_inputs.py
(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- packages/wasm-sdk/fixed_definitions.json
- packages/wasm-sdk/update_inputs.py
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/wasm-sdk/docs.html
🧰 Additional context used
📓 Path-based instructions (2)
packages/wasm-sdk/generate_docs.py
📄 CodeRabbit Inference Engine (CLAUDE.md)
Keep documentation for the WASM SDK in sync by running 'python3 generate_docs.py' in 'packages/wasm-sdk'
Files:
packages/wasm-sdk/generate_docs.py
packages/wasm-sdk/**/generate_docs.py
📄 CodeRabbit Inference Engine (packages/wasm-sdk/CLAUDE.md)
When adding new queries or state transitions, run python3 generate_docs.py to regenerate documentation.
Files:
packages/wasm-sdk/generate_docs.py
🧠 Learnings (2)
📓 Common learnings
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: 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: 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: 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: 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: 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: 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: 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/generate_docs.py (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: 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 : 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: 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: 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/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/index.html : Test the WASM SDK using the web interface at 'index.html' in 'packages/wasm-sdk'
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.
🪛 Gitleaks (8.27.2)
packages/wasm-sdk/generate_docs.py
157-157: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
🔇 Additional comments (5)
packages/wasm-sdk/generate_docs.py (5)
133-133
: LGTM: Test data update aligns with PR objectives.The update to use the specific contract ID
'HLY575cNazmc5824FxqaEMEBuzFeE4a98GDRNKbyJqCM'
forgetDataContractHistory
examples is consistent with the PR's goal of fixing this function's documentation.
157-157
: LGTM: Token ID update for test examples.The updated
tokenId
mapping correctly handles thegetTokenPerpetualDistributionLastClaim
function with appropriate test data. The static analysis warning about a "Generic API Key" is a false positive - this is a legitimate token ID used for documentation examples, not a real API key.
210-213
: LGTM: Special case handling for getDataContractHistory.The hardcoded parameters ensure the
getDataContractHistory
examples work correctly with the specific contract ID and reasonable defaults (limit=10, offset=0). This directly addresses the serialization issues mentioned in the PR objectives.
407-407
: LGTM: Removed getDataContractHistory from Work in Progress list.Correctly removes the WIP label from
getDataContractHistory
after fixing its issues, as documented in the PR objectives.
412-430
: LGTM: Enhanced getIdentityKeys examples improve documentation.The addition of multiple example containers for
getIdentityKeys
effectively demonstrates different usage patterns:
- Example 2 shows getting specific keys by index
- Example 3 shows searching keys by purpose with JSON filters
The HTML structure is well-formed and addresses the structural issues mentioned in the PR objectives. The examples provide valuable guidance for users working with identity keys.
0d8cc7a
to
8d02f7d
Compare
8d02f7d
to
243e31e
Compare
Issue being fixed or feature implemented
The WASM SDK documentation had several issues:
What was done?
prove: false
to bypass proof verification issues caused by missing token configuration in WasmContextHow Has This Been Tested?
Breaking Changes
None - these are bug fixes that restore intended functionality.
Checklist:
Summary by CodeRabbit
Documentation
Bug Fixes
Refactor