Expand description
§Client-side consensus primitives.
This crate offers client-side primitives mirroring the consensus layer of the Kaspa p2p node.
It declares structs such as Transaction, TransactionInput, TransactionOutput,
TransactionOutpoint, UtxoEntry, and UtxoEntryReference
that are used by the Wallet subsystem as well as WASM bindings.
Unlike raw consensus primitives (used for high-performance DAG processing) the primitives
offered in this crate are designed to be used in client-side applications. Their internal
data is typically wrapped into Arc<Mutex<T>>, allowing for easy sharing between
async / threaded environments and WASM bindings.
Modules§
- error
- The
Errorenum used by this crate - numeric
- This module implements transaction-related primitives for JSON serialization
where all large integer values (
u64) are serialized to JSON usingserdeand can exceed the largest integer value representable by the JavaScriptnumbertype. (i.e. transactions serialized using this module can not be deserialized in JavaScript but may be deserialized in other JSON-capable environments that support large integers) - result
Resulttype alias that is bound to theErrortype from this crate.- string
- This module implements transaction-related primitives for JSON serialization
where all large integer values (
u64) are serialized to and from JSON as strings.
Structs§
- IUtxo
Entry - WASM type representing a UTXO entry interface (a UTXO-like object)
- IUtxo
Entry Array - WASM type representing an array of UTXO entries (i.e.
IUtxoEntry[]) - Serializable
TransactionT - WASM (TypeScript) representation of the
ISerializableTransactioninterface. - Transaction
- Represents a Kaspa transaction. This is an artificial construct that includes additional transaction-related data such as additional data from UTXOs used by transaction inputs. @category Consensus
- Transaction
Inner - Inner type used by
Transaction - Transaction
Input - Represents a Kaspa transaction input @category Consensus
- Transaction
Input Array AsArgT - WASM (TypeScript) type representing
ITransactionInput[] | TransactionInput[]@category Consensus - Transaction
Input Array AsResultT - WASM (TypeScript) type representing
TransactionInput[]@category Consensus - Transaction
Input Inner - Inner type used by
TransactionInput - Transaction
InputT - WASM (TypeScript) type representing
ITransactionInput | TransactionInput@category Consensus - Transaction
Outpoint - Represents a Kaspa transaction outpoint.
NOTE: This struct is immutable - to create a custom outpoint
use the
TransactionOutpoint::newconstructor. (in JavaScript usenew TransactionOutpoint(transactionId, index)). @category Consensus - Transaction
Outpoint Inner - Inner type used by
TransactionOutpoint - Transaction
Output - Represents a Kaspad transaction output @category Consensus
- Transaction
Output Array AsArgT - WASM (TypeScript) type representing
ITransactionOutput[] | TransactionOutput[]@category Consensus - Transaction
Output Array AsResultT - WASM (TypeScript) type representing
TransactionOutput[]@category Consensus - Transaction
Output Inner - Inner type used by
TransactionOutput - Transaction
OutputT - WASM (TypeScript) type representing
ITransactionOutput | TransactionOutput@category Consensus - TransactionT
- WASM (TypeScript) type representing
ITransaction | Transaction@category Consensus - Utxo
Entries - A simple collection of UTXO entries. This struct is used to
retain a set of UTXO entries in the WASM memory for faster
processing. This struct keeps a list of entries represented
by
UtxoEntryReferencestruct. This data structure is used internally by the framework, but is exposed for convenience. Please consider usingUtxoContextinstead. @category Wallet SDK - Utxo
Entry UtxoEntrystruct represents a client-side UTXO entry.- Utxo
Entry Reference Arcreference to aUtxoEntryused by the wallet subsystems.- Utxo
Entry Reference ArrayT - WASM type representing an array of
UtxoEntryReferenceobjects (i.e.UtxoEntryReference[])
Traits§
- TryInto
Utxo Entry References - An extension trait to convert a JS value into a vec of UTXO entry references.
Type Aliases§
- Utxo
Entry Id - A UTXO entry Id is a unique identifier for a UTXO entry defined by the
txid+output_index.