-
Notifications
You must be signed in to change notification settings - Fork 117
Open
Description
I've been working on a nasty bug where the zapper is unable to get lud16 or lud06 information the 2nd time.
A script to reproduce the problem
#!/usr/bin/env tsx
import { NDK } from "./ndk";
debug.enable("*");
import debug from "debug";
import { NDKUser } from "./user";
import { NDKZapper } from "./zapper";
const hexpubkey = "8aa70f4433129dadb71330ac89f62b534caa200a9f3ee349a0f4a5593073d1a6";
async function run() {
const ndk = new NDK({
// debug: new Debug("*"),
explicitRelayUrls: ["wss://relay.damus.io", "wss://nos.lol"],
});
await ndk.connect();
const target = new NDKUser({ hexpubkey });
const zapper = new NDKZapper(target, 100, "msat", {
comment: "test",
ndk,
});
const zapMethodMap = await zapper.getZapMethods(ndk, hexpubkey);
console.log(zapMethodMap);
const zapMethodMap2 = await zapper.getZapMethods(ndk, hexpubkey);
console.log(zapMethodMap2);
}
run().catch(console.error);
First time the zapMethodMap has what is expected (including lud16 info), 2nd time it's empty. To debug this further i've added a PR that adds some debugging capabilities to fetchUser etc #362
Metadata
Metadata
Assignees
Labels
No labels