@ambosstech/lightning-mpp-adapter-lnd 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -0
- package/package.json +6 -1
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# @ambosstech/lightning-mpp-adapter-lnd
|
|
2
|
+
|
|
3
|
+
LND adapter for the [Lightning MPP SDK](https://www.npmjs.com/package/@ambosstech/lightning-mpp-sdk). Supports both gRPC and REST transports.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @ambosstech/lightning-mpp-sdk @ambosstech/lightning-mpp-adapter-lnd
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### REST transport
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { LndLightningProvider } from "@ambosstech/lightning-mpp-adapter-lnd";
|
|
17
|
+
|
|
18
|
+
const provider = new LndLightningProvider({
|
|
19
|
+
transport: "rest",
|
|
20
|
+
url: "https://127.0.0.1:8080",
|
|
21
|
+
macaroon: process.env.LND_MACAROON!, // hex-encoded
|
|
22
|
+
fetch: customFetchWithTLS, // optional: custom fetch for TLS cert handling
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### gRPC transport
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import { LndLightningProvider } from "@ambosstech/lightning-mpp-adapter-lnd";
|
|
30
|
+
import { readFileSync } from "node:fs";
|
|
31
|
+
|
|
32
|
+
const provider = new LndLightningProvider({
|
|
33
|
+
transport: "grpc",
|
|
34
|
+
host: "127.0.0.1:10009",
|
|
35
|
+
tlsCert: readFileSync("/path/to/tls.cert"),
|
|
36
|
+
macaroon: readFileSync("/path/to/admin.macaroon"),
|
|
37
|
+
});
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### With the SDK
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { lightningChargeServer } from "@ambosstech/lightning-mpp-sdk";
|
|
44
|
+
|
|
45
|
+
const chargeMethod = lightningChargeServer({
|
|
46
|
+
provider,
|
|
47
|
+
currency: "sat",
|
|
48
|
+
network: "mainnet",
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## License
|
|
53
|
+
|
|
54
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ambosstech/lightning-mpp-adapter-lnd",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/AmbossTech/lightning-mpp-sdk.git",
|
|
7
|
+
"directory": "packages/adapter-lnd"
|
|
8
|
+
},
|
|
4
9
|
"type": "module",
|
|
5
10
|
"main": "./dist/index.cjs",
|
|
6
11
|
"module": "./dist/index.js",
|