@misonetwork/sdk 0.2.2 → 0.3.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 (167) hide show
  1. package/README.md +44 -98
  2. package/dist/contracts.d.ts +0 -12
  3. package/dist/contracts.d.ts.map +1 -1
  4. package/dist/contracts.js +3 -16
  5. package/dist/contracts.js.map +1 -1
  6. package/dist/index.d.ts +0 -3
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +3 -3
  9. package/dist/index.js.map +1 -1
  10. package/dist/internal.d.ts +7 -3
  11. package/dist/internal.d.ts.map +1 -1
  12. package/dist/internal.js +22 -4
  13. package/dist/internal.js.map +1 -1
  14. package/dist/queries.d.ts +8 -0
  15. package/dist/queries.d.ts.map +1 -1
  16. package/dist/queries.js +30 -8
  17. package/dist/queries.js.map +1 -1
  18. package/package.json +1 -13
  19. package/src/contracts.ts +3 -19
  20. package/src/index.ts +3 -3
  21. package/src/internal.ts +34 -15
  22. package/src/queries.ts +40 -12
  23. package/dist/contracts/composition_credits/composition_credits.d.ts +0 -181
  24. package/dist/contracts/composition_credits/composition_credits.d.ts.map +0 -1
  25. package/dist/contracts/composition_credits/composition_credits.js +0 -109
  26. package/dist/contracts/composition_credits/composition_credits.js.map +0 -1
  27. package/dist/contracts/composition_credits/composition_party_role.d.ts +0 -119
  28. package/dist/contracts/composition_credits/composition_party_role.d.ts.map +0 -1
  29. package/dist/contracts/composition_credits/composition_party_role.js +0 -139
  30. package/dist/contracts/composition_credits/composition_party_role.js.map +0 -1
  31. package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts +0 -24
  32. package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts.map +0 -1
  33. package/dist/contracts/composition_credits/deps/miso_credit/credit.js +0 -23
  34. package/dist/contracts/composition_credits/deps/miso_credit/credit.js.map +0 -1
  35. package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts +0 -37
  36. package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts.map +0 -1
  37. package/dist/contracts/composition_credits/deps/sui/vec_map.js +0 -28
  38. package/dist/contracts/composition_credits/deps/sui/vec_map.js.map +0 -1
  39. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +0 -87
  40. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +0 -1
  41. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +0 -80
  42. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +0 -1
  43. package/dist/contracts/cover_art/cover_art.d.ts +0 -85
  44. package/dist/contracts/cover_art/cover_art.d.ts.map +0 -1
  45. package/dist/contracts/cover_art/cover_art.js +0 -68
  46. package/dist/contracts/cover_art/cover_art.js.map +0 -1
  47. package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts +0 -52
  48. package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts.map +0 -1
  49. package/dist/contracts/cover_art/deps/ori/walrus_data.js +0 -37
  50. package/dist/contracts/cover_art/deps/ori/walrus_data.js.map +0 -1
  51. package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts +0 -24
  52. package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts.map +0 -1
  53. package/dist/contracts/recording_credits/deps/miso_credit/credit.js +0 -23
  54. package/dist/contracts/recording_credits/deps/miso_credit/credit.js.map +0 -1
  55. package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts +0 -37
  56. package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts.map +0 -1
  57. package/dist/contracts/recording_credits/deps/sui/vec_map.js +0 -28
  58. package/dist/contracts/recording_credits/deps/sui/vec_map.js.map +0 -1
  59. package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts +0 -21
  60. package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts.map +0 -1
  61. package/dist/contracts/recording_credits/deps/sui/vec_set.js +0 -20
  62. package/dist/contracts/recording_credits/deps/sui/vec_set.js.map +0 -1
  63. package/dist/contracts/recording_credits/recording_credits.d.ts +0 -2313
  64. package/dist/contracts/recording_credits/recording_credits.d.ts.map +0 -1
  65. package/dist/contracts/recording_credits/recording_credits.js +0 -270
  66. package/dist/contracts/recording_credits/recording_credits.js.map +0 -1
  67. package/dist/contracts/recording_credits/recording_party_role.d.ts +0 -1174
  68. package/dist/contracts/recording_credits/recording_party_role.d.ts.map +0 -1
  69. package/dist/contracts/recording_credits/recording_party_role.js +0 -692
  70. package/dist/contracts/recording_credits/recording_party_role.js.map +0 -1
  71. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +0 -90
  72. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +0 -1
  73. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +0 -80
  74. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +0 -1
  75. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts +0 -52
  76. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts.map +0 -1
  77. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js +0 -37
  78. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js.map +0 -1
  79. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts +0 -46
  80. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts.map +0 -1
  81. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js +0 -21
  82. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js.map +0 -1
  83. package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts +0 -33
  84. package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts.map +0 -1
  85. package/dist/contracts/release_cover_art/deps/per_track/per_track.js +0 -32
  86. package/dist/contracts/release_cover_art/deps/per_track/per_track.js.map +0 -1
  87. package/dist/contracts/release_cover_art/release_cover_art.d.ts +0 -300
  88. package/dist/contracts/release_cover_art/release_cover_art.d.ts.map +0 -1
  89. package/dist/contracts/release_cover_art/release_cover_art.js +0 -168
  90. package/dist/contracts/release_cover_art/release_cover_art.js.map +0 -1
  91. package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts +0 -24
  92. package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts.map +0 -1
  93. package/dist/contracts/release_credits/deps/miso_credit/credit.js +0 -23
  94. package/dist/contracts/release_credits/deps/miso_credit/credit.js.map +0 -1
  95. package/dist/contracts/release_credits/deps/sui/vec_map.d.ts +0 -37
  96. package/dist/contracts/release_credits/deps/sui/vec_map.d.ts.map +0 -1
  97. package/dist/contracts/release_credits/deps/sui/vec_map.js +0 -28
  98. package/dist/contracts/release_credits/deps/sui/vec_map.js.map +0 -1
  99. package/dist/contracts/release_credits/release_credits.d.ts +0 -142
  100. package/dist/contracts/release_credits/release_credits.d.ts.map +0 -1
  101. package/dist/contracts/release_credits/release_credits.js +0 -108
  102. package/dist/contracts/release_credits/release_credits.js.map +0 -1
  103. package/dist/contracts/release_credits/release_party_role.d.ts +0 -58
  104. package/dist/contracts/release_credits/release_party_role.d.ts.map +0 -1
  105. package/dist/contracts/release_credits/release_party_role.js +0 -66
  106. package/dist/contracts/release_credits/release_party_role.js.map +0 -1
  107. package/dist/contracts/royalty_pool/deps/std/type_name.d.ts +0 -18
  108. package/dist/contracts/royalty_pool/deps/std/type_name.d.ts.map +0 -1
  109. package/dist/contracts/royalty_pool/deps/std/type_name.js +0 -20
  110. package/dist/contracts/royalty_pool/deps/std/type_name.js.map +0 -1
  111. package/dist/contracts/royalty_pool/deps/sui/balance.d.ts +0 -13
  112. package/dist/contracts/royalty_pool/deps/sui/balance.d.ts.map +0 -1
  113. package/dist/contracts/royalty_pool/deps/sui/balance.js +0 -15
  114. package/dist/contracts/royalty_pool/deps/sui/balance.js.map +0 -1
  115. package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts +0 -37
  116. package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts.map +0 -1
  117. package/dist/contracts/royalty_pool/deps/sui/vec_map.js +0 -28
  118. package/dist/contracts/royalty_pool/deps/sui/vec_map.js.map +0 -1
  119. package/dist/contracts/royalty_pool/pool.d.ts +0 -358
  120. package/dist/contracts/royalty_pool/pool.d.ts.map +0 -1
  121. package/dist/contracts/royalty_pool/pool.js +0 -352
  122. package/dist/contracts/royalty_pool/pool.js.map +0 -1
  123. package/dist/contracts/royalty_pool/stake.d.ts +0 -202
  124. package/dist/contracts/royalty_pool/stake.d.ts.map +0 -1
  125. package/dist/contracts/royalty_pool/stake.js +0 -197
  126. package/dist/contracts/royalty_pool/stake.js.map +0 -1
  127. package/dist/cover.d.ts +0 -48
  128. package/dist/cover.d.ts.map +0 -1
  129. package/dist/cover.js +0 -68
  130. package/dist/cover.js.map +0 -1
  131. package/dist/credits.d.ts +0 -171
  132. package/dist/credits.d.ts.map +0 -1
  133. package/dist/credits.js +0 -360
  134. package/dist/credits.js.map +0 -1
  135. package/dist/extensions/royalty-pool.d.ts +0 -32
  136. package/dist/extensions/royalty-pool.d.ts.map +0 -1
  137. package/dist/extensions/royalty-pool.js +0 -33
  138. package/dist/extensions/royalty-pool.js.map +0 -1
  139. package/src/contracts/composition_credits/composition_credits.ts +0 -169
  140. package/src/contracts/composition_credits/composition_party_role.ts +0 -189
  141. package/src/contracts/composition_credits/deps/miso_credit/credit.ts +0 -27
  142. package/src/contracts/composition_credits/deps/sui/vec_map.ts +0 -33
  143. package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +0 -135
  144. package/src/contracts/cover_art/cover_art.ts +0 -99
  145. package/src/contracts/cover_art/deps/ori/walrus_data.ts +0 -36
  146. package/src/contracts/recording_credits/deps/miso_credit/credit.ts +0 -27
  147. package/src/contracts/recording_credits/deps/sui/vec_map.ts +0 -33
  148. package/src/contracts/recording_credits/deps/sui/vec_set.ts +0 -21
  149. package/src/contracts/recording_credits/recording_credits.ts +0 -458
  150. package/src/contracts/recording_credits/recording_party_role.ts +0 -1041
  151. package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +0 -138
  152. package/src/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.ts +0 -36
  153. package/src/contracts/release_cover_art/deps/cover_art/cover_art.ts +0 -23
  154. package/src/contracts/release_cover_art/deps/per_track/per_track.ts +0 -36
  155. package/src/contracts/release_cover_art/release_cover_art.ts +0 -251
  156. package/src/contracts/release_credits/deps/miso_credit/credit.ts +0 -27
  157. package/src/contracts/release_credits/deps/sui/vec_map.ts +0 -33
  158. package/src/contracts/release_credits/release_credits.ts +0 -156
  159. package/src/contracts/release_credits/release_party_role.ts +0 -87
  160. package/src/contracts/royalty_pool/deps/std/type_name.ts +0 -22
  161. package/src/contracts/royalty_pool/deps/sui/balance.ts +0 -17
  162. package/src/contracts/royalty_pool/deps/sui/vec_map.ts +0 -33
  163. package/src/contracts/royalty_pool/pool.ts +0 -577
  164. package/src/contracts/royalty_pool/stake.ts +0 -317
  165. package/src/cover.ts +0 -136
  166. package/src/credits.ts +0 -645
  167. package/src/extensions/royalty-pool.ts +0 -85
package/src/index.ts CHANGED
@@ -1,10 +1,12 @@
1
1
  // Copyright (c) Miso Labs, Inc.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
+ // Protocol core only. Extension-derived surface (credits, cover art, royalty
5
+ // pools) lives in `@misofm/sdk` — an extension encodes opinionated business
6
+ // logic, so it belongs with the platform layer, not the protocol.
4
7
  export * from "./types.ts";
5
8
  export * from "./transactions.ts";
6
9
  export * from "./execute.ts";
7
- export * from "./extensions/royalty-pool.ts";
8
10
  export * from "./queries.ts";
9
11
  export * from "./parsers.ts";
10
12
  export * from "./view.ts";
@@ -12,5 +14,3 @@ export * from "./client.ts";
12
14
 
13
15
  // Generated, ABI-bound bindings (BCS structs + type-safe Move calls).
14
16
  export * as contracts from "./contracts.ts";
15
- export * from "./cover.ts";
16
- export * from "./credits.ts";
package/src/internal.ts CHANGED
@@ -3,16 +3,17 @@
3
3
 
4
4
  // Internal shared helpers (not exported from the package root).
5
5
  //
6
- // 1) Mappers from the generated BCS-parse output (snake_case, with @mysten/bcs
7
- // conventions: enums as `{ $kind, [Variant]: payload }`, tuples as arrays,
8
- // VecMap as `{ contents: [{ key, value }] }`, u64/u256 as strings, Address as
9
- // hex) into the public camelCase domain types in `./types`. These are the
10
- // single boundary between codegen output and the public API, so when the
11
- // generated shapes change, type errors surface here.
6
+ // Mappers from the generated BCS-parse output (snake_case, with @mysten/bcs
7
+ // conventions: enums as `{ $kind, [Variant]: payload }`, tuples as arrays,
8
+ // VecMap as `{ contents: [{ key, value }] }`, u64/u256 as strings, Address as
9
+ // hex) into the public camelCase domain types in `./types`. These are the
10
+ // single boundary between codegen output and the public API, so when the
11
+ // generated shapes change, type errors surface here.
12
12
  //
13
- // 2) PTB building blocks the `0x1::option` move-call targets used when a
14
- // generated call needs an `Option` argument built inline. Consumed by
15
- // `./cover` and `./credits`; `./transactions` does not use them.
13
+ // This module also held the `0x1::option` move-call targets used to build an
14
+ // `Option` argument inline. Their only consumers were `./cover` and `./credits`,
15
+ // which moved to `@misofm/sdk` along with the extension bindings they wrap, so
16
+ // the constants moved with them rather than becoming dead code here.
16
17
 
17
18
  import type {
18
19
  BPS,
@@ -23,12 +24,6 @@ import type {
23
24
  TrackState,
24
25
  } from "./types.ts";
25
26
 
26
- // === PTB building blocks ===
27
-
28
- /** `0x1::option::none` / `0x1::option::some` moveCall targets. */
29
- export const OPTION_NONE = "0x1::option::none";
30
- export const OPTION_SOME = "0x1::option::some";
31
-
32
27
  // === Mappers ===
33
28
 
34
29
  /* eslint-disable @typescript-eslint/no-explicit-any */
@@ -83,3 +78,27 @@ export function mapRelease(id: string, d: Parsed): ReleaseType {
83
78
  tracks: (d.tracks ?? []).map(mapTrack),
84
79
  };
85
80
  }
81
+
82
+ /**
83
+ * Maps the deployed disc-based Release JSON shape to the SDK's flat Release
84
+ * view. The current protocol source stores `tracks` directly, while the
85
+ * existing testnet package stores `discs`; both represent one ordered
86
+ * tracklist to SDK consumers.
87
+ */
88
+ export function mapDiscReleaseJson(id: string, d: Parsed): ReleaseType {
89
+ const tracks = (d.discs ?? []).flatMap((disc: Parsed) => disc.tracks ?? []);
90
+ const publishedAt = d.state?.["@variant"] === "Published" ? d.state.pos0 : null;
91
+ return {
92
+ id,
93
+ state:
94
+ publishedAt == null
95
+ ? { type: "Initialized" }
96
+ : { type: "Published", timestampMs: Number(publishedAt) },
97
+ title: d.title,
98
+ tracks: tracks.map((track: Parsed) => ({
99
+ state: (track.state?.["@variant"] ?? "Unassigned") as TrackState,
100
+ recordingId: track.recording_id,
101
+ splitBps: { value: Number(track.split_bps?.pos0 ?? track.split_bps) },
102
+ })),
103
+ };
104
+ }
package/src/queries.ts CHANGED
@@ -11,10 +11,11 @@
11
11
  // `get*AdminCapById`, …) THROW when the object is missing. Callers pass ids
12
12
  // they obtained from the chain, so a miss means a broken reference — an
13
13
  // exceptional state, not a normal one.
14
- // - Extension dynamic-field readers (`getCompositionCredits`/`getRecordingCredits`/
15
- // `getReleaseCredits` in ./credits.ts, `getReleaseCover` in ./cover.ts) return
16
- // `null` extension data is optional by design, and "not attached" is a
17
- // normal, expected state.
14
+ // - Extension dynamic-field readers return `null` — extension data is optional
15
+ // by design, and "not attached" is a normal, expected state. Those readers
16
+ // live in `@misofm/sdk` now (`getCompositionCredits`, `getRecordingCredits`,
17
+ // `getReleaseCredits`, `getReleaseCover`) and re-import {@link isNotFound}
18
+ // from here to keep one not-found taxonomy across both packages.
18
19
  // All null-returning readers use {@link isNotFound} to distinguish a missing
19
20
  // object from a transport failure (which still throws).
20
21
 
@@ -27,7 +28,7 @@ import { Composition as CompositionBcs } from "./contracts/miso/composition.ts";
27
28
  import { Deal as DealBcs } from "./contracts/miso/deal.ts";
28
29
  import { Recording as RecordingBcs } from "./contracts/miso/recording.ts";
29
30
  import { Release as ReleaseBcs } from "./contracts/miso/release.ts";
30
- import { mapBps, mapComposition, mapRecording, mapRelease } from "./internal.ts";
31
+ import { mapBps, mapComposition, mapDiscReleaseJson, mapRecording, mapRelease } from "./internal.ts";
31
32
  import type {
32
33
  Composition,
33
34
  CompositionAdminCap,
@@ -179,12 +180,27 @@ export async function getCompositionByShareType(
179
180
  shareType: string,
180
181
  misoPackageId: string,
181
182
  ): Promise<Composition> {
182
- const type = `${misoPackageId}::composition::Composition<${shareType}>`;
183
- const address = await firstAddressOfType(graphqlClient, type);
183
+ const address = await getCompositionAddressByShareType(graphqlClient, shareType, misoPackageId);
184
184
  if (!address) throw new Error(`Composition not found for share type: ${shareType}`);
185
185
  return getCompositionById(client, address);
186
186
  }
187
187
 
188
+ /**
189
+ * Resolves a composition share type to its object address.
190
+ *
191
+ * This is the lightweight discovery primitive for callers that need the
192
+ * composition's identity but will read extension fields rather than the core
193
+ * Composition contents.
194
+ */
195
+ export async function getCompositionAddressByShareType(
196
+ graphqlClient: SuiGraphQLClient,
197
+ shareType: string,
198
+ misoPackageId: string,
199
+ ): Promise<string | null> {
200
+ const type = `${misoPackageId}::composition::Composition<${shareType}>`;
201
+ return firstAddressOfType(graphqlClient, type);
202
+ }
203
+
188
204
  export async function getCompositionAdminCapById(
189
205
  client: ClientWithCoreApi,
190
206
  adminCapId: string,
@@ -342,19 +358,31 @@ export async function getReleasesByIds(
342
358
  releaseIds: string[],
343
359
  ): Promise<Record<string, Release>> {
344
360
  if (releaseIds.length === 0) return {};
345
- const { objects } = await client.core.getObjects({ objectIds: releaseIds, include: { content: true } });
361
+ const { objects } = await client.core.getObjects({
362
+ objectIds: releaseIds,
363
+ include: { content: true, json: true },
364
+ });
346
365
  const out: Record<string, Release> = {};
347
366
  for (const obj of objects) {
348
367
  if (obj instanceof Error || !obj.content) continue;
349
- out[obj.objectId] = mapRelease(obj.objectId, ReleaseBcs.parse(obj.content));
368
+ const json = obj.json as { discs?: unknown[] } | null;
369
+ out[obj.objectId] = json?.discs
370
+ ? mapDiscReleaseJson(obj.objectId, json)
371
+ : mapRelease(obj.objectId, ReleaseBcs.parse(obj.content));
350
372
  }
351
373
  return out;
352
374
  }
353
375
 
354
376
  export async function getReleaseById(client: ClientWithCoreApi, releaseId: string): Promise<Release> {
355
- const content = await getContent(client, releaseId);
356
- if (!content) throw new Error(`Release not found: ${releaseId}`);
357
- return mapRelease(releaseId, ReleaseBcs.parse(content));
377
+ const { object } = await client.core.getObject({
378
+ objectId: releaseId,
379
+ include: { content: true, json: true },
380
+ });
381
+ if (!object.content) throw new Error(`Release not found: ${releaseId}`);
382
+ const json = object.json as { discs?: unknown[] } | null;
383
+ return json?.discs
384
+ ? mapDiscReleaseJson(releaseId, json)
385
+ : mapRelease(releaseId, ReleaseBcs.parse(object.content));
358
386
  }
359
387
 
360
388
  export async function getReleaseRegistry(client: SuiGraphQLClient, misoPackageId: string): Promise<string> {
@@ -1,181 +0,0 @@
1
- /**************************************************************
2
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
- **************************************************************/
4
- /**
5
- * First-party credits extension for compositions.
6
- *
7
- * Attribution (writing credits) is display-oriented and varies across platforms,
8
- * so it lives here as a dynamic field on the composition rather than in immutable
9
- * core. The data is attached under `ExtensionKey()` via the composition's
10
- * cap-gated `uid_mut`, so every mutation is authorized by the composition's admin
11
- * and credits survive into any lifecycle state (they may be attached before or
12
- * after the composition is published).
13
- *
14
- * This is Miso's canonical credits standard; because it is an extension, other
15
- * parties may publish their own composition-credits standard against the same
16
- * `Composition`. Credits are NOT read by the economics — they are attribution.
17
- */
18
- import { MoveTuple, MoveStruct, type RawTransactionArgument } from '../utils/index.js';
19
- import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
20
- export declare const ExtensionKey: MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">], "@local-pkg/composition_credits::composition_credits::ExtensionKey">;
21
- export declare const CompositionCredits: MoveStruct<{
22
- /** Map of party IDs to their credit (display name + roles). */
23
- credits: MoveStruct<{
24
- contents: import("@mysten/sui/bcs").BcsType<{
25
- key: string;
26
- value: {
27
- display_name: string;
28
- roles: import("@mysten/bcs").EnumOutputShapeWithKeys<{
29
- Adapter: true;
30
- Arranger: true;
31
- Composer: true;
32
- Lyricist: true;
33
- Songwriter: true;
34
- Translator: true;
35
- Custom: string;
36
- }, "Adapter" | "Arranger" | "Composer" | "Lyricist" | "Songwriter" | "Translator" | "Custom">[];
37
- };
38
- }[], Iterable<{
39
- key: string | Uint8Array<ArrayBufferLike>;
40
- value: {
41
- display_name: string;
42
- roles: Iterable<import("@mysten/bcs").EnumInputShape<{
43
- Adapter: boolean | object | null;
44
- Arranger: boolean | object | null;
45
- Composer: boolean | object | null;
46
- Lyricist: boolean | object | null;
47
- Songwriter: boolean | object | null;
48
- Translator: boolean | object | null;
49
- Custom: string;
50
- }>> & {
51
- length: number;
52
- };
53
- };
54
- }> & {
55
- length: number;
56
- }, string>;
57
- }, "0x2::vec_map::VecMap<bytes[32], miso_credit::credit::Credit<@local-pkg/composition_credits::composition_party_role::CompositionPartyRole>>">;
58
- }, "@local-pkg/composition_credits::composition_credits::CompositionCredits">;
59
- export declare const CreditAddedEvent: MoveStruct<{
60
- composition_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
61
- party_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
62
- credit: MoveStruct<{
63
- display_name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
64
- roles: import("@mysten/sui/bcs").BcsType<import("@mysten/bcs").EnumOutputShapeWithKeys<{
65
- Adapter: true;
66
- Arranger: true;
67
- Composer: true;
68
- Lyricist: true;
69
- Songwriter: true;
70
- Translator: true;
71
- Custom: string;
72
- }, "Adapter" | "Arranger" | "Composer" | "Lyricist" | "Songwriter" | "Translator" | "Custom">[], Iterable<import("@mysten/bcs").EnumInputShape<{
73
- Adapter: boolean | object | null;
74
- Arranger: boolean | object | null;
75
- Composer: boolean | object | null;
76
- Lyricist: boolean | object | null;
77
- Songwriter: boolean | object | null;
78
- Translator: boolean | object | null;
79
- Custom: string;
80
- }>> & {
81
- length: number;
82
- }, string>;
83
- }, "miso_credit::credit::Credit<@local-pkg/composition_credits::composition_party_role::CompositionPartyRole>">;
84
- }, "@local-pkg/composition_credits::composition_credits::CreditAddedEvent">;
85
- export declare const CreditRemovedEvent: MoveStruct<{
86
- composition_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
87
- party_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
88
- credit: MoveStruct<{
89
- display_name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
90
- roles: import("@mysten/sui/bcs").BcsType<import("@mysten/bcs").EnumOutputShapeWithKeys<{
91
- Adapter: true;
92
- Arranger: true;
93
- Composer: true;
94
- Lyricist: true;
95
- Songwriter: true;
96
- Translator: true;
97
- Custom: string;
98
- }, "Adapter" | "Arranger" | "Composer" | "Lyricist" | "Songwriter" | "Translator" | "Custom">[], Iterable<import("@mysten/bcs").EnumInputShape<{
99
- Adapter: boolean | object | null;
100
- Arranger: boolean | object | null;
101
- Composer: boolean | object | null;
102
- Lyricist: boolean | object | null;
103
- Songwriter: boolean | object | null;
104
- Translator: boolean | object | null;
105
- Custom: string;
106
- }>> & {
107
- length: number;
108
- }, string>;
109
- }, "miso_credit::credit::Credit<@local-pkg/composition_credits::composition_party_role::CompositionPartyRole>">;
110
- }, "@local-pkg/composition_credits::composition_credits::CreditRemovedEvent">;
111
- export interface AddCreditArguments {
112
- self: RawTransactionArgument<string>;
113
- cap: RawTransactionArgument<string>;
114
- party: RawTransactionArgument<string>;
115
- credit: TransactionArgument;
116
- }
117
- export interface AddCreditOptions {
118
- package?: string;
119
- arguments: AddCreditArguments | [
120
- self: RawTransactionArgument<string>,
121
- cap: RawTransactionArgument<string>,
122
- party: RawTransactionArgument<string>,
123
- credit: TransactionArgument
124
- ];
125
- typeArguments: [
126
- string
127
- ];
128
- }
129
- /**
130
- * Adds a credit for a party on the composition, lazily creating the credits record
131
- * on first use. Each credit must have 1-5 roles, and a party may hold at most one
132
- * credit. Requires the composition's admin capability.
133
- */
134
- export declare function addCredit(options: AddCreditOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
135
- export interface RemoveCreditArguments {
136
- self: RawTransactionArgument<string>;
137
- cap: RawTransactionArgument<string>;
138
- partyId: RawTransactionArgument<string>;
139
- }
140
- export interface RemoveCreditOptions {
141
- package?: string;
142
- arguments: RemoveCreditArguments | [
143
- self: RawTransactionArgument<string>,
144
- cap: RawTransactionArgument<string>,
145
- partyId: RawTransactionArgument<string>
146
- ];
147
- typeArguments: [
148
- string
149
- ];
150
- }
151
- /** Removes a party's credit. Requires the composition's admin capability. */
152
- export declare function removeCredit(options: RemoveCreditOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
153
- export interface HasCreditsArguments {
154
- self: RawTransactionArgument<string>;
155
- }
156
- export interface HasCreditsOptions {
157
- package?: string;
158
- arguments: HasCreditsArguments | [
159
- self: RawTransactionArgument<string>
160
- ];
161
- typeArguments: [
162
- string
163
- ];
164
- }
165
- /** Returns whether a credits record has been attached to this composition yet. */
166
- export declare function hasCredits(options: HasCreditsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
167
- export interface CreditsArguments {
168
- self: RawTransactionArgument<string>;
169
- }
170
- export interface CreditsOptions {
171
- package?: string;
172
- arguments: CreditsArguments | [
173
- self: RawTransactionArgument<string>
174
- ];
175
- typeArguments: [
176
- string
177
- ];
178
- }
179
- /** Returns the party-to-credit map. Aborts if no credits are attached. */
180
- export declare function credits(options: CreditsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
181
- //# sourceMappingURL=composition_credits.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"composition_credits.d.ts","sourceRoot":"","sources":["../../../src/contracts/composition_credits/composition_credits.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAA0B,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE/G,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAKtF,eAAO,MAAM,YAAY,wJAAgF,CAAC;AAC1G,eAAO,MAAM,kBAAkB;IACvB,+DAA+D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EAE/D,CAAC;AACT,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;2EAIrB,CAAC;AACT,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;6EAIvB,CAAC;AACT,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IACrC,GAAG,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IACpC,KAAK,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,EAAE,mBAAmB,CAAC;CAC/B;AACD,MAAM,WAAW,gBAAgB;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,kBAAkB,GAAG;QAC5B,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;QACpC,GAAG,EAAE,sBAAsB,CAAC,MAAM,CAAC;QACnC,KAAK,EAAE,sBAAsB,CAAC,MAAM,CAAC;QACrC,MAAM,EAAE,mBAAmB;KAC9B,CAAC;IACF,aAAa,EAAE;QACX,MAAM;KACT,CAAC;CACL;AACD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,IASvC,IAAI,WAAW,0DAO1B;AACD,MAAM,WAAW,qBAAqB;IAClC,I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nC,IAAI,WAAW,0DAO1B"}
@@ -1,109 +0,0 @@
1
- /**************************************************************
2
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
- **************************************************************/
4
- /**
5
- * First-party credits extension for compositions.
6
- *
7
- * Attribution (writing credits) is display-oriented and varies across platforms,
8
- * so it lives here as a dynamic field on the composition rather than in immutable
9
- * core. The data is attached under `ExtensionKey()` via the composition's
10
- * cap-gated `uid_mut`, so every mutation is authorized by the composition's admin
11
- * and credits survive into any lifecycle state (they may be attached before or
12
- * after the composition is published).
13
- *
14
- * This is Miso's canonical credits standard; because it is an extension, other
15
- * parties may publish their own composition-credits standard against the same
16
- * `Composition`. Credits are NOT read by the economics — they are attribution.
17
- */
18
- import { MoveTuple, MoveStruct, normalizeMoveArguments } from '../utils/index.js';
19
- import { bcs } from '@mysten/sui/bcs';
20
- import {} from '@mysten/sui/transactions';
21
- import * as vec_map from './deps/sui/vec_map.js';
22
- import * as credit from './deps/miso_credit/credit.js';
23
- import * as composition_party_role from './composition_party_role.js';
24
- const $moduleName = '@local-pkg/composition_credits::composition_credits';
25
- export const ExtensionKey = new MoveTuple({ name: `${$moduleName}::ExtensionKey`, fields: [bcs.bool()] });
26
- export const CompositionCredits = new MoveStruct({ name: `${$moduleName}::CompositionCredits`, fields: {
27
- /** Map of party IDs to their credit (display name + roles). */
28
- credits: vec_map.VecMap(bcs.Address, credit.Credit(composition_party_role.CompositionPartyRole))
29
- } });
30
- export const CreditAddedEvent = new MoveStruct({ name: `${$moduleName}::CreditAddedEvent`, fields: {
31
- composition_id: bcs.Address,
32
- party_id: bcs.Address,
33
- credit: credit.Credit(composition_party_role.CompositionPartyRole)
34
- } });
35
- export const CreditRemovedEvent = new MoveStruct({ name: `${$moduleName}::CreditRemovedEvent`, fields: {
36
- composition_id: bcs.Address,
37
- party_id: bcs.Address,
38
- credit: credit.Credit(composition_party_role.CompositionPartyRole)
39
- } });
40
- /**
41
- * Adds a credit for a party on the composition, lazily creating the credits record
42
- * on first use. Each credit must have 1-5 roles, and a party may hold at most one
43
- * credit. Requires the composition's admin capability.
44
- */
45
- export function addCredit(options) {
46
- const packageAddress = options.package ?? '@local-pkg/composition_credits';
47
- const argumentsTypes = [
48
- null,
49
- null,
50
- null,
51
- null
52
- ];
53
- const parameterNames = ["self", "cap", "party", "credit"];
54
- return (tx) => tx.moveCall({
55
- package: packageAddress,
56
- module: 'composition_credits',
57
- function: 'add_credit',
58
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
59
- typeArguments: options.typeArguments
60
- });
61
- }
62
- /** Removes a party's credit. Requires the composition's admin capability. */
63
- export function removeCredit(options) {
64
- const packageAddress = options.package ?? '@local-pkg/composition_credits';
65
- const argumentsTypes = [
66
- null,
67
- null,
68
- '0x2::object::ID'
69
- ];
70
- const parameterNames = ["self", "cap", "partyId"];
71
- return (tx) => tx.moveCall({
72
- package: packageAddress,
73
- module: 'composition_credits',
74
- function: 'remove_credit',
75
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
76
- typeArguments: options.typeArguments
77
- });
78
- }
79
- /** Returns whether a credits record has been attached to this composition yet. */
80
- export function hasCredits(options) {
81
- const packageAddress = options.package ?? '@local-pkg/composition_credits';
82
- const argumentsTypes = [
83
- null
84
- ];
85
- const parameterNames = ["self"];
86
- return (tx) => tx.moveCall({
87
- package: packageAddress,
88
- module: 'composition_credits',
89
- function: 'has_credits',
90
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
91
- typeArguments: options.typeArguments
92
- });
93
- }
94
- /** Returns the party-to-credit map. Aborts if no credits are attached. */
95
- export function credits(options) {
96
- const packageAddress = options.package ?? '@local-pkg/composition_credits';
97
- const argumentsTypes = [
98
- null
99
- ];
100
- const parameterNames = ["self"];
101
- return (tx) => tx.moveCall({
102
- package: packageAddress,
103
- module: 'composition_credits',
104
- function: 'credits',
105
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
106
- typeArguments: options.typeArguments
107
- });
108
- }
109
- //# sourceMappingURL=composition_credits.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"composition_credits.js","sourceRoot":"","sources":["../../../src/contracts/composition_credits/composition_credits.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,sBAAsB,EAA+B,MAAM,mBAAmB,CAAC;AAC/G,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAA8C,MAAM,0BAA0B,CAAC;AACtF,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,8BAA8B,CAAC;AACvD,OAAO,KAAK,sBAAsB,MAAM,6BAA6B,CAAC;AACtE,MAAM,WAAW,GAAG,qDAAqD,CAAC;AAC1E,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,gBAAgB,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;AAC1G,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,sBAAsB,EAAE,MAAM,EAAE;QAC/F,+DAA+D;QAC/D,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,oBAAoB,CAAC,CAAC;KACnG,EAAE,CAAC,CAAC;AACT,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,oBAAoB,EAAE,MAAM,EAAE;QAC3F,cAAc,EAAE,GAAG,CAAC,OAAO;QAC3B,QAAQ,EAAE,GAAG,CAAC,OAAO;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,oBAAoB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-1,119 +0,0 @@
1
- /**************************************************************
2
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
- **************************************************************/
4
- /**
5
- * Defines the roles that parties can hold on a composition. Compositions are the
6
- * underlying musical works (melody + lyrics), and these roles represent the
7
- * writing and adaptation contributions to them.
8
- *
9
- * ### Design
10
- *
11
- * `CompositionPartyRole` is a closed enum: variants can only be constructed and
12
- * matched inside this module, so the `new_*_role` constructors are the external
13
- * write-API and `name()` is the external read-API.
14
- *
15
- * - **No seniority axis.** Unlike recording roles, composition roles carry no
16
- * level — a writer either contributed in a given capacity or did not.
17
- * - **`Custom` is the escape hatch.** The canonical variants cover the common
18
- * writing vocabulary; anything outside it is a `Custom(name)` whose name is
19
- * validated. Prefer a canonical variant when one fits.
20
- * - **`name()` is the canonical identifier**, returned as a stable PascalCase
21
- * token (e.g. `"Songwriter"`). For `Custom`, `name()` returns the user-supplied
22
- * string.
23
- *
24
- * These identifiers are Miso's own canonical vocabulary; any overlap with an
25
- * external standard (e.g. DDEX) is coincidental, not a reproduction of it.
26
- */
27
- import { MoveEnum, type RawTransactionArgument } from '../utils/index.js';
28
- import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
29
- /** Represents a party's role on a composition. */
30
- export declare const CompositionPartyRole: MoveEnum<{
31
- /** Adapted an existing work into this composition. */
32
- Adapter: null;
33
- /** Arranged the musical parts of the composition. */
34
- Arranger: null;
35
- /** Composed the music of the composition. */
36
- Composer: null;
37
- /** Wrote the lyrics of the composition. */
38
- Lyricist: null;
39
- /** Wrote both music and lyrics of the composition. */
40
- Songwriter: null;
41
- /** Translated the lyrics of the composition. */
42
- Translator: null;
43
- /**
44
- * A user-defined role not covered by a canonical variant. Carries the role name
45
- * (validated). An escape hatch — prefer a canonical variant when one fits.
46
- */
47
- Custom: import("@mysten/sui/bcs").BcsType<string, string, "string">;
48
- }, "@local-pkg/composition_credits::composition_party_role::CompositionPartyRole">;
49
- export interface NewAdapterRoleOptions {
50
- package?: string;
51
- arguments?: [
52
- ];
53
- }
54
- /** Creates a new Adapter role. */
55
- export declare function newAdapterRole(options?: NewAdapterRoleOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
56
- export interface NewArrangerRoleOptions {
57
- package?: string;
58
- arguments?: [
59
- ];
60
- }
61
- /** Creates a new Arranger role. */
62
- export declare function newArrangerRole(options?: NewArrangerRoleOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
63
- export interface NewComposerRoleOptions {
64
- package?: string;
65
- arguments?: [
66
- ];
67
- }
68
- /** Creates a new Composer role. */
69
- export declare function newComposerRole(options?: NewComposerRoleOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
70
- export interface NewLyricistRoleOptions {
71
- package?: string;
72
- arguments?: [
73
- ];
74
- }
75
- /** Creates a new Lyricist role. */
76
- export declare function newLyricistRole(options?: NewLyricistRoleOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
77
- export interface NewSongwriterRoleOptions {
78
- package?: string;
79
- arguments?: [
80
- ];
81
- }
82
- /** Creates a new Songwriter role. */
83
- export declare function newSongwriterRole(options?: NewSongwriterRoleOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
84
- export interface NewTranslatorRoleOptions {
85
- package?: string;
86
- arguments?: [
87
- ];
88
- }
89
- /** Creates a new Translator role. */
90
- export declare function newTranslatorRole(options?: NewTranslatorRoleOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
91
- export interface NewCustomRoleArguments {
92
- roleName: RawTransactionArgument<string>;
93
- }
94
- export interface NewCustomRoleOptions {
95
- package?: string;
96
- arguments: NewCustomRoleArguments | [
97
- roleName: RawTransactionArgument<string>
98
- ];
99
- }
100
- /**
101
- * Creates a new Custom role with a user-defined name. The name freezes into
102
- * credits, so it is validated here. Prefer a canonical variant when one fits.
103
- */
104
- export declare function newCustomRole(options: NewCustomRoleOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
105
- export interface NameArguments {
106
- self: TransactionArgument;
107
- }
108
- export interface NameOptions {
109
- package?: string;
110
- arguments: NameArguments | [
111
- self: TransactionArgument
112
- ];
113
- }
114
- /**
115
- * Returns the canonical identifier of the role as a stable PascalCase token. For
116
- * `Custom`, returns the user-supplied name.
117
- */
118
- export declare function name(options: NameOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
119
- //# sourceMappingURL=composition_party_role.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"composition_party_role.d.ts","sourceRoot":"","sources":["../../../src/contracts/composition_credits/composition_party_role.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,QAAQ,EAA0B,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAElG,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEtF,kDAAkD;AAClD,eAAO,MAAM,oBAAoB;IACzB,sDAAsD;;IAEtD,qDAAqD;;IAErD,6CAA6C;;IAE7C,2CAA2C;;IAE3C,sDAAsD;;IAEtD,gDAAgD;;IAEhD;;;OAGG;;kFAEH,CAAC;AACT,MAAM,WAAW,qBAAqB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE;KACX,CAAC;CACL;AACD,kCAAkC;AAClC,wBAAgB,cAAc,CAAC,OAAO,GAAE,qBAA0B,IAEtD,IAAI,WAAW,0DAK1B;AACD,MAAM,WAAW,sBAAsB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE;KACX,CAAC;CACL;AACD,mCAAmC;AACnC,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B,IAExD,IAAI,WAAW,0DAK1B;AACD,MAAM,WAAW,sBAAsB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE;KACX,CAAC;CACL;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