Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
fd546be
dpns usernames in rust sdk
Jul 10, 2025
ddca52a
dpns improvements
Jul 10, 2025
72d8197
more dpns improvements
QuantumExplorer Jul 10, 2025
84fb154
more dpns improvements
QuantumExplorer Jul 10, 2025
0964da3
more dpns improvements
QuantumExplorer Jul 10, 2025
bcacb00
more dpns improvements
QuantumExplorer Jul 10, 2025
9b0adf5
dpns improvements
Jul 10, 2025
ef11969
more work
Jul 10, 2025
647da0c
more work
Jul 10, 2025
69ac84a
more work
Jul 10, 2025
057b618
more work
Jul 11, 2025
5d71bd1
more fixes
Jul 11, 2025
26e4d25
fix
QuantumExplorer Jul 11, 2025
37a3ca4
fix
QuantumExplorer Jul 11, 2025
30215df
more fixes
Jul 11, 2025
ff8ff6d
Merge branch 'feat/dpnsImprovements' of github.com:dashpay/platform i…
Jul 11, 2025
a53b9cf
another fix
QuantumExplorer Jul 11, 2025
6aac9cf
Potential fix for code scanning alert no. 24: DOM text reinterpreted …
QuantumExplorer Jul 12, 2025
0f6be17
fixes
Jul 12, 2025
5ef0fdd
more work
Jul 12, 2025
4a1cf37
more work
Jul 12, 2025
a0867a9
improvement
QuantumExplorer Jul 12, 2025
09313ff
Merge branch 'feat/dpnsImprovements' of github.com:dashpay/platform i…
QuantumExplorer Jul 12, 2025
ba65988
improvement
QuantumExplorer Jul 12, 2025
36c3a4f
fix
QuantumExplorer Jul 12, 2025
b2c07f5
fix
QuantumExplorer Jul 12, 2025
1b55f53
fix
Jul 12, 2025
47403bc
Merge branch 'feat/dpnsImprovements' of github.com:dashpay/platform i…
Jul 12, 2025
8a3c931
more work
QuantumExplorer Jul 12, 2025
61e4d9c
fix
Jul 12, 2025
da06af1
fix
QuantumExplorer Jul 12, 2025
4778678
Merge branch 'feat/dpnsImprovements' of github.com:dashpay/platform i…
QuantumExplorer Jul 12, 2025
a64b739
fixes
Jul 12, 2025
5b08754
Merge branch 'feat/dpnsImprovements' of github.com:dashpay/platform i…
Jul 12, 2025
d47bfd8
fixes
Jul 12, 2025
2b80447
fixes
Jul 12, 2025
83a3cf1
wasm docs
Jul 14, 2025
dd4234c
Merge branch 'v2.1-dev' into feat/wasm-docs
QuantumExplorer Jul 14, 2025
16fedb5
more work
Jul 14, 2025
f97f190
Merge branch 'feat/wasm-docs' of github.com:dashpay/platform into fea…
Jul 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/grpc-queries-cache.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"status": "implemented"
},
"getTokenContractInfo": {
"status": "not_implemented"
"status": "implemented"
},
"getTokenPreProgrammedDistributions": {
"status": "not_implemented"
Expand All @@ -143,5 +143,5 @@
"status": "not_implemented"
}
},
"last_updated": "2025-01-06T00:00:00Z"
"last_updated": "2025-07-14T03:27:11.465612"
}
47 changes: 43 additions & 4 deletions .github/scripts/check-grpc-coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,28 @@ def save_cache(cache_file, cache_data):
json.dump(cache_data, f, indent=2)


def check_wasm_sdk_documentation():
"""Check WASM SDK documentation completeness"""
wasm_sdk_path = Path(__file__).parent.parent.parent / 'packages' / 'wasm-sdk'
check_script = wasm_sdk_path / 'check_documentation.py'

if not check_script.exists():
return True, [] # Skip if WASM SDK doesn't have the check script

# Run the documentation check
import subprocess
result = subprocess.run(['python3', str(check_script)], cwd=wasm_sdk_path, capture_output=True, text=True)

# Parse the output to find errors
errors = []
if result.returncode != 0:
output_lines = result.stdout.strip().split('\n')
for line in output_lines:
if line.startswith('ERROR:'):
errors.append(line)

return result.returncode == 0, errors

def main():
"""Main function to check gRPC coverage."""
# Get paths
Expand Down Expand Up @@ -313,12 +335,29 @@ def main():

print("\n" + report_content)

# Exit with error only if there are missing NEW queries
if missing_new_queries:
print(f"\nERROR: {len(missing_new_queries)} NEW queries are not implemented in rs-sdk")
# Check WASM SDK documentation
print("\n" + "=" * 80)
print("Checking WASM SDK Documentation...")
print("=" * 80)

wasm_docs_ok, wasm_errors = check_wasm_sdk_documentation()

if wasm_docs_ok:
print("✅ WASM SDK documentation is up to date")
else:
print(f"❌ WASM SDK documentation has {len(wasm_errors)} errors:")
for error in wasm_errors:
print(f" {error}")
print("\nTo fix WASM SDK documentation errors, run:")
print(" cd packages/wasm-sdk && python3 generate_docs.py")

# Exit with error if there are missing NEW queries or documentation errors
if missing_new_queries or not wasm_docs_ok:
if missing_new_queries:
print(f"\nERROR: {len(missing_new_queries)} NEW queries are not implemented in rs-sdk")
sys.exit(1)
else:
print("\nSUCCESS: All NEW gRPC queries are implemented in rs-sdk (or excluded)")
print("\nSUCCESS: All NEW gRPC queries are implemented in rs-sdk (or excluded) and documentation is up to date")
sys.exit(0)


Expand Down
152 changes: 152 additions & 0 deletions .github/workflows/wasm-sdk-documentation-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
name: Check WASM SDK Documentation

on:
workflow_dispatch:
pull_request:
paths:
- 'packages/wasm-sdk/index.html'
- 'packages/wasm-sdk/docs.html'
- 'packages/wasm-sdk/AI_REFERENCE.md'
- 'packages/wasm-sdk/docs_manifest.json'
- 'packages/wasm-sdk/generate_docs.py'
- 'packages/wasm-sdk/check_documentation.py'
- '.github/workflows/wasm-sdk-documentation-check.yml'
push:
branches:
- master
- 'v*-dev'
paths:
- 'packages/wasm-sdk/index.html'
- 'packages/wasm-sdk/docs.html'
- 'packages/wasm-sdk/AI_REFERENCE.md'
- 'packages/wasm-sdk/docs_manifest.json'
- 'packages/wasm-sdk/generate_docs.py'
- 'packages/wasm-sdk/check_documentation.py'
- '.github/workflows/wasm-sdk-documentation-check.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check-wasm-sdk-documentation:
name: Check WASM SDK Documentation
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Check documentation completeness
id: doc-check
working-directory: packages/wasm-sdk
run: |
# Run the documentation check
if python3 check_documentation.py; then
echo "status=success" >> $GITHUB_OUTPUT
else
echo "status=failure" >> $GITHUB_OUTPUT
fi

# Note: At this point, the documentation hasn't been regenerated yet,
# so this check will only detect if the PR already includes documentation changes
if git diff --quiet HEAD -- docs.html docs_manifest.json AI_REFERENCE.md; then
echo "docs_modified=false" >> $GITHUB_OUTPUT
else
echo "docs_modified=true" >> $GITHUB_OUTPUT
fi

- name: Upload documentation check report
if: always()
uses: actions/upload-artifact@v4
with:
name: documentation-check-report
path: packages/wasm-sdk/documentation-check-report.txt

- name: Comment PR
if: github.event_name == 'pull_request' && steps.doc-check.outputs.status == 'failure'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const reportPath = 'packages/wasm-sdk/documentation-check-report.txt';

if (fs.existsSync(reportPath)) {
const report = fs.readFileSync(reportPath, 'utf8');
const status = '${{ steps.doc-check.outputs.status }}' === 'success' ? '✅' : '❌';

// Find existing comment
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});

const botComment = comments.find(comment =>
comment.user.type === 'Bot' &&
comment.body.includes('WASM SDK Documentation Check')
);

const body = `### ${status} WASM SDK Documentation Check\n\n\`\`\`\n${report}\n\`\`\`\n\n**To fix documentation issues:**\n\`\`\`bash\ncd packages/wasm-sdk\npython3 generate_docs.py\n\`\`\``;

if (botComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: body
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: body
});
}
}

- name: Auto-update documentation (non-protected branches)
if: github.event_name == 'push' && !contains(github.ref, 'master') && !contains(github.ref, 'main') && steps.doc-check.outputs.status == 'failure'
working-directory: packages/wasm-sdk
run: |
# Generate updated documentation
python3 generate_docs.py
# Check if there are changes
if ! git diff --quiet docs.html docs_manifest.json AI_REFERENCE.md; then
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add docs.html docs_manifest.json AI_REFERENCE.md
git commit -m "chore: update WASM SDK documentation [skip ci]"
git push
fi

- name: Create documentation update PR (protected branches)
if: github.event_name == 'push' && (contains(github.ref, 'master') || contains(github.ref, 'main')) && steps.doc-check.outputs.status == 'failure'
uses: peter-evans/create-pull-request@v5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update action version to fix compatibility.

The peter-evans/create-pull-request@v5 action version is outdated and may not work with current GitHub Actions runners.

-        uses: peter-evans/create-pull-request@v5
+        uses: peter-evans/create-pull-request@v6
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v6
🧰 Tools
🪛 actionlint (1.7.7)

135-135: the runner of "peter-evans/create-pull-request@v5" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
In .github/workflows/wasm-sdk-documentation-check.yml at line 135, update the
version of the peter-evans/create-pull-request action from v5 to the latest
stable version to ensure compatibility with current GitHub Actions runners.
Replace the version tag with the newest release available on the action's
repository.

with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: update WASM SDK documentation"
title: "chore: update WASM SDK documentation"
body: |
This PR updates the WASM SDK documentation to match the current implementation.

Auto-generated by GitHub Actions.
branch: auto-update-wasm-docs-${{ github.run_number }}
base: ${{ github.ref_name }}
path: packages/wasm-sdk

- name: Fail if documentation is out of date
if: steps.doc-check.outputs.status == 'failure' && github.event_name == 'pull_request'
run: |
echo "Documentation is out of date. Please run 'python3 generate_docs.py' in packages/wasm-sdk/"
exit 1
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ packages/wasm-sdk/.cargo/
packages/wasm-sdk/pkg/
packages/wasm-sdk/dist/
packages/wasm-sdk/*.bak
packages/wasm-sdk/wasm_sdk.js
packages/wasm-sdk/wasm_sdk_bg.wasm
packages/wasm-sdk/documentation-check-report.txt
packages/wasm-sdk/extracted_definitions.json

# gRPC coverage report
grpc-coverage-report.txt
Expand Down
6 changes: 6 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ yarn configure:tests:network

**SDK** (`packages/js-dash-sdk`, `packages/rs-sdk`): Client libraries providing high-level interfaces for building applications on Dash Platform.

**WASM SDK** (`packages/wasm-sdk`): WebAssembly bindings for browser-based applications. See [AI_REFERENCE.md](packages/wasm-sdk/AI_REFERENCE.md) for comprehensive API documentation.

**Dashmate** (`packages/dashmate`): Node management tool for setting up and managing Dash Platform nodes.

### Data Contracts
Expand All @@ -114,6 +116,10 @@ Platform uses data contracts to define application data schemas:
2. **Cross-language Integration**: WASM bindings connect Rust and JavaScript code
3. **Local Development**: Docker Compose environment managed by dashmate
4. **Testing**: Comprehensive test suites at unit, integration, and e2e levels
5. **WASM SDK Development**:
- Build with `./build.sh` in `packages/wasm-sdk`
- Test with web interface at `index.html`
- Keep docs in sync: `python3 generate_docs.py`

### Important Patterns

Expand Down
1 change: 0 additions & 1 deletion packages/wasm-sdk/.gitignore

This file was deleted.

Loading
Loading