ethershell 0.1.0-alpha.0 → 0.1.0-alpha.4

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/bin/cli.js CHANGED
@@ -1,88 +1,88 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * @fileoverview EtherShell - Interactive CLI for Ethereum smart contract development
5
- * @description Main entry point for the EtherShell REPL environment that provides
6
- * an interactive command-line interface for compiling, deploying, and managing
7
- * Ethereum smart contracts and wallets.
8
- * @module cli
9
- */
10
-
11
- import repl from 'repl';
12
- import util from 'util';
13
- import { customEval } from '../src/utils/replHelper.js';
14
- import {
15
- updateCompiler,
16
- currentCompiler,
17
- compilerOptions,
18
- getCompilerOptions,
19
- compile
20
- } from '../src/services/build.js';
21
- import { set, get, getDefault } from '../src/services/network.js';
22
- import { deleteDirectory } from '../src/services/files.js';
23
- import {
24
- addAccounts,
25
- getAccounts,
26
- createAccounts,
27
- deleteAccount,
28
- createHD,
29
- getHDAccounts,
30
- addHD,
31
- getAllAccounts,
32
- connectWallet,
33
- getWalletInfo
34
- } from '../src/services/wallet.js';
35
-
36
- import { deploy, add } from '../src/services/addContracts.js';
37
- import { getContracts } from '../src/services/contracts.js';
38
-
39
- /**
40
- * REPL instance for EtherShell interactive environment
41
- * @type {repl.REPLServer}
42
- * @description Creates and configures the REPL server with custom evaluation
43
- * and output formatting
44
- */
45
- export const r = repl.start({
46
- prompt: 'EtherShell> ',
47
- ignoreUndefined: true,
48
- eval: customEval,
49
- writer: output => {
50
- return util.inspect(output, { colors: true, depth: null });
51
- }
52
- });
53
-
54
- // Network commands
55
- r.context.chain = set;
56
- r.context.chain = get;
57
- r.context.defaultChain = getDefault;
58
-
59
- // Compile commands
60
- r.context.compiler = currentCompiler;
61
- r.context.compUpdate = updateCompiler;
62
- r.context.compInfo = getCompilerOptions;
63
- r.context.compOpts = compilerOptions;
64
- r.context.build = compile;
65
-
66
- // Clean build folder
67
- r.context.clean = deleteDirectory;
68
-
69
- // Set wallet
70
- r.context.addWallet = addAccounts;
71
- r.context.addHDWallet = addHD;
72
- r.context.newWallet = createAccounts;
73
- r.context.newHDWallet = createHD;
74
- r.context.removeWallet = deleteAccount;
75
- r.context.connectWallet = connectWallet;
76
-
77
- // View wallets
78
- r.context.wallets = getAccounts;
79
- r.context.allWallets = getAllAccounts;
80
- r.context.hdWallets = getHDAccounts;
81
- r.context.walletInfo = getWalletInfo
82
-
83
- // Add contract
84
- r.context.deploy = deploy;
85
- r.context.addContract = add;
86
-
87
- // Contract
88
- r.context.contracts = getContracts;
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview EtherShell - Interactive CLI for Ethereum smart contract development
5
+ * @description Main entry point for the EtherShell REPL environment that provides
6
+ * an interactive command-line interface for compiling, deploying, and managing
7
+ * Ethereum smart contracts and wallets.
8
+ * @module cli
9
+ */
10
+
11
+ import repl from 'repl';
12
+ import util from 'util';
13
+ import { customEval } from '../src/utils/replHelper.js';
14
+ import {
15
+ updateCompiler,
16
+ currentCompiler,
17
+ compilerOptions,
18
+ getCompilerOptions,
19
+ compile
20
+ } from '../src/services/build.js';
21
+ import { set, get, getDefault } from '../src/services/network.js';
22
+ import { deleteDirectory } from '../src/services/files.js';
23
+ import {
24
+ addAccounts,
25
+ getAccounts,
26
+ createAccounts,
27
+ deleteAccount,
28
+ createHD,
29
+ getHDAccounts,
30
+ addHD,
31
+ getAllAccounts,
32
+ connectWallet,
33
+ getWalletInfo
34
+ } from '../src/services/wallet.js';
35
+
36
+ import { deploy, add } from '../src/services/addContracts.js';
37
+ import { getContracts } from '../src/services/contracts.js';
38
+
39
+ /**
40
+ * REPL instance for EtherShell interactive environment
41
+ * @type {repl.REPLServer}
42
+ * @description Creates and configures the REPL server with custom evaluation
43
+ * and output formatting
44
+ */
45
+ export const r = repl.start({
46
+ prompt: 'EtherShell> ',
47
+ ignoreUndefined: true,
48
+ eval: customEval,
49
+ writer: output => {
50
+ return util.inspect(output, { colors: true, depth: null });
51
+ }
52
+ });
53
+
54
+ // Network commands
55
+ r.context.chain = set;
56
+ r.context.chain = get;
57
+ r.context.defaultChain = getDefault;
58
+
59
+ // Compile commands
60
+ r.context.compiler = currentCompiler;
61
+ r.context.compUpdate = updateCompiler;
62
+ r.context.compInfo = getCompilerOptions;
63
+ r.context.compOpts = compilerOptions;
64
+ r.context.build = compile;
65
+
66
+ // Clean build folder
67
+ r.context.clean = deleteDirectory;
68
+
69
+ // Set wallet
70
+ r.context.addWallet = addAccounts;
71
+ r.context.addHDWallet = addHD;
72
+ r.context.newWallet = createAccounts;
73
+ r.context.newHDWallet = createHD;
74
+ r.context.removeWallet = deleteAccount;
75
+ r.context.connectWallet = connectWallet;
76
+
77
+ // View wallets
78
+ r.context.wallets = getAccounts;
79
+ r.context.allWallets = getAllAccounts;
80
+ r.context.hdWallets = getHDAccounts;
81
+ r.context.walletInfo = getWalletInfo
82
+
83
+ // Add contract
84
+ r.context.deploy = deploy;
85
+ r.context.addContract = add;
86
+
87
+ // Contract
88
+ r.context.contracts = getContracts;
package/package.json CHANGED
@@ -1,49 +1,48 @@
1
- {
2
- "name": "ethershell",
3
- "version": "0.1.0-alpha.0",
4
- "description": "Interactive JavaScript console for Ethereum smart contract management",
5
- "author": "Alireza Kiakojouri (alirezaethdev@gmail.com)",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/AlirezaEthDev/EtherShell"
9
- },
10
- "bugs": {
11
- "url": "https://github.com/AlirezaEthDev/EtherShell/issues"
12
- },
13
- "homepage": "https://github.com/AlirezaEthDev/EtherShell",
14
- "type": "module",
15
- "bin": {
16
- "ethershell": "./bin/cli.js"
17
- },
18
- "scripts": {
19
- "start": "node bin/cli.js",
20
- "dev": "nodemon bin/cli.js",
21
- "test": "echo \"No tests yet\" && exit 0",
22
- "lint": "echo \"No linting configured\" && exit 0",
23
- "prepublishOnly": "npm test"
24
- },
25
- "engines": {
26
- "node": ">=18.0.0"
27
- },
28
- "keywords": [
29
- "ethereum",
30
- "cli",
31
- "smart-contracts",
32
- "solidity",
33
- "blockchain"
34
- ],
35
- "dependencies": {
36
- "commander": "^12.1.0",
37
- "ethers": "^6.13.0",
38
- "node-localstorage": "^3.0.5",
39
- "solc": "^0.8.29",
40
- "vm": "^0.1.0"
41
- },
42
- "preferGlobal": true,
43
- "files": [
44
- "bin/",
45
- "src/",
46
- "LICENSE",
47
- "README.md"
48
- ]
49
- }
1
+ {
2
+ "name": "ethershell",
3
+ "version": "0.1.0-alpha.4",
4
+ "description": "Interactive JavaScript console for Ethereum smart contract management",
5
+ "author": "Alireza Kiakojouri (alirezaethdev@gmail.com)",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/AlirezaEthDev/EtherShell"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/AlirezaEthDev/EtherShell/issues"
12
+ },
13
+ "homepage": "https://github.com/AlirezaEthDev/EtherShell",
14
+ "type": "module",
15
+ "bin": {
16
+ "ethershell": "./bin/cli.js"
17
+ },
18
+ "scripts": {
19
+ "start": "node bin/cli.js",
20
+ "dev": "nodemon bin/cli.js",
21
+ "test": "echo \"No tests yet\" && exit 0",
22
+ "lint": "echo \"No linting configured\" && exit 0",
23
+ "prepublishOnly": "npm test"
24
+ },
25
+ "engines": {
26
+ "node": ">=18.0.0"
27
+ },
28
+ "keywords": [
29
+ "ethereum",
30
+ "cli",
31
+ "smart-contracts",
32
+ "solidity",
33
+ "blockchain"
34
+ ],
35
+ "dependencies": {
36
+ "ethers": "^6.13.0",
37
+ "node-localstorage": "^3.0.5",
38
+ "solc": "^0.8.29",
39
+ "vm": "^0.1.0"
40
+ },
41
+ "preferGlobal": true,
42
+ "files": [
43
+ "bin/",
44
+ "src/",
45
+ "LICENSE",
46
+ "README.md"
47
+ ]
48
+ }