WASM SDK Debug Tool

qwizzie

Well-known member
Requirements :

* Platform & Rust -> https://github.com/dashpay/platform
* Compiled WASM-SDK (complete pkg folder) -> https://github.com/dashpay/platform/tree/v2.1-dev/packages/wasm-sdk
* service-worker-simple.js -> https://github.com/dashpay/platform/tree/v2.1-dev/packages/wasm-sdk
* api-definitions.json -> https://github.com/dashpay/platform/tree/v2.1-dev/packages/wasm-sdk
* index.css -> https://github.com/dashpay/platform/tree/v2.1-dev/packages/wasm-sdk

Instructions

In same folder have :

pkg folder (this needs to contain your compiled wasm-sdk files)
service-worker-simple.js
api-definitions.json
index.css
index.html (extracted from wasm-sdk-debugging-tool.zip)

I use python proxy server (http://localhost: portnumber) and CORS-FLASK app.py with dapi endpoints rotation
to access my index.html

Once loaded you can do the following : Load WASM Module - Inspect Exports - Find SDK Functions - Attempt SDK Init

Knipsel.JPG

credits : Claude.AI

Press F12 and you will see the results of each pressed option in Console.
This tool came in handy for me during troubleshooting with AI, when i was trying to get a standalone Wasm-SDK init going
with a link to external script.

Note :

useTrusted flag and the associated prefetch_trusted_quorums logic is not used in this debug tool
also you will not have a defined __wbg_ptr: {__wbg_ptr: undefined}.
To get all that you need to use the index.html from https://github.com/dashpay/platform/tree/v2.1-dev/packages/wasm-sdk as i have not found a way to strip index.htlm in such a way that it can maintain its useTrusted flag + associated prefetch_trusted_quorums + a defined __wbg_ptr:
 

Attachments

Last edited:
Back
Top