avalanche_getAccountPubKey
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
stringThe EVM public key of the active account.
xp
stringThe X and P chain public key of the active account.
Errors
Code | Message |
---|---|
4001 | User rejected the request. |
-32602 | There is no active account |
-32602 | Can not find public key for the given index |
-32602 | Unable to get public key |
-32602 | This account does not have its public key imported |
-32602 | Public key is not known for Fireblocks accounts |
-32602 | This account does not have its public key imported |
Example
Request
await window.ethereum.request({
"method": "avalanche_getAccountPubKey",
"params": []
});
Result
{
"evm": "03f083f3aeada2222e49d1f9616fe966e90a758b31b33893bb46087ba11de5491b",
"xp": "022ac8b32f6667bf9055f3123ad7a733fd12ae20f80fa920bf4ef425c62d30555e"
}