Skip to main content

index/functions/getEthereumAddressFromPrivateKey.md

getEthereumAddressFromPrivateKey(privateKey): string

The Ethereum account of a private key: 0x plus the EIP-55 checksummed digits (for the GalaChain spelling, eth| plus the same digits).

Parameters​

ParameterTypeDescription
privateKeystring0x plus 64 hex digits.

Returns​

string

Throws​

GalaSDKError INVALID_PRIVATE_KEY (bad_encoding, not_on_curve).

Example​

getEthereumAddressFromPrivateKey(key); // '0x70997970C51812dc3A010C7d01b50e0d17dc79C8'