conseiljs-softsigner
Advanced tools
Comparing version 5.0.1-beta.3 to 5.0.1-beta.4
/// <reference types="node" /> | ||
import { KeyStore } from 'conseiljs'; | ||
export declare namespace KeyStoreUtils { | ||
function generateMnemonic(strength?: number): Promise<string>; | ||
function generateIdentity(strength?: number, password?: string, mnemonic?: string): Promise<KeyStore>; | ||
function restoreIdentityFromSecretKey(secretKey: string): Promise<KeyStore>; | ||
function restoreIdentityFromMnemonic(mnemonic: string, password: string, pkh?: string, derivationPath?: string): Promise<KeyStore>; | ||
function restoreIdentityFromMnemonic(mnemonic: string, password?: string, pkh?: string, derivationPath?: string): Promise<KeyStore>; | ||
function restoreIdentityFromFundraiser(mnemonic: string, email: string, password: string, pkh: string): Promise<KeyStore>; | ||
@@ -8,0 +9,0 @@ function generateKeys(seed: Buffer): Promise<{ |
@@ -25,2 +25,8 @@ "use strict"; | ||
(function (KeyStoreUtils) { | ||
function generateMnemonic(strength = 256) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return bip39.generateMnemonic(strength); | ||
}); | ||
} | ||
KeyStoreUtils.generateMnemonic = generateMnemonic; | ||
function generateIdentity(strength = 256, password = '', mnemonic) { | ||
@@ -42,3 +48,3 @@ return __awaiter(this, void 0, void 0, function* () { | ||
KeyStoreUtils.restoreIdentityFromSecretKey = restoreIdentityFromSecretKey; | ||
function restoreIdentityFromMnemonic(mnemonic, password, pkh, derivationPath) { | ||
function restoreIdentityFromMnemonic(mnemonic, password = '', pkh, derivationPath) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -51,3 +57,3 @@ if (![12, 15, 18, 21, 24].includes(mnemonic.split(' ').length)) { | ||
} | ||
const seed = (yield bip39.mnemonicToSeed(mnemonic, password)).slice(0, 32); | ||
const seed = (yield bip39.mnemonicToSeed(mnemonic.split(' ').join(''), password)).slice(0, 32); | ||
const keys = yield generateKeys(seed); | ||
@@ -54,0 +60,0 @@ const secretKey = conseiljs_2.TezosMessageUtils.readKeyWithHint(keys.secretKey, 'edsk'); |
{ | ||
"name": "conseiljs-softsigner", | ||
"version": "5.0.1-beta.3", | ||
"version": "5.0.1-beta.4", | ||
"description": "ConseilJS software signer plugin for ConseilJS-core. Supports the ED25519 curve via libsodium for tz1-address operations.", | ||
@@ -5,0 +5,0 @@ "browser": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36755
308