| Crates.io | lnurl-rs |
| lib.rs | lnurl-rs |
| version | 0.9.0 |
| created_at | 2023-01-31 23:38:54.694681+00 |
| updated_at | 2024-11-05 16:25:51.170223+00 |
| description | A basic LNURL implementation in Rust |
| homepage | https://github.com/benthecarman/lnurl-rs/ |
| repository | https://github.com/benthecarman/lnurl-rs/ |
| max_upload_size | |
| id | 773127 |
| size | 56,141 |
A rust implementation of LNURL. Supports plaintext, TLS and Onion servers. Blocking or async. WASM enabled.
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");
}