@solana-mobile/dapp-store-cli 0.7.1 → 0.7.3

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);
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.7.1");
162
+ _define_property(Constants, "CLI_VERSION", "0.7.3");
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 = 8;
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/lib/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.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.1",
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",
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.3",
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.3",
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
  }
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.3";
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 = 8;
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 ({