xyqon 0.4.1 → 0.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.
Files changed (3) hide show
  1. package/README.md +25 -0
  2. package/package.json +1 -1
  3. package/src/cli.js +11 -0
package/README.md CHANGED
@@ -20,12 +20,30 @@ You do not need to mine and you do not need to run a full node.
20
20
  npm install -g xyqon
21
21
  ```
22
22
 
23
+ Update an existing global install:
24
+
25
+ ```bash
26
+ npm update -g xyqon
27
+ ```
28
+
29
+ Or install this exact release:
30
+
31
+ ```bash
32
+ npm install -g xyqon@0.5.0
33
+ ```
34
+
23
35
  Or run without installing:
24
36
 
25
37
  ```bash
26
38
  npx xyqon help
27
39
  ```
28
40
 
41
+ Run this exact release without installing:
42
+
43
+ ```bash
44
+ npx xyqon@0.5.0 help
45
+ ```
46
+
29
47
  ## Create A Wallet
30
48
 
31
49
  ```bash
@@ -108,6 +126,13 @@ xyqon nft send \
108
126
  xyqon nodes
109
127
  ```
110
128
 
129
+ ## Show Version
130
+
131
+ ```bash
132
+ xyqon version
133
+ xyqon -v
134
+ ```
135
+
111
136
  ## Seed Nodes
112
137
 
113
138
  The package starts with these seed nodes:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xyqon",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "Friendly wallet CLI and JavaScript client for the XYQON network.",
5
5
  "keywords": [
6
6
  "xyqon",
package/src/cli.js CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
2
3
  import {
3
4
  DEFAULT_PEERS,
4
5
  DEFAULT_WALLET_PATH,
@@ -15,6 +16,9 @@ import {
15
16
  sendTransaction
16
17
  } from './index.js';
17
18
 
19
+ const require = createRequire(import.meta.url);
20
+ const { version: VERSION } = require('../package.json');
21
+
18
22
  const colors = {
19
23
  cyan: '\x1b[36m',
20
24
  green: '\x1b[32m',
@@ -48,6 +52,8 @@ ${color('bold', 'Usage')}
48
52
  xyqon nft mint --collection <SYMBOL> --token-id <ID> --name <NAME> [--image-url <URL>] [--wallet <FILE>]
49
53
  xyqon nft send --collection <SYMBOL> --token-id <ID> --to <PUBLIC_KEY> [--wallet <FILE>]
50
54
  xyqon nodes
55
+ xyqon version
56
+ xyqon -v
51
57
 
52
58
  ${color('bold', 'Network options')}
53
59
  --peer <IP[:PORT]> Add a seed peer. Can be repeated.
@@ -115,6 +121,11 @@ async function run() {
115
121
  return;
116
122
  }
117
123
 
124
+ if (command === 'version' || command === '--version' || command === '-v') {
125
+ console.log(VERSION);
126
+ return;
127
+ }
128
+
118
129
  if (command === 'wallet' && subcommand === 'new') {
119
130
  const path = options.out ?? DEFAULT_WALLET_PATH;
120
131
  const wallet = createWallet(options.name ?? 'XYQON User');