NConnect -> NBunker

This commit is contained in:
Alex Gleason 2024-10-23 10:00:23 -05:00
parent 200724e46c
commit cb95726249
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 6 additions and 6 deletions

View File

@ -1,7 +1,7 @@
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { useNostr } from 'soapbox/contexts/nostr-context'; import { useNostr } from 'soapbox/contexts/nostr-context';
import { NConnect } from 'soapbox/features/nostr/NConnect'; import { NBunker } from 'soapbox/features/nostr/NBunker';
const secretStorageKey = 'soapbox:nip46:secret'; const secretStorageKey = 'soapbox:nip46:secret';
@ -35,7 +35,7 @@ function useSignerStream() {
useEffect(() => { useEffect(() => {
if (!relay || !signer || !pubkey) return; if (!relay || !signer || !pubkey) return;
const connect = new NConnect({ const bunker = new NBunker({
relay, relay,
signer, signer,
onAuthorize(authorizedPubkey) { onAuthorize(authorizedPubkey) {
@ -51,7 +51,7 @@ function useSignerStream() {
}); });
return () => { return () => {
connect.close(); bunker.close();
}; };
}, [relay, signer, pubkey]); }, [relay, signer, pubkey]);

View File

@ -1,6 +1,6 @@
import { NRelay, NostrConnectRequest, NostrConnectResponse, NostrEvent, NostrSigner, NSchema as n } from '@nostrify/nostrify'; import { NRelay, NostrConnectRequest, NostrConnectResponse, NostrEvent, NostrSigner, NSchema as n } from '@nostrify/nostrify';
interface NConnectOpts { interface NBunkerOpts {
relay: NRelay; relay: NRelay;
signer: NostrSigner; signer: NostrSigner;
authorizedPubkey: string | undefined; authorizedPubkey: string | undefined;
@ -9,7 +9,7 @@ interface NConnectOpts {
getSecret(): string; getSecret(): string;
} }
export class NConnect { export class NBunker {
private relay: NRelay; private relay: NRelay;
private signer: NostrSigner; private signer: NostrSigner;
@ -20,7 +20,7 @@ export class NConnect {
private controller = new AbortController(); private controller = new AbortController();
constructor(opts: NConnectOpts) { constructor(opts: NBunkerOpts) {
this.relay = opts.relay; this.relay = opts.relay;
this.signer = opts.signer; this.signer = opts.signer;
this.authorizedPubkey = opts.authorizedPubkey; this.authorizedPubkey = opts.authorizedPubkey;