@vleap/warps-adapter-fastset 0.1.0-beta.54 → 0.1.0-beta.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2425,7 +2425,8 @@ var _MnemonicWalletProvider = class _MnemonicWalletProvider {
2425
2425
  return uint8ArrayToHex(signature);
2426
2426
  }
2427
2427
  async importFromMnemonic(mnemonic) {
2428
- const seed = bip39.mnemonicToSeedSync(mnemonic);
2428
+ const trimmedMnemonic = (0, import_warps5.normalizeAndValidateMnemonic)(mnemonic);
2429
+ const seed = bip39.mnemonicToSeedSync(trimmedMnemonic);
2429
2430
  const privateKey = seed.slice(0, 32);
2430
2431
  const publicKey = ed.getPublicKey(privateKey);
2431
2432
  const address = FastsetClient.encodeBech32Address(publicKey);
@@ -2433,7 +2434,7 @@ var _MnemonicWalletProvider = class _MnemonicWalletProvider {
2433
2434
  provider: _MnemonicWalletProvider.PROVIDER_NAME,
2434
2435
  address,
2435
2436
  privateKey: uint8ArrayToHex(privateKey),
2436
- mnemonic
2437
+ mnemonic: trimmedMnemonic
2437
2438
  };
2438
2439
  (0, import_warps5.setWarpWalletInConfig)(this.config, this.chain.name, walletDetails);
2439
2440
  return walletDetails;
@@ -2465,7 +2466,9 @@ var _MnemonicWalletProvider = class _MnemonicWalletProvider {
2465
2466
  };
2466
2467
  }
2467
2468
  async generate() {
2468
- const mnemonic = bip39.generateMnemonic(import_english.wordlist);
2469
+ const mnemonicRaw = bip39.generateMnemonic(import_english.wordlist, 256);
2470
+ const mnemonic = (0, import_warps5.normalizeMnemonic)(mnemonicRaw);
2471
+ (0, import_warps5.validateMnemonicLength)(mnemonic);
2469
2472
  const seed = bip39.mnemonicToSeedSync(mnemonic);
2470
2473
  const privateKey = seed.slice(0, 32);
2471
2474
  const publicKey = ed.getPublicKey(privateKey);