@getalby/lightning-tools 6.0.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.
@@ -251,13 +251,30 @@ 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
- webln?: WebLNProvider;
267
+ wallet?: Wallet;
258
268
  store?: KVStorage;
259
269
  }) => Promise<Response>;
260
270
 
271
+ interface FiatCurrency {
272
+ code: string;
273
+ name: string;
274
+ symbol: string;
275
+ priority: number;
276
+ }
277
+ declare const getFiatCurrencies: () => Promise<FiatCurrency[]>;
261
278
  declare const getFiatBtcRate: (currency: string) => Promise<number>;
262
279
  declare const getFiatValue: ({ satoshi, currency, }: {
263
280
  satoshi: number | string;
@@ -273,5 +290,5 @@ declare const getFormattedFiatValue: ({ satoshi, currency, locale, }: {
273
290
  locale: string;
274
291
  }) => Promise<string>;
275
292
 
276
- export { DEFAULT_PROXY, Invoice, LN_ADDRESS_REGEX, LightningAddress, MemoryStorage, NoStorage, decodeInvoice, fetchWithL402, fromHexString, generateZapEvent, getEventHash, getFiatBtcRate, getFiatValue, getFormattedFiatValue, getSatoshiValue, isUrl, isValidAmount, parseKeysendResponse, parseL402, parseLnUrlPayResponse, parseNostrResponse, sendBoostagram, serializeEvent, validateEvent };
277
- export type { Boost, BoostArguments, BoostOptions, Event, InvoiceArgs, KVStorage, KeySendRawData, KeysendResponse, LUD18PayerData, LUD18ServicePayerData, LnUrlPayResponse, LnUrlRawData, NostrProvider, NostrResponse, RequestInvoiceArgs, SuccessAction, WeblnBoostParams, ZapArgs, ZapOptions };
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 };
294
+ export type { Boost, BoostArguments, BoostOptions, Event, FiatCurrency, InvoiceArgs, KVStorage, KeySendRawData, KeysendResponse, LUD18PayerData, LUD18ServicePayerData, LnUrlPayResponse, LnUrlRawData, NostrProvider, NostrResponse, RequestInvoiceArgs, SuccessAction, WeblnBoostParams, ZapArgs, ZapOptions };
@@ -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
- webln?: WebLNProvider;
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": "6.0.0",
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",