@getalby/lightning-tools
Version:
Collection of helpful building blocks and tools to develop Bitcoin Lightning web apps
28 lines (24 loc) • 870 B
TypeScript
import { WebLNProvider } from '@webbtc/webln-types';
interface KVStorage {
getItem(key: string): string | null;
setItem(key: string, value: string): void;
}
declare class MemoryStorage implements KVStorage {
storage: any;
constructor(initial?: Record<string, unknown>);
getItem(key: string): any;
setItem(key: string, value: unknown): void;
}
declare class NoStorage implements KVStorage {
constructor(initial?: unknown);
getItem(key: string): null;
setItem(key: string, value: unknown): void;
}
declare const parseL402: (input: string) => Record<string, string>;
declare const fetchWithL402: (url: string, fetchArgs: RequestInit, options: {
headerKey?: string;
webln?: WebLNProvider;
store?: KVStorage;
}) => Promise<Response>;
export { MemoryStorage, NoStorage, fetchWithL402, parseL402 };
export type { KVStorage };