24 releases (8 breaking)

0.9.0 Nov 5, 2024
0.7.0 Sep 16, 2024
0.6.0 Jul 19, 2024
0.4.1 Jan 27, 2024
0.2.0 Mar 14, 2023

#1 in #lnurl

Download history 590/week @ 2024-09-25 372/week @ 2024-10-02 418/week @ 2024-10-09 600/week @ 2024-10-16 684/week @ 2024-10-23 639/week @ 2024-10-30 710/week @ 2024-11-06 632/week @ 2024-11-13 580/week @ 2024-11-20 407/week @ 2024-11-27 420/week @ 2024-12-04 815/week @ 2024-12-11 370/week @ 2024-12-18 49/week @ 2024-12-25 304/week @ 2025-01-01 302/week @ 2025-01-08

1,103 downloads per month
Used in 18 crates (10 directly)

MIT license

52KB
1K SLoC

lnurl-rs

MIT licensed lnurl-rs on crates.io lnurl-s on docs.rs

A rust implementation of LNURL. Supports plaintext, TLS and Onion servers. Blocking or async. WASM enabled.

Supported

  • lnurl-auth
  • lnurl-pay
  • lightning-address
  • lnurl-withdraw
  • lnurl-channel

Examples

Lnurl Pay

let ln_addr = LightningAddress::from_str("ben@zaps.benthecarman.com").unwrap();
let async_client = Builder::default().build_async().unwrap();

let res = async_client.make_request(url).await.unwrap();

if let LnUrlPayResponse(pay) = res {
    let msats = 1_000_000;
    let pay_result = async_client.get_invoice(&pay, msats, None, None).await.unwrap();

    let invoice = Bolt11Invoice::from_str(&pay_result.invoice()).unwrap();

    assert_eq!(invoice.amount_milli_satoshis(), Some(msats));
} else {
    panic!("Wrong response type");
}

Dependencies

~11–25MB
~339K SLoC