fix: use JS mnemonic generation instead of broken wasm bip39

This commit is contained in:
2026-02-02 20:45:54 +03:00
parent f5495f7cac
commit df7ad72047
2 changed files with 6 additions and 1 deletions
@@ -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,
+4
View File
@@ -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;
});
}