@misonetwork/sdk 0.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 (238) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +644 -0
  3. package/dist/client.d.ts +197 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +218 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/contracts/composition_credits/composition_credits.d.ts +181 -0
  8. package/dist/contracts/composition_credits/composition_credits.d.ts.map +1 -0
  9. package/dist/contracts/composition_credits/composition_credits.js +109 -0
  10. package/dist/contracts/composition_credits/composition_credits.js.map +1 -0
  11. package/dist/contracts/composition_credits/composition_party_role.d.ts +119 -0
  12. package/dist/contracts/composition_credits/composition_party_role.d.ts.map +1 -0
  13. package/dist/contracts/composition_credits/composition_party_role.js +139 -0
  14. package/dist/contracts/composition_credits/composition_party_role.js.map +1 -0
  15. package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts +24 -0
  16. package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts.map +1 -0
  17. package/dist/contracts/composition_credits/deps/miso_credit/credit.js +23 -0
  18. package/dist/contracts/composition_credits/deps/miso_credit/credit.js.map +1 -0
  19. package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts +37 -0
  20. package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts.map +1 -0
  21. package/dist/contracts/composition_credits/deps/sui/vec_map.js +28 -0
  22. package/dist/contracts/composition_credits/deps/sui/vec_map.js.map +1 -0
  23. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +87 -0
  24. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +1 -0
  25. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +80 -0
  26. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +1 -0
  27. package/dist/contracts/cover_art/cover_art.d.ts +85 -0
  28. package/dist/contracts/cover_art/cover_art.d.ts.map +1 -0
  29. package/dist/contracts/cover_art/cover_art.js +68 -0
  30. package/dist/contracts/cover_art/cover_art.js.map +1 -0
  31. package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts +52 -0
  32. package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts.map +1 -0
  33. package/dist/contracts/cover_art/deps/ori/walrus_data.js +37 -0
  34. package/dist/contracts/cover_art/deps/ori/walrus_data.js.map +1 -0
  35. package/dist/contracts/miso/composition.d.ts +231 -0
  36. package/dist/contracts/miso/composition.d.ts.map +1 -0
  37. package/dist/contracts/miso/composition.js +231 -0
  38. package/dist/contracts/miso/composition.js.map +1 -0
  39. package/dist/contracts/miso/deal.d.ts +184 -0
  40. package/dist/contracts/miso/deal.d.ts.map +1 -0
  41. package/dist/contracts/miso/deal.js +184 -0
  42. package/dist/contracts/miso/deal.js.map +1 -0
  43. package/dist/contracts/miso/deps/bps/bps.d.ts +19 -0
  44. package/dist/contracts/miso/deps/bps/bps.d.ts.map +1 -0
  45. package/dist/contracts/miso/deps/bps/bps.js +21 -0
  46. package/dist/contracts/miso/deps/bps/bps.js.map +1 -0
  47. package/dist/contracts/miso/recording.d.ts +228 -0
  48. package/dist/contracts/miso/recording.d.ts.map +1 -0
  49. package/dist/contracts/miso/recording.js +221 -0
  50. package/dist/contracts/miso/recording.js.map +1 -0
  51. package/dist/contracts/miso/release.d.ts +280 -0
  52. package/dist/contracts/miso/release.d.ts.map +1 -0
  53. package/dist/contracts/miso/release.js +282 -0
  54. package/dist/contracts/miso/release.js.map +1 -0
  55. package/dist/contracts/miso/track.d.ts +118 -0
  56. package/dist/contracts/miso/track.d.ts.map +1 -0
  57. package/dist/contracts/miso/track.js +118 -0
  58. package/dist/contracts/miso/track.js.map +1 -0
  59. package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts +24 -0
  60. package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts.map +1 -0
  61. package/dist/contracts/recording_credits/deps/miso_credit/credit.js +23 -0
  62. package/dist/contracts/recording_credits/deps/miso_credit/credit.js.map +1 -0
  63. package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts +37 -0
  64. package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts.map +1 -0
  65. package/dist/contracts/recording_credits/deps/sui/vec_map.js +28 -0
  66. package/dist/contracts/recording_credits/deps/sui/vec_map.js.map +1 -0
  67. package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts +21 -0
  68. package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts.map +1 -0
  69. package/dist/contracts/recording_credits/deps/sui/vec_set.js +20 -0
  70. package/dist/contracts/recording_credits/deps/sui/vec_set.js.map +1 -0
  71. package/dist/contracts/recording_credits/recording_credits.d.ts +2313 -0
  72. package/dist/contracts/recording_credits/recording_credits.d.ts.map +1 -0
  73. package/dist/contracts/recording_credits/recording_credits.js +270 -0
  74. package/dist/contracts/recording_credits/recording_credits.js.map +1 -0
  75. package/dist/contracts/recording_credits/recording_party_role.d.ts +1174 -0
  76. package/dist/contracts/recording_credits/recording_party_role.d.ts.map +1 -0
  77. package/dist/contracts/recording_credits/recording_party_role.js +692 -0
  78. package/dist/contracts/recording_credits/recording_party_role.js.map +1 -0
  79. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +90 -0
  80. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +1 -0
  81. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +80 -0
  82. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +1 -0
  83. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts +52 -0
  84. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts.map +1 -0
  85. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js +37 -0
  86. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js.map +1 -0
  87. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts +46 -0
  88. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts.map +1 -0
  89. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js +21 -0
  90. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js.map +1 -0
  91. package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts +33 -0
  92. package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts.map +1 -0
  93. package/dist/contracts/release_cover_art/deps/per_track/per_track.js +32 -0
  94. package/dist/contracts/release_cover_art/deps/per_track/per_track.js.map +1 -0
  95. package/dist/contracts/release_cover_art/release_cover_art.d.ts +300 -0
  96. package/dist/contracts/release_cover_art/release_cover_art.d.ts.map +1 -0
  97. package/dist/contracts/release_cover_art/release_cover_art.js +168 -0
  98. package/dist/contracts/release_cover_art/release_cover_art.js.map +1 -0
  99. package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts +24 -0
  100. package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts.map +1 -0
  101. package/dist/contracts/release_credits/deps/miso_credit/credit.js +23 -0
  102. package/dist/contracts/release_credits/deps/miso_credit/credit.js.map +1 -0
  103. package/dist/contracts/release_credits/deps/sui/vec_map.d.ts +37 -0
  104. package/dist/contracts/release_credits/deps/sui/vec_map.d.ts.map +1 -0
  105. package/dist/contracts/release_credits/deps/sui/vec_map.js +28 -0
  106. package/dist/contracts/release_credits/deps/sui/vec_map.js.map +1 -0
  107. package/dist/contracts/release_credits/release_credits.d.ts +142 -0
  108. package/dist/contracts/release_credits/release_credits.d.ts.map +1 -0
  109. package/dist/contracts/release_credits/release_credits.js +108 -0
  110. package/dist/contracts/release_credits/release_credits.js.map +1 -0
  111. package/dist/contracts/release_credits/release_party_role.d.ts +58 -0
  112. package/dist/contracts/release_credits/release_party_role.d.ts.map +1 -0
  113. package/dist/contracts/release_credits/release_party_role.js +66 -0
  114. package/dist/contracts/release_credits/release_party_role.js.map +1 -0
  115. package/dist/contracts/royalty_pool/deps/std/type_name.d.ts +18 -0
  116. package/dist/contracts/royalty_pool/deps/std/type_name.d.ts.map +1 -0
  117. package/dist/contracts/royalty_pool/deps/std/type_name.js +20 -0
  118. package/dist/contracts/royalty_pool/deps/std/type_name.js.map +1 -0
  119. package/dist/contracts/royalty_pool/deps/sui/balance.d.ts +13 -0
  120. package/dist/contracts/royalty_pool/deps/sui/balance.d.ts.map +1 -0
  121. package/dist/contracts/royalty_pool/deps/sui/balance.js +15 -0
  122. package/dist/contracts/royalty_pool/deps/sui/balance.js.map +1 -0
  123. package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts +37 -0
  124. package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts.map +1 -0
  125. package/dist/contracts/royalty_pool/deps/sui/vec_map.js +28 -0
  126. package/dist/contracts/royalty_pool/deps/sui/vec_map.js.map +1 -0
  127. package/dist/contracts/royalty_pool/pool.d.ts +358 -0
  128. package/dist/contracts/royalty_pool/pool.d.ts.map +1 -0
  129. package/dist/contracts/royalty_pool/pool.js +352 -0
  130. package/dist/contracts/royalty_pool/pool.js.map +1 -0
  131. package/dist/contracts/royalty_pool/stake.d.ts +202 -0
  132. package/dist/contracts/royalty_pool/stake.d.ts.map +1 -0
  133. package/dist/contracts/royalty_pool/stake.js +197 -0
  134. package/dist/contracts/royalty_pool/stake.js.map +1 -0
  135. package/dist/contracts/utils/index.d.ts +31 -0
  136. package/dist/contracts/utils/index.d.ts.map +1 -0
  137. package/dist/contracts/utils/index.js +162 -0
  138. package/dist/contracts/utils/index.js.map +1 -0
  139. package/dist/contracts.d.ts +18 -0
  140. package/dist/contracts.d.ts.map +1 -0
  141. package/dist/contracts.js +26 -0
  142. package/dist/contracts.js.map +1 -0
  143. package/dist/cover.d.ts +48 -0
  144. package/dist/cover.d.ts.map +1 -0
  145. package/dist/cover.js +68 -0
  146. package/dist/cover.js.map +1 -0
  147. package/dist/credits.d.ts +171 -0
  148. package/dist/credits.d.ts.map +1 -0
  149. package/dist/credits.js +360 -0
  150. package/dist/credits.js.map +1 -0
  151. package/dist/execute.d.ts +49 -0
  152. package/dist/execute.d.ts.map +1 -0
  153. package/dist/execute.js +114 -0
  154. package/dist/execute.js.map +1 -0
  155. package/dist/extensions/royalty-pool.d.ts +32 -0
  156. package/dist/extensions/royalty-pool.d.ts.map +1 -0
  157. package/dist/extensions/royalty-pool.js +33 -0
  158. package/dist/extensions/royalty-pool.js.map +1 -0
  159. package/dist/index.d.ts +13 -0
  160. package/dist/index.d.ts.map +1 -0
  161. package/dist/index.js +16 -0
  162. package/dist/index.js.map +1 -0
  163. package/dist/internal.d.ts +20 -0
  164. package/dist/internal.d.ts.map +1 -0
  165. package/dist/internal.js +48 -0
  166. package/dist/internal.js.map +1 -0
  167. package/dist/parsers.d.ts +9 -0
  168. package/dist/parsers.d.ts.map +1 -0
  169. package/dist/parsers.js +52 -0
  170. package/dist/parsers.js.map +1 -0
  171. package/dist/queries.d.ts +105 -0
  172. package/dist/queries.d.ts.map +1 -0
  173. package/dist/queries.js +380 -0
  174. package/dist/queries.js.map +1 -0
  175. package/dist/schemas.d.ts +99 -0
  176. package/dist/schemas.d.ts.map +1 -0
  177. package/dist/schemas.js +76 -0
  178. package/dist/schemas.js.map +1 -0
  179. package/dist/transactions.d.ts +158 -0
  180. package/dist/transactions.d.ts.map +1 -0
  181. package/dist/transactions.js +154 -0
  182. package/dist/transactions.js.map +1 -0
  183. package/dist/types.d.ts +204 -0
  184. package/dist/types.d.ts.map +1 -0
  185. package/dist/types.js +4 -0
  186. package/dist/types.js.map +1 -0
  187. package/dist/view.d.ts +21 -0
  188. package/dist/view.d.ts.map +1 -0
  189. package/dist/view.js +36 -0
  190. package/dist/view.js.map +1 -0
  191. package/package.json +111 -0
  192. package/src/client.ts +278 -0
  193. package/src/contracts/composition_credits/composition_credits.ts +169 -0
  194. package/src/contracts/composition_credits/composition_party_role.ts +189 -0
  195. package/src/contracts/composition_credits/deps/miso_credit/credit.ts +27 -0
  196. package/src/contracts/composition_credits/deps/sui/vec_map.ts +33 -0
  197. package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +135 -0
  198. package/src/contracts/cover_art/cover_art.ts +99 -0
  199. package/src/contracts/cover_art/deps/ori/walrus_data.ts +36 -0
  200. package/src/contracts/miso/composition.ts +343 -0
  201. package/src/contracts/miso/deal.ts +257 -0
  202. package/src/contracts/miso/deps/bps/bps.ts +23 -0
  203. package/src/contracts/miso/recording.ts +298 -0
  204. package/src/contracts/miso/release.ts +392 -0
  205. package/src/contracts/miso/track.ts +153 -0
  206. package/src/contracts/recording_credits/deps/miso_credit/credit.ts +27 -0
  207. package/src/contracts/recording_credits/deps/sui/vec_map.ts +33 -0
  208. package/src/contracts/recording_credits/deps/sui/vec_set.ts +21 -0
  209. package/src/contracts/recording_credits/recording_credits.ts +458 -0
  210. package/src/contracts/recording_credits/recording_party_role.ts +1041 -0
  211. package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +138 -0
  212. package/src/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.ts +36 -0
  213. package/src/contracts/release_cover_art/deps/cover_art/cover_art.ts +23 -0
  214. package/src/contracts/release_cover_art/deps/per_track/per_track.ts +36 -0
  215. package/src/contracts/release_cover_art/release_cover_art.ts +251 -0
  216. package/src/contracts/release_credits/deps/miso_credit/credit.ts +27 -0
  217. package/src/contracts/release_credits/deps/sui/vec_map.ts +33 -0
  218. package/src/contracts/release_credits/release_credits.ts +156 -0
  219. package/src/contracts/release_credits/release_party_role.ts +87 -0
  220. package/src/contracts/royalty_pool/deps/std/type_name.ts +22 -0
  221. package/src/contracts/royalty_pool/deps/sui/balance.ts +17 -0
  222. package/src/contracts/royalty_pool/deps/sui/vec_map.ts +33 -0
  223. package/src/contracts/royalty_pool/pool.ts +577 -0
  224. package/src/contracts/royalty_pool/stake.ts +317 -0
  225. package/src/contracts/utils/index.ts +229 -0
  226. package/src/contracts.ts +30 -0
  227. package/src/cover.ts +136 -0
  228. package/src/credits.ts +645 -0
  229. package/src/execute.ts +141 -0
  230. package/src/extensions/royalty-pool.ts +85 -0
  231. package/src/index.ts +17 -0
  232. package/src/internal.ts +85 -0
  233. package/src/parsers.ts +80 -0
  234. package/src/queries.ts +478 -0
  235. package/src/schemas.ts +96 -0
  236. package/src/transactions.ts +290 -0
  237. package/src/types.ts +244 -0
  238. package/src/view.ts +59 -0
@@ -0,0 +1,298 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /**
7
+ * Represents an audio recording of a composition in Miso. Recordings are the audio
8
+ * performances that are distributed and played. Each recording has its own share
9
+ * token for ownership distribution.
10
+ *
11
+ * ### Key Features:
12
+ *
13
+ * - Share token initialization with fixed supply (10M tokens, 6 decimals)
14
+ * - State machine: Initialized -> Published (embedded fields immutable after
15
+ * publish; dynamic fields remain extensible via `uid_mut`, e.g. masters, and
16
+ * credits/attribution attached by the credits extension)
17
+ * - Deterministic addresses via derived object pattern
18
+ *
19
+ * Attribution (credits, primary/featured artists) is intentionally NOT part of
20
+ * core: it is display-oriented, varies across platforms, and is never read by the
21
+ * economics. It lives in a first-party credits extension attached via `uid_mut`,
22
+ * so core takes no dependency on an identity package and core publish enforces no
23
+ * attribution.
24
+ *
25
+ * A recording carries no name of its own. Its display title is its composition's
26
+ * title, read by reference — composition titles are immutable, so an embedded copy
27
+ * would carry no information. Anything that names this particular take — "(Live)",
28
+ * "Radio Edit", a translated title — has more than one correct rendering, which
29
+ * makes it presentation, and presentation lives in the metadata extension, never
30
+ * in the frozen core. Core stores what a recording _is_; extensions describe it.
31
+ *
32
+ * ### Lifecycle and trust model
33
+ *
34
+ * A recording is `key`-only with no `drop`: a fresh `Initialized` object cannot be
35
+ * transferred, wrapped, publicly shared, or discarded, and its only by-value
36
+ * consumer is `publish`. Create-and-publish is therefore atomic by construction —
37
+ * an `Initialized` recording cannot outlive its creating transaction, and every
38
+ * recording that exists on-chain is `Published` and shared. There is deliberately
39
+ * no keep function; staged building must fit one transaction.
40
+ *
41
+ * `uid_mut` works in any lifecycle state and is permanent root over ALL dynamic
42
+ * fields on the object — including fields attached by other extensions. "Immutable
43
+ * after publish" covers the embedded fields only; extension-layer data stays
44
+ * admin-mutable in perpetuity. This is the designed extension surface, and it is
45
+ * the one trust assumption that never expires: integrators should model the cap
46
+ * holder as able to mutate or delete any extension data, forever.
47
+ *
48
+ * The recording carries its parent composition's identity as the
49
+ * `CompositionShare` phantom type parameter — the composition's share type is its
50
+ * durable identity (a share currency is published independently of miso and
51
+ * survives a fresh republish, whereas an object ID does not). This makes the
52
+ * recording↔composition lineage compile-time enforced wherever the two meet, and
53
+ * it is the sole link: the composition's object id is not stored on the recording.
54
+ * Off-chain consumers that need the composition object resolve its share type to
55
+ * an id via `composition::CompositionPublishedEvent`, which binds the two.
56
+ *
57
+ * A recording is its own freshly-created object (`object::new`), not a derived
58
+ * child of its composition: `recording::new` takes a read-only `&Composition`
59
+ * (only to read its royalty rate and id), so publishing recordings under a
60
+ * composition neither contends on the composition's shared-object version nor
61
+ * collides on a per-composition index.
62
+ */
63
+
64
+ import { MoveEnum, MoveStruct, MoveTuple, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
65
+ import { bcs } from '@mysten/sui/bcs';
66
+ import { type Transaction } from '@mysten/sui/transactions';
67
+ const $moduleName = '@local-pkg/miso::recording';
68
+ /** Lifecycle state of a recording. */
69
+ export const RecordingState = new MoveEnum({ name: `${$moduleName}::RecordingState`, fields: {
70
+ /** Recording is being set up and can be modified. */
71
+ Initialized: null,
72
+ /** Recording is published and immutable. Includes publication timestamp. */
73
+ Published: bcs.u64()
74
+ } });
75
+ export const Recording = new MoveStruct({ name: `${$moduleName}::Recording<phantom RecordingShare, phantom CompositionShare>`, fields: {
76
+ /** Unique identifier for this recording. */
77
+ id: bcs.Address,
78
+ /** Current lifecycle state. */
79
+ state: RecordingState
80
+ } });
81
+ export const RecordingAdminCap = new MoveStruct({ name: `${$moduleName}::RecordingAdminCap<phantom RecordingShare>`, fields: {
82
+ /** Unique identifier for this capability. */
83
+ id: bcs.Address
84
+ } });
85
+ export const RecordingAdminCapKey = new MoveTuple({ name: `${$moduleName}::RecordingAdminCapKey`, fields: [bcs.bool()] });
86
+ export const RecordingPublishedEvent = new MoveStruct({ name: `${$moduleName}::RecordingPublishedEvent<phantom RecordingShare, phantom CompositionShare>`, fields: {
87
+ recording_id: bcs.Address
88
+ } });
89
+ export const CompositionSharesGrantedEvent = new MoveStruct({ name: `${$moduleName}::CompositionSharesGrantedEvent<phantom RecordingShare, phantom CompositionShare>`, fields: {
90
+ recording_id: bcs.Address,
91
+ composition_id: bcs.Address,
92
+ /** Recording-share base units granted to the composition. */
93
+ value: bcs.u64(),
94
+ /** The composition royalty rate applied at creation, in basis points. */
95
+ rate_bps: bcs.u16(),
96
+ granted_by: bcs.Address
97
+ } });
98
+ export interface NewArguments {
99
+ composition: RawTransactionArgument<string>;
100
+ shareCurrency: RawTransactionArgument<string>;
101
+ shareTreasuryCap: RawTransactionArgument<string>;
102
+ maxRoyaltyRateBps: RawTransactionArgument<number>;
103
+ }
104
+ export interface NewOptions {
105
+ package?: string;
106
+ arguments: NewArguments | [
107
+ composition: RawTransactionArgument<string>,
108
+ shareCurrency: RawTransactionArgument<string>,
109
+ shareTreasuryCap: RawTransactionArgument<string>,
110
+ maxRoyaltyRateBps: RawTransactionArgument<number>
111
+ ];
112
+ typeArguments: [
113
+ string,
114
+ string
115
+ ];
116
+ }
117
+ /**
118
+ * Creates a new recording for a composition.
119
+ *
120
+ * Initializes share tokens (10M supply, 6 decimals), then splits the composition's
121
+ * royalty-rate worth of those shares off the freshly minted supply and
122
+ * `send_funds`es them to the composition's address. This settles the composition's
123
+ * cut as cap-table ownership: the composition literally owns its share of the
124
+ * recording, so its claim on recording revenue is enforced by share ownership
125
+ * rather than by any revenue distributor choosing to honor a rate. What the
126
+ * composition owner then does with the shares (hold, stake, sell) is outside the
127
+ * protocol's scope.
128
+ *
129
+ * `max_royalty_rate_bps` is a slippage guard: `new` reads the composition's
130
+ * royalty rate live off a shared object, so a composition owner could land a rate
131
+ * increase in a transaction ordered just before this one and capture more of the
132
+ * recording's shares than the recorder saw. The call aborts if the composition's
133
+ * current rate exceeds `max_royalty_rate_bps`, so the recorder pins the most they
134
+ * will grant (pass the rate they observed, or `2000` to accept up to the protocol
135
+ * maximum).
136
+ *
137
+ * The composition need not be `Published`: within the composition's own creating
138
+ * transaction its creator can already mint recordings against it. Third parties
139
+ * only ever see `Published`, shared compositions (an `Initialized` one cannot
140
+ * escape its creating transaction), so indexers may observe a recording created
141
+ * "against an unpublished composition" only as an intra-transaction ordering,
142
+ * never across transactions.
143
+ *
144
+ * Returns:
145
+ *
146
+ * - The recording object (typed to its parent composition's `CompositionShare`)
147
+ * - Admin capability for the owner
148
+ * - The creator's remaining share balance (full supply minus the composition's
149
+ * cut)
150
+ */
151
+ export function _new(options: NewOptions) {
152
+ const packageAddress = options.package ?? '@local-pkg/miso';
153
+ const argumentsTypes = [
154
+ null,
155
+ null,
156
+ null,
157
+ 'u16'
158
+ ] satisfies (string | null)[];
159
+ const parameterNames = ["composition", "shareCurrency", "shareTreasuryCap", "maxRoyaltyRateBps"];
160
+ return (tx: Transaction) => tx.moveCall({
161
+ package: packageAddress,
162
+ module: 'recording',
163
+ function: 'new',
164
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
165
+ typeArguments: options.typeArguments
166
+ });
167
+ }
168
+ export interface PublishArguments {
169
+ self: RawTransactionArgument<string>;
170
+ _: RawTransactionArgument<string>;
171
+ }
172
+ export interface PublishOptions {
173
+ package?: string;
174
+ arguments: PublishArguments | [
175
+ self: RawTransactionArgument<string>,
176
+ _: RawTransactionArgument<string>
177
+ ];
178
+ typeArguments: [
179
+ string,
180
+ string
181
+ ];
182
+ }
183
+ /**
184
+ * Publishes the recording, making its embedded fields immutable. Required State:
185
+ * Initialized
186
+ *
187
+ * Note: core enforces no attribution requirement — credits live in the credits
188
+ * extension and may be attached before or after publish via `uid_mut`.
189
+ */
190
+ export function publish(options: PublishOptions) {
191
+ const packageAddress = options.package ?? '@local-pkg/miso';
192
+ const argumentsTypes = [
193
+ null,
194
+ null,
195
+ '0x2::clock::Clock'
196
+ ] satisfies (string | null)[];
197
+ const parameterNames = ["self", "_"];
198
+ return (tx: Transaction) => tx.moveCall({
199
+ package: packageAddress,
200
+ module: 'recording',
201
+ function: 'publish',
202
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
203
+ typeArguments: options.typeArguments
204
+ });
205
+ }
206
+ export interface IdArguments {
207
+ self: RawTransactionArgument<string>;
208
+ }
209
+ export interface IdOptions {
210
+ package?: string;
211
+ arguments: IdArguments | [
212
+ self: RawTransactionArgument<string>
213
+ ];
214
+ typeArguments: [
215
+ string,
216
+ string
217
+ ];
218
+ }
219
+ /** Returns the recording's object ID. */
220
+ export function id(options: IdOptions) {
221
+ const packageAddress = options.package ?? '@local-pkg/miso';
222
+ const argumentsTypes = [
223
+ null
224
+ ] satisfies (string | null)[];
225
+ const parameterNames = ["self"];
226
+ return (tx: Transaction) => tx.moveCall({
227
+ package: packageAddress,
228
+ module: 'recording',
229
+ function: 'id',
230
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
231
+ typeArguments: options.typeArguments
232
+ });
233
+ }
234
+ export interface UidArguments {
235
+ self: RawTransactionArgument<string>;
236
+ }
237
+ export interface UidOptions {
238
+ package?: string;
239
+ arguments: UidArguments | [
240
+ self: RawTransactionArgument<string>
241
+ ];
242
+ typeArguments: [
243
+ string,
244
+ string
245
+ ];
246
+ }
247
+ /** Returns a reference to the recording's UID for reading dynamic fields. */
248
+ export function uid(options: UidOptions) {
249
+ const packageAddress = options.package ?? '@local-pkg/miso';
250
+ const argumentsTypes = [
251
+ null
252
+ ] satisfies (string | null)[];
253
+ const parameterNames = ["self"];
254
+ return (tx: Transaction) => tx.moveCall({
255
+ package: packageAddress,
256
+ module: 'recording',
257
+ function: 'uid',
258
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
259
+ typeArguments: options.typeArguments
260
+ });
261
+ }
262
+ export interface UidMutArguments {
263
+ self: RawTransactionArgument<string>;
264
+ _: RawTransactionArgument<string>;
265
+ }
266
+ export interface UidMutOptions {
267
+ package?: string;
268
+ arguments: UidMutArguments | [
269
+ self: RawTransactionArgument<string>,
270
+ _: RawTransactionArgument<string>
271
+ ];
272
+ typeArguments: [
273
+ string,
274
+ string
275
+ ];
276
+ }
277
+ /**
278
+ * Returns a mutable reference to the recording's UID. Requires the admin
279
+ * capability. Works in any lifecycle state — dynamic fields are the extension
280
+ * surface (e.g. masters, credits) and stay admin-mutable after publish; only the
281
+ * embedded fields are frozen. The reference is root over every dynamic field on
282
+ * the object, including fields attached by other extensions.
283
+ */
284
+ export function uidMut(options: UidMutOptions) {
285
+ const packageAddress = options.package ?? '@local-pkg/miso';
286
+ const argumentsTypes = [
287
+ null,
288
+ null
289
+ ] satisfies (string | null)[];
290
+ const parameterNames = ["self", "_"];
291
+ return (tx: Transaction) => tx.moveCall({
292
+ package: packageAddress,
293
+ module: 'recording',
294
+ function: 'uid_mut',
295
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
296
+ typeArguments: options.typeArguments
297
+ });
298
+ }
@@ -0,0 +1,392 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /**
7
+ * Represents a music release in Miso. A release is an ordered tracklist with
8
+ * per-track revenue distribution configuration. Cover art lives in the `cover_art`
9
+ * extension, not in core.
10
+ *
11
+ * The tracklist is deliberately FLAT — a `vector<Track>` with no disc structure.
12
+ * Grouping a sequence into discs, vinyl sides, acts, or movements is a property of
13
+ * a distribution medium, not of the release: it has more than one correct
14
+ * rendering, which makes it presentation, and presentation lives in the metadata
15
+ * extension. A consequence worth stating: the stored tracklist and the digest
16
+ * pre-image have the same shape, so what signers consented to is exactly what is
17
+ * stored — nothing structural is chosen after consent except the title.
18
+ *
19
+ * ### Key Features:
20
+ *
21
+ * - Ordered flat tracklist (grouping is presentation, in the metadata extension)
22
+ * - Configurable per-track revenue splits
23
+ * - State machine: Initialized -> Published
24
+ *
25
+ * Attribution (credits, primary/featured artists) is intentionally NOT part of
26
+ * core: it is display-oriented, varies across platforms, and is never read by the
27
+ * economics. It lives in a first-party credits extension attached via `uid_mut`,
28
+ * so core takes no dependency on an identity package and core publish enforces no
29
+ * attribution.
30
+ *
31
+ * The same rule governs naming. Core stores what a thing _is_ — identity and
32
+ * everything the economics read; extensions describe it. The release's `title` is
33
+ * the one embedded name: it is constitutive (naming the package is part of
34
+ * creating it) and freezing it at publish is a buyer-facing guarantee. Edition
35
+ * naming ("Deluxe Edition"), disc titles, localized titles, and DSP-shaped slots
36
+ * all have more than one correct rendering — presentation — and live in the
37
+ * metadata extension.
38
+ *
39
+ * ### Consent scope
40
+ *
41
+ * The release digest — and therefore the derived release id every `Deal` commits
42
+ * to — binds the economics and membership of the release: the ordered list of
43
+ * `(recording, split)` pairs and the creator's nonce. It deliberately binds
44
+ * nothing else. The title — the one embedded field outside the digest — and
45
+ * everything in the extension layer (artwork, credits, display grouping) are
46
+ * chosen by the release creator, before or after deals are signed, and are trusted
47
+ * and publicly attributable rather than cryptographically committed. See
48
+ * `deal::new` for the signer-side statement of this boundary.
49
+ *
50
+ * ### Lifecycle and trust model
51
+ *
52
+ * A release is `key`-only with no `drop`: a fresh `Initialized` object cannot be
53
+ * transferred, wrapped, publicly shared, or discarded, and its only by-value
54
+ * consumer is `publish`. Create-and-publish is therefore atomic by construction —
55
+ * an `Initialized` release cannot outlive its creating transaction, and every
56
+ * release that exists on-chain is `Published` and shared. There is deliberately no
57
+ * keep function; assembling tracks, discs, and the release must fit one
58
+ * transaction.
59
+ *
60
+ * `uid_mut` works in any lifecycle state and is permanent root over ALL dynamic
61
+ * fields on the object — including fields attached by other extensions. "Immutable
62
+ * after publish" covers the embedded fields only; extension-layer data stays
63
+ * admin-mutable in perpetuity. This is the designed extension surface, and it is
64
+ * the one trust assumption that never expires: integrators should model the cap
65
+ * holder as able to mutate or delete any extension data, forever.
66
+ */
67
+
68
+ import { MoveTuple, MoveEnum, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
69
+ import { bcs } from '@mysten/sui/bcs';
70
+ import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
71
+ import * as track from './track.js';
72
+ const $moduleName = '@local-pkg/miso::release';
73
+ export const RELEASE = new MoveTuple({ name: `${$moduleName}::RELEASE`, fields: [bcs.bool()] });
74
+ /** Lifecycle state of a release. */
75
+ export const ReleaseState = new MoveEnum({ name: `${$moduleName}::ReleaseState`, fields: {
76
+ /** Release is initialized but not yet published. */
77
+ Initialized: null,
78
+ /** Release is published and immutable. Includes publication timestamp. */
79
+ Published: bcs.u64()
80
+ } });
81
+ export const Release = new MoveStruct({ name: `${$moduleName}::Release`, fields: {
82
+ /** Unique identifier for this release. */
83
+ id: bcs.Address,
84
+ /** Current lifecycle state. */
85
+ state: ReleaseState,
86
+ /** Title of the release. */
87
+ title: bcs.string(),
88
+ /**
89
+ * The ordered tracklist. Same shape as the digest pre-image every deal consented
90
+ * to; display grouping lives in the metadata extension.
91
+ */
92
+ tracks: bcs.vector(track.Track)
93
+ } });
94
+ export const ReleaseKey = new MoveTuple({ name: `${$moduleName}::ReleaseKey`, fields: [bcs.vector(bcs.u8())] });
95
+ export const ReleaseRegistry = new MoveStruct({ name: `${$moduleName}::ReleaseRegistry`, fields: {
96
+ id: bcs.Address
97
+ } });
98
+ export const ReleaseAdminCap = new MoveStruct({ name: `${$moduleName}::ReleaseAdminCap`, fields: {
99
+ /** Unique identifier for this capability. */
100
+ id: bcs.Address,
101
+ /** ID of the release this capability controls. */
102
+ release_id: bcs.Address
103
+ } });
104
+ export const ReleaseAdminCapKey = new MoveTuple({ name: `${$moduleName}::ReleaseAdminCapKey`, fields: [bcs.bool()] });
105
+ export const ReleaseRegistryCreatedEvent = new MoveStruct({ name: `${$moduleName}::ReleaseRegistryCreatedEvent`, fields: {
106
+ registry_id: bcs.Address,
107
+ created_by: bcs.Address
108
+ } });
109
+ export const ReleasePublishedEvent = new MoveStruct({ name: `${$moduleName}::ReleasePublishedEvent`, fields: {
110
+ release_id: bcs.Address
111
+ } });
112
+ export interface NewArguments {
113
+ title: RawTransactionArgument<string>;
114
+ tracks: TransactionArgument;
115
+ nonce: RawTransactionArgument<number | bigint>;
116
+ registry: RawTransactionArgument<string>;
117
+ }
118
+ export interface NewOptions {
119
+ package?: string;
120
+ arguments: NewArguments | [
121
+ title: RawTransactionArgument<string>,
122
+ tracks: TransactionArgument,
123
+ nonce: RawTransactionArgument<number | bigint>,
124
+ registry: RawTransactionArgument<string>
125
+ ];
126
+ }
127
+ /**
128
+ * Creates a new release with the given configuration. Returns the release and
129
+ * admin capability.
130
+ */
131
+ export function _new(options: NewOptions) {
132
+ const packageAddress = options.package ?? '@local-pkg/miso';
133
+ const argumentsTypes = [
134
+ '0x1::string::String',
135
+ 'vector<null>',
136
+ 'u256',
137
+ null
138
+ ] satisfies (string | null)[];
139
+ const parameterNames = ["title", "tracks", "nonce", "registry"];
140
+ return (tx: Transaction) => tx.moveCall({
141
+ package: packageAddress,
142
+ module: 'release',
143
+ function: 'new',
144
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
145
+ });
146
+ }
147
+ export interface PublishArguments {
148
+ self: RawTransactionArgument<string>;
149
+ cap: RawTransactionArgument<string>;
150
+ }
151
+ export interface PublishOptions {
152
+ package?: string;
153
+ arguments: PublishArguments | [
154
+ self: RawTransactionArgument<string>,
155
+ cap: RawTransactionArgument<string>
156
+ ];
157
+ }
158
+ /**
159
+ * Publishes the release, making it immutable. Track splits must be set and sum to
160
+ * 100% before publishing. Required State: Initialized
161
+ *
162
+ * Note: core enforces no attribution requirement — credits live in the credits
163
+ * extension and may be attached before or after publish via `uid_mut`.
164
+ */
165
+ export function publish(options: PublishOptions) {
166
+ const packageAddress = options.package ?? '@local-pkg/miso';
167
+ const argumentsTypes = [
168
+ null,
169
+ null,
170
+ '0x2::clock::Clock'
171
+ ] satisfies (string | null)[];
172
+ const parameterNames = ["self", "cap"];
173
+ return (tx: Transaction) => tx.moveCall({
174
+ package: packageAddress,
175
+ module: 'release',
176
+ function: 'publish',
177
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
178
+ });
179
+ }
180
+ export interface AuthorizeArguments {
181
+ self: RawTransactionArgument<string>;
182
+ cap: RawTransactionArgument<string>;
183
+ }
184
+ export interface AuthorizeOptions {
185
+ package?: string;
186
+ arguments: AuthorizeArguments | [
187
+ self: RawTransactionArgument<string>,
188
+ cap: RawTransactionArgument<string>
189
+ ];
190
+ }
191
+ /** Verifies that the admin capability matches this release. */
192
+ export function authorize(options: AuthorizeOptions) {
193
+ const packageAddress = options.package ?? '@local-pkg/miso';
194
+ const argumentsTypes = [
195
+ null,
196
+ null
197
+ ] satisfies (string | null)[];
198
+ const parameterNames = ["self", "cap"];
199
+ return (tx: Transaction) => tx.moveCall({
200
+ package: packageAddress,
201
+ module: 'release',
202
+ function: 'authorize',
203
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
204
+ });
205
+ }
206
+ export interface DeriveReleaseIdArguments {
207
+ recordingIds: RawTransactionArgument<Array<string>>;
208
+ trackSplitValues: RawTransactionArgument<Array<number | bigint>>;
209
+ nonce: RawTransactionArgument<number | bigint>;
210
+ registry: RawTransactionArgument<string>;
211
+ }
212
+ export interface DeriveReleaseIdOptions {
213
+ package?: string;
214
+ arguments: DeriveReleaseIdArguments | [
215
+ recordingIds: RawTransactionArgument<Array<string>>,
216
+ trackSplitValues: RawTransactionArgument<Array<number | bigint>>,
217
+ nonce: RawTransactionArgument<number | bigint>,
218
+ registry: RawTransactionArgument<string>
219
+ ];
220
+ }
221
+ /**
222
+ * Derives the release ID that `new()` would produce for the given inputs, without
223
+ * creating the object. This is the on-chain equivalent of the client-side
224
+ * `deriveReleaseId()` function.
225
+ */
226
+ export function deriveReleaseId(options: DeriveReleaseIdOptions) {
227
+ const packageAddress = options.package ?? '@local-pkg/miso';
228
+ const argumentsTypes = [
229
+ 'vector<0x2::object::ID>',
230
+ 'vector<u64>',
231
+ 'u256',
232
+ null
233
+ ] satisfies (string | null)[];
234
+ const parameterNames = ["recordingIds", "trackSplitValues", "nonce", "registry"];
235
+ return (tx: Transaction) => tx.moveCall({
236
+ package: packageAddress,
237
+ module: 'release',
238
+ function: 'derive_release_id',
239
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
240
+ });
241
+ }
242
+ export interface IdArguments {
243
+ self: RawTransactionArgument<string>;
244
+ }
245
+ export interface IdOptions {
246
+ package?: string;
247
+ arguments: IdArguments | [
248
+ self: RawTransactionArgument<string>
249
+ ];
250
+ }
251
+ /** Returns the release's object ID. */
252
+ export function id(options: IdOptions) {
253
+ const packageAddress = options.package ?? '@local-pkg/miso';
254
+ const argumentsTypes = [
255
+ null
256
+ ] satisfies (string | null)[];
257
+ const parameterNames = ["self"];
258
+ return (tx: Transaction) => tx.moveCall({
259
+ package: packageAddress,
260
+ module: 'release',
261
+ function: 'id',
262
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
263
+ });
264
+ }
265
+ export interface TitleArguments {
266
+ self: RawTransactionArgument<string>;
267
+ }
268
+ export interface TitleOptions {
269
+ package?: string;
270
+ arguments: TitleArguments | [
271
+ self: RawTransactionArgument<string>
272
+ ];
273
+ }
274
+ /** Returns the release title. */
275
+ export function title(options: TitleOptions) {
276
+ const packageAddress = options.package ?? '@local-pkg/miso';
277
+ const argumentsTypes = [
278
+ null
279
+ ] satisfies (string | null)[];
280
+ const parameterNames = ["self"];
281
+ return (tx: Transaction) => tx.moveCall({
282
+ package: packageAddress,
283
+ module: 'release',
284
+ function: 'title',
285
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
286
+ });
287
+ }
288
+ export interface TracksArguments {
289
+ self: RawTransactionArgument<string>;
290
+ }
291
+ export interface TracksOptions {
292
+ package?: string;
293
+ arguments: TracksArguments | [
294
+ self: RawTransactionArgument<string>
295
+ ];
296
+ }
297
+ /**
298
+ * Returns a reference to the ordered tracklist. The single tracklist accessor —
299
+ * consumers derive length, membership, and per-track data from it
300
+ * (`tracks().length()`, `tracks().any!(..)`, indexing).
301
+ */
302
+ export function tracks(options: TracksOptions) {
303
+ const packageAddress = options.package ?? '@local-pkg/miso';
304
+ const argumentsTypes = [
305
+ null
306
+ ] satisfies (string | null)[];
307
+ const parameterNames = ["self"];
308
+ return (tx: Transaction) => tx.moveCall({
309
+ package: packageAddress,
310
+ module: 'release',
311
+ function: 'tracks',
312
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
313
+ });
314
+ }
315
+ export interface ReleaseAdminCapReleaseIdArguments {
316
+ cap: RawTransactionArgument<string>;
317
+ }
318
+ export interface ReleaseAdminCapReleaseIdOptions {
319
+ package?: string;
320
+ arguments: ReleaseAdminCapReleaseIdArguments | [
321
+ cap: RawTransactionArgument<string>
322
+ ];
323
+ }
324
+ /** Returns the release ID associated with the admin capability. */
325
+ export function releaseAdminCapReleaseId(options: ReleaseAdminCapReleaseIdOptions) {
326
+ const packageAddress = options.package ?? '@local-pkg/miso';
327
+ const argumentsTypes = [
328
+ null
329
+ ] satisfies (string | null)[];
330
+ const parameterNames = ["cap"];
331
+ return (tx: Transaction) => tx.moveCall({
332
+ package: packageAddress,
333
+ module: 'release',
334
+ function: 'release_admin_cap_release_id',
335
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
336
+ });
337
+ }
338
+ export interface UidArguments {
339
+ self: RawTransactionArgument<string>;
340
+ }
341
+ export interface UidOptions {
342
+ package?: string;
343
+ arguments: UidArguments | [
344
+ self: RawTransactionArgument<string>
345
+ ];
346
+ }
347
+ /** Returns a reference to the release's UID for reading dynamic fields. */
348
+ export function uid(options: UidOptions) {
349
+ const packageAddress = options.package ?? '@local-pkg/miso';
350
+ const argumentsTypes = [
351
+ null
352
+ ] satisfies (string | null)[];
353
+ const parameterNames = ["self"];
354
+ return (tx: Transaction) => tx.moveCall({
355
+ package: packageAddress,
356
+ module: 'release',
357
+ function: 'uid',
358
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
359
+ });
360
+ }
361
+ export interface UidMutArguments {
362
+ self: RawTransactionArgument<string>;
363
+ cap: RawTransactionArgument<string>;
364
+ }
365
+ export interface UidMutOptions {
366
+ package?: string;
367
+ arguments: UidMutArguments | [
368
+ self: RawTransactionArgument<string>,
369
+ cap: RawTransactionArgument<string>
370
+ ];
371
+ }
372
+ /**
373
+ * Returns a mutable reference to the release's UID. Requires the admin capability.
374
+ * Works in any lifecycle state — dynamic fields are the extension surface (e.g.
375
+ * credits) and stay admin-mutable after publish; only the embedded fields are
376
+ * frozen. The reference is root over every dynamic field on the object, including
377
+ * fields attached by other extensions.
378
+ */
379
+ export function uidMut(options: UidMutOptions) {
380
+ const packageAddress = options.package ?? '@local-pkg/miso';
381
+ const argumentsTypes = [
382
+ null,
383
+ null
384
+ ] satisfies (string | null)[];
385
+ const parameterNames = ["self", "cap"];
386
+ return (tx: Transaction) => tx.moveCall({
387
+ package: packageAddress,
388
+ module: 'release',
389
+ function: 'uid_mut',
390
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
391
+ });
392
+ }