Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
encrypt(password: Bytes | string, options?: any, progressCallback?: ProgressCallback): Promise {
if (typeof(options) === "function" && !progressCallback) {
progressCallback = options;
options = {};
}
if (progressCallback && typeof(progressCallback) !== "function") {
throw new Error("invalid callback");
}
if (!options) { options = {}; }
return encryptKeystore(this, password, options, progressCallback);
}
encrypt(password, options, progressCallback) {
if (typeof (options) === "function" && !progressCallback) {
progressCallback = options;
options = {};
}
if (progressCallback && typeof (progressCallback) !== "function") {
throw new Error("invalid callback");
}
if (!options) {
options = {};
}
return encryptKeystore(this, password, options, progressCallback);
}
/**
Wallet.prototype.encrypt = function (password, options, progressCallback) {
if (typeof (options) === "function" && !progressCallback) {
progressCallback = options;
options = {};
}
if (progressCallback && typeof (progressCallback) !== "function") {
throw new Error("invalid callback");
}
if (!options) {
options = {};
}
return json_wallets_1.encryptKeystore(this, password, options, progressCallback);
};
/**