Skip to main content

Crate fedimint_ln_client

Crate fedimint_ln_client 

Source

Re-exportsΒ§

pub use crate::error::ClaimIncomingContractError;
pub use crate::error::CreateBolt11InvoiceError;
pub use crate::error::GatewaySelectionError;
pub use crate::error::LnSubscribeError;
pub use crate::error::PayBolt11InvoiceError;
pub use crate::error::PaymentInfoError;
pub use crate::error::ReclaimLnReceiveError;
pub use crate::error::SpendableAmountError;
pub use fedimint_ln_common as common;

ModulesΒ§

api
cli
db
deprecated_variant_hack πŸ”’
This is a hack to allow us to use the deprecated variant in the database without the serde derived implementation throwing warnings.
error
Error types of the lightning client.
events
incoming
Incoming State Machine
pay
receive
recurring
Implements recurring payment codes (e.g. LNURL, BOLT12)

StructsΒ§

CreateBolt11InvoiceForUserTweakedRequest πŸ”’
CreateBolt11InvoiceRequest πŸ”’
GetGatewayRequest πŸ”’
LightningClientContext
LightningClientInit
LightningClientModule
Client side lightning module
LightningOperationMeta
LightningOperationMetaPay
MockGatewayConnection
OutgoingLightningPayment
PayBolt11InvoiceRequest πŸ”’
PayInvoiceResponse
PayLightningAddressRequest πŸ”’
RealGatewayConnection
ReclaimLnReceiveRequest πŸ”’
ScanReceiveForUserTweakedRequest πŸ”’
SelectAvailableGatewayRequest
SubscribeInternalPayRequest πŸ”’
SubscribeLnClaimRequest πŸ”’
SubscribeLnPayRequest πŸ”’
SubscribeLnReceiveRequest πŸ”’

EnumsΒ§

GatewayStatus
InternalPayState
The high-level state of an pay operation internal to the federation, started with LightningClientModule::pay_bolt11_invoice.
LightningChildKeys
LightningClientStateMachines
LightningOperationMetaVariant
LightningPaymentOutcome
LnPayState
The high-level state of a pay operation over lightning, started with LightningClientModule::pay_bolt11_invoice.
LnReceiveState
The high-level state of a reissue operation started with LightningClientModule::create_bolt11_invoice.
PayType
PaymentInfo
A payment target parsed from user input: either a bolt11 invoice or the pay parameters resolved from an LNURL/lightning address.
ReceivingKey
Where to receive the payment to, either to ourselves or to another user
RpcError πŸ”’
A failure of an ln module RPC request.

ConstantsΒ§

DEFAULT_INVOICE_EXPIRY_TIME πŸ”’
MAX_OUTGOING_CONTRACT_TIMELOCK_DELTA πŸ”’
Largest number of blocks an outgoing contract’s timelock may lie ahead of the current block count, matching the EXPIRATION_DELTA_LIMIT of the fedimint-lnv2-client. The payee picks part of the delta through the invoice’s min_final_cltv_expiry_delta, so without a bound they could push the payer’s refund out arbitrarily far or overflow the timelock.
OUTGOING_LN_CONTRACT_TIMELOCK πŸ”’
Number of blocks until outgoing lightning contracts times out and user client can get refund

TraitsΒ§

GatewayConnection

FunctionsΒ§

create_incoming_contract_output
fetch_and_validate_offer πŸ”’
get_invoice
Get LN invoice with given settings
invoice_has_internal_payment_markers πŸ”’
invoice_routes_back_to_federation πŸ”’
set_payment_result πŸ”’
tweak_user_key
Tweak a user key with an index, this is used to generate a new key for each invoice. This is done to not be able to link invoices to the same user.
tweak_user_secret_key πŸ”’
Tweak a secret key with an index, this is used to claim an unspent incoming contract.