NConnect -> NBunker
This commit is contained in:
parent
200724e46c
commit
cb95726249
|
@ -1,7 +1,7 @@
|
|||
import { useEffect, useState } from 'react';
|
||||
|
||||
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';
|
||||
|
||||
|
@ -35,7 +35,7 @@ function useSignerStream() {
|
|||
useEffect(() => {
|
||||
if (!relay || !signer || !pubkey) return;
|
||||
|
||||
const connect = new NConnect({
|
||||
const bunker = new NBunker({
|
||||
relay,
|
||||
signer,
|
||||
onAuthorize(authorizedPubkey) {
|
||||
|
@ -51,7 +51,7 @@ function useSignerStream() {
|
|||
});
|
||||
|
||||
return () => {
|
||||
connect.close();
|
||||
bunker.close();
|
||||
};
|
||||
}, [relay, signer, pubkey]);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { NRelay, NostrConnectRequest, NostrConnectResponse, NostrEvent, NostrSigner, NSchema as n } from '@nostrify/nostrify';
|
||||
|
||||
interface NConnectOpts {
|
||||
interface NBunkerOpts {
|
||||
relay: NRelay;
|
||||
signer: NostrSigner;
|
||||
authorizedPubkey: string | undefined;
|
||||
|
@ -9,7 +9,7 @@ interface NConnectOpts {
|
|||
getSecret(): string;
|
||||
}
|
||||
|
||||
export class NConnect {
|
||||
export class NBunker {
|
||||
|
||||
private relay: NRelay;
|
||||
private signer: NostrSigner;
|
||||
|
@ -20,7 +20,7 @@ export class NConnect {
|
|||
|
||||
private controller = new AbortController();
|
||||
|
||||
constructor(opts: NConnectOpts) {
|
||||
constructor(opts: NBunkerOpts) {
|
||||
this.relay = opts.relay;
|
||||
this.signer = opts.signer;
|
||||
this.authorizedPubkey = opts.authorizedPubkey;
|
Loading…
Reference in New Issue