@solana-mobile/dapp-store-cli 0.6.1 → 0.7.2
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/CliSetup.js +9 -1
- package/lib/CliUtils.js +1 -1
- package/lib/commands/create/CreateCliRelease.js +44 -4
- package/lib/commands/publish/PublishCliSubmit.js +2 -1
- package/lib/commands/publish/PublishCliUpdate.js +2 -1
- package/lib/config/PublishDetails.js +22 -2
- package/lib/package.json +2 -2
- package/package.json +2 -2
- package/src/CliSetup.ts +9 -1
- package/src/CliUtils.ts +1 -1
- package/src/commands/create/CreateCliRelease.ts +29 -16
- package/src/commands/publish/PublishCliSubmit.ts +7 -1
- package/src/commands/publish/PublishCliUpdate.ts +8 -1
- package/src/config/PublishDetails.ts +13 -1
package/lib/CliSetup.js
CHANGED
|
@@ -151,7 +151,7 @@ function resolveBuildToolsPath(buildToolsPath) {
|
|
|
151
151
|
/**
|
|
152
152
|
* This method should be updated with each new release of the CLI, and just do nothing when there isn't anything to report
|
|
153
153
|
*/ function latestReleaseMessage() {
|
|
154
|
-
showMessage("Publishing Tools Version ".concat(Constants.CLI_VERSION), "- short_description value reduced to 30 character limit", "warning");
|
|
154
|
+
showMessage("Publishing Tools Version ".concat(Constants.CLI_VERSION), "- priority fee has been updated to handle network congestion\n- short_description value reduced to 30 character limit", "warning");
|
|
155
155
|
}
|
|
156
156
|
function tryWithErrorMessage(block) {
|
|
157
157
|
return _tryWithErrorMessage.apply(this, arguments);
|
|
@@ -265,6 +265,7 @@ export var createPublisherCliCmd = createCliCmd.command("publisher").description
|
|
|
265
265
|
showMessage("Success", resultText);
|
|
266
266
|
_state.label = 3;
|
|
267
267
|
case 3:
|
|
268
|
+
process.exit();
|
|
268
269
|
return [
|
|
269
270
|
2
|
|
270
271
|
];
|
|
@@ -336,6 +337,7 @@ export var createAppCliCmd = createCliCmd.command("app").description("Create a a
|
|
|
336
337
|
showMessage("Success", resultText);
|
|
337
338
|
_state.label = 4;
|
|
338
339
|
case 4:
|
|
340
|
+
process.exit();
|
|
339
341
|
return [
|
|
340
342
|
2
|
|
341
343
|
];
|
|
@@ -412,6 +414,7 @@ export var createReleaseCliCmd = createCliCmd.command("release").description("Cr
|
|
|
412
414
|
showMessage("Success", resultText);
|
|
413
415
|
_state.label = 4;
|
|
414
416
|
case 4:
|
|
417
|
+
process.exit();
|
|
415
418
|
return [
|
|
416
419
|
2
|
|
417
420
|
];
|
|
@@ -472,6 +475,7 @@ mainCli.command("validate").description("Validates details prior to publishing")
|
|
|
472
475
|
_state.sent();
|
|
473
476
|
_state.label = 3;
|
|
474
477
|
case 3:
|
|
478
|
+
process.exit();
|
|
475
479
|
return [
|
|
476
480
|
2
|
|
477
481
|
];
|
|
@@ -550,6 +554,7 @@ publishCommand.command("submit").description("Submit a new app to the Solana Mob
|
|
|
550
554
|
showMessage("Success", resultText);
|
|
551
555
|
_state.label = 5;
|
|
552
556
|
case 5:
|
|
557
|
+
process.exit();
|
|
553
558
|
return [
|
|
554
559
|
2
|
|
555
560
|
];
|
|
@@ -637,6 +642,7 @@ publishCommand.command("update").description("Update an existing app on the Sola
|
|
|
637
642
|
];
|
|
638
643
|
case 1:
|
|
639
644
|
_state.sent();
|
|
645
|
+
process.exit();
|
|
640
646
|
return [
|
|
641
647
|
2
|
|
642
648
|
];
|
|
@@ -705,6 +711,7 @@ publishCommand.command("remove").description("Remove an existing app from the So
|
|
|
705
711
|
showMessage("Success", resultText);
|
|
706
712
|
_state.label = 5;
|
|
707
713
|
case 5:
|
|
714
|
+
process.exit();
|
|
708
715
|
return [
|
|
709
716
|
2
|
|
710
717
|
];
|
|
@@ -782,6 +789,7 @@ publishCommand.command("support <request_details>").description("Submit a suppor
|
|
|
782
789
|
showMessage("Success", resultText);
|
|
783
790
|
_state.label = 5;
|
|
784
791
|
case 5:
|
|
792
|
+
process.exit();
|
|
785
793
|
return [
|
|
786
794
|
2
|
|
787
795
|
];
|
package/lib/CliUtils.js
CHANGED
|
@@ -159,7 +159,7 @@ export var Constants = function Constants() {
|
|
|
159
159
|
"use strict";
|
|
160
160
|
_class_call_check(this, Constants);
|
|
161
161
|
};
|
|
162
|
-
_define_property(Constants, "CLI_VERSION", "0.
|
|
162
|
+
_define_property(Constants, "CLI_VERSION", "0.7.1");
|
|
163
163
|
_define_property(Constants, "CONFIG_FILE_NAME", "config.yaml");
|
|
164
164
|
_define_property(Constants, "DEFAULT_RPC_DEVNET", "https://api.devnet.solana.com");
|
|
165
165
|
_define_property(Constants, "getConfigFilePath", function() {
|
|
@@ -152,11 +152,11 @@ function _ts_generator(thisArg, body) {
|
|
|
152
152
|
}
|
|
153
153
|
import { createRelease } from "@solana-mobile/dapp-store-publishing-tools";
|
|
154
154
|
import { Connection, Keypair, PublicKey, sendAndConfirmTransaction } from "@solana/web3.js";
|
|
155
|
-
import { getMetaplexInstance } from "../../CliUtils.js";
|
|
155
|
+
import { getMetaplexInstance, showMessage } from "../../CliUtils.js";
|
|
156
156
|
import { loadPublishDetailsWithChecks, writeToPublishDetails } from "../../config/PublishDetails.js";
|
|
157
157
|
var createReleaseNft = function() {
|
|
158
158
|
var _ref = _async_to_generator(function(param) {
|
|
159
|
-
var appMintAddress, releaseDetails, appDetails, publisherDetails, connection, publisher, storageParams, releaseMintAddress, metaplex, txBuilder, blockhash, tx, txSig;
|
|
159
|
+
var appMintAddress, releaseDetails, appDetails, publisherDetails, connection, publisher, storageParams, releaseMintAddress, metaplex, txBuilder, maxTries, i, blockhash, tx, txSig, e, _e_message, errorMsg, retryMsg;
|
|
160
160
|
return _ts_generator(this, function(_state) {
|
|
161
161
|
switch(_state.label){
|
|
162
162
|
case 0:
|
|
@@ -178,11 +178,27 @@ var createReleaseNft = function() {
|
|
|
178
178
|
];
|
|
179
179
|
case 1:
|
|
180
180
|
txBuilder = _state.sent().txBuilder;
|
|
181
|
+
maxTries = 4;
|
|
182
|
+
i = 1;
|
|
183
|
+
_state.label = 2;
|
|
184
|
+
case 2:
|
|
185
|
+
if (!(i <= maxTries)) return [
|
|
186
|
+
3,
|
|
187
|
+
8
|
|
188
|
+
];
|
|
189
|
+
_state.label = 3;
|
|
190
|
+
case 3:
|
|
191
|
+
_state.trys.push([
|
|
192
|
+
3,
|
|
193
|
+
6,
|
|
194
|
+
,
|
|
195
|
+
7
|
|
196
|
+
]);
|
|
181
197
|
return [
|
|
182
198
|
4,
|
|
183
199
|
connection.getLatestBlockhashAndContext()
|
|
184
200
|
];
|
|
185
|
-
case
|
|
201
|
+
case 4:
|
|
186
202
|
blockhash = _state.sent();
|
|
187
203
|
tx = txBuilder.toTransaction(blockhash.value);
|
|
188
204
|
tx.sign(releaseMintAddress, publisher);
|
|
@@ -195,7 +211,7 @@ var createReleaseNft = function() {
|
|
|
195
211
|
minContextSlot: blockhash.context.slot
|
|
196
212
|
})
|
|
197
213
|
];
|
|
198
|
-
case
|
|
214
|
+
case 5:
|
|
199
215
|
txSig = _state.sent();
|
|
200
216
|
console.info({
|
|
201
217
|
txSig: txSig,
|
|
@@ -207,6 +223,30 @@ var createReleaseNft = function() {
|
|
|
207
223
|
releaseAddress: releaseMintAddress.publicKey.toBase58()
|
|
208
224
|
}
|
|
209
225
|
];
|
|
226
|
+
case 6:
|
|
227
|
+
e = _state.sent();
|
|
228
|
+
errorMsg = (_e_message = e === null || e === void 0 ? void 0 : e.message) !== null && _e_message !== void 0 ? _e_message : "";
|
|
229
|
+
if (i == maxTries) {
|
|
230
|
+
showMessage("Transaction Failure", errorMsg, "error");
|
|
231
|
+
process.exit(-1);
|
|
232
|
+
} else {
|
|
233
|
+
retryMsg = errorMsg + "\nWill Retry minting release";
|
|
234
|
+
showMessage("Transaction Failure", retryMsg, "standard");
|
|
235
|
+
}
|
|
236
|
+
return [
|
|
237
|
+
3,
|
|
238
|
+
7
|
|
239
|
+
];
|
|
240
|
+
case 7:
|
|
241
|
+
i++;
|
|
242
|
+
return [
|
|
243
|
+
3,
|
|
244
|
+
2
|
|
245
|
+
];
|
|
246
|
+
case 8:
|
|
247
|
+
return [
|
|
248
|
+
2
|
|
249
|
+
];
|
|
210
250
|
}
|
|
211
251
|
});
|
|
212
252
|
});
|
|
@@ -125,7 +125,7 @@ function _ts_generator(thisArg, body) {
|
|
|
125
125
|
import { Connection } from "@solana/web3.js";
|
|
126
126
|
import { publishSubmit } from "@solana-mobile/dapp-store-publishing-tools";
|
|
127
127
|
import nacl from "tweetnacl";
|
|
128
|
-
import { checkMintedStatus } from "../../CliUtils.js";
|
|
128
|
+
import { checkMintedStatus, showMessage } from "../../CliUtils.js";
|
|
129
129
|
import { loadPublishDetailsWithChecks } from "../../config/PublishDetails.js";
|
|
130
130
|
export var publishSubmitCommand = function() {
|
|
131
131
|
var _ref = _async_to_generator(function(param) {
|
|
@@ -134,6 +134,7 @@ export var publishSubmitCommand = function() {
|
|
|
134
134
|
switch(_state.label){
|
|
135
135
|
case 0:
|
|
136
136
|
appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, signer = param.signer, url = param.url, _param_dryRun = param.dryRun, dryRun = _param_dryRun === void 0 ? false : _param_dryRun, _param_compliesWithSolanaDappStorePolicies = param.compliesWithSolanaDappStorePolicies, compliesWithSolanaDappStorePolicies = _param_compliesWithSolanaDappStorePolicies === void 0 ? false : _param_compliesWithSolanaDappStorePolicies, _param_requestorIsAuthorized = param.requestorIsAuthorized, requestorIsAuthorized = _param_requestorIsAuthorized === void 0 ? false : _param_requestorIsAuthorized;
|
|
137
|
+
showMessage("Publishing Estimates", "New app submissions take around 3-4 business days for review.", "warning");
|
|
137
138
|
if (!compliesWithSolanaDappStorePolicies) {
|
|
138
139
|
console.error("ERROR: Cannot submit a request for which the requestor does not attest that it complies with Solana dApp Store policies");
|
|
139
140
|
return [
|
|
@@ -124,7 +124,7 @@ function _ts_generator(thisArg, body) {
|
|
|
124
124
|
}
|
|
125
125
|
import { Connection } from "@solana/web3.js";
|
|
126
126
|
import { publishUpdate } from "@solana-mobile/dapp-store-publishing-tools";
|
|
127
|
-
import { checkMintedStatus } from "../../CliUtils.js";
|
|
127
|
+
import { checkMintedStatus, showMessage } from "../../CliUtils.js";
|
|
128
128
|
import nacl from "tweetnacl";
|
|
129
129
|
import { loadPublishDetailsWithChecks } from "../../config/PublishDetails.js";
|
|
130
130
|
export var publishUpdateCommand = function() {
|
|
@@ -134,6 +134,7 @@ export var publishUpdateCommand = function() {
|
|
|
134
134
|
switch(_state.label){
|
|
135
135
|
case 0:
|
|
136
136
|
appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, signer = param.signer, url = param.url, _param_dryRun = param.dryRun, dryRun = _param_dryRun === void 0 ? false : _param_dryRun, _param_compliesWithSolanaDappStorePolicies = param.compliesWithSolanaDappStorePolicies, compliesWithSolanaDappStorePolicies = _param_compliesWithSolanaDappStorePolicies === void 0 ? false : _param_compliesWithSolanaDappStorePolicies, _param_requestorIsAuthorized = param.requestorIsAuthorized, requestorIsAuthorized = _param_requestorIsAuthorized === void 0 ? false : _param_requestorIsAuthorized, _param_critical = param.critical, critical = _param_critical === void 0 ? false : _param_critical;
|
|
137
|
+
showMessage("Publishing Estimates", "App update approvals take around 1-2 business days for review.", "warning");
|
|
137
138
|
if (!compliesWithSolanaDappStorePolicies) {
|
|
138
139
|
console.error("ERROR: Cannot submit a request for which the requestor does not attest that it complies with Solana dApp Store policies");
|
|
139
140
|
return [
|
|
@@ -48,6 +48,13 @@ function _define_property(obj, key, value) {
|
|
|
48
48
|
}
|
|
49
49
|
return obj;
|
|
50
50
|
}
|
|
51
|
+
function _instanceof(left, right) {
|
|
52
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
53
|
+
return !!right[Symbol.hasInstance](left);
|
|
54
|
+
} else {
|
|
55
|
+
return left instanceof right;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
51
58
|
function _iterable_to_array(iter) {
|
|
52
59
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
53
60
|
}
|
|
@@ -221,6 +228,7 @@ var AaptPrefixes = {
|
|
|
221
228
|
verCodePrefix: "versionCode=",
|
|
222
229
|
verNamePrefix: "versionName=",
|
|
223
230
|
sdkPrefix: "sdkVersion:",
|
|
231
|
+
debuggableApkPrefix: "application-debuggable",
|
|
224
232
|
localePrefix: "locales: "
|
|
225
233
|
};
|
|
226
234
|
var ajv = new Ajv({
|
|
@@ -456,7 +464,7 @@ var checkIconDimensions = function() {
|
|
|
456
464
|
}();
|
|
457
465
|
var getAndroidDetails = function() {
|
|
458
466
|
var _ref = _async_to_generator(function(aaptDir, apkPath) {
|
|
459
|
-
var stdout, appPackage, versionCode, versionName, minSdk, permissions, locales, _locales_values, localeArray, localesSrc, _appPackage_, _minSdk_, _versionCode_, _versionName_, _tmp, e;
|
|
467
|
+
var stdout, appPackage, versionCode, versionName, minSdk, permissions, locales, isDebuggable, _locales_values, localeArray, localesSrc, _appPackage_, _minSdk_, _versionCode_, _versionName_, _tmp, e;
|
|
460
468
|
return _ts_generator(this, function(_state) {
|
|
461
469
|
switch(_state.label){
|
|
462
470
|
case 0:
|
|
@@ -478,6 +486,10 @@ var getAndroidDetails = function() {
|
|
|
478
486
|
minSdk = new RegExp(AaptPrefixes.sdkPrefix + AaptPrefixes.quoteRegex).exec(stdout);
|
|
479
487
|
permissions = _to_consumable_array(stdout.matchAll(/uses-permission: name='(.*)'/g));
|
|
480
488
|
locales = new RegExp(AaptPrefixes.localePrefix + AaptPrefixes.quoteNonLazyRegex).exec(stdout);
|
|
489
|
+
isDebuggable = new RegExp(AaptPrefixes.debuggableApkPrefix).exec(stdout);
|
|
490
|
+
if (isDebuggable != null) {
|
|
491
|
+
throw new TypeError("Debug apks are not supported on Solana dApp store.\nSubmit a signed release apk");
|
|
492
|
+
}
|
|
481
493
|
localeArray = Array.from((_locales_values = locales === null || locales === void 0 ? void 0 : locales.values()) !== null && _locales_values !== void 0 ? _locales_values : []);
|
|
482
494
|
if (localeArray.length == 2) {
|
|
483
495
|
localesSrc = localeArray[1];
|
|
@@ -507,7 +519,15 @@ var getAndroidDetails = function() {
|
|
|
507
519
|
];
|
|
508
520
|
case 3:
|
|
509
521
|
e = _state.sent();
|
|
510
|
-
|
|
522
|
+
if (_instanceof(e, TypeError)) {
|
|
523
|
+
throw e;
|
|
524
|
+
} else {
|
|
525
|
+
throw new Error("There was an error parsing your APK. Please ensure you have installed Java and provided a valid Android tools directory containing AAPT2.\n" + e);
|
|
526
|
+
}
|
|
527
|
+
return [
|
|
528
|
+
3,
|
|
529
|
+
4
|
|
530
|
+
];
|
|
511
531
|
case 4:
|
|
512
532
|
return [
|
|
513
533
|
2
|
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana-mobile/dapp-store-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
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.18.3",
|
|
56
|
-
"@solana-mobile/dapp-store-publishing-tools": "workspace:0.
|
|
56
|
+
"@solana-mobile/dapp-store-publishing-tools": "workspace:0.7.1",
|
|
57
57
|
"@solana/web3.js": "1.68.0",
|
|
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.
|
|
3
|
+
"version": "0.7.2",
|
|
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.18.3",
|
|
49
|
-
"@solana-mobile/dapp-store-publishing-tools": "0.
|
|
49
|
+
"@solana-mobile/dapp-store-publishing-tools": "0.7.2",
|
|
50
50
|
"@solana/web3.js": "1.68.0",
|
|
51
51
|
"@types/semver": "^7.3.13",
|
|
52
52
|
"ajv": "^8.11.0",
|
package/src/CliSetup.ts
CHANGED
|
@@ -48,7 +48,7 @@ function resolveBuildToolsPath(buildToolsPath: string | undefined) {
|
|
|
48
48
|
function latestReleaseMessage() {
|
|
49
49
|
showMessage(
|
|
50
50
|
`Publishing Tools Version ${ Constants.CLI_VERSION }`,
|
|
51
|
-
"- short_description value reduced to 30 character limit",
|
|
51
|
+
"- priority fee has been updated to handle network congestion\n- short_description value reduced to 30 character limit",
|
|
52
52
|
"warning"
|
|
53
53
|
);
|
|
54
54
|
}
|
|
@@ -108,6 +108,7 @@ export const createPublisherCliCmd = createCliCmd
|
|
|
108
108
|
|
|
109
109
|
showMessage("Success", resultText);
|
|
110
110
|
}
|
|
111
|
+
process.exit()
|
|
111
112
|
});
|
|
112
113
|
});
|
|
113
114
|
|
|
@@ -151,6 +152,7 @@ export const createAppCliCmd = createCliCmd
|
|
|
151
152
|
|
|
152
153
|
showMessage("Success", resultText);
|
|
153
154
|
}
|
|
155
|
+
process.exit()
|
|
154
156
|
});
|
|
155
157
|
});
|
|
156
158
|
|
|
@@ -203,6 +205,7 @@ export const createReleaseCliCmd = createCliCmd
|
|
|
203
205
|
|
|
204
206
|
showMessage("Success", resultText);
|
|
205
207
|
}
|
|
208
|
+
process.exit()
|
|
206
209
|
});
|
|
207
210
|
}
|
|
208
211
|
);
|
|
@@ -235,6 +238,7 @@ mainCli
|
|
|
235
238
|
buildToolsPath: resolvedBuildToolsPath,
|
|
236
239
|
});
|
|
237
240
|
}
|
|
241
|
+
process.exit()
|
|
238
242
|
});
|
|
239
243
|
});
|
|
240
244
|
|
|
@@ -307,6 +311,7 @@ publishCommand
|
|
|
307
311
|
const resultText = "Successfully submitted to the Solana Mobile dApp publisher portal";
|
|
308
312
|
showMessage("Success", resultText);
|
|
309
313
|
}
|
|
314
|
+
process.exit()
|
|
310
315
|
});
|
|
311
316
|
}
|
|
312
317
|
);
|
|
@@ -380,6 +385,7 @@ publishCommand
|
|
|
380
385
|
showMessage("Success", resultText);
|
|
381
386
|
}
|
|
382
387
|
});
|
|
388
|
+
process.exit()
|
|
383
389
|
}
|
|
384
390
|
);
|
|
385
391
|
|
|
@@ -445,6 +451,7 @@ publishCommand
|
|
|
445
451
|
const resultText = "dApp successfully removed from the publisher portal";
|
|
446
452
|
showMessage("Success", resultText);
|
|
447
453
|
}
|
|
454
|
+
process.exit()
|
|
448
455
|
})
|
|
449
456
|
}
|
|
450
457
|
);
|
|
@@ -505,6 +512,7 @@ publishCommand
|
|
|
505
512
|
const resultText = "Support request sent successfully";
|
|
506
513
|
showMessage("Success", resultText);
|
|
507
514
|
}
|
|
515
|
+
process.exit()
|
|
508
516
|
});
|
|
509
517
|
}
|
|
510
518
|
);
|
package/src/CliUtils.ts
CHANGED
|
@@ -18,7 +18,7 @@ import { awsStorage } from "@metaplex-foundation/js-plugin-aws";
|
|
|
18
18
|
import { S3StorageManager } from "./config/index.js";
|
|
19
19
|
|
|
20
20
|
export class Constants {
|
|
21
|
-
static CLI_VERSION = "0.
|
|
21
|
+
static CLI_VERSION = "0.7.2";
|
|
22
22
|
static CONFIG_FILE_NAME = "config.yaml";
|
|
23
23
|
static DEFAULT_RPC_DEVNET = "https://api.devnet.solana.com";
|
|
24
24
|
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
} from "@solana/web3.js";
|
|
13
13
|
import {
|
|
14
14
|
getMetaplexInstance,
|
|
15
|
+
showMessage
|
|
15
16
|
} from "../../CliUtils.js";
|
|
16
17
|
import { loadPublishDetailsWithChecks, writeToPublishDetails } from "../../config/PublishDetails.js";
|
|
17
18
|
|
|
@@ -56,22 +57,34 @@ const createReleaseNft = async ({
|
|
|
56
57
|
{ metaplex, publisher }
|
|
57
58
|
);
|
|
58
59
|
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
60
|
+
const maxTries = 4;
|
|
61
|
+
for (let i = 1; i <= maxTries; i++) {
|
|
62
|
+
try {
|
|
63
|
+
const blockhash = await connection.getLatestBlockhashAndContext();
|
|
64
|
+
const tx = txBuilder.toTransaction(blockhash.value);
|
|
65
|
+
tx.sign(releaseMintAddress, publisher);
|
|
66
|
+
const txSig = await sendAndConfirmTransaction(connection, tx, [
|
|
67
|
+
publisher,
|
|
68
|
+
releaseMintAddress,
|
|
69
|
+
], {
|
|
70
|
+
minContextSlot: blockhash.context.slot,
|
|
71
|
+
});
|
|
72
|
+
console.info({
|
|
73
|
+
txSig,
|
|
74
|
+
releaseMintAddress: releaseMintAddress.publicKey.toBase58(),
|
|
75
|
+
});
|
|
76
|
+
return { releaseAddress: releaseMintAddress.publicKey.toBase58() };
|
|
77
|
+
} catch (e) {
|
|
78
|
+
const errorMsg = (e as Error | null)?.message ?? "";
|
|
79
|
+
if (i == maxTries) {
|
|
80
|
+
showMessage("Transaction Failure", errorMsg, "error");
|
|
81
|
+
process.exit(-1)
|
|
82
|
+
} else {
|
|
83
|
+
const retryMsg = errorMsg + "\nWill Retry minting release"
|
|
84
|
+
showMessage("Transaction Failure", retryMsg, "standard");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
75
88
|
};
|
|
76
89
|
|
|
77
90
|
export const createReleaseCommand = async ({
|
|
@@ -2,7 +2,7 @@ import { AccountInfo, Connection, Keypair, PublicKey } from "@solana/web3.js";
|
|
|
2
2
|
import type { SignWithPublisherKeypair } from "@solana-mobile/dapp-store-publishing-tools";
|
|
3
3
|
import { publishSubmit } from "@solana-mobile/dapp-store-publishing-tools";
|
|
4
4
|
import nacl from "tweetnacl";
|
|
5
|
-
import { checkMintedStatus } from "../../CliUtils.js";
|
|
5
|
+
import { checkMintedStatus, showMessage } from "../../CliUtils.js";
|
|
6
6
|
import { Buffer } from "buffer";
|
|
7
7
|
import { loadPublishDetailsWithChecks } from "../../config/PublishDetails.js";
|
|
8
8
|
|
|
@@ -25,6 +25,12 @@ export const publishSubmitCommand = async ({
|
|
|
25
25
|
compliesWithSolanaDappStorePolicies = false,
|
|
26
26
|
requestorIsAuthorized = false,
|
|
27
27
|
}: PublishSubmitCommandInput) => {
|
|
28
|
+
showMessage(
|
|
29
|
+
`Publishing Estimates`,
|
|
30
|
+
"New app submissions take around 3-4 business days for review.",
|
|
31
|
+
"warning"
|
|
32
|
+
);
|
|
33
|
+
|
|
28
34
|
if (!compliesWithSolanaDappStorePolicies) {
|
|
29
35
|
console.error(
|
|
30
36
|
"ERROR: Cannot submit a request for which the requestor does not attest that it complies with Solana dApp Store policies"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Connection, Keypair } from "@solana/web3.js";
|
|
2
2
|
import type { SignWithPublisherKeypair } from "@solana-mobile/dapp-store-publishing-tools";
|
|
3
3
|
import { publishUpdate } from "@solana-mobile/dapp-store-publishing-tools";
|
|
4
|
-
import { checkMintedStatus } from "../../CliUtils.js";
|
|
4
|
+
import { checkMintedStatus, showMessage } from "../../CliUtils.js";
|
|
5
5
|
import nacl from "tweetnacl";
|
|
6
6
|
import { loadPublishDetailsWithChecks } from "../../config/PublishDetails.js";
|
|
7
7
|
|
|
@@ -26,6 +26,13 @@ export const publishUpdateCommand = async ({
|
|
|
26
26
|
requestorIsAuthorized = false,
|
|
27
27
|
critical = false,
|
|
28
28
|
}: PublishUpdateCommandInput) => {
|
|
29
|
+
|
|
30
|
+
showMessage(
|
|
31
|
+
`Publishing Estimates`,
|
|
32
|
+
"App update approvals take around 1-2 business days for review.",
|
|
33
|
+
"warning"
|
|
34
|
+
);
|
|
35
|
+
|
|
29
36
|
if (!compliesWithSolanaDappStorePolicies) {
|
|
30
37
|
console.error(
|
|
31
38
|
"ERROR: Cannot submit a request for which the requestor does not attest that it complies with Solana dApp Store policies"
|
|
@@ -34,6 +34,7 @@ const AaptPrefixes = {
|
|
|
34
34
|
verCodePrefix: "versionCode=",
|
|
35
35
|
verNamePrefix: "versionName=",
|
|
36
36
|
sdkPrefix: "sdkVersion:",
|
|
37
|
+
debuggableApkPrefix: "application-debuggable",
|
|
37
38
|
localePrefix: "locales: ",
|
|
38
39
|
};
|
|
39
40
|
|
|
@@ -214,6 +215,13 @@ const getAndroidDetails = async (
|
|
|
214
215
|
const locales = new RegExp(
|
|
215
216
|
AaptPrefixes.localePrefix + AaptPrefixes.quoteNonLazyRegex
|
|
216
217
|
).exec(stdout);
|
|
218
|
+
const isDebuggable = new RegExp(
|
|
219
|
+
AaptPrefixes.debuggableApkPrefix
|
|
220
|
+
).exec(stdout);
|
|
221
|
+
|
|
222
|
+
if (isDebuggable != null) {
|
|
223
|
+
throw new TypeError("Debug apks are not supported on Solana dApp store.\nSubmit a signed release apk")
|
|
224
|
+
}
|
|
217
225
|
|
|
218
226
|
let localeArray = Array.from(locales?.values() ?? []);
|
|
219
227
|
if (localeArray.length == 2) {
|
|
@@ -242,7 +250,11 @@ const getAndroidDetails = async (
|
|
|
242
250
|
locales: localeArray
|
|
243
251
|
};
|
|
244
252
|
} catch (e) {
|
|
245
|
-
|
|
253
|
+
if (e instanceof TypeError) {
|
|
254
|
+
throw e
|
|
255
|
+
} else {
|
|
256
|
+
throw new Error(`There was an error parsing your APK. Please ensure you have installed Java and provided a valid Android tools directory containing AAPT2.\n` + e);
|
|
257
|
+
}
|
|
246
258
|
}
|
|
247
259
|
};
|
|
248
260
|
|