@airmoney-degn/airmoney-cli 0.10.3 → 0.10.5
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/dist/bin/darwin-arm64 +0 -0
- package/dist/bin/darwin-x64 +0 -0
- package/dist/bin/linux-x64 +0 -0
- package/dist/bin/win32-x64 +0 -0
- package/dist/cli/serve.js +5 -1
- package/dist/cli/wallet.js +15 -5
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/dist/bin/darwin-arm64
CHANGED
|
Binary file
|
package/dist/bin/darwin-x64
CHANGED
|
Binary file
|
package/dist/bin/linux-x64
CHANGED
|
Binary file
|
package/dist/bin/win32-x64
CHANGED
|
Binary file
|
package/dist/cli/serve.js
CHANGED
|
@@ -160,6 +160,10 @@ async function serveCommand(noBrowser, locationFolder, appUrl) {
|
|
|
160
160
|
console.log('crypto service not found at ' + bin);
|
|
161
161
|
}
|
|
162
162
|
else {
|
|
163
|
-
|
|
163
|
+
console.log('execing crypto service at http://localhost:5050');
|
|
164
|
+
ChildProcess.exec(bin, { env: { SECURE_STORAGE: (0, env_1.configDir)(), RUST_BACKTRACE: '1' } }, (_, stdout, stderr) => {
|
|
165
|
+
console.log(stdout);
|
|
166
|
+
console.log(stderr);
|
|
167
|
+
});
|
|
164
168
|
}
|
|
165
169
|
}
|
package/dist/cli/wallet.js
CHANGED
|
@@ -62,7 +62,9 @@ async function listWallet(chainName) {
|
|
|
62
62
|
const config = (0, env_1.configDir)();
|
|
63
63
|
const walletPath = path_1.default.join(config, 'wallet', chainName);
|
|
64
64
|
if (!(0, fs_1.existsSync)(walletPath)) {
|
|
65
|
-
(0, fs_1.mkdirSync)(walletPath
|
|
65
|
+
(0, fs_1.mkdirSync)(walletPath, {
|
|
66
|
+
recursive: true,
|
|
67
|
+
});
|
|
66
68
|
}
|
|
67
69
|
const files = (0, fs_1.readdirSync)(walletPath)
|
|
68
70
|
.map(file => file.split('.json')[0])
|
|
@@ -73,7 +75,9 @@ async function importWalletSk(PrivateKey, chainName) {
|
|
|
73
75
|
const config = (0, env_1.configDir)();
|
|
74
76
|
const walletPath = path_1.default.join(config, chainName);
|
|
75
77
|
if (!(0, fs_1.existsSync)(walletPath)) {
|
|
76
|
-
(0, fs_1.mkdirSync)(walletPath
|
|
78
|
+
(0, fs_1.mkdirSync)(walletPath, {
|
|
79
|
+
recursive: true,
|
|
80
|
+
});
|
|
77
81
|
}
|
|
78
82
|
if (chainName == 'evm') {
|
|
79
83
|
await importEvmWallet(PrivateKey);
|
|
@@ -86,7 +90,9 @@ async function importEvmWallet(PrivateKey) {
|
|
|
86
90
|
const config = (0, env_1.configDir)();
|
|
87
91
|
const walletPath = path_1.default.join(config, 'wallet', 'evm');
|
|
88
92
|
if (!(0, fs_1.existsSync)(walletPath)) {
|
|
89
|
-
(0, fs_1.mkdirSync)(walletPath
|
|
93
|
+
(0, fs_1.mkdirSync)(walletPath, {
|
|
94
|
+
recursive: true,
|
|
95
|
+
});
|
|
90
96
|
}
|
|
91
97
|
if (PrivateKey.startsWith('0x') == false) {
|
|
92
98
|
PrivateKey = '0x' + PrivateKey;
|
|
@@ -101,7 +107,9 @@ async function importSvmWallet(privateKey) {
|
|
|
101
107
|
const config = (0, env_1.configDir)();
|
|
102
108
|
const walletPath = path_1.default.join(config, 'wallet', 'svm');
|
|
103
109
|
if (!(0, fs_1.existsSync)(walletPath)) {
|
|
104
|
-
(0, fs_1.mkdirSync)(walletPath
|
|
110
|
+
(0, fs_1.mkdirSync)(walletPath, {
|
|
111
|
+
recursive: true
|
|
112
|
+
});
|
|
105
113
|
}
|
|
106
114
|
const bytes = bs58.decode(privateKey);
|
|
107
115
|
const wallet = web3_js_1.Keypair.fromSecretKey(bytes);
|
|
@@ -114,7 +122,9 @@ async function exportWalletSk(address, chainName) {
|
|
|
114
122
|
const config = (0, env_1.configDir)();
|
|
115
123
|
const walletPath = path_1.default.join(config, 'wallet', chainName);
|
|
116
124
|
if (!(0, fs_1.existsSync)(walletPath)) {
|
|
117
|
-
(0, fs_1.mkdirSync)(walletPath
|
|
125
|
+
(0, fs_1.mkdirSync)(walletPath, {
|
|
126
|
+
recursive: true
|
|
127
|
+
});
|
|
118
128
|
}
|
|
119
129
|
let walletFile;
|
|
120
130
|
try {
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ const program = new commander_1.Command();
|
|
|
14
14
|
program
|
|
15
15
|
.name('airmoney-cli')
|
|
16
16
|
.description('airmoney-cli is a command-line interface tool designed to facilitate the development and management of decentralized applications (DApps) for Airmoney.')
|
|
17
|
-
.version(
|
|
17
|
+
.version('0.10.5');
|
|
18
18
|
program
|
|
19
19
|
.command('setup')
|
|
20
20
|
.description('Setup env with userAddress, apiKey, rpc')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airmoney-degn/airmoney-cli",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.5",
|
|
4
4
|
"description": "airmoney-cli is a command-line interface tool designed to facilitate the development and management of decentralized applications (DApps) for Airmoney.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"format": "prettier --write \"src/**/*\"",
|
|
13
|
-
"start": "
|
|
14
|
-
"build": "tsc && cp -r bin/ dist/bin && chmod -R +x dist",
|
|
13
|
+
"start": "npm run build && node dist/index.js",
|
|
14
|
+
"build": "rm -rf dist && tsc && cp -r bin/ dist/bin/ && chmod -R +x dist",
|
|
15
15
|
"release": "npm run build && npm publish"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [
|