Expand description
§lipa-lightning-lib (aka 3L)
This crate implements all the main business logic of the lipa wallet.
Most functionality can be accessed by creating an instance of LightningNode
and using its methods.
Structs§
- A sat amount accompanied by its fiat value in a specific fiat currency
- Calculate
LspFee Response Deprecated The type returned byLightningNode::calculate_lsp_fee
. - The type returned by
Swap::calculate_lsp_fee_for_amount
andLightning::calculate_lsp_fee_for_amount
. - Information about a closed channel.
- Information about the channels of the node
- Information about a wallet clearance operation as returned by
LightningNode::prepare_clear_wallet
. - Exchange rate as sats per major unit accompanied by the specific currency code and time the rate was updated at.
- Information about a failed swap
- Information about a fiat top-up registration
- A fiat value accompanied by the exchange rate that was used to get it.
- Information about an incoming payment.
- Includes metadata about an invoice the user created.
- Information embedded in an invoice
- The main class/struct of this library. Constructing an instance will initiate the Lightning node and run it in the background. As long as an instance of
LightningNode
is held, the node will continue to run in the background. Dropping the instance will start a deinit process. - An object that holds all configuration needed to start a LightningNode instance.
- Information about all pending and only requested completed activities.
- Information about an LNURL-pay.
- Information about an LNURL-withdraw.
- The fee charged by the Lightning Service Provider (LSP) for opening a channel with the node. This fee is being charged at the time of the channel creation. The LSP simply subtracts this fee from an incoming payment (if this incoming payment leads to a channel creation).
- Information about the Lightning node running in the background
- A configuration struct used to enable/disable processing of different payloads in
handle_notification
. - Information on a funds offer that can be claimed using
crate::LightningNode::request_offer_collection
. - Contains the fee information for the options to resolve funds that have moved on-chain.
- Information about an outgoing payment.
- Information on the limits imposed on the next receiving payment
- Information about a payment.
- Includes metadata about a payment the client received in any way.
- Information on the limits imposed on the next receiving payment
- Information the resolution of a failed swap.
- Information about a successful reverse swap.
- An object that holds necessary secrets. Should be dealt with carefully and never be logged.
- Information about a generated swap address
- Information about a pending or successful swap.
- Information about fees related to swap of own on-chain funds back to lightning.
- Information the resolution of a failed swap.
- An object that holds timezone configuration values necessary for 3L to do timestamp annotation. These values get tied together with every timestamp persisted in the local payment database.
- A UTC timestamp accompanied by the ID of the timezone on which it was recorded and the respective UTC offset.
Enums§
- Indicates the different service health check statuses.
- Decoded data that can be obtained using
LightningNode::decode_data
. - Invoice affordability returned by
LightningNode::get_invoice_affordability
. - A code that specifies the LnUrlPayError that occurred.
- Indicates the max routing fee mode used to restrict fees of a payment of a given size
- A notification to be displayed to the user.
- A code that specifies the NotificationHandlingError that occurred.
- Enum representing possible errors why parsing could fail.
- A code that specifies the PayError that occurred.
- Payment affordability returned by
Lightning::determine_payment_affordability
. - Represent the result of comparision of a value with a given range.
- User-friendly representation of an outgoing payment’s recipient.
- The possible statuses of a reverse swap, from the Breez SDK perspective.
- A code that specifies the RuntimeError that occurred
- Error returned by [crate::breez_services::BreezServices::receive_onchain] and [crate::breez_services::BreezServices::buy_bitcoin]
Traits§
- Asynchronous events that the consumer of this library might be interested in handling are delivered through this interface. These callbacks will only be called once per event.
Functions§
- Accept lipa’s terms and conditions. Should be called before instantiating a
LightningNode
for the first time. - Generate a new mnemonic with an optional passphrase. Provide an empty string to use no passphrase.
- Allows checking if certain terms and conditions have been accepted by the user.
- Handles a notification.
- Generate a Secret object (containing the seed). Provide an empty string to use no passphrase.
- Try to parse the provided string as a lightning address, return
ParseError
precisely indicating why parsing failed. - Performs a recovery procedure by fetching necessary data from remote storage. It should and can only be called on a fresh install of the app, if the user wants to recover a previously created wallet.
- Return a list of valid BIP-39 English words starting with the prefix. Calling this function with empty prefix will return the full list of BIP-39 words.
Type Aliases§
- An error associated with a specific PocketOffer. Can be temporary, indicating there was an issue with a previous withdrawal attempt and it can be retried, or it can be permanent.