add interface for getRelays() and bump version.

This commit is contained in:
fiatjaf
2022-02-15 16:15:27 -03:00
parent 414c0ea337
commit 259a37d4d7
4 changed files with 22 additions and 11 deletions

View File

@@ -2,6 +2,7 @@ import browser from 'webextension-polyfill'
export const PERMISSIONS_REQUIRED = {
getPublicKey: 1,
getRelays: 5,
signEvent: 10,
'nip04.encrypt': 20,
'nip04.decrypt': 20
@@ -9,6 +10,7 @@ export const PERMISSIONS_REQUIRED = {
const ORDERED_PERMISSIONS = [
[1, ['getPublicKey']],
[5, ['getRelays']],
[10, ['signEvent']],
[20, ['nip04.encrypt']],
[20, ['nip04.decrypt']]
@@ -16,6 +18,7 @@ const ORDERED_PERMISSIONS = [
const PERMISSION_NAMES = {
getPublicKey: 'read your public key',
getRelays: 'read your list of preferred relays',
signEvent: 'sign events using your private key',
'nip04.encrypt': 'encrypt messages to peers',
'nip04.decrypt': 'decrypt messages from peers'