Message with a type field in NAP format (e.g., 'relay.subscribe')
CapabilityResolution with senderCap and recipientCap (each may be null)
resolveCapabilitiesNap({ type: 'relay.subscribe' })
// => { senderCap: 'relay:read', recipientCap: null }
resolveCapabilitiesNap({ type: 'relay.publishEncrypted' })
// => { senderCap: 'relay:write', recipientCap: null }
resolveCapabilitiesNap({ type: 'identity.getProfile' })
// => { senderCap: 'identity:read', recipientCap: null }
resolveCapabilitiesNap({ type: 'keys.forward' })
// => { senderCap: 'keys:forward', recipientCap: null }
resolveCapabilitiesNap({ type: 'inc.channel.broadcast' })
// => { senderCap: 'relay:write', recipientCap: 'relay:read' }
resolveCapabilitiesNap({ type: 'theme.changed' })
// => { senderCap: null, recipientCap: 'theme:read' }
resolveCapabilitiesNap({ type: 'signer.signEvent' })
// => { senderCap: null, recipientCap: null } // domain removed
Resolve the capabilities required by a NAP message.
Splits
msg.typeon '.' to obtain[domain, action], then dispatches to a per-domain mapper. Unknown domains returnnull/null(silently ignored).NAP domain mapping table (8 canonical domains):
relaysubscribe,query,close, results/pushesrelay:readnullrelaypublishrelay:writerelay:readrelaypublishEncryptedrelay:writenullidentitygetPublicKey,getRelaysnullnullidentitygetProfile/getFollows/getList/getZaps/getMutes/...identity:readnullkeysforward,actionkeys:forwardnullkeysregisterAction,unregisterAction,bindingskeys:bindnullmediamedia:controlnullnotifychannel.register,permission.request,permission.resultnotify:channelnullnotifysend,dismiss,badge,clicked,action, ...notify:sendnullstorageget,keysstate:readnullstorageset,removestate:writenullstorageclear)nullnullincemit,channel.emit,channel.broadcastrelay:writerelay:readincsubscribe,unsubscribe,channel.open/list/closerelay:readnullthemeget,get.resulttheme:readnullthemechanged(shell → napplet push)nulltheme:readconfigget,subscribe,unsubscribe,registerSchema,openSettingsconfig:readnullconfigvalues,registerSchema.result,schemaError(shell → napplet pushes)nullconfig:readresourcebytes,bytesMany,cancel(napplet → shell requests)resource:fetchnullresourcebytes*.result,bytes*.error(shell → napplet pushes)nullresource:fetchintentinvoke(napplet → shell)intent:writenullintentavailable,handlers(napplet → shell)intent:readnullintentchanged,*.result,*.error(shell → napplet pushes)nullintent:readnullnullThe
signerdomain is REMOVED — signer messages fall through to the default null/null branch.getPublicKey/getRelaysmigrated toidentity; napplet-visible signing does not exist in NIP-5D (shell signs internally forrelay.publishEncrypted).