@nomicfoundation/hardhat-keystore
Version:
A module for managing keystore files that store a map from IDs to encrypted string values.
21 lines (17 loc) • 619 B
text/typescript
import type { KeystoreLoader } from "../types.js";
import type { HardhatConfig } from "hardhat/types/config";
import { FileManagerImpl } from "../loaders/file-manager.js";
import { KeystoreFileLoader } from "../loaders/keystore-file-loader.js";
/**
* Factory for setting up the keyloader based on the
* keystore file path from the hre config.
*/
export function setupKeystoreLoaderFrom({
config,
}: {
config: HardhatConfig;
}): KeystoreLoader {
const keystoreFilePath = config.keystore.filePath;
const fileManager = new FileManagerImpl();
return new KeystoreFileLoader(keystoreFilePath, fileManager);
}