@nomicfoundation/hardhat-keystore
Version:
A module for managing keystore files that store a map from IDs to encrypted string values.
63 lines ⢠2.39 kB
JavaScript
import chalk from "chalk";
export class UserDisplayMessages {
static displayInvalidKeyErrorMessage(key) {
return chalk.red(`Invalid value for key: "${key}". Keys can only have alphanumeric characters and underscores, and they cannot start with a number.`);
}
static displayKeyAlreadyExistsWarning(key) {
return chalk.yellow(`The key "${key}" already exists. Use the ${chalk.blue.italic("--force")} flag to overwrite it.`);
}
static displayKeyListInfoMessage(keys) {
let output = "Keys:";
for (const key of keys) {
output += `\n${key}`;
}
return output + "\n";
}
static displayKeyNotFoundErrorMessage(key) {
return chalk.red(`Key "${key}" not found`);
}
static displayKeyRemovedInfoMessage(key) {
return `Key "${key}" deleted`;
}
static displayKeySetInfoMessage(key) {
return `Key "${key}" set`;
}
static displayNoKeysInfoMessage() {
return "The keystore does not contain any keys.";
}
static displayNoKeystoreSetErrorMessage() {
return `No keystore found. Please set one up using ${chalk.blue.italic("npx hardhat keystore set {key}")} `;
}
static displaySecretCannotBeEmptyErrorMessage() {
return chalk.red("The value cannot be empty.");
}
static displayValueInfoMessage(value) {
return `${value}`;
}
static enterSecretMessage() {
return "Enter secret to store";
}
static keystoreBannerMessage() {
return "\nš·š Hardhat-Keystore šš·\n";
}
static passwordSetUpMessage() {
return "This is the first time you are using the keystore, please set a password.";
}
static passwordRequirementsMessage() {
// return "The password must have at least 8 characters, one uppercase letter, one lowercase letter, and one special character.";
return "The password must have at least 8 characters.";
}
static enterPasswordMsg() {
return "Enter the password";
}
static passwordRequirementsError() {
return "Invalid password! It does not meet the required criteria.";
}
static confirmPasswordMessage() {
return "Please confirm your password";
}
static passwordsDoNotMatchError() {
return "Passwords do not match!";
}
}
//# sourceMappingURL=user-display-messages.js.map