@solana-mobile/dapp-store-cli 0.1.7 → 0.1.9
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/esm/commands/create/app.js +3 -2
- package/lib/esm/commands/create/app.js.map +1 -1
- package/lib/esm/index.js +70 -66
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/package.json +57 -0
- package/lib/esm/utils.js +45 -6
- package/lib/esm/utils.js.map +1 -1
- package/lib/types/commands/create/app.d.ts.map +1 -1
- package/lib/types/utils.d.ts +6 -1
- package/lib/types/utils.d.ts.map +1 -1
- package/package.json +8 -3
- package/src/commands/create/app.ts +3 -2
- package/src/index.ts +91 -81
- package/src/utils.ts +55 -7
|
@@ -30,8 +30,9 @@ export const createAppCommand = async ({ signer, url, dryRun, publisherMintAddre
|
|
|
30
30
|
publisherMintAddress: publisherDetails.address ?? publisherMintAddress,
|
|
31
31
|
appDetails,
|
|
32
32
|
}, { dryRun });
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
if (!dryRun) {
|
|
34
|
+
saveToConfig({ app: { address: appAddress } });
|
|
35
|
+
}
|
|
35
36
|
return { appAddress };
|
|
36
37
|
};
|
|
37
38
|
//# sourceMappingURL=app.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../../src/commands/create/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AACvE,OAAO,EACL,UAAU,EACV,OAAO,EACP,SAAS,EACT,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,YAAY,GACb,MAAM,gBAAgB,CAAC;AAExB,MAAM,YAAY,GAAG,KAAK,EACxB,EACE,UAAU,EACV,UAAU,EACV,oBAAoB,EACpB,SAAS,GAMV,EACD,EAAE,MAAM,EAAwB,EAChC,EAAE;IACF,MAAM,WAAW,GAAG,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AO,EAAE,UAAU,EAAE,WAAW,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC;AAC1D,CAAC,CAAC;AASF,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,EACrC,MAAM,EACN,GAAG,EACH,MAAM,EACN,oBAAoB,GACE,EAAE,EAAE;IAC1B,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;IAEvC,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,GACpD,MAAM,aAAa,EAAE,CAAC;IAExB,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,YAAY,CACvC;QACE,UAAU;QACV,SAAS,EAAE,MAAM;QACjB,oBAAoB,EAAE,gBAAgB,CAAC,OAAO,IAAI,oBAAoB;QACtE,UAAU;KACX,EACD,EAAE,MAAM,EAAE,CACX,CAAC;IAEF,IAAI,CAAC,MAAM,EAAE;QACX,YAAY,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC;KAChD;IAED,OAAO,EAAE,UAAU,EAAE,CAAC;AACxB,CAAC,CAAC"}
|
package/lib/esm/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Command } from "commander";
|
|
|
2
2
|
import { validateCommand } from "./commands/index.js";
|
|
3
3
|
import { createAppCommand, createPublisherCommand, createReleaseCommand } from "./commands/create/index.js";
|
|
4
4
|
import { publishRemoveCommand, publishSubmitCommand, publishSupportCommand, publishUpdateCommand } from "./commands/publish/index.js";
|
|
5
|
-
import { getConfigFile, parseKeypair,
|
|
5
|
+
import { checkForSelfUpdate, checkSubmissionNetwork, generateNetworkSuffix, getConfigFile, parseKeypair, showMessage } from "./utils.js";
|
|
6
6
|
import * as dotenv from "dotenv";
|
|
7
7
|
dotenv.config();
|
|
8
8
|
const hasAddressInConfig = ({ address }) => {
|
|
@@ -21,10 +21,19 @@ function resolveBuildToolsPath(buildToolsPath) {
|
|
|
21
21
|
// No path was specified
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
+
async function tryWithErrorMessage(block) {
|
|
25
|
+
try {
|
|
26
|
+
await block();
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
const errorMsg = e?.message ?? "";
|
|
30
|
+
showMessage("Error", errorMsg, true);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
24
33
|
async function main() {
|
|
25
34
|
program
|
|
26
35
|
.name("dapp-store")
|
|
27
|
-
.version("0.1.
|
|
36
|
+
.version("0.1.9")
|
|
28
37
|
.description("CLI to assist with publishing to the Saga Dapp Store");
|
|
29
38
|
const createCommand = program
|
|
30
39
|
.command("create")
|
|
@@ -36,10 +45,16 @@ async function main() {
|
|
|
36
45
|
.option("-u, --url <url>", "RPC URL", "https://devnet.genesysgo.net")
|
|
37
46
|
.option("-d, --dry-run", "Flag for dry run. Doesn't mint an NFT")
|
|
38
47
|
.action(async ({ keypair, url, dryRun }) => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
48
|
+
tryWithErrorMessage(async () => {
|
|
49
|
+
await checkForSelfUpdate();
|
|
50
|
+
const signer = parseKeypair(keypair);
|
|
51
|
+
if (signer) {
|
|
52
|
+
const result = await createPublisherCommand({ signer, url, dryRun });
|
|
53
|
+
const displayUrl = `https://solscan.io/token/${result.publisherAddress}${generateNetworkSuffix(url)}`;
|
|
54
|
+
const resultText = `Publisher NFT successfully minted:\n${displayUrl}`;
|
|
55
|
+
showMessage("Success", resultText);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
43
58
|
});
|
|
44
59
|
createCommand
|
|
45
60
|
.command("app")
|
|
@@ -49,26 +64,25 @@ async function main() {
|
|
|
49
64
|
.option("-u, --url <url>", "RPC URL", "https://devnet.genesysgo.net")
|
|
50
65
|
.option("-d, --dry-run", "Flag for dry run. Doesn't mint an NFT")
|
|
51
66
|
.action(async ({ publisherMintAddress, keypair, url, dryRun }) => {
|
|
52
|
-
|
|
67
|
+
tryWithErrorMessage(async () => {
|
|
68
|
+
await checkForSelfUpdate();
|
|
53
69
|
const config = await getConfigFile();
|
|
54
70
|
if (!hasAddressInConfig(config.publisher) && !publisherMintAddress) {
|
|
55
|
-
|
|
56
|
-
createCommand.showHelpAfterError();
|
|
57
|
-
return;
|
|
71
|
+
throw new Error("Either specify a publisher mint address in the config file or specify as a CLI argument to this command.");
|
|
58
72
|
}
|
|
59
73
|
const signer = parseKeypair(keypair);
|
|
60
74
|
if (signer) {
|
|
61
|
-
await createAppCommand({
|
|
75
|
+
const result = await createAppCommand({
|
|
62
76
|
publisherMintAddress: publisherMintAddress,
|
|
63
77
|
signer,
|
|
64
78
|
url,
|
|
65
79
|
dryRun,
|
|
66
80
|
});
|
|
81
|
+
const displayUrl = `https://solscan.io/token/${result.appAddress}${generateNetworkSuffix(url)}`;
|
|
82
|
+
const resultText = `App NFT successfully minted:\n${displayUrl}`;
|
|
83
|
+
showMessage("Success", resultText);
|
|
67
84
|
}
|
|
68
|
-
}
|
|
69
|
-
catch (e) {
|
|
70
|
-
showUserErrorMessage(e?.message ?? "");
|
|
71
|
-
}
|
|
85
|
+
});
|
|
72
86
|
});
|
|
73
87
|
createCommand
|
|
74
88
|
.command("release")
|
|
@@ -79,18 +93,15 @@ async function main() {
|
|
|
79
93
|
.option("-d, --dry-run", "Flag for dry run. Doesn't mint an NFT")
|
|
80
94
|
.option("-b, --build-tools-path <build-tools-path>", "Path to Android build tools which contains AAPT2")
|
|
81
95
|
.action(async ({ appMintAddress, keypair, url, dryRun, buildToolsPath }) => {
|
|
82
|
-
|
|
96
|
+
tryWithErrorMessage(async () => {
|
|
97
|
+
await checkForSelfUpdate();
|
|
83
98
|
const resolvedBuildToolsPath = resolveBuildToolsPath(buildToolsPath);
|
|
84
99
|
if (resolvedBuildToolsPath === undefined) {
|
|
85
|
-
|
|
86
|
-
createCommand.showHelpAfterError();
|
|
87
|
-
return;
|
|
100
|
+
throw new Error("Please specify an Android build tools directory in the .env file or via the command line argument.");
|
|
88
101
|
}
|
|
89
102
|
const config = await getConfigFile();
|
|
90
103
|
if (!hasAddressInConfig(config.app) && !appMintAddress) {
|
|
91
|
-
|
|
92
|
-
createCommand.showHelpAfterError();
|
|
93
|
-
return;
|
|
104
|
+
throw new Error("Either specify an app mint address in the config file or specify as a CLI argument to this command");
|
|
94
105
|
}
|
|
95
106
|
const signer = parseKeypair(keypair);
|
|
96
107
|
if (signer) {
|
|
@@ -101,11 +112,11 @@ async function main() {
|
|
|
101
112
|
url,
|
|
102
113
|
dryRun,
|
|
103
114
|
});
|
|
115
|
+
const displayUrl = `https://solscan.io/token/${result?.releaseAddress}${generateNetworkSuffix(url)}`;
|
|
116
|
+
const resultText = `Release NFT successfully minted:\n${displayUrl}`;
|
|
117
|
+
showMessage("Success", resultText);
|
|
104
118
|
}
|
|
105
|
-
}
|
|
106
|
-
catch (e) {
|
|
107
|
-
showUserErrorMessage(e?.message ?? "");
|
|
108
|
-
}
|
|
119
|
+
});
|
|
109
120
|
});
|
|
110
121
|
program
|
|
111
122
|
.command("validate")
|
|
@@ -113,12 +124,11 @@ async function main() {
|
|
|
113
124
|
.requiredOption("-k, --keypair <path-to-keypair-file>", "Path to keypair file")
|
|
114
125
|
.option("-b, --build-tools-path <build-tools-path>", "Path to Android build tools which contains AAPT2")
|
|
115
126
|
.action(async ({ keypair, buildToolsPath }) => {
|
|
116
|
-
|
|
127
|
+
tryWithErrorMessage(async () => {
|
|
128
|
+
await checkForSelfUpdate();
|
|
117
129
|
const resolvedBuildToolsPath = resolveBuildToolsPath(buildToolsPath);
|
|
118
130
|
if (resolvedBuildToolsPath === undefined) {
|
|
119
|
-
|
|
120
|
-
createCommand.showHelpAfterError();
|
|
121
|
-
return;
|
|
131
|
+
throw new Error("Please specify an Android build tools directory in the .env file or via the command line argument.");
|
|
122
132
|
}
|
|
123
133
|
const signer = parseKeypair(keypair);
|
|
124
134
|
if (signer) {
|
|
@@ -126,11 +136,9 @@ async function main() {
|
|
|
126
136
|
signer,
|
|
127
137
|
buildToolsPath: resolvedBuildToolsPath,
|
|
128
138
|
});
|
|
139
|
+
//TODO: Add pretty formatting here, but will require more work than other sections
|
|
129
140
|
}
|
|
130
|
-
}
|
|
131
|
-
catch (e) {
|
|
132
|
-
showUserErrorMessage(e?.message ?? "");
|
|
133
|
-
}
|
|
141
|
+
});
|
|
134
142
|
});
|
|
135
143
|
const publishCommand = program
|
|
136
144
|
.command("publish")
|
|
@@ -146,12 +154,12 @@ async function main() {
|
|
|
146
154
|
.option("-u, --url <url>", "RPC URL", "https://devnet.genesysgo.net")
|
|
147
155
|
.option("-d, --dry-run", "Flag for dry run. Doesn't submit the request to the publisher portal.")
|
|
148
156
|
.action(async ({ appMintAddress, releaseMintAddress, keypair, url, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, dryRun, }) => {
|
|
149
|
-
|
|
157
|
+
tryWithErrorMessage(async () => {
|
|
158
|
+
await checkForSelfUpdate();
|
|
159
|
+
await checkSubmissionNetwork(url);
|
|
150
160
|
const config = await getConfigFile();
|
|
151
161
|
if (!hasAddressInConfig(config.release) && !releaseMintAddress) {
|
|
152
|
-
|
|
153
|
-
publishCommand.showHelpAfterError();
|
|
154
|
-
return;
|
|
162
|
+
throw new Error("Either specify a release mint address in the config file or specify as a CLI argument to this command.");
|
|
155
163
|
}
|
|
156
164
|
const signer = parseKeypair(keypair);
|
|
157
165
|
if (signer) {
|
|
@@ -164,11 +172,10 @@ async function main() {
|
|
|
164
172
|
compliesWithSolanaDappStorePolicies,
|
|
165
173
|
requestorIsAuthorized,
|
|
166
174
|
});
|
|
175
|
+
const resultText = "Successfully submitted to the Solana Mobile dApp publisher portal";
|
|
176
|
+
showMessage("Success", resultText);
|
|
167
177
|
}
|
|
168
|
-
}
|
|
169
|
-
catch (e) {
|
|
170
|
-
showUserErrorMessage(e?.message ?? "");
|
|
171
|
-
}
|
|
178
|
+
});
|
|
172
179
|
});
|
|
173
180
|
publishCommand
|
|
174
181
|
.command("update")
|
|
@@ -182,12 +189,12 @@ async function main() {
|
|
|
182
189
|
.option("-u, --url <url>", "RPC URL", "https://devnet.genesysgo.net")
|
|
183
190
|
.option("-d, --dry-run", "Flag for dry run. Doesn't submit the request to the publisher portal.")
|
|
184
191
|
.action(async ({ appMintAddress, releaseMintAddress, keypair, url, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, critical, dryRun, }) => {
|
|
185
|
-
|
|
192
|
+
tryWithErrorMessage(async () => {
|
|
193
|
+
await checkForSelfUpdate();
|
|
194
|
+
await checkSubmissionNetwork(url);
|
|
186
195
|
const config = await getConfigFile();
|
|
187
196
|
if (!hasAddressInConfig(config.release) && !releaseMintAddress) {
|
|
188
|
-
|
|
189
|
-
publishCommand.showHelpAfterError();
|
|
190
|
-
return;
|
|
197
|
+
throw new Error("Either specify a release mint address in the config file or specify as a CLI argument to this command.");
|
|
191
198
|
}
|
|
192
199
|
const signer = parseKeypair(keypair);
|
|
193
200
|
if (signer) {
|
|
@@ -201,11 +208,10 @@ async function main() {
|
|
|
201
208
|
requestorIsAuthorized,
|
|
202
209
|
critical,
|
|
203
210
|
});
|
|
211
|
+
const resultText = "dApp successfully updated on the publisher portal";
|
|
212
|
+
showMessage("Success", resultText);
|
|
204
213
|
}
|
|
205
|
-
}
|
|
206
|
-
catch (e) {
|
|
207
|
-
showUserErrorMessage(e?.message ?? "");
|
|
208
|
-
}
|
|
214
|
+
});
|
|
209
215
|
});
|
|
210
216
|
publishCommand
|
|
211
217
|
.command("remove")
|
|
@@ -218,12 +224,12 @@ async function main() {
|
|
|
218
224
|
.option("-u, --url <url>", "RPC URL", "https://devnet.genesysgo.net")
|
|
219
225
|
.option("-d, --dry-run", "Flag for dry run. Doesn't submit the request to the publisher portal.")
|
|
220
226
|
.action(async ({ appMintAddress, releaseMintAddress, keypair, url, requestorIsAuthorized, critical, dryRun, }) => {
|
|
221
|
-
|
|
227
|
+
tryWithErrorMessage(async () => {
|
|
228
|
+
await checkForSelfUpdate();
|
|
229
|
+
await checkSubmissionNetwork(url);
|
|
222
230
|
const config = await getConfigFile();
|
|
223
231
|
if (!hasAddressInConfig(config.release) && !releaseMintAddress) {
|
|
224
|
-
|
|
225
|
-
publishCommand.showHelpAfterError();
|
|
226
|
-
return;
|
|
232
|
+
throw new Error("Either specify a release mint address in the config file or specify as a CLI argument to this command.");
|
|
227
233
|
}
|
|
228
234
|
const signer = parseKeypair(keypair);
|
|
229
235
|
if (signer) {
|
|
@@ -236,11 +242,10 @@ async function main() {
|
|
|
236
242
|
requestorIsAuthorized,
|
|
237
243
|
critical,
|
|
238
244
|
});
|
|
245
|
+
const resultText = "dApp successfully removed from the publisher portal";
|
|
246
|
+
showMessage("Success", resultText);
|
|
239
247
|
}
|
|
240
|
-
}
|
|
241
|
-
catch (e) {
|
|
242
|
-
showUserErrorMessage(e?.message ?? "");
|
|
243
|
-
}
|
|
248
|
+
});
|
|
244
249
|
});
|
|
245
250
|
publishCommand
|
|
246
251
|
.command("support <request_details>")
|
|
@@ -252,12 +257,12 @@ async function main() {
|
|
|
252
257
|
.option("-u, --url <url>", "RPC URL", "https://devnet.genesysgo.net")
|
|
253
258
|
.option("-d, --dry-run", "Flag for dry run. Doesn't submit the request to the publisher portal.")
|
|
254
259
|
.action(async (requestDetails, { appMintAddress, releaseMintAddress, keypair, url, requestorIsAuthorized, dryRun }) => {
|
|
255
|
-
|
|
260
|
+
tryWithErrorMessage(async () => {
|
|
261
|
+
await checkForSelfUpdate();
|
|
262
|
+
await checkSubmissionNetwork(url);
|
|
256
263
|
const config = await getConfigFile();
|
|
257
264
|
if (!hasAddressInConfig(config.release) && !releaseMintAddress) {
|
|
258
|
-
|
|
259
|
-
publishCommand.showHelpAfterError();
|
|
260
|
-
return;
|
|
265
|
+
throw new Error("Either specify a release mint address in the config file or specify as a CLI argument to this command.");
|
|
261
266
|
}
|
|
262
267
|
const signer = parseKeypair(keypair);
|
|
263
268
|
if (signer) {
|
|
@@ -270,11 +275,10 @@ async function main() {
|
|
|
270
275
|
requestorIsAuthorized,
|
|
271
276
|
requestDetails,
|
|
272
277
|
});
|
|
278
|
+
const resultText = "Support request sent successfully";
|
|
279
|
+
showMessage("Success", resultText);
|
|
273
280
|
}
|
|
274
|
-
}
|
|
275
|
-
catch (e) {
|
|
276
|
-
showUserErrorMessage(e?.message ?? "");
|
|
277
|
-
}
|
|
281
|
+
});
|
|
278
282
|
});
|
|
279
283
|
await program.parseAsync(process.argv);
|
|
280
284
|
}
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAC5G,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAC5G,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAIzI,OAAO,KAAK,MAAM,MAAM,QAAQ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AO,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AACD,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@solana-mobile/dapp-store-cli",
|
|
3
|
+
"version": "0.1.9",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"main": "./lib/cjs/index.js",
|
|
8
|
+
"module": "./lib/esm/index.js",
|
|
9
|
+
"types": "./lib/types/index.d.ts",
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=18"
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
"import": "./lib/esm/index.js",
|
|
15
|
+
"require": "./lib/cjs/index.js",
|
|
16
|
+
"types": "./lib/types/index.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"bin": {
|
|
19
|
+
"dapp-store": "./bin/dapp-store.js"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"lib",
|
|
23
|
+
"src",
|
|
24
|
+
"LICENSE"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"clean": "shx mkdir -p lib && shx rm -rf lib",
|
|
31
|
+
"prebuild": "pnpm run clean"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@metaplex-foundation/js": "0.17.11",
|
|
35
|
+
"@types/commander": "^2.12.2",
|
|
36
|
+
"@types/debug": "^4.1.7",
|
|
37
|
+
"@types/js-yaml": "^4.0.5",
|
|
38
|
+
"@types/terminal-link": "^1.2.0",
|
|
39
|
+
"@types/update-notifier": "^6.0.1",
|
|
40
|
+
"shx": "^0.3.4"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@solana-mobile/dapp-store-publishing-tools": "workspace:0.1.9",
|
|
44
|
+
"@solana/web3.js": "1.68.0",
|
|
45
|
+
"ajv": "^8.11.0",
|
|
46
|
+
"boxen": "^7.0.1",
|
|
47
|
+
"commander": "^9.4.1",
|
|
48
|
+
"debug": "^4.3.4",
|
|
49
|
+
"dotenv": "^16.0.3",
|
|
50
|
+
"esm": "^3.2.25",
|
|
51
|
+
"image-size": "^1.0.2",
|
|
52
|
+
"js-yaml": "^4.1.0",
|
|
53
|
+
"terminal-link": "^3.0.0",
|
|
54
|
+
"tweetnacl": "1.0.3",
|
|
55
|
+
"update-notifier": "^6.0.2"
|
|
56
|
+
}
|
|
57
|
+
}
|
package/lib/esm/utils.js
CHANGED
|
@@ -8,10 +8,20 @@ import { exec } from "child_process";
|
|
|
8
8
|
import * as path from "path";
|
|
9
9
|
import { BundlrStorageDriver, keypairIdentity, Metaplex, toMetaplexFile } from "@metaplex-foundation/js";
|
|
10
10
|
import { imageSize } from "image-size";
|
|
11
|
+
import updateNotifier from "update-notifier";
|
|
12
|
+
import cliPackage from "./package.json" assert { type: "json" };
|
|
13
|
+
import boxen from "boxen";
|
|
11
14
|
import { CachedStorageDriver } from "./upload/CachedStorageDriver.js";
|
|
12
15
|
const runImgSize = util.promisify(imageSize);
|
|
13
16
|
const runExec = util.promisify(exec);
|
|
14
17
|
export const debug = debugModule("CLI");
|
|
18
|
+
export const checkForSelfUpdate = async () => {
|
|
19
|
+
const notifier = updateNotifier({ pkg: cliPackage });
|
|
20
|
+
const updateInfo = await notifier.fetchInfo();
|
|
21
|
+
if (updateInfo.current != updateInfo.latest) {
|
|
22
|
+
throw new Error("Please update to the latest version of the dApp Store CLI before proceeding.");
|
|
23
|
+
}
|
|
24
|
+
};
|
|
15
25
|
export const parseKeypair = (pathToKeypairFile) => {
|
|
16
26
|
try {
|
|
17
27
|
const keypairFile = fs.readFileSync(pathToKeypairFile, "utf-8");
|
|
@@ -34,7 +44,6 @@ const AaptPrefixes = {
|
|
|
34
44
|
export const getConfigFile = async (buildToolsDir = null) => {
|
|
35
45
|
const configFilePath = `${process.cwd()}/config.yaml`;
|
|
36
46
|
const config = await getConfig(configFilePath);
|
|
37
|
-
console.info(`Pulling details from ${configFilePath}`);
|
|
38
47
|
if (buildToolsDir && fs.lstatSync(buildToolsDir).isDirectory()) {
|
|
39
48
|
// We validate that the config is going to have at least one installable asset
|
|
40
49
|
const apkEntry = config.release.files.find((asset) => asset.purpose === "install");
|
|
@@ -83,10 +92,40 @@ const checkImageExtension = (uri) => {
|
|
|
83
92
|
fileExt == ".jpeg" ||
|
|
84
93
|
fileExt == ".webp");
|
|
85
94
|
};
|
|
86
|
-
export const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
95
|
+
export const isDevnet = (rpcUrl) => {
|
|
96
|
+
return rpcUrl.indexOf("devnet") != -1;
|
|
97
|
+
};
|
|
98
|
+
export const isTestnet = (rpcUrl) => {
|
|
99
|
+
return rpcUrl.indexOf("testnet") != -1;
|
|
100
|
+
};
|
|
101
|
+
export const checkSubmissionNetwork = (rpcUrl) => {
|
|
102
|
+
if (isDevnet(rpcUrl) || isTestnet(rpcUrl)) {
|
|
103
|
+
throw new Error("It looks like you are attempting to submit a request with a devnet or testnet RPC endpoint. Please ensure that your NFTs are minted on mainnet beta, and re-run with a mainnet beta RPC endpoint.");
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
export const generateNetworkSuffix = (rpcUrl) => {
|
|
107
|
+
let suffix = "";
|
|
108
|
+
if (isDevnet(rpcUrl)) {
|
|
109
|
+
suffix = "?cluster=devnet";
|
|
110
|
+
}
|
|
111
|
+
else if (isTestnet(rpcUrl)) {
|
|
112
|
+
suffix = "?cluster=testnet";
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
suffix = "?cluster=mainnet";
|
|
116
|
+
}
|
|
117
|
+
return suffix;
|
|
118
|
+
};
|
|
119
|
+
export const showMessage = (titleMessage = "", contentMessage = "", isError = false) => {
|
|
120
|
+
console.log(boxen(contentMessage, {
|
|
121
|
+
title: titleMessage,
|
|
122
|
+
padding: 1,
|
|
123
|
+
margin: 1,
|
|
124
|
+
borderStyle: 'single',
|
|
125
|
+
borderColor: isError ? "redBright" : "cyan",
|
|
126
|
+
textAlignment: "left",
|
|
127
|
+
titleAlignment: "center"
|
|
128
|
+
}));
|
|
90
129
|
};
|
|
91
130
|
const checkIconDimensions = async (iconPath) => {
|
|
92
131
|
const size = await runImgSize(iconPath);
|
|
@@ -107,7 +146,7 @@ const getAndroidDetails = async (aaptDir, apkPath) => {
|
|
|
107
146
|
let localeArray = Array.from(locales?.values() ?? []);
|
|
108
147
|
if (localeArray.length == 2) {
|
|
109
148
|
const localesSrc = localeArray[1];
|
|
110
|
-
localeArray = localesSrc.split("' '").slice(1);
|
|
149
|
+
localeArray = ["en-US"].concat(localesSrc.split("' '").slice(1));
|
|
111
150
|
}
|
|
112
151
|
return {
|
|
113
152
|
android_package: appPackage?.[1] ?? "",
|
package/lib/esm/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAGpB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,WAAW,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzG,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":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commands/create/app.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,OAAO,EAGR,MAAM,iBAAiB,CAAC;AAgDzB,aAAK,qBAAqB,GAAG;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,gBAAgB,mDAK1B,qBAAqB;;
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../../src/commands/create/app.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,OAAO,EAGR,MAAM,iBAAiB,CAAC;AAgDzB,aAAK,qBAAqB,GAAG;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,gBAAgB,mDAK1B,qBAAqB;;EAqBvB,CAAC"}
|
package/lib/types/utils.d.ts
CHANGED
|
@@ -5,9 +5,14 @@ import type { CLIConfig } from "./config/index.js";
|
|
|
5
5
|
import debugModule from "debug";
|
|
6
6
|
import { Metaplex } from "@metaplex-foundation/js";
|
|
7
7
|
export declare const debug: debugModule.Debugger;
|
|
8
|
+
export declare const checkForSelfUpdate: () => Promise<void>;
|
|
8
9
|
export declare const parseKeypair: (pathToKeypairFile: string) => Keypair | undefined;
|
|
9
10
|
export declare const getConfigFile: (buildToolsDir?: string | null) => Promise<CLIConfig>;
|
|
10
|
-
export declare const
|
|
11
|
+
export declare const isDevnet: (rpcUrl: string) => boolean;
|
|
12
|
+
export declare const isTestnet: (rpcUrl: string) => boolean;
|
|
13
|
+
export declare const checkSubmissionNetwork: (rpcUrl: string) => void;
|
|
14
|
+
export declare const generateNetworkSuffix: (rpcUrl: string) => string;
|
|
15
|
+
export declare const showMessage: (titleMessage?: string, contentMessage?: string, isError?: boolean) => void;
|
|
11
16
|
declare type SaveToConfigArgs = {
|
|
12
17
|
publisher?: Pick<Publisher, "address">;
|
|
13
18
|
app?: Pick<App, "address">;
|
package/lib/types/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,4CAA4C,CAAC;AAC1G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,WAAW,MAAM,OAAO,CAAC;AAKhC,OAAO,EAAwC,QAAQ,EAAkB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,4CAA4C,CAAC;AAC1G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,WAAW,MAAM,OAAO,CAAC;AAKhC,OAAO,EAAwC,QAAQ,EAAkB,MAAM,yBAAyB,CAAC;AAWzG,eAAO,MAAM,KAAK,sBAAqB,CAAC;AAExC,eAAO,MAAM,kBAAkB,qBAO9B,CAAC;AAEF,eAAO,MAAM,YAAY,sBAAuB,MAAM,wBASrD,CAAC;AAaF,eAAO,MAAM,aAAa,mBACT,MAAM,GAAG,IAAI,KAC3B,QAAQ,SAAS,CAiEnB,CAAC;AAYF,eAAO,MAAM,QAAQ,WAAY,MAAM,KAAG,OAEzC,CAAC;AAEF,eAAO,MAAM,SAAS,WAAY,MAAM,KAAG,OAE1C,CAAC;AAEF,eAAO,MAAM,sBAAsB,WAAY,MAAM,SAIpD,CAAC;AAEF,eAAO,MAAM,qBAAqB,WAAY,MAAM,KAAG,MAYtD,CAAC;AAEF,eAAO,MAAM,WAAW,6EAcvB,CAAC;AAsDF,aAAK,gBAAgB,GAAG;IACtB,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACvC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAC3B,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,YAAY,iCAItB,gBAAgB,kBAyBlB,CAAC;AAEF,eAAO,MAAM,mBAAmB,eAClB,UAAU,WACb,OAAO,aAoBjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana-mobile/dapp-store-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -31,19 +31,24 @@
|
|
|
31
31
|
"@types/commander": "^2.12.2",
|
|
32
32
|
"@types/debug": "^4.1.7",
|
|
33
33
|
"@types/js-yaml": "^4.0.5",
|
|
34
|
+
"@types/terminal-link": "^1.2.0",
|
|
35
|
+
"@types/update-notifier": "^6.0.1",
|
|
34
36
|
"shx": "^0.3.4"
|
|
35
37
|
},
|
|
36
38
|
"dependencies": {
|
|
37
|
-
"@solana-mobile/dapp-store-publishing-tools": "0.1.
|
|
39
|
+
"@solana-mobile/dapp-store-publishing-tools": "0.1.9",
|
|
38
40
|
"@solana/web3.js": "1.68.0",
|
|
39
41
|
"ajv": "^8.11.0",
|
|
42
|
+
"boxen": "^7.0.1",
|
|
40
43
|
"commander": "^9.4.1",
|
|
41
44
|
"debug": "^4.3.4",
|
|
42
45
|
"dotenv": "^16.0.3",
|
|
43
46
|
"esm": "^3.2.25",
|
|
44
47
|
"image-size": "^1.0.2",
|
|
45
48
|
"js-yaml": "^4.1.0",
|
|
46
|
-
"
|
|
49
|
+
"terminal-link": "^3.0.0",
|
|
50
|
+
"tweetnacl": "1.0.3",
|
|
51
|
+
"update-notifier": "^6.0.2"
|
|
47
52
|
},
|
|
48
53
|
"scripts": {
|
|
49
54
|
"clean": "shx mkdir -p lib && shx rm -rf lib",
|
|
@@ -81,8 +81,9 @@ export const createAppCommand = async ({
|
|
|
81
81
|
{ dryRun }
|
|
82
82
|
);
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
if (!dryRun) {
|
|
85
|
+
saveToConfig({ app: { address: appAddress } });
|
|
86
|
+
}
|
|
86
87
|
|
|
87
88
|
return { appAddress };
|
|
88
89
|
};
|
package/src/index.ts
CHANGED
|
@@ -7,7 +7,9 @@ import {
|
|
|
7
7
|
publishSupportCommand,
|
|
8
8
|
publishUpdateCommand
|
|
9
9
|
} from "./commands/publish/index.js";
|
|
10
|
-
import { getConfigFile, parseKeypair,
|
|
10
|
+
import { checkForSelfUpdate, checkSubmissionNetwork, generateNetworkSuffix, getConfigFile, parseKeypair, showMessage } from "./utils.js";
|
|
11
|
+
import terminalLink from "terminal-link";
|
|
12
|
+
import boxen from "boxen";
|
|
11
13
|
|
|
12
14
|
import * as dotenv from "dotenv";
|
|
13
15
|
|
|
@@ -34,10 +36,20 @@ function resolveBuildToolsPath(buildToolsPath: string | undefined) {
|
|
|
34
36
|
return;
|
|
35
37
|
}
|
|
36
38
|
|
|
39
|
+
async function tryWithErrorMessage(block: () => Promise<any>) {
|
|
40
|
+
try {
|
|
41
|
+
await block()
|
|
42
|
+
} catch (e) {
|
|
43
|
+
const errorMsg = (e as Error | null)?.message ?? "";
|
|
44
|
+
|
|
45
|
+
showMessage("Error", errorMsg, true);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
37
49
|
async function main() {
|
|
38
50
|
program
|
|
39
51
|
.name("dapp-store")
|
|
40
|
-
.version("0.1.
|
|
52
|
+
.version("0.1.9")
|
|
41
53
|
.description("CLI to assist with publishing to the Saga Dapp Store");
|
|
42
54
|
|
|
43
55
|
const createCommand = program
|
|
@@ -54,11 +66,19 @@ async function main() {
|
|
|
54
66
|
.option("-u, --url <url>", "RPC URL", "https://devnet.genesysgo.net")
|
|
55
67
|
.option("-d, --dry-run", "Flag for dry run. Doesn't mint an NFT")
|
|
56
68
|
.action(async ({ keypair, url, dryRun }) => {
|
|
57
|
-
|
|
69
|
+
tryWithErrorMessage(async () => {
|
|
70
|
+
await checkForSelfUpdate();
|
|
58
71
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
72
|
+
const signer = parseKeypair(keypair);
|
|
73
|
+
if (signer) {
|
|
74
|
+
const result: { publisherAddress: string } = await createPublisherCommand({ signer, url, dryRun });
|
|
75
|
+
|
|
76
|
+
const displayUrl = `https://solscan.io/token/${result.publisherAddress}${generateNetworkSuffix(url)}`;
|
|
77
|
+
const resultText = `Publisher NFT successfully minted:\n${displayUrl}`;
|
|
78
|
+
|
|
79
|
+
showMessage("Success", resultText);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
62
82
|
});
|
|
63
83
|
|
|
64
84
|
createCommand
|
|
@@ -75,29 +95,30 @@ async function main() {
|
|
|
75
95
|
.option("-u, --url <url>", "RPC URL", "https://devnet.genesysgo.net")
|
|
76
96
|
.option("-d, --dry-run", "Flag for dry run. Doesn't mint an NFT")
|
|
77
97
|
.action(async ({ publisherMintAddress, keypair, url, dryRun }) => {
|
|
78
|
-
|
|
98
|
+
tryWithErrorMessage(async () => {
|
|
99
|
+
await checkForSelfUpdate();
|
|
100
|
+
|
|
79
101
|
const config = await getConfigFile();
|
|
80
102
|
|
|
81
103
|
if (!hasAddressInConfig(config.publisher) && !publisherMintAddress) {
|
|
82
|
-
|
|
83
|
-
"Either specify an publisher mint address in the config file, or specify as a CLI argument to this command."
|
|
84
|
-
);
|
|
85
|
-
createCommand.showHelpAfterError();
|
|
86
|
-
return;
|
|
104
|
+
throw new Error("Either specify a publisher mint address in the config file or specify as a CLI argument to this command.")
|
|
87
105
|
}
|
|
88
106
|
|
|
89
107
|
const signer = parseKeypair(keypair);
|
|
90
108
|
if (signer) {
|
|
91
|
-
await createAppCommand({
|
|
109
|
+
const result = await createAppCommand({
|
|
92
110
|
publisherMintAddress: publisherMintAddress,
|
|
93
111
|
signer,
|
|
94
112
|
url,
|
|
95
113
|
dryRun,
|
|
96
114
|
});
|
|
115
|
+
|
|
116
|
+
const displayUrl = `https://solscan.io/token/${result.appAddress}${generateNetworkSuffix(url)}`;
|
|
117
|
+
const resultText = `App NFT successfully minted:\n${displayUrl}`;
|
|
118
|
+
|
|
119
|
+
showMessage("Success", resultText);
|
|
97
120
|
}
|
|
98
|
-
}
|
|
99
|
-
showUserErrorMessage((e as Error | null)?.message ?? "");
|
|
100
|
-
}
|
|
121
|
+
});
|
|
101
122
|
});
|
|
102
123
|
|
|
103
124
|
createCommand
|
|
@@ -118,28 +139,20 @@ async function main() {
|
|
|
118
139
|
"Path to Android build tools which contains AAPT2"
|
|
119
140
|
)
|
|
120
141
|
.action(async ({ appMintAddress, keypair, url, dryRun, buildToolsPath }) => {
|
|
121
|
-
|
|
142
|
+
tryWithErrorMessage(async () => {
|
|
143
|
+
await checkForSelfUpdate();
|
|
144
|
+
|
|
122
145
|
const resolvedBuildToolsPath = resolveBuildToolsPath(buildToolsPath);
|
|
123
146
|
if (resolvedBuildToolsPath === undefined) {
|
|
124
|
-
|
|
125
|
-
"Please specify an Android build tools directory in the .env file or via the command line argument."
|
|
126
|
-
);
|
|
127
|
-
createCommand.showHelpAfterError();
|
|
128
|
-
return;
|
|
147
|
+
throw new Error("Please specify an Android build tools directory in the .env file or via the command line argument.")
|
|
129
148
|
}
|
|
130
149
|
|
|
131
150
|
const config = await getConfigFile();
|
|
132
|
-
|
|
133
151
|
if (!hasAddressInConfig(config.app) && !appMintAddress) {
|
|
134
|
-
|
|
135
|
-
"\n\n::: Either specify an app mint address in the config file, or specify as a CLI argument to this command. :::\n\n"
|
|
136
|
-
);
|
|
137
|
-
createCommand.showHelpAfterError();
|
|
138
|
-
return;
|
|
152
|
+
throw new Error("Either specify an app mint address in the config file or specify as a CLI argument to this command")
|
|
139
153
|
}
|
|
140
154
|
|
|
141
155
|
const signer = parseKeypair(keypair);
|
|
142
|
-
|
|
143
156
|
if (signer) {
|
|
144
157
|
const result = await createReleaseCommand({
|
|
145
158
|
appMintAddress: appMintAddress,
|
|
@@ -148,10 +161,13 @@ async function main() {
|
|
|
148
161
|
url,
|
|
149
162
|
dryRun,
|
|
150
163
|
});
|
|
164
|
+
|
|
165
|
+
const displayUrl = `https://solscan.io/token/${result?.releaseAddress}${generateNetworkSuffix(url)}`;
|
|
166
|
+
const resultText = `Release NFT successfully minted:\n${displayUrl}`;
|
|
167
|
+
|
|
168
|
+
showMessage("Success", resultText);
|
|
151
169
|
}
|
|
152
|
-
}
|
|
153
|
-
showUserErrorMessage((e as Error | null)?.message ?? "");
|
|
154
|
-
}
|
|
170
|
+
});
|
|
155
171
|
}
|
|
156
172
|
);
|
|
157
173
|
|
|
@@ -167,27 +183,24 @@ async function main() {
|
|
|
167
183
|
"Path to Android build tools which contains AAPT2"
|
|
168
184
|
)
|
|
169
185
|
.action(async ({ keypair, buildToolsPath }) => {
|
|
170
|
-
|
|
186
|
+
tryWithErrorMessage(async () => {
|
|
187
|
+
await checkForSelfUpdate();
|
|
188
|
+
|
|
171
189
|
const resolvedBuildToolsPath = resolveBuildToolsPath(buildToolsPath);
|
|
172
190
|
if (resolvedBuildToolsPath === undefined) {
|
|
173
|
-
|
|
174
|
-
"Please specify an Android build tools directory in the .env file or via the command line argument."
|
|
175
|
-
);
|
|
176
|
-
createCommand.showHelpAfterError();
|
|
177
|
-
return;
|
|
191
|
+
throw new Error("Please specify an Android build tools directory in the .env file or via the command line argument.")
|
|
178
192
|
}
|
|
179
193
|
|
|
180
194
|
const signer = parseKeypair(keypair);
|
|
181
|
-
|
|
182
195
|
if (signer) {
|
|
183
196
|
await validateCommand({
|
|
184
197
|
signer,
|
|
185
198
|
buildToolsPath: resolvedBuildToolsPath,
|
|
186
199
|
});
|
|
200
|
+
|
|
201
|
+
//TODO: Add pretty formatting here, but will require more work than other sections
|
|
187
202
|
}
|
|
188
|
-
}
|
|
189
|
-
showUserErrorMessage((e as Error | null)?.message ?? "");
|
|
190
|
-
}
|
|
203
|
+
});
|
|
191
204
|
});
|
|
192
205
|
|
|
193
206
|
const publishCommand = program
|
|
@@ -234,15 +247,14 @@ async function main() {
|
|
|
234
247
|
requestorIsAuthorized,
|
|
235
248
|
dryRun,
|
|
236
249
|
}) => {
|
|
237
|
-
|
|
250
|
+
tryWithErrorMessage(async () => {
|
|
251
|
+
await checkForSelfUpdate();
|
|
252
|
+
await checkSubmissionNetwork(url);
|
|
253
|
+
|
|
238
254
|
const config = await getConfigFile();
|
|
239
255
|
|
|
240
256
|
if (!hasAddressInConfig(config.release) && !releaseMintAddress) {
|
|
241
|
-
|
|
242
|
-
"\n\n::: Either specify an release mint address in the config file, or specify as a CLI argument to this command. :::\n\n"
|
|
243
|
-
);
|
|
244
|
-
publishCommand.showHelpAfterError();
|
|
245
|
-
return;
|
|
257
|
+
throw new Error("Either specify a release mint address in the config file or specify as a CLI argument to this command.")
|
|
246
258
|
}
|
|
247
259
|
|
|
248
260
|
const signer = parseKeypair(keypair);
|
|
@@ -256,10 +268,11 @@ async function main() {
|
|
|
256
268
|
compliesWithSolanaDappStorePolicies,
|
|
257
269
|
requestorIsAuthorized,
|
|
258
270
|
});
|
|
271
|
+
|
|
272
|
+
const resultText = "Successfully submitted to the Solana Mobile dApp publisher portal";
|
|
273
|
+
showMessage("Success", resultText);
|
|
259
274
|
}
|
|
260
|
-
}
|
|
261
|
-
showUserErrorMessage((e as Error | null)?.message ?? "");
|
|
262
|
-
}
|
|
275
|
+
});
|
|
263
276
|
}
|
|
264
277
|
);
|
|
265
278
|
|
|
@@ -305,19 +318,17 @@ async function main() {
|
|
|
305
318
|
critical,
|
|
306
319
|
dryRun,
|
|
307
320
|
}) => {
|
|
308
|
-
|
|
321
|
+
tryWithErrorMessage(async () => {
|
|
322
|
+
await checkForSelfUpdate();
|
|
323
|
+
await checkSubmissionNetwork(url);
|
|
324
|
+
|
|
309
325
|
const config = await getConfigFile();
|
|
310
326
|
|
|
311
327
|
if (!hasAddressInConfig(config.release) && !releaseMintAddress) {
|
|
312
|
-
|
|
313
|
-
"\n\n::: Either specify an release mint address in the config file, or specify as a CLI argument to this command. :::\n\n"
|
|
314
|
-
);
|
|
315
|
-
publishCommand.showHelpAfterError();
|
|
316
|
-
return;
|
|
328
|
+
throw new Error("Either specify a release mint address in the config file or specify as a CLI argument to this command.")
|
|
317
329
|
}
|
|
318
330
|
|
|
319
331
|
const signer = parseKeypair(keypair);
|
|
320
|
-
|
|
321
332
|
if (signer) {
|
|
322
333
|
await publishUpdateCommand({
|
|
323
334
|
appMintAddress,
|
|
@@ -329,10 +340,11 @@ async function main() {
|
|
|
329
340
|
requestorIsAuthorized,
|
|
330
341
|
critical,
|
|
331
342
|
});
|
|
343
|
+
|
|
344
|
+
const resultText = "dApp successfully updated on the publisher portal";
|
|
345
|
+
showMessage("Success", resultText);
|
|
332
346
|
}
|
|
333
|
-
}
|
|
334
|
-
showUserErrorMessage((e as Error | null)?.message ?? "");
|
|
335
|
-
}
|
|
347
|
+
});
|
|
336
348
|
}
|
|
337
349
|
);
|
|
338
350
|
|
|
@@ -373,19 +385,17 @@ async function main() {
|
|
|
373
385
|
critical,
|
|
374
386
|
dryRun,
|
|
375
387
|
}) => {
|
|
376
|
-
|
|
388
|
+
tryWithErrorMessage(async () => {
|
|
389
|
+
await checkForSelfUpdate();
|
|
390
|
+
await checkSubmissionNetwork(url);
|
|
391
|
+
|
|
377
392
|
const config = await getConfigFile();
|
|
378
393
|
|
|
379
394
|
if (!hasAddressInConfig(config.release) && !releaseMintAddress) {
|
|
380
|
-
|
|
381
|
-
"\n\n::: Either specify an release mint address in the config file, or specify as a CLI argument to this command. :::\n\n"
|
|
382
|
-
);
|
|
383
|
-
publishCommand.showHelpAfterError();
|
|
384
|
-
return;
|
|
395
|
+
throw new Error("Either specify a release mint address in the config file or specify as a CLI argument to this command.")
|
|
385
396
|
}
|
|
386
397
|
|
|
387
398
|
const signer = parseKeypair(keypair);
|
|
388
|
-
|
|
389
399
|
if (signer) {
|
|
390
400
|
await publishRemoveCommand({
|
|
391
401
|
appMintAddress,
|
|
@@ -396,10 +406,11 @@ async function main() {
|
|
|
396
406
|
requestorIsAuthorized,
|
|
397
407
|
critical,
|
|
398
408
|
});
|
|
409
|
+
|
|
410
|
+
const resultText = "dApp successfully removed from the publisher portal";
|
|
411
|
+
showMessage("Success", resultText);
|
|
399
412
|
}
|
|
400
|
-
}
|
|
401
|
-
showUserErrorMessage((e as Error | null)?.message ?? "");
|
|
402
|
-
}
|
|
413
|
+
})
|
|
403
414
|
}
|
|
404
415
|
);
|
|
405
416
|
|
|
@@ -434,19 +445,17 @@ async function main() {
|
|
|
434
445
|
requestDetails,
|
|
435
446
|
{ appMintAddress, releaseMintAddress, keypair, url, requestorIsAuthorized, dryRun }
|
|
436
447
|
) => {
|
|
437
|
-
|
|
448
|
+
tryWithErrorMessage(async () => {
|
|
449
|
+
await checkForSelfUpdate();
|
|
450
|
+
await checkSubmissionNetwork(url);
|
|
451
|
+
|
|
438
452
|
const config = await getConfigFile();
|
|
439
453
|
|
|
440
454
|
if (!hasAddressInConfig(config.release) && !releaseMintAddress) {
|
|
441
|
-
|
|
442
|
-
"\n\n::: Either specify an release mint address in the config file, or specify as a CLI argument to this command. :::\n\n"
|
|
443
|
-
);
|
|
444
|
-
publishCommand.showHelpAfterError();
|
|
445
|
-
return;
|
|
455
|
+
throw new Error("Either specify a release mint address in the config file or specify as a CLI argument to this command.")
|
|
446
456
|
}
|
|
447
457
|
|
|
448
458
|
const signer = parseKeypair(keypair);
|
|
449
|
-
|
|
450
459
|
if (signer) {
|
|
451
460
|
await publishSupportCommand({
|
|
452
461
|
appMintAddress,
|
|
@@ -457,10 +466,11 @@ async function main() {
|
|
|
457
466
|
requestorIsAuthorized,
|
|
458
467
|
requestDetails,
|
|
459
468
|
});
|
|
469
|
+
|
|
470
|
+
const resultText = "Support request sent successfully";
|
|
471
|
+
showMessage("Success", resultText);
|
|
460
472
|
}
|
|
461
|
-
}
|
|
462
|
-
showUserErrorMessage((e as Error | null)?.message ?? "");
|
|
463
|
-
}
|
|
473
|
+
});
|
|
464
474
|
}
|
|
465
475
|
);
|
|
466
476
|
|
package/src/utils.ts
CHANGED
|
@@ -11,6 +11,9 @@ import { exec } from "child_process";
|
|
|
11
11
|
import * as path from "path";
|
|
12
12
|
import { BundlrStorageDriver, keypairIdentity, Metaplex, toMetaplexFile } from "@metaplex-foundation/js";
|
|
13
13
|
import { imageSize } from "image-size";
|
|
14
|
+
import updateNotifier from "update-notifier";
|
|
15
|
+
import cliPackage from "./package.json" assert { type: "json" };
|
|
16
|
+
import boxen from "boxen";
|
|
14
17
|
|
|
15
18
|
import { CachedStorageDriver } from "./upload/CachedStorageDriver.js";
|
|
16
19
|
|
|
@@ -19,6 +22,15 @@ const runExec = util.promisify(exec);
|
|
|
19
22
|
|
|
20
23
|
export const debug = debugModule("CLI");
|
|
21
24
|
|
|
25
|
+
export const checkForSelfUpdate = async () => {
|
|
26
|
+
const notifier = updateNotifier({ pkg: cliPackage });
|
|
27
|
+
const updateInfo = await notifier.fetchInfo();
|
|
28
|
+
|
|
29
|
+
if (updateInfo.current != updateInfo.latest) {
|
|
30
|
+
throw new Error("Please update to the latest version of the dApp Store CLI before proceeding.");
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
22
34
|
export const parseKeypair = (pathToKeypairFile: string) => {
|
|
23
35
|
try {
|
|
24
36
|
const keypairFile = fs.readFileSync(pathToKeypairFile, "utf-8");
|
|
@@ -48,8 +60,6 @@ export const getConfigFile = async (
|
|
|
48
60
|
|
|
49
61
|
const config = await getConfig(configFilePath);
|
|
50
62
|
|
|
51
|
-
console.info(`Pulling details from ${configFilePath}`);
|
|
52
|
-
|
|
53
63
|
if (buildToolsDir && fs.lstatSync(buildToolsDir).isDirectory()) {
|
|
54
64
|
// We validate that the config is going to have at least one installable asset
|
|
55
65
|
const apkEntry = config.release.files.find(
|
|
@@ -122,10 +132,48 @@ const checkImageExtension = (uri: string): boolean => {
|
|
|
122
132
|
);
|
|
123
133
|
};
|
|
124
134
|
|
|
125
|
-
export const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
135
|
+
export const isDevnet = (rpcUrl: string): boolean => {
|
|
136
|
+
return rpcUrl.indexOf("devnet") != -1;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export const isTestnet = (rpcUrl: string): boolean => {
|
|
140
|
+
return rpcUrl.indexOf("testnet") != -1;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export const checkSubmissionNetwork = (rpcUrl: string) => {
|
|
144
|
+
if (isDevnet(rpcUrl) || isTestnet(rpcUrl)) {
|
|
145
|
+
throw new Error("It looks like you are attempting to submit a request with a devnet or testnet RPC endpoint. Please ensure that your NFTs are minted on mainnet beta, and re-run with a mainnet beta RPC endpoint.");
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export const generateNetworkSuffix = (rpcUrl: string): string => {
|
|
150
|
+
let suffix = "";
|
|
151
|
+
|
|
152
|
+
if (isDevnet(rpcUrl)) {
|
|
153
|
+
suffix = "?cluster=devnet";
|
|
154
|
+
} else if (isTestnet(rpcUrl)) {
|
|
155
|
+
suffix = "?cluster=testnet";
|
|
156
|
+
} else {
|
|
157
|
+
suffix = "?cluster=mainnet";
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return suffix;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export const showMessage = (
|
|
164
|
+
titleMessage = "",
|
|
165
|
+
contentMessage = "",
|
|
166
|
+
isError = false
|
|
167
|
+
) => {
|
|
168
|
+
console.log(boxen(contentMessage, {
|
|
169
|
+
title: titleMessage,
|
|
170
|
+
padding: 1,
|
|
171
|
+
margin: 1,
|
|
172
|
+
borderStyle: 'single',
|
|
173
|
+
borderColor: isError ? "redBright" : "cyan",
|
|
174
|
+
textAlignment: "left",
|
|
175
|
+
titleAlignment: "center"
|
|
176
|
+
}));
|
|
129
177
|
};
|
|
130
178
|
|
|
131
179
|
const checkIconDimensions = async (iconPath: string): Promise<boolean> => {
|
|
@@ -167,7 +215,7 @@ const getAndroidDetails = async (
|
|
|
167
215
|
let localeArray = Array.from(locales?.values() ?? []);
|
|
168
216
|
if (localeArray.length == 2) {
|
|
169
217
|
const localesSrc = localeArray[1];
|
|
170
|
-
localeArray = localesSrc.split("' '").slice(1);
|
|
218
|
+
localeArray = ["en-US"].concat(localesSrc.split("' '").slice(1));
|
|
171
219
|
}
|
|
172
220
|
|
|
173
221
|
return {
|