feat: add support for nip44

This commit is contained in:
Ren Amamiya
2026-04-08 11:54:00 +07:00
parent 387796faa3
commit 72b9dcddc1
20 changed files with 2447 additions and 309 deletions

View File

@@ -10,12 +10,16 @@ window.nostr = {
return this._pubkey
},
async peekPublicKey() {
return this._call('peekPublicKey', {})
},
async signEvent(event) {
return this._call('signEvent', { event })
},
async getRelays() {
return this._call('getRelays', {})
return {}
},
nip04: {
@@ -28,6 +32,16 @@ window.nostr = {
}
},
nip44: {
async encrypt(peer, plaintext) {
return window.nostr._call('nip44.encrypt', { peer, plaintext })
},
async decrypt(peer, ciphertext) {
return window.nostr._call('nip44.decrypt', { peer, ciphertext })
}
},
_call(type, params) {
const id = Math.random().toString().slice(-4)
console.log(