Crates.io | rust_l402 |
lib.rs | rust_l402 |
version | |
source | src |
created_at | 2024-08-26 13:35:30.113614 |
updated_at | 2024-12-02 13:43:53.106623 |
description | Rust L402 Client |
homepage | https://www.arealayer.net/projects |
repository | https://github.com/AreaLayer/rust-l402 |
max_upload_size | |
id | 1352229 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Rust L402 client module to consume L402 endpoints.
⚠️Beta version
⚠️While this code hapanned many tests, it is still beta-quality experimental software. Use at your own risk. Independent audit is welcome.
rust_l402
is a comprehensive Rust crate designed to simplify the integration and handling of L402 protocol payments within the Lightning Network ecosystem. This SDK offers convenient abstractions for wallet interactions, invoice payments, and token management, making it an essential tool for developers working on Rust-based applications requiring L402 API access.
Learn more about L402 and L402 Protocol by Lightning Labs
reqwest
library.LND
support.NWC
wallet support.To start using the Rust L402 SDK, add it to your Cargo.toml
:
[dependencies]
rust_l402 = "2.0.4-beta"
This example demonstrates how to use the L402 client with the LND wallet to make a request to the rnd.ln.sulu.sh/randomnumber
API or via FewSats, which returns a random number.
use rust_l402::L402Client;
fn main() {
// Initialize the wallet and client
let client = L402Client::new(wallet);
// Make a request to the API
let response = client.get("https://rnd.ln.sulu.sh/randomnumber").send().unwrap();
// Print the response
println!("Response: {}", response.text().unwrap());
}
use rust_l402::{L402Client, L402Wallet};
fn main() {
// Initialize the wallet and client
let wallet = L402Wallet::new(wallet_type);
let client = L402Client::new(wallet);
// Make a request to the API
let response = client.get("https://rnd.ln.sulu.sh/randomnumber").send().unwrap();
// Print the response
println!("Response: {}", response.text().unwrap());
}
This example provides a quick overview of how to utilize the rust_l402
crate for making payments and handling L402 API requests in a Rust-based application.