@solana-mobile/dapp-store-publishing-tools 0.10.0 → 0.12.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/CoreUtils.js CHANGED
@@ -85,7 +85,7 @@ function _object_spread_props(target, source) {
85
85
  return target;
86
86
  }
87
87
  function _ts_generator(thisArg, body) {
88
- var f, y, t, g, _ = {
88
+ var f, y, t, _ = {
89
89
  label: 0,
90
90
  sent: function() {
91
91
  if (t[0] & 1) throw t[1];
@@ -93,12 +93,8 @@ function _ts_generator(thisArg, body) {
93
93
  },
94
94
  trys: [],
95
95
  ops: []
96
- };
97
- return g = {
98
- next: verb(0),
99
- "throw": verb(1),
100
- "return": verb(2)
101
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
96
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
97
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
102
98
  return this;
103
99
  }), g;
104
100
  function verb(n) {
@@ -111,7 +107,7 @@ function _ts_generator(thisArg, body) {
111
107
  }
112
108
  function step(op) {
113
109
  if (f) throw new TypeError("Generator is already executing.");
114
- while(_)try {
110
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
115
111
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
116
112
  if (y = 0, t) op = [
117
113
  op[0] & 2,
@@ -188,8 +184,8 @@ _define_property(Constants, "PUBLISHING_SCHEMA_VER", "0.3.0");
188
184
  export var truncateAddress = function(address) {
189
185
  return "".concat(address.slice(0, 4), "...").concat(address.slice(address.length - 4, address.length));
190
186
  };
191
- export var mintNft = /*#__PURE__*/ function() {
192
- var _ref = _async_to_generator(function(metaplex, json, createNftInput, priorityFeeLamports) {
187
+ export var mintNft = function(metaplex, json, createNftInput, priorityFeeLamports) {
188
+ return _async_to_generator(function() {
193
189
  var uri, computeBudget, txBuilder, microLamportsPerCU;
194
190
  return _ts_generator(this, function(_state) {
195
191
  switch(_state.label){
@@ -234,8 +230,5 @@ export var mintNft = /*#__PURE__*/ function() {
234
230
  ];
235
231
  }
236
232
  });
237
- });
238
- return function mintNft(metaplex, json, createNftInput, priorityFeeLamports) {
239
- return _ref.apply(this, arguments);
240
- };
241
- }();
233
+ })();
234
+ };
@@ -28,7 +28,7 @@ function _async_to_generator(fn) {
28
28
  };
29
29
  }
30
30
  function _ts_generator(thisArg, body) {
31
- var f, y, t, g, _ = {
31
+ var f, y, t, _ = {
32
32
  label: 0,
33
33
  sent: function() {
34
34
  if (t[0] & 1) throw t[1];
@@ -36,12 +36,8 @@ function _ts_generator(thisArg, body) {
36
36
  },
37
37
  trys: [],
38
38
  ops: []
39
- };
40
- return g = {
41
- next: verb(0),
42
- "throw": verb(1),
43
- "return": verb(2)
44
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
39
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
40
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
45
41
  return this;
46
42
  }), g;
47
43
  function verb(n) {
@@ -54,7 +50,7 @@ function _ts_generator(thisArg, body) {
54
50
  }
55
51
  function step(op) {
56
52
  if (f) throw new TypeError("Generator is already executing.");
57
- while(_)try {
53
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
58
54
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
59
55
  if (y = 0, t) op = [
60
56
  op[0] & 2,
@@ -149,13 +145,13 @@ export var createAppJson = function(app, publisherAddress) {
149
145
  };
150
146
  return appMetadata;
151
147
  };
152
- export var createApp = /*#__PURE__*/ function() {
153
- var _ref = _async_to_generator(function(param, param1) {
154
- var publisherMintAddress, mintAddress, appDetails, priorityFeeLamports, metaplex, publisher, appJson, txBuilder;
148
+ export var createApp = function(param, param1) {
149
+ var publisherMintAddress = param.publisherMintAddress, mintAddress = param.mintAddress, appDetails = param.appDetails, priorityFeeLamports = param.priorityFeeLamports, metaplex = param1.metaplex, publisher = param1.publisher;
150
+ return _async_to_generator(function() {
151
+ var appJson, txBuilder;
155
152
  return _ts_generator(this, function(_state) {
156
153
  switch(_state.label){
157
154
  case 0:
158
- publisherMintAddress = param.publisherMintAddress, mintAddress = param.mintAddress, appDetails = param.appDetails, priorityFeeLamports = param.priorityFeeLamports, metaplex = param1.metaplex, publisher = param1.publisher;
159
155
  appJson = createAppJson(appDetails, publisher.publicKey);
160
156
  validateApp(appJson);
161
157
  return [
@@ -189,8 +185,5 @@ export var createApp = /*#__PURE__*/ function() {
189
185
  ];
190
186
  }
191
187
  });
192
- });
193
- return function createApp(_, _1) {
194
- return _ref.apply(this, arguments);
195
- };
196
- }();
188
+ })();
189
+ };
@@ -167,7 +167,7 @@ function _unsupported_iterable_to_array(o, minLen) {
167
167
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
168
168
  }
169
169
  function _ts_generator(thisArg, body) {
170
- var f, y, t, g, _ = {
170
+ var f, y, t, _ = {
171
171
  label: 0,
172
172
  sent: function() {
173
173
  if (t[0] & 1) throw t[1];
@@ -175,12 +175,8 @@ function _ts_generator(thisArg, body) {
175
175
  },
176
176
  trys: [],
177
177
  ops: []
178
- };
179
- return g = {
180
- next: verb(0),
181
- "throw": verb(1),
182
- "return": verb(2)
183
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
178
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
179
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
184
180
  return this;
185
181
  }), g;
186
182
  function verb(n) {
@@ -193,7 +189,7 @@ function _ts_generator(thisArg, body) {
193
189
  }
194
190
  function step(op) {
195
191
  if (f) throw new TypeError("Generator is already executing.");
196
- while(_)try {
192
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
197
193
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
198
194
  if (y = 0, t) op = [
199
195
  op[0] & 2,
@@ -274,8 +270,8 @@ import { imageSize } from "image-size";
274
270
  import getVideoDimensions from "get-video-dimensions";
275
271
  var runImgSize = util.promisify(imageSize);
276
272
  var debug = debugModule("RELEASE");
277
- var getFileMetadata = /*#__PURE__*/ function() {
278
- var _ref = _async_to_generator(function(item) {
273
+ var getFileMetadata = function(item) {
274
+ return _async_to_generator(function() {
279
275
  var _item_uri, file, mediaBuffer, size, hash, _item_uri1, _item_uri2, metadata;
280
276
  return _ts_generator(this, function(_state) {
281
277
  switch(_state.label){
@@ -310,13 +306,10 @@ var getFileMetadata = /*#__PURE__*/ function() {
310
306
  ];
311
307
  }
312
308
  });
313
- });
314
- return function getFileMetadata(item) {
315
- return _ref.apply(this, arguments);
316
- };
317
- }();
318
- var getMediaMetadata = /*#__PURE__*/ function() {
319
- var _ref = _async_to_generator(function(item) {
309
+ })();
310
+ };
311
+ var getMediaMetadata = function(item) {
312
+ return _async_to_generator(function() {
320
313
  var metadata, _item_uri, size, _size_width, _size_height, _item_uri1, size1, _size_width1, _size_height1;
321
314
  return _ts_generator(this, function(_state) {
322
315
  switch(_state.label){
@@ -364,18 +357,15 @@ var getMediaMetadata = /*#__PURE__*/ function() {
364
357
  ];
365
358
  }
366
359
  });
367
- });
368
- return function getMediaMetadata(item) {
369
- return _ref.apply(this, arguments);
370
- };
371
- }();
372
- export var createReleaseJson = /*#__PURE__*/ function() {
373
- var _ref = _async_to_generator(function(param, publisherAddress) {
374
- var releaseDetails, appDetails, publisherDetails, media, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, item, _, err, files, _iteratorAbruptCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, _value1, item1, _1, err1, releaseIcon, imgUri, tmpMedia, _2, releaseMetadata, _iteratorNormalCompletion, _didIteratorError2, _iteratorError2, _iterator2, _step2, _step_value, locale, strings, _strings_saga_features;
360
+ })();
361
+ };
362
+ export var createReleaseJson = function(param, publisherAddress) {
363
+ var releaseDetails = param.releaseDetails, appDetails = param.appDetails, publisherDetails = param.publisherDetails;
364
+ return _async_to_generator(function() {
365
+ var media, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, item, _, err, files, _iteratorAbruptCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, _value1, item1, _1, err1, releaseIcon, imgUri, tmpMedia, _2, releaseMetadata, _iteratorNormalCompletion, _didIteratorError2, _iteratorError2, _iterator2, _step2, _step_value, locale, strings, _strings_saga_features;
375
366
  return _ts_generator(this, function(_state) {
376
367
  switch(_state.label){
377
368
  case 0:
378
- releaseDetails = param.releaseDetails, appDetails = param.appDetails, publisherDetails = param.publisherDetails;
379
369
  media = [];
380
370
  debug({
381
371
  media: releaseDetails.media
@@ -668,18 +658,15 @@ export var createReleaseJson = /*#__PURE__*/ function() {
668
658
  ];
669
659
  }
670
660
  });
671
- });
672
- return function createReleaseJson(_, publisherAddress) {
673
- return _ref.apply(this, arguments);
674
- };
675
- }();
676
- export var createRelease = /*#__PURE__*/ function() {
677
- var _ref = _async_to_generator(function(param, param1) {
678
- var appMintAddress, releaseMintAddress, releaseDetails, appDetails, publisherDetails, priorityFeeLamports, publisher, metaplex, releaseJson, suppressedJson, txBuilder;
661
+ })();
662
+ };
663
+ export var createRelease = function(param, param1) {
664
+ var appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, releaseDetails = param.releaseDetails, appDetails = param.appDetails, publisherDetails = param.publisherDetails, priorityFeeLamports = param.priorityFeeLamports, publisher = param1.publisher, metaplex = param1.metaplex;
665
+ return _async_to_generator(function() {
666
+ var releaseJson, suppressedJson, txBuilder;
679
667
  return _ts_generator(this, function(_state) {
680
668
  switch(_state.label){
681
669
  case 0:
682
- appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, releaseDetails = param.releaseDetails, appDetails = param.appDetails, publisherDetails = param.publisherDetails, priorityFeeLamports = param.priorityFeeLamports, publisher = param1.publisher, metaplex = param1.metaplex;
683
670
  return [
684
671
  4,
685
672
  createReleaseJson({
@@ -724,8 +711,5 @@ export var createRelease = /*#__PURE__*/ function() {
724
711
  ];
725
712
  }
726
713
  });
727
- });
728
- return function createRelease(_, _1) {
729
- return _ref.apply(this, arguments);
730
- };
731
- }();
714
+ })();
715
+ };
@@ -1,3 +1,2 @@
1
1
  export * from "./AppCore.js";
2
- export * from "./PublisherCore.js";
3
2
  export * from "./ReleaseCore.js";
@@ -28,7 +28,7 @@ function _async_to_generator(fn) {
28
28
  };
29
29
  }
30
30
  function _ts_generator(thisArg, body) {
31
- var f, y, t, g, _ = {
31
+ var f, y, t, _ = {
32
32
  label: 0,
33
33
  sent: function() {
34
34
  if (t[0] & 1) throw t[1];
@@ -36,12 +36,8 @@ function _ts_generator(thisArg, body) {
36
36
  },
37
37
  trys: [],
38
38
  ops: []
39
- };
40
- return g = {
41
- next: verb(0),
42
- "throw": verb(1),
43
- "return": verb(2)
44
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
39
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
40
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
45
41
  return this;
46
42
  }), g;
47
43
  function verb(n) {
@@ -54,7 +50,7 @@ function _ts_generator(thisArg, body) {
54
50
  }
55
51
  function step(op) {
56
52
  if (f) throw new TypeError("Generator is already executing.");
57
- while(_)try {
53
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
58
54
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
59
55
  if (y = 0, t) op = [
60
56
  op[0] & 2,
@@ -122,8 +118,8 @@ function _ts_generator(thisArg, body) {
122
118
  };
123
119
  }
124
120
  }
125
- export var createAttestationPayload = /*#__PURE__*/ function() {
126
- var _ref = _async_to_generator(function(connection, sign) {
121
+ export var createAttestationPayload = function(connection, sign) {
122
+ return _async_to_generator(function() {
127
123
  var REQUEST_UNIQUE_ID_LEN, REQUEST_UNIQUE_ID_CHAR_SET, requestUniqueId, blockhash, attestation, signedAttestation;
128
124
  return _ts_generator(this, function(_state) {
129
125
  switch(_state.label){
@@ -154,8 +150,5 @@ export var createAttestationPayload = /*#__PURE__*/ function() {
154
150
  ];
155
151
  }
156
152
  });
157
- });
158
- return function createAttestationPayload(connection, sign) {
159
- return _ref.apply(this, arguments);
160
- };
161
- }();
153
+ })();
154
+ };
@@ -28,7 +28,7 @@ function _async_to_generator(fn) {
28
28
  };
29
29
  }
30
30
  function _ts_generator(thisArg, body) {
31
- var f, y, t, g, _ = {
31
+ var f, y, t, _ = {
32
32
  label: 0,
33
33
  sent: function() {
34
34
  if (t[0] & 1) throw t[1];
@@ -36,12 +36,8 @@ function _ts_generator(thisArg, body) {
36
36
  },
37
37
  trys: [],
38
38
  ops: []
39
- };
40
- return g = {
41
- next: verb(0),
42
- "throw": verb(1),
43
- "return": verb(2)
44
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
39
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
40
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
45
41
  return this;
46
42
  }), g;
47
43
  function verb(n) {
@@ -54,7 +50,7 @@ function _ts_generator(thisArg, body) {
54
50
  }
55
51
  function step(op) {
56
52
  if (f) throw new TypeError("Generator is already executing.");
57
- while(_)try {
53
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
58
54
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
59
55
  if (y = 0, t) op = [
60
56
  op[0] & 2,
@@ -124,8 +120,8 @@ function _ts_generator(thisArg, body) {
124
120
  }
125
121
  import { createAttestationPayload } from "./PublishCoreAttestation.js";
126
122
  import { CONTACT_OBJECT_ID, CONTACT_PROPERTY_COMPANY, CONTACT_PROPERTY_EMAIL, CONTACT_PROPERTY_WEBSITE, submitRequestToSolanaDappPublisherPortal, TICKET_OBJECT_ID, TICKET_PROPERTY_ATTESTATION_PAYLOAD, TICKET_PROPERTY_AUTHORIZED_REQUEST, TICKET_PROPERTY_CRITICAL_UPDATE, TICKET_PROPERTY_DAPP_COLLECTION_ACCOUNT_ADDRESS, TICKET_PROPERTY_DAPP_RELEASE_ACCOUNT_ADDRESS, TICKET_PROPERTY_REQUEST_UNIQUE_ID, URL_FORM_REMOVE } from "./dapp_publisher_portal.js";
127
- var createRemoveRequest = /*#__PURE__*/ function() {
128
- var _ref = _async_to_generator(function(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, requestorIsAuthorized, criticalUpdate) {
123
+ var createRemoveRequest = function(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, requestorIsAuthorized, criticalUpdate) {
124
+ return _async_to_generator(function() {
129
125
  var _ref, attestationPayload, requestUniqueId, request;
130
126
  return _ts_generator(this, function(_state) {
131
127
  switch(_state.label){
@@ -193,18 +189,15 @@ var createRemoveRequest = /*#__PURE__*/ function() {
193
189
  ];
194
190
  }
195
191
  });
196
- });
197
- return function createRemoveRequest(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, requestorIsAuthorized, criticalUpdate) {
198
- return _ref.apply(this, arguments);
199
- };
200
- }();
201
- export var publishRemove = /*#__PURE__*/ function() {
202
- var _ref = _async_to_generator(function(publishSolanaNetworkInput, param, dryRun) {
203
- var appMintAddress, releaseMintAddress, publisherDetails, requestorIsAuthorized, criticalUpdate, removeRequest;
192
+ })();
193
+ };
194
+ export var publishRemove = function(publishSolanaNetworkInput, param, dryRun) {
195
+ var appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, publisherDetails = param.publisherDetails, requestorIsAuthorized = param.requestorIsAuthorized, criticalUpdate = param.criticalUpdate;
196
+ return _async_to_generator(function() {
197
+ var removeRequest;
204
198
  return _ts_generator(this, function(_state) {
205
199
  switch(_state.label){
206
200
  case 0:
207
- appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, publisherDetails = param.publisherDetails, requestorIsAuthorized = param.requestorIsAuthorized, criticalUpdate = param.criticalUpdate;
208
201
  return [
209
202
  4,
210
203
  createRemoveRequest(publishSolanaNetworkInput.connection, publishSolanaNetworkInput.sign, appMintAddress, releaseMintAddress, publisherDetails, requestorIsAuthorized, criticalUpdate)
@@ -217,8 +210,5 @@ export var publishRemove = /*#__PURE__*/ function() {
217
210
  ];
218
211
  }
219
212
  });
220
- });
221
- return function publishRemove(publishSolanaNetworkInput, _, dryRun) {
222
- return _ref.apply(this, arguments);
223
- };
224
- }();
213
+ })();
214
+ };
@@ -28,7 +28,7 @@ function _async_to_generator(fn) {
28
28
  };
29
29
  }
30
30
  function _ts_generator(thisArg, body) {
31
- var f, y, t, g, _ = {
31
+ var f, y, t, _ = {
32
32
  label: 0,
33
33
  sent: function() {
34
34
  if (t[0] & 1) throw t[1];
@@ -36,12 +36,8 @@ function _ts_generator(thisArg, body) {
36
36
  },
37
37
  trys: [],
38
38
  ops: []
39
- };
40
- return g = {
41
- next: verb(0),
42
- "throw": verb(1),
43
- "return": verb(2)
44
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
39
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
40
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
45
41
  return this;
46
42
  }), g;
47
43
  function verb(n) {
@@ -54,7 +50,7 @@ function _ts_generator(thisArg, body) {
54
50
  }
55
51
  function step(op) {
56
52
  if (f) throw new TypeError("Generator is already executing.");
57
- while(_)try {
53
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
58
54
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
59
55
  if (y = 0, t) op = [
60
56
  op[0] & 2,
@@ -124,8 +120,8 @@ function _ts_generator(thisArg, body) {
124
120
  }
125
121
  import { createAttestationPayload } from "./PublishCoreAttestation.js";
126
122
  import { CONTACT_OBJECT_ID, CONTACT_PROPERTY_COMPANY, CONTACT_PROPERTY_EMAIL, CONTACT_PROPERTY_WEBSITE, submitRequestToSolanaDappPublisherPortal, TICKET_OBJECT_ID, TICKET_PROPERTY_ALPHA_TEST, TICKET_PROPERTY_ALPHA_TESTERS, TICKET_PROPERTY_ATTESTATION_PAYLOAD, TICKET_PROPERTY_AUTHORIZED_REQUEST, TICKET_PROPERTY_DAPP_COLLECTION_ACCOUNT_ADDRESS, TICKET_PROPERTY_DAPP_RELEASE_ACCOUNT_ADDRESS, TICKET_PROPERTY_GOOGLE_PLAY_STORE_PACKAGE_NAME, TICKET_PROPERTY_POLICY_COMPLIANT, TICKET_PROPERTY_REQUEST_UNIQUE_ID, TICKET_PROPERTY_TESTING_INSTRUCTIONS, URL_FORM_SUBMIT } from "./dapp_publisher_portal.js";
127
- var createSubmitRequest = /*#__PURE__*/ function() {
128
- var _ref = _async_to_generator(function(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, alphaTest) {
123
+ var createSubmitRequest = function(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, alphaTest) {
124
+ return _async_to_generator(function() {
129
125
  var _ref, attestationPayload, requestUniqueId, request;
130
126
  return _ts_generator(this, function(_state) {
131
127
  switch(_state.label){
@@ -221,18 +217,15 @@ var createSubmitRequest = /*#__PURE__*/ function() {
221
217
  ];
222
218
  }
223
219
  });
224
- });
225
- return function createSubmitRequest(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, alphaTest) {
226
- return _ref.apply(this, arguments);
227
- };
228
- }();
229
- export var publishSubmit = /*#__PURE__*/ function() {
230
- var _ref = _async_to_generator(function(publishSolanaNetworkInput, param, dryRun) {
231
- var appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, alphaTest, submitRequest;
220
+ })();
221
+ };
222
+ export var publishSubmit = function(publishSolanaNetworkInput, param, dryRun) {
223
+ var appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, publisherDetails = param.publisherDetails, solanaMobileDappPublisherPortalDetails = param.solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies = param.compliesWithSolanaDappStorePolicies, requestorIsAuthorized = param.requestorIsAuthorized, alphaTest = param.alphaTest;
224
+ return _async_to_generator(function() {
225
+ var submitRequest;
232
226
  return _ts_generator(this, function(_state) {
233
227
  switch(_state.label){
234
228
  case 0:
235
- appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, publisherDetails = param.publisherDetails, solanaMobileDappPublisherPortalDetails = param.solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies = param.compliesWithSolanaDappStorePolicies, requestorIsAuthorized = param.requestorIsAuthorized, alphaTest = param.alphaTest;
236
229
  return [
237
230
  4,
238
231
  createSubmitRequest(publishSolanaNetworkInput.connection, publishSolanaNetworkInput.sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, alphaTest)
@@ -245,8 +238,5 @@ export var publishSubmit = /*#__PURE__*/ function() {
245
238
  ];
246
239
  }
247
240
  });
248
- });
249
- return function publishSubmit(publishSolanaNetworkInput, _, dryRun) {
250
- return _ref.apply(this, arguments);
251
- };
252
- }();
241
+ })();
242
+ };
@@ -28,7 +28,7 @@ function _async_to_generator(fn) {
28
28
  };
29
29
  }
30
30
  function _ts_generator(thisArg, body) {
31
- var f, y, t, g, _ = {
31
+ var f, y, t, _ = {
32
32
  label: 0,
33
33
  sent: function() {
34
34
  if (t[0] & 1) throw t[1];
@@ -36,12 +36,8 @@ function _ts_generator(thisArg, body) {
36
36
  },
37
37
  trys: [],
38
38
  ops: []
39
- };
40
- return g = {
41
- next: verb(0),
42
- "throw": verb(1),
43
- "return": verb(2)
44
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
39
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
40
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
45
41
  return this;
46
42
  }), g;
47
43
  function verb(n) {
@@ -54,7 +50,7 @@ function _ts_generator(thisArg, body) {
54
50
  }
55
51
  function step(op) {
56
52
  if (f) throw new TypeError("Generator is already executing.");
57
- while(_)try {
53
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
58
54
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
59
55
  if (y = 0, t) op = [
60
56
  op[0] & 2,
@@ -124,8 +120,8 @@ function _ts_generator(thisArg, body) {
124
120
  }
125
121
  import { createAttestationPayload } from "./PublishCoreAttestation.js";
126
122
  import { CONTACT_OBJECT_ID, CONTACT_PROPERTY_COMPANY, CONTACT_PROPERTY_EMAIL, CONTACT_PROPERTY_WEBSITE, submitRequestToSolanaDappPublisherPortal, TICKET_OBJECT_ID, TICKET_PROPERTY_ATTESTATION_PAYLOAD, TICKET_PROPERTY_AUTHORIZED_REQUEST, TICKET_PROPERTY_CONTENT, TICKET_PROPERTY_DAPP_COLLECTION_ACCOUNT_ADDRESS, TICKET_PROPERTY_DAPP_RELEASE_ACCOUNT_ADDRESS, TICKET_PROPERTY_REQUEST_UNIQUE_ID, URL_FORM_SUPPORT } from "./dapp_publisher_portal.js";
127
- var createSupportRequest = /*#__PURE__*/ function() {
128
- var _ref = _async_to_generator(function(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, requestorIsAuthorized, requestDetails) {
123
+ var createSupportRequest = function(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, requestorIsAuthorized, requestDetails) {
124
+ return _async_to_generator(function() {
129
125
  var _ref, attestationPayload, requestUniqueId;
130
126
  return _ts_generator(this, function(_state) {
131
127
  switch(_state.label){
@@ -190,18 +186,15 @@ var createSupportRequest = /*#__PURE__*/ function() {
190
186
  ];
191
187
  }
192
188
  });
193
- });
194
- return function createSupportRequest(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, requestorIsAuthorized, requestDetails) {
195
- return _ref.apply(this, arguments);
196
- };
197
- }();
198
- export var publishSupport = /*#__PURE__*/ function() {
199
- var _ref = _async_to_generator(function(publishSolanaNetworkInput, param, dryRun) {
200
- var appMintAddress, releaseMintAddress, publisherDetails, requestorIsAuthorized, requestDetails, supportRequest;
189
+ })();
190
+ };
191
+ export var publishSupport = function(publishSolanaNetworkInput, param, dryRun) {
192
+ var appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, publisherDetails = param.publisherDetails, requestorIsAuthorized = param.requestorIsAuthorized, requestDetails = param.requestDetails;
193
+ return _async_to_generator(function() {
194
+ var supportRequest;
201
195
  return _ts_generator(this, function(_state) {
202
196
  switch(_state.label){
203
197
  case 0:
204
- appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, publisherDetails = param.publisherDetails, requestorIsAuthorized = param.requestorIsAuthorized, requestDetails = param.requestDetails;
205
198
  return [
206
199
  4,
207
200
  createSupportRequest(publishSolanaNetworkInput.connection, publishSolanaNetworkInput.sign, appMintAddress, releaseMintAddress, publisherDetails, requestorIsAuthorized, requestDetails)
@@ -214,8 +207,5 @@ export var publishSupport = /*#__PURE__*/ function() {
214
207
  ];
215
208
  }
216
209
  });
217
- });
218
- return function publishSupport(publishSolanaNetworkInput, _, dryRun) {
219
- return _ref.apply(this, arguments);
220
- };
221
- }();
210
+ })();
211
+ };
@@ -28,7 +28,7 @@ function _async_to_generator(fn) {
28
28
  };
29
29
  }
30
30
  function _ts_generator(thisArg, body) {
31
- var f, y, t, g, _ = {
31
+ var f, y, t, _ = {
32
32
  label: 0,
33
33
  sent: function() {
34
34
  if (t[0] & 1) throw t[1];
@@ -36,12 +36,8 @@ function _ts_generator(thisArg, body) {
36
36
  },
37
37
  trys: [],
38
38
  ops: []
39
- };
40
- return g = {
41
- next: verb(0),
42
- "throw": verb(1),
43
- "return": verb(2)
44
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
39
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
40
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
45
41
  return this;
46
42
  }), g;
47
43
  function verb(n) {
@@ -54,7 +50,7 @@ function _ts_generator(thisArg, body) {
54
50
  }
55
51
  function step(op) {
56
52
  if (f) throw new TypeError("Generator is already executing.");
57
- while(_)try {
53
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
58
54
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
59
55
  if (y = 0, t) op = [
60
56
  op[0] & 2,
@@ -124,8 +120,8 @@ function _ts_generator(thisArg, body) {
124
120
  }
125
121
  import { createAttestationPayload } from "./PublishCoreAttestation.js";
126
122
  import { CONTACT_OBJECT_ID, CONTACT_PROPERTY_COMPANY, CONTACT_PROPERTY_EMAIL, CONTACT_PROPERTY_WEBSITE, submitRequestToSolanaDappPublisherPortal, TICKET_OBJECT_ID, TICKET_PROPERTY_ALPHA_TEST, TICKET_PROPERTY_ALPHA_TESTERS, TICKET_PROPERTY_ATTESTATION_PAYLOAD, TICKET_PROPERTY_AUTHORIZED_REQUEST, TICKET_PROPERTY_CRITICAL_UPDATE, TICKET_PROPERTY_DAPP_COLLECTION_ACCOUNT_ADDRESS, TICKET_PROPERTY_DAPP_RELEASE_ACCOUNT_ADDRESS, TICKET_PROPERTY_POLICY_COMPLIANT, TICKET_PROPERTY_REQUEST_UNIQUE_ID, TICKET_PROPERTY_TESTING_INSTRUCTIONS, URL_FORM_UPDATE } from "./dapp_publisher_portal.js";
127
- var createUpdateRequest = /*#__PURE__*/ function() {
128
- var _ref = _async_to_generator(function(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, criticalUpdate, alphaTest) {
123
+ var createUpdateRequest = function(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, criticalUpdate, alphaTest) {
124
+ return _async_to_generator(function() {
129
125
  var _ref, attestationPayload, requestUniqueId, request;
130
126
  return _ts_generator(this, function(_state) {
131
127
  switch(_state.label){
@@ -221,18 +217,15 @@ var createUpdateRequest = /*#__PURE__*/ function() {
221
217
  ];
222
218
  }
223
219
  });
224
- });
225
- return function createUpdateRequest(connection, sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, criticalUpdate, alphaTest) {
226
- return _ref.apply(this, arguments);
227
- };
228
- }();
229
- export var publishUpdate = /*#__PURE__*/ function() {
230
- var _ref = _async_to_generator(function(publishSolanaNetworkInput, param, dryRun) {
231
- var appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, criticalUpdate, alphaTest, updateRequest;
220
+ })();
221
+ };
222
+ export var publishUpdate = function(publishSolanaNetworkInput, param, dryRun) {
223
+ var appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, publisherDetails = param.publisherDetails, solanaMobileDappPublisherPortalDetails = param.solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies = param.compliesWithSolanaDappStorePolicies, requestorIsAuthorized = param.requestorIsAuthorized, criticalUpdate = param.criticalUpdate, alphaTest = param.alphaTest;
224
+ return _async_to_generator(function() {
225
+ var updateRequest;
232
226
  return _ts_generator(this, function(_state) {
233
227
  switch(_state.label){
234
228
  case 0:
235
- appMintAddress = param.appMintAddress, releaseMintAddress = param.releaseMintAddress, publisherDetails = param.publisherDetails, solanaMobileDappPublisherPortalDetails = param.solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies = param.compliesWithSolanaDappStorePolicies, requestorIsAuthorized = param.requestorIsAuthorized, criticalUpdate = param.criticalUpdate, alphaTest = param.alphaTest;
236
229
  return [
237
230
  4,
238
231
  createUpdateRequest(publishSolanaNetworkInput.connection, publishSolanaNetworkInput.sign, appMintAddress, releaseMintAddress, publisherDetails, solanaMobileDappPublisherPortalDetails, compliesWithSolanaDappStorePolicies, requestorIsAuthorized, criticalUpdate, alphaTest)
@@ -245,8 +238,5 @@ export var publishUpdate = /*#__PURE__*/ function() {
245
238
  ];
246
239
  }
247
240
  });
248
- });
249
- return function publishUpdate(publishSolanaNetworkInput, _, dryRun) {
250
- return _ref.apply(this, arguments);
251
- };
252
- }();
241
+ })();
242
+ };
@@ -28,7 +28,7 @@ function _async_to_generator(fn) {
28
28
  };
29
29
  }
30
30
  function _ts_generator(thisArg, body) {
31
- var f, y, t, g, _ = {
31
+ var f, y, t, _ = {
32
32
  label: 0,
33
33
  sent: function() {
34
34
  if (t[0] & 1) throw t[1];
@@ -36,12 +36,8 @@ function _ts_generator(thisArg, body) {
36
36
  },
37
37
  trys: [],
38
38
  ops: []
39
- };
40
- return g = {
41
- next: verb(0),
42
- "throw": verb(1),
43
- "return": verb(2)
44
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
39
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
40
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
45
41
  return this;
46
42
  }), g;
47
43
  function verb(n) {
@@ -54,7 +50,7 @@ function _ts_generator(thisArg, body) {
54
50
  }
55
51
  function step(op) {
56
52
  if (f) throw new TypeError("Generator is already executing.");
57
- while(_)try {
53
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
58
54
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
59
55
  if (y = 0, t) op = [
60
56
  op[0] & 2,
@@ -149,8 +145,8 @@ export var URL_FORM_SUBMIT = "https://api.hsforms.com/submissions/v3/integration
149
145
  export var URL_FORM_UPDATE = "https://api.hsforms.com/submissions/v3/integration/submit/".concat(PORTAL_ID, "/").concat(FORM_UPDATE);
150
146
  export var URL_FORM_REMOVE = "https://api.hsforms.com/submissions/v3/integration/submit/".concat(PORTAL_ID, "/").concat(FORM_REMOVE);
151
147
  export var URL_FORM_SUPPORT = "https://api.hsforms.com/submissions/v3/integration/submit/".concat(PORTAL_ID, "/").concat(FORM_SUPPORT);
152
- export var submitRequestToSolanaDappPublisherPortal = /*#__PURE__*/ function() {
153
- var _ref = _async_to_generator(function(request, url, dryRun) {
148
+ export var submitRequestToSolanaDappPublisherPortal = function(request, url, dryRun) {
149
+ return _async_to_generator(function() {
154
150
  var config;
155
151
  return _ts_generator(this, function(_state) {
156
152
  switch(_state.label){
@@ -206,8 +202,5 @@ export var submitRequestToSolanaDappPublisherPortal = /*#__PURE__*/ function() {
206
202
  ];
207
203
  }
208
204
  });
209
- });
210
- return function submitRequestToSolanaDappPublisherPortal(request, url, dryRun) {
211
- return _ref.apply(this, arguments);
212
- };
213
- }();
205
+ })();
206
+ };
@@ -8,35 +8,6 @@
8
8
  "type": "string",
9
9
  "maxLength": 32
10
10
  },
11
- "image": {
12
- "type": "string"
13
- },
14
- "properties": {
15
- "type": "object",
16
- "properties": {
17
- "category": {
18
- "type": "string"
19
- },
20
- "creators": {
21
- "type": "array",
22
- "items": {
23
- "type": "object",
24
- "properties": {
25
- "address": {
26
- "type": "string"
27
- }
28
- },
29
- "required": [
30
- "address"
31
- ]
32
- }
33
- }
34
- },
35
- "required": [
36
- "category",
37
- "creators"
38
- ]
39
- },
40
11
  "extensions": {
41
12
  "type": "object",
42
13
  "properties": {
@@ -78,8 +49,6 @@
78
49
  "required": [
79
50
  "schema_version",
80
51
  "name",
81
- "image",
82
- "properties",
83
52
  "extensions"
84
53
  ]
85
54
  }
@@ -28,7 +28,6 @@ function _object_spread(target) {
28
28
  }
29
29
  import Ajv from "ajv";
30
30
  import { readFile } from 'fs/promises';
31
- var publisherSchema = JSON.parse((await readFile(new URL("../schemas/publisherJsonMetadata.json", import.meta.url))).toString());
32
31
  var appSchema = JSON.parse((await readFile(new URL("../schemas/appJsonMetadata.json", import.meta.url))).toString());
33
32
  var releaseSchema = JSON.parse((await readFile(new URL("../schemas/releaseJsonMetadata.json", import.meta.url))).toString());
34
33
  import { isMetaplexFile } from "@metaplex-foundation/js";
@@ -38,23 +37,6 @@ export var metaplexFileReplacer = function(k, v) {
38
37
  }
39
38
  return v;
40
39
  };
41
- export var validatePublisher = function(publisherJson) {
42
- var jsonToValidate = _object_spread({}, publisherJson);
43
- if (typeof jsonToValidate.image !== "string") {
44
- var _jsonToValidate_image;
45
- jsonToValidate.image = (_jsonToValidate_image = jsonToValidate.image) === null || _jsonToValidate_image === void 0 ? void 0 : _jsonToValidate_image.fileName;
46
- }
47
- var ajv = new Ajv({
48
- strictTuples: false
49
- });
50
- var validate = ajv.compile(publisherSchema);
51
- var valid = validate(jsonToValidate);
52
- if (!valid) {
53
- console.error(validate.errors);
54
- throw new Error("Publisher JSON not valid");
55
- }
56
- return valid;
57
- };
58
40
  export var validateApp = function(appJson) {
59
41
  var jsonToValidate = _object_spread({}, appJson);
60
42
  if (typeof jsonToValidate.image !== "string") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana-mobile/dapp-store-publishing-tools",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -1,3 +1,2 @@
1
1
  export * from "./AppCore.js";
2
- export * from "./PublisherCore.js";
3
2
  export * from "./ReleaseCore.js";
@@ -8,15 +8,6 @@
8
8
  export interface PublisherJsonMetadata {
9
9
  schema_version: string;
10
10
  name: string;
11
- image: string;
12
- properties: {
13
- category: string;
14
- creators: {
15
- address: string;
16
- [k: string]: unknown;
17
- }[];
18
- [k: string]: unknown;
19
- };
20
11
  extensions: {
21
12
  solana_dapp_store: {
22
13
  publisher_details: {
@@ -8,35 +8,6 @@
8
8
  "type": "string",
9
9
  "maxLength": 32
10
10
  },
11
- "image": {
12
- "type": "string"
13
- },
14
- "properties": {
15
- "type": "object",
16
- "properties": {
17
- "category": {
18
- "type": "string"
19
- },
20
- "creators": {
21
- "type": "array",
22
- "items": {
23
- "type": "object",
24
- "properties": {
25
- "address": {
26
- "type": "string"
27
- }
28
- },
29
- "required": [
30
- "address"
31
- ]
32
- }
33
- }
34
- },
35
- "required": [
36
- "category",
37
- "creators"
38
- ]
39
- },
40
11
  "extensions": {
41
12
  "type": "object",
42
13
  "properties": {
@@ -78,8 +49,6 @@
78
49
  "required": [
79
50
  "schema_version",
80
51
  "name",
81
- "image",
82
- "properties",
83
52
  "extensions"
84
53
  ]
85
54
  }
package/src/types.ts CHANGED
@@ -8,9 +8,7 @@ import type {
8
8
 
9
9
  export type { ReleaseJsonMetadata } from "./generated";
10
10
 
11
- export type PublisherMetadata = Omit<PublisherJsonMetadata, "image"> & {
12
- image: string | MetaplexFile;
13
- };
11
+ export type PublisherMetadata = PublisherJsonMetadata;
14
12
 
15
13
  export type AppMetadata = Omit<AppJsonMetadata, "image"> & {
16
14
  image: string | MetaplexFile;
@@ -35,18 +33,16 @@ export type AndroidDetails = {
35
33
  android_package: string;
36
34
  min_sdk: number;
37
35
  version_code: number;
36
+ cert_fingerprint: string;
38
37
  version: string;
39
38
  permissions: string[];
40
39
  locales: string[];
41
40
  };
42
41
 
43
42
  export type Publisher = {
44
- address: string;
45
43
  name: string;
46
- icon?: string | MetaplexFile;
47
44
  website: string;
48
45
  email: string;
49
- media: ReleaseJsonMetadata["extensions"]["solana_dapp_store"]["media"];
50
46
  };
51
47
 
52
48
  export type App = {
@@ -3,11 +3,9 @@ import Ajv from "ajv";
3
3
  import type {
4
4
  AppMetadata,
5
5
  MetaplexFileReleaseJsonMetadata,
6
- PublisherMetadata,
7
6
  } from "../types.js";
8
7
 
9
8
  import { readFile } from 'fs/promises';
10
- const publisherSchema = JSON.parse((await readFile(new URL("../schemas/publisherJsonMetadata.json", import.meta.url))).toString());
11
9
  const appSchema = JSON.parse((await readFile(new URL("../schemas/appJsonMetadata.json", import.meta.url))).toString());
12
10
  const releaseSchema = JSON.parse((await readFile(new URL("../schemas/releaseJsonMetadata.json", import.meta.url))).toString());
13
11
  import { isMetaplexFile } from "@metaplex-foundation/js";
@@ -19,23 +17,6 @@ export const metaplexFileReplacer = (k: any, v: any) => {
19
17
  return v;
20
18
  };
21
19
 
22
- export const validatePublisher = (publisherJson: PublisherMetadata) => {
23
- const jsonToValidate = { ...publisherJson };
24
- if (typeof jsonToValidate.image !== "string") {
25
- jsonToValidate.image = jsonToValidate.image?.fileName;
26
- }
27
-
28
- const ajv = new Ajv({ strictTuples: false });
29
- const validate = ajv.compile(publisherSchema);
30
-
31
- const valid = validate(jsonToValidate);
32
- if (!valid) {
33
- console.error(validate.errors);
34
- throw new Error("Publisher JSON not valid");
35
- }
36
- return valid;
37
- };
38
-
39
20
  export const validateApp = (appJson: AppMetadata) => {
40
21
  const jsonToValidate = { ...appJson };
41
22
  if (typeof jsonToValidate.image !== "string") {
@@ -1,185 +0,0 @@
1
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
2
- try {
3
- var info = gen[key](arg);
4
- var value = info.value;
5
- } catch (error) {
6
- reject(error);
7
- return;
8
- }
9
- if (info.done) {
10
- resolve(value);
11
- } else {
12
- Promise.resolve(value).then(_next, _throw);
13
- }
14
- }
15
- function _async_to_generator(fn) {
16
- return function() {
17
- var self = this, args = arguments;
18
- return new Promise(function(resolve, reject) {
19
- var gen = fn.apply(self, args);
20
- function _next(value) {
21
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
22
- }
23
- function _throw(err) {
24
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
25
- }
26
- _next(undefined);
27
- });
28
- };
29
- }
30
- function _ts_generator(thisArg, body) {
31
- var f, y, t, g, _ = {
32
- label: 0,
33
- sent: function() {
34
- if (t[0] & 1) throw t[1];
35
- return t[1];
36
- },
37
- trys: [],
38
- ops: []
39
- };
40
- return g = {
41
- next: verb(0),
42
- "throw": verb(1),
43
- "return": verb(2)
44
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
45
- return this;
46
- }), g;
47
- function verb(n) {
48
- return function(v) {
49
- return step([
50
- n,
51
- v
52
- ]);
53
- };
54
- }
55
- function step(op) {
56
- if (f) throw new TypeError("Generator is already executing.");
57
- while(_)try {
58
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
59
- if (y = 0, t) op = [
60
- op[0] & 2,
61
- t.value
62
- ];
63
- switch(op[0]){
64
- case 0:
65
- case 1:
66
- t = op;
67
- break;
68
- case 4:
69
- _.label++;
70
- return {
71
- value: op[1],
72
- done: false
73
- };
74
- case 5:
75
- _.label++;
76
- y = op[1];
77
- op = [
78
- 0
79
- ];
80
- continue;
81
- case 7:
82
- op = _.ops.pop();
83
- _.trys.pop();
84
- continue;
85
- default:
86
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
87
- _ = 0;
88
- continue;
89
- }
90
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
91
- _.label = op[1];
92
- break;
93
- }
94
- if (op[0] === 6 && _.label < t[1]) {
95
- _.label = t[1];
96
- t = op;
97
- break;
98
- }
99
- if (t && _.label < t[2]) {
100
- _.label = t[2];
101
- _.ops.push(op);
102
- break;
103
- }
104
- if (t[2]) _.ops.pop();
105
- _.trys.pop();
106
- continue;
107
- }
108
- op = body.call(thisArg, _);
109
- } catch (e) {
110
- op = [
111
- 6,
112
- e
113
- ];
114
- y = 0;
115
- } finally{
116
- f = t = 0;
117
- }
118
- if (op[0] & 5) throw op[1];
119
- return {
120
- value: op[0] ? op[1] : void 0,
121
- done: true
122
- };
123
- }
124
- }
125
- import debugModule from "debug";
126
- import { validatePublisher } from "../validate/CoreValidation.js";
127
- import { Constants, mintNft } from "../CoreUtils.js";
128
- var debug = debugModule("PUBLISHER");
129
- export var createPublisherJson = function(publisher) {
130
- var publisherMetadata = {
131
- schema_version: Constants.PUBLISHING_SCHEMA_VER,
132
- name: publisher.name,
133
- image: publisher.icon,
134
- external_url: publisher.website,
135
- properties: {
136
- category: "dApp",
137
- creators: [
138
- {
139
- address: publisher.address,
140
- share: 100
141
- }
142
- ]
143
- },
144
- extensions: {
145
- solana_dapp_store: {
146
- publisher_details: {
147
- name: publisher.name,
148
- website: publisher.website,
149
- contact: publisher.email
150
- }
151
- }
152
- }
153
- };
154
- return publisherMetadata;
155
- };
156
- export var createPublisher = /*#__PURE__*/ function() {
157
- var _ref = _async_to_generator(function(param, param1) {
158
- var mintAddress, publisherDetails, priorityFeeLamports, metaplex, publisherJson, txBuilder;
159
- return _ts_generator(this, function(_state) {
160
- switch(_state.label){
161
- case 0:
162
- mintAddress = param.mintAddress, publisherDetails = param.publisherDetails, priorityFeeLamports = param.priorityFeeLamports, metaplex = param1.metaplex;
163
- publisherJson = createPublisherJson(publisherDetails);
164
- validatePublisher(publisherJson);
165
- return [
166
- 4,
167
- mintNft(metaplex, publisherJson, {
168
- isCollection: true,
169
- isMutable: true,
170
- useNewMint: mintAddress
171
- }, priorityFeeLamports)
172
- ];
173
- case 1:
174
- txBuilder = _state.sent();
175
- return [
176
- 2,
177
- txBuilder
178
- ];
179
- }
180
- });
181
- });
182
- return function createPublisher(_, _1) {
183
- return _ref.apply(this, arguments);
184
- };
185
- }();
@@ -1,67 +0,0 @@
1
- import type { TransactionBuilder } from "@metaplex-foundation/js";
2
- import debugModule from "debug";
3
- import type { Signer } from "@solana/web3.js";
4
-
5
- import { validatePublisher } from "../validate/CoreValidation.js";
6
- import { Constants, mintNft } from "../CoreUtils.js";
7
- import type { Context, Publisher, PublisherMetadata } from "../types.js";
8
-
9
- const debug = debugModule("PUBLISHER");
10
-
11
- export const createPublisherJson = (
12
- publisher: Publisher
13
- ): PublisherMetadata => {
14
- const publisherMetadata = {
15
- schema_version: Constants.PUBLISHING_SCHEMA_VER,
16
- name: publisher.name,
17
- image: publisher.icon!,
18
- external_url: publisher.website,
19
- properties: {
20
- category: "dApp",
21
- creators: [
22
- {
23
- address: publisher.address,
24
- share: 100,
25
- },
26
- ],
27
- },
28
- extensions: {
29
- solana_dapp_store: {
30
- publisher_details: {
31
- name: publisher.name,
32
- website: publisher.website,
33
- contact: publisher.email,
34
- },
35
- },
36
- },
37
- };
38
-
39
- return publisherMetadata;
40
- };
41
-
42
- type CreatePublisherInput = {
43
- mintAddress: Signer;
44
- publisherDetails: Publisher;
45
- priorityFeeLamports: number;
46
- };
47
-
48
- export const createPublisher = async (
49
- { mintAddress, publisherDetails, priorityFeeLamports }: CreatePublisherInput,
50
- { metaplex }: Context
51
- ): Promise<TransactionBuilder> => {
52
- const publisherJson = createPublisherJson(publisherDetails);
53
- validatePublisher(publisherJson);
54
-
55
- const txBuilder = await mintNft(
56
- metaplex,
57
- publisherJson,
58
- {
59
- isCollection: true,
60
- isMutable: true,
61
- useNewMint: mintAddress,
62
- },
63
- priorityFeeLamports
64
- );
65
-
66
- return txBuilder;
67
- };