mirror of
https://github.com/pezkuwichain/pezkuwi-extension.git
synced 2026-06-12 03:01:08 +00:00
fix: use JS mnemonic generation instead of broken wasm bip39
This commit is contained in:
@@ -325,7 +325,8 @@ export default class Extension {
|
||||
}
|
||||
|
||||
private seedCreate ({ length = SEED_DEFAULT_LENGTH, seed: _seed, type }: RequestSeedCreate): ResponseSeedCreate {
|
||||
const seed = _seed || mnemonicGenerate(length);
|
||||
// Use onlyJs=true because wasm-crypto doesn't implement bip39Generate
|
||||
const seed = _seed || mnemonicGenerate(length, undefined, true);
|
||||
|
||||
return {
|
||||
address: keyring.createFromUri(getSuri(seed, type), {}, type).address,
|
||||
|
||||
@@ -29,6 +29,10 @@ function initializeExtension (): Promise<void> {
|
||||
console.log('crypto initialized');
|
||||
keyring.loadAll({ store: new AccountsStore(), type: 'sr25519' });
|
||||
console.log('initialization completed');
|
||||
})
|
||||
.catch((error): void => {
|
||||
console.error('initialization failed', error);
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user