@misonetwork/sdk 0.8.0 → 0.9.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 (207) hide show
  1. package/README.md +48 -38
  2. package/dist/client.d.ts +3 -17
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +18 -3
  5. package/dist/client.js.map +1 -1
  6. package/dist/contracts/miso/composition.d.ts +0 -14
  7. package/dist/contracts/miso/composition.d.ts.map +1 -1
  8. package/dist/contracts/miso/composition.js +0 -15
  9. package/dist/contracts/miso/composition.js.map +1 -1
  10. package/dist/contracts/miso/recording.d.ts +0 -15
  11. package/dist/contracts/miso/recording.d.ts.map +1 -1
  12. package/dist/contracts/miso/recording.js +0 -15
  13. package/dist/contracts/miso/recording.js.map +1 -1
  14. package/dist/contracts/miso/release.d.ts +0 -11
  15. package/dist/contracts/miso/release.d.ts.map +1 -1
  16. package/dist/contracts/miso/release.js +0 -14
  17. package/dist/contracts/miso/release.js.map +1 -1
  18. package/dist/contracts/miso_party/deps/sui/vec_set.d.ts +21 -0
  19. package/dist/contracts/miso_party/deps/sui/vec_set.d.ts.map +1 -0
  20. package/dist/contracts/miso_party/deps/sui/vec_set.js +20 -0
  21. package/dist/contracts/miso_party/deps/sui/vec_set.js.map +1 -0
  22. package/dist/contracts/miso_party/party.d.ts +481 -0
  23. package/dist/contracts/miso_party/party.d.ts.map +1 -0
  24. package/dist/contracts/miso_party/party.js +527 -0
  25. package/dist/contracts/miso_party/party.js.map +1 -0
  26. package/dist/contracts/party_cta/party_cta.d.ts +120 -0
  27. package/dist/contracts/party_cta/party_cta.d.ts.map +1 -0
  28. package/dist/contracts/party_cta/party_cta.js +139 -0
  29. package/dist/contracts/party_cta/party_cta.js.map +1 -0
  30. package/dist/contracts/party_genre/party_genre.d.ts +117 -0
  31. package/dist/contracts/party_genre/party_genre.d.ts.map +1 -0
  32. package/dist/contracts/party_genre/party_genre.js +131 -0
  33. package/dist/contracts/party_genre/party_genre.js.map +1 -0
  34. package/dist/contracts/party_media/party_media.d.ts +86 -0
  35. package/dist/contracts/party_media/party_media.d.ts.map +1 -0
  36. package/dist/contracts/party_media/party_media.js +97 -0
  37. package/dist/contracts/party_media/party_media.js.map +1 -0
  38. package/dist/contracts/party_music/party_music.d.ts +209 -0
  39. package/dist/contracts/party_music/party_music.d.ts.map +1 -0
  40. package/dist/contracts/party_music/party_music.js +259 -0
  41. package/dist/contracts/party_music/party_music.js.map +1 -0
  42. package/dist/contracts/party_platform_link/party_platform_link.d.ts +89 -0
  43. package/dist/contracts/party_platform_link/party_platform_link.d.ts.map +1 -0
  44. package/dist/contracts/party_platform_link/party_platform_link.js +92 -0
  45. package/dist/contracts/party_platform_link/party_platform_link.js.map +1 -0
  46. package/dist/contracts/party_pro_link/party_pro_link.d.ts +233 -0
  47. package/dist/contracts/party_pro_link/party_pro_link.d.ts.map +1 -0
  48. package/dist/contracts/party_pro_link/party_pro_link.js +289 -0
  49. package/dist/contracts/party_pro_link/party_pro_link.js.map +1 -0
  50. package/dist/contracts/party_profile/deps/country_code/country_code.d.ts +15 -0
  51. package/dist/contracts/party_profile/deps/country_code/country_code.d.ts.map +1 -0
  52. package/dist/contracts/party_profile/deps/country_code/country_code.js +17 -0
  53. package/dist/contracts/party_profile/deps/country_code/country_code.js.map +1 -0
  54. package/dist/contracts/party_profile/deps/language_code/language_code.d.ts +6 -0
  55. package/dist/contracts/party_profile/deps/language_code/language_code.d.ts.map +1 -0
  56. package/dist/contracts/party_profile/deps/language_code/language_code.js +8 -0
  57. package/dist/contracts/party_profile/deps/language_code/language_code.js.map +1 -0
  58. package/dist/contracts/party_profile/party_profile.d.ts +133 -0
  59. package/dist/contracts/party_profile/party_profile.d.ts.map +1 -0
  60. package/dist/contracts/party_profile/party_profile.js +153 -0
  61. package/dist/contracts/party_profile/party_profile.js.map +1 -0
  62. package/dist/contracts/party_roles/party_roles.d.ts +201 -0
  63. package/dist/contracts/party_roles/party_roles.d.ts.map +1 -0
  64. package/dist/contracts/party_roles/party_roles.js +237 -0
  65. package/dist/contracts/party_roles/party_roles.js.map +1 -0
  66. package/dist/contracts/party_social/party_social.d.ts +258 -0
  67. package/dist/contracts/party_social/party_social.d.ts.map +1 -0
  68. package/dist/contracts/party_social/party_social.js +320 -0
  69. package/dist/contracts/party_social/party_social.js.map +1 -0
  70. package/dist/contracts/party_tags/party_tags.d.ts +116 -0
  71. package/dist/contracts/party_tags/party_tags.d.ts.map +1 -0
  72. package/dist/contracts/party_tags/party_tags.js +130 -0
  73. package/dist/contracts/party_tags/party_tags.js.map +1 -0
  74. package/dist/contracts/routed_stake/routed_stake.d.ts +0 -14
  75. package/dist/contracts/routed_stake/routed_stake.d.ts.map +1 -1
  76. package/dist/contracts/routed_stake/routed_stake.js +0 -14
  77. package/dist/contracts/routed_stake/routed_stake.js.map +1 -1
  78. package/dist/contracts/royalty_pool/pool.d.ts +0 -14
  79. package/dist/contracts/royalty_pool/pool.d.ts.map +1 -1
  80. package/dist/contracts/royalty_pool/pool.js +0 -14
  81. package/dist/contracts/royalty_pool/pool.js.map +1 -1
  82. package/dist/contracts/royalty_pool/stake.d.ts +6 -13
  83. package/dist/contracts/royalty_pool/stake.d.ts.map +1 -1
  84. package/dist/contracts/royalty_pool/stake.js +6 -14
  85. package/dist/contracts/royalty_pool/stake.js.map +1 -1
  86. package/dist/contracts.d.ts +13 -2
  87. package/dist/contracts.d.ts.map +1 -1
  88. package/dist/contracts.js +14 -2
  89. package/dist/contracts.js.map +1 -1
  90. package/dist/deployments.d.ts +73 -14
  91. package/dist/deployments.d.ts.map +1 -1
  92. package/dist/deployments.js +53 -13
  93. package/dist/deployments.js.map +1 -1
  94. package/dist/events.d.ts +0 -14
  95. package/dist/events.d.ts.map +1 -1
  96. package/dist/events.js +0 -4
  97. package/dist/events.js.map +1 -1
  98. package/dist/index.d.ts +2 -0
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/index.js +1 -0
  101. package/dist/index.js.map +1 -1
  102. package/dist/packages.d.ts +39 -4
  103. package/dist/packages.d.ts.map +1 -1
  104. package/dist/packages.js +39 -4
  105. package/dist/packages.js.map +1 -1
  106. package/dist/party/client.d.ts +233 -0
  107. package/dist/party/client.d.ts.map +1 -0
  108. package/dist/party/client.js +222 -0
  109. package/dist/party/client.js.map +1 -0
  110. package/dist/party/extensions/ctas.d.ts +19 -0
  111. package/dist/party/extensions/ctas.d.ts.map +1 -0
  112. package/dist/party/extensions/ctas.js +25 -0
  113. package/dist/party/extensions/ctas.js.map +1 -0
  114. package/dist/party/extensions/genres.d.ts +27 -0
  115. package/dist/party/extensions/genres.d.ts.map +1 -0
  116. package/dist/party/extensions/genres.js +31 -0
  117. package/dist/party/extensions/genres.js.map +1 -0
  118. package/dist/party/extensions/links.d.ts +65 -0
  119. package/dist/party/extensions/links.d.ts.map +1 -0
  120. package/dist/party/extensions/links.js +117 -0
  121. package/dist/party/extensions/links.js.map +1 -0
  122. package/dist/party/extensions/media.d.ts +36 -0
  123. package/dist/party/extensions/media.d.ts.map +1 -0
  124. package/dist/party/extensions/media.js +45 -0
  125. package/dist/party/extensions/media.js.map +1 -0
  126. package/dist/party/extensions/profile.d.ts +24 -0
  127. package/dist/party/extensions/profile.d.ts.map +1 -0
  128. package/dist/party/extensions/profile.js +48 -0
  129. package/dist/party/extensions/profile.js.map +1 -0
  130. package/dist/party/extensions/roles.d.ts +37 -0
  131. package/dist/party/extensions/roles.d.ts.map +1 -0
  132. package/dist/party/extensions/roles.js +46 -0
  133. package/dist/party/extensions/roles.js.map +1 -0
  134. package/dist/party/extensions/tags.d.ts +25 -0
  135. package/dist/party/extensions/tags.d.ts.map +1 -0
  136. package/dist/party/extensions/tags.js +25 -0
  137. package/dist/party/extensions/tags.js.map +1 -0
  138. package/dist/party/index.d.ts +12 -0
  139. package/dist/party/index.d.ts.map +1 -0
  140. package/dist/party/index.js +14 -0
  141. package/dist/party/index.js.map +1 -0
  142. package/dist/party/internal.d.ts +15 -0
  143. package/dist/party/internal.d.ts.map +1 -0
  144. package/dist/party/internal.js +103 -0
  145. package/dist/party/internal.js.map +1 -0
  146. package/dist/party/queries.d.ts +38 -0
  147. package/dist/party/queries.d.ts.map +1 -0
  148. package/dist/party/queries.js +232 -0
  149. package/dist/party/queries.js.map +1 -0
  150. package/dist/party/transactions.d.ts +74 -0
  151. package/dist/party/transactions.d.ts.map +1 -0
  152. package/dist/party/transactions.js +85 -0
  153. package/dist/party/transactions.js.map +1 -0
  154. package/dist/party/types.d.ts +54 -0
  155. package/dist/party/types.d.ts.map +1 -0
  156. package/dist/party/types.js +4 -0
  157. package/dist/party/types.js.map +1 -0
  158. package/package.json +6 -2
  159. package/src/client.ts +21 -3
  160. package/src/contracts/miso/composition.ts +0 -27
  161. package/src/contracts/miso/recording.ts +0 -28
  162. package/src/contracts/miso/release.ts +0 -23
  163. package/src/contracts/miso_party/deps/sui/vec_set.ts +21 -0
  164. package/src/contracts/miso_party/party.ts +797 -0
  165. package/src/contracts/party_cta/party_cta.ts +212 -0
  166. package/src/contracts/party_genre/party_genre.ts +199 -0
  167. package/src/contracts/party_media/party_media.ts +141 -0
  168. package/src/contracts/party_music/party_music.ts +405 -0
  169. package/src/contracts/party_platform_link/party_platform_link.ts +148 -0
  170. package/src/contracts/party_pro_link/party_pro_link.ts +453 -0
  171. package/src/contracts/party_profile/deps/country_code/country_code.ts +19 -0
  172. package/src/contracts/party_profile/deps/language_code/language_code.ts +7 -0
  173. package/src/contracts/party_profile/party_profile.ts +239 -0
  174. package/src/contracts/party_roles/party_roles.ts +363 -0
  175. package/src/contracts/party_social/party_social.ts +502 -0
  176. package/src/contracts/party_tags/party_tags.ts +198 -0
  177. package/src/contracts/routed_stake/routed_stake.ts +0 -27
  178. package/src/contracts/royalty_pool/pool.ts +0 -27
  179. package/src/contracts/royalty_pool/stake.ts +6 -26
  180. package/src/contracts.ts +15 -2
  181. package/src/deployments.ts +56 -14
  182. package/src/events.ts +0 -4
  183. package/src/index.ts +2 -0
  184. package/src/packages.ts +40 -8
  185. package/src/party/client.ts +283 -0
  186. package/src/party/extensions/ctas.ts +46 -0
  187. package/src/party/extensions/genres.ts +62 -0
  188. package/src/party/extensions/links.ts +185 -0
  189. package/src/party/extensions/media.ts +72 -0
  190. package/src/party/extensions/profile.ts +81 -0
  191. package/src/party/extensions/roles.ts +94 -0
  192. package/src/party/extensions/tags.ts +54 -0
  193. package/src/party/index.ts +14 -0
  194. package/src/party/internal.ts +119 -0
  195. package/src/party/queries.ts +303 -0
  196. package/src/party/transactions.ts +167 -0
  197. package/src/party/types.ts +95 -0
  198. package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.d.ts +0 -52
  199. package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.d.ts.map +0 -1
  200. package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.js +0 -37
  201. package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.js.map +0 -1
  202. package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.d.ts +0 -91
  203. package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.d.ts.map +0 -1
  204. package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.js +0 -91
  205. package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.js.map +0 -1
  206. package/src/contracts/release_snapshot_bundle/deps/ori/walrus_data.ts +0 -36
  207. package/src/contracts/release_snapshot_bundle/release_snapshot_bundle.ts +0 -124
@@ -0,0 +1,212 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /**
7
+ * Off-Miso call-to-action links for a party — the "what do you want people to do"
8
+ * row (Tickets, Merch, Newsletter, external Listen, …).
9
+ *
10
+ * Deliberately slim: a CTA is just a `{ label, url }`. On-Miso actions (collect /
11
+ * listen-on-Miso / pin) are a different, interactive concern and live in
12
+ * `party_featured`, which references object ids and can render live state — so
13
+ * this package stays a plain, dependency-light external link hub.
14
+ *
15
+ * The CTAs are an ordered list: **position is priority**. The whole list is
16
+ * written at once (`set_ctas`) — the natural fit for a drag-to-reorder editor that
17
+ * saves on submit — so there are no per-entry ids to track. Gated by the
18
+ * `PartyAdminCap`; views are permissionless.
19
+ */
20
+
21
+ import { MoveTuple, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.ts';
22
+ import { bcs } from '@mysten/sui/bcs';
23
+ import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
24
+ const $moduleName = '@local-pkg/party_cta::party_cta';
25
+ export const CtasKey = new MoveTuple({ name: `${$moduleName}::CtasKey`, fields: [bcs.bool()] });
26
+ export const Cta = new MoveStruct({ name: `${$moduleName}::Cta`, fields: {
27
+ label: bcs.string(),
28
+ url: bcs.string()
29
+ } });
30
+ export const CtasSetEvent = new MoveStruct({ name: `${$moduleName}::CtasSetEvent`, fields: {
31
+ party_id: bcs.Address,
32
+ count: bcs.u64()
33
+ } });
34
+ export const CtasClearedEvent = new MoveStruct({ name: `${$moduleName}::CtasClearedEvent`, fields: {
35
+ party_id: bcs.Address
36
+ } });
37
+ export interface NewCtaArguments {
38
+ label: RawTransactionArgument<string>;
39
+ url: RawTransactionArgument<string>;
40
+ }
41
+ export interface NewCtaOptions {
42
+ package?: string;
43
+ arguments: NewCtaArguments | [
44
+ label: RawTransactionArgument<string>,
45
+ url: RawTransactionArgument<string>
46
+ ];
47
+ }
48
+ /**
49
+ * Builds a CTA. Aborts if the label or url is empty or too long. Callers build the
50
+ * ordered `vector<Cta>` client-side and submit it with `set_ctas`.
51
+ */
52
+ export function newCta(options: NewCtaOptions) {
53
+ const packageAddress = options.package ?? '@local-pkg/party_cta';
54
+ const argumentsTypes = [
55
+ '0x1::string::String',
56
+ '0x1::string::String'
57
+ ] satisfies (string | null)[];
58
+ const parameterNames = ["label", "url"];
59
+ return (tx: Transaction) => tx.moveCall({
60
+ package: packageAddress,
61
+ module: 'party_cta',
62
+ function: 'new_cta',
63
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
64
+ });
65
+ }
66
+ export interface LabelArguments {
67
+ self: TransactionArgument;
68
+ }
69
+ export interface LabelOptions {
70
+ package?: string;
71
+ arguments: LabelArguments | [
72
+ self: TransactionArgument
73
+ ];
74
+ }
75
+ /** The CTA's display label. */
76
+ export function label(options: LabelOptions) {
77
+ const packageAddress = options.package ?? '@local-pkg/party_cta';
78
+ const argumentsTypes = [
79
+ null
80
+ ] satisfies (string | null)[];
81
+ const parameterNames = ["self"];
82
+ return (tx: Transaction) => tx.moveCall({
83
+ package: packageAddress,
84
+ module: 'party_cta',
85
+ function: 'label',
86
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
87
+ });
88
+ }
89
+ export interface UrlArguments {
90
+ self: TransactionArgument;
91
+ }
92
+ export interface UrlOptions {
93
+ package?: string;
94
+ arguments: UrlArguments | [
95
+ self: TransactionArgument
96
+ ];
97
+ }
98
+ /** The CTA's destination url. */
99
+ export function url(options: UrlOptions) {
100
+ const packageAddress = options.package ?? '@local-pkg/party_cta';
101
+ const argumentsTypes = [
102
+ null
103
+ ] satisfies (string | null)[];
104
+ const parameterNames = ["self"];
105
+ return (tx: Transaction) => tx.moveCall({
106
+ package: packageAddress,
107
+ module: 'party_cta',
108
+ function: 'url',
109
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
110
+ });
111
+ }
112
+ export interface SetCtasArguments {
113
+ self: RawTransactionArgument<string>;
114
+ cap: RawTransactionArgument<string>;
115
+ ctas: TransactionArgument;
116
+ }
117
+ export interface SetCtasOptions {
118
+ package?: string;
119
+ arguments: SetCtasArguments | [
120
+ self: RawTransactionArgument<string>,
121
+ cap: RawTransactionArgument<string>,
122
+ ctas: TransactionArgument
123
+ ];
124
+ }
125
+ /** Sets (or replaces) the party's ordered CTA list. Position is priority. */
126
+ export function setCtas(options: SetCtasOptions) {
127
+ const packageAddress = options.package ?? '@local-pkg/party_cta';
128
+ const argumentsTypes = [
129
+ null,
130
+ null,
131
+ 'vector<null>'
132
+ ] satisfies (string | null)[];
133
+ const parameterNames = ["self", "cap", "ctas"];
134
+ return (tx: Transaction) => tx.moveCall({
135
+ package: packageAddress,
136
+ module: 'party_cta',
137
+ function: 'set_ctas',
138
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
139
+ });
140
+ }
141
+ export interface ClearCtasArguments {
142
+ self: RawTransactionArgument<string>;
143
+ cap: RawTransactionArgument<string>;
144
+ }
145
+ export interface ClearCtasOptions {
146
+ package?: string;
147
+ arguments: ClearCtasArguments | [
148
+ self: RawTransactionArgument<string>,
149
+ cap: RawTransactionArgument<string>
150
+ ];
151
+ }
152
+ /** Removes the party's CTA list. No-op if none is set. */
153
+ export function clearCtas(options: ClearCtasOptions) {
154
+ const packageAddress = options.package ?? '@local-pkg/party_cta';
155
+ const argumentsTypes = [
156
+ null,
157
+ null
158
+ ] satisfies (string | null)[];
159
+ const parameterNames = ["self", "cap"];
160
+ return (tx: Transaction) => tx.moveCall({
161
+ package: packageAddress,
162
+ module: 'party_cta',
163
+ function: 'clear_ctas',
164
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
165
+ });
166
+ }
167
+ export interface HasCtasArguments {
168
+ self: RawTransactionArgument<string>;
169
+ }
170
+ export interface HasCtasOptions {
171
+ package?: string;
172
+ arguments: HasCtasArguments | [
173
+ self: RawTransactionArgument<string>
174
+ ];
175
+ }
176
+ /** Whether the party has a CTA list. */
177
+ export function hasCtas(options: HasCtasOptions) {
178
+ const packageAddress = options.package ?? '@local-pkg/party_cta';
179
+ const argumentsTypes = [
180
+ null
181
+ ] satisfies (string | null)[];
182
+ const parameterNames = ["self"];
183
+ return (tx: Transaction) => tx.moveCall({
184
+ package: packageAddress,
185
+ module: 'party_cta',
186
+ function: 'has_ctas',
187
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
188
+ });
189
+ }
190
+ export interface CtasArguments {
191
+ self: RawTransactionArgument<string>;
192
+ }
193
+ export interface CtasOptions {
194
+ package?: string;
195
+ arguments: CtasArguments | [
196
+ self: RawTransactionArgument<string>
197
+ ];
198
+ }
199
+ /** The party's ordered CTA list (empty if unset). */
200
+ export function ctas(options: CtasOptions) {
201
+ const packageAddress = options.package ?? '@local-pkg/party_cta';
202
+ const argumentsTypes = [
203
+ null
204
+ ] satisfies (string | null)[];
205
+ const parameterNames = ["self"];
206
+ return (tx: Transaction) => tx.moveCall({
207
+ package: packageAddress,
208
+ module: 'party_cta',
209
+ function: 'ctas',
210
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
211
+ });
212
+ }
@@ -0,0 +1,199 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /**
7
+ * Musical-genre tags for a party, piggybacking the Miso genre vocabulary.
8
+ *
9
+ * Stores a set of `genre::Genre` object ids — the same canonical, name-derived
10
+ * genres the shared vocabulary primitive mints, so a party's genres reference
11
+ * exactly the ids releases (and anything else) use. Adding a genre takes a
12
+ * `&Genre`, proving the id is a real vocabulary entry; removal is by id. Genre is
13
+ * presentation, not protocol-verifiable state, so a party's genres are a
14
+ * lightweight display tag list — no primary/secondary ranking, no anti-churn
15
+ * locks. The set mechanics — storage, duplicate and capacity checks, field
16
+ * reclamation — live in the shared `typed_set` primitive; this package keeps the
17
+ * vocabulary proof, the capacity, and the typed events. Duplicate / not-present /
18
+ * over-max aborts come from `typed_set` with its own error codes. All writes are
19
+ * gated by the `PartyAdminCap`; views are permissionless.
20
+ */
21
+
22
+ import { MoveTuple, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.ts';
23
+ import { bcs } from '@mysten/sui/bcs';
24
+ import { type Transaction } from '@mysten/sui/transactions';
25
+ const $moduleName = '@local-pkg/party_genre::party_genre';
26
+ export const GenresKey = new MoveTuple({ name: `${$moduleName}::GenresKey`, fields: [bcs.bool()] });
27
+ export const GenreAddedEvent = new MoveStruct({ name: `${$moduleName}::GenreAddedEvent`, fields: {
28
+ party_id: bcs.Address,
29
+ genre_id: bcs.Address
30
+ } });
31
+ export const GenreRemovedEvent = new MoveStruct({ name: `${$moduleName}::GenreRemovedEvent`, fields: {
32
+ party_id: bcs.Address,
33
+ genre_id: bcs.Address
34
+ } });
35
+ export const GenresClearedEvent = new MoveStruct({ name: `${$moduleName}::GenresClearedEvent`, fields: {
36
+ party_id: bcs.Address
37
+ } });
38
+ export interface AddGenreArguments {
39
+ self: RawTransactionArgument<string>;
40
+ cap: RawTransactionArgument<string>;
41
+ genre: RawTransactionArgument<string>;
42
+ }
43
+ export interface AddGenreOptions {
44
+ package?: string;
45
+ arguments: AddGenreArguments | [
46
+ self: RawTransactionArgument<string>,
47
+ cap: RawTransactionArgument<string>,
48
+ genre: RawTransactionArgument<string>
49
+ ];
50
+ }
51
+ /**
52
+ * Adds a genre to the party. Takes `&Genre` so only a real vocabulary entry can be
53
+ * tagged. Aborts in `typed_set` if already present or the max is reached.
54
+ */
55
+ export function addGenre(options: AddGenreOptions) {
56
+ const packageAddress = options.package ?? '@local-pkg/party_genre';
57
+ const argumentsTypes = [
58
+ null,
59
+ null,
60
+ null
61
+ ] satisfies (string | null)[];
62
+ const parameterNames = ["self", "cap", "genre"];
63
+ return (tx: Transaction) => tx.moveCall({
64
+ package: packageAddress,
65
+ module: 'party_genre',
66
+ function: 'add_genre',
67
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
68
+ });
69
+ }
70
+ export interface RemoveGenreArguments {
71
+ self: RawTransactionArgument<string>;
72
+ cap: RawTransactionArgument<string>;
73
+ genreId: RawTransactionArgument<string>;
74
+ }
75
+ export interface RemoveGenreOptions {
76
+ package?: string;
77
+ arguments: RemoveGenreArguments | [
78
+ self: RawTransactionArgument<string>,
79
+ cap: RawTransactionArgument<string>,
80
+ genreId: RawTransactionArgument<string>
81
+ ];
82
+ }
83
+ /**
84
+ * Removes a genre from the party. Aborts in `typed_set` if not present. The whole
85
+ * field is dropped when the last genre leaves.
86
+ */
87
+ export function removeGenre(options: RemoveGenreOptions) {
88
+ const packageAddress = options.package ?? '@local-pkg/party_genre';
89
+ const argumentsTypes = [
90
+ null,
91
+ null,
92
+ '0x2::object::ID'
93
+ ] satisfies (string | null)[];
94
+ const parameterNames = ["self", "cap", "genreId"];
95
+ return (tx: Transaction) => tx.moveCall({
96
+ package: packageAddress,
97
+ module: 'party_genre',
98
+ function: 'remove_genre',
99
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
100
+ });
101
+ }
102
+ export interface ClearGenresArguments {
103
+ self: RawTransactionArgument<string>;
104
+ cap: RawTransactionArgument<string>;
105
+ }
106
+ export interface ClearGenresOptions {
107
+ package?: string;
108
+ arguments: ClearGenresArguments | [
109
+ self: RawTransactionArgument<string>,
110
+ cap: RawTransactionArgument<string>
111
+ ];
112
+ }
113
+ /** Removes the party's entire genre set. No-op if none is set. */
114
+ export function clearGenres(options: ClearGenresOptions) {
115
+ const packageAddress = options.package ?? '@local-pkg/party_genre';
116
+ const argumentsTypes = [
117
+ null,
118
+ null
119
+ ] satisfies (string | null)[];
120
+ const parameterNames = ["self", "cap"];
121
+ return (tx: Transaction) => tx.moveCall({
122
+ package: packageAddress,
123
+ module: 'party_genre',
124
+ function: 'clear_genres',
125
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
126
+ });
127
+ }
128
+ export interface HasGenresArguments {
129
+ self: RawTransactionArgument<string>;
130
+ }
131
+ export interface HasGenresOptions {
132
+ package?: string;
133
+ arguments: HasGenresArguments | [
134
+ self: RawTransactionArgument<string>
135
+ ];
136
+ }
137
+ /** Whether the party carries any genres. */
138
+ export function hasGenres(options: HasGenresOptions) {
139
+ const packageAddress = options.package ?? '@local-pkg/party_genre';
140
+ const argumentsTypes = [
141
+ null
142
+ ] satisfies (string | null)[];
143
+ const parameterNames = ["self"];
144
+ return (tx: Transaction) => tx.moveCall({
145
+ package: packageAddress,
146
+ module: 'party_genre',
147
+ function: 'has_genres',
148
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
149
+ });
150
+ }
151
+ export interface HasGenreArguments {
152
+ self: RawTransactionArgument<string>;
153
+ genreId: RawTransactionArgument<string>;
154
+ }
155
+ export interface HasGenreOptions {
156
+ package?: string;
157
+ arguments: HasGenreArguments | [
158
+ self: RawTransactionArgument<string>,
159
+ genreId: RawTransactionArgument<string>
160
+ ];
161
+ }
162
+ /** Whether the party carries the given genre. */
163
+ export function hasGenre(options: HasGenreOptions) {
164
+ const packageAddress = options.package ?? '@local-pkg/party_genre';
165
+ const argumentsTypes = [
166
+ null,
167
+ '0x2::object::ID'
168
+ ] satisfies (string | null)[];
169
+ const parameterNames = ["self", "genreId"];
170
+ return (tx: Transaction) => tx.moveCall({
171
+ package: packageAddress,
172
+ module: 'party_genre',
173
+ function: 'has_genre',
174
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
175
+ });
176
+ }
177
+ export interface GenresArguments {
178
+ self: RawTransactionArgument<string>;
179
+ }
180
+ export interface GenresOptions {
181
+ package?: string;
182
+ arguments: GenresArguments | [
183
+ self: RawTransactionArgument<string>
184
+ ];
185
+ }
186
+ /** The party's genre ids. */
187
+ export function genres(options: GenresOptions) {
188
+ const packageAddress = options.package ?? '@local-pkg/party_genre';
189
+ const argumentsTypes = [
190
+ null
191
+ ] satisfies (string | null)[];
192
+ const parameterNames = ["self"];
193
+ return (tx: Transaction) => tx.moveCall({
194
+ package: packageAddress,
195
+ module: 'party_genre',
196
+ function: 'genres',
197
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
198
+ });
199
+ }
@@ -0,0 +1,141 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /**
7
+ * Profile imagery for a party, stored as a single Walrus quilt.
8
+ *
9
+ * All of a party's images (avatar, header/cover, …) live together in one Walrus
10
+ * quilt — batching them under a single storage reservation is markedly cheaper
11
+ * than one blob each, which matters when the platform sponsors storage. Only the
12
+ * quilt's blob id is held on-chain, as a `Media` dynamic field on the party's UID,
13
+ * gated by the `PartyAdminCap`; views are permissionless.
14
+ *
15
+ * The chain is deliberately role-agnostic: which patch is the avatar vs the header
16
+ * is a client convention (quilt patch _identifiers_, e.g. "avatar" / "header"),
17
+ * derived off-chain — never stored here. Updating any image means re-storing the
18
+ * quilt and calling `set_media` with the new id.
19
+ */
20
+
21
+ import { MoveTuple, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.ts';
22
+ import { bcs } from '@mysten/sui/bcs';
23
+ import { type Transaction } from '@mysten/sui/transactions';
24
+ const $moduleName = '@local-pkg/party_media::party_media';
25
+ export const MediaKey = new MoveTuple({ name: `${$moduleName}::MediaKey`, fields: [bcs.bool()] });
26
+ export const Media = new MoveStruct({ name: `${$moduleName}::Media`, fields: {
27
+ /**
28
+ * Walrus quilt blob id holding all of the party's images. Individual images are
29
+ * quilt patches addressed by identifier ("avatar", "header", …); those roles are a
30
+ * client convention, derived off-chain, not stored here.
31
+ */
32
+ quilt: bcs.u256()
33
+ } });
34
+ export const MediaSetEvent = new MoveStruct({ name: `${$moduleName}::MediaSetEvent`, fields: {
35
+ party_id: bcs.Address,
36
+ quilt: bcs.u256()
37
+ } });
38
+ export const MediaClearedEvent = new MoveStruct({ name: `${$moduleName}::MediaClearedEvent`, fields: {
39
+ party_id: bcs.Address
40
+ } });
41
+ export interface SetMediaArguments {
42
+ self: RawTransactionArgument<string>;
43
+ cap: RawTransactionArgument<string>;
44
+ quilt: RawTransactionArgument<number | bigint>;
45
+ }
46
+ export interface SetMediaOptions {
47
+ package?: string;
48
+ arguments: SetMediaArguments | [
49
+ self: RawTransactionArgument<string>,
50
+ cap: RawTransactionArgument<string>,
51
+ quilt: RawTransactionArgument<number | bigint>
52
+ ];
53
+ }
54
+ /** Sets (or replaces) the party's media quilt. Aborts on a zero id. */
55
+ export function setMedia(options: SetMediaOptions) {
56
+ const packageAddress = options.package ?? '@local-pkg/party_media';
57
+ const argumentsTypes = [
58
+ null,
59
+ null,
60
+ 'u256'
61
+ ] satisfies (string | null)[];
62
+ const parameterNames = ["self", "cap", "quilt"];
63
+ return (tx: Transaction) => tx.moveCall({
64
+ package: packageAddress,
65
+ module: 'party_media',
66
+ function: 'set_media',
67
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
68
+ });
69
+ }
70
+ export interface ClearMediaArguments {
71
+ self: RawTransactionArgument<string>;
72
+ cap: RawTransactionArgument<string>;
73
+ }
74
+ export interface ClearMediaOptions {
75
+ package?: string;
76
+ arguments: ClearMediaArguments | [
77
+ self: RawTransactionArgument<string>,
78
+ cap: RawTransactionArgument<string>
79
+ ];
80
+ }
81
+ /** Removes the party's media. No-op if none is set. */
82
+ export function clearMedia(options: ClearMediaOptions) {
83
+ const packageAddress = options.package ?? '@local-pkg/party_media';
84
+ const argumentsTypes = [
85
+ null,
86
+ null
87
+ ] satisfies (string | null)[];
88
+ const parameterNames = ["self", "cap"];
89
+ return (tx: Transaction) => tx.moveCall({
90
+ package: packageAddress,
91
+ module: 'party_media',
92
+ function: 'clear_media',
93
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
94
+ });
95
+ }
96
+ export interface HasMediaArguments {
97
+ self: RawTransactionArgument<string>;
98
+ }
99
+ export interface HasMediaOptions {
100
+ package?: string;
101
+ arguments: HasMediaArguments | [
102
+ self: RawTransactionArgument<string>
103
+ ];
104
+ }
105
+ /** Whether the party has media set. */
106
+ export function hasMedia(options: HasMediaOptions) {
107
+ const packageAddress = options.package ?? '@local-pkg/party_media';
108
+ const argumentsTypes = [
109
+ null
110
+ ] satisfies (string | null)[];
111
+ const parameterNames = ["self"];
112
+ return (tx: Transaction) => tx.moveCall({
113
+ package: packageAddress,
114
+ module: 'party_media',
115
+ function: 'has_media',
116
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
117
+ });
118
+ }
119
+ export interface QuiltArguments {
120
+ self: RawTransactionArgument<string>;
121
+ }
122
+ export interface QuiltOptions {
123
+ package?: string;
124
+ arguments: QuiltArguments | [
125
+ self: RawTransactionArgument<string>
126
+ ];
127
+ }
128
+ /** The party's media quilt id, if set. */
129
+ export function quilt(options: QuiltOptions) {
130
+ const packageAddress = options.package ?? '@local-pkg/party_media';
131
+ const argumentsTypes = [
132
+ null
133
+ ] satisfies (string | null)[];
134
+ const parameterNames = ["self"];
135
+ return (tx: Transaction) => tx.moveCall({
136
+ package: packageAddress,
137
+ module: 'party_media',
138
+ function: 'quilt',
139
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
140
+ });
141
+ }