https://github.com/benthecarman/lnurl-rs
A rust implementation of LNURL
https://github.com/benthecarman/lnurl-rs
lnurl lnurl-pay rust
Last synced: 2 months ago
JSON representation
A rust implementation of LNURL
- Host: GitHub
- URL: https://github.com/benthecarman/lnurl-rs
- Owner: benthecarman
- License: mit
- Created: 2023-01-14T01:53:01.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-11-05T16:25:58.000Z (7 months ago)
- Last Synced: 2025-04-02T06:02:41.539Z (2 months ago)
- Topics: lnurl, lnurl-pay, rust
- Language: Rust
- Homepage:
- Size: 95.7 KB
- Stars: 31
- Watchers: 2
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lnurl-rs
[](https://github.com/benthecarman/lnurl-rs/blob/master/LICENSE)
[](https://crates.io/crates/lnurl-rs)
[](https://docs.rs/lnurl-rs)A rust implementation of [LNURL](https://github.com/lnurl/luds). 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
```rustc
let ln_addr = LightningAddress::from_str("[email protected]").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");
}
```