ssi.nostr.getPublicKey()
Return public key set as primary currently. During the execution process, an internal authorization check is performed similar to browser.ssi.askConsent
.
Syntax
const promiseValue = await window.ssi.nostr.getPublicKey(
options, // optional object
)
Parameters
options(optional)
object
. Not implemented
Return value
A Promise that will be fulfilled with a string
of public key.
Exceptions
Throw error If failed to get public key.
Examples
Getting public key in NIP-07
const pubkey = await window.ssi.nostr.getPublicKey()
if (!pubkey) {
throw new Error("Failed to get public key");
}
console.log(pubkey)
// "3327e31cfbef92d143c699e1559e207d977639303d81bb132d9541bff99af3b4"
This documentation is derived from window.ssi.type.ts in gecko-dev-for-ssi.