@solana-mobile/dapp-store-cli 0.9.2 → 0.9.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/bin/dapp-store.js +1 -1
- package/lib/CliUtils.js +19 -10
- package/lib/commands/scaffolding/ScaffoldInit.js +2 -4
- package/lib/config/PublishDetails.js +2 -3
- package/lib/package.json +2 -2
- package/package.json +2 -2
- package/src/CliUtils.ts +24 -8
- package/src/commands/scaffolding/ScaffoldInit.ts +2 -2
- package/src/config/PublishDetails.ts +2 -1
package/bin/dapp-store.js
CHANGED
package/lib/CliUtils.js
CHANGED
|
@@ -145,9 +145,8 @@ import { Keypair, PublicKey } from "@solana/web3.js";
|
|
|
145
145
|
import debugModule from "debug";
|
|
146
146
|
import { IrysStorageDriver, keypairIdentity, Metaplex } from "@metaplex-foundation/js";
|
|
147
147
|
import updateNotifier from "update-notifier";
|
|
148
|
-
import
|
|
149
|
-
|
|
150
|
-
};
|
|
148
|
+
import { readFile } from "fs/promises";
|
|
149
|
+
var cliPackage = JSON.parse((await readFile(new URL("./package.json", import.meta.url))).toString());
|
|
151
150
|
import boxen from "boxen";
|
|
152
151
|
import ver from "semver";
|
|
153
152
|
import { CachedStorageDriver } from "./upload/CachedStorageDriver.js";
|
|
@@ -159,7 +158,7 @@ export var Constants = function Constants() {
|
|
|
159
158
|
"use strict";
|
|
160
159
|
_class_call_check(this, Constants);
|
|
161
160
|
};
|
|
162
|
-
_define_property(Constants, "CLI_VERSION", "0.9.
|
|
161
|
+
_define_property(Constants, "CLI_VERSION", "0.9.3");
|
|
163
162
|
_define_property(Constants, "CONFIG_FILE_NAME", "config.yaml");
|
|
164
163
|
_define_property(Constants, "DEFAULT_RPC_DEVNET", "https://api.devnet.solana.com");
|
|
165
164
|
_define_property(Constants, "DEFAULT_PRIORITY_FEE", 500000);
|
|
@@ -199,7 +198,7 @@ export var checkForSelfUpdate = function() {
|
|
|
199
198
|
}();
|
|
200
199
|
export var checkMintedStatus = function() {
|
|
201
200
|
var _ref = _async_to_generator(function(conn, pubAddr, appAddr, releaseAddr) {
|
|
202
|
-
var results,
|
|
201
|
+
var _results_, _results_1, _results_2, results, isPublisherMinted, isAppMinted, isReleaseMinted, errorMessage;
|
|
203
202
|
return _ts_generator(this, function(_state) {
|
|
204
203
|
switch(_state.label){
|
|
205
204
|
case 0:
|
|
@@ -213,11 +212,21 @@ export var checkMintedStatus = function() {
|
|
|
213
212
|
];
|
|
214
213
|
case 1:
|
|
215
214
|
results = _state.sent();
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
if (
|
|
220
|
-
|
|
215
|
+
isPublisherMinted = results[0] != undefined && ((_results_ = results[0]) === null || _results_ === void 0 ? void 0 : _results_.lamports) > 0;
|
|
216
|
+
isAppMinted = results[1] != undefined && ((_results_1 = results[1]) === null || _results_1 === void 0 ? void 0 : _results_1.lamports) > 0;
|
|
217
|
+
isReleaseMinted = results[2] != undefined && ((_results_2 = results[2]) === null || _results_2 === void 0 ? void 0 : _results_2.lamports) > 0;
|
|
218
|
+
if (!isPublisherMinted || !isAppMinted || !isReleaseMinted) {
|
|
219
|
+
errorMessage = "";
|
|
220
|
+
if (!isPublisherMinted) {
|
|
221
|
+
errorMessage = errorMessage + "Publisher NFT fetch at address ".concat(pubAddr, " failed.\n");
|
|
222
|
+
}
|
|
223
|
+
if (!isAppMinted) {
|
|
224
|
+
errorMessage = errorMessage + "App NFT fetch at address ".concat(appAddr, " failed.\n");
|
|
225
|
+
}
|
|
226
|
+
if (!isReleaseMinted) {
|
|
227
|
+
errorMessage = errorMessage + "Release NFT fetch at address ".concat(releaseAddr, " failed.\n");
|
|
228
|
+
}
|
|
229
|
+
throw new Error("Expected Publisher :: ".concat(pubAddr, ", App :: ").concat(appAddr, " and Release :: ").concat(releaseAddr, " to be minted before submission.\n\n but ").concat(errorMessage, "\n\n Please ensure you have minted all of your NFTs before submitting to the Solana Mobile dApp publisher portal."));
|
|
221
230
|
}
|
|
222
231
|
return [
|
|
223
232
|
2
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { dump } from "js-yaml";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type: "json"
|
|
5
|
-
};
|
|
2
|
+
import { readFile } from "fs/promises";
|
|
3
|
+
var releaseSchema = JSON.parse((await readFile(new URL("../../generated/config_obj.json", import.meta.url))).toString());
|
|
6
4
|
import fs from "fs";
|
|
7
5
|
import { Constants } from "../../CliUtils.js";
|
|
8
6
|
export var initScaffold = function() {
|
|
@@ -209,9 +209,8 @@ function _ts_generator(thisArg, body) {
|
|
|
209
209
|
import { dump, load } from "js-yaml";
|
|
210
210
|
import Ajv from "ajv";
|
|
211
211
|
// eslint-disable-next-line require-extensions/require-extensions
|
|
212
|
-
import
|
|
213
|
-
|
|
214
|
-
};
|
|
212
|
+
import { readFile } from "fs/promises";
|
|
213
|
+
var schemaJson = JSON.parse((await readFile(new URL("../generated/config_schema.json", import.meta.url))).toString());
|
|
215
214
|
import fs from "fs";
|
|
216
215
|
import path from "path";
|
|
217
216
|
import { toMetaplexFile } from "@metaplex-foundation/js";
|
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana-mobile/dapp-store-cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.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.20.0",
|
|
56
|
-
"@solana-mobile/dapp-store-publishing-tools": "workspace:0.9.
|
|
56
|
+
"@solana-mobile/dapp-store-publishing-tools": "workspace:0.9.3",
|
|
57
57
|
"@solana/web3.js": "1.92.1",
|
|
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.9.
|
|
3
|
+
"version": "0.9.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.20.0",
|
|
49
|
-
"@solana-mobile/dapp-store-publishing-tools": "0.9.
|
|
49
|
+
"@solana-mobile/dapp-store-publishing-tools": "0.9.3",
|
|
50
50
|
"@solana/web3.js": "1.92.1",
|
|
51
51
|
"@types/semver": "^7.3.13",
|
|
52
52
|
"ajv": "^8.11.0",
|
package/src/CliUtils.ts
CHANGED
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
Metaplex,
|
|
9
9
|
} from "@metaplex-foundation/js";
|
|
10
10
|
import updateNotifier from "update-notifier";
|
|
11
|
-
import
|
|
11
|
+
import { readFile } from 'fs/promises';
|
|
12
|
+
const cliPackage = JSON.parse((await readFile(new URL("./package.json", import.meta.url))).toString());
|
|
12
13
|
import boxen from "boxen";
|
|
13
14
|
import ver from "semver";
|
|
14
15
|
import { CachedStorageDriver } from "./upload/CachedStorageDriver.js";
|
|
@@ -18,7 +19,7 @@ import { awsStorage } from "@metaplex-foundation/js-plugin-aws";
|
|
|
18
19
|
import { S3StorageManager } from "./config/index.js";
|
|
19
20
|
|
|
20
21
|
export class Constants {
|
|
21
|
-
static CLI_VERSION = "0.9.
|
|
22
|
+
static CLI_VERSION = "0.9.3";
|
|
22
23
|
static CONFIG_FILE_NAME = "config.yaml";
|
|
23
24
|
static DEFAULT_RPC_DEVNET = "https://api.devnet.solana.com";
|
|
24
25
|
static DEFAULT_PRIORITY_FEE = 500000;
|
|
@@ -59,13 +60,28 @@ export const checkMintedStatus = async (
|
|
|
59
60
|
new PublicKey(releaseAddr),
|
|
60
61
|
]);
|
|
61
62
|
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
const isPublisherMinted = results[0] != undefined && results[0]?.lamports > 0
|
|
64
|
+
const isAppMinted = results[1] != undefined && results[1]?.lamports > 0
|
|
65
|
+
const isReleaseMinted = results[2] != undefined && results[2]?.lamports > 0
|
|
66
|
+
|
|
67
|
+
if (!isPublisherMinted || !isAppMinted || !isReleaseMinted) {
|
|
68
|
+
let errorMessage = ``
|
|
69
|
+
|
|
70
|
+
if (!isPublisherMinted) {
|
|
71
|
+
errorMessage = errorMessage + `Publisher NFT fetch at address ${pubAddr} failed.\n`
|
|
72
|
+
}
|
|
73
|
+
if (!isAppMinted) {
|
|
74
|
+
errorMessage = errorMessage + `App NFT fetch at address ${appAddr} failed.\n`
|
|
75
|
+
}
|
|
76
|
+
if (!isReleaseMinted) {
|
|
77
|
+
errorMessage = errorMessage + `Release NFT fetch at address ${releaseAddr} failed.\n`
|
|
78
|
+
}
|
|
79
|
+
|
|
66
80
|
throw new Error(
|
|
67
|
-
|
|
68
|
-
|
|
81
|
+
`Expected Publisher :: ${pubAddr}, App :: ${appAddr} and Release :: ${releaseAddr} to be minted before submission.\n
|
|
82
|
+
but ${errorMessage}\n
|
|
83
|
+
Please ensure you have minted all of your NFTs before submitting to the Solana Mobile dApp publisher portal.`
|
|
84
|
+
);
|
|
69
85
|
}
|
|
70
86
|
};
|
|
71
87
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import yaml, { dump } from "js-yaml";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { readFile } from 'fs/promises';
|
|
4
|
+
const releaseSchema = JSON.parse((await readFile(new URL("../../generated/config_obj.json", import.meta.url))).toString());
|
|
5
5
|
import fs from "fs";
|
|
6
6
|
import { Constants } from "../../CliUtils.js";
|
|
7
7
|
|
|
@@ -10,7 +10,8 @@ import type {
|
|
|
10
10
|
import { dump, load } from "js-yaml";
|
|
11
11
|
import Ajv from "ajv";
|
|
12
12
|
// eslint-disable-next-line require-extensions/require-extensions
|
|
13
|
-
import
|
|
13
|
+
import { readFile } from 'fs/promises';
|
|
14
|
+
const schemaJson = JSON.parse((await readFile(new URL("../generated/config_schema.json", import.meta.url))).toString());
|
|
14
15
|
import fs from "fs";
|
|
15
16
|
import path from "path";
|
|
16
17
|
import { toMetaplexFile } from "@metaplex-foundation/js";
|