Crate kaspa_wallet_core
source ·Expand description
Kaspa Wallet Core - Multi-platform Rust framework for Kaspa Wallet.
This framework provides a series of APIs and primitives to simplify building applications that interface with the Kaspa p2p network.
Included are low-level primitives
such as UtxoProcessor
and UtxoContext
that provide
various levels of automation as well as higher-level
APIs such as Wallet
,
Account
(managed via
WalletApi
trait)
that offer a fully-featured wallet implementation
backed by a multi-platform data storage layer capable of
storing wallet data on a local file-system as well as
within the browser environment.
The wallet framework also includes transaction
Generator
that can be used to generate transactions from a set of
UTXO entries. The generator can be used to create
simple transactions as well as batch transactions
comprised of multiple chained transactions. Batch
transactions (also known as compound transactions)
are needed when the total number of inputs required
to satisfy the requested amount exceeds the maximum
allowed transaction mass.
The framework can operate within native Rust applications as well as within the NodeJS and browser environments via WASM32.
For JavaScript / TypeScript environments, there are two available NPM modules:
The kaspa-wasm
module is a pure WASM32 module that includes
the entire wallet framework, but does not support RPC due to an absence
of a native WebSocket in NodeJs environment, while
the kaspa
module includes isomorphic-ws
dependency simulating
the W3C WebSocket and thus supports RPC.
JavaScript examples for using this framework can be found at: https://github.com/kaspanet/rusty-kaspa/tree/master/wasm/nodejs
For pre-built browser-compatible WASM32 redistributables of this framework please see the releases section of the Rusty Kaspa repository at https://github.com/kaspanet/rusty-kaspa/releases.
Modules§
- Generic wallet
Account
trait implementation used by different types of accounts. - Wallet API module that provides a unified interface for all wallet operations.
- Module handling bip32 address derivation (bip32+bip44 and legacy accounts)
- Deterministic byte sequence generation (used by Account ids).
- Wallet data encryption module.
- Error types used by the wallet framework.
- Events emitted by the wallet framework. This includes various wallet, account and transaction events as well as state and sync events produced by the client RPC and the Kaspa node monitoring subsystems.
- Wallet Account factories (Account type registration and creation).
- Message signing and verification functions.
- A module which is typically glob imported. Contains most commonly used imports.
- RPC adaptor struct use by the Wallet framework.
- Secret container for sensitive data. Performs zeroization on drop.
- Helpers for binary serialization and deserialization used by the storage subsystem.
- Multi-platform storage for wallet and application settings.
- Wallet data storage subsystem.
- Transaction generation and processing primitives.
- Type aliases used by the wallet framework.
- Kaspa value formatting and parsing utilities.
- UTXO handling primitives.
- Kaspa wallet runtime implementation.
- WASM32 bindings for the wallet framework components.
Functions§
- Returns the version of the Wallet framework.