Crate stackmate[][src]

Expand description

A set of composite functions that uses rust-bitcoin & bdk and exposes a simpligied C interface to build descriptor based wallet applications. Refer to the structs in each module for return types.

Modules

Functions

Broadcasts a signed transaction to a remote node.

Builds a transaction for a given descriptor wallet. If sweep is set to true, amount value is ignored and will default to None. Set amount to 0 for sweep.

Checks if an extended public key is valid. Do not use the key source while checking an xpub i.e. remove [fingerprint/derivation/path/values] and only provide the xpub/tpub.

Compiles a policy into a descriptor of the specified script type. Use wpkh for a single signature segwit native wallet (default). Use wsh for a scripted segwit native wallet.

After using any other function, pass the output pointer into cstring_free to clear memory. Failure to do so can lead to memory bugs.

Decodes a PSBT and returns all outputs of the transaction and total size. “miner” is used in the ‘to’ field of an output to indicate fee.

Derives hardened child keys from a master xprv. Follows the BIP32 standard of m/purpose’/network’/account’. Network path is inferred from the master xprv.

Generates a mnemonic phrase of a given length. Defaults to 24 words. A master xprv is created from the mnemonic and passphrase.

Gets a new address for a descriptor wallet at a given index. Client must keep track of address indexes and ensure prevention of address reuse.

Gets the current network fee (in sats/vbyte) for a given confirmation target.

Creates a master xprv given a mnemonic and passphrase.

Signs a PSBT with a descriptor. Can only be used with descriptors containing private key(s).

Syncs to a remote node and fetches balance of a descriptor wallet.

Syncs to a remote node and fetches history of a descriptor wallet.