Skip to content
Docs

Client: wallets

Import an EVM keystore file

Decrypt Ethereum JSON keystore V3 into an EVM private-key wallet.

Overview

Decrypts an Ethereum JSON keystore V3 file and imports it as an EVM private_key wallet (all EVM chains on the allowlist). Duplicate check is address-based—same as importPrivateKey.

Signature

js
await client.wallets.importEvmKeystore(options)

Parameters

ImportEvmKeystoreOptions

FieldRequiredDescription
jsonYes`string | object` — Ethereum JSON keystore V3.
passwordYes`string` — decrypts the JSON file (MetaMask / export PIN).
storagePasswordNo`string` — Gray3 keystore PIN when storage is encrypted. Defaults to `password` if omitted.
labelNo`string` — UI name.

Response

Promise<Wallet> — kind: "private_key", EVM only

ts
{
  id: string;
  label: string;
  kind: "private_key";
  enabledChains: GrayChainId[]; // enabled EVM chains
}

Usage

js
await client.wallets.importEvmKeystore({
  json: keystoreJson,
  password: "file-pin",
  storagePassword: pin,
  label: "From MetaMask",
});

Throws

FieldRequiredDescription
conflictNoDerived EVM address already imported / watched.
unauthorizedNoWrong file password, or wrong Gray3 storage PIN.
invalid_argumentNoMalformed keystore JSON.