For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get active public key

ArConnect Injected API getActivePublicKey() function

This function allows you to get the public key of the currently active wallet in Wander.

Note: This function requires the ACCESS_PUBLIC_KEY permission.

Example usage

// connect to the extension
await window.arweaveWallet.connect(["ACCESS_PUBLIC_KEY"]);

// obtain the user's public key
const publicKey = await window.arweaveWallet.getActivePublicKey();

console.log("JWK.n field is:", publicKey);

// create public key JWK
const publicJWK: JsonWebKey = {
    e: "AQAB",
    ext: true,
    kty: "RSA",
    n: publicKey
};

// import it with webcrypto, etc.

Last updated

Was this helpful?