lnurl-rs

Crates.iolnurl-rs
lib.rslnurl-rs
version0.9.0
sourcesrc
created_at2023-01-31 23:38:54.694681
updated_at2024-11-05 16:25:51.170223
descriptionA basic LNURL implementation in Rust
homepagehttps://github.com/benthecarman/lnurl-rs/
repositoryhttps://github.com/benthecarman/lnurl-rs/
max_upload_size
id773127
size56,141
(benthecarman)

documentation

https://docs.rs/lnurl-rs/

README

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");
}
Commit count: 81

cargo fmt