feat: translation (#389)

This commit is contained in:
Cody Tseng 2025-06-23 23:52:21 +08:00 committed by GitHub
parent e2e115ebeb
commit df9066eae0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 1466 additions and 47 deletions

View file

@ -144,6 +144,22 @@ class ClientService extends EventTarget {
return result
}
async signHttpAuth(url: string, method: string, description = '') {
if (!this.signer) {
throw new Error('Please login first to sign the event')
}
const event = await this.signer?.signEvent({
content: description,
kind: kinds.HTTPAuth,
created_at: dayjs().unix(),
tags: [
['u', url],
['method', method]
]
})
return 'Nostr ' + btoa(JSON.stringify(event))
}
private generateTimelineKey(urls: string[], filter: Filter) {
const stableFilter: any = {}
Object.entries(filter)