UNPKG

@nomicfoundation/hardhat-keystore

Version:

A module for managing keystore files that store a map from IDs to encrypted string values.

28 lines (23 loc) 934 B
import path from "node:path"; import { getConfigDir } from "@nomicfoundation/hardhat-utils/global-dir"; /** * Get the path for the keystore in the Hardhat global config directory. */ export async function getKeystoreFilePath(): Promise<string> { const configDirPath = await getConfigDir(); return path.join(configDirPath, "keystore.json"); } /** * Get the path for the development keystore in the Hardhat global config directory. */ export async function getDevKeystoreFilePath(): Promise<string> { const configDirPath = await getConfigDir(); return path.join(configDirPath, "dev.keystore.json"); } /** * Get the path for the file containing the unencrypted password for the development keystore in the Hardhat global config directory. */ export async function getDevKeystorePasswordFilePath(): Promise<string> { const configDirPath = await getConfigDir(); return path.join(configDirPath, "hardhat.checksum"); }