21 unstable releases (5 breaking)

new 0.6.0 Jul 19, 2024
0.4.1 Jan 27, 2024
0.4.0 Dec 16, 2023
0.3.1 Nov 22, 2023
0.2.0 Mar 14, 2023

#33 in Magic Beans

Download history 806/week @ 2024-04-02 855/week @ 2024-04-09 733/week @ 2024-04-16 332/week @ 2024-04-23 109/week @ 2024-04-30 272/week @ 2024-05-07 146/week @ 2024-05-14 282/week @ 2024-05-21 361/week @ 2024-05-28 489/week @ 2024-06-04 482/week @ 2024-06-11 587/week @ 2024-06-18 393/week @ 2024-06-25 333/week @ 2024-07-02 619/week @ 2024-07-09 788/week @ 2024-07-16

2,185 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

~9–23MB
~325K SLoC