Skip to content

Commit 0b0ba34

Browse files
committed
update docs
1 parent dc7bc84 commit 0b0ba34

File tree

1 file changed

+45
-17
lines changed

1 file changed

+45
-17
lines changed

readme.md

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
LNI - Lightning Node Interface
22
==============================
33

4-
<img src="./assets/logo.jpg" alt="logo" style="max-height: 300px;">
4+
LNI - Lightning Node Interface. Connect to the major lightning node implementations with a standard interface.
55

6-
- LNI - Lightning Node Interface. Connect to the major lightning node implementations with a standard interface.
76
- Supports *CLN, *LND, *LNDK, *Phoenixd, *LNURL, *BOLT 11 and *BOLT 12 (WIP).
87
- Language Binding support for kotlin, swift, react-native, nodejs (typescript, javaScript). No support for WASM (yet)
98
- Runs on Android, iOS, Linux, Windows and Mac
109

11-
```
12-
### Examples
10+
<img src="./assets/logo.jpg" alt="logo" style="max-height: 300px;">
1311

14-
# LND
12+
### Interface API
13+
14+
#### LND
15+
```rust
1516
let lnd_node = LndNode::new("test_macaroon".to_string(), "https://127.0.0.1:8080".to_string());
1617
let lnd_result = lnd_node.pay_invoice("invoice".to_string());
1718
println!("Pay LND invoice result {}", lnd_result);
@@ -20,8 +21,10 @@ lnd_txns.iter().for_each(|txn| {
2021
println!("LND Transaction amount: {}, date: {}, memo: {}", txn.amount(), txn.date(), txn.memo());
2122
});
2223
let lnd_macaroon = lnd_node.key();
24+
```
2325

24-
# CLN
26+
#### CLN
27+
```rust
2528
let cln_node = ClnNode::new("test_rune".to_string(), "https://127.0.0.1:8081".to_string());
2629
let cln_result = cln_node.pay_invoice("invoice".to_string());
2730
println!("Pay CLN invoice result {}", cln_result);
@@ -30,34 +33,42 @@ cln_txns.iter().for_each(|txn| {
3033
println!("CLN Transaction amount: {}, date: {}, memo: {}", txn.amount(), txn.date(), txn.memo());
3134
});
3235
let cln_rune = cln_node.key();
36+
```
3337

3438

35-
### Payments
39+
#### Payments
40+
```rust
3641
lni.create_invoice(amount, expiration, memo, BOLT11 | BOLT12)
3742
lni.pay_invoice()
3843
lni.fetch_invoice_from_offer('lno***')
3944
lni.decode_invoice(invoice)
4045
lni.check_invoice_status(invoice)
46+
```
4147
42-
### Node Management
48+
#### Node Management
49+
```
4350
lni.get_info()
4451
lni.get_transactions(limit, skip)
4552
lni.wallet_balance()
53+
```
4654
47-
### Channel Management
55+
#### Channel Management
56+
```
4857
lni.fetch_channel_info()
58+
```
4959
50-
### Event Polling
60+
#### Event Polling
61+
```
5162
await lni.on_invoice_events(invoice_id, (event) =>{
5263
console.log("Callback result:", result);
5364
})
54-
5565
```
5666
67+
5768
Event Polling
5869
============
59-
LNI does some simple event polling over http to get some basic invoice status events.
60-
Polling is used instead of a heavier grpc/pubsub/ websocket event system to make sure the lib runs cross platform and stays lightweight.
70+
LNI does some simple event polling over https to get some basic invoice status events.
71+
Polling is used instead of a heavier grpc/pubsub (for now) event system to make sure the lib runs cross platform and stays lightweight. TODO websockets
6172
6273
Build
6374
=======
@@ -68,16 +79,31 @@ cargo build
6879
cargo test
6980
```
7081
82+
Folder Structure
83+
================
84+
```
85+
lni
86+
├── bindings
87+
│ ├── lni_nodejs
88+
│ ├── lni_react_native
89+
│ ├── lni_uniffi
90+
├── crates
91+
│ ├── lni
92+
│ |─── lnd
93+
│ |─── cln
94+
│ |─── phoenixd
95+
```
96+
7197
Example
7298
========
73-
- react-native
99+
react-native
74100
```
75101
cd bindings/lni_react_native
76102
cat example/src/App.tsx
77103
yarn start
78104
```
79105
80-
- nodejs
106+
nodejs
81107
```
82108
cd bindings/lni_nodejs
83109
cat main.mjs
@@ -109,9 +135,10 @@ Tor
109135
Use Tor socks if connecting to a .onion hidden service by passing in socks5 proxy.
110136
111137
112-
Inpiration
138+
Inspiration
113139
==========
114140
- https://github.com/ZeusLN/zeus/blob/master/backends/LND.ts
141+
- https://github.com/getAlby/hub/tree/master/lnclient
115142
- https://github.com/fedimint/fedimint/blob/master/gateway/ln-gateway/src/lightning/lnd.rs
116143
117144
Project Structure
@@ -140,4 +167,5 @@ Todo
140167
To Research
141168
============
142169
- [X] napi-rs https://napi.rs/docs/introduction/simple-package
143-
- [ ] can we support more complex grpc in
170+
- [ ] can we support more complex grpc in
171+
- [ ] wasm

0 commit comments

Comments
 (0)