@webbtc/webln-types
Advanced tools
Comparing version 1.0.12 to 1.0.13
{ | ||
"name": "@webbtc/webln-types", | ||
"description": "Type definitions for WebLN", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"types": "types/index.d.ts", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -11,5 +11,5 @@ # webln-types | ||
```bash | ||
npm install @webbtc/webln-types --save-dev # or yarn add @webbtc/webln-types --dev | ||
``` | ||
```bash | ||
npm install @webbtc/webln-types --save-dev # or yarn add @webbtc/webln-types --dev | ||
``` | ||
@@ -24,17 +24,18 @@ 2. Create `webln-types.d.ts` in your `src` directory with the following contents to ensure the types are picked up by the Typescript compiler: | ||
```javascript | ||
import { GetInfoResponse } from "@webbtc/webln-types"; | ||
if (window.webln) { | ||
(async () => { | ||
await window.webln.enable(); | ||
const info: GetInfoResponse = await window.webln.getInfo(); | ||
console.log("Your node pubkey is", info.node.pubkey); | ||
})(); | ||
} else { | ||
console.warn("WebLN not enabled"); | ||
} | ||
``` | ||
```typescript | ||
import type { GetInfoResponse } from "@webbtc/webln-types"; | ||
if (window.webln) { | ||
(async () => { | ||
await window.webln.enable(); | ||
const info: GetInfoResponse = await window.webln.getInfo(); | ||
console.log("Your node pubkey is", info.node.pubkey); | ||
})(); | ||
} else { | ||
console.warn("WebLN not enabled"); | ||
} | ||
``` | ||
## Adding WebLN to your application | ||
Read the [WebLN Guide](https://www.webln.guide/introduction/readme) |
@@ -274,2 +274,4 @@ // Workaround for code completion to account for values this library doesn't know about yet. | ||
verifyMessage(signature: string, message: string): Promise<void>; | ||
on?(eventName: string, listener: () => void): this; | ||
off?(eventName: string, listener: () => void): this; | ||
} | ||
@@ -276,0 +278,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10366
283
40