thunder-bridge 3.0.0 → 3.0.1
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 +4 -2
- package/dist/index.cjs +20 -5
- package/dist/index.js +20 -5
- package/openapi.yaml +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -145,8 +145,10 @@ checkout page should not have to download.
|
|
|
145
145
|
Anything that opens a socket needs Node 22 or newer: `requestPayment`, `settled`,
|
|
146
146
|
`firstSettled`, `follow`, `attend` and every NWC call. `invoiceFrom`,
|
|
147
147
|
`serve.lightningVerify` and `rails.lightning` without `gatewayMints` resolve wallet
|
|
148
|
-
hostnames through `node:dns
|
|
149
|
-
|
|
148
|
+
hostnames through `node:dns` and pin the connection to the checked address through
|
|
149
|
+
`node:https`, so they need Node and run on neither Cloudflare Workers nor Deno.
|
|
150
|
+
Everything else runs on any runtime with `fetch` and `crypto.subtle`, and a browser
|
|
151
|
+
bundler leaves those Node imports alone.
|
|
150
152
|
|
|
151
153
|
## More
|
|
152
154
|
|
package/dist/index.cjs
CHANGED
|
@@ -1354,14 +1354,23 @@ async function addressesToReach(url) {
|
|
|
1354
1354
|
return found;
|
|
1355
1355
|
}
|
|
1356
1356
|
async function resolved(url) {
|
|
1357
|
-
const { isIP } = await import(
|
|
1357
|
+
const { isIP } = await import(
|
|
1358
|
+
/* webpackIgnore: true */
|
|
1359
|
+
"node:net"
|
|
1360
|
+
);
|
|
1358
1361
|
const host = new URL(url).hostname.replace(/^\[|]$/g, "");
|
|
1359
1362
|
const literal = isIP(host);
|
|
1360
1363
|
if (literal !== 0) {
|
|
1361
1364
|
return [{ address: host, family: literal }];
|
|
1362
1365
|
}
|
|
1363
|
-
const { Resolver } = await import(
|
|
1364
|
-
|
|
1366
|
+
const { Resolver } = await import(
|
|
1367
|
+
/* webpackIgnore: true */
|
|
1368
|
+
"node:dns/promises"
|
|
1369
|
+
);
|
|
1370
|
+
const { setTimeout: sleep } = await import(
|
|
1371
|
+
/* webpackIgnore: true */
|
|
1372
|
+
"node:timers/promises"
|
|
1373
|
+
);
|
|
1365
1374
|
const resolver = new Resolver({ timeout: LOOKUP_TIMEOUT_MS, tries: 1 });
|
|
1366
1375
|
const found = await Promise.race([
|
|
1367
1376
|
Promise.all([
|
|
@@ -1669,8 +1678,14 @@ var pinnedToTheAddressWeVerified = async (url, sent, signal, at) => {
|
|
|
1669
1678
|
if (first === void 0) {
|
|
1670
1679
|
throw new Error(`${url} resolved to nothing worth connecting to`);
|
|
1671
1680
|
}
|
|
1672
|
-
const { request } = await import(
|
|
1673
|
-
|
|
1681
|
+
const { request } = await import(
|
|
1682
|
+
/* webpackIgnore: true */
|
|
1683
|
+
"node:https"
|
|
1684
|
+
);
|
|
1685
|
+
const { Readable } = await import(
|
|
1686
|
+
/* webpackIgnore: true */
|
|
1687
|
+
"node:stream"
|
|
1688
|
+
);
|
|
1674
1689
|
return new Promise((settle, fail) => {
|
|
1675
1690
|
if (signal.aborted) {
|
|
1676
1691
|
fail(signal.reason);
|
package/dist/index.js
CHANGED
|
@@ -1300,14 +1300,23 @@ async function addressesToReach(url) {
|
|
|
1300
1300
|
return found;
|
|
1301
1301
|
}
|
|
1302
1302
|
async function resolved(url) {
|
|
1303
|
-
const { isIP } = await import(
|
|
1303
|
+
const { isIP } = await import(
|
|
1304
|
+
/* webpackIgnore: true */
|
|
1305
|
+
"node:net"
|
|
1306
|
+
);
|
|
1304
1307
|
const host = new URL(url).hostname.replace(/^\[|]$/g, "");
|
|
1305
1308
|
const literal = isIP(host);
|
|
1306
1309
|
if (literal !== 0) {
|
|
1307
1310
|
return [{ address: host, family: literal }];
|
|
1308
1311
|
}
|
|
1309
|
-
const { Resolver } = await import(
|
|
1310
|
-
|
|
1312
|
+
const { Resolver } = await import(
|
|
1313
|
+
/* webpackIgnore: true */
|
|
1314
|
+
"node:dns/promises"
|
|
1315
|
+
);
|
|
1316
|
+
const { setTimeout: sleep } = await import(
|
|
1317
|
+
/* webpackIgnore: true */
|
|
1318
|
+
"node:timers/promises"
|
|
1319
|
+
);
|
|
1311
1320
|
const resolver = new Resolver({ timeout: LOOKUP_TIMEOUT_MS, tries: 1 });
|
|
1312
1321
|
const found = await Promise.race([
|
|
1313
1322
|
Promise.all([
|
|
@@ -1615,8 +1624,14 @@ var pinnedToTheAddressWeVerified = async (url, sent, signal, at) => {
|
|
|
1615
1624
|
if (first === void 0) {
|
|
1616
1625
|
throw new Error(`${url} resolved to nothing worth connecting to`);
|
|
1617
1626
|
}
|
|
1618
|
-
const { request } = await import(
|
|
1619
|
-
|
|
1627
|
+
const { request } = await import(
|
|
1628
|
+
/* webpackIgnore: true */
|
|
1629
|
+
"node:https"
|
|
1630
|
+
);
|
|
1631
|
+
const { Readable } = await import(
|
|
1632
|
+
/* webpackIgnore: true */
|
|
1633
|
+
"node:stream"
|
|
1634
|
+
);
|
|
1620
1635
|
return new Promise((settle, fail) => {
|
|
1621
1636
|
if (signal.aborted) {
|
|
1622
1637
|
fail(signal.reason);
|
package/openapi.yaml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "thunder-bridge",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Take Bitcoin Lightning and bank payments in JavaScript, paid straight into your own wallet or account. No node to run, no custodian, and every payment proven rather than taken on the gateway's word.",
|
|
5
5
|
"author": "i-am-fatik",
|
|
6
6
|
"homepage": "https://agora.gripe/en/tools/thunder-bridge",
|