mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-08 16:28:49 +00:00
* including interface for nip07 * fix types for NIP-07 * including NIP-07 export to jsr * fix readme about nip07 * including in nip7 interface an output signature compatible with the event returned by the signer
26 lines
596 B
TypeScript
26 lines
596 B
TypeScript
import { verifyEvent } from './pure.ts'
|
|
import { AbstractRelay } from './abstract-relay.ts'
|
|
|
|
/**
|
|
* @deprecated use Relay.connect() instead.
|
|
*/
|
|
export function relayConnect(url: string): Promise<Relay> {
|
|
return Relay.connect(url)
|
|
}
|
|
|
|
export class Relay extends AbstractRelay {
|
|
constructor(url: string) {
|
|
super(url, { verifyEvent })
|
|
}
|
|
|
|
static async connect(url: string): Promise<Relay> {
|
|
const relay = new Relay(url)
|
|
await relay.connect()
|
|
return relay
|
|
}
|
|
}
|
|
|
|
export type RelayRecord = Record<string, { read: boolean; write: boolean }>;
|
|
|
|
export * from './abstract-relay.ts'
|