oc · docs
docs / documentation

@orangecheck/nostr-core


@orangecheck/nostr-core / AuthSigner

Type Alias: AuthSigner

type AuthSigner = (challenge: string, relayUrl: string) => 
  | NostrEvent
| Promise<NostrEvent>;

Defined in: index.ts:167

Sign a NIP-42 AUTH challenge. Given the relay's challenge string and relayUrl, return a signed kind-22242 event (tags ["relay", relayUrl] + ["challenge", challenge]). Passed in by the caller so this package stays dependency-free (no crypto here). Provide it only for auth-required relays; absent it, an AUTH challenge is ignored (today's behavior).

Parameters

ParameterType
challengestring
relayUrlstring

Returns

| NostrEvent | Promise&lt;NostrEvent>