@misofm/sdk 0.9.0 → 0.11.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 (265) hide show
  1. package/README.md +88 -56
  2. package/dist/client.d.ts +121 -18
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +200 -44
  5. package/dist/client.js.map +1 -1
  6. package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts +205 -0
  7. package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts.map +1 -0
  8. package/dist/contracts/composition_routed_stake/composition_routed_stake.js +184 -0
  9. package/dist/contracts/composition_routed_stake/composition_routed_stake.js.map +1 -0
  10. package/dist/contracts/composition_routed_stake/witness.d.ts +7 -0
  11. package/dist/contracts/composition_routed_stake/witness.d.ts.map +1 -0
  12. package/dist/contracts/composition_routed_stake/witness.js +9 -0
  13. package/dist/contracts/composition_routed_stake/witness.js.map +1 -0
  14. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +89 -28
  15. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +1 -1
  16. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +84 -23
  17. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +1 -1
  18. package/dist/contracts/composition_royalty_pool/witness.d.ts +6 -0
  19. package/dist/contracts/composition_royalty_pool/witness.d.ts.map +1 -0
  20. package/dist/contracts/composition_royalty_pool/witness.js +8 -0
  21. package/dist/contracts/composition_royalty_pool/witness.js.map +1 -0
  22. package/dist/contracts/genre/genre.d.ts +96 -0
  23. package/dist/contracts/genre/genre.d.ts.map +1 -0
  24. package/dist/contracts/genre/genre.js +107 -0
  25. package/dist/contracts/genre/genre.js.map +1 -0
  26. package/dist/contracts/recording_advisory/recording_advisory.d.ts +194 -0
  27. package/dist/contracts/recording_advisory/recording_advisory.d.ts.map +1 -0
  28. package/dist/contracts/recording_advisory/recording_advisory.js +204 -0
  29. package/dist/contracts/recording_advisory/recording_advisory.js.map +1 -0
  30. package/dist/contracts/recording_language/deps/language_code/language_code.d.ts +6 -0
  31. package/dist/contracts/recording_language/deps/language_code/language_code.d.ts.map +1 -0
  32. package/dist/contracts/recording_language/deps/language_code/language_code.js +8 -0
  33. package/dist/contracts/recording_language/deps/language_code/language_code.js.map +1 -0
  34. package/dist/contracts/recording_language/recording_language.d.ts +152 -0
  35. package/dist/contracts/recording_language/recording_language.d.ts.map +1 -0
  36. package/dist/contracts/recording_language/recording_language.js +149 -0
  37. package/dist/contracts/recording_language/recording_language.js.map +1 -0
  38. package/dist/contracts/recording_master_reference/deps/ori/walrus_data.d.ts +52 -0
  39. package/dist/contracts/recording_master_reference/deps/ori/walrus_data.d.ts.map +1 -0
  40. package/dist/contracts/recording_master_reference/deps/ori/walrus_data.js +37 -0
  41. package/dist/contracts/recording_master_reference/deps/ori/walrus_data.js.map +1 -0
  42. package/dist/contracts/recording_master_reference/recording_master_reference.d.ts +131 -0
  43. package/dist/contracts/recording_master_reference/recording_master_reference.d.ts.map +1 -0
  44. package/dist/contracts/recording_master_reference/recording_master_reference.js +121 -0
  45. package/dist/contracts/recording_master_reference/recording_master_reference.js.map +1 -0
  46. package/dist/contracts/recording_preview/deps/ori/walrus_data.d.ts +52 -0
  47. package/dist/contracts/recording_preview/deps/ori/walrus_data.d.ts.map +1 -0
  48. package/dist/contracts/recording_preview/deps/ori/walrus_data.js +37 -0
  49. package/dist/contracts/recording_preview/deps/ori/walrus_data.js.map +1 -0
  50. package/dist/contracts/recording_preview/recording_preview.d.ts +104 -0
  51. package/dist/contracts/recording_preview/recording_preview.d.ts.map +1 -0
  52. package/dist/contracts/recording_preview/recording_preview.js +94 -0
  53. package/dist/contracts/recording_preview/recording_preview.js.map +1 -0
  54. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +90 -28
  55. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +1 -1
  56. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +84 -23
  57. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +1 -1
  58. package/dist/contracts/recording_royalty_pool/witness.d.ts +6 -0
  59. package/dist/contracts/recording_royalty_pool/witness.d.ts.map +1 -0
  60. package/dist/contracts/recording_royalty_pool/witness.js +8 -0
  61. package/dist/contracts/recording_royalty_pool/witness.js.map +1 -0
  62. package/dist/contracts/release_description/release_description.d.ts +112 -0
  63. package/dist/contracts/release_description/release_description.d.ts.map +1 -0
  64. package/dist/contracts/release_description/release_description.js +123 -0
  65. package/dist/contracts/release_description/release_description.js.map +1 -0
  66. package/dist/contracts/release_dsp_link/release_dsp_link.d.ts +644 -0
  67. package/dist/contracts/release_dsp_link/release_dsp_link.d.ts.map +1 -0
  68. package/dist/contracts/release_dsp_link/release_dsp_link.js +556 -0
  69. package/dist/contracts/release_dsp_link/release_dsp_link.js.map +1 -0
  70. package/dist/contracts/release_genre/deps/per_track/per_track.d.ts +33 -0
  71. package/dist/contracts/release_genre/deps/per_track/per_track.d.ts.map +1 -0
  72. package/dist/contracts/release_genre/deps/per_track/per_track.js +32 -0
  73. package/dist/contracts/release_genre/deps/per_track/per_track.js.map +1 -0
  74. package/dist/contracts/release_genre/release_genre.d.ts +193 -0
  75. package/dist/contracts/release_genre/release_genre.d.ts.map +1 -0
  76. package/dist/contracts/release_genre/release_genre.js +207 -0
  77. package/dist/contracts/release_genre/release_genre.js.map +1 -0
  78. package/dist/contracts/release_kind/release_kind.d.ts +98 -0
  79. package/dist/contracts/release_kind/release_kind.d.ts.map +1 -0
  80. package/dist/contracts/release_kind/release_kind.js +109 -0
  81. package/dist/contracts/release_kind/release_kind.js.map +1 -0
  82. package/dist/contracts/release_revenue_distributor/release_revenue_distributor.d.ts +106 -0
  83. package/dist/contracts/release_revenue_distributor/release_revenue_distributor.d.ts.map +1 -0
  84. package/dist/contracts/release_revenue_distributor/release_revenue_distributor.js +113 -0
  85. package/dist/contracts/release_revenue_distributor/release_revenue_distributor.js.map +1 -0
  86. package/dist/contracts/release_revenue_distributor/witness.d.ts +7 -0
  87. package/dist/contracts/release_revenue_distributor/witness.d.ts.map +1 -0
  88. package/dist/contracts/release_revenue_distributor/witness.js +9 -0
  89. package/dist/contracts/release_revenue_distributor/witness.js.map +1 -0
  90. package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts +54 -0
  91. package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts.map +1 -0
  92. package/dist/contracts/routed_stake/deps/royalty_pool/stake.js +37 -0
  93. package/dist/contracts/routed_stake/deps/royalty_pool/stake.js.map +1 -0
  94. package/dist/contracts/routed_stake/deps/std/type_name.d.ts +18 -0
  95. package/dist/contracts/routed_stake/deps/std/type_name.d.ts.map +1 -0
  96. package/dist/contracts/routed_stake/deps/std/type_name.js +20 -0
  97. package/dist/contracts/routed_stake/deps/std/type_name.js.map +1 -0
  98. package/dist/contracts/routed_stake/deps/sui/balance.d.ts +13 -0
  99. package/dist/contracts/routed_stake/deps/sui/balance.d.ts.map +1 -0
  100. package/dist/contracts/routed_stake/deps/sui/balance.js +15 -0
  101. package/dist/contracts/routed_stake/deps/sui/balance.js.map +1 -0
  102. package/dist/contracts/routed_stake/deps/sui/vec_map.d.ts +37 -0
  103. package/dist/contracts/routed_stake/deps/sui/vec_map.d.ts.map +1 -0
  104. package/dist/contracts/routed_stake/deps/sui/vec_map.js +28 -0
  105. package/dist/contracts/routed_stake/deps/sui/vec_map.js.map +1 -0
  106. package/dist/contracts/routed_stake/routed_stake.d.ts +356 -0
  107. package/dist/contracts/routed_stake/routed_stake.d.ts.map +1 -0
  108. package/dist/contracts/routed_stake/routed_stake.js +311 -0
  109. package/dist/contracts/routed_stake/routed_stake.js.map +1 -0
  110. package/dist/contracts/royalty_pool/pool.d.ts +27 -17
  111. package/dist/contracts/royalty_pool/pool.d.ts.map +1 -1
  112. package/dist/contracts/royalty_pool/pool.js +26 -17
  113. package/dist/contracts/royalty_pool/pool.js.map +1 -1
  114. package/dist/contracts/vault/deps/sui/bag.d.ts +35 -0
  115. package/dist/contracts/vault/deps/sui/bag.d.ts.map +1 -0
  116. package/dist/contracts/vault/deps/sui/bag.js +37 -0
  117. package/dist/contracts/vault/deps/sui/bag.js.map +1 -0
  118. package/dist/contracts/vault/deps/sui/borrow.d.ts +20 -0
  119. package/dist/contracts/vault/deps/sui/borrow.d.ts.map +1 -0
  120. package/dist/contracts/vault/deps/sui/borrow.js +21 -0
  121. package/dist/contracts/vault/deps/sui/borrow.js.map +1 -0
  122. package/dist/contracts/vault/vault.d.ts +276 -0
  123. package/dist/contracts/vault/vault.d.ts.map +1 -0
  124. package/dist/contracts/vault/vault.js +274 -0
  125. package/dist/contracts/vault/vault.js.map +1 -0
  126. package/dist/contracts.d.ts +13 -2
  127. package/dist/contracts.d.ts.map +1 -1
  128. package/dist/contracts.js +15 -7
  129. package/dist/contracts.js.map +1 -1
  130. package/dist/cover.d.ts +17 -3
  131. package/dist/cover.d.ts.map +1 -1
  132. package/dist/cover.js +43 -20
  133. package/dist/cover.js.map +1 -1
  134. package/dist/credits.d.ts +31 -12
  135. package/dist/credits.d.ts.map +1 -1
  136. package/dist/credits.js +41 -25
  137. package/dist/credits.js.map +1 -1
  138. package/dist/deployments.d.ts +30 -57
  139. package/dist/deployments.d.ts.map +1 -1
  140. package/dist/deployments.js +5 -53
  141. package/dist/deployments.js.map +1 -1
  142. package/dist/index.d.ts +4 -2
  143. package/dist/index.d.ts.map +1 -1
  144. package/dist/index.js +6 -5
  145. package/dist/index.js.map +1 -1
  146. package/dist/pressing.d.ts +8 -7
  147. package/dist/pressing.d.ts.map +1 -1
  148. package/dist/pressing.js +91 -32
  149. package/dist/pressing.js.map +1 -1
  150. package/dist/read/artist.js +3 -3
  151. package/dist/read/artist.js.map +1 -1
  152. package/dist/read/catalog.d.ts +14 -9
  153. package/dist/read/catalog.d.ts.map +1 -1
  154. package/dist/read/catalog.js +71 -37
  155. package/dist/read/catalog.js.map +1 -1
  156. package/dist/read/client.d.ts +4 -2
  157. package/dist/read/client.d.ts.map +1 -1
  158. package/dist/read/client.js +15 -4
  159. package/dist/read/client.js.map +1 -1
  160. package/dist/read/config.d.ts +14 -11
  161. package/dist/read/config.d.ts.map +1 -1
  162. package/dist/read/config.js +10 -37
  163. package/dist/read/config.js.map +1 -1
  164. package/dist/read/index.d.ts +2 -2
  165. package/dist/read/index.d.ts.map +1 -1
  166. package/dist/read/index.js +1 -1
  167. package/dist/read/index.js.map +1 -1
  168. package/dist/read/receipts.d.ts +24 -7
  169. package/dist/read/receipts.d.ts.map +1 -1
  170. package/dist/read/receipts.js +78 -25
  171. package/dist/read/receipts.js.map +1 -1
  172. package/dist/read/types.d.ts +43 -25
  173. package/dist/read/types.d.ts.map +1 -1
  174. package/dist/read/types.js +2 -2
  175. package/dist/read/types.js.map +1 -1
  176. package/dist/recording-extensions.d.ts +37 -0
  177. package/dist/recording-extensions.d.ts.map +1 -0
  178. package/dist/recording-extensions.js +61 -0
  179. package/dist/recording-extensions.js.map +1 -0
  180. package/dist/release-extensions.d.ts +84 -0
  181. package/dist/release-extensions.d.ts.map +1 -0
  182. package/dist/release-extensions.js +160 -0
  183. package/dist/release-extensions.js.map +1 -0
  184. package/dist/release-graph.d.ts +17 -26
  185. package/dist/release-graph.d.ts.map +1 -1
  186. package/dist/release-graph.js +55 -49
  187. package/dist/release-graph.js.map +1 -1
  188. package/dist/transactions.d.ts +43 -24
  189. package/dist/transactions.d.ts.map +1 -1
  190. package/dist/transactions.js +48 -27
  191. package/dist/transactions.js.map +1 -1
  192. package/dist/vault.d.ts +268 -0
  193. package/dist/vault.d.ts.map +1 -0
  194. package/dist/vault.js +389 -0
  195. package/dist/vault.js.map +1 -0
  196. package/package.json +17 -11
  197. package/src/client.ts +399 -61
  198. package/src/contracts/composition_routed_stake/composition_routed_stake.ts +346 -0
  199. package/src/contracts/composition_routed_stake/witness.ts +11 -0
  200. package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +151 -35
  201. package/src/contracts/composition_royalty_pool/witness.ts +7 -0
  202. package/src/contracts/genre/genre.ts +151 -0
  203. package/src/contracts/recording_advisory/recording_advisory.ts +315 -0
  204. package/src/contracts/recording_language/deps/language_code/language_code.ts +7 -0
  205. package/src/contracts/recording_language/recording_language.ts +237 -0
  206. package/src/contracts/recording_master_reference/deps/ori/walrus_data.ts +36 -0
  207. package/src/contracts/recording_master_reference/recording_master_reference.ts +181 -0
  208. package/src/contracts/recording_preview/deps/ori/walrus_data.ts +36 -0
  209. package/src/contracts/recording_preview/recording_preview.ts +154 -0
  210. package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +152 -35
  211. package/src/contracts/recording_royalty_pool/witness.ts +7 -0
  212. package/src/contracts/release_description/release_description.ts +167 -0
  213. package/src/contracts/release_dsp_link/release_dsp_link.ts +813 -0
  214. package/src/contracts/release_genre/deps/per_track/per_track.ts +36 -0
  215. package/src/contracts/release_genre/release_genre.ts +314 -0
  216. package/src/contracts/release_kind/release_kind.ts +153 -0
  217. package/src/contracts/release_revenue_distributor/release_revenue_distributor.ts +178 -0
  218. package/src/contracts/release_revenue_distributor/witness.ts +11 -0
  219. package/src/contracts/routed_stake/deps/royalty_pool/stake.ts +39 -0
  220. package/src/contracts/routed_stake/deps/std/type_name.ts +22 -0
  221. package/src/contracts/routed_stake/deps/sui/balance.ts +17 -0
  222. package/src/contracts/routed_stake/deps/sui/vec_map.ts +33 -0
  223. package/src/contracts/routed_stake/routed_stake.ts +508 -0
  224. package/src/contracts/royalty_pool/pool.ts +34 -24
  225. package/src/contracts/vault/deps/sui/bag.ts +39 -0
  226. package/src/contracts/vault/deps/sui/borrow.ts +25 -0
  227. package/src/contracts/vault/vault.ts +454 -0
  228. package/src/contracts.ts +16 -9
  229. package/src/cover.ts +62 -37
  230. package/src/credits.ts +64 -51
  231. package/src/deployments.ts +35 -97
  232. package/src/index.ts +11 -5
  233. package/src/pressing.ts +135 -39
  234. package/src/read/artist.ts +3 -3
  235. package/src/read/catalog.ts +99 -44
  236. package/src/read/client.ts +20 -4
  237. package/src/read/config.ts +23 -49
  238. package/src/read/index.ts +3 -1
  239. package/src/read/receipts.ts +103 -26
  240. package/src/read/types.ts +44 -27
  241. package/src/recording-extensions.ts +102 -0
  242. package/src/release-extensions.ts +261 -0
  243. package/src/release-graph.ts +68 -81
  244. package/src/transactions.ts +79 -53
  245. package/src/vault.ts +777 -0
  246. package/dist/contracts/miso_drop/drop.d.ts +0 -550
  247. package/dist/contracts/miso_drop/drop.d.ts.map +0 -1
  248. package/dist/contracts/miso_drop/drop.js +0 -523
  249. package/dist/contracts/miso_drop/drop.js.map +0 -1
  250. package/dist/contracts/release_registry/release_registry.d.ts +0 -114
  251. package/dist/contracts/release_registry/release_registry.d.ts.map +0 -1
  252. package/dist/contracts/release_registry/release_registry.js +0 -119
  253. package/dist/contracts/release_registry/release_registry.js.map +0 -1
  254. package/dist/drop.d.ts +0 -127
  255. package/dist/drop.d.ts.map +0 -1
  256. package/dist/drop.js +0 -202
  257. package/dist/drop.js.map +0 -1
  258. package/dist/extensions/royalty-pool.d.ts +0 -32
  259. package/dist/extensions/royalty-pool.d.ts.map +0 -1
  260. package/dist/extensions/royalty-pool.js +0 -33
  261. package/dist/extensions/royalty-pool.js.map +0 -1
  262. package/src/contracts/miso_drop/drop.ts +0 -798
  263. package/src/contracts/release_registry/release_registry.ts +0 -160
  264. package/src/drop.ts +0 -376
  265. package/src/extensions/royalty-pool.ts +0 -90
@@ -1,119 +0,0 @@
1
- /**************************************************************
2
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
- **************************************************************/
4
- /**
5
- * The recommended canonical parent namespace for `miso::release::new`.
6
- *
7
- * `miso::release::new` takes `parent: &mut UID` and derives every release's id
8
- * from `(parent, digest)`: core is deliberately parent-agnostic and implements no
9
- * coordination policy of its own (see the "Consent scope" section of
10
- * `miso::release`'s module doc). This package supplies the one recommended parent
11
- * — a shared, permissionless, undeletable `UID` — and is deliberately the _only_
12
- * policy it implements: it neither gates who may assemble a release through it nor
13
- * interprets what a `Track` means.
14
- *
15
- * ### One instance, ever
16
- *
17
- * The module exposes no constructor: the only `ReleaseRegistry` that can ever
18
- * exist is the canonical one created and shared by package initialization. "The
19
- * registry" is therefore unambiguous on-chain — the type itself names the
20
- * namespace, not a config convention. Every `new_release` takes `&mut` on that one
21
- * shared object, so release creation through it serializes per checkpoint; the
22
- * ceiling is accepted — releases are rare events. Alternative namespaces are still
23
- * possible, but they live in other packages: core is parent-agnostic, and any
24
- * object exposing a `&mut UID` (a release escrow, for instance) can parent its own
25
- * releases; ids derived under different parents never collide, by construction of
26
- * `derive_address`.
27
- *
28
- * ### Liveness
29
- *
30
- * The canonical instance is shared at publish, and this module exposes no delete
31
- * function and no `uid_mut`: its only capability is being a derivation parent.
32
- * That undeletability is a consent guarantee, not an accident — a `Track`'s
33
- * `target_release_id` commits to this namespace's liveness (see `miso::release`'s
34
- * module doc), and a deletable parent would strand every track and offer that ever
35
- * targeted it. Keeping the surface to exactly one capability is what makes that
36
- * guarantee durable: there is nothing else here to reason about.
37
- *
38
- * ### Permissionless
39
- *
40
- * No capability gates `new_release`: anyone holding a fully-formed `vector<Track>`
41
- * may assemble and claim a release through this registry. That is not a gap —
42
- * consent already lives in the `Track`s themselves, each one minted by its
43
- * recording's admin via cap-gated `miso::track::new` against this exact digest.
44
- * Assembly is bookkeeping over consent already given, not a second authorization
45
- * step.
46
- */
47
- import { MoveStruct, normalizeMoveArguments } from '../utils/index.js';
48
- import { bcs } from '@mysten/sui/bcs';
49
- import {} from '@mysten/sui/transactions';
50
- const $moduleName = '@local-pkg/release_registry::release_registry';
51
- export const ReleaseRegistry = new MoveStruct({ name: `${$moduleName}::ReleaseRegistry`, fields: {
52
- id: bcs.Address
53
- } });
54
- export const ReleaseRegistryCreatedEvent = new MoveStruct({ name: `${$moduleName}::ReleaseRegistryCreatedEvent`, fields: {
55
- registry_id: bcs.Address,
56
- created_by: bcs.Address
57
- } });
58
- /**
59
- * Assembles a release by delegating to `miso::release::new` with this registry as
60
- * parent. Returns the `(Release, ReleaseAdminCap)` pair rather than transferring
61
- * or sharing either: the release is not on-chain-final until `release::publish`
62
- * consumes it by value — typically later in the same PTB — and where the cap ends
63
- * up is the caller's decision, not this function's.
64
- */
65
- export function newRelease(options) {
66
- const packageAddress = options.package ?? '@local-pkg/release_registry';
67
- const argumentsTypes = [
68
- null,
69
- '0x1::string::String',
70
- 'vector<null>',
71
- 'u256'
72
- ];
73
- const parameterNames = ["self", "title", "tracks", "nonce"];
74
- return (tx) => tx.moveCall({
75
- package: packageAddress,
76
- module: 'release_registry',
77
- function: 'new_release',
78
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
79
- });
80
- }
81
- /**
82
- * Derives the release id `new_release` would produce for the given inputs under
83
- * this registry, without creating anything. Delegates to
84
- * `miso::release::derive_target_release_id` with this registry's own id as parent.
85
- */
86
- export function deriveTargetReleaseId(options) {
87
- const packageAddress = options.package ?? '@local-pkg/release_registry';
88
- const argumentsTypes = [
89
- null,
90
- 'vector<0x2::object::ID>',
91
- 'vector<u64>',
92
- 'u256'
93
- ];
94
- const parameterNames = ["self", "recordingIds", "trackSplitValues", "nonce"];
95
- return (tx) => tx.moveCall({
96
- package: packageAddress,
97
- module: 'release_registry',
98
- function: 'derive_target_release_id',
99
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
100
- });
101
- }
102
- /**
103
- * Returns the registry's object id — the derivation parent that
104
- * `derive_target_release_id` and `new_release` both commit to.
105
- */
106
- export function id(options) {
107
- const packageAddress = options.package ?? '@local-pkg/release_registry';
108
- const argumentsTypes = [
109
- null
110
- ];
111
- const parameterNames = ["self"];
112
- return (tx) => tx.moveCall({
113
- package: packageAddress,
114
- module: 'release_registry',
115
- function: 'id',
116
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
117
- });
118
- }
119
- //# sourceMappingURL=release_registry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"release_registry.js","sourceRoot":"","sources":["../../../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AAC;AAgBD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAqC;IACvE,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,IAAI,6BAA6B,CAAC;IACxE,MAAM,cAAc,GAAG;QACnB,IAAI;QACJ,yBAAyB;QACzB,aAAa;QACb,MAAM;KACmB,CAAC;IAC9B,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC;IAC7E,OAAO,CAAC,EAAe,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,kBAAkB;QAC1B,QAAQ,EAAE,0BAA0B;QACpC,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC;AAUD;;;GAGG;AACH,MAAM,UAAU,EAAE,CAAC,OAAkB;IACjC,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,IAAI,6BAA6B,CAAC;IACxE,MAAM,cAAc,GAAG;QACnB,IAAI;KACqB,CAAC;IAC9B,MAAM,cAAc,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,OAAO,CAAC,EAAe,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,kBAAkB;QAC1B,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC"}
package/dist/drop.d.ts DELETED
@@ -1,127 +0,0 @@
1
- import type { ClientWithCoreApi } from "@mysten/sui/client";
2
- import type { TxThunk } from "./transactions.ts";
3
- /** Pricing policy: pay exactly `amount` (fixed) or at least `amount` (floor). */
4
- export type DropPrice = {
5
- kind: "fixed" | "floor";
6
- amount: bigint | number | string;
7
- };
8
- export interface CreateDropParams {
9
- /** The `Release` object the drop sells copies of — also the drop's derivation
10
- * parent and the home of the live-drop pointer. */
11
- releaseId: string;
12
- /** The release's `ReleaseAdminCap` — authorizes the drop. */
13
- releaseAdminCapId: string;
14
- /** Fixed or floor price, in the currency's smallest unit. */
15
- price: DropPrice;
16
- /** The `Currency` type argument, e.g. `0x2::sui::SUI`. */
17
- currencyType: string;
18
- /** Copies this edition may ever sell; `null`/omitted = uncapped (an open edition). */
19
- maxSupply?: bigint | number | null;
20
- /** Unix ms the sale opens. Default 0 (open immediately). */
21
- startTimestampMs?: bigint | number;
22
- /** Unix ms the sale closes; `null`/omitted = evergreen. */
23
- endTimestampMs?: bigint | number | null;
24
- misoDropPackageId: string;
25
- }
26
- /**
27
- * Creates and shares a release's FIRST drop — edition 0. A release's edition
28
- * sequence can only ever start once; later terms changes go through `newEdition`.
29
- * The `Clock` is auto-supplied by the generated binding.
30
- */
31
- export declare function createDrop(p: CreateDropParams): TxThunk;
32
- export interface NewEditionParams {
33
- /** The `Release` whose drop is being superseded. */
34
- releaseId: string;
35
- /** The release's CURRENT drop — consumed (destroyed) by this call. */
36
- oldDropId: string;
37
- /** The current drop's `Currency` type. */
38
- oldCurrencyType: string;
39
- /** The release's `ReleaseAdminCap`. */
40
- releaseAdminCapId: string;
41
- /** The successor's price. */
42
- price: DropPrice;
43
- /** The successor's `Currency` type (may differ from the old one). */
44
- currencyType: string;
45
- /** Successor's supply cap; `null`/omitted = uncapped. */
46
- maxSupply?: bigint | number | null;
47
- /** Unix ms the successor opens. Default 0 (open immediately). */
48
- startTimestampMs?: bigint | number;
49
- /** Unix ms the successor closes; `null`/omitted = evergreen. */
50
- endTimestampMs?: bigint | number | null;
51
- misoDropPackageId: string;
52
- }
53
- /**
54
- * Opens edition n+1 of a release's drop, CONSUMING the current one — the one way to
55
- * change price, currency, cap, or window (or start a fresh run after a sell-out).
56
- * Serial numbers restart at 1 for the new edition. The `Clock` is auto-supplied.
57
- */
58
- export declare function newEdition(p: NewEditionParams): TxThunk;
59
- export interface BuyRecordParams {
60
- /** The shared `Drop<Currency>` to buy from. */
61
- dropId: string;
62
- /** Buyer's `Coin<Currency>` object ids to pay from — merged, then split to `amount`. */
63
- paymentCoinIds: string[];
64
- /** Amount to pay in the currency's smallest unit (exact for `fixed`, ≥ for `floor`). */
65
- amount: bigint | number | string;
66
- /** The drop's `Currency` type, e.g. `0x2::sui::SUI`. */
67
- currencyType: string;
68
- /** The `miso_record` `Settings` shared object (authorizes the mint). */
69
- settingsId: string;
70
- /** Where to send the bought `Record` (usually the buyer). */
71
- recipient: string;
72
- misoDropPackageId: string;
73
- }
74
- /**
75
- * Buys one record from a drop: merges the buyer's payment coins, splits the exact
76
- * price, calls `buy`, and sends the minted `Record` to `recipient`. The buyer selects
77
- * which of their coins to spend (see the app's coin selection); this builder only
78
- * assembles the PTB. The `Clock` is auto-supplied.
79
- */
80
- export declare function buyRecord(p: BuyRecordParams): TxThunk;
81
- /** A parsed drop, in the shape the featured-drop card renders. */
82
- export interface DropView {
83
- id: string;
84
- releaseId: string;
85
- edition: number;
86
- price: {
87
- kind: "fixed" | "floor";
88
- amount: bigint;
89
- };
90
- /** `null` = uncapped (an open edition). */
91
- maxSupply: bigint | null;
92
- quantitySold: bigint;
93
- startTimestampMs: bigint;
94
- /** `null` = evergreen. */
95
- endTimestampMs: bigint | null;
96
- /** The drop's `Currency` type, parsed from its object type tag (`null` if unavailable). */
97
- currencyType: string | null;
98
- }
99
- /**
100
- * Fetches and parses a shared `Drop` object, or `null` if it doesn't exist.
101
- *
102
- * NOTE: this deliberately deviates from the core-getter convention in
103
- * `./queries.ts` (throw on missing object). Consumers probe pasted or stored
104
- * drop ids — a party's featured drop, a superseded edition — where "no such
105
- * drop" is a normal state, so absence is `null` and only transport failures throw.
106
- */
107
- export declare function getDrop(client: ClientWithCoreApi, dropId: string): Promise<DropView | null>;
108
- /** Fetch and parse many Drop objects through one Core bulk request. */
109
- export declare function getDropsByIds(client: ClientWithCoreApi, dropIdsInput: readonly string[]): Promise<Partial<Record<string, DropView>>>;
110
- export interface GetCurrentDropParams {
111
- /** The release whose live drop to resolve. */
112
- releaseId: string;
113
- misoDropPackageId: string;
114
- }
115
- /**
116
- * Resolves a release's LIVE drop through the `CurrentDropKey` pointer on the
117
- * release's UID, or `null` if the release has never dropped. Superseded drops are
118
- * destroyed, so this — not derived-address probing — is how the current edition is
119
- * found.
120
- */
121
- export declare function getCurrentDrop(client: ClientWithCoreApi, p: GetCurrentDropParams): Promise<DropView | null>;
122
- /**
123
- * Resolve the live drops for many releases in two Core bulk requests: all
124
- * CurrentDrop pointer fields, then all pointed-to Drop objects.
125
- */
126
- export declare function getCurrentDrops(client: ClientWithCoreApi, releaseIdsInput: readonly string[], misoDropPackageId: string): Promise<Partial<Record<string, DropView>>>;
127
- //# sourceMappingURL=drop.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"drop.d.ts","sourceRoot":"","sources":["../src/drop.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAGjD,iFAAiF;AACjF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CAClC,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B;wDACoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,6DAA6D;IAC7D,KAAK,EAAE,SAAS,CAAC;IACjB,0DAA0D;IAC1D,YAAY,EAAE,MAAM,CAAC;IACrB,sFAAsF;IACtF,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACnC,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,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CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAiC5C"}
package/dist/drop.js DELETED
@@ -1,202 +0,0 @@
1
- // Copyright (c) Miso Labs, Inc.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { deriveDynamicFieldID } from "@mysten/sui/utils";
4
- import { bcs } from "@mysten/sui/bcs";
5
- import * as drop from "./contracts/miso_drop/drop.js";
6
- /**
7
- * Creates and shares a release's FIRST drop — edition 0. A release's edition
8
- * sequence can only ever start once; later terms changes go through `newEdition`.
9
- * The `Clock` is auto-supplied by the generated binding.
10
- */
11
- export function createDrop(p) {
12
- return (tx) => {
13
- const terms = buildTerms(tx, p);
14
- tx.add(drop._new({
15
- package: p.misoDropPackageId,
16
- arguments: [
17
- p.releaseId,
18
- p.releaseAdminCapId,
19
- terms.price,
20
- terms.supply,
21
- terms.window,
22
- ],
23
- typeArguments: [p.currencyType],
24
- }));
25
- };
26
- }
27
- /**
28
- * Opens edition n+1 of a release's drop, CONSUMING the current one — the one way to
29
- * change price, currency, cap, or window (or start a fresh run after a sell-out).
30
- * Serial numbers restart at 1 for the new edition. The `Clock` is auto-supplied.
31
- */
32
- export function newEdition(p) {
33
- return (tx) => {
34
- const terms = buildTerms(tx, p);
35
- tx.add(drop.newEdition({
36
- package: p.misoDropPackageId,
37
- arguments: [
38
- p.releaseId,
39
- p.oldDropId,
40
- p.releaseAdminCapId,
41
- terms.price,
42
- terms.supply,
43
- terms.window,
44
- ],
45
- typeArguments: [p.oldCurrencyType, p.currencyType],
46
- }));
47
- };
48
- }
49
- /** Builds the three on-chain term values (`Price`, `Supply`, `Window`) from the flat
50
- * facade params — the flat shape stays the public API; the enums are a wire detail. */
51
- function buildTerms(tx, p) {
52
- const pkg = { package: p.misoDropPackageId };
53
- const makePrice = p.price.kind === "fixed" ? drop.newFixedPrice : drop.newFloorPrice;
54
- const price = tx.add(makePrice({ ...pkg, arguments: [BigInt(p.price.amount)] }));
55
- const supply = p.maxSupply == null
56
- ? tx.add(drop.newUncappedSupply({ ...pkg, arguments: [] }))
57
- : tx.add(drop.newCappedSupply({ ...pkg, arguments: [BigInt(p.maxSupply)] }));
58
- const start = BigInt(p.startTimestampMs ?? 0);
59
- const window = p.endTimestampMs == null
60
- ? tx.add(drop.newUnboundedWindow({ ...pkg, arguments: [start] }))
61
- : tx.add(drop.newBoundedWindow({
62
- ...pkg,
63
- arguments: [start, BigInt(p.endTimestampMs)],
64
- }));
65
- return { price, supply, window };
66
- }
67
- /**
68
- * Buys one record from a drop: merges the buyer's payment coins, splits the exact
69
- * price, calls `buy`, and sends the minted `Record` to `recipient`. The buyer selects
70
- * which of their coins to spend (see the app's coin selection); this builder only
71
- * assembles the PTB. The `Clock` is auto-supplied.
72
- */
73
- export function buyRecord(p) {
74
- return (tx) => {
75
- const [first, ...rest] = p.paymentCoinIds;
76
- if (!first)
77
- throw new Error("buyRecord: no payment coins provided");
78
- const primary = tx.object(first);
79
- if (rest.length > 0)
80
- tx.mergeCoins(primary, rest.map((id) => tx.object(id)));
81
- const [payment] = tx.splitCoins(primary, [tx.pure.u64(BigInt(p.amount))]);
82
- const record = tx.add(drop.buy({
83
- package: p.misoDropPackageId,
84
- arguments: [p.dropId, payment, p.settingsId],
85
- typeArguments: [p.currencyType],
86
- }));
87
- tx.transferObjects([record], p.recipient);
88
- };
89
- }
90
- /** Extracts `CURRENCY` from a `…::drop::Drop<CURRENCY>` type tag. */
91
- function currencyFromType(type) {
92
- if (!type)
93
- return null;
94
- const lt = type.indexOf("<");
95
- return lt >= 0 && type.endsWith(">") ? type.slice(lt + 1, -1) : null;
96
- }
97
- /**
98
- * Fetches and parses a shared `Drop` object, or `null` if it doesn't exist.
99
- *
100
- * NOTE: this deliberately deviates from the core-getter convention in
101
- * `./queries.ts` (throw on missing object). Consumers probe pasted or stored
102
- * drop ids — a party's featured drop, a superseded edition — where "no such
103
- * drop" is a normal state, so absence is `null` and only transport failures throw.
104
- */
105
- export async function getDrop(client, dropId) {
106
- return (await getDropsByIds(client, [dropId]))[dropId] ?? null;
107
- }
108
- function parseDrop(dropId, content, type) {
109
- const d = drop.Drop.parse(content);
110
- const price = d.price;
111
- const isFixed = price.$kind === "Fixed" || price.Fixed != null;
112
- const amount = (isFixed ? price.Fixed?.amount : price.Floor?.amount) ?? "0";
113
- const supply = d.supply;
114
- const capped = supply.$kind === "Capped" || supply.Capped != null;
115
- const window = d.window;
116
- const bounded = window.$kind === "Bounded" || window.Bounded != null;
117
- return {
118
- id: dropId,
119
- releaseId: d.release_id,
120
- edition: d.edition,
121
- price: { kind: isFixed ? "fixed" : "floor", amount: BigInt(amount) },
122
- maxSupply: capped ? BigInt(supply.Capped?.max ?? "0") : null,
123
- quantitySold: BigInt(d.quantity_sold),
124
- startTimestampMs: BigInt((bounded
125
- ? window.Bounded?.start_timestamp_ms
126
- : window.Unbounded?.start_timestamp_ms) ?? "0"),
127
- endTimestampMs: bounded
128
- ? BigInt(window.Bounded?.end_timestamp_ms ?? "0")
129
- : null,
130
- currencyType: currencyFromType(type),
131
- };
132
- }
133
- /** Fetch and parse many Drop objects through one Core bulk request. */
134
- export async function getDropsByIds(client, dropIdsInput) {
135
- const dropIds = [...new Set(dropIdsInput)];
136
- if (dropIds.length === 0)
137
- return {};
138
- const { objects } = await client.core.getObjects({
139
- objectIds: dropIds,
140
- include: { content: true },
141
- });
142
- const out = {};
143
- objects.forEach((object, index) => {
144
- const dropId = dropIds[index];
145
- if (!dropId ||
146
- object instanceof Error ||
147
- !object.content ||
148
- !/::drop::Drop</.test(object.type ?? "")) {
149
- return;
150
- }
151
- out[dropId] = parseDrop(dropId, object.content, object.type);
152
- });
153
- return out;
154
- }
155
- // The release's `CurrentDropKey` dynamic field holds a bare `ID`; the field object
156
- // serializes as `Field { id, name: CurrentDropKey (unit), value: ID }`.
157
- const CurrentDropField = bcs.struct("Field", {
158
- id: bcs.Address,
159
- name: bcs.bool(),
160
- value: bcs.Address,
161
- });
162
- // Unit-struct key bytes (single `0x00` for the dummy bool field).
163
- const CURRENT_DROP_KEY_BYTES = drop.CurrentDropKey.serialize([false]).toBytes();
164
- /**
165
- * Resolves a release's LIVE drop through the `CurrentDropKey` pointer on the
166
- * release's UID, or `null` if the release has never dropped. Superseded drops are
167
- * destroyed, so this — not derived-address probing — is how the current edition is
168
- * found.
169
- */
170
- export async function getCurrentDrop(client, p) {
171
- return ((await getCurrentDrops(client, [p.releaseId], p.misoDropPackageId))[p.releaseId] ?? null);
172
- }
173
- /**
174
- * Resolve the live drops for many releases in two Core bulk requests: all
175
- * CurrentDrop pointer fields, then all pointed-to Drop objects.
176
- */
177
- export async function getCurrentDrops(client, releaseIdsInput, misoDropPackageId) {
178
- const releaseIds = [...new Set(releaseIdsInput)];
179
- if (releaseIds.length === 0)
180
- return {};
181
- const fieldIds = releaseIds.map((releaseId) => deriveDynamicFieldID(releaseId, `${misoDropPackageId}::drop::CurrentDropKey`, CURRENT_DROP_KEY_BYTES));
182
- const { objects } = await client.core.getObjects({
183
- objectIds: fieldIds,
184
- include: { content: true },
185
- });
186
- const dropIdByRelease = {};
187
- objects.forEach((object, index) => {
188
- const releaseId = releaseIds[index];
189
- if (!releaseId || object instanceof Error || !object.content)
190
- return;
191
- dropIdByRelease[releaseId] = CurrentDropField.parse(object.content).value;
192
- });
193
- const drops = await getDropsByIds(client, Object.values(dropIdByRelease).filter((id) => id !== undefined));
194
- const out = {};
195
- for (const [releaseId, dropId] of Object.entries(dropIdByRelease)) {
196
- const dropView = dropId ? drops[dropId] : undefined;
197
- if (dropView)
198
- out[releaseId] = dropView;
199
- }
200
- return out;
201
- }
202
- //# sourceMappingURL=drop.js.map
package/dist/drop.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"drop.js","sourceRoot":"","sources":["../src/drop.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAUtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE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action, TransactionObjectArgument } from "@mysten/sui/transactions";
2
- export interface AttachCompositionRoyaltyPoolParams {
3
- /** The Composition — an in-PTB `createComposition` result, borrowed `&mut`. */
4
- composition: TransactionObjectArgument;
5
- /** The CompositionAdminCap, borrowed `&`. */
6
- adminCap: TransactionObjectArgument;
7
- /** The composition's share type (the pool's `Share` phantom = CompositionShare). */
8
- compositionShareType: string;
9
- /** Fully-qualified coin type the pool accumulates (the `Currency` phantom). */
10
- currency: string;
11
- compositionRoyaltyPoolPackageId: string;
12
- royaltyPoolPackageId: string;
13
- }
14
- /** Creates a royalty pool for a composition and shares it, appending to `tx`. */
15
- export declare function attachCompositionRoyaltyPool(tx: Transaction, params: AttachCompositionRoyaltyPoolParams): void;
16
- export interface AttachRecordingRoyaltyPoolParams {
17
- /** The Recording — an in-PTB `createRecording` result, borrowed `&mut`. */
18
- recording: TransactionObjectArgument;
19
- /** The RecordingAdminCap, borrowed `&`. */
20
- adminCap: TransactionObjectArgument;
21
- /** The recording's own share type (the pool's `Share` phantom = RecordingShare). */
22
- recordingShareType: string;
23
- /** The parent composition's share type (the recording's `CompositionShare` phantom). */
24
- compositionShareType: string;
25
- /** Fully-qualified coin type the pool accumulates (the `Currency` phantom). */
26
- currency: string;
27
- recordingRoyaltyPoolPackageId: string;
28
- royaltyPoolPackageId: string;
29
- }
30
- /** Creates a royalty pool for a recording and shares it, appending to `tx`. */
31
- export declare function attachRecordingRoyaltyPool(tx: Transaction, params: AttachRecordingRoyaltyPoolParams): void;
32
- //# sourceMappingURL=royalty-pool.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"royalty-pool.d.ts","sourceRoot":"","sources":["../../src/extensions/royalty-pool.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAKvF,MAAM,WAAW,kCAAkC;IACjD,+EAA+E;IAC/E,WAAW,EAAE,yBAAyB,CAAC;IACvC,6CAA6C;IAC7C,QAAQ,EAAE,yBAAyB,CAAC;IACpC,oFAAoF;IACpF,oBAAoB,EAAE,MAAM,CAAC;IAC7B,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;IACjB,+BAA+B,EAAE,MAAM,CAAC;IACxC,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,iFAAiF;AACjF,wBAAgB,4BAA4B,CAAC,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,kCAAkC,GAAG,IAAI,CAe9G;AAED,MAAM,WAAW,gCAAgC;IAC/C,2EAA2E;IAC3E,SAAS,EAAE,yBAAyB,CAAC;IACrC,2CAA2C;IAC3C,QAAQ,EAAE,yBAAyB,CAAC;IACpC,oFAAoF;IACpF,kBAAkB,EAAE,MAAM,CAAC;IAC3B,wFAAwF;IACxF,oBAAoB,EAAE,MAAM,CAAC;IAC7B,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;IACjB,6BAA6B,EAAE,MAAM,CAAC;IACtC,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,+EAA+E;AAC/E,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,gCAAgC,GAAG,IAAI,CAgB1G"}
@@ -1,33 +0,0 @@
1
- // Copyright (c) Miso Labs, Inc.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import * as compositionRoyaltyPool from "../contracts/composition_royalty_pool/composition_royalty_pool.js";
4
- import * as recordingRoyaltyPool from "../contracts/recording_royalty_pool/recording_royalty_pool.js";
5
- import * as pool from "../contracts/royalty_pool/pool.js";
6
- /** Creates a royalty pool for a composition and shares it, appending to `tx`. */
7
- export function attachCompositionRoyaltyPool(tx, params) {
8
- const created = tx.add(compositionRoyaltyPool.initializePool({
9
- package: params.compositionRoyaltyPoolPackageId,
10
- typeArguments: [params.compositionShareType, params.currency],
11
- arguments: [params.composition, params.adminCap],
12
- }));
13
- tx.add(pool.share({
14
- package: params.royaltyPoolPackageId,
15
- typeArguments: [params.compositionShareType, params.currency],
16
- arguments: [created],
17
- }));
18
- }
19
- /** Creates a royalty pool for a recording and shares it, appending to `tx`. */
20
- export function attachRecordingRoyaltyPool(tx, params) {
21
- const created = tx.add(recordingRoyaltyPool.initializePool({
22
- package: params.recordingRoyaltyPoolPackageId,
23
- typeArguments: [params.recordingShareType, params.compositionShareType, params.currency],
24
- arguments: [params.recording, params.adminCap],
25
- }));
26
- // The pool is RoyaltyPool<RecordingShare, Currency> — Share is the recording's own share type.
27
- tx.add(pool.share({
28
- package: params.royaltyPoolPackageId,
29
- typeArguments: [params.recordingShareType, params.currency],
30
- arguments: [created],
31
- }));
32
- }
33
- //# sourceMappingURL=royalty-pool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"royalty-pool.js","sourceRoot":"","sources":["../../src/extensions/royalty-pool.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAqBtC,OAAO,KAAK,sBAAsB,MAAM,mEAAmE,CAAC;AAC5G,OAAO,KAAK,oBAAoB,MAAM,+DAA+D,CAAC;AACtG,OAAO,KAAK,IAAI,MAAM,mCAAmC,CAAC;AAe1D,iFAAiF;AACjF,MAAM,UAAU,4BAA4B,CAAC,EAAe,EAAE,MAA0C;IACtG,MAAM,OAAO,GAAG,EAAE,CAAC,GAAG,CACpB,sBAAsB,CAAC,cAAc,CAAC;QACpC,OAAO,EAAE,MAAM,CAAC,+BAA+B;QAC/C,aAAa,EAAE,CAAC,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC;QAC7D,SAAS,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC;KACjD,CAAC,CACH,CAAC;IACF,EAAE,CAAC,GAAG,CACJ,IAAI,CAAC,KAAK,CAAC;QACT,OAAO,EAAE,MAAM,CAAC,oBAAoB;QACpC,aAAa,EAAE,CAAC,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC;QAC7D,SAAS,EAAE,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