20 unstable releases (4 breaking)

new 0.5.0 Apr 13, 2024
0.4.1 Jan 27, 2024
0.4.0 Dec 16, 2023
0.3.2 Jan 25, 2024
0.2.0 Mar 14, 2023

#200 in Magic Beans

Download history 104/week @ 2023-12-22 149/week @ 2023-12-29 315/week @ 2024-01-05 197/week @ 2024-01-12 307/week @ 2024-01-19 363/week @ 2024-01-26 458/week @ 2024-02-02 453/week @ 2024-02-09 560/week @ 2024-02-16 436/week @ 2024-02-23 405/week @ 2024-03-01 570/week @ 2024-03-08 791/week @ 2024-03-15 699/week @ 2024-03-22 687/week @ 2024-03-29 714/week @ 2024-04-05

2,957 downloads per month
Used in 10 crates

MIT license

53KB
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).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

~10–25MB
~346K SLoC