@solana-mobile/dapp-store-cli 0.7.2 → 0.8.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/lib/CliSetup.js +74 -46
- package/lib/CliUtils.js +5 -1
- package/lib/__tests__/CliSetupTest.js +3 -3
- package/lib/commands/ValidateCommand.js +27 -5
- package/lib/commands/create/CreateCliApp.js +68 -32
- package/lib/commands/create/CreateCliPublisher.js +68 -28
- package/lib/commands/create/CreateCliRelease.js +21 -16
- package/lib/config/PublishDetails.js +9 -3
- package/lib/package.json +2 -2
- package/lib/upload/CachedStorageDriver.js +1 -10
- package/package.json +2 -2
- package/src/CliSetup.ts +62 -32
- package/src/CliUtils.ts +6 -1
- package/src/__tests__/CliSetupTest.ts +15 -12
- package/src/commands/ValidateCommand.ts +38 -4
- package/src/commands/create/CreateCliApp.ts +46 -27
- package/src/commands/create/CreateCliPublisher.ts +45 -30
- package/src/commands/create/CreateCliRelease.ts +20 -9
- package/src/config/PublishDetails.ts +18 -6
- package/src/upload/CachedStorageDriver.ts +1 -10
|
@@ -124,23 +124,24 @@ function _ts_generator(thisArg, body) {
|
|
|
124
124
|
}
|
|
125
125
|
import { createPublisher } from "@solana-mobile/dapp-store-publishing-tools";
|
|
126
126
|
import { Connection, Keypair, sendAndConfirmTransaction } from "@solana/web3.js";
|
|
127
|
-
import { getMetaplexInstance } from "../../CliUtils.js";
|
|
127
|
+
import { Constants, getMetaplexInstance, showMessage } from "../../CliUtils.js";
|
|
128
128
|
import { loadPublishDetailsWithChecks, writeToPublishDetails } from "../../config/PublishDetails.js";
|
|
129
129
|
var createPublisherNft = function() {
|
|
130
|
-
var _ref = _async_to_generator(function(param
|
|
131
|
-
var connection, publisher, publisherDetails, storageParams,
|
|
130
|
+
var _ref = _async_to_generator(function(param) {
|
|
131
|
+
var connection, publisher, publisherDetails, storageParams, priorityFeeLamports, mintAddress, metaplex, txBuilder, maxTries, i, blockhash, tx, txSig, e, _e_message, errorMsg, retryMsg;
|
|
132
132
|
return _ts_generator(this, function(_state) {
|
|
133
133
|
switch(_state.label){
|
|
134
134
|
case 0:
|
|
135
|
-
connection = param.connection, publisher = param.publisher, publisherDetails = param.publisherDetails, storageParams = param.storageParams,
|
|
135
|
+
connection = param.connection, publisher = param.publisher, publisherDetails = param.publisherDetails, storageParams = param.storageParams, priorityFeeLamports = param.priorityFeeLamports;
|
|
136
|
+
console.info("Creating Publisher NFT");
|
|
136
137
|
mintAddress = Keypair.generate();
|
|
137
138
|
metaplex = getMetaplexInstance(connection, publisher, storageParams);
|
|
138
|
-
console.info("Creating publisher at address: ".concat(mintAddress.publicKey.toBase58()));
|
|
139
139
|
return [
|
|
140
140
|
4,
|
|
141
141
|
createPublisher({
|
|
142
142
|
mintAddress: mintAddress,
|
|
143
|
-
publisherDetails: publisherDetails
|
|
143
|
+
publisherDetails: publisherDetails,
|
|
144
|
+
priorityFeeLamports: priorityFeeLamports
|
|
144
145
|
}, {
|
|
145
146
|
metaplex: metaplex,
|
|
146
147
|
publisher: publisher
|
|
@@ -148,18 +149,31 @@ var createPublisherNft = function() {
|
|
|
148
149
|
];
|
|
149
150
|
case 1:
|
|
150
151
|
txBuilder = _state.sent();
|
|
152
|
+
console.info("Publisher NFT data upload complete\nSigning transaction now");
|
|
153
|
+
maxTries = 8;
|
|
154
|
+
i = 1;
|
|
155
|
+
_state.label = 2;
|
|
156
|
+
case 2:
|
|
157
|
+
if (!(i <= maxTries)) return [
|
|
158
|
+
3,
|
|
159
|
+
8
|
|
160
|
+
];
|
|
161
|
+
_state.label = 3;
|
|
162
|
+
case 3:
|
|
163
|
+
_state.trys.push([
|
|
164
|
+
3,
|
|
165
|
+
6,
|
|
166
|
+
,
|
|
167
|
+
7
|
|
168
|
+
]);
|
|
151
169
|
return [
|
|
152
170
|
4,
|
|
153
171
|
connection.getLatestBlockhashAndContext()
|
|
154
172
|
];
|
|
155
|
-
case
|
|
173
|
+
case 4:
|
|
156
174
|
blockhash = _state.sent();
|
|
157
175
|
tx = txBuilder.toTransaction(blockhash.value);
|
|
158
176
|
tx.sign(mintAddress, publisher);
|
|
159
|
-
if (!!dryRun) return [
|
|
160
|
-
3,
|
|
161
|
-
4
|
|
162
|
-
];
|
|
163
177
|
return [
|
|
164
178
|
4,
|
|
165
179
|
sendAndConfirmTransaction(connection, tx, [
|
|
@@ -169,34 +183,53 @@ var createPublisherNft = function() {
|
|
|
169
183
|
minContextSlot: blockhash.context.slot
|
|
170
184
|
})
|
|
171
185
|
];
|
|
172
|
-
case
|
|
186
|
+
case 5:
|
|
173
187
|
txSig = _state.sent();
|
|
174
|
-
console.info({
|
|
175
|
-
txSig: txSig,
|
|
176
|
-
mintAddress: mintAddress.publicKey.toBase58()
|
|
177
|
-
});
|
|
178
|
-
_state.label = 4;
|
|
179
|
-
case 4:
|
|
180
188
|
return [
|
|
181
189
|
2,
|
|
182
190
|
{
|
|
183
|
-
publisherAddress: mintAddress.publicKey.toBase58()
|
|
191
|
+
publisherAddress: mintAddress.publicKey.toBase58(),
|
|
192
|
+
transactionSignature: txSig
|
|
184
193
|
}
|
|
185
194
|
];
|
|
195
|
+
case 6:
|
|
196
|
+
e = _state.sent();
|
|
197
|
+
errorMsg = (_e_message = e === null || e === void 0 ? void 0 : e.message) !== null && _e_message !== void 0 ? _e_message : "";
|
|
198
|
+
if (i == maxTries) {
|
|
199
|
+
showMessage("Transaction Failure", errorMsg, "error");
|
|
200
|
+
process.exit(-1);
|
|
201
|
+
} else {
|
|
202
|
+
retryMsg = errorMsg + "\nWill Retry minting publisher.";
|
|
203
|
+
showMessage("Transaction Failure", retryMsg, "standard");
|
|
204
|
+
}
|
|
205
|
+
return [
|
|
206
|
+
3,
|
|
207
|
+
7
|
|
208
|
+
];
|
|
209
|
+
case 7:
|
|
210
|
+
i++;
|
|
211
|
+
return [
|
|
212
|
+
3,
|
|
213
|
+
2
|
|
214
|
+
];
|
|
215
|
+
case 8:
|
|
216
|
+
return [
|
|
217
|
+
2
|
|
218
|
+
];
|
|
186
219
|
}
|
|
187
220
|
});
|
|
188
221
|
});
|
|
189
|
-
return function createPublisherNft(_
|
|
222
|
+
return function createPublisherNft(_) {
|
|
190
223
|
return _ref.apply(this, arguments);
|
|
191
224
|
};
|
|
192
225
|
}();
|
|
193
226
|
export var createPublisherCommand = function() {
|
|
194
227
|
var _ref = _async_to_generator(function(param) {
|
|
195
|
-
var signer, url, dryRun, storageParams, connection, _ref, publisherDetails, publisherAddress;
|
|
228
|
+
var signer, url, dryRun, storageParams, _param_priorityFeeLamports, priorityFeeLamports, connection, _ref, publisherDetails, _ref1, publisherAddress, transactionSignature;
|
|
196
229
|
return _ts_generator(this, function(_state) {
|
|
197
230
|
switch(_state.label){
|
|
198
231
|
case 0:
|
|
199
|
-
signer = param.signer, url = param.url, dryRun = param.dryRun, storageParams = param.storageParams;
|
|
232
|
+
signer = param.signer, url = param.url, dryRun = param.dryRun, storageParams = param.storageParams, _param_priorityFeeLamports = param.priorityFeeLamports, priorityFeeLamports = _param_priorityFeeLamports === void 0 ? Constants.DEFAULT_PRIORITY_FEE : _param_priorityFeeLamports;
|
|
200
233
|
connection = new Connection(url);
|
|
201
234
|
return [
|
|
202
235
|
4,
|
|
@@ -204,20 +237,22 @@ export var createPublisherCommand = function() {
|
|
|
204
237
|
];
|
|
205
238
|
case 1:
|
|
206
239
|
_ref = _state.sent(), publisherDetails = _ref.publisher;
|
|
240
|
+
if (!!dryRun) return [
|
|
241
|
+
3,
|
|
242
|
+
4
|
|
243
|
+
];
|
|
207
244
|
return [
|
|
208
245
|
4,
|
|
209
246
|
createPublisherNft({
|
|
210
247
|
connection: connection,
|
|
211
248
|
publisher: signer,
|
|
212
249
|
publisherDetails: publisherDetails,
|
|
213
|
-
storageParams: storageParams
|
|
214
|
-
|
|
215
|
-
dryRun: dryRun
|
|
250
|
+
storageParams: storageParams,
|
|
251
|
+
priorityFeeLamports: priorityFeeLamports
|
|
216
252
|
})
|
|
217
253
|
];
|
|
218
254
|
case 2:
|
|
219
|
-
|
|
220
|
-
// TODO(sdlaver): dry-run should not modify config
|
|
255
|
+
_ref1 = _state.sent(), publisherAddress = _ref1.publisherAddress, transactionSignature = _ref1.transactionSignature;
|
|
221
256
|
return [
|
|
222
257
|
4,
|
|
223
258
|
writeToPublishDetails({
|
|
@@ -231,9 +266,14 @@ export var createPublisherCommand = function() {
|
|
|
231
266
|
return [
|
|
232
267
|
2,
|
|
233
268
|
{
|
|
234
|
-
publisherAddress: publisherAddress
|
|
269
|
+
publisherAddress: publisherAddress,
|
|
270
|
+
transactionSignature: transactionSignature
|
|
235
271
|
}
|
|
236
272
|
];
|
|
273
|
+
case 4:
|
|
274
|
+
return [
|
|
275
|
+
2
|
|
276
|
+
];
|
|
237
277
|
}
|
|
238
278
|
});
|
|
239
279
|
});
|
|
@@ -152,15 +152,16 @@ 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, showMessage } from "../../CliUtils.js";
|
|
155
|
+
import { Constants, 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, maxTries, i, blockhash, tx, txSig, e, _e_message, errorMsg, retryMsg;
|
|
159
|
+
var appMintAddress, releaseDetails, appDetails, publisherDetails, connection, publisher, storageParams, priorityFeeLamports, 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:
|
|
163
|
-
appMintAddress = param.appMintAddress, releaseDetails = param.releaseDetails, appDetails = param.appDetails, publisherDetails = param.publisherDetails, connection = param.connection, publisher = param.publisher, storageParams = param.storageParams;
|
|
163
|
+
appMintAddress = param.appMintAddress, releaseDetails = param.releaseDetails, appDetails = param.appDetails, publisherDetails = param.publisherDetails, connection = param.connection, publisher = param.publisher, storageParams = param.storageParams, priorityFeeLamports = param.priorityFeeLamports;
|
|
164
|
+
console.info("Creating Release NFT");
|
|
164
165
|
releaseMintAddress = Keypair.generate();
|
|
165
166
|
metaplex = getMetaplexInstance(connection, publisher, storageParams);
|
|
166
167
|
return [
|
|
@@ -170,7 +171,8 @@ var createReleaseNft = function() {
|
|
|
170
171
|
releaseMintAddress: releaseMintAddress,
|
|
171
172
|
releaseDetails: releaseDetails,
|
|
172
173
|
appDetails: appDetails,
|
|
173
|
-
publisherDetails: publisherDetails
|
|
174
|
+
publisherDetails: publisherDetails,
|
|
175
|
+
priorityFeeLamports: priorityFeeLamports
|
|
174
176
|
}, {
|
|
175
177
|
metaplex: metaplex,
|
|
176
178
|
publisher: publisher
|
|
@@ -178,7 +180,8 @@ var createReleaseNft = function() {
|
|
|
178
180
|
];
|
|
179
181
|
case 1:
|
|
180
182
|
txBuilder = _state.sent().txBuilder;
|
|
181
|
-
|
|
183
|
+
console.info("Release NFT data upload complete\nSigning transaction now");
|
|
184
|
+
maxTries = 8;
|
|
182
185
|
i = 1;
|
|
183
186
|
_state.label = 2;
|
|
184
187
|
case 2:
|
|
@@ -213,14 +216,11 @@ var createReleaseNft = function() {
|
|
|
213
216
|
];
|
|
214
217
|
case 5:
|
|
215
218
|
txSig = _state.sent();
|
|
216
|
-
console.info({
|
|
217
|
-
txSig: txSig,
|
|
218
|
-
releaseMintAddress: releaseMintAddress.publicKey.toBase58()
|
|
219
|
-
});
|
|
220
219
|
return [
|
|
221
220
|
2,
|
|
222
221
|
{
|
|
223
|
-
releaseAddress: releaseMintAddress.publicKey.toBase58()
|
|
222
|
+
releaseAddress: releaseMintAddress.publicKey.toBase58(),
|
|
223
|
+
transactionSignature: txSig
|
|
224
224
|
}
|
|
225
225
|
];
|
|
226
226
|
case 6:
|
|
@@ -230,7 +230,7 @@ var createReleaseNft = function() {
|
|
|
230
230
|
showMessage("Transaction Failure", errorMsg, "error");
|
|
231
231
|
process.exit(-1);
|
|
232
232
|
} else {
|
|
233
|
-
retryMsg = errorMsg + "\nWill Retry minting release";
|
|
233
|
+
retryMsg = errorMsg + "\nWill Retry minting release NFT";
|
|
234
234
|
showMessage("Transaction Failure", retryMsg, "standard");
|
|
235
235
|
}
|
|
236
236
|
return [
|
|
@@ -256,11 +256,11 @@ var createReleaseNft = function() {
|
|
|
256
256
|
}();
|
|
257
257
|
export var createReleaseCommand = function() {
|
|
258
258
|
var _ref = _async_to_generator(function(param) {
|
|
259
|
-
var appMintAddress, buildToolsPath, signer, url, _param_dryRun, dryRun, storageParams, connection, _ref, release, app, publisher, _app_address, releaseAddress;
|
|
259
|
+
var appMintAddress, buildToolsPath, signer, url, _param_dryRun, dryRun, storageParams, _param_priorityFeeLamports, priorityFeeLamports, connection, _ref, release, app, publisher, _app_address, _ref1, releaseAddress, transactionSignature;
|
|
260
260
|
return _ts_generator(this, function(_state) {
|
|
261
261
|
switch(_state.label){
|
|
262
262
|
case 0:
|
|
263
|
-
appMintAddress = param.appMintAddress, buildToolsPath = param.buildToolsPath, signer = param.signer, url = param.url, _param_dryRun = param.dryRun, dryRun = _param_dryRun === void 0 ? false : _param_dryRun, storageParams = param.storageParams;
|
|
263
|
+
appMintAddress = param.appMintAddress, buildToolsPath = param.buildToolsPath, signer = param.signer, url = param.url, _param_dryRun = param.dryRun, dryRun = _param_dryRun === void 0 ? false : _param_dryRun, storageParams = param.storageParams, _param_priorityFeeLamports = param.priorityFeeLamports, priorityFeeLamports = _param_priorityFeeLamports === void 0 ? Constants.DEFAULT_PRIORITY_FEE : _param_priorityFeeLamports;
|
|
264
264
|
connection = new Connection(url);
|
|
265
265
|
return [
|
|
266
266
|
4,
|
|
@@ -268,6 +268,9 @@ export var createReleaseCommand = function() {
|
|
|
268
268
|
];
|
|
269
269
|
case 1:
|
|
270
270
|
_ref = _state.sent(), release = _ref.release, app = _ref.app, publisher = _ref.publisher;
|
|
271
|
+
if (app.android_package != release.android_details.android_package) {
|
|
272
|
+
throw new Error("App package name and release package name do not match.\nApp release specifies " + app.android_package + " while release specifies " + release.android_details.android_package);
|
|
273
|
+
}
|
|
271
274
|
if (!!dryRun) return [
|
|
272
275
|
3,
|
|
273
276
|
4
|
|
@@ -281,11 +284,12 @@ export var createReleaseCommand = function() {
|
|
|
281
284
|
releaseDetails: _object_spread({}, release),
|
|
282
285
|
appDetails: app,
|
|
283
286
|
publisherDetails: publisher,
|
|
284
|
-
storageParams: storageParams
|
|
287
|
+
storageParams: storageParams,
|
|
288
|
+
priorityFeeLamports: priorityFeeLamports
|
|
285
289
|
})
|
|
286
290
|
];
|
|
287
291
|
case 2:
|
|
288
|
-
|
|
292
|
+
_ref1 = _state.sent(), releaseAddress = _ref1.releaseAddress, transactionSignature = _ref1.transactionSignature;
|
|
289
293
|
return [
|
|
290
294
|
4,
|
|
291
295
|
writeToPublishDetails({
|
|
@@ -299,7 +303,8 @@ export var createReleaseCommand = function() {
|
|
|
299
303
|
return [
|
|
300
304
|
2,
|
|
301
305
|
{
|
|
302
|
-
releaseAddress: releaseAddress
|
|
306
|
+
releaseAddress: releaseAddress,
|
|
307
|
+
transactionSignature: transactionSignature
|
|
303
308
|
}
|
|
304
309
|
];
|
|
305
310
|
case 4:
|
|
@@ -265,7 +265,7 @@ export var loadPublishDetails = function() {
|
|
|
265
265
|
}();
|
|
266
266
|
export var loadPublishDetailsWithChecks = function() {
|
|
267
267
|
var _ref = _async_to_generator(function() {
|
|
268
|
-
var buildToolsDir, _config_publisher_media_find, _config_publisher_media, _config_app_media_find, _config_app_media, _config_release_media_find, _config_release_media, config, apkEntry, apkPath, _, publisherIcon, iconPath, iconBuffer, appIcon, iconPath1, iconBuffer1, releaseIcon, iconPath2, googlePkg, pkgCompare;
|
|
268
|
+
var buildToolsDir, _config_publisher_media_find, _config_publisher_media, _config_app_media_find, _config_app_media, _config_release_media_find, _config_release_media, _config_release_media1, config, apkEntry, apkPath, _, publisherIcon, iconPath, iconBuffer, appIcon, iconPath1, iconBuffer1, releaseIcon, iconPath2, screenshots, googlePkg, pkgCompare;
|
|
269
269
|
var _arguments = arguments;
|
|
270
270
|
return _ts_generator(this, function(_state) {
|
|
271
271
|
switch(_state.label){
|
|
@@ -368,6 +368,12 @@ export var loadPublishDetailsWithChecks = function() {
|
|
|
368
368
|
throw new Error("Invalid media path or file type: ".concat(item.uri, ". Please ensure the file is a jpeg, png, or webp file."));
|
|
369
369
|
}
|
|
370
370
|
});
|
|
371
|
+
screenshots = (_config_release_media1 = config.release.media) === null || _config_release_media1 === void 0 ? void 0 : _config_release_media1.filter(function(asset) {
|
|
372
|
+
return asset.purpose === "screenshot";
|
|
373
|
+
});
|
|
374
|
+
if (screenshots.length < 4) {
|
|
375
|
+
showMessage("Screenshots requirements changing in version 0.9.0", "At least 4 screenshots are required for publishing a new release. Found only ".concat(screenshots.length), "warning");
|
|
376
|
+
}
|
|
371
377
|
validateLocalizableResources(config);
|
|
372
378
|
googlePkg = config.solana_mobile_dapp_publisher_portal.google_store_package;
|
|
373
379
|
if (googlePkg === null || googlePkg === void 0 ? void 0 : googlePkg.length) {
|
|
@@ -401,7 +407,7 @@ var checkIconCompatibility = function() {
|
|
|
401
407
|
];
|
|
402
408
|
case 1:
|
|
403
409
|
if (_state.sent()) {
|
|
404
|
-
throw new Error("Icons must
|
|
410
|
+
throw new Error("Icons must be 512px by 512px.");
|
|
405
411
|
}
|
|
406
412
|
return [
|
|
407
413
|
2
|
|
@@ -453,7 +459,7 @@ var checkIconDimensions = function() {
|
|
|
453
459
|
size = _state.sent();
|
|
454
460
|
return [
|
|
455
461
|
2,
|
|
456
|
-
(size === null || size === void 0 ? void 0 : size.width) != (size === null || size === void 0 ? void 0 : size.height) || ((_size_width = size === null || size === void 0 ? void 0 : size.width) !== null && _size_width !== void 0 ? _size_width : 0)
|
|
462
|
+
(size === null || size === void 0 ? void 0 : size.width) != (size === null || size === void 0 ? void 0 : size.height) || ((_size_width = size === null || size === void 0 ? void 0 : size.width) !== null && _size_width !== void 0 ? _size_width : 0) != 512
|
|
457
463
|
];
|
|
458
464
|
}
|
|
459
465
|
});
|
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana-mobile/dapp-store-cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
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.7.
|
|
56
|
+
"@solana-mobile/dapp-store-publishing-tools": "workspace:0.7.3",
|
|
57
57
|
"@solana/web3.js": "1.68.0",
|
|
58
58
|
"@types/semver": "^7.3.13",
|
|
59
59
|
"ajv": "^8.11.0",
|
|
@@ -181,9 +181,6 @@ export var CachedStorageDriver = /*#__PURE__*/ function() {
|
|
|
181
181
|
_define_property(this, "assetManifestPath", void 0);
|
|
182
182
|
_define_property(this, "storageDriver", void 0);
|
|
183
183
|
this.assetManifestPath = assetManifestPath;
|
|
184
|
-
console.info({
|
|
185
|
-
loading: true
|
|
186
|
-
});
|
|
187
184
|
var _this_loadAssetManifest;
|
|
188
185
|
this.assetManifest = (_this_loadAssetManifest = this.loadAssetManifest(assetManifestPath)) !== null && _this_loadAssetManifest !== void 0 ? _this_loadAssetManifest : {
|
|
189
186
|
schema_version: CachedStorageDriver.SCHEMA_VERSION,
|
|
@@ -252,13 +249,6 @@ export var CachedStorageDriver = /*#__PURE__*/ function() {
|
|
|
252
249
|
];
|
|
253
250
|
case 2:
|
|
254
251
|
hash = createHash("sha256").update(file.buffer).digest("base64");
|
|
255
|
-
console.info(JSON.stringify({
|
|
256
|
-
file: {
|
|
257
|
-
name: file.fileName,
|
|
258
|
-
disn: file.displayName,
|
|
259
|
-
un: file.uniqueName
|
|
260
|
-
}
|
|
261
|
-
}));
|
|
262
252
|
uploadedAsset = _this.uploadedAsset(file.fileName, {
|
|
263
253
|
sha256: hash
|
|
264
254
|
});
|
|
@@ -290,6 +280,7 @@ export var CachedStorageDriver = /*#__PURE__*/ function() {
|
|
|
290
280
|
];
|
|
291
281
|
case 4:
|
|
292
282
|
_state.sent();
|
|
283
|
+
console.log("".concat(file.fileName, " uploaded at ").concat(uri));
|
|
293
284
|
return [
|
|
294
285
|
2,
|
|
295
286
|
uri
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana-mobile/dapp-store-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
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.8.0",
|
|
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
|
@@ -11,10 +11,12 @@ import {
|
|
|
11
11
|
checkForSelfUpdate,
|
|
12
12
|
checkSubmissionNetwork,
|
|
13
13
|
Constants,
|
|
14
|
+
dryRunSuccessMessage,
|
|
14
15
|
generateNetworkSuffix,
|
|
15
16
|
parseKeypair,
|
|
16
17
|
showMessage
|
|
17
18
|
} from "./CliUtils.js";
|
|
19
|
+
import { LAMPORTS_PER_SOL } from "@solana/web3.js"
|
|
18
20
|
import * as dotenv from "dotenv";
|
|
19
21
|
import { initScaffold } from "./commands/scaffolding/index.js";
|
|
20
22
|
import { loadPublishDetails, loadPublishDetailsWithChecks } from "./config/PublishDetails.js";
|
|
@@ -46,9 +48,14 @@ function resolveBuildToolsPath(buildToolsPath: string | undefined) {
|
|
|
46
48
|
* This method should be updated with each new release of the CLI, and just do nothing when there isn't anything to report
|
|
47
49
|
*/
|
|
48
50
|
function latestReleaseMessage() {
|
|
51
|
+
const messages = [
|
|
52
|
+
`- priority fee has been updated to ${Constants.DEFAULT_PRIORITY_FEE} lamports = ${Constants.DEFAULT_PRIORITY_FEE / LAMPORTS_PER_SOL} SOL. To adjust this value use param "-p" or "--priority-fee-lamports"`,
|
|
53
|
+
`- At least 4 screenshots are now required to update or release a new app`,
|
|
54
|
+
`- App icons should be exactly 512x512.`
|
|
55
|
+
].join('\n\n')
|
|
49
56
|
showMessage(
|
|
50
57
|
`Publishing Tools Version ${ Constants.CLI_VERSION }`,
|
|
51
|
-
|
|
58
|
+
messages,
|
|
52
59
|
"warning"
|
|
53
60
|
);
|
|
54
61
|
}
|
|
@@ -94,21 +101,26 @@ export const createPublisherCliCmd = createCliCmd
|
|
|
94
101
|
.option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET)
|
|
95
102
|
.option("-d, --dry-run", "Flag for dry run. Doesn't mint an NFT")
|
|
96
103
|
.option("-s, --storage-config <storage-config>", "Provide alternative storage configuration details")
|
|
97
|
-
.
|
|
104
|
+
.option("-p, --priority-fee-lamports <priority-fee-lamports>", "Priority Fee lamports")
|
|
105
|
+
.action(async ({ keypair, url, dryRun, storageConfig, priorityFeeLamports }) => {
|
|
98
106
|
await tryWithErrorMessage(async () => {
|
|
99
107
|
latestReleaseMessage();
|
|
100
108
|
await checkForSelfUpdate();
|
|
101
109
|
|
|
102
110
|
const signer = parseKeypair(keypair);
|
|
103
111
|
if (signer) {
|
|
104
|
-
const result: { publisherAddress: string } = await createPublisherCommand({ signer, url, dryRun, storageParams: storageConfig });
|
|
112
|
+
const result: { publisherAddress: string, transactionSignature: string } = await createPublisherCommand({ signer, url, dryRun, storageParams: storageConfig, priorityFeeLamports });
|
|
105
113
|
|
|
106
|
-
|
|
107
|
-
|
|
114
|
+
if (dryRun) {
|
|
115
|
+
dryRunSuccessMessage()
|
|
116
|
+
} else {
|
|
117
|
+
const displayUrl = `https://explorer.solana.com/address/${result.publisherAddress}${generateNetworkSuffix(url)}`;
|
|
118
|
+
const transactionUrl = `https://explorer.solana.com/tx/${result.transactionSignature}${generateNetworkSuffix(url)}`;
|
|
119
|
+
const resultText = `Publisher NFT successfully minted successfully:\n${displayUrl}\n${transactionUrl}`;
|
|
108
120
|
|
|
109
|
-
|
|
121
|
+
showMessage("Success", resultText);
|
|
122
|
+
}
|
|
110
123
|
}
|
|
111
|
-
process.exit()
|
|
112
124
|
});
|
|
113
125
|
});
|
|
114
126
|
|
|
@@ -126,7 +138,8 @@ export const createAppCliCmd = createCliCmd
|
|
|
126
138
|
.option("-u, --url <url>", "RPC URL", Constants.DEFAULT_RPC_DEVNET)
|
|
127
139
|
.option("-d, --dry-run", "Flag for dry run. Doesn't mint an NFT")
|
|
128
140
|
.option("-s, --storage-config <storage-config>", "Provide alternative storage configuration details")
|
|
129
|
-
.
|
|
141
|
+
.option("-p, --priority-fee-lamports <priority-fee-lamports>", "Priority Fee lamports")
|
|
142
|
+
.action(async ({ publisherMintAddress, keypair, url, dryRun, storageConfig, priorityFeeLamports }) => {
|
|
130
143
|
await tryWithErrorMessage(async () => {
|
|
131
144
|
latestReleaseMessage();
|
|
132
145
|
await checkForSelfUpdate();
|
|
@@ -144,15 +157,19 @@ export const createAppCliCmd = createCliCmd
|
|
|
144
157
|
signer,
|
|
145
158
|
url,
|
|
146
159
|
dryRun,
|
|
147
|
-
storageParams: storageConfig
|
|
160
|
+
storageParams: storageConfig,
|
|
161
|
+
priorityFeeLamports: priorityFeeLamports,
|
|
148
162
|
});
|
|
149
163
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
164
|
+
if (dryRun) {
|
|
165
|
+
dryRunSuccessMessage()
|
|
166
|
+
} else {
|
|
167
|
+
const displayUrl = `https://explorer.solana.com/address/${result.appAddress}${generateNetworkSuffix(url)}`;
|
|
168
|
+
const transactionUrl = `https://explorer.solana.com/tx/${result.transactionSignature}${generateNetworkSuffix(url)}`;
|
|
169
|
+
const resultText = `App NFT successfully minted:\n${displayUrl}\n${transactionUrl}`;
|
|
170
|
+
showMessage("Success", resultText);
|
|
171
|
+
}
|
|
154
172
|
}
|
|
155
|
-
process.exit()
|
|
156
173
|
});
|
|
157
174
|
});
|
|
158
175
|
|
|
@@ -174,7 +191,8 @@ export const createReleaseCliCmd = createCliCmd
|
|
|
174
191
|
"Path to Android build tools which contains AAPT2"
|
|
175
192
|
)
|
|
176
193
|
.option("-s, --storage-config <storage-config>", "Provide alternative storage configuration details")
|
|
177
|
-
.
|
|
194
|
+
.option("-p, --priority-fee-lamports <priority-fee-lamports>", "Priority Fee lamports")
|
|
195
|
+
.action(async ({ appMintAddress, keypair, url, dryRun, buildToolsPath, storageConfig, priorityFeeLamports }) => {
|
|
178
196
|
await tryWithErrorMessage(async () => {
|
|
179
197
|
latestReleaseMessage();
|
|
180
198
|
await checkForSelfUpdate();
|
|
@@ -198,14 +216,19 @@ export const createReleaseCliCmd = createCliCmd
|
|
|
198
216
|
url,
|
|
199
217
|
dryRun,
|
|
200
218
|
storageParams: storageConfig,
|
|
219
|
+
priorityFeeLamports: priorityFeeLamports
|
|
201
220
|
});
|
|
202
221
|
|
|
203
|
-
|
|
204
|
-
|
|
222
|
+
if (dryRun) {
|
|
223
|
+
dryRunSuccessMessage()
|
|
224
|
+
} else {
|
|
225
|
+
const displayUrl = `https://explorer.solana.com/address/${result?.releaseAddress}${generateNetworkSuffix(url)}`;
|
|
226
|
+
const transactionUrl = `https://explorer.solana.com/tx/${result.transactionSignature}${generateNetworkSuffix(url)}`;
|
|
227
|
+
const resultText = `Release NFT successfully minted:\n${displayUrl}\n${transactionUrl}`;
|
|
205
228
|
|
|
206
|
-
|
|
229
|
+
showMessage("Success", resultText);
|
|
230
|
+
}
|
|
207
231
|
}
|
|
208
|
-
process.exit()
|
|
209
232
|
});
|
|
210
233
|
}
|
|
211
234
|
);
|
|
@@ -238,7 +261,6 @@ mainCli
|
|
|
238
261
|
buildToolsPath: resolvedBuildToolsPath,
|
|
239
262
|
});
|
|
240
263
|
}
|
|
241
|
-
process.exit()
|
|
242
264
|
});
|
|
243
265
|
});
|
|
244
266
|
|
|
@@ -308,10 +330,12 @@ publishCommand
|
|
|
308
330
|
requestorIsAuthorized,
|
|
309
331
|
});
|
|
310
332
|
|
|
311
|
-
|
|
312
|
-
|
|
333
|
+
if (dryRun) {
|
|
334
|
+
dryRunSuccessMessage()
|
|
335
|
+
} else {
|
|
336
|
+
showMessage("Success", "Successfully submitted to the Solana Mobile dApp publisher portal");
|
|
337
|
+
}
|
|
313
338
|
}
|
|
314
|
-
process.exit()
|
|
315
339
|
});
|
|
316
340
|
}
|
|
317
341
|
);
|
|
@@ -381,11 +405,13 @@ publishCommand
|
|
|
381
405
|
critical,
|
|
382
406
|
});
|
|
383
407
|
|
|
384
|
-
|
|
385
|
-
|
|
408
|
+
if (dryRun) {
|
|
409
|
+
dryRunSuccessMessage()
|
|
410
|
+
} else {
|
|
411
|
+
showMessage("Success", "dApp successfully updated on the publisher portal");
|
|
412
|
+
}
|
|
386
413
|
}
|
|
387
414
|
});
|
|
388
|
-
process.exit()
|
|
389
415
|
}
|
|
390
416
|
);
|
|
391
417
|
|
|
@@ -448,10 +474,12 @@ publishCommand
|
|
|
448
474
|
critical,
|
|
449
475
|
});
|
|
450
476
|
|
|
451
|
-
|
|
452
|
-
|
|
477
|
+
if (dryRun) {
|
|
478
|
+
dryRunSuccessMessage()
|
|
479
|
+
} else {
|
|
480
|
+
showMessage("Success", "dApp successfully removed from the publisher portal");
|
|
481
|
+
}
|
|
453
482
|
}
|
|
454
|
-
process.exit()
|
|
455
483
|
})
|
|
456
484
|
}
|
|
457
485
|
);
|
|
@@ -509,10 +537,12 @@ publishCommand
|
|
|
509
537
|
requestDetails,
|
|
510
538
|
});
|
|
511
539
|
|
|
512
|
-
|
|
513
|
-
|
|
540
|
+
if (dryRun) {
|
|
541
|
+
dryRunSuccessMessage()
|
|
542
|
+
} else {
|
|
543
|
+
showMessage("Success", "Support request sent successfully");
|
|
544
|
+
}
|
|
514
545
|
}
|
|
515
|
-
process.exit()
|
|
516
546
|
});
|
|
517
547
|
}
|
|
518
548
|
);
|
package/src/CliUtils.ts
CHANGED
|
@@ -18,9 +18,10 @@ 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.8.0";
|
|
22
22
|
static CONFIG_FILE_NAME = "config.yaml";
|
|
23
23
|
static DEFAULT_RPC_DEVNET = "https://api.devnet.solana.com";
|
|
24
|
+
static DEFAULT_PRIORITY_FEE = 500000;
|
|
24
25
|
|
|
25
26
|
static getConfigFilePath = () => {
|
|
26
27
|
return `${process.cwd()}/${Constants.CONFIG_FILE_NAME}`;
|
|
@@ -112,6 +113,10 @@ export const generateNetworkSuffix = (rpcUrl: string): string => {
|
|
|
112
113
|
return suffix;
|
|
113
114
|
};
|
|
114
115
|
|
|
116
|
+
export const dryRunSuccessMessage = () => {
|
|
117
|
+
showMessage("Dry run", "Dry run was successful", "standard")
|
|
118
|
+
}
|
|
119
|
+
|
|
115
120
|
export const showMessage = (
|
|
116
121
|
titleMessage = "",
|
|
117
122
|
contentMessage = "",
|