20 unstable releases (4 breaking)

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

#265 in Magic Beans

Download history 361/week @ 2024-01-24 444/week @ 2024-01-31 431/week @ 2024-02-07 470/week @ 2024-02-14 542/week @ 2024-02-21 380/week @ 2024-02-28 564/week @ 2024-03-06 661/week @ 2024-03-13 830/week @ 2024-03-20 492/week @ 2024-03-27 839/week @ 2024-04-03 878/week @ 2024-04-10 724/week @ 2024-04-17 218/week @ 2024-04-24 137/week @ 2024-05-01 256/week @ 2024-05-08

1,479 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–26MB
~354K SLoC