feat: LNC wallet
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import { EventPublisher } from "Feed/EventPublisher";
|
||||
import EventKind from "Nostr/EventKind";
|
||||
import {
|
||||
InvoiceRequest,
|
||||
LNWallet,
|
||||
@ -48,6 +47,10 @@ export default class LNDHubWallet implements LNWallet {
|
||||
}
|
||||
}
|
||||
|
||||
close(): Promise<boolean | WalletError> {
|
||||
throw new Error("Not implemented");
|
||||
}
|
||||
|
||||
async createAccount() {
|
||||
return Promise.resolve(UnknownWalletError);
|
||||
}
|
||||
@ -136,7 +139,7 @@ export default class LNDHubWallet implements LNWallet {
|
||||
private async getJson<T>(method: "GET" | "POST", path: string, body?: any): Promise<T | WalletError> {
|
||||
let auth = `Bearer ${this.auth?.access_token}`;
|
||||
if (this.type === "snort") {
|
||||
const ev = await this.publisher?.generic(`${new URL(this.url).pathname}${path}`, EventKind.Ephemeral);
|
||||
const ev = await this.publisher?.generic(`${new URL(this.url).pathname}${path}`, 30_000);
|
||||
auth = JSON.stringify(ev?.ToObject());
|
||||
}
|
||||
const rsp = await fetch(`${this.url}${path}`, {
|
||||
|
Reference in New Issue
Block a user