mirror of
https://github.com/nostr-connect/connect.git
synced 2025-12-17 13:14:20 +01:00
lint
This commit is contained in:
@@ -62,13 +62,16 @@ export class ConnectURI {
|
||||
relay: this.relayURL,
|
||||
secretKey,
|
||||
});
|
||||
await rpc.call({
|
||||
await rpc.call(
|
||||
{
|
||||
target: this.target,
|
||||
request: {
|
||||
method: 'connect',
|
||||
params: [getPublicKey(secretKey)],
|
||||
},
|
||||
}, { skipResponse: true });
|
||||
},
|
||||
{ skipResponse: true }
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -78,13 +81,16 @@ export class ConnectURI {
|
||||
relay: this.relayURL,
|
||||
secretKey,
|
||||
});
|
||||
await rpc.call({
|
||||
await rpc.call(
|
||||
{
|
||||
target: this.target,
|
||||
request: {
|
||||
method: 'disconnect',
|
||||
params: [],
|
||||
},
|
||||
}, { skipResponse: true });
|
||||
},
|
||||
{ skipResponse: true }
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -135,7 +141,7 @@ export class Connect {
|
||||
const [pubkey] = payload.params;
|
||||
this.target = pubkey;
|
||||
this.events.emit('connect', pubkey);
|
||||
return
|
||||
return;
|
||||
case 'disconnect':
|
||||
this.target = undefined;
|
||||
this.events.emit('disconnect');
|
||||
|
||||
@@ -37,7 +37,8 @@ export class NostrRPC {
|
||||
};
|
||||
}
|
||||
|
||||
async call({
|
||||
async call(
|
||||
{
|
||||
target,
|
||||
request: { id = randomID(), method, params = [] },
|
||||
}: {
|
||||
@@ -47,7 +48,9 @@ export class NostrRPC {
|
||||
method: string;
|
||||
params?: any[];
|
||||
};
|
||||
}, opts?: { skipResponse?: boolean, timeout?: number }): Promise<any> {
|
||||
},
|
||||
opts?: { skipResponse?: boolean; timeout?: number }
|
||||
): Promise<any> {
|
||||
// connect to relay
|
||||
const relay = await connectToRelay(this.relay);
|
||||
|
||||
@@ -295,4 +298,3 @@ export async function broadcastToRelay(relay: Relay, event: Event) {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user