From 806141033319af8dddf50f3a606b3c07b1592251 Mon Sep 17 00:00:00 2001 From: Kieran Date: Fri, 26 Jan 2024 13:37:49 +0000 Subject: [PATCH] fix: NWC wrong method names --- packages/app/src/Wallet/NostrWalletConnect.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/app/src/Wallet/NostrWalletConnect.ts b/packages/app/src/Wallet/NostrWalletConnect.ts index f133cd4c..1bce2a79 100644 --- a/packages/app/src/Wallet/NostrWalletConnect.ts +++ b/packages/app/src/Wallet/NostrWalletConnect.ts @@ -1,3 +1,4 @@ +/* eslint-disable max-lines */ import { dedupe } from "@snort/shared"; import { Connection, EventBuilder, EventKind, NostrEvent, PrivateKeySigner } from "@snort/system"; import debug from "debug"; @@ -155,7 +156,7 @@ export class NostrConnectWallet implements LNWallet { }, reject, }); - this.#conn?.QueueReq(["REQ", "info", { kinds: [13194], limit: 1 }], () => { + this.#conn?.queueReq(["REQ", "info", { kinds: [13194], limit: 1 }], () => { // ignored }); }); @@ -179,7 +180,7 @@ export class NostrConnectWallet implements LNWallet { this.#conn.on("event", (s, e) => { this.#onReply(s, e); }); - this.#conn.Connect(); + this.#conn.connect(); }); await this.getInfo(); this.changed(); @@ -187,7 +188,7 @@ export class NostrConnectWallet implements LNWallet { } async close() { - this.#conn?.Close(); + this.#conn?.close(); return true; } @@ -291,7 +292,7 @@ export class NostrConnectWallet implements LNWallet { pending.resolve(e.content); this.#commandQueue.delete(replyTo[1]); - this.#conn?.CloseReq(sub); + this.#conn?.closeReq(sub); } async #rpc(method: string, params: Record) { @@ -319,7 +320,7 @@ export class NostrConnectWallet implements LNWallet { .tag(["p", this.#config.walletPubkey]); const evCommand = await eb.buildAndSign(this.#config.secret); - this.#conn.QueueReq( + this.#conn.queueReq( [ "REQ", evCommand.id.slice(0, 12), @@ -333,7 +334,7 @@ export class NostrConnectWallet implements LNWallet { // ignored }, ); - await this.#conn.SendAsync(evCommand); + await this.#conn.sendEventAsync(evCommand); return await new Promise((resolve, reject) => { this.#commandQueue.set(evCommand.id, { resolve: async (o: string) => {