feat: add support for nip44
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user