@solana-mobile/dapp-store-cli 0.1.1-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 (86) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +142 -0
  3. package/bin/dapp-store.js +3 -0
  4. package/lib/esm/commands/create/app.js +37 -0
  5. package/lib/esm/commands/create/app.js.map +1 -0
  6. package/lib/esm/commands/create/index.js +44 -0
  7. package/lib/esm/commands/create/index.js.map +1 -0
  8. package/lib/esm/commands/create/publisher.js +33 -0
  9. package/lib/esm/commands/create/publisher.js.map +1 -0
  10. package/lib/esm/commands/create/release.js +48 -0
  11. package/lib/esm/commands/create/release.js.map +1 -0
  12. package/lib/esm/commands/index.js +4 -0
  13. package/lib/esm/commands/index.js.map +1 -0
  14. package/lib/esm/commands/publish/index.js +25 -0
  15. package/lib/esm/commands/publish/index.js.map +1 -0
  16. package/lib/esm/commands/publish/remove.js +20 -0
  17. package/lib/esm/commands/publish/remove.js.map +1 -0
  18. package/lib/esm/commands/publish/submit.js +25 -0
  19. package/lib/esm/commands/publish/submit.js.map +1 -0
  20. package/lib/esm/commands/publish/support.js +20 -0
  21. package/lib/esm/commands/publish/support.js.map +1 -0
  22. package/lib/esm/commands/publish/update.js +26 -0
  23. package/lib/esm/commands/publish/update.js.map +1 -0
  24. package/lib/esm/commands/validate.js +40 -0
  25. package/lib/esm/commands/validate.js.map +1 -0
  26. package/lib/esm/config/index.js +19 -0
  27. package/lib/esm/config/index.js.map +1 -0
  28. package/lib/esm/config/schema.json +228 -0
  29. package/lib/esm/index.js +259 -0
  30. package/lib/esm/index.js.map +1 -0
  31. package/lib/esm/upload/CachedStorageDriver.js +64 -0
  32. package/lib/esm/upload/CachedStorageDriver.js.map +1 -0
  33. package/lib/esm/upload/index.js +2 -0
  34. package/lib/esm/upload/index.js.map +1 -0
  35. package/lib/esm/utils.js +171 -0
  36. package/lib/esm/utils.js.map +1 -0
  37. package/lib/types/commands/create/app.d.ts +12 -0
  38. package/lib/types/commands/create/app.d.ts.map +1 -0
  39. package/lib/types/commands/create/index.d.ts +4 -0
  40. package/lib/types/commands/create/index.d.ts.map +1 -0
  41. package/lib/types/commands/create/publisher.d.ts +9 -0
  42. package/lib/types/commands/create/publisher.d.ts.map +1 -0
  43. package/lib/types/commands/create/release.d.ts +14 -0
  44. package/lib/types/commands/create/release.d.ts.map +1 -0
  45. package/lib/types/commands/index.d.ts +4 -0
  46. package/lib/types/commands/index.d.ts.map +1 -0
  47. package/lib/types/commands/publish/index.d.ts +5 -0
  48. package/lib/types/commands/publish/index.d.ts.map +1 -0
  49. package/lib/types/commands/publish/remove.d.ts +12 -0
  50. package/lib/types/commands/publish/remove.d.ts.map +1 -0
  51. package/lib/types/commands/publish/submit.d.ts +12 -0
  52. package/lib/types/commands/publish/submit.d.ts.map +1 -0
  53. package/lib/types/commands/publish/support.d.ts +12 -0
  54. package/lib/types/commands/publish/support.d.ts.map +1 -0
  55. package/lib/types/commands/publish/update.d.ts +13 -0
  56. package/lib/types/commands/publish/update.d.ts.map +1 -0
  57. package/lib/types/commands/validate.d.ts +6 -0
  58. package/lib/types/commands/validate.d.ts.map +1 -0
  59. package/lib/types/config/index.d.ts +10 -0
  60. package/lib/types/config/index.d.ts.map +1 -0
  61. package/lib/types/index.d.ts +2 -0
  62. package/lib/types/index.d.ts.map +1 -0
  63. package/lib/types/upload/CachedStorageDriver.d.ts +30 -0
  64. package/lib/types/upload/CachedStorageDriver.d.ts.map +1 -0
  65. package/lib/types/upload/index.d.ts +2 -0
  66. package/lib/types/upload/index.d.ts.map +1 -0
  67. package/lib/types/utils.d.ts +21 -0
  68. package/lib/types/utils.d.ts.map +1 -0
  69. package/package.json +49 -0
  70. package/src/commands/create/app.ts +88 -0
  71. package/src/commands/create/index.ts +48 -0
  72. package/src/commands/create/publisher.ts +78 -0
  73. package/src/commands/create/release.ts +107 -0
  74. package/src/commands/index.ts +3 -0
  75. package/src/commands/publish/index.ts +29 -0
  76. package/src/commands/publish/remove.ts +46 -0
  77. package/src/commands/publish/submit.ts +55 -0
  78. package/src/commands/publish/support.ts +46 -0
  79. package/src/commands/publish/update.ts +58 -0
  80. package/src/commands/validate.ts +67 -0
  81. package/src/config/index.ts +40 -0
  82. package/src/config/schema.json +228 -0
  83. package/src/index.ts +435 -0
  84. package/src/upload/CachedStorageDriver.ts +104 -0
  85. package/src/upload/index.ts +1 -0
  86. package/src/utils.ts +275 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2022 Solana Labs
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,142 @@
1
+ ### Notes:
2
+
3
+ - dapp-store -> something else
4
+ <!-- - android_details from the apk -->
5
+ - auto fill address
6
+ - `init`
7
+ - move releases into config.yaml
8
+ - always use the app version from the config file
9
+ <!-- - by default go to Arweave
10
+ - Look at how hard to add S3
11
+ - S3 URL -->
12
+ - when we run the release, SHA hash the previous files and commit to an `.asset-cache`
13
+
14
+
15
+ ## Publishing Notes
16
+
17
+ - https://developer.android.com/guide/topics/resources/multilingual-support#specify-the-languages-your-app-supports
18
+ - Android build tools
19
+ - Specify ANDROID_TOOLS_DIR= in .env file
20
+
21
+ ## Prerequisites
22
+
23
+ - Node 16+
24
+ - PNPM
25
+
26
+ If you have Node 16+, you can [activate PNPM with Corepack](https://pnpm.io/installation#using-corepack):
27
+
28
+ ```shell
29
+ corepack enable
30
+ corepack prepare pnpm@`npm info pnpm --json | jq -r .version` --activate
31
+ ```
32
+
33
+ Corepack requires a version to enable, so if you don't have [jq](https://stedolan.github.io/jq/) installed, you can [install it](https://formulae.brew.sh/formula/jq), or just manually get the current version of pnpm with `npm info pnpm` and use it like this:
34
+
35
+ ```shell
36
+ corepack prepare pnpm@7.13.4 --activate
37
+ ```
38
+
39
+ ## Setup
40
+
41
+ ```shell
42
+ git clone https://github.com/solana-mobile/app-publishing-spec
43
+ cd app-publishing-spec
44
+ pnpm install
45
+ pnpm run build
46
+ pnpm link .
47
+ ```
48
+
49
+ ## Usage
50
+
51
+ In your application folder (e.g., `example`):
52
+
53
+ ```shell
54
+ cd example
55
+ pnpm link <path-to-app-publishing-spec>/packages/cli
56
+ npx dapp-store --help
57
+ ```
58
+
59
+ # Overview
60
+
61
+ Publishers, applications, and releases on the Saga Dapp Store are all represented as NFTs, with some modifications.
62
+
63
+ "Publishers" are Metaplex Certified Collection (MCC) NFTs that have can have many "apps" associated with them.
64
+
65
+ "Apps" are _also_ MCC NFTs that can have many "releases" associated with them.
66
+
67
+ "Releases" are immutable Metaplex NFTs that can only be issued once per-version. Any new releases must be re-issued as a new NFT.
68
+
69
+ A typical publishing flow might look like:
70
+
71
+ 1. Create a publisher (`dapp-store create publisher`)
72
+ 2. Create an app (`dapp-store create app`)
73
+ 3. Create a release (`dapp-store create release`)
74
+ 4. Submit an app for review (`dapp-store submit-for-review`)
75
+
76
+ Repeat steps 3. and 4. as needed!
77
+
78
+ ## Editor's Note
79
+
80
+ The `dapp-store` CLI:
81
+
82
+ - takes an opinionated approach to file structure optimizing for source control
83
+ - handles rote tasks like uploading assets to immutable file storage and i18n
84
+
85
+ However, it is by no means the only way to create these NFTs—all information about the requirements are specified in this repository, and the packages have been designed to be portable to other client contexts besides the CLI
86
+
87
+ ## Configuration
88
+
89
+ In `config.yaml`:
90
+
91
+ ```yaml
92
+ publisher:
93
+ name: My new publisher name
94
+ address: BrWNieTsfdkkwMaz2A616i1fkqSjxk2kHhTn1Y44pi48
95
+ website: https://solanamobile.com
96
+ email: hello@solanamobile.com
97
+ media:
98
+ - purpose: icon
99
+ uri: ./media/publisher_icon.jpeg
100
+ app:
101
+ name: My new app name
102
+ address: 4xE4MDVHfFAXMKKzqrJ2v1HxcgYgdoV98nuvd8SRKhWP
103
+ android_package: com.company.dapp
104
+ creators:
105
+ - 7pF18kRbv4mWdLPNMa8CjqLotQpznxzzRJqwdMibMitE
106
+ urls:
107
+ license_url: http://cdn.org/license.html
108
+ copyright_url: http://cdn.org/copyright.html
109
+ privacy_policy_url: http://cdn.org/privacy.html
110
+ website: http://cdn.org
111
+ media:
112
+ - purpose: icon
113
+ uri: ./media/app_icon.jpeg
114
+ release:
115
+ version: 1.0.4
116
+ address: HeXP8pLxxzWPo1j7FwsytrCBN9Q7HZ3MA8TVCVGj5eCA
117
+ media:
118
+ - purpose: screenshot
119
+ uri: ./media/app_screenshot.png
120
+ files:
121
+ - purpose: install
122
+ uri: ./files/app-debug.apk
123
+ catalog:
124
+ en-US:
125
+ name: |
126
+ A nice, helpful dApp name
127
+ short_description: |
128
+ Some wonderful release notes
129
+ long_description: |
130
+ Some wonderful release notes, in long-form
131
+ new_in_version: |
132
+ Something new in this version
133
+ saga_features_localized: |
134
+ Some information about saga specific features
135
+ solana_mobile_dapp_publisher_portal:
136
+ google_store_package: com.company.dapp.otherpkg
137
+ testing_instructions: >
138
+ Here are some steps informing Solana Mobile of how to test this dapp. You
139
+ can specify multiple lines of instructions. For example, if a login is
140
+ needed, you would add those details here.
141
+ ```
142
+
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+
3
+ import "../lib/esm/index.js";
@@ -0,0 +1,37 @@
1
+ import { createApp } from "@solana-mobile/dapp-store-publishing-tools";
2
+ import { Connection, Keypair, PublicKey, sendAndConfirmTransaction, } from "@solana/web3.js";
3
+ import { getConfigFile, getMetaplexInstance, saveToConfig, } from "../../utils.js";
4
+ const createAppNft = async ({ appDetails, connection, publisherMintAddress, publisher, }, { dryRun }) => {
5
+ const mintAddress = Keypair.generate();
6
+ const metaplex = getMetaplexInstance(connection, publisher);
7
+ const txBuilder = await createApp({
8
+ publisherMintAddress: new PublicKey(publisherMintAddress),
9
+ mintAddress,
10
+ appDetails,
11
+ }, { metaplex, publisher });
12
+ const blockhash = await connection.getLatestBlockhash();
13
+ const tx = txBuilder.toTransaction(blockhash);
14
+ tx.sign(mintAddress, publisher);
15
+ if (!dryRun) {
16
+ const txSig = await sendAndConfirmTransaction(connection, tx, [
17
+ publisher,
18
+ mintAddress,
19
+ ]);
20
+ console.info({ txSig, mintAddress: mintAddress.publicKey.toBase58() });
21
+ }
22
+ return { appAddress: mintAddress.publicKey.toBase58() };
23
+ };
24
+ export const createAppCommand = async ({ signer, url, dryRun, publisherMintAddress, }) => {
25
+ const connection = new Connection(url);
26
+ const { app: appDetails, publisher: publisherDetails } = await getConfigFile();
27
+ const { appAddress } = await createAppNft({
28
+ connection,
29
+ publisher: signer,
30
+ publisherMintAddress: publisherDetails.address ?? publisherMintAddress,
31
+ appDetails,
32
+ }, { dryRun });
33
+ // TODO(sdlaver): dry-run should not modify config
34
+ saveToConfig({ app: { address: appAddress } });
35
+ return { appAddress };
36
+ };
37
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../../src/commands/create/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AACvE,OAAO,EACL,UAAU,EACV,OAAO,EACP,SAAS,EACT,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,YAAY,GACb,MAAM,gBAAgB,CAAC;AAExB,MAAM,YAAY,GAAG,KAAK,EACxB,EACE,UAAU,EACV,UAAU,EACV,oBAAoB,EACpB,SAAS,GAMV,EACD,EAAE,MAAM,EAAwB,EAChC,EAAE;IACF,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IACvC,MAAM,QAAQ,GAAG,mBAAmB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAC5D,MAAM,SAAS,GAAG,MAAM,SAAS,CAC/B;QACE,oBAAoB,EAAE,IAAI,SAAS,CAAC,oBAAoB,CAAC;QACzD,WAAW;QACX,UAAU;KACX,EACD,EAAE,QAAQ,EAAE,SAAS,EAAE,CACxB,CAAC;IAEF,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,kBAAkB,EAAE,CAAC;IACxD,MAAM,EAAE,GAAG,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAC9C,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAEhC,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,KAAK,GAAG,MAAM,yBAAyB,CAAC,UAAU,EAAE,EAAE,EAAE;YAC5D,SAAS;YACT,WAAW;SACZ,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;KACxE;IAED,OAAO,EAAE,UAAU,EAAE,WAAW,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC;AAC1D,CAAC,CAAC;AASF,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,EACrC,MAAM,EACN,GAAG,EACH,MAAM,EACN,oBAAoB,GACE,EAAE,EAAE;IAC1B,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;IAEvC,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,GACpD,MAAM,aAAa,EAAE,CAAC;IAExB,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,YAAY,CACvC;QACE,UAAU;QACV,SAAS,EAAE,MAAM;QACjB,oBAAoB,EAAE,gBAAgB,CAAC,OAAO,IAAI,oBAAoB;QACtE,UAAU;KACX,EACD,EAAE,MAAM,EAAE,CACX,CAAC;IAEF,kDAAkD;IAClD,YAAY,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC;IAE/C,OAAO,EAAE,UAAU,EAAE,CAAC;AACxB,CAAC,CAAC"}
@@ -0,0 +1,44 @@
1
+ export * from "./publisher.js";
2
+ export * from "./app.js";
3
+ export * from "./release.js";
4
+ /*
5
+ * Module responsible for creating publishers, apps, and releases (in that order)
6
+ * Anything that is out-of-order will be prompted back into order
7
+ * And steps that happen more than once will do their best to remember as much information as possible.
8
+ * We will ask questions and do our best to answer anything that's already been configured, and prompt for anything that's not
9
+ */
10
+ // We'll never ask for private keys or seed phrases
11
+ // You can use a burner signer to publish; all NFTs require verification from the publisher signer
12
+ // You can use a multisig or Ledger for that purpose
13
+ // Publisher
14
+ // Public key attached to a publisher must also verify applications and releases
15
+ // Most information here can be be edited after the fact
16
+ // Only required fields are name, address, publisher website, and contact
17
+ // Optional fields are: description, image_url (need dimensions!)
18
+ // App
19
+ // Publisher creator key required
20
+ // Most information can be edited after the fact
21
+ // Required: name, description, `android_package`
22
+ // Optional: Any additional creator keys
23
+ // TODO(jon): Probably okay to capture more information here like:
24
+ // - `license_url`
25
+ // - `copyright_url`
26
+ // - `privacy_policy_url`
27
+ // Release
28
+ // Publisher creator key required
29
+ // Immutable; information cannot be edited after publishing.
30
+ // Change based on the review process must result in a new release
31
+ // Required:
32
+ // - version (automatically prompt with semver + 1)
33
+ // - release notes (description)
34
+ // - publisher creator key
35
+ // - path to the APK
36
+ // Optional:
37
+ // - Media related to the release
38
+ // - New permissions (prompted)
39
+ // - New languages (prompted)
40
+ // Handles uploads of all files, sha'ing them
41
+ // Handles i18n (later)
42
+ // We'll attempt to read as much as possible from a provided `.yml` file
43
+ // If there are provided folders that are well-structured, we'll opt to use that too.
44
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/create/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAE7B;;;;;GAKG;AAEH,mDAAmD;AACnD,kGAAkG;AAClG,oDAAoD;AAEpD,YAAY;AACZ,gFAAgF;AAChF,wDAAwD;AACxD,yEAAyE;AACzE,iEAAiE;AAEjE,MAAM;AACN,iCAAiC;AACjC,gDAAgD;AAChD,iDAAiD;AACjD,wCAAwC;AACxC,kEAAkE;AAClE,kBAAkB;AAClB,oBAAoB;AACpB,yBAAyB;AACzB,UAAU;AACV,iCAAiC;AACjC,4DAA4D;AAC5D,kEAAkE;AAClE,YAAY;AACZ,mDAAmD;AACnD,gCAAgC;AAChC,0BAA0B;AAC1B,oBAAoB;AACpB,YAAY;AACZ,iCAAiC;AACjC,+BAA+B;AAC/B,6BAA6B;AAC7B,6CAA6C;AAC7C,uBAAuB;AAEvB,wEAAwE;AACxE,qFAAqF"}
@@ -0,0 +1,33 @@
1
+ import { createPublisher } from "@solana-mobile/dapp-store-publishing-tools";
2
+ import { Connection, Keypair, sendAndConfirmTransaction, } from "@solana/web3.js";
3
+ import { getConfigFile, getMetaplexInstance, saveToConfig, } from "../../utils.js";
4
+ const createPublisherNft = async ({ connection, publisher, publisherDetails, }, { dryRun }) => {
5
+ const mintAddress = Keypair.generate();
6
+ const metaplex = getMetaplexInstance(connection, publisher);
7
+ console.info(`Creating publisher at address: ${mintAddress.publicKey.toBase58()}`);
8
+ const txBuilder = await createPublisher({ mintAddress, publisherDetails }, { metaplex, publisher });
9
+ const blockhash = await connection.getLatestBlockhash();
10
+ const tx = txBuilder.toTransaction(blockhash);
11
+ tx.sign(mintAddress, publisher);
12
+ if (!dryRun) {
13
+ const txSig = await sendAndConfirmTransaction(connection, tx, [
14
+ publisher,
15
+ mintAddress,
16
+ ]);
17
+ console.info({ txSig, mintAddress: mintAddress.publicKey.toBase58() });
18
+ }
19
+ return { publisherAddress: mintAddress.publicKey.toBase58() };
20
+ };
21
+ export const createPublisherCommand = async ({ signer, url, dryRun, }) => {
22
+ const connection = new Connection(url);
23
+ const { publisher: publisherDetails } = await getConfigFile();
24
+ const { publisherAddress } = await createPublisherNft({
25
+ connection,
26
+ publisher: signer,
27
+ publisherDetails,
28
+ }, { dryRun });
29
+ // TODO(sdlaver): dry-run should not modify config
30
+ saveToConfig({ publisher: { address: publisherAddress } });
31
+ return { publisherAddress };
32
+ };
33
+ //# sourceMappingURL=publisher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publisher.js","sourceRoot":"","sources":["../../../../src/commands/create/publisher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EACL,UAAU,EACV,OAAO,EACP,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,YAAY,GACb,MAAM,gBAAgB,CAAC;AAExB,MAAM,kBAAkB,GAAG,KAAK,EAC9B,EACE,UAAU,EACV,SAAS,EACT,gBAAgB,GAKjB,EACD,EAAE,MAAM,EAAuB,EAC/B,EAAE;IACF,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IACvC,MAAM,QAAQ,GAAG,mBAAmB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAC5D,OAAO,CAAC,IAAI,CACV,kCAAkC,WAAW,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,CACrE,CAAC;IACF,MAAM,SAAS,GAAG,MAAM,eAAe,CACrC,EAAE,WAAW,EAAE,gBAAgB,EAAE,EACjC,EAAE,QAAQ,EAAE,SAAS,EAAE,CACxB,CAAC;IAEF,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,kBAAkB,EAAE,CAAC;IACxD,MAAM,EAAE,GAAG,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAC9C,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAEhC,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,KAAK,GAAG,MAAM,yBAAyB,CAAC,UAAU,EAAE,EAAE,EAAE;YAC5D,SAAS;YACT,WAAW;SACZ,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;KACxE;IAED,OAAO,EAAE,gBAAgB,EAAE,WAAW,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC;AAChE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EAAE,EAC3C,MAAM,EACN,GAAG,EACH,MAAM,GAKP,EAAE,EAAE;IACH,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;IAEvC,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAG,MAAM,aAAa,EAAE,CAAC;IAE9D,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,kBAAkB,CACnD;QACE,UAAU;QACV,SAAS,EAAE,MAAM;QACjB,gBAAgB;KACjB,EACD,EAAE,MAAM,EAAE,CACX,CAAC;IAEF,kDAAkD;IAClD,YAAY,CAAC,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;IAE3D,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC9B,CAAC,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { createRelease } from "@solana-mobile/dapp-store-publishing-tools";
2
+ import { Connection, Keypair, PublicKey, sendAndConfirmTransaction, } from "@solana/web3.js";
3
+ import { getConfigFile, getMetaplexInstance, saveToConfig, } from "../../utils.js";
4
+ const createReleaseNft = async ({ appMintAddress, releaseDetails, appDetails, publisherDetails, connection, publisher, }) => {
5
+ const releaseMintAddress = Keypair.generate();
6
+ const metaplex = getMetaplexInstance(connection, publisher);
7
+ const { txBuilder } = await createRelease({
8
+ appMintAddress: new PublicKey(appMintAddress),
9
+ releaseMintAddress,
10
+ releaseDetails,
11
+ appDetails,
12
+ publisherDetails,
13
+ }, { metaplex, publisher });
14
+ const blockhash = await connection.getLatestBlockhash();
15
+ const tx = txBuilder.toTransaction(blockhash);
16
+ tx.sign(releaseMintAddress, publisher);
17
+ const txSig = await sendAndConfirmTransaction(connection, tx, [
18
+ publisher,
19
+ releaseMintAddress,
20
+ ]);
21
+ console.info({
22
+ txSig,
23
+ releaseMintAddress: releaseMintAddress.publicKey.toBase58(),
24
+ });
25
+ return { releaseAddress: releaseMintAddress.publicKey.toBase58() };
26
+ };
27
+ export const createReleaseCommand = async ({ appMintAddress, version, buildToolsPath, signer, url, dryRun = false, }) => {
28
+ const connection = new Connection(url);
29
+ const { release, app, publisher } = await getConfigFile(buildToolsPath);
30
+ if (!dryRun) {
31
+ const { releaseAddress } = await createReleaseNft({
32
+ appMintAddress: app.address ?? appMintAddress,
33
+ connection,
34
+ publisher: signer,
35
+ releaseDetails: {
36
+ ...release,
37
+ version,
38
+ },
39
+ appDetails: app,
40
+ publisherDetails: publisher,
41
+ });
42
+ saveToConfig({
43
+ release: { address: releaseAddress, version },
44
+ });
45
+ return { releaseAddress };
46
+ }
47
+ };
48
+ //# sourceMappingURL=release.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release.js","sourceRoot":"","sources":["../../../../src/commands/create/release.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EACL,UAAU,EACV,OAAO,EACP,SAAS,EACT,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,YAAY,GACb,MAAM,gBAAgB,CAAC;AAWxB,MAAM,gBAAgB,GAAG,KAAK,EAAE,EAC9B,cAAc,EACd,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,SAAS,GAQV,EAAE,EAAE;IACH,MAAM,kBAAkB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAE9C,MAAM,QAAQ,GAAG,mBAAmB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAE5D,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,aAAa,CACvC;QACE,cAAc,EAAE,IAAI,SAAS,CAAC,cAAc,CAAC;QAC7C,kBAAkB;QAClB,cAAc;QACd,UAAU;QACV,gBAAgB;KACjB,EACD,EAAE,QAAQ,EAAE,SAAS,EAAE,CACxB,CAAC;IAEF,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,kBAAkB,EAAE,CAAC;IACxD,MAAM,EAAE,GAAG,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAC9C,EAAE,CAAC,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;IAEvC,MAAM,KAAK,GAAG,MAAM,yBAAyB,CAAC,UAAU,EAAE,EAAE,EAAE;QAC5D,SAAS;QACT,kBAAkB;KACnB,CAAC,CAAC;IACH,OAAO,CAAC,IAAI,CAAC;QACX,KAAK;QACL,kBAAkB,EAAE,kBAAkB,CAAC,SAAS,CAAC,QAAQ,EAAE;KAC5D,CAAC,CAAC;IAEH,OAAO,EAAE,cAAc,EAAE,kBAAkB,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC;AACrE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EAAE,EACzC,cAAc,EACd,OAAO,EACP,cAAc,EACd,MAAM,EACN,GAAG,EACH,MAAM,GAAG,KAAK,GACY,EAAE,EAAE;IAC9B,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;IAEvC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,MAAM,aAAa,CAAC,cAAc,CAAC,CAAC;IAExE,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,gBAAgB,CAAC;YAChD,cAAc,EAAE,GAAG,CAAC,OAAO,IAAI,cAAc;YAC7C,UAAU;YACV,SAAS,EAAE,MAAM;YACjB,cAAc,EAAE;gBACd,GAAG,OAAO;gBACV,OAAO;aACR;YACD,UAAU,EAAE,GAAG;YACf,gBAAgB,EAAE,SAAS;SAC5B,CAAC,CAAC;QAEH,YAAY,CAAC;YACX,OAAO,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE;SAC9C,CAAC,CAAC;QAEH,OAAO,EAAE,cAAc,EAAE,CAAC;KAC3B;AACH,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./create/index.js";
2
+ export * from "./publish/index.js";
3
+ export * from "./validate.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
@@ -0,0 +1,25 @@
1
+ export * from "./remove.js";
2
+ export * from "./submit.js";
3
+ export * from "./support.js";
4
+ export * from "./update.js";
5
+ /*
6
+ * Module responsible for submitting requests to the Solana dApp Store publisher portal
7
+ * Anything that is out-of-order will be prompted back into order
8
+ * And steps that happen more than once will do their best to remember as much information as possible.
9
+ * We will ask questions and do our best to answer anything that's already been configured, and prompt for anything that's not
10
+ */
11
+ // We'll never ask for private keys or seed phrases
12
+ // You must use the same signer(s) when submitting requests to the publisher portal as was used to publish
13
+ // your app on-chain.
14
+ // The Solana Mobile dApp publisher portal supports 4 different requests: `submit`, `update`, `remove`, and `support`.
15
+ // Each request includes:
16
+ // - a 32-digit randomly generated unique identifier
17
+ // - an attestation payload, signed with the private key of the dApp collection update authority
18
+ // - the dApp release NFT address
19
+ // - contact and company information for the requestor
20
+ // - a self-attestation that the requestor is authorized to make this request
21
+ // - additional fields, specific to the request type in question
22
+ // We'll attempt to read as much as possible from a provided `.yml` file
23
+ // If there are provided folders that are well-structured, we'll opt to use that too.
24
+ // Requests and responses are logged to the console, to facilitate use in an automated CI/CD environment.
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/publish/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAE5B;;;;;GAKG;AAEH,mDAAmD;AACnD,0GAA0G;AAC1G,qBAAqB;AAErB,sHAAsH;AACtH,yBAAyB;AACzB,oDAAoD;AACpD,gGAAgG;AAChG,iCAAiC;AACjC,sDAAsD;AACtD,6EAA6E;AAC7E,gEAAgE;AAEhE,wEAAwE;AACxE,qFAAqF;AAErF,yGAAyG"}
@@ -0,0 +1,20 @@
1
+ import { Connection } from "@solana/web3.js";
2
+ import { publishRemove } from "@solana-mobile/dapp-store-publishing-tools";
3
+ import { getConfigFile } from "../../utils.js";
4
+ import nacl from "tweetnacl";
5
+ export const publishRemoveCommand = async ({ releaseMintAddress, signer, url, dryRun = false, requestorIsAuthorized = false, critical = false, }) => {
6
+ if (!requestorIsAuthorized) {
7
+ console.error("ERROR: Cannot submit a request for which the requestor does not attest they are authorized to do so");
8
+ return;
9
+ }
10
+ const connection = new Connection(url);
11
+ const { publisher: publisherDetails } = await getConfigFile();
12
+ const sign = ((buf) => nacl.sign(buf, signer.secretKey));
13
+ await publishRemove({ connection, sign }, {
14
+ releaseMintAddress,
15
+ publisherDetails,
16
+ requestorIsAuthorized,
17
+ criticalUpdate: critical,
18
+ }, dryRun);
19
+ };
20
+ //# sourceMappingURL=remove.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove.js","sourceRoot":"","sources":["../../../../src/commands/publish/remove.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAW,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,IAAI,MAAM,WAAW,CAAC;AAW7B,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EAAE,EACzC,kBAAkB,EAClB,MAAM,EACN,GAAG,EACH,MAAM,GAAG,KAAK,EACd,qBAAqB,GAAG,KAAK,EAC7B,QAAQ,GAAG,KAAK,GACU,EAAE,EAAE;IAC9B,IAAI,CAAC,qBAAqB,EAAE;QAC1B,OAAO,CAAC,KAAK,CACX,qGAAqG,CACtG,CAAC;QACF,OAAO;KACR;IAED,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAG,MAAM,aAAa,EAAE,CAAC;IAC9D,MAAM,IAAI,GAAG,CAAC,CAAC,GAAW,EAAE,EAAE,CAC5B,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,SAAS,CAAC,CAA6B,CAAC;IAEhE,MAAM,aAAa,CACjB,EAAE,UAAU,EAAE,IAAI,EAAE,EACpB;QACE,kBAAkB;QAClB,gBAAgB;QAChB,qBAAqB;QACrB,cAAc,EAAE,QAAQ;KACzB,EACD,MAAM,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { Connection } from "@solana/web3.js";
2
+ import { publishSubmit } from "@solana-mobile/dapp-store-publishing-tools";
3
+ import nacl from "tweetnacl";
4
+ import { getConfigFile } from "../../utils.js";
5
+ export const publishSubmitCommand = async ({ releaseMintAddress, signer, url, dryRun = false, compliesWithSolanaDappStorePolicies = false, requestorIsAuthorized = false, }) => {
6
+ if (!compliesWithSolanaDappStorePolicies) {
7
+ console.error("ERROR: Cannot submit a request for which the requestor does not attest that it complies with Solana dApp Store policies");
8
+ return;
9
+ }
10
+ else if (!requestorIsAuthorized) {
11
+ console.error("ERROR: Cannot submit a request for which the requestor does not attest they are authorized to do so");
12
+ return;
13
+ }
14
+ const connection = new Connection(url);
15
+ const { publisher: publisherDetails, solana_mobile_dapp_publisher_portal: solanaMobileDappPublisherPortalDetails, } = await getConfigFile();
16
+ const sign = ((buf) => nacl.sign(buf, signer.secretKey));
17
+ await publishSubmit({ connection, sign }, {
18
+ releaseMintAddress,
19
+ publisherDetails,
20
+ solanaMobileDappPublisherPortalDetails,
21
+ compliesWithSolanaDappStorePolicies,
22
+ requestorIsAuthorized,
23
+ }, dryRun);
24
+ };
25
+ //# sourceMappingURL=submit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submit.js","sourceRoot":"","sources":["../../../../src/commands/publish/submit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAW,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAW/C,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EAAE,EACzC,kBAAkB,EAClB,MAAM,EACN,GAAG,EACH,MAAM,GAAG,KAAK,EACd,mCAAmC,GAAG,KAAK,EAC3C,qBAAqB,GAAG,KAAK,GACH,EAAE,EAAE;IAC9B,IAAI,CAAC,mCAAmC,EAAE;QACxC,OAAO,CAAC,KAAK,CACX,yHAAyH,CAC1H,CAAC;QACF,OAAO;KACR;SAAM,IAAI,CAAC,qBAAqB,EAAE;QACjC,OAAO,CAAC,KAAK,CACX,qGAAqG,CACtG,CAAC;QACF,OAAO;KACR;IAED,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,EACJ,SAAS,EAAE,gBAAgB,EAC3B,mCAAmC,EAAE,sCAAsC,GAC5E,GAAG,MAAM,aAAa,EAAE,CAAC;IAC1B,MAAM,IAAI,GAAG,CAAC,CAAC,GAAW,EAAE,EAAE,CAC5B,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,SAAS,CAAC,CAA6B,CAAC;IAEhE,MAAM,aAAa,CACjB,EAAE,UAAU,EAAE,IAAI,EAAE,EACpB;QACE,kBAAkB;QAClB,gBAAgB;QAChB,sCAAsC;QACtC,mCAAmC;QACnC,qBAAqB;KACtB,EACD,MAAM,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Connection } from "@solana/web3.js";
2
+ import { publishSupport } from "@solana-mobile/dapp-store-publishing-tools";
3
+ import { getConfigFile } from "../../utils.js";
4
+ import nacl from "tweetnacl";
5
+ export const publishSupportCommand = async ({ releaseMintAddress, signer, url, dryRun = false, requestorIsAuthorized = false, requestDetails, }) => {
6
+ if (!requestorIsAuthorized) {
7
+ console.error("ERROR: Cannot submit a request for which the requestor does not attest they are authorized to do so");
8
+ return;
9
+ }
10
+ const connection = new Connection(url);
11
+ const { publisher: publisherDetails } = await getConfigFile();
12
+ const sign = ((buf) => nacl.sign(buf, signer.secretKey));
13
+ await publishSupport({ connection, sign }, {
14
+ releaseMintAddress,
15
+ publisherDetails,
16
+ requestorIsAuthorized,
17
+ requestDetails,
18
+ }, dryRun);
19
+ };
20
+ //# sourceMappingURL=support.js.map