@yerofey/cryptowallet-cli 1.3.0 → 1.5.0
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/README.md +6 -6
- package/cli.js +12 -11
- package/package.json +1 -1
- package/src/CW.js +9 -9
- package/src/{Coin.js → Chain.js} +4 -4
- package/src/Method.js +15 -16
- package/src/Wallet.js +21 -18
- package/src/{coins → chains}/BCH.json +0 -0
- package/src/{coins → chains}/BLK.json +0 -0
- package/src/{coins → chains}/BNB.json +0 -0
- package/src/{coins → chains}/BTC.json +0 -0
- package/src/{coins → chains}/BTG.json +0 -0
- package/src/{coins → chains}/DASH.json +0 -0
- package/src/{coins → chains}/DCR.json +0 -0
- package/src/{coins → chains}/DGB.json +0 -0
- package/src/{coins → chains}/DOGE.json +0 -0
- package/src/{coins → chains}/ERC.json +0 -0
- package/src/{coins → chains}/ETC.json +0 -0
- package/src/{coins → chains}/ETH.json +0 -0
- package/src/{coins → chains}/LTC.json +0 -0
- package/src/{coins → chains}/MONA.json +0 -0
- package/src/{coins → chains}/NBT.json +0 -0
- package/src/{coins → chains}/NMC.json +0 -0
- package/src/{coins → chains}/ONE.json +0 -0
- package/src/{coins → chains}/POLYGON.json +0 -0
- package/src/{coins → chains}/PPC.json +0 -0
- package/src/{coins → chains}/QTUM.json +0 -0
- package/src/{coins → chains}/RDD.json +0 -0
- package/src/{coins → chains}/TRX.json +0 -0
- package/src/{coins → chains}/VIA.json +0 -0
- package/src/{coins → chains}/VTC.json +0 -0
- package/src/{coins → chains}/XTZ.json +0 -0
- package/src/{coins → chains}/ZEC.json +0 -0
- package/src/utils.js +6 -6
package/README.md
CHANGED
|
@@ -26,10 +26,10 @@ $ cw -p aaa
|
|
|
26
26
|
# generate random BTC wallet (default format: bech32 - "bc1q...")
|
|
27
27
|
$ cw -c BTC
|
|
28
28
|
|
|
29
|
-
# generate random BTC wallet with desired prefix (case
|
|
29
|
+
# generate random BTC wallet with desired prefix (case-insensitive)
|
|
30
30
|
$ cw -c BTC -p ABC
|
|
31
31
|
|
|
32
|
-
# generate random BTC wallet with desired prefix (case
|
|
32
|
+
# generate random BTC wallet with desired prefix (case-sensitive)
|
|
33
33
|
$ cw -c BTC -P abc
|
|
34
34
|
|
|
35
35
|
# generate BTC legacy wallet ("1...")
|
|
@@ -95,10 +95,10 @@ $ cw -l
|
|
|
95
95
|
* `-l` or `--list`: List all supported cryptocurrencies
|
|
96
96
|
* `-m` or `--mnemonic`: Use a bip39 mnemonic phrase (if is set) to generate wallet, or leave it empty to generate new one
|
|
97
97
|
* `-n` or `--number`: Specify number of wallets to display (works for HD wallets only, like BTC/LTC/DOGE)
|
|
98
|
-
* `-p` or `--prefix`: Specify desired prefix of an wallet address (**case-
|
|
99
|
-
* `-P` or `--prefix-
|
|
100
|
-
* `-s` or `--suffix`: Specify desired suffix of an wallet address (**case-
|
|
101
|
-
* `-S` or `--suffix-
|
|
98
|
+
* `-p` or `--prefix`: Specify desired prefix of an wallet address (**case-insensitive**)
|
|
99
|
+
* `-P` or `--prefix-sensitive`: Specify desired prefix of an wallet address (**case-sensitive**)
|
|
100
|
+
* `-s` or `--suffix`: Specify desired suffix of an wallet address (**case-insensitive**)
|
|
101
|
+
* `-S` or `--suffix-sensitive`: Specify desired suffix of an wallet address (**case-sensitive**)
|
|
102
102
|
* `-v` or `--version`: Display the version of CW tool
|
|
103
103
|
|
|
104
104
|
## Highlights
|
package/cli.js
CHANGED
|
@@ -3,19 +3,20 @@
|
|
|
3
3
|
|
|
4
4
|
const { program } = require('commander');
|
|
5
5
|
const chalk = require('chalk');
|
|
6
|
-
const { log,
|
|
6
|
+
const { log, supportedChains } = require('./src/utils');
|
|
7
7
|
const Method = require('./src/Method');
|
|
8
8
|
|
|
9
|
-
program.option('-
|
|
9
|
+
program.option('-b, --chain <ticker>', 'Wallet for specific blockchain', 'ERC');
|
|
10
|
+
program.option('-c, --chain <ticker>', 'Wallet for specific blockchain', 'ERC');
|
|
10
11
|
program.option('-f, --format <format>', 'Wallet format type (for cryptos with multiple wallet formats)');
|
|
11
12
|
program.option('-g, --geek', 'Display some more info (geeky)');
|
|
12
13
|
program.option('-l, --list', 'List all supported cryptos');
|
|
13
14
|
program.option('-m, --mnemonic [mnemonic]', 'Generate wallet from mnemonic string OR just a mnemonic string');
|
|
14
15
|
program.option('-n, --number <number>', 'Number of wallets to generate (if supported)');
|
|
15
|
-
program.option('-p, --prefix <prefix>', 'Desired wallet prefix
|
|
16
|
-
program.option('-P, --prefix-
|
|
17
|
-
program.option('-s, --suffix <suffix>', 'Desired wallet suffix
|
|
18
|
-
program.option('-S, --suffix-
|
|
16
|
+
program.option('-p, --prefix <prefix>', 'Desired wallet prefix');
|
|
17
|
+
program.option('-P, --prefix-sensitive <prefix>', 'Desired wallet prefix (case-sensitive)');
|
|
18
|
+
program.option('-s, --suffix <suffix>', 'Desired wallet suffix');
|
|
19
|
+
program.option('-S, --suffix-sensitive <suffix>', 'Desired wallet suffix (case-sensitive)');
|
|
19
20
|
program.option('-v, --version', 'Display cryptowallet version');
|
|
20
21
|
program.parse();
|
|
21
22
|
|
|
@@ -34,13 +35,13 @@ program.parse();
|
|
|
34
35
|
return new Method('version').init();
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
38
|
+
const chain = (options.chain).toUpperCase() || '';
|
|
39
|
+
if (supportedChains.includes(chain)) {
|
|
39
40
|
return new Method('wallet', {
|
|
40
|
-
|
|
41
|
-
options
|
|
41
|
+
chain,
|
|
42
|
+
options,
|
|
42
43
|
}).init();
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
log(chalk.red('⛔️ Error:
|
|
46
|
+
log(chalk.red('⛔️ Error: this blockchain is not supported!'));
|
|
46
47
|
})();
|
package/package.json
CHANGED
package/src/CW.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Chain = require('./Chain');
|
|
2
2
|
const { Wallet } = require('./Wallet');
|
|
3
3
|
|
|
4
4
|
class CW {
|
|
5
|
-
constructor(
|
|
5
|
+
constructor(chain, options = {}) {
|
|
6
6
|
const defaultValues = {
|
|
7
|
-
|
|
7
|
+
chain: chain || options.chain || '',
|
|
8
8
|
format: '',
|
|
9
9
|
geek: false,
|
|
10
10
|
mnemonic: '',
|
|
11
11
|
number: 1,
|
|
12
|
-
prefix: options.
|
|
13
|
-
|
|
14
|
-
suffix: options.
|
|
15
|
-
|
|
12
|
+
prefix: options.prefixSensitive || '',
|
|
13
|
+
prefixIsCaseSensitive: options.prefixSensitive !== undefined,
|
|
14
|
+
suffix: options.suffixSensitive || '',
|
|
15
|
+
suffixIsCaseSensitive: options.suffixSensitive !== undefined,
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
for (const key of Object.keys(defaultValues)) {
|
|
@@ -21,9 +21,9 @@ class CW {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
this.
|
|
24
|
+
this.chain = chain;
|
|
25
25
|
this.options = options;
|
|
26
|
-
this.row = new
|
|
26
|
+
this.row = new Chain(chain, options.format).row;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
async init() {
|
package/src/{Coin.js → Chain.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
class
|
|
2
|
-
constructor(
|
|
3
|
-
const content = require('./
|
|
1
|
+
class Chain {
|
|
2
|
+
constructor(chain, format) {
|
|
3
|
+
const content = require('./chains/' + chain + '.json') || {};
|
|
4
4
|
const data = (() => {
|
|
5
5
|
if (content.formats !== undefined) {
|
|
6
6
|
if (format != '' && format != content.defaultFormat) {
|
|
@@ -25,4 +25,4 @@ class Coin {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
module.exports =
|
|
28
|
+
module.exports = Chain;
|
package/src/Method.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const chalk = require('chalk');
|
|
2
2
|
const columnify = require('columnify');
|
|
3
|
-
const { log,
|
|
3
|
+
const { log, supportedChains } = require('./utils');
|
|
4
4
|
const { generateMnemonicString } = require('./Wallet');
|
|
5
5
|
const selfInfo = require('../package.json');
|
|
6
6
|
const CW = require('./CW');
|
|
@@ -15,10 +15,10 @@ class Method {
|
|
|
15
15
|
const callMethod = {
|
|
16
16
|
'_': () => {},
|
|
17
17
|
'list': () => {
|
|
18
|
-
log(`🔠 All supported
|
|
18
|
+
log(`🔠 All supported blockchains:\n`);
|
|
19
19
|
let cryptos = {};
|
|
20
|
-
for (const val of
|
|
21
|
-
const data = require('./
|
|
20
|
+
for (const val of supportedChains) {
|
|
21
|
+
const data = require('./chains/' + val + '.json');
|
|
22
22
|
let title = data.title || '';
|
|
23
23
|
if (title == '' || val == 'ERC') {
|
|
24
24
|
continue;
|
|
@@ -30,7 +30,7 @@ class Method {
|
|
|
30
30
|
columnSplitter: ' - ',
|
|
31
31
|
}));
|
|
32
32
|
log();
|
|
33
|
-
log(`ℹ️ Use flag "-c TICKER" to select specific
|
|
33
|
+
log(`ℹ️ Use flag "-c TICKER" to select specific blockchain`);
|
|
34
34
|
},
|
|
35
35
|
'mnemonic': () => {
|
|
36
36
|
log(`✨ ${chalk.green('Done!')} ${chalk.blueBright('Here is your randomly generated 12 words mnemonic string:')}\n`);
|
|
@@ -42,23 +42,23 @@ class Method {
|
|
|
42
42
|
log(selfInfo.version);
|
|
43
43
|
},
|
|
44
44
|
'wallet': async () => {
|
|
45
|
-
const
|
|
45
|
+
const chain = this.params.chain;
|
|
46
46
|
const options = this.params.options;
|
|
47
47
|
|
|
48
|
-
const cw = await new CW(
|
|
48
|
+
const cw = await new CW(chain, options).init();
|
|
49
49
|
|
|
50
|
-
let
|
|
50
|
+
let chainFullName = (cw.row.name || chain) + (cw.wallet.format !== undefined && cw.wallet.format != '' ? ' (' + cw.wallet.format + ')' : '');
|
|
51
51
|
|
|
52
52
|
if (cw.options.prefix && !cw.prefixFound) {
|
|
53
|
-
log(`😢 ${chalk.yellow('Sorry, ' +
|
|
53
|
+
log(`😢 ${chalk.yellow('Sorry, ' + chainFullName + ' does not support prefix yet...')}`);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
if (cw.options.suffix && !cw.suffixFound) {
|
|
57
|
-
log(`😢 ${chalk.yellow('Sorry, ' +
|
|
57
|
+
log(`😢 ${chalk.yellow('Sorry, ' + chainFullName + ' does not support suffix yet...')}`);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
if (cw.options.mnemonic != '' && cw.wallet.mnemonic == undefined) {
|
|
61
|
-
log(`😢 ${chalk.yellow('Sorry, ' +
|
|
61
|
+
log(`😢 ${chalk.yellow('Sorry, ' + chainFullName + ' does not support mnemonic yet...')}`);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
if (cw.wallet.error !== undefined) {
|
|
@@ -68,13 +68,13 @@ class Method {
|
|
|
68
68
|
|
|
69
69
|
// prefix, suffix
|
|
70
70
|
if (cw.prefixFound && cw.suffixFound) {
|
|
71
|
-
log(`✨ ${chalk.green('Done!')} ${chalk.blueBright('Here is your brand new ' +
|
|
71
|
+
log(`✨ ${chalk.green('Done!')} ${chalk.blueBright('Here is your brand new ' + chainFullName + ' wallet with "' + cw.options.prefix + '" prefix and "' + cw.options.suffix + '" suffix:')}\n`);
|
|
72
72
|
} else if (cw.prefixFound) {
|
|
73
|
-
log(`✨ ${chalk.green('Done!')} ${chalk.blueBright('Here is your brand new ' +
|
|
73
|
+
log(`✨ ${chalk.green('Done!')} ${chalk.blueBright('Here is your brand new ' + chainFullName + ' wallet with "' + cw.options.prefix + '" prefix:')}\n`);
|
|
74
74
|
} else if (cw.suffixFound) {
|
|
75
|
-
log(`✨ ${chalk.green('Done!')} ${chalk.blueBright('Here is your brand new ' +
|
|
75
|
+
log(`✨ ${chalk.green('Done!')} ${chalk.blueBright('Here is your brand new ' + chainFullName + ' wallet with "' + cw.options.suffix + '" suffix:')}\n`);
|
|
76
76
|
} else {
|
|
77
|
-
log(`✨ ${chalk.green('Done!')} ${chalk.blueBright('Here is your brand new ' +
|
|
77
|
+
log(`✨ ${chalk.green('Done!')} ${chalk.blueBright('Here is your brand new ' + chainFullName + ' wallet:')}\n`);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
// result
|
|
@@ -94,7 +94,6 @@ class Method {
|
|
|
94
94
|
|
|
95
95
|
if (cw.prefixFound && cw.prefixFoundInWallets.includes(item.address) && cw.suffixFound && cw.suffixFoundInWallets.includes(item.address)) {
|
|
96
96
|
// highlight found prefix
|
|
97
|
-
// log(`👛 ${item.address}`);
|
|
98
97
|
const addressCutPrefixLength = cw.row.startsWith.length + cw.options.prefix.length;
|
|
99
98
|
const addressFirstPart = item.address.slice(cw.row.startsWith.length, addressCutPrefixLength);
|
|
100
99
|
const addressLastPart = item.address.slice(item.address.length - cw.options.suffix.length);
|
package/src/Wallet.js
CHANGED
|
@@ -11,7 +11,10 @@ class Wallet {
|
|
|
11
11
|
const row = cw.row;
|
|
12
12
|
const options = cw.options;
|
|
13
13
|
|
|
14
|
-
const
|
|
14
|
+
const desiredSymbolsArray = (options.prefix.length > 0 || options.suffix.length > 0) ? options.prefix.split('').concat(options.suffix.split('')) : [];
|
|
15
|
+
const desiredSymbolsUniqueArray = desiredSymbolsArray.filter((item, pos) => desiredSymbolsArray.indexOf(item) === pos);
|
|
16
|
+
const badSymbolsArray = desiredSymbolsUniqueArray.filter(char => !RegExp(row.prefixTest, 'g').test(char)) || [];
|
|
17
|
+
|
|
15
18
|
let wallet = {};
|
|
16
19
|
let prefixFound = false;
|
|
17
20
|
let prefixFoundInWallets = [];
|
|
@@ -21,8 +24,8 @@ class Wallet {
|
|
|
21
24
|
let onlySuffix = false;
|
|
22
25
|
let onlyBoth = false;
|
|
23
26
|
|
|
24
|
-
const prefixFoundInAddress = (address,
|
|
25
|
-
const suffixFoundInAddress = (address,
|
|
27
|
+
const prefixFoundInAddress = (address, isCaseSensitive, prefix, symbol) => (isCaseSensitive && address.startsWith(symbol + '' + prefix) || !isCaseSensitive && (address).toUpperCase().startsWith((symbol + '' + prefix).toUpperCase()));
|
|
28
|
+
const suffixFoundInAddress = (address, isCaseSensitive, suffix) => (isCaseSensitive && address.endsWith(suffix) || !isCaseSensitive && (address).toUpperCase().endsWith(suffix));
|
|
26
29
|
|
|
27
30
|
if (options.prefix && row.flags.includes('p') || options.suffix && row.flags.includes('s')) {
|
|
28
31
|
if (badSymbolsArray.length === 0) {
|
|
@@ -49,34 +52,34 @@ class Wallet {
|
|
|
49
52
|
wallet = await this.createWallet();
|
|
50
53
|
for (let firstSymbol of startsWithSymbols) {
|
|
51
54
|
if (wallet.address !== undefined) { // one address
|
|
52
|
-
if (onlyPrefix && prefixFoundInAddress(wallet.address, options.
|
|
55
|
+
if (onlyPrefix && prefixFoundInAddress(wallet.address, options.prefixIsCaseSensitive, options.prefix, firstSymbol)) {
|
|
53
56
|
prefixFound = true;
|
|
54
57
|
break loop;
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
if (onlySuffix && suffixFoundInAddress(wallet.address, options.
|
|
60
|
+
if (onlySuffix && suffixFoundInAddress(wallet.address, options.suffixIsCaseSensitive, options.suffix)) {
|
|
58
61
|
suffixFound = true;
|
|
59
62
|
break loop;
|
|
60
63
|
}
|
|
61
64
|
|
|
62
|
-
if (onlyBoth && prefixFoundInAddress(wallet.address, options.
|
|
65
|
+
if (onlyBoth && prefixFoundInAddress(wallet.address, options.prefixIsCaseSensitive, options.prefix, firstSymbol) && suffixFoundInAddress(wallet.address, options.suffixIsCaseSensitive, options.suffix)) {
|
|
63
66
|
prefixFound = true;
|
|
64
67
|
suffixFound = true;
|
|
65
68
|
break loop;
|
|
66
69
|
}
|
|
67
70
|
} else if (wallet.addresses !== undefined) { // multiple addresses
|
|
68
71
|
for (let item of wallet.addresses) {
|
|
69
|
-
if (onlyPrefix && prefixFoundInAddress(item.address, options.
|
|
72
|
+
if (onlyPrefix && prefixFoundInAddress(item.address, options.prefixIsCaseSensitive, options.prefix, firstSymbol)) {
|
|
70
73
|
prefixFound = true;
|
|
71
74
|
prefixFoundInWallets.push(item.address);
|
|
72
75
|
}
|
|
73
76
|
|
|
74
|
-
if (onlySuffix && suffixFoundInAddress(item.address, options.
|
|
77
|
+
if (onlySuffix && suffixFoundInAddress(item.address, options.suffixIsCaseSensitive, options.suffix)) {
|
|
75
78
|
suffixFound = true;
|
|
76
79
|
suffixFoundInWallets.push(item.address);
|
|
77
80
|
}
|
|
78
81
|
|
|
79
|
-
if (onlyBoth && prefixFoundInAddress(item.address, options.
|
|
82
|
+
if (onlyBoth && prefixFoundInAddress(item.address, options.prefixIsCaseSensitive, options.prefix, firstSymbol) && suffixFoundInAddress(item.address, options.suffixIsCaseSensitive, options.suffix)) {
|
|
80
83
|
prefixFound = true;
|
|
81
84
|
prefixFoundInWallets.push(item.address);
|
|
82
85
|
suffixFound = true;
|
|
@@ -117,7 +120,7 @@ class Wallet {
|
|
|
117
120
|
|
|
118
121
|
async createWallet() {
|
|
119
122
|
const cw = this.cw;
|
|
120
|
-
const
|
|
123
|
+
const chain = cw.chain;
|
|
121
124
|
const row = cw.row;
|
|
122
125
|
const options = cw.options;
|
|
123
126
|
|
|
@@ -128,7 +131,7 @@ class Wallet {
|
|
|
128
131
|
|
|
129
132
|
if (row.length == 0) {
|
|
130
133
|
return {
|
|
131
|
-
error: '
|
|
134
|
+
error: 'this blockchain is not found',
|
|
132
135
|
}
|
|
133
136
|
}
|
|
134
137
|
|
|
@@ -136,7 +139,7 @@ class Wallet {
|
|
|
136
139
|
const CoinKey = require('coinkey');
|
|
137
140
|
const CoinInfo = require('coininfo');
|
|
138
141
|
|
|
139
|
-
const wallet = CoinKey.createRandom(CoinInfo(
|
|
142
|
+
const wallet = CoinKey.createRandom(CoinInfo(chain).versions);
|
|
140
143
|
|
|
141
144
|
result = Object.assign(result, {
|
|
142
145
|
format,
|
|
@@ -146,7 +149,7 @@ class Wallet {
|
|
|
146
149
|
privateKey: wallet.privateWif,
|
|
147
150
|
}]
|
|
148
151
|
});
|
|
149
|
-
} else if (
|
|
152
|
+
} else if (chain == 'BTC') {
|
|
150
153
|
const bip39 = require('bip39');
|
|
151
154
|
const { fromMnemonic, fromZPrv } = require('bip84');
|
|
152
155
|
|
|
@@ -178,7 +181,7 @@ class Wallet {
|
|
|
178
181
|
privateExtendedKey: account.getAccountPrivateKey(),
|
|
179
182
|
mnemonic
|
|
180
183
|
});
|
|
181
|
-
} else if (
|
|
184
|
+
} else if (chain == 'DOGE' || chain == 'LTC') {
|
|
182
185
|
const bip39 = require('bip39');
|
|
183
186
|
const { fromMnemonic, fromZPrv } = require('@yerofey/' + row.title.toLowerCase() + '-bip84');
|
|
184
187
|
|
|
@@ -292,7 +295,7 @@ class Wallet {
|
|
|
292
295
|
addresses,
|
|
293
296
|
mnemonic,
|
|
294
297
|
});
|
|
295
|
-
} else if (
|
|
298
|
+
} else if (chain == 'ONE') {
|
|
296
299
|
const bip39 = require('bip39');
|
|
297
300
|
const { Wallet } = require('@harmony-js/account');
|
|
298
301
|
|
|
@@ -316,7 +319,7 @@ class Wallet {
|
|
|
316
319
|
}],
|
|
317
320
|
mnemonic,
|
|
318
321
|
});
|
|
319
|
-
} else if (
|
|
322
|
+
} else if (chain == 'TRX') {
|
|
320
323
|
const tronWeb = require('tronweb');
|
|
321
324
|
|
|
322
325
|
try {
|
|
@@ -334,7 +337,7 @@ class Wallet {
|
|
|
334
337
|
error
|
|
335
338
|
}
|
|
336
339
|
}
|
|
337
|
-
} else if (
|
|
340
|
+
} else if (chain == 'XTZ') {
|
|
338
341
|
const tezos = require('tezos-sign');
|
|
339
342
|
const wallet = tezos.generateKeysNoSeed();
|
|
340
343
|
|
|
@@ -347,7 +350,7 @@ class Wallet {
|
|
|
347
350
|
});
|
|
348
351
|
} else {
|
|
349
352
|
return {
|
|
350
|
-
error: '
|
|
353
|
+
error: 'your desired blockchain is not supported yet'
|
|
351
354
|
}
|
|
352
355
|
}
|
|
353
356
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/utils.js
CHANGED
|
@@ -13,13 +13,13 @@ const filesList = (dir) => {
|
|
|
13
13
|
|
|
14
14
|
const objectHasAllKeys = (obj, keysArray) => keysArray.every(item => obj.hasOwnProperty(item));
|
|
15
15
|
|
|
16
|
-
let
|
|
17
|
-
const
|
|
18
|
-
filesList(
|
|
19
|
-
const name = item.replace(
|
|
20
|
-
|
|
16
|
+
let supportedChains = [];
|
|
17
|
+
const chainsFolder = __dirname + '/chains/';
|
|
18
|
+
filesList(chainsFolder).forEach((item) => {
|
|
19
|
+
const name = item.replace(chainsFolder, '').replace('.json', '');
|
|
20
|
+
supportedChains.push(name);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
module.exports.log = log;
|
|
24
24
|
module.exports.objectHasAllKeys = objectHasAllKeys;
|
|
25
|
-
module.exports.
|
|
25
|
+
module.exports.supportedChains = supportedChains;
|