@airmoney-degn/airmoney-cli 0.19.5 → 0.19.7
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/cli/dapp.js +10 -2
- package/dist/config.json +1 -1
- package/dist/util/env.js +1 -1
- package/dist/util/metadata.js +11 -4
- package/package.json +1 -1
package/dist/cli/dapp.js
CHANGED
|
@@ -5,13 +5,21 @@ const env_1 = require("../util/env");
|
|
|
5
5
|
const format_1 = require("../util/format");
|
|
6
6
|
const LogService_1 = require("../service/log/LogService");
|
|
7
7
|
const DappService_1 = require("../service/dapp/DappService");
|
|
8
|
+
const network_1 = require("../util/network");
|
|
8
9
|
async function dappStatusCommand() {
|
|
9
10
|
try {
|
|
10
11
|
const { userId, apiKey, rpc } = (0, env_1.validateCredential)();
|
|
11
12
|
(0, LogService_1.log)(`User: ${(0, format_1.shortenString)(userId)}`).white();
|
|
12
|
-
(0, LogService_1.log)(`Network: ${rpc
|
|
13
|
+
(0, LogService_1.log)(`Network: ${rpc ? (rpc === 'devnet' ? 'devnet' : 'mainnet') : `<empty> (default: devnet)`}`).white();
|
|
13
14
|
const dappService = new DappService_1.DappService(userId, apiKey, rpc);
|
|
14
|
-
|
|
15
|
+
try {
|
|
16
|
+
await dappService.validateApiKey();
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
19
|
+
(0, LogService_1.log)(`${err instanceof Error ? err.message : String(err)}`).red();
|
|
20
|
+
(0, LogService_1.log)(`Please setup your key at ${(0, network_1.networkToRpcUrl)(rpc)}`).red();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
15
23
|
// Fetch dapp list
|
|
16
24
|
const dapps = await dappService.fetchDappList();
|
|
17
25
|
if (dapps.length === 0) {
|
package/dist/config.json
CHANGED
package/dist/util/env.js
CHANGED
|
@@ -86,7 +86,7 @@ function validateCredential() {
|
|
|
86
86
|
const apiKey = getApiKey();
|
|
87
87
|
const rpc = getRpc();
|
|
88
88
|
if (!userId || !apiKey) {
|
|
89
|
-
throw new Error(
|
|
89
|
+
throw new Error(`Missing credentials. Please setup your key at ${(0, network_1.networkToRpcUrl)('devnet')} for devnet or ${(0, network_1.networkToRpcUrl)('mainnet')} for mainnet`);
|
|
90
90
|
}
|
|
91
91
|
if ((0, network_1.validateNetwork)(rpc)) {
|
|
92
92
|
return {
|
package/dist/util/metadata.js
CHANGED
|
@@ -46,10 +46,17 @@ async function loadMetadata(projectPath = '.', appUrl) {
|
|
|
46
46
|
if (appUrl) {
|
|
47
47
|
// Fetch from remote URL
|
|
48
48
|
const url = (0, remote_1.buildRemoteUrl)(appUrl, 'metadata.json');
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
let fetchedRaw = null;
|
|
50
|
+
let hasLogged = false;
|
|
51
|
+
while (fetchedRaw === null) {
|
|
52
|
+
fetchedRaw = await (0, remote_1.fetchRemoteText)(url);
|
|
53
|
+
if (fetchedRaw === null) {
|
|
54
|
+
if (!hasLogged) {
|
|
55
|
+
(0, LogService_1.log)(`Wating for ${appUrl.endsWith('/') ? appUrl : appUrl + '/'}metadata.json...`).white();
|
|
56
|
+
hasLogged = true;
|
|
57
|
+
}
|
|
58
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
59
|
+
}
|
|
53
60
|
}
|
|
54
61
|
raw = fetchedRaw;
|
|
55
62
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airmoney-degn/airmoney-cli",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.7",
|
|
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"
|