@yerofey/cryptowallet-cli 1.13.0 → 1.14.1

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/cli.js CHANGED
@@ -19,6 +19,10 @@ import Method from './src/Method.js';
19
19
  return new Method('version').init();
20
20
  }
21
21
 
22
+ if (options.donate) {
23
+ return new Method('donate').init();
24
+ }
25
+
22
26
  const chain = options.chain.toUpperCase() || '';
23
27
  if (supportedChains.includes(chain)) {
24
28
  return new Method('wallet', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yerofey/cryptowallet-cli",
3
- "version": "1.13.0",
3
+ "version": "1.14.1",
4
4
  "description": "Crypto wallet generator CLI tool",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/yerofey/cryptowallet-cli",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "scripts": {
21
21
  "lint": "pnpm exec eslint src/*.js",
22
- "postinstall": "node postinstall.js",
22
+ "postinstall": "cw --donate",
23
23
  "test": "ava"
24
24
  },
25
25
  "files": [
package/src/Method.js CHANGED
@@ -6,16 +6,8 @@ import { log, supportedChains, loadJson } from './utils.js';
6
6
  import { generateMnemonicString } from './Wallet.js';
7
7
  import CW from './CW.js';
8
8
 
9
- const {
10
- blue,
11
- green,
12
- blueBright,
13
- greenBright,
14
- yellow,
15
- red,
16
- magenta,
17
- white,
18
- } = chalk;
9
+ const { blue, green, blueBright, greenBright, yellow, red, magenta, white } =
10
+ chalk;
19
11
 
20
12
  const pkg = await loadJson(
21
13
  `${path.dirname(import.meta.url)}/../package.json`.replace('file://', '')
@@ -32,6 +24,7 @@ class Method {
32
24
  _initializeMethods() {
33
25
  return {
34
26
  _: () => {},
27
+ donate: this._donate.bind(this),
35
28
  list: this._list.bind(this),
36
29
  mnemonic: this._mnemonic.bind(this),
37
30
  version: this._version.bind(this),
@@ -310,6 +303,7 @@ class Method {
310
303
  }
311
304
  }
312
305
 
306
+ // formats, network, apps
313
307
  if (displayAsText) {
314
308
  if (
315
309
  cw.row.formats !== undefined ||
@@ -320,6 +314,7 @@ class Method {
320
314
  log();
321
315
  }
322
316
 
317
+ // tested
323
318
  if (cw.wallet.tested !== undefined) {
324
319
  log(
325
320
  red(
@@ -328,6 +323,7 @@ class Method {
328
323
  );
329
324
  }
330
325
 
326
+ // formats
331
327
  if (
332
328
  cw.row.formats !== undefined &&
333
329
  Object.keys(cw.row.formats).length > 1
@@ -347,6 +343,7 @@ class Method {
347
343
  );
348
344
  }
349
345
 
346
+ // network
350
347
  if (cw.row.network == 'EVM' || false) {
351
348
  log(
352
349
  yellow(
@@ -377,9 +374,34 @@ class Method {
377
374
  }
378
375
  log(greenBright('ℹ️ You can import this wallet into ' + appsString));
379
376
  }
377
+
378
+ // donation
379
+ log(blueBright('🙏 Consider supporting the project - see donation options with: cw --donate'));
380
380
  }
381
381
  }
382
382
 
383
+ _donate() {
384
+ console.log(`
385
+ ──────────────────────────────────────────────────────
386
+ Thank you for installing CW!
387
+
388
+ If you'd like to support this project, consider making
389
+ a donation. Your support is greatly appreciated!
390
+
391
+ Donate Crypto:
392
+ - USDT: TCW9eaRWjpivZvnZ5DwgbWxPRpoZNWbuPe
393
+ - BTC: bc1qcwamquntxshqsjcra6vryftrfd9z57j02g3ywq
394
+ - ETH: 0xe3e3ed78d9f8A935a9a0fCE2a7305F2f5DBabAD8
395
+ - DOGE: DMAkWQKx1H6ESG3beDBssn5mAAZcwkrYVh
396
+
397
+ Donate via PayPal:
398
+ - https://paypal.me/Jerofej
399
+
400
+ Thank you for your support!
401
+ ──────────────────────────────────────────────────────
402
+ `);
403
+ }
404
+
383
405
  async init() {
384
406
  return (this.callMethods[this.name] || this.callMethods['_'])();
385
407
  }
package/src/options.js CHANGED
@@ -37,6 +37,7 @@ program.option(
37
37
  'Desired wallet suffix (case-sensitive)'
38
38
  );
39
39
  program.option('-v, --version', 'Display cryptowallet version');
40
+ program.option('-T, --donate', 'Donate to the project');
40
41
  program.parse();
41
42
 
42
43
  export const options = program.opts();