@solana-mobile/dapp-store-cli 0.4.0 → 0.4.1

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.
Files changed (110) hide show
  1. package/lib/esm/CliUtils.js +105 -0
  2. package/lib/esm/CliUtils.js.map +1 -0
  3. package/lib/esm/commands/{validate.js → ValidateCommand.js} +4 -3
  4. package/lib/esm/commands/ValidateCommand.js.map +1 -0
  5. package/lib/esm/commands/create/{app.js → CreateCliApp.js} +5 -4
  6. package/lib/esm/commands/create/CreateCliApp.js.map +1 -0
  7. package/lib/esm/commands/create/{publisher.js → CreateCliPublisher.js} +5 -4
  8. package/lib/esm/commands/create/CreateCliPublisher.js.map +1 -0
  9. package/lib/esm/commands/create/{release.js → CreateCliRelease.js} +5 -4
  10. package/lib/esm/commands/create/CreateCliRelease.js.map +1 -0
  11. package/lib/esm/commands/create/index.js +3 -3
  12. package/lib/esm/commands/create/index.js.map +1 -1
  13. package/lib/esm/commands/index.js +1 -1
  14. package/lib/esm/commands/index.js.map +1 -1
  15. package/lib/esm/commands/publish/{remove.js → PublishCliRemove.js} +4 -3
  16. package/lib/esm/commands/publish/PublishCliRemove.js.map +1 -0
  17. package/lib/esm/commands/publish/{submit.js → PublishCliSubmit.js} +4 -3
  18. package/lib/esm/commands/publish/PublishCliSubmit.js.map +1 -0
  19. package/lib/esm/commands/publish/{support.js → PublishCliSupport.js} +4 -3
  20. package/lib/esm/commands/publish/PublishCliSupport.js.map +1 -0
  21. package/lib/esm/commands/publish/{update.js → PublishCliUpdate.js} +4 -3
  22. package/lib/esm/commands/publish/PublishCliUpdate.js.map +1 -0
  23. package/lib/esm/commands/publish/index.js +4 -4
  24. package/lib/esm/commands/publish/index.js.map +1 -1
  25. package/lib/esm/commands/scaffolding/{init.js → ScaffoldInit.js} +2 -2
  26. package/lib/esm/commands/scaffolding/ScaffoldInit.js.map +1 -0
  27. package/lib/esm/commands/scaffolding/index.js +1 -1
  28. package/lib/esm/commands/scaffolding/index.js.map +1 -1
  29. package/lib/esm/config/PublishDetails.js +178 -0
  30. package/lib/esm/config/PublishDetails.js.map +1 -0
  31. package/lib/esm/index.js +16 -15
  32. package/lib/esm/index.js.map +1 -1
  33. package/lib/esm/package.json +2 -2
  34. package/lib/types/{utils.d.ts → CliUtils.d.ts} +2 -11
  35. package/lib/types/CliUtils.d.ts.map +1 -0
  36. package/lib/types/commands/{validate.d.ts → ValidateCommand.d.ts} +1 -1
  37. package/lib/types/commands/ValidateCommand.d.ts.map +1 -0
  38. package/lib/types/commands/create/{app.d.ts → CreateCliApp.d.ts} +2 -2
  39. package/lib/types/commands/create/CreateCliApp.d.ts.map +1 -0
  40. package/lib/types/commands/create/{publisher.d.ts → CreateCliPublisher.d.ts} +1 -1
  41. package/lib/types/commands/create/CreateCliPublisher.d.ts.map +1 -0
  42. package/lib/types/commands/create/{release.d.ts → CreateCliRelease.d.ts} +2 -2
  43. package/lib/types/commands/create/CreateCliRelease.d.ts.map +1 -0
  44. package/lib/types/commands/create/index.d.ts +3 -3
  45. package/lib/types/commands/create/index.d.ts.map +1 -1
  46. package/lib/types/commands/index.d.ts +1 -1
  47. package/lib/types/commands/index.d.ts.map +1 -1
  48. package/lib/types/commands/publish/{remove.d.ts → PublishCliRemove.d.ts} +2 -2
  49. package/lib/types/commands/publish/PublishCliRemove.d.ts.map +1 -0
  50. package/lib/types/commands/publish/{submit.d.ts → PublishCliSubmit.d.ts} +2 -2
  51. package/lib/types/commands/publish/PublishCliSubmit.d.ts.map +1 -0
  52. package/lib/types/commands/publish/{support.d.ts → PublishCliSupport.d.ts} +2 -2
  53. package/lib/types/commands/publish/PublishCliSupport.d.ts.map +1 -0
  54. package/lib/types/commands/publish/{update.d.ts → PublishCliUpdate.d.ts} +2 -2
  55. package/lib/types/commands/publish/PublishCliUpdate.d.ts.map +1 -0
  56. package/lib/types/commands/publish/index.d.ts +4 -4
  57. package/lib/types/commands/publish/index.d.ts.map +1 -1
  58. package/lib/types/commands/scaffolding/{init.d.ts → ScaffoldInit.d.ts} +1 -1
  59. package/lib/types/commands/scaffolding/ScaffoldInit.d.ts.map +1 -0
  60. package/lib/types/commands/scaffolding/index.d.ts +1 -1
  61. package/lib/types/commands/scaffolding/index.d.ts.map +1 -1
  62. package/lib/types/config/PublishDetails.d.ts +17 -0
  63. package/lib/types/config/PublishDetails.d.ts.map +1 -0
  64. package/lib/types/upload/CachedStorageDriver.d.ts +3 -3
  65. package/lib/types/upload/CachedStorageDriver.d.ts.map +1 -1
  66. package/package.json +2 -2
  67. package/src/CliUtils.ts +135 -0
  68. package/src/commands/{validate.ts → ValidateCommand.ts} +3 -2
  69. package/src/commands/create/{app.ts → CreateCliApp.ts} +4 -5
  70. package/src/commands/create/{publisher.ts → CreateCliPublisher.ts} +4 -5
  71. package/src/commands/create/{release.ts → CreateCliRelease.ts} +4 -7
  72. package/src/commands/create/index.ts +3 -3
  73. package/src/commands/index.ts +1 -1
  74. package/src/commands/publish/{remove.ts → PublishCliRemove.ts} +3 -2
  75. package/src/commands/publish/{submit.ts → PublishCliSubmit.ts} +3 -2
  76. package/src/commands/publish/{support.ts → PublishCliSupport.ts} +3 -2
  77. package/src/commands/publish/{update.ts → PublishCliUpdate.ts} +3 -2
  78. package/src/commands/publish/index.ts +4 -4
  79. package/src/commands/scaffolding/{init.ts → ScaffoldInit.ts} +1 -1
  80. package/src/commands/scaffolding/index.ts +1 -1
  81. package/src/config/PublishDetails.ts +273 -0
  82. package/src/index.ts +17 -17
  83. package/README.md +0 -86
  84. package/lib/esm/commands/create/app.js.map +0 -1
  85. package/lib/esm/commands/create/publisher.js.map +0 -1
  86. package/lib/esm/commands/create/release.js.map +0 -1
  87. package/lib/esm/commands/publish/remove.js.map +0 -1
  88. package/lib/esm/commands/publish/submit.js.map +0 -1
  89. package/lib/esm/commands/publish/support.js.map +0 -1
  90. package/lib/esm/commands/publish/update.js.map +0 -1
  91. package/lib/esm/commands/scaffolding/init.js.map +0 -1
  92. package/lib/esm/commands/validate.js.map +0 -1
  93. package/lib/esm/config/index.js +0 -18
  94. package/lib/esm/config/index.js.map +0 -1
  95. package/lib/esm/utils.js +0 -261
  96. package/lib/esm/utils.js.map +0 -1
  97. package/lib/types/commands/create/app.d.ts.map +0 -1
  98. package/lib/types/commands/create/publisher.d.ts.map +0 -1
  99. package/lib/types/commands/create/release.d.ts.map +0 -1
  100. package/lib/types/commands/publish/remove.d.ts.map +0 -1
  101. package/lib/types/commands/publish/submit.d.ts.map +0 -1
  102. package/lib/types/commands/publish/support.d.ts.map +0 -1
  103. package/lib/types/commands/publish/update.d.ts.map +0 -1
  104. package/lib/types/commands/scaffolding/init.d.ts.map +0 -1
  105. package/lib/types/commands/validate.d.ts.map +0 -1
  106. package/lib/types/config/index.d.ts +0 -9
  107. package/lib/types/config/index.d.ts.map +0 -1
  108. package/lib/types/utils.d.ts.map +0 -1
  109. package/src/config/index.ts +0 -38
  110. package/src/utils.ts +0 -377
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/scaffolding/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/scaffolding/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { App, Publisher, Release, SolanaMobileDappPublisherPortal } from "@solana-mobile/dapp-store-publishing-tools";
2
+ export interface PublishDetails {
3
+ publisher: Publisher;
4
+ app: App;
5
+ release: Release;
6
+ solana_mobile_dapp_publisher_portal: SolanaMobileDappPublisherPortal;
7
+ }
8
+ declare type SaveToConfigArgs = {
9
+ publisher?: Pick<Publisher, "address">;
10
+ app?: Pick<App, "address">;
11
+ release?: Pick<Release, "address">;
12
+ };
13
+ export declare const loadPublishDetails: (configPath: string) => Promise<PublishDetails>;
14
+ export declare const loadPublishDetailsWithChecks: (buildToolsDir?: string | null) => Promise<PublishDetails>;
15
+ export declare const writeToPublishDetails: ({ publisher, app, release }: SaveToConfigArgs) => Promise<void>;
16
+ export {};
17
+ //# sourceMappingURL=PublishDetails.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PublishDetails.d.ts","sourceRoot":"","sources":["../../../src/config/PublishDetails.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,GAAG,EACH,SAAS,EACT,OAAO,EACP,+BAA+B,EAChC,MAAM,4CAA4C,CAAC;AAgBpD,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,SAAS,CAAC;IACrB,GAAG,EAAE,GAAG,CAAC;IACT,OAAO,EAAE,OAAO,CAAC;IACjB,mCAAmC,EAAE,+BAA+B,CAAC;CACtE;AAYD,aAAK,gBAAgB,GAAG;IACtB,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACvC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAC3B,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;CACpC,CAAC;AAKF,eAAO,MAAM,kBAAkB,eAAsB,MAAM,4BAW1D,CAAC;AAEF,eAAO,MAAM,4BAA4B,mBACxB,MAAM,GAAG,IAAI,KAC3B,QAAQ,cAAc,CA8ExB,CAAC;AA4GF,eAAO,MAAM,qBAAqB,gCAAuC,gBAAgB,kBAuBxF,CAAC"}
@@ -1,11 +1,11 @@
1
1
  import type { MetaplexFile, StorageDriver } from "@metaplex-foundation/js";
2
- type URI = string;
3
- type Asset = {
2
+ declare type URI = string;
3
+ declare type Asset = {
4
4
  path: string;
5
5
  sha256: string;
6
6
  uri: URI;
7
7
  };
8
- export type AssetManifestSchema = {
8
+ export declare type AssetManifestSchema = {
9
9
  schema_version: string;
10
10
  assets: {
11
11
  [path: string]: Asset;
@@ -1 +1 @@
1
- {"version":3,"file":"CachedStorageDriver.d.ts","sourceRoot":"","sources":["../../../src/upload/CachedStorageDriver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG3E,KAAK,GAAG,GAAG,MAAM,CAAC;AAElB,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,GAAG,CAAC;CACV,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE;QACN,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;KACvB,CAAC;CACH,CAAC;AAGF,qBAAa,mBAAoB,YAAW,aAAa;IAGvD,MAAM,CAAC,QAAQ,CAAC,cAAc,SAAS;IAEvC,aAAa,EAAE,mBAAmB,CAAC;IACnC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,aAAa,CAAC;gBAG3B,aAAa,EAAE,aAAa,EAC5B,EAAE,iBAAiB,EAAE,EAAE;QAAE,iBAAiB,EAAE,MAAM,CAAA;KAAE;IAWhD,cAAc,CAAC,KAAK,EAAE,MAAM;IAIlC,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS;IAWpE,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;IAOxD,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;CA0ClD"}
1
+ {"version":3,"file":"CachedStorageDriver.d.ts","sourceRoot":"","sources":["../../../src/upload/CachedStorageDriver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG3E,aAAK,GAAG,GAAG,MAAM,CAAC;AAElB,aAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,GAAG,CAAC;CACV,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE;QACN,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;KACvB,CAAC;CACH,CAAC;AAGF,qBAAa,mBAAoB,YAAW,aAAa;IAGvD,MAAM,CAAC,QAAQ,CAAC,cAAc,SAAS;IAEvC,aAAa,EAAE,mBAAmB,CAAC;IACnC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,aAAa,CAAC;gBAG3B,aAAa,EAAE,aAAa,EAC5B,EAAE,iBAAiB,EAAE,EAAE;QAAE,iBAAiB,EAAE,MAAM,CAAA;KAAE;IAWhD,cAAc,CAAC,KAAK,EAAE,MAAM;IAIlC,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS;IAWpE,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;IAOxD,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;CA0ClD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana-mobile/dapp-store-cli",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -36,7 +36,7 @@
36
36
  "shx": "^0.3.4"
37
37
  },
38
38
  "dependencies": {
39
- "@solana-mobile/dapp-store-publishing-tools": "0.4.0",
39
+ "@solana-mobile/dapp-store-publishing-tools": "0.4.1",
40
40
  "@solana/web3.js": "1.68.0",
41
41
  "@types/semver": "^7.3.13",
42
42
  "ajv": "^8.11.0",
@@ -0,0 +1,135 @@
1
+ import fs from "fs";
2
+ import type { Connection } from "@solana/web3.js";
3
+ import { Keypair, PublicKey } from "@solana/web3.js";
4
+ import debugModule from "debug";
5
+ import { BundlrStorageDriver, keypairIdentity, Metaplex } from "@metaplex-foundation/js";
6
+ import updateNotifier from "update-notifier";
7
+ import cliPackage from "./package.json" assert { type: "json" };
8
+ import boxen from "boxen";
9
+ import ver from "semver";
10
+ import { CachedStorageDriver } from "./upload/CachedStorageDriver.js";
11
+
12
+ export class Constants {
13
+ static CLI_VERSION = "0.4.1";
14
+ static CONFIG_FILE_NAME = "config.yaml";
15
+ static DEFAULT_RPC_DEVNET = "https://api.devnet.solana.com";
16
+ }
17
+
18
+ export const debug = debugModule("CLI");
19
+
20
+ export const checkForSelfUpdate = async () => {
21
+ const notifier = updateNotifier({ pkg: cliPackage });
22
+ const updateInfo = await notifier.fetchInfo();
23
+
24
+ const latestVer = new ver.SemVer(updateInfo.latest);
25
+ const currentVer = new ver.SemVer(updateInfo.current);
26
+
27
+ if (latestVer.major > currentVer.major || latestVer.minor > currentVer.minor) {
28
+ throw new Error("Please update to the latest version of the dApp Store CLI before proceeding.");
29
+ }
30
+ };
31
+
32
+ export const checkMintedStatus = async (conn: Connection, pubAddr: string, appAddr: string, releaseAddr: string) => {
33
+ const results = await conn.getMultipleAccountsInfo([
34
+ new PublicKey(pubAddr),
35
+ new PublicKey(appAddr),
36
+ new PublicKey(releaseAddr),
37
+ ]);
38
+
39
+ const rentAccounts = results.filter((item) => !(item == undefined) && item?.lamports > 0);
40
+ if (rentAccounts?.length != 3) {
41
+ throw new Error("Please ensure you have minted all of your NFTs before submitting to the Solana Mobile dApp publisher portal.");
42
+ }
43
+ };
44
+
45
+ export const parseKeypair = (pathToKeypairFile: string) => {
46
+ try {
47
+ const keypairFile = fs.readFileSync(pathToKeypairFile, "utf-8");
48
+ return Keypair.fromSecretKey(Buffer.from(JSON.parse(keypairFile)));
49
+ } catch (e) {
50
+ showMessage
51
+ (
52
+ "KeyPair Error",
53
+ "Something went wrong when attempting to retrieve the keypair at " + pathToKeypairFile,
54
+ "error"
55
+ )
56
+ }
57
+ };
58
+
59
+ export const isDevnet = (rpcUrl: string): boolean => {
60
+ return rpcUrl.indexOf("devnet") != -1;
61
+ };
62
+
63
+ export const isTestnet = (rpcUrl: string): boolean => {
64
+ return rpcUrl.indexOf("testnet") != -1;
65
+ };
66
+
67
+ export const checkSubmissionNetwork = (rpcUrl: string) => {
68
+ if (isDevnet(rpcUrl) || isTestnet(rpcUrl)) {
69
+ throw new Error("It looks like you are attempting to submit a request with a devnet or testnet RPC endpoint. Please ensure that your NFTs are minted on mainnet beta, and re-run with a mainnet beta RPC endpoint.");
70
+ }
71
+ };
72
+
73
+ export const generateNetworkSuffix = (rpcUrl: string): string => {
74
+ let suffix = "";
75
+
76
+ if (isDevnet(rpcUrl)) {
77
+ suffix = "?cluster=devnet";
78
+ } else if (isTestnet(rpcUrl)) {
79
+ suffix = "?cluster=testnet";
80
+ } else {
81
+ suffix = "?cluster=mainnet";
82
+ }
83
+
84
+ return suffix;
85
+ };
86
+
87
+ export const showMessage = (
88
+ titleMessage = "",
89
+ contentMessage = "",
90
+ type: "standard" | "error" | "warning" = "standard",
91
+ ): string => {
92
+ let color = "cyan";
93
+ if (type == "error") {
94
+ color = "redBright";
95
+ } else if (type == "warning") {
96
+ color = "yellow";
97
+ }
98
+
99
+ const msg = boxen(contentMessage, {
100
+ title: titleMessage,
101
+ padding: 1,
102
+ margin: 1,
103
+ borderStyle: 'single',
104
+ borderColor: color,
105
+ textAlignment: "left",
106
+ titleAlignment: "center",
107
+ });
108
+
109
+ console.log(msg);
110
+ return msg;
111
+ };
112
+
113
+ export const getMetaplexInstance = (
114
+ connection: Connection,
115
+ keypair: Keypair
116
+ ) => {
117
+ const metaplex = Metaplex.make(connection).use(keypairIdentity(keypair));
118
+ const isDevnet = connection.rpcEndpoint.includes("devnet");
119
+
120
+ const bundlrStorageDriver = isDevnet
121
+ ? new BundlrStorageDriver(metaplex, {
122
+ address: "https://devnet.bundlr.network",
123
+ providerUrl: Constants.DEFAULT_RPC_DEVNET,
124
+ })
125
+ : new BundlrStorageDriver(metaplex);
126
+
127
+ metaplex.storage().setDriver(
128
+ new CachedStorageDriver(bundlrStorageDriver, {
129
+ assetManifestPath: isDevnet
130
+ ? "./.asset-manifest-devnet.json"
131
+ : "./.asset-manifest.json",
132
+ })
133
+ );
134
+ return metaplex;
135
+ };
@@ -7,11 +7,12 @@ import {
7
7
  validateRelease,
8
8
  metaplexFileReplacer,
9
9
  } from "@solana-mobile/dapp-store-publishing-tools";
10
- import { debug, getConfigWithChecks } from "../utils.js";
10
+ import { debug } from "../CliUtils.js";
11
11
 
12
12
  import type { Keypair } from "@solana/web3.js";
13
13
  import type { MetaplexFile } from "@metaplex-foundation/js";
14
14
  import { isMetaplexFile } from "@metaplex-foundation/js";
15
+ import { loadPublishDetailsWithChecks } from "../config/PublishDetails.js";
15
16
 
16
17
  export const validateCommand = async ({
17
18
  signer,
@@ -24,7 +25,7 @@ export const validateCommand = async ({
24
25
  publisher: publisherDetails,
25
26
  app: appDetails,
26
27
  release: releaseDetails,
27
- } = await getConfigWithChecks(buildToolsPath);
28
+ } = await loadPublishDetailsWithChecks(buildToolsPath);
28
29
 
29
30
  debug({ publisherDetails, appDetails, releaseDetails });
30
31
 
@@ -8,10 +8,9 @@ import {
8
8
  } from "@solana/web3.js";
9
9
 
10
10
  import {
11
- getConfigWithChecks,
12
11
  getMetaplexInstance,
13
- saveToConfig,
14
- } from "../../utils.js";
12
+ } from "../../CliUtils.js";
13
+ import { loadPublishDetailsWithChecks, writeToPublishDetails } from "../../config/PublishDetails.js";
15
14
 
16
15
  const createAppNft = async (
17
16
  {
@@ -71,7 +70,7 @@ export const createAppCommand = async ({
71
70
  const connection = new Connection(url);
72
71
 
73
72
  const { app: appDetails, publisher: publisherDetails } =
74
- await getConfigWithChecks();
73
+ await loadPublishDetailsWithChecks();
75
74
 
76
75
  const { appAddress } = await createAppNft(
77
76
  {
@@ -84,7 +83,7 @@ export const createAppCommand = async ({
84
83
  );
85
84
 
86
85
  if (!dryRun) {
87
- saveToConfig({ app: { address: appAddress } });
86
+ writeToPublishDetails({ app: { address: appAddress } });
88
87
  }
89
88
 
90
89
  return { appAddress };
@@ -7,10 +7,9 @@ import {
7
7
  } from "@solana/web3.js";
8
8
 
9
9
  import {
10
- getConfigWithChecks,
11
10
  getMetaplexInstance,
12
- saveToConfig,
13
- } from "../../utils.js";
11
+ } from "../../CliUtils.js";
12
+ import { loadPublishDetailsWithChecks, writeToPublishDetails } from "../../config/PublishDetails.js";
14
13
 
15
14
  const createPublisherNft = async (
16
15
  {
@@ -62,7 +61,7 @@ export const createPublisherCommand = async ({
62
61
  }) => {
63
62
  const connection = new Connection(url);
64
63
 
65
- const { publisher: publisherDetails } = await getConfigWithChecks();
64
+ const { publisher: publisherDetails } = await loadPublishDetailsWithChecks();
66
65
 
67
66
  const { publisherAddress } = await createPublisherNft(
68
67
  {
@@ -74,7 +73,7 @@ export const createPublisherCommand = async ({
74
73
  );
75
74
 
76
75
  // TODO(sdlaver): dry-run should not modify config
77
- saveToConfig({ publisher: { address: publisherAddress } });
76
+ writeToPublishDetails({ publisher: { address: publisherAddress } });
78
77
 
79
78
  return { publisherAddress };
80
79
  };
@@ -10,13 +10,10 @@ import {
10
10
  PublicKey,
11
11
  sendAndConfirmTransaction,
12
12
  } from "@solana/web3.js";
13
- import { CachedStorageDriver } from "../../upload/CachedStorageDriver.js";
14
-
15
13
  import {
16
- getConfigWithChecks,
17
14
  getMetaplexInstance,
18
- saveToConfig,
19
- } from "../../utils.js";
15
+ } from "../../CliUtils.js";
16
+ import { loadPublishDetailsWithChecks, writeToPublishDetails } from "../../config/PublishDetails.js";
20
17
 
21
18
  type CreateReleaseCommandInput = {
22
19
  appMintAddress: string;
@@ -83,7 +80,7 @@ export const createReleaseCommand = async ({
83
80
  }: CreateReleaseCommandInput) => {
84
81
  const connection = new Connection(url);
85
82
 
86
- const { release, app, publisher } = await getConfigWithChecks(buildToolsPath);
83
+ const { release, app, publisher } = await loadPublishDetailsWithChecks(buildToolsPath);
87
84
 
88
85
  if (!dryRun) {
89
86
  const { releaseAddress } = await createReleaseNft({
@@ -97,7 +94,7 @@ export const createReleaseCommand = async ({
97
94
  publisherDetails: publisher,
98
95
  });
99
96
 
100
- saveToConfig({
97
+ writeToPublishDetails({
101
98
  release: { address: releaseAddress },
102
99
  });
103
100
 
@@ -1,6 +1,6 @@
1
- export * from "./publisher.js";
2
- export * from "./app.js";
3
- export * from "./release.js";
1
+ export * from "./CreateCliPublisher.js";
2
+ export * from "./CreateCliApp.js";
3
+ export * from "./CreateCliRelease.js";
4
4
 
5
5
  /*
6
6
  * Module responsible for creating publishers, apps, and releases (in that order)
@@ -1,3 +1,3 @@
1
1
  export * from "./create/index.js";
2
2
  export * from "./publish/index.js";
3
- export * from "./validate.js";
3
+ export * from "./ValidateCommand.js";
@@ -1,8 +1,9 @@
1
1
  import { Connection, Keypair } from "@solana/web3.js";
2
2
  import type { SignWithPublisherKeypair } from "@solana-mobile/dapp-store-publishing-tools";
3
3
  import { publishRemove } from "@solana-mobile/dapp-store-publishing-tools";
4
- import { checkMintedStatus, getConfigWithChecks } from "../../utils.js";
4
+ import { checkMintedStatus } from "../../CliUtils.js";
5
5
  import nacl from "tweetnacl";
6
+ import { loadPublishDetailsWithChecks } from "../../config/PublishDetails.js";
6
7
 
7
8
  type PublishRemoveCommandInput = {
8
9
  appMintAddress: string;
@@ -35,7 +36,7 @@ export const publishRemoveCommand = async ({
35
36
  publisher: publisherDetails,
36
37
  app: appDetails,
37
38
  release: releaseDetails,
38
- } = await getConfigWithChecks();
39
+ } = await loadPublishDetailsWithChecks();
39
40
 
40
41
  const sign = ((buf: Buffer) =>
41
42
  nacl.sign(buf, signer.secretKey)) as SignWithPublisherKeypair;
@@ -2,8 +2,9 @@ import { AccountInfo, Connection, Keypair, PublicKey } from "@solana/web3.js";
2
2
  import type { SignWithPublisherKeypair } from "@solana-mobile/dapp-store-publishing-tools";
3
3
  import { publishSubmit } from "@solana-mobile/dapp-store-publishing-tools";
4
4
  import nacl from "tweetnacl";
5
- import { checkMintedStatus, getConfigWithChecks } from "../../utils.js";
5
+ import { checkMintedStatus } from "../../CliUtils.js";
6
6
  import { Buffer } from "buffer";
7
+ import { loadPublishDetailsWithChecks } from "../../config/PublishDetails.js";
7
8
 
8
9
  type PublishSubmitCommandInput = {
9
10
  appMintAddress: string;
@@ -42,7 +43,7 @@ export const publishSubmitCommand = async ({
42
43
  app: appDetails,
43
44
  release: releaseDetails,
44
45
  solana_mobile_dapp_publisher_portal: solanaMobileDappPublisherPortalDetails,
45
- } = await getConfigWithChecks();
46
+ } = await loadPublishDetailsWithChecks();
46
47
 
47
48
  const sign = ((buf: Buffer) =>
48
49
  nacl.sign(buf, signer.secretKey)) as SignWithPublisherKeypair;
@@ -1,8 +1,9 @@
1
1
  import { Connection, Keypair } from "@solana/web3.js";
2
2
  import type { SignWithPublisherKeypair } from "@solana-mobile/dapp-store-publishing-tools";
3
3
  import { publishSupport } from "@solana-mobile/dapp-store-publishing-tools";
4
- import { checkMintedStatus, getConfigWithChecks } from "../../utils.js";
4
+ import { checkMintedStatus } from "../../CliUtils.js";
5
5
  import nacl from "tweetnacl";
6
+ import { loadPublishDetailsWithChecks } from "../../config/PublishDetails.js";
6
7
 
7
8
  type PublishSupportCommandInput = {
8
9
  appMintAddress: string;
@@ -35,7 +36,7 @@ export const publishSupportCommand = async ({
35
36
  publisher: publisherDetails,
36
37
  app: appDetails,
37
38
  release: releaseDetails,
38
- } = await getConfigWithChecks();
39
+ } = await loadPublishDetailsWithChecks();
39
40
 
40
41
  const sign = ((buf: Buffer) =>
41
42
  nacl.sign(buf, signer.secretKey)) as SignWithPublisherKeypair;
@@ -1,8 +1,9 @@
1
1
  import { Connection, Keypair } from "@solana/web3.js";
2
2
  import type { SignWithPublisherKeypair } from "@solana-mobile/dapp-store-publishing-tools";
3
3
  import { publishUpdate } from "@solana-mobile/dapp-store-publishing-tools";
4
- import { checkMintedStatus, getConfigWithChecks } from "../../utils.js";
4
+ import { checkMintedStatus } from "../../CliUtils.js";
5
5
  import nacl from "tweetnacl";
6
+ import { loadPublishDetailsWithChecks } from "../../config/PublishDetails.js";
6
7
 
7
8
  type PublishUpdateCommandInput = {
8
9
  appMintAddress: string;
@@ -43,7 +44,7 @@ export const publishUpdateCommand = async ({
43
44
  app: appDetails,
44
45
  release: releaseDetails,
45
46
  solana_mobile_dapp_publisher_portal: solanaMobileDappPublisherPortalDetails,
46
- } = await getConfigWithChecks();
47
+ } = await loadPublishDetailsWithChecks();
47
48
 
48
49
  const sign = ((buf: Buffer) =>
49
50
  nacl.sign(buf, signer.secretKey)) as SignWithPublisherKeypair;
@@ -1,7 +1,7 @@
1
- export * from "./remove.js";
2
- export * from "./submit.js";
3
- export * from "./support.js";
4
- export * from "./update.js";
1
+ export * from "./PublishCliRemove.js";
2
+ export * from "./PublishCliSubmit.js";
3
+ export * from "./PublishCliSupport.js";
4
+ export * from "./PublishCliUpdate.js";
5
5
 
6
6
  /*
7
7
  * Module responsible for submitting requests to the Solana dApp Store publisher portal
@@ -3,7 +3,7 @@ import yaml, { dump } from "js-yaml";
3
3
  // eslint-disable-next-line require-extensions/require-extensions
4
4
  import releaseSchema from "../../generated/config_obj.json" assert { type: "json" };
5
5
  import fs from "fs";
6
- import { Constants } from "../../utils.js";
6
+ import { Constants } from "../../CliUtils.js";
7
7
 
8
8
  export const initScaffold = (): string => {
9
9
  const outputYaml = Constants.CONFIG_FILE_NAME;
@@ -1 +1 @@
1
- export * from "./init.js";
1
+ export * from "./ScaffoldInit.js";