feat: nip44

This commit is contained in:
2023-06-14 15:03:07 +01:00
parent ecd957792d
commit c2a3a706de
10 changed files with 262 additions and 57 deletions

View File

@ -160,7 +160,7 @@ export class NostrConnectWallet implements LNWallet {
});
const eb = new EventBuilder();
eb.kind(23194 as EventKind)
.content(await EventExt.encryptData(payload, this.#config.walletPubkey, this.#config.secret))
.content(await EventExt.encryptDm(payload, this.#config.secret, this.#config.walletPubkey))
.tag(["p", this.#config.walletPubkey]);
const evCommand = await eb.buildAndSign(this.#config.secret);
@ -182,7 +182,7 @@ export class NostrConnectWallet implements LNWallet {
return await new Promise<T>((resolve, reject) => {
this.#commandQueue.set(evCommand.id, {
resolve: async (o: string) => {
const reply = JSON.parse(await EventExt.decryptData(o, this.#config.secret, this.#config.walletPubkey));
const reply = JSON.parse(await EventExt.decryptDm(o, this.#config.secret, this.#config.walletPubkey));
debug("NWC")("%o", reply);
resolve(reply);
},