@avm-sdk/avmnet-cli 1.0.0 → 1.0.2

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/dasq/index.js ADDED
@@ -0,0 +1,2 @@
1
+ const { AVM, accounts, rpc } = require("avm-sdk");
2
+ console.log("Project initialized. Start coding your AVM programs in JS!");
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "dasq",
3
+ "version": "1.0.0",
4
+ "main": "index.js",
5
+ "scripts": {
6
+ "start": "node index.js"
7
+ },
8
+ "dependencies": {}
9
+ }
package/index.js CHANGED
@@ -1,11 +1,31 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const args = process.argv.slice(2);
4
+ const path = require("path");
4
5
 
5
- if (args[0] === "node") {
6
- require("./rpc"); // runs your rpc server
7
- } else {
8
- console.log("AVM CLI");
9
- console.log("Use:");
10
- console.log(" avm node");
6
+ if (!args[0]) {
7
+ console.log("AVMNet CLI");
8
+ console.log("Commands:");
9
+ console.log(" avmnet node - start blockchain");
10
+ console.log(" avmnet run - run script");
11
+ console.log(" avmnet init - create project");
12
+ process.exit(0);
13
+ }
14
+
15
+ const command = args[0];
16
+ const cliPath = path.join(__dirname, "cli");
17
+
18
+ switch (command) {
19
+ case "node":
20
+ require(path.join(cliPath, "avm-node.js"));
21
+ break;
22
+ case "run":
23
+ require(path.join(cliPath, "avm-run.js"));
24
+ break;
25
+ case "init":
26
+ require(path.join(cliPath, "avm-sdk.js"));
27
+ break;
28
+ default:
29
+ console.log(`Unknown command: ${command}`);
30
+ process.exit(1);
11
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avm-sdk/avmnet-cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "AVMNet Blockchain CLI",
5
5
  "main": "vm.js",
6
6
  "bin": {