thunder-bridge 1.0.0 → 1.3.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 +96 -4
- package/dist/index.cjs +1650 -1302
- package/dist/index.d.cts +214 -170
- package/dist/index.d.ts +214 -170
- package/dist/index.js +1646 -1301
- package/dist/{rail-CL9QkiHo.d.cts → rail-DZzlN-bi.d.cts} +166 -1
- package/dist/{rail-CL9QkiHo.d.ts → rail-DZzlN-bi.d.ts} +166 -1
- package/dist/server.cjs +976 -382
- package/dist/server.d.cts +47 -41
- package/dist/server.d.ts +47 -41
- package/dist/server.js +966 -382
- package/openapi.yaml +1 -1
- package/package.json +33 -13
package/dist/server.d.cts
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
|
-
import { T as ThunderBridge } from './rail-
|
|
2
|
-
export { m as BlindLightningRailConfig, n as blindLightningRail } from './rail-
|
|
1
|
+
import { T as ThunderBridge } from './rail-DZzlN-bi.cjs';
|
|
2
|
+
export { m as BlindLightningRailConfig, N as NwcConnection, n as NwcInvoice, o as NwcRailConfig, p as NwcVerifyConfig, q as Resolved, r as askWallet, s as blindLightningRail, u as invoiceFrom, v as nwcConnection, w as nwcHoldInvoice, x as nwcInvoice, y as nwcPay, z as nwcRail, A as nwcSettlement, D as nwcVerifyEndpoint, E as nwcVerifyUrl } from './rail-DZzlN-bi.cjs';
|
|
3
|
+
|
|
4
|
+
/** The wallet's own LUD-21 URL and the hash its preimage has to match */
|
|
5
|
+
interface Relayed {
|
|
6
|
+
url: string;
|
|
7
|
+
hash: string;
|
|
8
|
+
}
|
|
9
|
+
interface LightningVerifyConfig {
|
|
10
|
+
/** The secret the sealed wallet URL was made with, and nothing else uses it */
|
|
11
|
+
secret: string;
|
|
12
|
+
/**
|
|
13
|
+
* How often you want the gateway to ask, in seconds. It goes out as
|
|
14
|
+
* `Cache-Control: max-age`, so the pace is yours rather than the operator's.
|
|
15
|
+
* Five by default, which is what a Lightning checkout wants
|
|
16
|
+
*/
|
|
17
|
+
pollEverySecs?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A verify endpoint of your own that asks the recipient's wallet for you, so the
|
|
21
|
+
* gateway polls you and never the wallet.
|
|
22
|
+
*
|
|
23
|
+
* `relayedVerifyUrl` seals the wallet's own LUD-21 URL into the query with your
|
|
24
|
+
* secret, so what the gateway stores and replicates is opaque: not the wallet's
|
|
25
|
+
* host, not which provider the recipient uses, nothing but a blob it cannot read.
|
|
26
|
+
* This handler unseals it, asks the wallet, and answers the same LUD-21 shape.
|
|
27
|
+
*
|
|
28
|
+
* It relays rather than decides. The preimage still comes from the recipient's
|
|
29
|
+
* own server and still has to hash to the payment hash, so standing between the
|
|
30
|
+
* two buys privacy and pacing without becoming something anyone has to trust.
|
|
31
|
+
*
|
|
32
|
+
* A wallet it cannot reach answers `502` rather than "not settled", because those
|
|
33
|
+
* are different claims and only one of them is true. The gateway logs a failed
|
|
34
|
+
* poll and asks again, which is what a broken relay should look like.
|
|
35
|
+
*/
|
|
36
|
+
declare function lightningVerifyEndpoint(config: LightningVerifyConfig): (request: Request) => Promise<Response>;
|
|
37
|
+
/**
|
|
38
|
+
* The URL to hand the gateway instead of the wallet's own, with the wallet's
|
|
39
|
+
* sealed inside it. Point it at wherever `lightningVerifyEndpoint` is mounted
|
|
40
|
+
*/
|
|
41
|
+
declare function relayedVerifyUrl(endpoint: string, wallet: Relayed, secret: string): Promise<string>;
|
|
3
42
|
|
|
4
43
|
interface TriggerConfig {
|
|
5
44
|
/** The gateway that quotes the addresses and mints the invoice */
|
|
@@ -18,6 +57,12 @@ interface TriggerConfig {
|
|
|
18
57
|
secret: string;
|
|
19
58
|
/** Groups every payment here so `followTrigger` can watch the place, keep it off the QR */
|
|
20
59
|
watchSecret?: string;
|
|
60
|
+
/**
|
|
61
|
+
* How many settlements of this place the gateway keeps replayable past the hour
|
|
62
|
+
* it would otherwise forget them in, up to the ceiling its operator set. What a
|
|
63
|
+
* page that opens later still gets to see. Needs `watchSecret`
|
|
64
|
+
*/
|
|
65
|
+
replay?: number;
|
|
21
66
|
/** Override when a proxy hides the public URL from the request, no trailing slash */
|
|
22
67
|
baseUrl?: string;
|
|
23
68
|
/**
|
|
@@ -61,43 +106,4 @@ interface Minted {
|
|
|
61
106
|
*/
|
|
62
107
|
declare function lnurlPayEndpoint(config: TriggerConfig): (request: Request) => Promise<Response>;
|
|
63
108
|
|
|
64
|
-
/** The wallet's own LUD-21 URL and the hash its preimage has to match */
|
|
65
|
-
interface Relayed {
|
|
66
|
-
url: string;
|
|
67
|
-
hash: string;
|
|
68
|
-
}
|
|
69
|
-
interface LightningVerifyConfig {
|
|
70
|
-
/** The secret the sealed wallet URL was made with, and nothing else uses it */
|
|
71
|
-
secret: string;
|
|
72
|
-
/**
|
|
73
|
-
* How often you want the gateway to ask, in seconds. It goes out as
|
|
74
|
-
* `Cache-Control: max-age`, so the pace is yours rather than the operator's.
|
|
75
|
-
* Five by default, which is what a Lightning checkout wants
|
|
76
|
-
*/
|
|
77
|
-
pollEverySecs?: number;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* A verify endpoint of your own that asks the recipient's wallet for you, so the
|
|
81
|
-
* gateway polls you and never the wallet.
|
|
82
|
-
*
|
|
83
|
-
* `relayedVerifyUrl` seals the wallet's own LUD-21 URL into the query with your
|
|
84
|
-
* secret, so what the gateway stores and replicates is opaque: not the wallet's
|
|
85
|
-
* host, not which provider the recipient uses, nothing but a blob it cannot read.
|
|
86
|
-
* This handler unseals it, asks the wallet, and answers the same LUD-21 shape.
|
|
87
|
-
*
|
|
88
|
-
* It relays rather than decides. The preimage still comes from the recipient's
|
|
89
|
-
* own server and still has to hash to the payment hash, so standing between the
|
|
90
|
-
* two buys privacy and pacing without becoming something anyone has to trust.
|
|
91
|
-
*
|
|
92
|
-
* A wallet it cannot reach answers `502` rather than "not settled", because those
|
|
93
|
-
* are different claims and only one of them is true. The gateway logs a failed
|
|
94
|
-
* poll and asks again, which is what a broken relay should look like.
|
|
95
|
-
*/
|
|
96
|
-
declare function lightningVerifyEndpoint(config: LightningVerifyConfig): (request: Request) => Promise<Response>;
|
|
97
|
-
/**
|
|
98
|
-
* The URL to hand the gateway instead of the wallet's own, with the wallet's
|
|
99
|
-
* sealed inside it. Point it at wherever `lightningVerifyEndpoint` is mounted
|
|
100
|
-
*/
|
|
101
|
-
declare function relayedVerifyUrl(endpoint: string, wallet: Relayed, secret: string): Promise<string>;
|
|
102
|
-
|
|
103
109
|
export { type LightningVerifyConfig, type Minted, type Relayed, type TriggerConfig, lightningVerifyEndpoint, lnurlPayEndpoint, relayedVerifyUrl };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
|
-
import { T as ThunderBridge } from './rail-
|
|
2
|
-
export { m as BlindLightningRailConfig, n as blindLightningRail } from './rail-
|
|
1
|
+
import { T as ThunderBridge } from './rail-DZzlN-bi.js';
|
|
2
|
+
export { m as BlindLightningRailConfig, N as NwcConnection, n as NwcInvoice, o as NwcRailConfig, p as NwcVerifyConfig, q as Resolved, r as askWallet, s as blindLightningRail, u as invoiceFrom, v as nwcConnection, w as nwcHoldInvoice, x as nwcInvoice, y as nwcPay, z as nwcRail, A as nwcSettlement, D as nwcVerifyEndpoint, E as nwcVerifyUrl } from './rail-DZzlN-bi.js';
|
|
3
|
+
|
|
4
|
+
/** The wallet's own LUD-21 URL and the hash its preimage has to match */
|
|
5
|
+
interface Relayed {
|
|
6
|
+
url: string;
|
|
7
|
+
hash: string;
|
|
8
|
+
}
|
|
9
|
+
interface LightningVerifyConfig {
|
|
10
|
+
/** The secret the sealed wallet URL was made with, and nothing else uses it */
|
|
11
|
+
secret: string;
|
|
12
|
+
/**
|
|
13
|
+
* How often you want the gateway to ask, in seconds. It goes out as
|
|
14
|
+
* `Cache-Control: max-age`, so the pace is yours rather than the operator's.
|
|
15
|
+
* Five by default, which is what a Lightning checkout wants
|
|
16
|
+
*/
|
|
17
|
+
pollEverySecs?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A verify endpoint of your own that asks the recipient's wallet for you, so the
|
|
21
|
+
* gateway polls you and never the wallet.
|
|
22
|
+
*
|
|
23
|
+
* `relayedVerifyUrl` seals the wallet's own LUD-21 URL into the query with your
|
|
24
|
+
* secret, so what the gateway stores and replicates is opaque: not the wallet's
|
|
25
|
+
* host, not which provider the recipient uses, nothing but a blob it cannot read.
|
|
26
|
+
* This handler unseals it, asks the wallet, and answers the same LUD-21 shape.
|
|
27
|
+
*
|
|
28
|
+
* It relays rather than decides. The preimage still comes from the recipient's
|
|
29
|
+
* own server and still has to hash to the payment hash, so standing between the
|
|
30
|
+
* two buys privacy and pacing without becoming something anyone has to trust.
|
|
31
|
+
*
|
|
32
|
+
* A wallet it cannot reach answers `502` rather than "not settled", because those
|
|
33
|
+
* are different claims and only one of them is true. The gateway logs a failed
|
|
34
|
+
* poll and asks again, which is what a broken relay should look like.
|
|
35
|
+
*/
|
|
36
|
+
declare function lightningVerifyEndpoint(config: LightningVerifyConfig): (request: Request) => Promise<Response>;
|
|
37
|
+
/**
|
|
38
|
+
* The URL to hand the gateway instead of the wallet's own, with the wallet's
|
|
39
|
+
* sealed inside it. Point it at wherever `lightningVerifyEndpoint` is mounted
|
|
40
|
+
*/
|
|
41
|
+
declare function relayedVerifyUrl(endpoint: string, wallet: Relayed, secret: string): Promise<string>;
|
|
3
42
|
|
|
4
43
|
interface TriggerConfig {
|
|
5
44
|
/** The gateway that quotes the addresses and mints the invoice */
|
|
@@ -18,6 +57,12 @@ interface TriggerConfig {
|
|
|
18
57
|
secret: string;
|
|
19
58
|
/** Groups every payment here so `followTrigger` can watch the place, keep it off the QR */
|
|
20
59
|
watchSecret?: string;
|
|
60
|
+
/**
|
|
61
|
+
* How many settlements of this place the gateway keeps replayable past the hour
|
|
62
|
+
* it would otherwise forget them in, up to the ceiling its operator set. What a
|
|
63
|
+
* page that opens later still gets to see. Needs `watchSecret`
|
|
64
|
+
*/
|
|
65
|
+
replay?: number;
|
|
21
66
|
/** Override when a proxy hides the public URL from the request, no trailing slash */
|
|
22
67
|
baseUrl?: string;
|
|
23
68
|
/**
|
|
@@ -61,43 +106,4 @@ interface Minted {
|
|
|
61
106
|
*/
|
|
62
107
|
declare function lnurlPayEndpoint(config: TriggerConfig): (request: Request) => Promise<Response>;
|
|
63
108
|
|
|
64
|
-
/** The wallet's own LUD-21 URL and the hash its preimage has to match */
|
|
65
|
-
interface Relayed {
|
|
66
|
-
url: string;
|
|
67
|
-
hash: string;
|
|
68
|
-
}
|
|
69
|
-
interface LightningVerifyConfig {
|
|
70
|
-
/** The secret the sealed wallet URL was made with, and nothing else uses it */
|
|
71
|
-
secret: string;
|
|
72
|
-
/**
|
|
73
|
-
* How often you want the gateway to ask, in seconds. It goes out as
|
|
74
|
-
* `Cache-Control: max-age`, so the pace is yours rather than the operator's.
|
|
75
|
-
* Five by default, which is what a Lightning checkout wants
|
|
76
|
-
*/
|
|
77
|
-
pollEverySecs?: number;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* A verify endpoint of your own that asks the recipient's wallet for you, so the
|
|
81
|
-
* gateway polls you and never the wallet.
|
|
82
|
-
*
|
|
83
|
-
* `relayedVerifyUrl` seals the wallet's own LUD-21 URL into the query with your
|
|
84
|
-
* secret, so what the gateway stores and replicates is opaque: not the wallet's
|
|
85
|
-
* host, not which provider the recipient uses, nothing but a blob it cannot read.
|
|
86
|
-
* This handler unseals it, asks the wallet, and answers the same LUD-21 shape.
|
|
87
|
-
*
|
|
88
|
-
* It relays rather than decides. The preimage still comes from the recipient's
|
|
89
|
-
* own server and still has to hash to the payment hash, so standing between the
|
|
90
|
-
* two buys privacy and pacing without becoming something anyone has to trust.
|
|
91
|
-
*
|
|
92
|
-
* A wallet it cannot reach answers `502` rather than "not settled", because those
|
|
93
|
-
* are different claims and only one of them is true. The gateway logs a failed
|
|
94
|
-
* poll and asks again, which is what a broken relay should look like.
|
|
95
|
-
*/
|
|
96
|
-
declare function lightningVerifyEndpoint(config: LightningVerifyConfig): (request: Request) => Promise<Response>;
|
|
97
|
-
/**
|
|
98
|
-
* The URL to hand the gateway instead of the wallet's own, with the wallet's
|
|
99
|
-
* sealed inside it. Point it at wherever `lightningVerifyEndpoint` is mounted
|
|
100
|
-
*/
|
|
101
|
-
declare function relayedVerifyUrl(endpoint: string, wallet: Relayed, secret: string): Promise<string>;
|
|
102
|
-
|
|
103
109
|
export { type LightningVerifyConfig, type Minted, type Relayed, type TriggerConfig, lightningVerifyEndpoint, lnurlPayEndpoint, relayedVerifyUrl };
|