Skip to content

Commit c4f2ebd

Browse files
committed
Merge branch 'master' into chore/v6.0.0
2 parents b4b2f1f + a950fc8 commit c4f2ebd

8 files changed

Lines changed: 72 additions & 77 deletions

File tree

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ or for use without any build tools:
4444
The `LightningAddress` class provides helpers to work with lightning addresses
4545

4646
```js
47-
// import { LightningAddress } from "@getalby/lightning-tools"; (or)
4847
import { LightningAddress } from "@getalby/lightning-tools/lnurl";
4948

5049
const ln = new LightningAddress("hello@getalby.com");
@@ -61,7 +60,6 @@ console.log(ln.keysendData);
6160
#### Get an invoice:
6261

6362
```js
64-
// import { LightningAddress } from "@getalby/lightning-tools"; (or)
6563
import { LightningAddress } from "@getalby/lightning-tools/lnurl";
6664

6765
const ln = new LightningAddress("hello@getalby.com");
@@ -78,7 +76,6 @@ console.log(invoice.paymentHash); // print the payment hash
7876
#### Verify a payment
7977

8078
```js
81-
// import { LightningAddress } from "@getalby/lightning-tools"; (or)
8279
import { LightningAddress } from "@getalby/lightning-tools/lnurl";
8380
const ln = new LightningAddress("hello@getalby.com");
8481
await ln.fetch();
@@ -106,7 +103,6 @@ await invoice.isPaid();
106103
It is also possible to manually initialize the `Invoice`
107104

108105
```js
109-
// import { Invoice } from "@getalby/lightning-tools"; (or)
110106
import { Invoice } from "@getalby/lightning-tools/bolt11";
111107

112108
const invoice = new Invoice({ pr: pr, preimage: preimage });
@@ -118,7 +114,6 @@ await invoice.isPaid();
118114
You can also attach additional metadata information like app name, version, name of the podcast which is boosted etc. to the keysend payment.
119115

120116
```js
121-
// import { LightningAddress } from "@getalby/lightning-tools"; (or)
122117
import { LightningAddress } from "@getalby/lightning-tools/lnurl";
123118
const ln = new LightningAddress("hello@getalby.com");
124119
await ln.fetch();
@@ -146,7 +141,6 @@ Nostr is a simple, open protocol that enables truly censorship-resistant and glo
146141
This librarys provides helpers to create [zaps](https://github.com/nostr-protocol/nips/blob/master/57.md).
147142

148143
```js
149-
// import { LightningAddress } from "@getalby/lightning-tools"; (or)
150144
import { LightningAddress } from "@getalby/lightning-tools/lnurl";
151145
const ln = new LightningAddress("hello@getalby.com");
152146
await ln.fetch();
@@ -188,7 +182,6 @@ This library includes a `fetchWithL402` function to consume L402 protected resou
188182
##### Examples
189183

190184
```js
191-
// import { fetchWithL402 } from "@getalby/lightning-tools"; (or)
192185
import { fetchWithL402 } from "@getalby/lightning-tools/l402";
193186

194187
// this will fetch the resource and pay the invoice with window.webln.
@@ -203,7 +196,6 @@ await fetchWithL402(
203196
```
204197

205198
```js
206-
// import { fetchWithL402 } from "@getalby/lightning-tools"; (or)
207199
import { fetchWithL402 } from "@getalby/lightning-tools/l402";
208200
import { NostrWebLNProvider } from "@getalby/sdk";
209201

@@ -223,7 +215,6 @@ await fetchWithL402(
223215
```
224216

225217
```js
226-
// import { fetchWithL402, NoStorage } from "@getalby/lightning-tools"; (or)
227218
import { fetchWithL402, NoStorage } from "@getalby/lightning-tools/l402";
228219

229220
// do not store the tokens
@@ -239,7 +230,6 @@ await fetchWithL402(
239230
You can initialize an `Invoice` to decode a payment request.
240231

241232
```js
242-
// import { Invoice } from "@getalby/lightning-tools"; (or)
243233
import { Invoice } from "@getalby/lightning-tools/bolt11";
244234

245235
const invoice = new Invoice({ pr });

examples/l402.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fetchWithL402 } from "@getalby/lightning-tools";
1+
import { fetchWithL402 } from "@getalby/lightning-tools/l402";
22
import { NostrWebLNProvider } from "@getalby/sdk";
33
import "websocket-polyfill";
44

examples/request-invoice.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LightningAddress } from "@getalby/lightning-tools";
1+
import { LightningAddress } from "@getalby/lightning-tools/lnurl";
22

33
const ln = new LightningAddress("hello@getalby.com");
44

examples/zaps-nwc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LightningAddress } from "@getalby/lightning-tools";
1+
import { LightningAddress } from "@getalby/lightning-tools/lnurl";
22
import { NostrWebLNProvider } from "@getalby/sdk";
33
import "websocket-polyfill";
44
import { finalizeEvent, getPublicKey } from "nostr-tools";

examples/zaps.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LightningAddress } from "@getalby/lightning-tools";
1+
import { LightningAddress } from "@getalby/lightning-tools/lnurl";
22

33
(async () => {
44
const ln = new LightningAddress("hello@getalby.com");

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
"alby"
1919
],
2020
"sideEffects": false,
21+
"source": "src/index.ts",
2122
"module": "./dist/esm/index.js",
2223
"main": "./dist/cjs/index.cjs",
2324
"types": "./dist/types/index.d.ts",
25+
"unpkg": "./dist/types/lightning-tools.umd.js",
2426
"exports": {
2527
".": {
2628
"import": "./dist/esm/index.js",
@@ -77,7 +79,7 @@
7779
"@rollup/plugin-terser": "^0.4.4",
7880
"@rollup/plugin-typescript": "^12.1.4",
7981
"@types/jest": "^30.0.0",
80-
"@types/node": "^24.0.10",
82+
"@types/node": "^24.2.0",
8183
"@typescript-eslint/eslint-plugin": "^6.21.0",
8284
"@typescript-eslint/parser": "^6.21.0",
8385
"@webbtc/webln-types": "^3.0.0",
@@ -87,12 +89,12 @@
8789
"jest": "^30.0.5",
8890
"jest-fetch-mock": "^3.0.3",
8991
"light-bolt11-decoder": "^3.2.0",
90-
"lint-staged": "^16.1.2",
91-
"nostr-tools": "^2.15.0",
92+
"lint-staged": "^16.1.4",
93+
"nostr-tools": "^2.16.1",
9294
"prettier": "^3.6.2",
9395
"rollup": "^4.46.2",
9496
"rollup-plugin-dts": "^6.2.1",
95-
"ts-jest": "^29.4.0",
97+
"ts-jest": "^29.4.1",
9698
"ts-node": "^10.9.2",
9799
"tslib": "^2.8.1",
98100
"typescript": "^5.9.2"

rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const umdBundle = {
5757
input: "src/index.ts",
5858
plugins: [...plugins, terser()],
5959
output: {
60-
file: "dist/lightning-tools.bundle.js",
60+
file: "dist/lightning-tools.umd.js",
6161
format: "umd",
6262
name: "LightningTools",
6363
sourcemap: true,

0 commit comments

Comments
 (0)