How to use the @ethersproject/json-wallets.encryptKeystore function in @ethersproject/json-wallets

To help you get started, we’ve selected a few @ethersproject/json-wallets examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ethers-io / ethers.js / packages / wallet / src.ts / index.ts View on Github external
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);
    }
github ethers-io / ethers.js / packages / wallet / lib.esm / index.js View on Github external
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);
    }
    /**
github ethers-io / ethers.js / packages / wallet / index.js View on Github external
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);
    };
    /**

@ethersproject/json-wallets

Wallet management utilities for KeyStore and Crowdsale JSON wallets.

MIT
Latest version published 2 years ago

Package Health Score

59 / 100
Full package analysis