Validate that offer_amount is non-zero when parsing bolt12 offers,
rejecting malformed offers early per the BOLT 12 specification. Also
update CLI help text to note the amount requirement.
Closes#251.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit updates README and docs folder that not updated on
how can an offer be made and how LNDK now can use other data path
for storing logs and TLS certs.
Change all CreateOffer command arguments to use long-form flags (--amount,
--description, --issuer, --expiry, --quantity) instead of positional
arguments. This is needed otherwise you cannot for example create an
offer with a quantity of Some(0), without having to specify all the
other arguments because they were positional.
Replace LndStatus variants with String in OfferError and LndError enums, updating all error handling to extract message from LndStatus before converting to String. This simplifies error handling and provides cleaner error messages to users.
Extracted duplicated gRPC channel creation, client authentication, and metadata handling code into reusable functions to reduce code duplication and improve error handling.
This commit adds an integration test for checking the pay offer
feature using 3 available blinded paths, which nodes support onion messages
and are connected to more channels.
The current approach uses random peers. These random peers may be
temporary connections, so that if someone tries to pay and offer, the
selected peers may not be connected anymore, and the payment will fail.
Instead of choosing random peers, this commit will select public
open channels, creating long-lived offers. It tries to choose three
different channels at most. In order for these channels to be valid, the node
has to have onion support, and the node has to be connect to more public
channels. This new logic is only for creating offers.
The current logic of choosing random peers is better for outgoing payments
and remains as such.
If the `connect_to_peer` task fails somehow, it won't retry the connection
probably missing the connection to the peer. Therefore, this commit adds
a exponential back off strategy for the retries of `connect_to_peer`.
Mine and confirm channel to LND one by one instead of batching to
ensure all channels are open when creating the blinded path and
then closing channels.
LND force close channels when wallet is not in sync with the
blockchain.
Replace custom JSON error info format with tonic_types ErrorDetails. Add missing import for google/rpc/error_details.proto in lndkrpc.proto to enable proper decoding of ErrorInfo messages in grpcurl and other clients.
Create new LndError enum with ConnectError, NetworkParseError,
NetworkNotConnected, and ServiceUnavailable variants to provide
structured error handling for LND operations. Replace ad-hoc error
handling in server.rs with proper error types and gRPC status
mapping, improving error consistency across the codebase.
Move TLS certificate generation, reading, and related utilities from
server.rs to main.rs where they are actually used. This improves
separation of concerns by keeping application startup logic in main
and focusing server.rs on gRPC service implementation.