@getalby/lightning-tools 6.1.0 → 7.0.2
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 +8 -6
- package/dist/cjs/index.cjs +10 -6
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/l402.cjs +10 -6
- package/dist/cjs/l402.cjs.map +1 -1
- package/dist/esm/index.js +10 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/l402.js +10 -7
- package/dist/esm/l402.js.map +1 -1
- package/dist/lightning-tools.umd.js +2 -2
- package/dist/lightning-tools.umd.js.map +1 -1
- package/dist/types/index.d.ts +12 -2
- package/dist/types/l402.d.ts +12 -4
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -251,10 +251,20 @@ declare class NoStorage implements KVStorage {
|
|
|
251
251
|
setItem(key: string, value: unknown): void;
|
|
252
252
|
}
|
|
253
253
|
declare const parseL402: (input: string) => Record<string, string>;
|
|
254
|
+
declare const makeAuthenticateHeader: (args: {
|
|
255
|
+
macaroon: string;
|
|
256
|
+
invoice: string;
|
|
257
|
+
key?: string;
|
|
258
|
+
}) => string;
|
|
254
259
|
|
|
260
|
+
interface Wallet {
|
|
261
|
+
sendPayment(paymentRequest: string): Promise<{
|
|
262
|
+
preimage: string;
|
|
263
|
+
}>;
|
|
264
|
+
}
|
|
255
265
|
declare const fetchWithL402: (url: string, fetchArgs: RequestInit, options: {
|
|
256
266
|
headerKey?: string;
|
|
257
|
-
|
|
267
|
+
wallet?: Wallet;
|
|
258
268
|
store?: KVStorage;
|
|
259
269
|
}) => Promise<Response>;
|
|
260
270
|
|
|
@@ -280,5 +290,5 @@ declare const getFormattedFiatValue: ({ satoshi, currency, locale, }: {
|
|
|
280
290
|
locale: string;
|
|
281
291
|
}) => Promise<string>;
|
|
282
292
|
|
|
283
|
-
export { DEFAULT_PROXY, Invoice, LN_ADDRESS_REGEX, LightningAddress, MemoryStorage, NoStorage, decodeInvoice, fetchWithL402, fromHexString, generateZapEvent, getEventHash, getFiatBtcRate, getFiatCurrencies, getFiatValue, getFormattedFiatValue, getSatoshiValue, isUrl, isValidAmount, parseKeysendResponse, parseL402, parseLnUrlPayResponse, parseNostrResponse, sendBoostagram, serializeEvent, validateEvent };
|
|
293
|
+
export { DEFAULT_PROXY, Invoice, LN_ADDRESS_REGEX, LightningAddress, MemoryStorage, NoStorage, decodeInvoice, fetchWithL402, fromHexString, generateZapEvent, getEventHash, getFiatBtcRate, getFiatCurrencies, getFiatValue, getFormattedFiatValue, getSatoshiValue, isUrl, isValidAmount, makeAuthenticateHeader, parseKeysendResponse, parseL402, parseLnUrlPayResponse, parseNostrResponse, sendBoostagram, serializeEvent, validateEvent };
|
|
284
294
|
export type { Boost, BoostArguments, BoostOptions, Event, FiatCurrency, InvoiceArgs, KVStorage, KeySendRawData, KeysendResponse, LUD18PayerData, LUD18ServicePayerData, LnUrlPayResponse, LnUrlRawData, NostrProvider, NostrResponse, RequestInvoiceArgs, SuccessAction, WeblnBoostParams, ZapArgs, ZapOptions };
|
package/dist/types/l402.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { WebLNProvider } from '@webbtc/webln-types';
|
|
2
|
-
|
|
3
1
|
interface KVStorage {
|
|
4
2
|
getItem(key: string): string | null;
|
|
5
3
|
setItem(key: string, value: string): void;
|
|
@@ -16,12 +14,22 @@ declare class NoStorage implements KVStorage {
|
|
|
16
14
|
setItem(key: string, value: unknown): void;
|
|
17
15
|
}
|
|
18
16
|
declare const parseL402: (input: string) => Record<string, string>;
|
|
17
|
+
declare const makeAuthenticateHeader: (args: {
|
|
18
|
+
macaroon: string;
|
|
19
|
+
invoice: string;
|
|
20
|
+
key?: string;
|
|
21
|
+
}) => string;
|
|
19
22
|
|
|
23
|
+
interface Wallet {
|
|
24
|
+
sendPayment(paymentRequest: string): Promise<{
|
|
25
|
+
preimage: string;
|
|
26
|
+
}>;
|
|
27
|
+
}
|
|
20
28
|
declare const fetchWithL402: (url: string, fetchArgs: RequestInit, options: {
|
|
21
29
|
headerKey?: string;
|
|
22
|
-
|
|
30
|
+
wallet?: Wallet;
|
|
23
31
|
store?: KVStorage;
|
|
24
32
|
}) => Promise<Response>;
|
|
25
33
|
|
|
26
|
-
export { MemoryStorage, NoStorage, fetchWithL402, parseL402 };
|
|
34
|
+
export { MemoryStorage, NoStorage, fetchWithL402, makeAuthenticateHeader, parseL402 };
|
|
27
35
|
export type { KVStorage };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getalby/lightning-tools",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.2",
|
|
4
4
|
"description": "Collection of helpful building blocks and tools to develop Bitcoin Lightning web apps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": "https://github.com/getAlby/js-lightning-tools.git",
|