(challenge: string, generation: number)
| 770 | } |
| 771 | |
| 772 | private async handleAuthChallenge(challenge: string, generation: number) { |
| 773 | if (!this.relayUrl) { |
| 774 | this.relayUrl = await getRelayWsUrl(); |
| 775 | } |
| 776 | |
| 777 | const event = await createAuthEvent({ |
| 778 | challenge, |
| 779 | relayUrl: this.relayUrl, |
| 780 | }); |
| 781 | |
| 782 | if (generation !== this.connectionGeneration || !this.authRequest) { |
| 783 | return; |
| 784 | } |
| 785 | |
| 786 | this.authRequest.pendingEventId = event.id; |
| 787 | await this.sendRaw(["AUTH", event]); |
| 788 | } |
| 789 | |
| 790 | private handleEvent(subId: string, event: RelayEvent) { |
| 791 | const subscription = this.subscriptions.get(subId); |
no test coverage detected