24 unstable releases (5 breaking)

0.5.0 Oct 16, 2023
0.4.4 Jul 16, 2023
0.3.6 May 29, 2023
0.3.3 Mar 31, 2023
0.1.3 Nov 19, 2022
Download history 25/week @ 2023-08-13 2/week @ 2023-08-20 25/week @ 2023-08-27 5/week @ 2023-09-03 28/week @ 2023-09-10 35/week @ 2023-09-17 6/week @ 2023-09-24 12/week @ 2023-10-01 8/week @ 2023-10-08 41/week @ 2023-10-15 12/week @ 2023-10-22 15/week @ 2023-10-29 44/week @ 2023-11-05 22/week @ 2023-11-12 31/week @ 2023-11-19 114/week @ 2023-11-26

211 downloads per month

MIT license

64KB
1.5K SLoC

zebedee-rust

  • Interface easily with ZEBEDEE's public API's.
  • Currently supports most feature of the public zebedee API.

Example usage of some of the functions:

Create a charge

use std::env;
use zebedee_rust::{charges::*, ZebedeeClient};

#[tokio::main]
async fn main() {
    let apikey: String = env::var("ZBD_API_KEY").unwrap();
    let zebedee_client = ZebedeeClient::new().apikey(apikey).build();

    // Create a Bolt 11 Invoice for 5000 msat or 5 sat.
    let charge = Charge {
        amount: String::from("5000"),
        ..Default::default()
    };

    // Create the charge
    let charges_res = zebedee_client.create_charge(&charge).await.unwrap();

    // Print the response
    println!("{:?}", charges_res);
}

Pay a Lightning Address

use std::env;
use zebedee_rust::{ln_address::*, ZebedeeClient};

#[tokio::main]
async fn main() {
    let apikey: String = env::var("ZBD_API_KEY").unwrap();
    let zebedee_client = ZebedeeClient::new().apikey(apikey).build();

    // Create a Lightning payment
    let payment = LnPayment {
        ln_address: String::from("dannym@zbd.gg"),
        amount: String::from("10000"),
        ..Default::default()
    };

    // Initiate the payment
    let payment_res = zebedee_client.pay_ln_address(&payment).await.unwrap();
    
    // Print the result
    println!("Internal transfer result: {:?}", payment_res);
}

Send an internal transfer

use std::env;
use zebedee_rust::{internal_transfer::*, ZebedeeClient};

#[tokio::main]
async fn main() {
    let apikey: String = env::var("ZBD_API_KEY").unwrap();
    let zebedee_client = ZebedeeClient::new().apikey(apikey).build();

    // Send Internal Transfer
    let internal_transfer_payload = InternalTransfer {
        amount: String::from("10000"),
        receiver_wallet_id: String::from("b2bcc262-186a-4fe8-961e-a5246383516c"),
    };

    // Initiate the internal transfer
    let transfer_res = zebedee_client.internal_transfer(&internal_transfer_payload).await.unwrap();
    
    // Print the result
    println!("Internal transfer result: {:?}", transfer_res);
}

Dependencies

~8–21MB
~335K SLoC