@solana-mobile/dapp-store-cli 0.7.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 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
  ];
@@ -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 2:
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 3:
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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana-mobile/dapp-store-cli",
3
- "version": "0.7.1",
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.7.1",
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.7.1";
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 blockhash = await connection.getLatestBlockhashAndContext();
60
- const tx = txBuilder.toTransaction(blockhash.value);
61
- tx.sign(releaseMintAddress, publisher);
62
-
63
- const txSig = await sendAndConfirmTransaction(connection, tx, [
64
- publisher,
65
- releaseMintAddress,
66
- ], {
67
- minContextSlot: blockhash.context.slot
68
- });
69
- console.info({
70
- txSig,
71
- releaseMintAddress: releaseMintAddress.publicKey.toBase58(),
72
- });
73
-
74
- return { releaseAddress: releaseMintAddress.publicKey.toBase58() };
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 ({