@leofcoin/chain 1.5.24 → 1.5.26

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.
@@ -1,37 +0,0 @@
1
- import { M as MultiWallet, e as encrypt, b as base58$1 } from './node-browser-c27ce598.js';
2
- import './index-b3d08518.js';
3
-
4
- /**
5
- * @params {String} network
6
- * @return {object} { identity, accounts, config }
7
- */
8
- var index = async (password, network) => {
9
- if (!password)
10
- throw new Error('wallets need to be password protected.');
11
- let wallet = new MultiWallet(network);
12
- /**
13
- * @type {string}
14
- */
15
- let mnemonic = await wallet.generate(password);
16
- wallet = new MultiWallet(network);
17
- await wallet.recover(mnemonic, password, network);
18
- mnemonic = new Uint8Array(await encrypt(password, mnemonic));
19
- const multiWIF = new Uint8Array(await encrypt(password, await wallet.multiWIF));
20
- /**
21
- * @type {object}
22
- */
23
- const external = await wallet.account(1).external(1);
24
- const externalAddress = await external.address;
25
- const internal = await wallet.account(1).internal(1);
26
- const internalAddress = await internal.address;
27
- return {
28
- identity: {
29
- mnemonic: base58$1.encode(mnemonic),
30
- multiWIF: base58$1.encode(multiWIF),
31
- walletId: await external.id
32
- },
33
- accounts: [['main account', externalAddress, internalAddress]]
34
- };
35
- };
36
-
37
- export { index as default };