@solana-mobile/dapp-store-cli 0.9.3 → 0.9.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/lib/CliUtils.js +33 -5
- package/lib/commands/publish/PublishCliRemove.js +3 -1
- package/lib/commands/publish/PublishCliSupport.js +3 -1
- package/lib/commands/publish/PublishCliUpdate.js +3 -1
- package/lib/package.json +2 -2
- package/package.json +2 -2
- package/src/CliUtils.ts +39 -29
- package/src/commands/publish/PublishCliRemove.ts +7 -1
- package/src/commands/publish/PublishCliSupport.ts +7 -1
- package/src/commands/publish/PublishCliUpdate.ts +7 -1
package/lib/CliUtils.js
CHANGED
|
@@ -158,7 +158,7 @@ export var Constants = function Constants() {
|
|
|
158
158
|
"use strict";
|
|
159
159
|
_class_call_check(this, Constants);
|
|
160
160
|
};
|
|
161
|
-
_define_property(Constants, "CLI_VERSION", "0.9.
|
|
161
|
+
_define_property(Constants, "CLI_VERSION", "0.9.4");
|
|
162
162
|
_define_property(Constants, "CONFIG_FILE_NAME", "config.yaml");
|
|
163
163
|
_define_property(Constants, "DEFAULT_RPC_DEVNET", "https://api.devnet.solana.com");
|
|
164
164
|
_define_property(Constants, "DEFAULT_PRIORITY_FEE", 500000);
|
|
@@ -198,10 +198,17 @@ export var checkForSelfUpdate = function() {
|
|
|
198
198
|
}();
|
|
199
199
|
export var checkMintedStatus = function() {
|
|
200
200
|
var _ref = _async_to_generator(function(conn, pubAddr, appAddr, releaseAddr) {
|
|
201
|
-
var _results_, _results_1, _results_2, results, isPublisherMinted, isAppMinted, isReleaseMinted, errorMessage;
|
|
201
|
+
var i, _results_, _results_1, _results_2, results, isPublisherMinted, isAppMinted, isReleaseMinted, errorMessage;
|
|
202
202
|
return _ts_generator(this, function(_state) {
|
|
203
203
|
switch(_state.label){
|
|
204
204
|
case 0:
|
|
205
|
+
i = 0;
|
|
206
|
+
_state.label = 1;
|
|
207
|
+
case 1:
|
|
208
|
+
if (!(i < 5)) return [
|
|
209
|
+
3,
|
|
210
|
+
4
|
|
211
|
+
];
|
|
205
212
|
return [
|
|
206
213
|
4,
|
|
207
214
|
conn.getMultipleAccountsInfo([
|
|
@@ -210,12 +217,16 @@ export var checkMintedStatus = function() {
|
|
|
210
217
|
new PublicKey(releaseAddr)
|
|
211
218
|
])
|
|
212
219
|
];
|
|
213
|
-
case
|
|
220
|
+
case 2:
|
|
214
221
|
results = _state.sent();
|
|
215
222
|
isPublisherMinted = results[0] != undefined && ((_results_ = results[0]) === null || _results_ === void 0 ? void 0 : _results_.lamports) > 0;
|
|
216
223
|
isAppMinted = results[1] != undefined && ((_results_1 = results[1]) === null || _results_1 === void 0 ? void 0 : _results_1.lamports) > 0;
|
|
217
224
|
isReleaseMinted = results[2] != undefined && ((_results_2 = results[2]) === null || _results_2 === void 0 ? void 0 : _results_2.lamports) > 0;
|
|
218
|
-
if (
|
|
225
|
+
if (isPublisherMinted && isAppMinted && isReleaseMinted) {
|
|
226
|
+
return [
|
|
227
|
+
2
|
|
228
|
+
];
|
|
229
|
+
} else {
|
|
219
230
|
errorMessage = "";
|
|
220
231
|
if (!isPublisherMinted) {
|
|
221
232
|
errorMessage = errorMessage + "Publisher NFT fetch at address ".concat(pubAddr, " failed.\n");
|
|
@@ -226,8 +237,20 @@ export var checkMintedStatus = function() {
|
|
|
226
237
|
if (!isReleaseMinted) {
|
|
227
238
|
errorMessage = errorMessage + "Release NFT fetch at address ".concat(releaseAddr, " failed.\n");
|
|
228
239
|
}
|
|
229
|
-
|
|
240
|
+
if (i == 4) {
|
|
241
|
+
throw new Error("Expected Publisher :: ".concat(pubAddr, ", App :: ").concat(appAddr, " and Release :: ").concat(releaseAddr, " to be minted before submission.\n\n but ").concat(errorMessage, "\n\n Please ensure you have minted all of your NFTs before submitting to the Solana Mobile dApp publisher portal."));
|
|
242
|
+
} else {
|
|
243
|
+
sleep(2000);
|
|
244
|
+
}
|
|
230
245
|
}
|
|
246
|
+
_state.label = 3;
|
|
247
|
+
case 3:
|
|
248
|
+
i++;
|
|
249
|
+
return [
|
|
250
|
+
3,
|
|
251
|
+
1
|
|
252
|
+
];
|
|
253
|
+
case 4:
|
|
231
254
|
return [
|
|
232
255
|
2
|
|
233
256
|
];
|
|
@@ -238,6 +261,11 @@ export var checkMintedStatus = function() {
|
|
|
238
261
|
return _ref.apply(this, arguments);
|
|
239
262
|
};
|
|
240
263
|
}();
|
|
264
|
+
export var sleep = function(ms) {
|
|
265
|
+
return new Promise(function(resolve) {
|
|
266
|
+
return setTimeout(resolve, ms);
|
|
267
|
+
});
|
|
268
|
+
};
|
|
241
269
|
export var parseKeypair = function(pathToKeypairFile) {
|
|
242
270
|
try {
|
|
243
271
|
var keypairFile = fs.readFileSync(pathToKeypairFile, "utf-8");
|
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana-mobile/dapp-store-cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@aws-sdk/client-s3": "^3.321.1",
|
|
55
55
|
"@metaplex-foundation/js-plugin-aws": "^0.20.0",
|
|
56
|
-
"@solana-mobile/dapp-store-publishing-tools": "workspace:0.9.
|
|
56
|
+
"@solana-mobile/dapp-store-publishing-tools": "workspace:0.9.4",
|
|
57
57
|
"@solana/web3.js": "1.92.1",
|
|
58
58
|
"@types/semver": "^7.3.13",
|
|
59
59
|
"ajv": "^8.11.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana-mobile/dapp-store-cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@aws-sdk/client-s3": "^3.321.1",
|
|
48
48
|
"@metaplex-foundation/js-plugin-aws": "^0.20.0",
|
|
49
|
-
"@solana-mobile/dapp-store-publishing-tools": "0.9.
|
|
49
|
+
"@solana-mobile/dapp-store-publishing-tools": "0.9.4",
|
|
50
50
|
"@solana/web3.js": "1.92.1",
|
|
51
51
|
"@types/semver": "^7.3.13",
|
|
52
52
|
"ajv": "^8.11.0",
|
package/src/CliUtils.ts
CHANGED
|
@@ -19,7 +19,7 @@ import { awsStorage } from "@metaplex-foundation/js-plugin-aws";
|
|
|
19
19
|
import { S3StorageManager } from "./config/index.js";
|
|
20
20
|
|
|
21
21
|
export class Constants {
|
|
22
|
-
static CLI_VERSION = "0.9.
|
|
22
|
+
static CLI_VERSION = "0.9.4";
|
|
23
23
|
static CONFIG_FILE_NAME = "config.yaml";
|
|
24
24
|
static DEFAULT_RPC_DEVNET = "https://api.devnet.solana.com";
|
|
25
25
|
static DEFAULT_PRIORITY_FEE = 500000;
|
|
@@ -54,37 +54,47 @@ export const checkMintedStatus = async (
|
|
|
54
54
|
appAddr: string,
|
|
55
55
|
releaseAddr: string
|
|
56
56
|
) => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
errorMessage =
|
|
57
|
+
for (let i = 0; i < 5; i++) {
|
|
58
|
+
const results = await conn.getMultipleAccountsInfo([
|
|
59
|
+
new PublicKey(pubAddr),
|
|
60
|
+
new PublicKey(appAddr),
|
|
61
|
+
new PublicKey(releaseAddr),
|
|
62
|
+
]);
|
|
63
|
+
|
|
64
|
+
const isPublisherMinted = results[0] != undefined && results[0]?.lamports > 0
|
|
65
|
+
const isAppMinted = results[1] != undefined && results[1]?.lamports > 0
|
|
66
|
+
const isReleaseMinted = results[2] != undefined && results[2]?.lamports > 0
|
|
67
|
+
|
|
68
|
+
if (isPublisherMinted && isAppMinted && isReleaseMinted) {
|
|
69
|
+
return
|
|
70
|
+
} else {
|
|
71
|
+
let errorMessage = ``
|
|
72
|
+
if (!isPublisherMinted) {
|
|
73
|
+
errorMessage = errorMessage + `Publisher NFT fetch at address ${pubAddr} failed.\n`
|
|
74
|
+
}
|
|
75
|
+
if (!isAppMinted) {
|
|
76
|
+
errorMessage = errorMessage + `App NFT fetch at address ${appAddr} failed.\n`
|
|
77
|
+
}
|
|
78
|
+
if (!isReleaseMinted) {
|
|
79
|
+
errorMessage = errorMessage + `Release NFT fetch at address ${releaseAddr} failed.\n`
|
|
80
|
+
}
|
|
81
|
+
if (i == 4) {
|
|
82
|
+
throw new Error(
|
|
83
|
+
`Expected Publisher :: ${pubAddr}, App :: ${appAddr} and Release :: ${releaseAddr} to be minted before submission.\n
|
|
84
|
+
but ${errorMessage}\n
|
|
85
|
+
Please ensure you have minted all of your NFTs before submitting to the Solana Mobile dApp publisher portal.`
|
|
86
|
+
);
|
|
87
|
+
} else {
|
|
88
|
+
sleep(2000)
|
|
89
|
+
}
|
|
72
90
|
}
|
|
73
|
-
if (!isAppMinted) {
|
|
74
|
-
errorMessage = errorMessage + `App NFT fetch at address ${appAddr} failed.\n`
|
|
75
|
-
}
|
|
76
|
-
if (!isReleaseMinted) {
|
|
77
|
-
errorMessage = errorMessage + `Release NFT fetch at address ${releaseAddr} failed.\n`
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
throw new Error(
|
|
81
|
-
`Expected Publisher :: ${pubAddr}, App :: ${appAddr} and Release :: ${releaseAddr} to be minted before submission.\n
|
|
82
|
-
but ${errorMessage}\n
|
|
83
|
-
Please ensure you have minted all of your NFTs before submitting to the Solana Mobile dApp publisher portal.`
|
|
84
|
-
);
|
|
85
91
|
}
|
|
86
92
|
};
|
|
87
93
|
|
|
94
|
+
export const sleep = (ms: number):Promise<void> => {
|
|
95
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
96
|
+
}
|
|
97
|
+
|
|
88
98
|
export const parseKeypair = (pathToKeypairFile: string) => {
|
|
89
99
|
try {
|
|
90
100
|
const keypairFile = fs.readFileSync(pathToKeypairFile, "utf-8");
|
|
@@ -93,7 +103,7 @@ export const parseKeypair = (pathToKeypairFile: string) => {
|
|
|
93
103
|
showMessage(
|
|
94
104
|
"KeyPair Error",
|
|
95
105
|
"Something went wrong when attempting to retrieve the keypair at " +
|
|
96
|
-
|
|
106
|
+
pathToKeypairFile,
|
|
97
107
|
"error"
|
|
98
108
|
);
|
|
99
109
|
}
|
|
@@ -31,7 +31,13 @@ export const publishRemoveCommand = async ({
|
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
const connection = new Connection(
|
|
34
|
+
const connection = new Connection(
|
|
35
|
+
url,
|
|
36
|
+
{
|
|
37
|
+
commitment: "confirmed",
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
|
|
35
41
|
const {
|
|
36
42
|
publisher: publisherDetails,
|
|
37
43
|
app: appDetails,
|
|
@@ -31,7 +31,13 @@ export const publishSupportCommand = async ({
|
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
const connection = new Connection(
|
|
34
|
+
const connection = new Connection(
|
|
35
|
+
url,
|
|
36
|
+
{
|
|
37
|
+
commitment: "confirmed",
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
|
|
35
41
|
const {
|
|
36
42
|
publisher: publisherDetails,
|
|
37
43
|
app: appDetails,
|
|
@@ -45,7 +45,13 @@ export const publishUpdateCommand = async ({
|
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
const connection = new Connection(
|
|
48
|
+
const connection = new Connection(
|
|
49
|
+
url,
|
|
50
|
+
{
|
|
51
|
+
commitment: "confirmed",
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
|
|
49
55
|
const {
|
|
50
56
|
publisher: publisherDetails,
|
|
51
57
|
app: appDetails,
|