@airmoney-degn/airmoney-cli 0.9.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.
- package/dist/bin/darwin-arm64 +0 -0
- package/dist/bin/linux-x64 +0 -0
- package/dist/bin/win32-x64 +0 -0
- package/dist/cli/create.js +105 -0
- package/dist/cli/serve.js +180 -0
- package/dist/cli/setup.js +56 -0
- package/dist/cli/upload.js +121 -0
- package/dist/cli/wallet.js +126 -0
- package/dist/darwin-arm64 +0 -0
- package/dist/index.js +96 -0
- package/dist/linux-x64 +0 -0
- package/dist/types.js +13 -0
- package/dist/util/env.js +56 -0
- package/dist/util/metadata.js +64 -0
- package/dist/util/server.js +74 -0
- package/dist/util/tarball.js +102 -0
- package/dist/win32-x64 +0 -0
- package/package.json +65 -0
- package/public/simulator/assets/device.png +0 -0
- package/public/simulator/index.html +55 -0
- package/readme.md +22 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const env_1 = require("./util/env");
|
|
6
|
+
const create_1 = require("./cli/create");
|
|
7
|
+
const serve_1 = require("./cli/serve");
|
|
8
|
+
const upload_1 = require("./cli/upload");
|
|
9
|
+
const setup_1 = require("./cli/setup");
|
|
10
|
+
const wallet_1 = require("./cli/wallet");
|
|
11
|
+
// Load environment from config
|
|
12
|
+
(0, env_1.loadEnvFromConfig)();
|
|
13
|
+
const program = new commander_1.Command();
|
|
14
|
+
program
|
|
15
|
+
.name('airmoney-cli')
|
|
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('0.8.1');
|
|
18
|
+
program
|
|
19
|
+
.command('setup')
|
|
20
|
+
.description('Setup env with userAddress, apiKey, rpc')
|
|
21
|
+
.requiredOption('-u, --user <string>', 'developer user')
|
|
22
|
+
.requiredOption('-k, --key <string>', 'API key')
|
|
23
|
+
.option('-n, --network <string>', 'network devnet|mainnet', 'devnet')
|
|
24
|
+
.action(opts => {
|
|
25
|
+
const { user, key, network } = opts;
|
|
26
|
+
(0, setup_1.setupCommand)(network, user, key);
|
|
27
|
+
});
|
|
28
|
+
program
|
|
29
|
+
.command('create')
|
|
30
|
+
.description('Initialize a new project')
|
|
31
|
+
.requiredOption('-N, --name <string>', 'Project name')
|
|
32
|
+
.option('-n, --network <string>', 'network devnet|mainnet', 'devnet')
|
|
33
|
+
.option('-f, --app-path <string>', 'path where project will be created')
|
|
34
|
+
.option('--template', 'initialize project based on git quickstart')
|
|
35
|
+
.action(async (opts) => {
|
|
36
|
+
const { name, network, appPath, template } = opts;
|
|
37
|
+
await (0, create_1.createCommand)(name, network, template, appPath);
|
|
38
|
+
});
|
|
39
|
+
program
|
|
40
|
+
.command('serve')
|
|
41
|
+
.description('Serve locally in the simulator')
|
|
42
|
+
.option('-p, --port <number>', 'Port', '4040')
|
|
43
|
+
.option('-f, --index-app-path <string>', 'path for the index.html', './')
|
|
44
|
+
.option('--no-browser', 'stop browser from being open')
|
|
45
|
+
.option('-u, --app-url <string>', 'url where the app is running')
|
|
46
|
+
.action(async (opts) => {
|
|
47
|
+
let { portArg, indexAppPath, browser, appUrl } = opts;
|
|
48
|
+
const port = parseInt(portArg, 10) || 4040;
|
|
49
|
+
if (indexAppPath == './') {
|
|
50
|
+
indexAppPath = undefined;
|
|
51
|
+
}
|
|
52
|
+
if (indexAppPath && appUrl) {
|
|
53
|
+
console.error('both --index-app-path and --app-url must not be used simuntaniusly');
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
await (0, serve_1.serveCommand)(port, !browser, indexAppPath, appUrl);
|
|
57
|
+
});
|
|
58
|
+
program
|
|
59
|
+
.command('wallet')
|
|
60
|
+
.description('handle wallet')
|
|
61
|
+
.option('-l, --list', 'show wallet list')
|
|
62
|
+
.option('-d, --delete <string>', 'delete wallet')
|
|
63
|
+
.option('-i, --import <string>', 'import wallet')
|
|
64
|
+
.option('-e, --export <string>', 'export wallet')
|
|
65
|
+
.option('-c, --chain [evm | svm]', 'chain name ', 'evm')
|
|
66
|
+
.action(async (opts) => {
|
|
67
|
+
const { list, delete: del, import: importWallet, export: exportWallet, chain, } = opts;
|
|
68
|
+
if (list) {
|
|
69
|
+
await (0, wallet_1.listWallet)(chain);
|
|
70
|
+
}
|
|
71
|
+
else if (del) {
|
|
72
|
+
await (0, wallet_1.deleteWallet)(del, chain);
|
|
73
|
+
}
|
|
74
|
+
else if (importWallet) {
|
|
75
|
+
await (0, wallet_1.importWalletSk)(importWallet, chain);
|
|
76
|
+
}
|
|
77
|
+
else if (exportWallet) {
|
|
78
|
+
await (0, wallet_1.exportWalletSk)(exportWallet, chain);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
program
|
|
82
|
+
.command('upload')
|
|
83
|
+
.description('Publish the app to the DEGN Dapp Store')
|
|
84
|
+
.option('-n, --network <string>', 'network devnet|mainnet', 'https://rpc-dev.air.fun')
|
|
85
|
+
.option('-f, --index-app-path <string>', 'path for the index.html', './')
|
|
86
|
+
.option('-i, --button-image <string>', 'path for the button images', 'assets')
|
|
87
|
+
.action(async (opts) => {
|
|
88
|
+
let { network, indexAppPath, buttonImage } = opts;
|
|
89
|
+
if (indexAppPath == './') {
|
|
90
|
+
indexAppPath = undefined;
|
|
91
|
+
}
|
|
92
|
+
// user and key are read from store config within uploadCommand
|
|
93
|
+
await (0, upload_1.uploadCommand)(network, indexAppPath, buttonImage);
|
|
94
|
+
});
|
|
95
|
+
program.addHelpText('after', 'for more help access https://dash-devnet.air.fun/');
|
|
96
|
+
program.parse(process.argv);
|
package/dist/linux-x64
ADDED
|
Binary file
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPackage = createPackage;
|
|
4
|
+
function createPackage(name, identifier) {
|
|
5
|
+
return {
|
|
6
|
+
name,
|
|
7
|
+
identifier,
|
|
8
|
+
author: '',
|
|
9
|
+
version: '0.1.0',
|
|
10
|
+
maintainer: '',
|
|
11
|
+
url: '',
|
|
12
|
+
};
|
|
13
|
+
}
|
package/dist/util/env.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.configDir = configDir;
|
|
37
|
+
exports.loadEnvFromConfig = loadEnvFromConfig;
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const os = __importStar(require("os"));
|
|
41
|
+
const dotenv = __importStar(require("dotenv"));
|
|
42
|
+
function configDir() {
|
|
43
|
+
// similar to Rust's ProjectDirs::from("fun", "air", "simulator");
|
|
44
|
+
// We'll do a rough approach
|
|
45
|
+
const baseDir = path.join(os.homedir(), '.config', 'air-simulator');
|
|
46
|
+
return baseDir;
|
|
47
|
+
}
|
|
48
|
+
function loadEnvFromConfig() {
|
|
49
|
+
const dir = configDir();
|
|
50
|
+
if (!dir)
|
|
51
|
+
return;
|
|
52
|
+
const envPath = path.join(dir, '.env');
|
|
53
|
+
if (fs.existsSync(envPath)) {
|
|
54
|
+
dotenv.config({ path: envPath });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.loadMetadata = loadMetadata;
|
|
37
|
+
exports.saveMetadata = saveMetadata;
|
|
38
|
+
exports.getPackageName = getPackageName;
|
|
39
|
+
const fs = __importStar(require("fs"));
|
|
40
|
+
const path = __importStar(require("path"));
|
|
41
|
+
function loadMetadata(projectPath = '.') {
|
|
42
|
+
try {
|
|
43
|
+
const filePath = path.join(projectPath, 'metadata.json');
|
|
44
|
+
if (!fs.existsSync(filePath)) {
|
|
45
|
+
console.log('Please run this command in Project directory');
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const raw = fs.readFileSync(filePath, 'utf8');
|
|
49
|
+
const data = JSON.parse(raw);
|
|
50
|
+
return data;
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
console.log('Please run this command in Project directory');
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function saveMetadata(pkg, projectPath = '.') {
|
|
58
|
+
const filePath = path.join(projectPath, 'metadata.json');
|
|
59
|
+
fs.writeFileSync(filePath, JSON.stringify(pkg, null, 2), 'utf8');
|
|
60
|
+
}
|
|
61
|
+
function getPackageName(pkg) {
|
|
62
|
+
// e.g. com.degn.myApp-0.1.0.tar.gz
|
|
63
|
+
return `${pkg.identifier}-${pkg.version}.tar.gz`;
|
|
64
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.displayImage = displayImage;
|
|
40
|
+
const path_1 = __importDefault(require("path"));
|
|
41
|
+
const fs = __importStar(require("fs"));
|
|
42
|
+
function displayImage(request, appName) {
|
|
43
|
+
const f = request.params[0].replace(new RegExp(`^${appName}\\/`), '');
|
|
44
|
+
let file = fs.readFileSync(f, { encoding: 'base64' });
|
|
45
|
+
const fileType = path_1.default.extname(f);
|
|
46
|
+
let mime = '';
|
|
47
|
+
switch (fileType.replace('.', '')) {
|
|
48
|
+
case 'png':
|
|
49
|
+
mime = 'image/png';
|
|
50
|
+
break;
|
|
51
|
+
case 'jpg':
|
|
52
|
+
case 'jpeg':
|
|
53
|
+
mime = 'image/jpeg';
|
|
54
|
+
break;
|
|
55
|
+
case 'gif':
|
|
56
|
+
mime = 'image/gif';
|
|
57
|
+
break;
|
|
58
|
+
case 'bmp':
|
|
59
|
+
mime = 'image/bmp';
|
|
60
|
+
break;
|
|
61
|
+
default:
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
const event = {
|
|
65
|
+
source: 'air-money',
|
|
66
|
+
type: "service",
|
|
67
|
+
subType: "setImage",
|
|
68
|
+
data: {
|
|
69
|
+
id: request.params[1],
|
|
70
|
+
imageName: `data:${mime};base64,${file}`
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
return event;
|
|
74
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.packProject = packProject;
|
|
40
|
+
const fs = __importStar(require("fs"));
|
|
41
|
+
const path = __importStar(require("path"));
|
|
42
|
+
const tar = __importStar(require("tar"));
|
|
43
|
+
const md5_1 = __importDefault(require("md5")); // default import
|
|
44
|
+
const metadata_1 = require("./metadata");
|
|
45
|
+
/**
|
|
46
|
+
* Reproduces the `pack()` logic, creating a tar.gz from the project's assets
|
|
47
|
+
*/
|
|
48
|
+
async function packProject(pkg, projectPath, assetsPath) {
|
|
49
|
+
const outputFilename = (0, metadata_1.getPackageName)(pkg);
|
|
50
|
+
const absOutputPath = path.join(process.cwd(), outputFilename);
|
|
51
|
+
try {
|
|
52
|
+
let files = ['metadata.json', 'dapp-logo.png', '@projectFiles.tar.gz'];
|
|
53
|
+
let projectFiles = ['index.html'];
|
|
54
|
+
if (fs.existsSync(assetsPath)) {
|
|
55
|
+
const assetFiles = fs.readdirSync(assetsPath);
|
|
56
|
+
await tar.create({
|
|
57
|
+
file: 'assets.tar.gz',
|
|
58
|
+
gzip: false,
|
|
59
|
+
cwd: assetsPath,
|
|
60
|
+
prefix: 'assets',
|
|
61
|
+
portable: true,
|
|
62
|
+
}, assetFiles);
|
|
63
|
+
files.push('@assets.tar.gz');
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
console.log('No assets directory found.');
|
|
67
|
+
}
|
|
68
|
+
// this is bad, but couldn't figure out how to get files from different folders without the absolute path messing with the tar file structure
|
|
69
|
+
await tar.create({
|
|
70
|
+
file: 'projectFiles.tar.gz',
|
|
71
|
+
gzip: false,
|
|
72
|
+
cwd: projectPath,
|
|
73
|
+
prefix: '',
|
|
74
|
+
portable: true,
|
|
75
|
+
}, projectFiles);
|
|
76
|
+
await tar.create({
|
|
77
|
+
file: absOutputPath,
|
|
78
|
+
gzip: true,
|
|
79
|
+
cwd: process.cwd(),
|
|
80
|
+
prefix: '',
|
|
81
|
+
portable: true,
|
|
82
|
+
}, files);
|
|
83
|
+
// read it in memory for MD5
|
|
84
|
+
const buffer = fs.readFileSync(absOutputPath);
|
|
85
|
+
const digest = (0, md5_1.default)(buffer);
|
|
86
|
+
console.log(`MD5: ${digest}`);
|
|
87
|
+
console.log(`Tarball created at ${absOutputPath}`);
|
|
88
|
+
console.log('cleaning up...');
|
|
89
|
+
fs.rmSync('projectFiles.tar.gz');
|
|
90
|
+
fs.rmSync('assets.tar.gz');
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
console.error(`Failed to create tarball: ${err.message}`);
|
|
94
|
+
if (fs.existsSync('projectFiles.tar.gz'))
|
|
95
|
+
fs.rmSync('projectFiles.tar.gz');
|
|
96
|
+
if (fs.existsSync('assets.tar.gz'))
|
|
97
|
+
fs.rmSync('assets.tar.gz');
|
|
98
|
+
if (fs.existsSync(absOutputPath))
|
|
99
|
+
fs.rmSync(absOutputPath);
|
|
100
|
+
process.exit(1);
|
|
101
|
+
}
|
|
102
|
+
}
|
package/dist/win32-x64
ADDED
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@airmoney-degn/airmoney-cli",
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "airmoney-cli is a command-line interface tool designed to facilitate the development and management of decentralized applications (DApps) for Airmoney.",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"bin": {
|
|
9
|
+
"airmoney-cli": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"format": "prettier --write \"src/**/*\"",
|
|
13
|
+
"start": "tsc && cp -r bin/ dist/ && chmod -R +x dist/bin && node dist/index.js",
|
|
14
|
+
"build": "tsc && cp -r bin/ dist/ && chmod -R +x dist/bin",
|
|
15
|
+
"release": "npm run build && npm publish"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"CLI"
|
|
19
|
+
],
|
|
20
|
+
"author": "Hadi Hosseini <help@degn.com>",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"files": [
|
|
23
|
+
"dist/**/*",
|
|
24
|
+
"public/simulator/**/*"
|
|
25
|
+
],
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@solana/signers": "2.1.1",
|
|
28
|
+
"@solana/web3.js": "1.98.2",
|
|
29
|
+
"base64-js": "^1.5.1",
|
|
30
|
+
"bs58": "5.0.0",
|
|
31
|
+
"commander": "^11.0.0",
|
|
32
|
+
"cors": "^2.8.5",
|
|
33
|
+
"dotenv": "^16.3.1",
|
|
34
|
+
"ethers": "6.14.3",
|
|
35
|
+
"expres": "^0.0.5",
|
|
36
|
+
"express": "^4.21.2",
|
|
37
|
+
"express-http-proxy": "^2.1.1",
|
|
38
|
+
"express-ws": "^5.0.2",
|
|
39
|
+
"form-data": "^4.0.0",
|
|
40
|
+
"http-proxy-middleware": "^3.0.3",
|
|
41
|
+
"inquirer": "^8.0.0",
|
|
42
|
+
"md5": "^2.3.0",
|
|
43
|
+
"node-fetch": "^2.6.7",
|
|
44
|
+
"open": "^8.4.0",
|
|
45
|
+
"tar": "^6.1.13",
|
|
46
|
+
"websocket": "^1.0.35",
|
|
47
|
+
"ws": "^8.18.1"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@airmoney-degn/controller-sdk": "^5.4.1",
|
|
51
|
+
"@types/bs58": "5.0.0",
|
|
52
|
+
"@types/cors": "^2.8.17",
|
|
53
|
+
"@types/express": "^5.0.0",
|
|
54
|
+
"@types/express-http-proxy": "^1.6.6",
|
|
55
|
+
"@types/express-ws": "^3.0.5",
|
|
56
|
+
"@types/inquirer": "^8.1.3",
|
|
57
|
+
"@types/md5": "^2.3.2",
|
|
58
|
+
"@types/node": "^18.19.70",
|
|
59
|
+
"@types/node-fetch": "^2.6.12",
|
|
60
|
+
"@types/tar": "^6.1.13",
|
|
61
|
+
"@types/websocket": "^1.0.10",
|
|
62
|
+
"prettier": "^3.6.1",
|
|
63
|
+
"typescript": "^5.0.4"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
Binary file
|