Crate lwk_common

Crate lwk_common 

Source
Expand description

A crate containing common code used in multiple other crate in the workspace, such as:

  • Utils to inspect a PSET: get the net effect of a PSET on a given wallet pset_balance(), or get how many signatures are missing , and which signers should provide them pset_signatures().
  • Signer trait: contains the methods to be implemented by a signer such as signing a pset or returning an xpub

To avoid circular dependencies this crate must not depend on other crate of the workspace

Re-exports§

pub use crate::precision::Precision;

Modules§

electrum_ssl
The sockets of the Blockstream Liquid Electrum servers.
precision
Module to handle the formattings of amount of assets given its precision.

Structs§

Address
A wrapper around elements::Address that checks the network and provides a more user-friendly parse errors
Amp0SignerData
Signer information necessary for full login to AMP0
Balance
Wallet balance wrapper
InvalidBipVariant
The error type returned by Bip::from_str
InvalidBlindingKeyVariant
The error type returned by DescriptorBlindingKey::from_str
InvalidKeyOriginXpub
The error type returned by keyorigin_xpub_from_str
InvalidMultisigVariant
The variant of the multisig descriptor
InvalidSinglesigVariant
The error type returned by Singlesig::from_str
Issuance
The details of an issuance or reissuance
PsetBalance
The details regarding balance and amounts in a PSET
PsetDetails
The details of a Partially Signed Elements Transaction:
PsetSignatures
The details of the signatures in a PSET
Recipient
The recipient (an output not belonging to the wallet) in a PSET
SignedBalance
A signed balance of assets, to represent a balance with negative values such as the results of a transactions from the perspective of a wallet.

Enums§

AddressParseError
The error type returned by Address::parse
Bip
The variant of the descriptor like specified in the bips
DescriptorBlindingKey
Some descriptor blinding keys variant
Error
Multisig
The variant of the multisig descriptor
Network
The network of the elements blockchain.
QrError
Singlesig
The variant of the singlesig descriptor

Traits§

Amp0Signer
AMP0 signer methods
Signer
A trait defining methods of signers, providing blanket implementations for some methods.
Stream
A trait for async read/write operations used by hardware wallet connections

Functions§

address_to_text_qr
Convert the given address in a string representing a QR code to be consumed from a terminal
address_to_uri_qr
Convert the given elements address to an image uri
burn_script
Create the same burn script that Elements Core wallet creates
derive_blinding_key
Derive the blinding secret key from a confidential descriptor and a script pubkey.
derive_script_pubkey
Derive the script pubkey from a confidential descriptor and an index.
is_provably_segwit
Whether a script pubkey is provably segwit
keyorigin_xpub_from_str
Parse a keyorigin xpub from a string
multisig_desc
Generate a multisig descriptor with the given parameters
pset_balance
Return the net balance of a PSET from the perspective of the given descriptor. It returns also the fee and the recipients (external receivers) of the PSET.
pset_debug
Create a debug string of a PSET, but remove new lines on number arrays.
pset_issuances
Return the issuances of a PSET, for each input return an Issuance but the struct must be checked with Issuance::is_issuance if it’s a real issuance or reissuance.
pset_signatures
Return the signatures of a PSET, for each input return a PsetSignatures which includes a list of signatures that are available and a list of signatures that are missing.
singlesig_desc
Generate a singlesig descriptor with the given parameters