Skip to main content

avalanche_getAccountPubKey

Core

This method returns the public keys associated with the active account of the Core wallet. It provides both EVM and P-chain keys.

Params

(0)

Result

(PublicKeyDetails)
evm
string
required

The EVM public key of the active account.

xp
string
required

The X and P chain public key of the active account.

Errors

CodeMessage
4001User rejected the request.
-32602There is no active account
-32602Can not find public key for the given index
-32602Unable to get public key
-32602This account does not have its public key imported
-32602Public key is not known for Fireblocks accounts
-32602This account does not have its public key imported

Example

Request

await window.ethereum.request({
"method": "avalanche_getAccountPubKey",
"params": []
});

Result

{
"evm": "03f083f3aeada2222e49d1f9616fe966e90a758b31b33893bb46087ba11de5491b",
"xp": "022ac8b32f6667bf9055f3123ad7a733fd12ae20f80fa920bf4ef425c62d30555e"
}

Request

await window.ethereum.request({
"method": "avalanche_getAccountPubKey",
"params": []
});

Was this page helpful?