Skip to content

Commit 0ef87eb

Browse files
committed
Version 0.3.1
1 parent f707def commit 0ef87eb

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,23 @@ yarn add webln
2727

2828
If you don't have a build system, you can add the following script tag to your
2929
project which will add all functionality under the global `WebLN` namespace:
30+
3031
```html
3132
<script
32-
src="https://unpkg.com/webln@0.3.0/dist/webln.min.js"
33-
integrity="sha384-g4CABMESGmsa44I6J+t/4fY3DYGpbl8EjqX4L8g6rmD0RLjVinenmzEDqSH3f1QV"
33+
src="https://unpkg.com/webln@0.3.1/dist/webln.min.js"
34+
integrity="sha384-TddsmDgTQUTU/yuktBl5LSb8Y+QQqknQ19Lx2E0FraOK451Wv63kQ6iZFPrkmeEB"
3435
crossorigin="anonymous"
3536
></script>
3637
```
38+
3739
<sup>Make sure you leave the integrity hash in to prevent possibly malicious JS</sup>
3840

3941
### Client Library
4042

4143
Apps that want to enable WebLN interactions can use the `requestProvider` function to grab a WebLN provider:
4244

4345
```ts
44-
import { requestProvider } from 'webln';
46+
import { requestProvider } from "webln";
4547

4648
let webln;
4749
try {
@@ -56,7 +58,6 @@ if (webln) {
5658
}
5759
```
5860

59-
6061
### WebLN Provider
6162

6263
Providers are classes that implement the interface provided in `webln/lib/provider`.
@@ -77,7 +78,9 @@ export interface WebLNProvider {
7778
keysend(args: KeysendArgs): Promise<SendPaymentResponse>;
7879

7980
/* Prompts the user to provide the page with an invoice */
80-
makeInvoice(amount: string | number | RequestInvoiceArgs): Promise<RequestInvoiceResponse>;
81+
makeInvoice(
82+
amount: string | number | RequestInvoiceArgs
83+
): Promise<RequestInvoiceResponse>;
8184

8285
/* Prompts the user to sign a message with their private key */
8386
signMessage(message: string): Promise<SignMessageResponse>;
@@ -92,7 +95,6 @@ for more detail about request objects and response shapes. The spec
9295
is far from complete, and will need more functions to be fully-fledged,
9396
but these methods should cover most use-cases.
9497

95-
9698
### Errors
9799

98100
Both apps and providers will want to make use of WebLN's pre-defined errors.
@@ -123,12 +125,14 @@ And the provider should throw the correct error when possible:
123125
124126
```ts
125127
// And a provider should correctly throw this error
126-
import { WebLNProvider } from 'webln';
127-
import { UnsupportedMethodError } from 'webln/lib/errors';
128+
import { WebLNProvider } from "webln";
129+
import { UnsupportedMethodError } from "webln/lib/errors";
128130

129131
class MyProvider extends WebLNProvider {
130132
signMessage() {
131-
throw new UnsupportedMethodError('MyProvider doesn’t support message signatures!');
133+
throw new UnsupportedMethodError(
134+
"MyProvider doesn’t support message signatures!"
135+
);
132136
}
133137
}
134138
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webln",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "Spec and tools around implementing WebLN",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",

0 commit comments

Comments
 (0)