Skip to main content
Home

latest

Framework for Nostr on Deno and web. 🛸

This package works with Deno, BrowsersIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
This package works with Browsers
JSR Score
94%
Published
2 months ago (0.46.5)
class NConnectSigner
implements NostrSigner

NIP-46 remote signer through a relay.

Constructors

new
NConnectSigner(unnamed 0: NConnectSignerOpts)

Properties

private
encryption: "nip04" | "nip44"
readonly
nip04: { encrypt: (
pubkey: string,
plaintext: string,
) => Promise<string>
; decrypt: (
pubkey: string,
ciphertext: string,
) => Promise<string>
; }
readonly
nip44: { encrypt: (
pubkey: string,
plaintext: string,
) => Promise<string>
; decrypt: (
pubkey: string,
ciphertext: string,
) => Promise<string>
; }
private
pubkey: string
private
relay: NRelay
private
signer: NostrSigner
private
optional
timeout: number

Methods

private
cmd(
method: string,
params: string[],
): Promise<string>

High-level RPC method. Returns the string result, or throws on error.

Send a connect command to the relay. It should respond with ack.

private
decrypt(
pubkey: string,
ciphertext: string,
): Promise<string>

Local decrypt depending on settings.

private
encrypt(
pubkey: string,
plaintext: string,
): Promise<string>

Local encrypt depending on settings.

getRelays(): Promise<Record<string, { read: boolean; write: boolean; }>>

Send a ping command to the signer. It should respond with pong.

private
send(
request: NostrConnectRequest,
opts?: { signal?: AbortSignal; },
): Promise<NostrConnectResponse>

Low-level send method. Deals directly with connect request/response.

signEvent(event: Omit<NostrEvent,
"id"
| "pubkey"
| "sig"
>
): Promise<NostrEvent>

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@nostrify/nostrify

Import symbol

import { NConnectSigner } from "@nostrify/nostrify";
or

Import directly with a jsr specifier

import { NConnectSigner } from "jsr:@nostrify/nostrify";

Add Package

pnpm i jsr:@nostrify/nostrify
or (using pnpm 10.8 or older)
pnpm dlx jsr add @nostrify/nostrify

Import symbol

import { NConnectSigner } from "@nostrify/nostrify";

Add Package

yarn add jsr:@nostrify/nostrify
or (using Yarn 4.8 or older)
yarn dlx jsr add @nostrify/nostrify

Import symbol

import { NConnectSigner } from "@nostrify/nostrify";

Add Package

vlt install jsr:@nostrify/nostrify

Import symbol

import { NConnectSigner } from "@nostrify/nostrify";

Add Package

npx jsr add @nostrify/nostrify

Import symbol

import { NConnectSigner } from "@nostrify/nostrify";

Add Package

bunx jsr add @nostrify/nostrify

Import symbol

import { NConnectSigner } from "@nostrify/nostrify";