Crate kaspa_consensus_client

Source
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 Error enum used by this crate
numeric
This module implements transaction-related primitives for JSON serialization where all large integer values (u64) are serialized to JSON using serde and can exceed the largest integer value representable by the JavaScript number type. (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
Result type alias that is bound to the Error type 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§

IUtxoEntry
WASM type representing a UTXO entry interface (a UTXO-like object)
IUtxoEntryArray
WASM type representing an array of UTXO entries (i.e. IUtxoEntry[])
SerializableTransactionT
WASM (TypeScript) representation of the ISerializableTransaction interface.
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
TransactionInner
Inner type used by Transaction
TransactionInput
Represents a Kaspa transaction input @category Consensus
TransactionInputArrayAsArgT
WASM (TypeScript) type representing ITransactionInput[] | TransactionInput[] @category Consensus
TransactionInputArrayAsResultT
WASM (TypeScript) type representing TransactionInput[] @category Consensus
TransactionInputInner
Inner type used by TransactionInput
TransactionInputT
WASM (TypeScript) type representing ITransactionInput | TransactionInput @category Consensus
TransactionOutpoint
Represents a Kaspa transaction outpoint. NOTE: This struct is immutable - to create a custom outpoint use the TransactionOutpoint::new constructor. (in JavaScript use new TransactionOutpoint(transactionId, index)). @category Consensus
TransactionOutpointInner
Inner type used by TransactionOutpoint
TransactionOutput
Represents a Kaspad transaction output @category Consensus
TransactionOutputArrayAsArgT
WASM (TypeScript) type representing ITransactionOutput[] | TransactionOutput[] @category Consensus
TransactionOutputArrayAsResultT
WASM (TypeScript) type representing TransactionOutput[] @category Consensus
TransactionOutputInner
Inner type used by TransactionOutput
TransactionOutputT
WASM (TypeScript) type representing ITransactionOutput | TransactionOutput @category Consensus
TransactionT
WASM (TypeScript) type representing ITransaction | Transaction @category Consensus
UtxoEntries
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 UtxoEntryReference struct. This data structure is used internally by the framework, but is exposed for convenience. Please consider using UtxoContext instead. @category Wallet SDK
UtxoEntry
UtxoEntry struct represents a client-side UTXO entry.
UtxoEntryReference
Arc reference to a UtxoEntry used by the wallet subsystems.
UtxoEntryReferenceArrayT
WASM type representing an array of UtxoEntryReference objects (i.e. UtxoEntryReference[])

Traits§

TryIntoUtxoEntryReferences
An extension trait to convert a JS value into a vec of UTXO entry references.

Type Aliases§

UtxoEntryId
A UTXO entry Id is a unique identifier for a UTXO entry defined by the txid+output_index.