Skip to main content

index/functions/ethereumAddressOfAccount.md

ethereumAddressOfAccount(account): string | undefined

The 0x-prefixed Ethereum address a Gala account is signed by, or undefined when the account names no key (a client| alias or a bare GalaChain id is not derivable from a key). Accepts 0x plus 40 hex digits and eth| plus 40 hex digits; the caller's casing is kept. eth|0x... is not an address form and is refused. For LazyPrivateKeySignerOptions.expectedAddress, which should only be set for an account whose key can be checked.

Parameters​

ParameterType
accountstring

Returns​

string | undefined

Example​

createLazyPrivateKeySigner(getKey, { expectedAddress: ethereumAddressOfAccount(account) });

Throws​

GalaSDKError INVALID_ETH_USER_REF_PREFIX for eth|0x... (refused, never read as "names no key", which would switch a signer's address check off).