Introduction
This documentation covers Kaspa WASM SDK - Rust infrastructure (Rusty Kaspa) WASM bindings that allow Rust code to be used from within JavaScript/TypeScript environments.
Please contribute! This mdbook
is very easy to edit. If you would like to suggest any changes or add anything, please check the Contributing page.
Technologies
This project is built using multi-platform Rust crates (libraries). The Rust framework is exposed to JavaScript via WASM, while the Rust framework itself can be built to run on any native platform (i.e. for Windows, Linux and MacOS).
WASM32 is compatible with all major browsers, Node.js as well as environments such as NWJS and Electron. It is also compatible with Chrome Extension manifest version 3, which allows it to be used in Chrome browser extensions.
WASM SDK
This WASM SDK is generated directly from the Rusty Kaspa codebase, where Rust functions are compiled into WebAssembly and then are offered in the JavaScript or TypeScript environments as native JavaScript functions.
Since the WASM SDK has an integrated WebSocket support, it offers RPC connectivity turning all RPC calls into async function calls in JavaScript (in Rust these functions are also async).
The WASM SDK offers bindings for Transaction generation, address management, transaction signing as well as various helper classes for UTXO management.
Documentation
TypeScript and Rust API documentation is available at the following URLs:
- Rust documentation (Rustdoc)
- TypeScript documentation (TypeDoc is built for development releases)
Discord
You can find help on the Kaspa Discord server, in the #development
channel.
Redistributables
WASM redistributables are available prebuilt for web browsers and for nodejs. The entire framework can also be built from Rusty Kaspa sources (into WASM) or used within Rust directly for Rust-based application integration.
You can currently download the latest version of the WASM SDK from: https://aspectron.com/en/projects/kaspa-wasm.html
Development releases
Building from source & examples
Additional WASM SDK information can be found in the WASM SDK README
Git
This SDK is a part of a larger Rusty Kaspa framework available at https://github.com/kaspanet/rusty-kaspa
The following crates implement key functionality exposed by this SDK:
- Kaspa Consensus Core: https://github.com/kaspanet/rusty-kaspa/tree/master/consensus/core/src
- WASM SDK: https://github.com/kaspanet/rusty-kaspa/tree/master/wasm
- Wallet Core: https://github.com/kaspanet/rusty-kaspa/tree/master/wallet/core/src
- RPC Client: https://github.com/kaspanet/rusty-kaspa/tree/master/rpc/wrpc/client/src