Replying to Avatar liminal 🦠

nostr:npub1l2vyh47mk2p0qlsku7hg0vn29faehy9hy34ygaclpn66ukqp3afqutajft

nostr:npub1zuuajd7u3sx8xu92yav9jwxpr839cs0kc3q6t56vd5u9q033xmhsk6c2uc I'm clearly missing something simple here. Can't find any example that uses NDKPrivateKeySigner either.

```

import NDK, {

NDKEvent,

NDKFilter,

NDKPrivateKeySigner,

} from "@nostr-dev-kit/ndk";

const signer = NDKPrivateKeySigner.generate();

console.log(signer);

const ndk = new NDK({

explicitRelayUrls: ["wss://relay.damus.io", "wss://relay.nostr.band"],

signer: signer,

});

const ndkEvent = new NDKEvent(ndk);

ndkEvent.kind = 1;

ndkEvent.content = "Hello, world!";

ndkEvent.created_at = Math.floor(Date.now() / 1000);

ndk.connect().then(() => {

ndkEvent.publish().then(() => {

console.log("Event published!");

});

});

```

```

file:///home/user/Documents/Programming/upload_files/node_modules/.pnpm/@nostr-dev-kit+ndk@0.6.5_typescript@5.5.2/node_modules/@nostr-dev-kit/ndk/dist/index.mjs:670

this.sig = await _signer.sign(nostrEvent);

^

TypeError: Cannot read properties of undefined (reading 'sign')

at NDKEvent.sign (file:///home/user/Documents/Programming/upload_files/node_modules/.pnpm/@nostr-dev-kit+ndk@0.6.5_typescript@5.5.2/node_modules/@nostr-dev-kit/ndk/dist/index.mjs:670:30)

at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

at async NDKEvent.publish (file:///home/user/Documents/Programming/upload_files/node_modules/.pnpm/@nostr-dev-kit+ndk@0.6.5_typescript@5.5.2/node_modules/@nostr-dev-kit/ndk/dist/index.mjs:679:7)

```

you need a remote signer instead of the local signer?

https://dev.nsecbunker.com/

Reply to this note

Please Login to reply.

Discussion

No replies yet.