Commit graph

38 commits

Author SHA1 Message Date
Ignacio Porte
bb14ecd7ec feat: pay BOLT 12 offers via BIP-353 human-readable names
Resolves a name like `alice@example.com` to a BOLT 12 offer over DoH
and pays it. DNSSEC is validated locally, as required by BIP-353.
Self-resolution only for now; peer-based resolution via BLIP-32 will
follow. Exposes a `PayHumanReadableAddress` gRPC endpoint and a
`lndk-cli pay-hrn` command.
2026-04-18 19:06:00 -04:00
orbitalturtle
e0b23440a3
Merge pull request #253 from vincenzopalazzo/claude/hardcore-mclaren
fix: reject offers with offer_amount=0 per BOLT 12
2026-04-14 14:55:45 -05:00
Vincenzo Palazzo
1b28412f6a fix: reject offers with offer_amount=0 per BOLT 12 spec
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>
2026-04-14 07:48:12 +02:00
Orbital
aef4d27b60
fix: resolve clippy warnings 2026-03-27 17:25:35 -05:00
Maurice Poirrier
406b2a08f9
Merge pull request #244 from benthecarman/positial-args
refactor: require named arguments for CreateOffer CLI options
2025-10-01 14:56:58 +02:00
benthecarman
4d22162385
refactor: require named arguments for CreateOffer CLI options
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.
2025-10-01 08:07:20 +02:00
Maurice
12be7cae75
cli: add docs for macaroon and grpc options 2025-09-30 15:54:43 +02:00
Ignacio Porte
9a214bda78 chore: replace nested LndStatus with String messages in error enums
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.
2025-09-26 12:51:15 -03:00
Ignacio Porte
efe5688552 refactor(cli): extract repeated gRPC client setup and metadata handling
Extracted duplicated gRPC channel creation, client authentication, and metadata handling code into reusable functions to reduce code duplication and improve error handling.
2025-09-26 12:45:46 -03:00
Ignacio Porte
e990a6cde2 chore: use machine error codes in cli
Unify error handling across CLI commands by introducing consistent error message formatting and using machine-readable codes
2025-09-26 12:45:46 -03:00
Maurice Poirrier Chuden
13b60cbf36
server+cli: expose create_offer
Expose a way to create offers with amount, quantity, issuer,
exipiry and description parameters.
2025-09-05 08:37:20 -04:00
Ignacio Porte
3d0e6e353d cli: test fees args validations 2025-08-12 01:26:05 -04:00
Ignacio Porte
5681b1124b cli: add fees limits args to pay_invoice and pay_offer 2025-08-11 23:01:09 -04:00
Maurice Poirrier Chuden
c93b5055c9
offers: refactor code into a modular structure
Split lndk_offers.rs into a proper module structure with separate files:
- handler:      Defines entry point to get and pay bolt12 invoices and
                pay offers (does both). Also actions whenever a offer
                related onion message arrives to lndk.
- lnd_requests: Defines parsing and request to the LND node. Previously
                some were were bounded to the lndk_offer. Now they are
                separated and mostly use traits for easy mocking.
- client_impls: Defines client traits to be used on requests. Also adds
                mocks to them exposed for use in other parts of the
		module.
- parse:        General bolt12 offers parsing methods.
- mod:          General module, exposes Errors and different modules.

This separation improves maintainability and code organization while keeping
the same behavior.
2025-07-08 09:35:40 -07:00
Maurice Poirrier Chuden
9005503c88
cli: fix decode-invoice encoding docs
Changes cli decode-invoice from bech32-encoded
string to hex-encoded. We expect hex-encoded in the
current implementation.
2025-06-17 07:13:57 -04:00
Maurice Poirrier Chuden
a3b96d14a4
cli: add tests reading certs and args
this commits separates logic on cli to read certs from arguments and test edge cases.
2025-04-04 09:32:08 -03:00
Turtle
1fcad30708
cli: look in correct directory for tls cert 2025-01-14 12:23:31 -06:00
Maurice Poirrier Chuden
856eb68c1f
multi: Configurable timeout for receiving invoice
This commit introduces a parameter in the RPC to allow users to modify
the timeout when receiving an invoice from the offer creator.

Additionally, it adds a configuration parameter for the server to set
up a default value if no parameter is used.

The default timeout value is also decreased from 100 seconds to 20
seconds.
2024-08-09 22:41:11 +02:00
benthecarman
6235886ae3
Add cert path option for cli 2024-08-08 21:56:46 -05:00
Orbital
f499cdd602
multi: allow passing in a payer note 2024-07-31 16:29:43 -05:00
Orbital
5ae34e1597
cli: don't pass in full cli args to read function 2024-07-22 19:29:15 -05:00
Tom Kirkpatrick
eff37bc02f
server+cli: add DecodeInvoice command 2024-07-22 15:37:20 -05:00
Orbital
737438a4bb
cli: add get_invoice/pay_invoice commands
Co-authored-by: Maurice Poirrier <29377393+mauricepoirrier@users.noreply.github.com>
2024-07-22 15:36:37 -05:00
Orbital
bb6e79b735
cli: split tls/macaroon processing into separate functions
Co-authored-by: Maurice Poirrier <29377393+mauricepoirrier@users.noreply.github.com>
2024-07-22 15:35:24 -05:00
Orbital
dd98a219a9
cli: return error code on error 2024-06-24 00:21:51 -05:00
Orbital
15bbe3fcab
cli: add option to pass in LNDK tls cert directly
Some users would rather pass in the TLS cert directly as a pem-encoded string,
rather than pull it from a file.
2024-06-18 23:33:33 -05:00
Orbital
15220f7cfe
cli: TLS connection with server 2024-06-18 23:33:32 -05:00
Orbital
0d1a417aae
multi: format comments to 100 width 2024-06-07 21:50:38 -05:00
Orbital
eb321f384c
main: add grpc server config options
Co-authored-by: Tom <tom@strike.me>
2024-05-29 22:58:29 -05:00
Orbital
ed7a8779c1
cli: update CLI to connect to new gRPC server
This updates the CLI to connect to the LNDK gRPC server in order to make API
calls. We add the necessary macaroon metadata to each request. In addition,
we remove the cert and address flag options because we no longer require
passing in an LND certificate and address to connect to LND.
2024-05-29 22:54:00 -05:00
Orbital
d858e0983e
multi: delete started channel
With the grpc server, we don't need to check whether the onion messenger has
started before we pay an offer - we know it's already running.
2024-05-28 21:09:14 -05:00
Orbital
94b6b719af
main+lib: move logger out of run method
We move logger setup into main, so we're able to access the logger when we
start up the server.
2024-05-28 21:09:14 -05:00
Orbital
9904ee0f9c
lib: move and Arc-ify OffersHandler
This commit Arc-ifies the reference to OffersHandler, which is necessary
because once we set up the grpc server, we'll need a second thread-safe
reference to it.
2024-05-28 21:09:13 -05:00
Orbital
ef07ebbf35
cli: add option to pass cert/macaroon in directly to cli 2024-05-21 14:23:25 -05:00
Orbital
53ff36722f
cli: default macaroon path should depend on the specified network 2024-05-21 14:23:25 -05:00
Orbital
0ffdeaace1
cli: Add cli command to pay offer 2024-03-28 14:10:55 -05:00
Orbital
bcb76c0e76
cli: add global arguments for connecting to lnd 2024-03-28 13:58:07 -05:00
Orbital
97de626cf5
Add a basic cli binary 2023-11-14 16:43:21 -06:00