feat: login (#2)

This commit is contained in:
Cody Tseng 2024-11-04 22:59:09 +08:00 committed by GitHub
parent 199b44d280
commit a7cf6dc5e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 382 additions and 86 deletions

View file

@ -74,6 +74,11 @@ class ClientService {
return this.pool.listConnectionStatus()
}
async publishEvent(event: NEvent) {
// TODO: outbox
return await Promise.any(this.pool.publish(this.relayUrls, event))
}
subscribeEvents(
urls: string[],
filter: Filter,
@ -82,7 +87,6 @@ class ClientService {
onNew: (evt: NEvent) => void
}
) {
console.log('subscribeEvents', urls, filter)
const events: NEvent[] = []
let eose = false
return this.pool.subscribeMany(urls, [filter], {