thor-builtin 1.1.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/wallet.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  declare const SoloDefault: {
2
2
  mnemonic: string;
3
+ privKeys: string[];
3
4
  accounts: string[];
4
5
  };
5
6
  declare const HDWalletDerivationPath = "m/44'/818'/0'/0";
package/dist/wallet.js CHANGED
@@ -4,14 +4,17 @@ exports.HDWalletDerivationPath = exports.SoloDefault = void 0;
4
4
  const thor_devkit_1 = require("thor-devkit");
5
5
  const word = 'denial kitchen pet squirrel other broom bar gas better priority spoil cross';
6
6
  const hdNode = thor_devkit_1.HDNode.fromMnemonic(word.split(' '));
7
- let defaultAccounts = [];
7
+ let privKeys = [];
8
+ let accounts = [];
8
9
  for (let i = 0; i < 10; i++) {
9
10
  const priv = hdNode.derive(i).privateKey;
10
- defaultAccounts.push('0x' + (priv === null || priv === void 0 ? void 0 : priv.toString('hex')));
11
+ privKeys.push('0x' + (priv === null || priv === void 0 ? void 0 : priv.toString('hex')));
12
+ accounts.push(thor_devkit_1.address.fromPublicKey(priv));
11
13
  }
12
14
  const SoloDefault = {
13
15
  mnemonic: word,
14
- accounts: defaultAccounts
16
+ privKeys: privKeys,
17
+ accounts: accounts
15
18
  };
16
19
  exports.SoloDefault = SoloDefault;
17
20
  const HDWalletDerivationPath = `m/44'/818'/0'/0`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thor-builtin",
3
- "version": "1.1.0",
3
+ "version": "2.0.0",
4
4
  "description": "Addresses and ABIs of the built-in contracts deployed on the VeChain Thor blockchain.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/wallet.ts CHANGED
@@ -1,17 +1,20 @@
1
- import { HDNode } from 'thor-devkit'
1
+ import { HDNode, address } from 'thor-devkit'
2
2
 
3
3
  const word = 'denial kitchen pet squirrel other broom bar gas better priority spoil cross'
4
4
  const hdNode = HDNode.fromMnemonic(word.split(' '))
5
5
 
6
- let defaultAccounts: string[] = []
6
+ let privKeys: string[] = []
7
+ let accounts: string[] = []
7
8
  for (let i = 0; i < 10; i++) {
8
9
  const priv = hdNode.derive(i).privateKey
9
- defaultAccounts.push('0x' + priv?.toString('hex'))
10
+ privKeys.push('0x' + priv?.toString('hex'))
11
+ accounts.push(address.fromPublicKey(<Buffer>priv))
10
12
  }
11
13
 
12
14
  const SoloDefault = {
13
15
  mnemonic: word,
14
- accounts: defaultAccounts
16
+ privKeys: privKeys,
17
+ accounts: accounts
15
18
  }
16
19
 
17
20
  const HDWalletDerivationPath = `m/44'/818'/0'/0`