-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
223880
committed
Oct 11, 2024
1 parent
497df82
commit 3e88eaf
Showing
3 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,53 @@ | ||
use crate::lightning::{ | ||
invoice::Invoice, | ||
keysend::{Keysend, KeysendResponse}, | ||
payment::{Payment, PaymentStatus}, | ||
utils::{get_invoice_amount, get_invoice_expiry}, | ||
}; | ||
|
||
fn main () { | ||
let invoice = Invoice { | ||
amount: 1000, | ||
description: "test".to_string(), | ||
description_hash: None, | ||
expiry: 1000, | ||
payment_hash: None, | ||
payment_hash_algo: None, | ||
payment_secret: None, | ||
timestamp: None, | ||
min_final_cltv_expiry: None, | ||
fallback_address: None, | ||
routing_info: None, | ||
routes: None, | ||
features: None, | ||
signature: None, | ||
}; | ||
|
||
} | ||
|
||
impl Invoice { | ||
pub fn new(amount: u64, description: String) -> Self { | ||
Self { | ||
amount, | ||
description, | ||
description_hash: None, | ||
expiry: 1000, | ||
payment_hash: None, | ||
payment_hash_algo: None, | ||
payment_secret: None, | ||
timestamp: None, | ||
min_final_cltv_expiry: None, | ||
fallback_address: None, | ||
routing_info: None, | ||
routes: None, | ||
features: None, | ||
signature: None, | ||
} | ||
} | ||
pub fn get_invoice_amount(&self) -> u64 { | ||
self.amount | ||
} | ||
pub fn get_invoice_expiry(&self) -> u64 { | ||
self.expiry | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,35 @@ | ||
use ldk_node::LightningNode; | ||
use lightning::ln::channelmanager::ChannelManager; | ||
use lightning::invoice::Invoice; | ||
|
||
fn main () { | ||
let node = LightningNode::new(); | ||
let channel_manager = ChannelManager::new(); | ||
let invoice = Invoice::new(); | ||
} | ||
|
||
impl LightningNode { | ||
pub fn new() -> Self { | ||
LightningNode { | ||
channel_manager: ChannelManager::new(), | ||
invoice: Invoice::new(), | ||
} | ||
} | ||
} | ||
|
||
impl ChannelManager { | ||
pub fn new() -> Self { | ||
ChannelManager { | ||
channels: Vec::new(), | ||
} | ||
} | ||
} | ||
|
||
impl Invoice { | ||
pub fn new() -> Self { | ||
Invoice { | ||
amount: 0, | ||
description: String::new(), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters