Skip to main content

Crate lexe_common

Crate lexe_common 

Source
Expand description

lexe-common contains types and functionality shared between most Lexe crates.

Modules§

api
API definitions, errors, clients, and structs sent across the wire.
byte_str
tokio::Bytes but must contain a string.
constants
Application-level constants.
dotenv
dotenvy extensions.
env
DeployEnv.
ln
Bitcoin / Lightning Lexe newtypes which can’t go in lexe-ln Bitcoin / Lightning Lexe newtypes which have to be in lexe-common for some reason, likely because they are referenced in an API definition.
net
Networking utilities.
or_env
OrEnvExt utility trait. Use OrEnvExt when you have a cli arg (e.g. db_url: Option<String>) that can also be set by a “fallback” env variable (e.g. $DATABASE_URL). Then, when initializing the args, just use db_url.or_env_mut("DATABASE_URL")?.
releases
Types related to releases.json.
rng
Random number generation. Lexe Crng compatibility hacks to support LDK’s EntropySource.
root_seed
RootSeed.
secp256k1_ctx
Global Secp256k1 context
time
TimestampMs and DisplayMs.

Macros§

btc
Shorthand macro for Amount::try_from_btc(dec!(___)).unwrap()
debug_panic_release_log
panic!(..)s in debug mode, tracing::error!(..)s in release mode
msat
Shorthand macro for Amount::from_msat(___)
sat
Shorthand macro for Amount::from_sats_u32(___)

Structs§

Secret
Wrapper type for values that contains secrets, which attempts to limit accidental exposure and ensure secrets are wiped from memory when dropped. (e.g. passwords, cryptographic keys, access tokens or other credentials)

Traits§

ByteArray
A trait for types represented in memory as a byte array. Should NOT be implemented for types that require validation of the byte array contents.
ExposeSecret
Expose a reference to an inner secret
RefCast
Safely cast &T to &U where the struct U contains a single field of type T.

Functions§

default_lexe_data_dir
Returns the default Lexe data directory (~/.lexe).

Derive Macros§

RefCast
Derive the RefCast trait.