diff --git a/src/connect.ts b/src/connect.ts index c425512..d6bf112 100644 --- a/src/connect.ts +++ b/src/connect.ts @@ -62,13 +62,16 @@ export class ConnectURI { relay: this.relayURL, secretKey, }); - await rpc.call({ - target: this.target, - request: { - method: 'connect', - params: [getPublicKey(secretKey)], + 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({ - target: this.target, - request: { - method: 'disconnect', - params: [], + 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'); diff --git a/src/rpc.ts b/src/rpc.ts index e554a22..b4b0866 100644 --- a/src/rpc.ts +++ b/src/rpc.ts @@ -37,17 +37,20 @@ export class NostrRPC { }; } - async call({ - target, - request: { id = randomID(), method, params = [] }, - }: { - target: string; - request: { - id?: string; - method: string; - params?: any[]; - }; - }, opts?: { skipResponse?: boolean, timeout?: number }): Promise { + async call( + { + target, + request: { id = randomID(), method, params = [] }, + }: { + target: string; + request: { + id?: string; + method: string; + params?: any[]; + }; + }, + opts?: { skipResponse?: boolean; timeout?: number } + ): Promise { // connect to relay const relay = await connectToRelay(this.relay); @@ -295,4 +298,3 @@ export async function broadcastToRelay(relay: Relay, event: Event) { }); }); } -