Skip to content

nostr-tools EventTemplate -> NDKEvent? #324

@vcavallo

Description

@vcavallo

For reasons, I would like to do something like the following:

          let zapRequest = await nip57.makeZapRequest({
            comment: "Some comment",
            profile: pubkey,
            event: eventID,
            amount: 100,
            relays: Array.from(ndk.pool.urls())
          })

          const zapRequestEvent = new NDKEvent(ndk, zapRequest);

          const signer = ndk.signer;
          if (!signer) {
            throw new Error("NDK signer is not initialized");
          }

          const signed = await signer.sign(zapRequestEvent)

There might be very many things wrong with this approach, but at least one is that it throws this error:

Error signing zap request: DataCloneError: Failed to execute 'postMessage' on 'Window': async (relay, challenge2) => {
      if (this.relayAuthDefaultPolicy) {
        await this.relayAuthDefaultPoli...<omitted>... } could not be cloned.
    at inpageScript.bundle.js:1:12719
    at new Promise (<anonymous>)
    at inpageScript.bundle.js:1:12645

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions