@vleap/warps-adapter-fastset 0.1.0-beta.49 → 0.1.0-beta.51
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 +12 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1935,7 +1935,7 @@ import {
|
|
|
1935
1935
|
|
|
1936
1936
|
// src/providers/MnemonicWalletProvider.ts
|
|
1937
1937
|
import * as bip39 from "@scure/bip39";
|
|
1938
|
-
import { wordlist } from "@scure/bip39/wordlists/english";
|
|
1938
|
+
import { wordlist } from "@scure/bip39/wordlists/english.js";
|
|
1939
1939
|
import { getWarpWalletMnemonicFromConfig } from "@vleap/warps";
|
|
1940
1940
|
|
|
1941
1941
|
// src/sdk/ed25519-setup.ts
|
|
@@ -2434,6 +2434,7 @@ var MnemonicWalletProvider = _MnemonicWalletProvider;
|
|
|
2434
2434
|
|
|
2435
2435
|
// src/providers/PrivateKeyWalletProvider.ts
|
|
2436
2436
|
import { getWarpWalletPrivateKeyFromConfig } from "@vleap/warps";
|
|
2437
|
+
import * as bip392 from "@scure/bip39";
|
|
2437
2438
|
var _PrivateKeyWalletProvider = class _PrivateKeyWalletProvider {
|
|
2438
2439
|
constructor(config, chain2) {
|
|
2439
2440
|
this.config = config;
|
|
@@ -2476,7 +2477,16 @@ var _PrivateKeyWalletProvider = class _PrivateKeyWalletProvider {
|
|
|
2476
2477
|
return uint8ArrayToHex(signature);
|
|
2477
2478
|
}
|
|
2478
2479
|
create(mnemonic) {
|
|
2479
|
-
|
|
2480
|
+
const seed = bip392.mnemonicToSeedSync(mnemonic);
|
|
2481
|
+
const privateKey = seed.slice(0, 32);
|
|
2482
|
+
const publicKey = ed.getPublicKey(privateKey);
|
|
2483
|
+
const address = FastsetClient.encodeBech32Address(publicKey);
|
|
2484
|
+
return {
|
|
2485
|
+
provider: _PrivateKeyWalletProvider.PROVIDER_NAME,
|
|
2486
|
+
address,
|
|
2487
|
+
privateKey: uint8ArrayToHex(privateKey),
|
|
2488
|
+
mnemonic: null
|
|
2489
|
+
};
|
|
2480
2490
|
}
|
|
2481
2491
|
generate() {
|
|
2482
2492
|
const privateKey = ed.utils.randomSecretKey();
|