@solana-mobile/dapp-store-cli 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.
Files changed (35) hide show
  1. package/lib/CliSetup.js +468 -568
  2. package/lib/CliUtils.js +18 -33
  3. package/lib/__tests__/CliSetupTest.js +4 -27
  4. package/lib/commands/ValidateCommand.js +15 -40
  5. package/lib/commands/create/CreateCliApp.js +18 -30
  6. package/lib/commands/create/CreateCliRelease.js +24 -27
  7. package/lib/commands/create/index.js +0 -1
  8. package/lib/commands/publish/PublishCliRemove.js +11 -19
  9. package/lib/commands/publish/PublishCliSubmit.js +11 -19
  10. package/lib/commands/publish/PublishCliSupport.js +11 -19
  11. package/lib/commands/publish/PublishCliUpdate.js +11 -19
  12. package/lib/commands/utils.js +6 -14
  13. package/lib/config/PublishDetails.js +138 -259
  14. package/lib/generated/config_obj.json +1 -1
  15. package/lib/generated/config_schema.json +1 -1
  16. package/lib/index.js +6 -14
  17. package/lib/package.json +2 -2
  18. package/lib/prebuild_schema/publishing_source.yaml +32 -32
  19. package/lib/upload/CachedStorageDriver.js +13 -19
  20. package/package.json +2 -2
  21. package/src/CliSetup.ts +5 -54
  22. package/src/CliUtils.ts +5 -11
  23. package/src/__tests__/CliSetupTest.ts +8 -43
  24. package/src/commands/ValidateCommand.ts +0 -20
  25. package/src/commands/create/CreateCliApp.ts +1 -8
  26. package/src/commands/create/CreateCliRelease.ts +10 -1
  27. package/src/commands/create/index.ts +0 -1
  28. package/src/commands/publish/PublishCliRemove.ts +1 -2
  29. package/src/commands/publish/PublishCliSubmit.ts +1 -2
  30. package/src/commands/publish/PublishCliSupport.ts +1 -2
  31. package/src/commands/publish/PublishCliUpdate.ts +1 -2
  32. package/src/config/PublishDetails.ts +30 -58
  33. package/src/prebuild_schema/publishing_source.yaml +32 -32
  34. package/lib/commands/create/CreateCliPublisher.js +0 -237
  35. package/src/commands/create/CreateCliPublisher.ts +0 -87
@@ -1,87 +0,0 @@
1
- import type { Publisher } from "@solana-mobile/dapp-store-publishing-tools";
2
- import { createPublisher } from "@solana-mobile/dapp-store-publishing-tools";
3
- import {
4
- Connection,
5
- Keypair,
6
- } from "@solana/web3.js";
7
-
8
- import {
9
- Constants,
10
- getMetaplexInstance,
11
- } from "../../CliUtils.js";
12
- import { loadPublishDetailsWithChecks, writeToPublishDetails } from "../../config/PublishDetails.js";
13
- import { sendAndConfirmTransaction } from "../utils.js";
14
-
15
- const createPublisherNft = async (
16
- {
17
- connection,
18
- publisher,
19
- publisherDetails,
20
- storageParams,
21
- priorityFeeLamports,
22
- }: {
23
- connection: Connection;
24
- publisher: Keypair;
25
- publisherDetails: Publisher;
26
- storageParams: string;
27
- priorityFeeLamports: number;
28
- },
29
- ) => {
30
- console.info(`Creating Publisher NFT`);
31
- const mintAddress = Keypair.generate();
32
- const metaplex = getMetaplexInstance(connection, publisher, storageParams);
33
- const txBuilder = await createPublisher(
34
- { mintAddress, publisherDetails, priorityFeeLamports },
35
- { metaplex, publisher }
36
- );
37
-
38
- console.info(`Publisher NFT data upload complete\nSigning transaction now`);
39
-
40
- const { response } = await sendAndConfirmTransaction(metaplex, txBuilder);
41
-
42
- return {
43
- publisherAddress: mintAddress.publicKey.toBase58(),
44
- transactionSignature: response.signature,
45
- };
46
- };
47
-
48
- export const createPublisherCommand = async ({
49
- signer,
50
- url,
51
- dryRun,
52
- storageParams,
53
- priorityFeeLamports = Constants.DEFAULT_PRIORITY_FEE,
54
- }: {
55
- signer: Keypair;
56
- url: string;
57
- dryRun: boolean;
58
- storageParams: string;
59
- priorityFeeLamports: number;
60
- }) => {
61
- const connection = new Connection(
62
- url,
63
- {
64
- commitment: "confirmed",
65
- }
66
- );
67
-
68
- const { publisher: publisherDetails } = await loadPublishDetailsWithChecks();
69
-
70
- if (!dryRun) {
71
- const { publisherAddress, transactionSignature } = await createPublisherNft(
72
- {
73
- connection,
74
- publisher: signer,
75
- publisherDetails,
76
- storageParams: storageParams,
77
- priorityFeeLamports: priorityFeeLamports,
78
- },
79
- );
80
-
81
- await writeToPublishDetails({ publisher: { address: publisherAddress } });
82
-
83
- return { publisherAddress, transactionSignature };
84
- }
85
-
86
- return { publisherAddress: "", transactionSignature: "" };
87
- };