@misofm/platform 0.27.0 → 0.28.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 (425) hide show
  1. package/README.md +309 -204
  2. package/dist/Miso.d.ts +403 -0
  3. package/dist/Miso.d.ts.map +1 -0
  4. package/dist/Miso.js +455 -0
  5. package/dist/Miso.js.map +1 -0
  6. package/dist/auth.d.ts +11 -1
  7. package/dist/auth.d.ts.map +1 -1
  8. package/dist/auth.js +16 -3
  9. package/dist/auth.js.map +1 -1
  10. package/dist/catalog.d.ts +8 -5
  11. package/dist/catalog.d.ts.map +1 -1
  12. package/dist/catalog.js +36 -19
  13. package/dist/catalog.js.map +1 -1
  14. package/dist/client.d.ts +52 -443
  15. package/dist/client.d.ts.map +1 -1
  16. package/dist/client.js +58 -775
  17. package/dist/client.js.map +1 -1
  18. package/dist/contracts/composition_credits/composition_credits.d.ts +38 -48
  19. package/dist/contracts/composition_credits/composition_credits.d.ts.map +1 -1
  20. package/dist/contracts/composition_credits/composition_credits.js +20 -4
  21. package/dist/contracts/composition_credits/composition_credits.js.map +1 -1
  22. package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts +64 -1
  23. package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts.map +1 -1
  24. package/dist/contracts/composition_routed_stake/composition_routed_stake.js +66 -1
  25. package/dist/contracts/composition_routed_stake/composition_routed_stake.js.map +1 -1
  26. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +52 -4
  27. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +1 -1
  28. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +52 -4
  29. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +1 -1
  30. package/dist/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.d.ts +63 -1
  31. package/dist/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.d.ts.map +1 -1
  32. package/dist/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.js +63 -1
  33. package/dist/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.js.map +1 -1
  34. package/dist/contracts/genre/genre.d.ts +10 -1
  35. package/dist/contracts/genre/genre.d.ts.map +1 -1
  36. package/dist/contracts/genre/genre.js +8 -1
  37. package/dist/contracts/genre/genre.js.map +1 -1
  38. package/dist/contracts/miso_pay/deps/std/type_name.d.ts.map +1 -0
  39. package/dist/contracts/miso_pay/deps/std/type_name.js.map +1 -0
  40. package/dist/contracts/miso_pay/pay.d.ts +209 -0
  41. package/dist/contracts/miso_pay/pay.d.ts.map +1 -0
  42. package/dist/contracts/miso_pay/pay.js +195 -0
  43. package/dist/contracts/miso_pay/pay.js.map +1 -0
  44. package/dist/contracts/party_cta/party_cta.d.ts +49 -3
  45. package/dist/contracts/party_cta/party_cta.d.ts.map +1 -1
  46. package/dist/contracts/party_cta/party_cta.js +27 -5
  47. package/dist/contracts/party_cta/party_cta.js.map +1 -1
  48. package/dist/contracts/party_genre/party_genre.d.ts +25 -0
  49. package/dist/contracts/party_genre/party_genre.d.ts.map +1 -1
  50. package/dist/contracts/party_genre/party_genre.js +14 -3
  51. package/dist/contracts/party_genre/party_genre.js.map +1 -1
  52. package/dist/contracts/party_media/party_media.d.ts +19 -3
  53. package/dist/contracts/party_media/party_media.d.ts.map +1 -1
  54. package/dist/contracts/party_media/party_media.js +20 -4
  55. package/dist/contracts/party_media/party_media.js.map +1 -1
  56. package/dist/contracts/party_platform_link/party_platform_link.d.ts +15 -7
  57. package/dist/contracts/party_platform_link/party_platform_link.d.ts.map +1 -1
  58. package/dist/contracts/party_platform_link/party_platform_link.js +15 -7
  59. package/dist/contracts/party_platform_link/party_platform_link.js.map +1 -1
  60. package/dist/contracts/party_profile/party_profile.d.ts +63 -8
  61. package/dist/contracts/party_profile/party_profile.d.ts.map +1 -1
  62. package/dist/contracts/party_profile/party_profile.js +33 -8
  63. package/dist/contracts/party_profile/party_profile.js.map +1 -1
  64. package/dist/contracts/party_roles/party_roles.d.ts +28 -3
  65. package/dist/contracts/party_roles/party_roles.d.ts.map +1 -1
  66. package/dist/contracts/party_roles/party_roles.js +19 -4
  67. package/dist/contracts/party_roles/party_roles.js.map +1 -1
  68. package/dist/contracts/party_tags/party_tags.d.ts +23 -3
  69. package/dist/contracts/party_tags/party_tags.d.ts.map +1 -1
  70. package/dist/contracts/party_tags/party_tags.js +16 -4
  71. package/dist/contracts/party_tags/party_tags.js.map +1 -1
  72. package/dist/contracts/party_wallet/party_wallet.d.ts +4 -1
  73. package/dist/contracts/party_wallet/party_wallet.d.ts.map +1 -1
  74. package/dist/contracts/party_wallet/party_wallet.js +2 -1
  75. package/dist/contracts/party_wallet/party_wallet.js.map +1 -1
  76. package/dist/contracts/platform_link/platform_link.d.ts +207 -0
  77. package/dist/contracts/platform_link/platform_link.d.ts.map +1 -0
  78. package/dist/contracts/platform_link/platform_link.js +209 -0
  79. package/dist/contracts/platform_link/platform_link.js.map +1 -0
  80. package/dist/contracts/record/pressing.d.ts +53 -7
  81. package/dist/contracts/record/pressing.d.ts.map +1 -1
  82. package/dist/contracts/record/pressing.js +50 -4
  83. package/dist/contracts/record/pressing.js.map +1 -1
  84. package/dist/contracts/record/record.d.ts +14 -0
  85. package/dist/contracts/record/record.d.ts.map +1 -1
  86. package/dist/contracts/record/record.js +15 -1
  87. package/dist/contracts/record/record.js.map +1 -1
  88. package/dist/contracts/record_shop/listing.d.ts +80 -35
  89. package/dist/contracts/record_shop/listing.d.ts.map +1 -1
  90. package/dist/contracts/record_shop/listing.js +76 -13
  91. package/dist/contracts/record_shop/listing.js.map +1 -1
  92. package/dist/contracts/recording_advisory/recording_advisory.d.ts +15 -15
  93. package/dist/contracts/recording_advisory/recording_advisory.d.ts.map +1 -1
  94. package/dist/contracts/recording_advisory/recording_advisory.js +15 -8
  95. package/dist/contracts/recording_advisory/recording_advisory.js.map +1 -1
  96. package/dist/contracts/recording_credits/recording_credits.d.ts +95 -1350
  97. package/dist/contracts/recording_credits/recording_credits.d.ts.map +1 -1
  98. package/dist/contracts/recording_credits/recording_credits.js +63 -12
  99. package/dist/contracts/recording_credits/recording_credits.js.map +1 -1
  100. package/dist/contracts/recording_engine_session/recording_engine_session.d.ts +30 -49
  101. package/dist/contracts/recording_engine_session/recording_engine_session.d.ts.map +1 -1
  102. package/dist/contracts/recording_engine_session/recording_engine_session.js +19 -4
  103. package/dist/contracts/recording_engine_session/recording_engine_session.js.map +1 -1
  104. package/dist/contracts/recording_genre/recording_genre.d.ts +67 -9
  105. package/dist/contracts/recording_genre/recording_genre.d.ts.map +1 -1
  106. package/dist/contracts/recording_genre/recording_genre.js +53 -9
  107. package/dist/contracts/recording_genre/recording_genre.js.map +1 -1
  108. package/dist/contracts/recording_language/recording_language.d.ts +29 -5
  109. package/dist/contracts/recording_language/recording_language.d.ts.map +1 -1
  110. package/dist/contracts/recording_language/recording_language.js +18 -5
  111. package/dist/contracts/recording_language/recording_language.js.map +1 -1
  112. package/dist/contracts/recording_master_reference/recording_master_reference.d.ts +25 -15
  113. package/dist/contracts/recording_master_reference/recording_master_reference.d.ts.map +1 -1
  114. package/dist/contracts/recording_master_reference/recording_master_reference.js +18 -5
  115. package/dist/contracts/recording_master_reference/recording_master_reference.js.map +1 -1
  116. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +55 -4
  117. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +1 -1
  118. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +55 -4
  119. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +1 -1
  120. package/dist/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.d.ts +66 -1
  121. package/dist/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.d.ts.map +1 -1
  122. package/dist/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.js +66 -1
  123. package/dist/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.js.map +1 -1
  124. package/dist/contracts/recording_streaming_transcode/recording_streaming_transcode.d.ts +12 -9
  125. package/dist/contracts/recording_streaming_transcode/recording_streaming_transcode.d.ts.map +1 -1
  126. package/dist/contracts/recording_streaming_transcode/recording_streaming_transcode.js +11 -4
  127. package/dist/contracts/recording_streaming_transcode/recording_streaming_transcode.js.map +1 -1
  128. package/dist/contracts/release_cover_art/release_cover_art.d.ts +168 -74
  129. package/dist/contracts/release_cover_art/release_cover_art.d.ts.map +1 -1
  130. package/dist/contracts/release_cover_art/release_cover_art.js +126 -10
  131. package/dist/contracts/release_cover_art/release_cover_art.js.map +1 -1
  132. package/dist/contracts/release_credits/release_credits.d.ts +24 -28
  133. package/dist/contracts/release_credits/release_credits.d.ts.map +1 -1
  134. package/dist/contracts/release_credits/release_credits.js +18 -4
  135. package/dist/contracts/release_credits/release_credits.js.map +1 -1
  136. package/dist/contracts/release_description/release_description.d.ts +16 -5
  137. package/dist/contracts/release_description/release_description.d.ts.map +1 -1
  138. package/dist/contracts/release_description/release_description.js +9 -4
  139. package/dist/contracts/release_description/release_description.js.map +1 -1
  140. package/dist/contracts/release_dsp_link/release_dsp_link.d.ts +130 -160
  141. package/dist/contracts/release_dsp_link/release_dsp_link.d.ts.map +1 -1
  142. package/dist/contracts/release_dsp_link/release_dsp_link.js +74 -19
  143. package/dist/contracts/release_dsp_link/release_dsp_link.js.map +1 -1
  144. package/dist/contracts/release_genre/release_genre.d.ts +66 -11
  145. package/dist/contracts/release_genre/release_genre.d.ts.map +1 -1
  146. package/dist/contracts/release_genre/release_genre.js +52 -11
  147. package/dist/contracts/release_genre/release_genre.js.map +1 -1
  148. package/dist/contracts/release_kind/release_kind.d.ts +28 -5
  149. package/dist/contracts/release_kind/release_kind.d.ts.map +1 -1
  150. package/dist/contracts/release_kind/release_kind.js +19 -4
  151. package/dist/contracts/release_kind/release_kind.js.map +1 -1
  152. package/dist/contracts/release_revenue_distributor/release_revenue_distributor.d.ts +17 -0
  153. package/dist/contracts/release_revenue_distributor/release_revenue_distributor.d.ts.map +1 -1
  154. package/dist/contracts/release_revenue_distributor/release_revenue_distributor.js +15 -0
  155. package/dist/contracts/release_revenue_distributor/release_revenue_distributor.js.map +1 -1
  156. package/dist/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.d.ts +37 -1
  157. package/dist/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.d.ts.map +1 -1
  158. package/dist/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.js +37 -1
  159. package/dist/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.js.map +1 -1
  160. package/dist/contracts/routed_stake/routed_stake.d.ts +78 -6
  161. package/dist/contracts/routed_stake/routed_stake.d.ts.map +1 -1
  162. package/dist/contracts/routed_stake/routed_stake.js +79 -7
  163. package/dist/contracts/routed_stake/routed_stake.js.map +1 -1
  164. package/dist/contracts/royalty_pool/pool.d.ts +117 -27
  165. package/dist/contracts/royalty_pool/pool.d.ts.map +1 -1
  166. package/dist/contracts/royalty_pool/pool.js +117 -28
  167. package/dist/contracts/royalty_pool/pool.js.map +1 -1
  168. package/dist/contracts/royalty_pool/stake.d.ts +3 -0
  169. package/dist/contracts/royalty_pool/stake.d.ts.map +1 -1
  170. package/dist/contracts/royalty_pool/stake.js +5 -2
  171. package/dist/contracts/royalty_pool/stake.js.map +1 -1
  172. package/dist/contracts/share/share.d.ts +80 -0
  173. package/dist/contracts/share/share.d.ts.map +1 -0
  174. package/dist/contracts/share/share.js +72 -0
  175. package/dist/contracts/share/share.js.map +1 -0
  176. package/dist/contracts/vault/vault.d.ts +51 -0
  177. package/dist/contracts/vault/vault.d.ts.map +1 -1
  178. package/dist/contracts/vault/vault.js +55 -4
  179. package/dist/contracts/vault/vault.js.map +1 -1
  180. package/dist/contracts.d.ts +60 -0
  181. package/dist/contracts.d.ts.map +1 -1
  182. package/dist/contracts.js +17 -0
  183. package/dist/contracts.js.map +1 -1
  184. package/dist/cover.d.ts +5 -6
  185. package/dist/cover.d.ts.map +1 -1
  186. package/dist/cover.js +10 -10
  187. package/dist/cover.js.map +1 -1
  188. package/dist/credits.d.ts +12 -13
  189. package/dist/credits.d.ts.map +1 -1
  190. package/dist/credits.js +16 -10
  191. package/dist/credits.js.map +1 -1
  192. package/dist/deployments.d.ts +3 -3
  193. package/dist/deployments.d.ts.map +1 -1
  194. package/dist/deployments.js +2 -3
  195. package/dist/deployments.js.map +1 -1
  196. package/dist/errors.d.ts +24 -9
  197. package/dist/errors.d.ts.map +1 -1
  198. package/dist/errors.js +43 -16
  199. package/dist/errors.js.map +1 -1
  200. package/dist/events.d.ts +1687 -835
  201. package/dist/events.d.ts.map +1 -1
  202. package/dist/events.js +258 -39
  203. package/dist/events.js.map +1 -1
  204. package/dist/genre.d.ts +11 -12
  205. package/dist/genre.d.ts.map +1 -1
  206. package/dist/genre.js +5 -3
  207. package/dist/genre.js.map +1 -1
  208. package/dist/index.d.ts +3 -3
  209. package/dist/index.d.ts.map +1 -1
  210. package/dist/index.js +7 -2
  211. package/dist/index.js.map +1 -1
  212. package/dist/packages.d.ts +1047 -1695
  213. package/dist/packages.d.ts.map +1 -1
  214. package/dist/party/client.d.ts +113 -296
  215. package/dist/party/client.d.ts.map +1 -1
  216. package/dist/party/client.js +93 -178
  217. package/dist/party/client.js.map +1 -1
  218. package/dist/party/extensions/ctas.d.ts +3 -3
  219. package/dist/party/extensions/ctas.d.ts.map +1 -1
  220. package/dist/party/extensions/genres.d.ts +4 -4
  221. package/dist/party/extensions/genres.d.ts.map +1 -1
  222. package/dist/party/extensions/links.d.ts +5 -5
  223. package/dist/party/extensions/links.d.ts.map +1 -1
  224. package/dist/party/extensions/links.js.map +1 -1
  225. package/dist/party/extensions/media.d.ts +3 -3
  226. package/dist/party/extensions/media.d.ts.map +1 -1
  227. package/dist/party/extensions/profile.d.ts +3 -3
  228. package/dist/party/extensions/profile.d.ts.map +1 -1
  229. package/dist/party/extensions/roles.d.ts +4 -4
  230. package/dist/party/extensions/roles.d.ts.map +1 -1
  231. package/dist/party/extensions/roles.js.map +1 -1
  232. package/dist/party/extensions/tags.d.ts +4 -4
  233. package/dist/party/extensions/tags.d.ts.map +1 -1
  234. package/dist/party/index.d.ts +1 -1
  235. package/dist/party/index.d.ts.map +1 -1
  236. package/dist/party/index.js.map +1 -1
  237. package/dist/party/queries.d.ts +8 -8
  238. package/dist/party/queries.d.ts.map +1 -1
  239. package/dist/party/queries.js +83 -56
  240. package/dist/party/queries.js.map +1 -1
  241. package/dist/pressing.d.ts +13 -15
  242. package/dist/pressing.d.ts.map +1 -1
  243. package/dist/pressing.js +99 -29
  244. package/dist/pressing.js.map +1 -1
  245. package/dist/publication.d.ts +13 -6
  246. package/dist/publication.d.ts.map +1 -1
  247. package/dist/publication.js +26 -21
  248. package/dist/publication.js.map +1 -1
  249. package/dist/queries.js +3 -3
  250. package/dist/queries.js.map +1 -1
  251. package/dist/read/artist.d.ts +4 -3
  252. package/dist/read/artist.d.ts.map +1 -1
  253. package/dist/read/artist.js +24 -8
  254. package/dist/read/artist.js.map +1 -1
  255. package/dist/read/catalog.d.ts +17 -16
  256. package/dist/read/catalog.d.ts.map +1 -1
  257. package/dist/read/catalog.js +25 -11
  258. package/dist/read/catalog.js.map +1 -1
  259. package/dist/read/client.d.ts +41 -20
  260. package/dist/read/client.d.ts.map +1 -1
  261. package/dist/read/client.js +20 -12
  262. package/dist/read/client.js.map +1 -1
  263. package/dist/read/config.d.ts +25 -3
  264. package/dist/read/config.d.ts.map +1 -1
  265. package/dist/read/config.js +42 -25
  266. package/dist/read/config.js.map +1 -1
  267. package/dist/read/genres.d.ts +8 -3
  268. package/dist/read/genres.d.ts.map +1 -1
  269. package/dist/read/genres.js +23 -17
  270. package/dist/read/genres.js.map +1 -1
  271. package/dist/read/index.d.ts +1 -1
  272. package/dist/read/index.d.ts.map +1 -1
  273. package/dist/read/index.js +8 -6
  274. package/dist/read/index.js.map +1 -1
  275. package/dist/read/receipts.d.ts +5 -4
  276. package/dist/read/receipts.d.ts.map +1 -1
  277. package/dist/read/receipts.js +94 -46
  278. package/dist/read/receipts.js.map +1 -1
  279. package/dist/read/royalties.d.ts +6 -5
  280. package/dist/read/royalties.d.ts.map +1 -1
  281. package/dist/read/royalties.js +16 -9
  282. package/dist/read/royalties.js.map +1 -1
  283. package/dist/read/wallet.d.ts +23 -12
  284. package/dist/read/wallet.d.ts.map +1 -1
  285. package/dist/read/wallet.js +158 -177
  286. package/dist/read/wallet.js.map +1 -1
  287. package/dist/read/works.d.ts +6 -6
  288. package/dist/read/works.d.ts.map +1 -1
  289. package/dist/read/works.js +40 -26
  290. package/dist/read/works.js.map +1 -1
  291. package/dist/recording-extensions.d.ts +15 -16
  292. package/dist/recording-extensions.d.ts.map +1 -1
  293. package/dist/recording-extensions.js +12 -8
  294. package/dist/recording-extensions.js.map +1 -1
  295. package/dist/release-extensions.d.ts +5 -6
  296. package/dist/release-extensions.d.ts.map +1 -1
  297. package/dist/release-extensions.js +3 -2
  298. package/dist/release-extensions.js.map +1 -1
  299. package/dist/release-graph.d.ts +2 -2
  300. package/dist/release-graph.d.ts.map +1 -1
  301. package/dist/release-graph.js.map +1 -1
  302. package/dist/royalty.d.ts +4 -4
  303. package/dist/royalty.d.ts.map +1 -1
  304. package/dist/royalty.js +16 -7
  305. package/dist/royalty.js.map +1 -1
  306. package/dist/share.d.ts +58 -24
  307. package/dist/share.d.ts.map +1 -1
  308. package/dist/share.js +167 -92
  309. package/dist/share.js.map +1 -1
  310. package/dist/transactions.d.ts +15 -6
  311. package/dist/transactions.d.ts.map +1 -1
  312. package/dist/transactions.js +1 -0
  313. package/dist/transactions.js.map +1 -1
  314. package/dist/vault.d.ts +13 -3
  315. package/dist/vault.d.ts.map +1 -1
  316. package/dist/vault.js +22 -16
  317. package/dist/vault.js.map +1 -1
  318. package/package.json +9 -8
  319. package/src/Miso.ts +951 -0
  320. package/src/auth.ts +16 -3
  321. package/src/catalog.ts +58 -25
  322. package/src/client.ts +98 -1359
  323. package/src/contracts/composition_credits/composition_credits.ts +20 -4
  324. package/src/contracts/composition_routed_stake/composition_routed_stake.ts +67 -1
  325. package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +53 -4
  326. package/src/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.ts +64 -1
  327. package/src/contracts/genre/genre.ts +8 -1
  328. package/src/contracts/miso_pay/pay.ts +356 -0
  329. package/src/contracts/party_cta/party_cta.ts +27 -5
  330. package/src/contracts/party_genre/party_genre.ts +14 -3
  331. package/src/contracts/party_media/party_media.ts +20 -4
  332. package/src/contracts/party_platform_link/party_platform_link.ts +15 -7
  333. package/src/contracts/party_profile/party_profile.ts +33 -8
  334. package/src/contracts/party_roles/party_roles.ts +19 -4
  335. package/src/contracts/party_tags/party_tags.ts +16 -4
  336. package/src/contracts/party_wallet/party_wallet.ts +2 -1
  337. package/src/contracts/platform_link/platform_link.ts +322 -0
  338. package/src/contracts/record/pressing.ts +50 -4
  339. package/src/contracts/record/record.ts +15 -1
  340. package/src/contracts/record_shop/listing.ts +76 -13
  341. package/src/contracts/recording_advisory/recording_advisory.ts +15 -8
  342. package/src/contracts/recording_credits/recording_credits.ts +63 -12
  343. package/src/contracts/recording_engine_session/recording_engine_session.ts +19 -4
  344. package/src/contracts/recording_genre/recording_genre.ts +53 -9
  345. package/src/contracts/recording_language/recording_language.ts +18 -5
  346. package/src/contracts/recording_master_reference/recording_master_reference.ts +18 -5
  347. package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +56 -4
  348. package/src/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.ts +67 -1
  349. package/src/contracts/recording_streaming_transcode/recording_streaming_transcode.ts +11 -4
  350. package/src/contracts/release_cover_art/release_cover_art.ts +126 -10
  351. package/src/contracts/release_credits/release_credits.ts +18 -4
  352. package/src/contracts/release_description/release_description.ts +9 -4
  353. package/src/contracts/release_dsp_link/release_dsp_link.ts +74 -19
  354. package/src/contracts/release_genre/release_genre.ts +52 -11
  355. package/src/contracts/release_kind/release_kind.ts +19 -4
  356. package/src/contracts/release_revenue_distributor/release_revenue_distributor.ts +15 -0
  357. package/src/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.ts +38 -1
  358. package/src/contracts/routed_stake/routed_stake.ts +79 -7
  359. package/src/contracts/royalty_pool/pool.ts +140 -38
  360. package/src/contracts/royalty_pool/stake.ts +5 -2
  361. package/src/contracts/share/share.ts +97 -0
  362. package/src/contracts/vault/vault.ts +55 -4
  363. package/src/contracts.ts +18 -0
  364. package/src/cover.ts +14 -15
  365. package/src/credits.ts +27 -22
  366. package/src/deployments.ts +3 -4
  367. package/src/errors.ts +64 -34
  368. package/src/events.ts +260 -39
  369. package/src/genre.ts +15 -14
  370. package/src/index.ts +19 -10
  371. package/src/party/client.ts +217 -208
  372. package/src/party/extensions/ctas.ts +3 -3
  373. package/src/party/extensions/genres.ts +4 -4
  374. package/src/party/extensions/links.ts +7 -7
  375. package/src/party/extensions/media.ts +3 -3
  376. package/src/party/extensions/profile.ts +3 -3
  377. package/src/party/extensions/roles.ts +5 -5
  378. package/src/party/extensions/tags.ts +4 -4
  379. package/src/party/index.ts +0 -1
  380. package/src/party/queries.ts +90 -87
  381. package/src/pressing.ts +132 -89
  382. package/src/publication.ts +33 -32
  383. package/src/queries.ts +3 -3
  384. package/src/read/artist.ts +36 -17
  385. package/src/read/catalog.ts +68 -36
  386. package/src/read/client.ts +55 -30
  387. package/src/read/config.ts +55 -30
  388. package/src/read/genres.ts +22 -18
  389. package/src/read/index.ts +8 -6
  390. package/src/read/receipts.ts +130 -67
  391. package/src/read/royalties.ts +22 -10
  392. package/src/read/wallet.ts +226 -216
  393. package/src/read/works.ts +51 -44
  394. package/src/recording-extensions.ts +27 -24
  395. package/src/release-extensions.ts +7 -7
  396. package/src/release-graph.ts +2 -1
  397. package/src/royalty.ts +19 -25
  398. package/src/share.ts +197 -128
  399. package/src/transactions.ts +15 -8
  400. package/src/vault.ts +24 -31
  401. package/dist/contracts/record_shop/deps/std/type_name.d.ts.map +0 -1
  402. package/dist/contracts/record_shop/deps/std/type_name.js.map +0 -1
  403. package/dist/contracts/recording_language/deps/language_code/language_code.d.ts +0 -6
  404. package/dist/contracts/recording_language/deps/language_code/language_code.d.ts.map +0 -1
  405. package/dist/contracts/recording_language/deps/language_code/language_code.js +0 -8
  406. package/dist/contracts/recording_language/deps/language_code/language_code.js.map +0 -1
  407. package/dist/contracts/recording_master_reference/deps/ori/confidentiality.d.ts +0 -24
  408. package/dist/contracts/recording_master_reference/deps/ori/confidentiality.d.ts.map +0 -1
  409. package/dist/contracts/recording_master_reference/deps/ori/confidentiality.js +0 -24
  410. package/dist/contracts/recording_master_reference/deps/ori/confidentiality.js.map +0 -1
  411. package/dist/contracts/recording_master_reference/deps/ori/data.d.ts +0 -16
  412. package/dist/contracts/recording_master_reference/deps/ori/data.d.ts.map +0 -1
  413. package/dist/contracts/recording_master_reference/deps/ori/data.js +0 -12
  414. package/dist/contracts/recording_master_reference/deps/ori/data.js.map +0 -1
  415. package/dist/execute.d.ts +0 -32
  416. package/dist/execute.d.ts.map +0 -1
  417. package/dist/execute.js +0 -36
  418. package/dist/execute.js.map +0 -1
  419. package/src/contracts/recording_language/deps/language_code/language_code.ts +0 -8
  420. package/src/contracts/recording_master_reference/deps/ori/confidentiality.ts +0 -24
  421. package/src/contracts/recording_master_reference/deps/ori/data.ts +0 -12
  422. package/src/execute.ts +0 -56
  423. /package/dist/contracts/{record_shop → miso_pay}/deps/std/type_name.d.ts +0 -0
  424. /package/dist/contracts/{record_shop → miso_pay}/deps/std/type_name.js +0 -0
  425. /package/src/contracts/{record_shop → miso_pay}/deps/std/type_name.ts +0 -0
package/src/share.ts CHANGED
@@ -13,42 +13,41 @@
13
13
  // The bytecode is identical for every currency (only the baked-in INITIALIZER
14
14
  // matters, and it is the same signer for all), so publishes are fungible: a whole
15
15
  // batch can be published — up to 5 `tx.publish` per PTB (the protocol's
16
- // `max_publish_or_upgrade_per_ptb` cap) — and run concurrently through a
17
- // `ParallelTransactionExecutor`. Every Publish result is consumed immediately by
18
- // `package::make_immutable` in that same PTB, so no share-package UpgradeCap is
19
- // ever left with the publisher. Initialization is likewise batched. The caller
20
- // assigns packages to work slots and supplies per-package metadata, so each
21
- // currency still gets a descriptive, work-specific name.
16
+ // `max_publish_or_upgrade_per_ptb` cap) — in one `Tx.run`. Every Publish result is
17
+ // consumed immediately by `package::make_immutable` in that same PTB, so no
18
+ // share-package UpgradeCap is ever left with the publisher. Initialization is
19
+ // likewise batched. The caller assigns packages to work slots and supplies
20
+ // per-package metadata, so each currency still gets a descriptive, work-specific
21
+ // name.
22
+ //
23
+ // Every write here goes through `Tx.run`: the three submit-on-behalf members
24
+ // (`createShareCurrency`, `publishShareCurrencies`, `initializeShareCurrencies`,
25
+ // misofm/sdks#35 WP4) take the signer as a parameter, plus an optional `gasOwner`
26
+ // and `sponsor` when the gas owner differs from the sender. `Tx.run` holds one
27
+ // sender lock per address, so what used to run concurrently through a
28
+ // `ParallelTransactionExecutor` now serializes per batch under that lock — an
29
+ // accepted behaviour change for 0.28 (parallel submission needs distinct gas
30
+ // owners, `docs/extensions.md` §5).
22
31
 
23
- import type { ParallelTransactionExecutor } from "@mysten/sui/transactions";
24
- import type { Signer } from "@mysten/sui/cryptography";
25
32
  import { fromBase64, fromHex, toBase64 } from "@mysten/sui/utils";
26
33
  import { update_constants } from "@mysten/move-bytecode-template";
27
34
  import { Effect } from "effect";
28
- import {
29
- execThunks,
30
- publishedPackageId,
31
- allPublishedPackageIds,
32
- createdByType,
33
- allCreatedByType,
34
- type ExecResult,
35
- } from "@misofm/musicos";
36
- import { SuiClient, SuiRpcError, type TransactionFailedError } from "@misofm/effect";
35
+ import { ObjectId, UnexpectedEffects, type Executed, type Sui, type SuiAddress } from "@unconfirmed/sui-effect";
36
+ import { Tx, type RunError, type Signer } from "@unconfirmed/sui-effect/tx";
37
37
 
38
38
  import { publishShareCurrency, initializeShareCurrency, type PackageBytecode } from "./transactions.ts";
39
39
  import { SHARE_TEMPLATE } from "./share-template.ts";
40
- import { executeViaExecutor } from "./execute.ts";
41
40
 
42
41
  /** The protocol cap on Publish/Upgrade commands per programmable transaction. */
43
42
  const PUBLISHES_PER_PTB = 5;
44
43
  /** Initializes batched per PTB (each is one moveCall + transfer; all share the 0xc registry). */
45
44
  const INITS_PER_PTB = 10;
46
45
 
47
- // Address-free type markers: gRPC object types carry fully-normalized addresses
48
- // (e.g. 0x0000…0002::coin::TreasuryCap), so we match on module::type rather than a
49
- // short "0x2" prefix that would never match.
50
- const CURRENCY_TYPE = "::coin_registry::Currency<";
51
- const TREASURY_CAP_TYPE = "::coin::TreasuryCap<";
46
+ // A bare (no type-argument) expected tag: per sui-effect's generic-Move-type
47
+ // rule, this matches every instantiation (`Currency<pkg::share::Share>` for
48
+ // any `pkg`), comparing only `address::module::name`.
49
+ const CURRENCY_TYPE = "0x2::coin_registry::Currency";
50
+ const TREASURY_CAP_TYPE = "0x2::coin::TreasuryCap";
52
51
 
53
52
  export interface ShareCurrency {
54
53
  /** The published share package id. */
@@ -59,8 +58,8 @@ export interface ShareCurrency {
59
58
  shareType: string;
60
59
  /** The `TreasuryCap<Share>` object id (held by the treasury-cap recipient). */
61
60
  treasuryCapId: string;
62
- /** Net gas (MIST) attributed to this currency, if tracked per-item (else 0). */
63
- gasUsed: number;
61
+ /** Net gas (MIST), summed over every `Tx.run` this currency's provisioning made. Can be negative. */
62
+ gasUsed: bigint;
64
63
  }
65
64
 
66
65
  export interface ShareCurrencyMeta {
@@ -69,6 +68,14 @@ export interface ShareCurrencyMeta {
69
68
  iconUrl?: string;
70
69
  }
71
70
 
71
+ /** A signer to run a submit-on-behalf member as, plus a sponsor when the gas owner differs. */
72
+ export interface RunOpts {
73
+ readonly signer: Signer;
74
+ readonly gasOwner?: SuiAddress;
75
+ /** The gas owner's signer. Required whenever `gasOwner` names an address that is not `signer`'s. */
76
+ readonly sponsor?: Signer;
77
+ }
78
+
72
79
  // ── Bytecode patching ────────────────────────────────────────────────────────
73
80
 
74
81
  /**
@@ -107,23 +114,46 @@ export interface CreateShareCurrencyParams {
107
114
  treasuryCapRecipient?: string;
108
115
  }
109
116
 
110
- /** Publishes an immutable package, then initializes a fresh share currency in a second tx. */
117
+ /**
118
+ * Publishes an immutable package, then initializes a fresh share currency in a
119
+ * second tx — two `Tx.run`s, because a `moveCall` target needs the package's
120
+ * id and a package published in the same PTB has none until it executes.
121
+ *
122
+ * Fails with: everything `Tx.run` does (`RunError`: `BuildError`,
123
+ * `SimulationFailed`, `PolicyDenied`, `SigningError`, `ExecutionFailed`,
124
+ * `NotApplied`, `SubmissionUnknown`, `JournalError`, `TransportError`), and
125
+ * `UnexpectedEffects` when a run applied but did not create the object this
126
+ * step expected (a Move-side change already on chain — not a "retry" outcome).
127
+ */
111
128
  export const createShareCurrency = Effect.fn("createShareCurrency")(function* (
112
- signer: Signer,
113
129
  params: CreateShareCurrencyParams,
114
- ): Effect.fn.Return<ShareCurrency, TransactionFailedError | SuiRpcError, SuiClient> {
115
- const signerAddress = signer.toSuiAddress();
130
+ opts: RunOpts,
131
+ ): Effect.fn.Return<ShareCurrency, RunError | UnexpectedEffects, Sui> {
132
+ const signerAddress = opts.signer.address;
116
133
  const initializer = params.initializerAddress ?? signerAddress;
117
134
  const recipient = params.treasuryCapRecipient ?? signerAddress;
118
135
 
119
136
  // Tx 1: publish the share package with the initializer baked in.
120
137
  const patched = patchInitializer(params.template ?? SHARE_TEMPLATE, initializer);
121
- const publishRes = yield* execThunks(signer, publishShareCurrency(patched));
122
- const packageId = publishedPackageId(publishRes);
138
+ const published = yield* Tx.run(publishShareCurrency(patched), opts);
139
+ const packagesPublished = published.packagesPublished();
140
+ const packageId = String(packagesPublished[0]?.id ?? "");
141
+ if (packageId === "") {
142
+ // The publish `Tx.run` already applied (gas was charged) but the effects
143
+ // carried no published package — `UnexpectedEffects` (outcome "applied"),
144
+ // not a defect, per B9 (misofm/sdks#35 verification): a caller must be
145
+ // able to `catchTag` this the same way `expectCreated` lets it below.
146
+ return yield* Effect.fail(
147
+ new UnexpectedEffects({
148
+ digest: published.digest,
149
+ expected: "a published share package",
150
+ found: packagesPublished.map((ref) => ref.id),
151
+ }),
152
+ );
153
+ }
123
154
 
124
155
  // Tx 2: initialize → creates the Currency object + transfers the TreasuryCap.
125
- const initRes = yield* execThunks(
126
- signer,
156
+ const initialized = yield* Tx.run(
127
157
  initializeShareCurrency({
128
158
  shareCurrencyPackageId: packageId,
129
159
  name: params.name,
@@ -131,42 +161,51 @@ export const createShareCurrency = Effect.fn("createShareCurrency")(function* (
131
161
  iconUrl: params.iconUrl ?? "",
132
162
  treasuryCapRecipient: recipient,
133
163
  }),
164
+ opts,
134
165
  );
166
+ const currency = yield* initialized.expectCreated(CURRENCY_TYPE);
167
+ const treasuryCap = yield* initialized.expectCreated(TREASURY_CAP_TYPE);
135
168
 
136
169
  return {
137
170
  packageId,
138
- currencyId: createdByType(initRes, CURRENCY_TYPE),
171
+ currencyId: String(currency.id),
139
172
  shareType: `${packageId}::share::Share`,
140
- treasuryCapId: createdByType(initRes, TREASURY_CAP_TYPE),
141
- gasUsed: publishRes.gasUsed + initRes.gasUsed,
173
+ treasuryCapId: String(treasuryCap.id),
174
+ gasUsed: published.gasUsedTotal + initialized.gasUsedTotal,
142
175
  };
143
176
  });
144
177
 
145
- // ── Batched (parallel) ─────────────────────────────────────────────────────
178
+ // ── Batched ────────────────────────────────────────────────────────────────
146
179
 
147
180
  /** Splits an array into fixed-size chunks. */
148
- function chunk<T>(items: T[], size: number): T[][] {
181
+ function chunk<T>(items: readonly T[], size: number): T[][] {
149
182
  const out: T[][] = [];
150
183
  for (let i = 0; i < items.length; i += size) out.push(items.slice(i, i + size));
151
184
  return out;
152
185
  }
153
186
 
154
187
  /**
155
- * Publishes `count` fresh, permanently immutable share-currency packages, batched
156
- * at ≤5 publishes per PTB and run concurrently through the executor. Each publish
157
- * consumes its UpgradeCap in the same PTB. Returns the published package ids
158
- * (fungible — order is not meaningful; the caller assigns them to work slots).
188
+ * Publishes `count` fresh, permanently immutable share-currency packages,
189
+ * batched at ≤5 publishes per `Tx.run`. Each publish consumes its UpgradeCap
190
+ * in the same PTB. Returns the published package ids (fungible — order is not
191
+ * meaningful; the caller assigns them to work slots).
192
+ *
193
+ * Batches run as concurrent `Effect`s, but `Tx.run` holds one sender lock per
194
+ * address, so they serialize at the submission boundary — the accepted
195
+ * `ParallelTransactionExecutor` behaviour change for 0.28 (`docs/extensions.md`
196
+ * §5; parallel submission needs distinct gas owners).
197
+ *
198
+ * Fails with: `RunError`.
159
199
  */
160
200
  export const publishShareCurrencies = Effect.fn("publishShareCurrencies")(function* (
161
- executor: ParallelTransactionExecutor,
162
- initializerAddress: string,
163
201
  count: number,
164
- template: PackageBytecode = SHARE_TEMPLATE,
165
- ): Effect.fn.Return<{ packageIds: string[]; gasUsed: number }, SuiRpcError> {
166
- if (count <= 0) return { packageIds: [], gasUsed: 0 };
202
+ opts: RunOpts & { readonly initializerAddress?: string; readonly template?: PackageBytecode },
203
+ ): Effect.fn.Return<{ packageIds: string[]; gasUsed: bigint }, RunError | UnexpectedEffects, Sui> {
204
+ if (count <= 0) return { packageIds: [], gasUsed: 0n };
167
205
 
168
206
  // One patched template, reused for every publish (identical bytecode → distinct packages).
169
- const patched = patchInitializer(template, initializerAddress);
207
+ const initializer = opts.initializerAddress ?? opts.signer.address;
208
+ const patched = patchInitializer(opts.template ?? SHARE_TEMPLATE, initializer);
170
209
 
171
210
  const batchSizes: number[] = [];
172
211
  for (let remaining = count; remaining > 0; remaining -= PUBLISHES_PER_PTB) {
@@ -175,102 +214,132 @@ export const publishShareCurrencies = Effect.fn("publishShareCurrencies")(functi
175
214
 
176
215
  const results = yield* Effect.forEach(
177
216
  batchSizes,
178
- (n) => executeViaExecutor(executor, ...Array.from({ length: n }, () => publishShareCurrency(patched))),
217
+ (n) =>
218
+ Tx.run(
219
+ (tx) => {
220
+ for (let i = 0; i < n; i++) publishShareCurrency(patched)(tx);
221
+ },
222
+ { signer: opts.signer, gasOwner: opts.gasOwner, sponsor: opts.sponsor },
223
+ ),
179
224
  { concurrency: "unbounded" },
180
225
  );
181
226
 
182
- const packageIds = results.flatMap(allPublishedPackageIds);
183
- const gasUsed = results.reduce((sum, r) => sum + r.gasUsed, 0);
227
+ const packageIds = results.flatMap((executed) => executed.packagesPublished().map((ref) => String(ref.id)));
228
+ const gasUsed = results.reduce((sum, r) => sum + r.gasUsedTotal, 0n);
184
229
  if (packageIds.length !== count) {
185
- throw new Error(`Expected ${count} published share packages, got ${packageIds.length}.`);
230
+ // Every batch here already applied (each is its own `Tx.run`, gas
231
+ // charged) but the total published count disagrees with what was asked
232
+ // for — `UnexpectedEffects` (outcome "applied"), not a defect, per B9
233
+ // (misofm/sdks#35 verification). The last batch's digest is the most
234
+ // recent applied transaction; `found` lists every package actually seen.
235
+ const lastResult = results[results.length - 1]!;
236
+ return yield* Effect.fail(
237
+ new UnexpectedEffects({
238
+ digest: lastResult.digest,
239
+ expected: `${count} published share packages`,
240
+ found: packageIds.map((id) => ObjectId.make(id)),
241
+ }),
242
+ );
186
243
  }
187
244
  return { packageIds, gasUsed };
188
245
  });
189
246
 
190
- /** Re-associates one init PTB's created objects back to their packages by share type. */
191
- function currenciesFromResult(res: ExecResult, batchPkgs: string[]): ShareCurrency[] {
192
- const currencies = allCreatedByType(res, CURRENCY_TYPE);
193
- const treasuries = allCreatedByType(res, TREASURY_CAP_TYPE);
194
- return batchPkgs.map((pkg) => {
195
- const shareType = `${pkg}::share::Share`;
196
- const currency = currencies.find((o) => o.objectType.includes(shareType));
197
- const treasury = treasuries.find((o) => o.objectType.includes(shareType));
198
- if (!currency) throw new Error(`No Currency<${shareType}> created during initialize.`);
199
- if (!treasury) throw new Error(`No TreasuryCap<${shareType}> created during initialize.`);
200
- return { packageId: pkg, currencyId: currency.objectId, shareType, treasuryCapId: treasury.objectId, gasUsed: 0 };
201
- });
247
+ /**
248
+ * Re-associates one init PTB's created objects back to their packages by
249
+ * share type. `expectCreated` (an already-applied `Executed`'s own typed
250
+ * accessor) is what turns "the initialize applied but this package's
251
+ * Currency/TreasuryCap is missing" into `UnexpectedEffects` (outcome
252
+ * `"applied"`) instead of a bare throw a caller could not `catchTag` (B9,
253
+ * misofm/sdks#35 verification).
254
+ */
255
+ function currenciesFromResult(executed: Executed, batchPkgs: readonly string[]): Effect.Effect<ShareCurrency[], UnexpectedEffects> {
256
+ return Effect.forEach(batchPkgs, (pkg) =>
257
+ Effect.gen(function* () {
258
+ const shareType = `${pkg}::share::Share`;
259
+ const currency = yield* executed.expectCreated(`${CURRENCY_TYPE}<${shareType}>`);
260
+ const treasury = yield* executed.expectCreated(`${TREASURY_CAP_TYPE}<${shareType}>`);
261
+ return { packageId: pkg, currencyId: String(currency.id), shareType, treasuryCapId: String(treasury.id), gasUsed: 0n };
262
+ }),
263
+ );
202
264
  }
203
265
 
204
266
  /**
205
267
  * Initializes each published package into a `Currency<Share>` + `TreasuryCap`,
206
- * batched and run concurrently. `metaOf` supplies each package's display metadata,
207
- * so a currency destined for a specific work is named for it.
268
+ * batched (≤10 per `Tx.run`). `metaOf` supplies each package's display
269
+ * metadata, so a currency destined for a specific work is named for it.
208
270
  *
209
- * `share::initialize` is NON-idempotent (`coin_registry` registers one `Currency`
210
- * per type), so a batch must never be re-run. Batches run under `Promise.allSettled`
211
- * and `onBatch` fires for each SUCCEEDED batch as it lands letting the caller
212
- * persist that batch immediately. If any batch fails, the succeeded ones are already
213
- * reported and this throws, so a resume re-initializes only the still-missing packages.
271
+ * `share::initialize` is NON-idempotent (`coin_registry` registers one
272
+ * `Currency` per type), so a batch must never be re-run. `onBatch` fires for
273
+ * each succeeded batch as it lands, letting the caller persist it
274
+ * immediately, before the whole call settles. If any batch fails, the ones
275
+ * that already succeeded have already been reported through `onBatch`; this
276
+ * then fails with that batch's own typed error (the first one encountered),
277
+ * so a resume re-initializes only the still-missing packages.
278
+ *
279
+ * Fails with: `RunError`; `UnexpectedEffects` when a batch applied but a
280
+ * package's `Currency`/`TreasuryCap` is missing from its effects, or from a
281
+ * rejecting `onBatch` effect; or whatever `onBatch` itself declares (typed `E`).
214
282
  */
215
- export const initializeShareCurrencies = Effect.fn("initializeShareCurrencies")(function* (
216
- executor: ParallelTransactionExecutor,
217
- signerAddress: string,
218
- packageIds: string[],
283
+ export function initializeShareCurrencies<E = never>(
284
+ packageIds: readonly string[],
219
285
  metaOf: (packageId: string) => ShareCurrencyMeta,
220
- onBatch?: (currencies: ShareCurrency[], gasUsed: number) => void | Promise<void>,
221
- ): Effect.fn.Return<{ currencies: ShareCurrency[]; gasUsed: number }, never> {
222
- if (packageIds.length === 0) return { currencies: [], gasUsed: 0 };
286
+ opts: RunOpts & {
287
+ readonly onBatch?: (currencies: ShareCurrency[], gasUsed: bigint) => Effect.Effect<void, E>;
288
+ },
289
+ ): Effect.Effect<{ currencies: ShareCurrency[]; gasUsed: bigint }, RunError | UnexpectedEffects | E, Sui> {
290
+ return Effect.gen(function* () {
291
+ if (packageIds.length === 0) return { currencies: [], gasUsed: 0n };
223
292
 
224
- const batches = chunk(packageIds, INITS_PER_PTB);
225
- // `Effect.either` per batch preserves `Promise.allSettled`'s partial-failure
226
- // tolerance: one batch's `SuiRpcError` does not cancel the others in flight.
227
- const outcomes = yield* Effect.forEach(
228
- batches,
229
- (batchPkgs) =>
230
- executeViaExecutor(
231
- executor,
232
- ...batchPkgs.map((pkg) => {
233
- const meta = metaOf(pkg);
234
- return initializeShareCurrency({
235
- shareCurrencyPackageId: pkg,
236
- name: meta.name,
237
- description: meta.description,
238
- iconUrl: meta.iconUrl ?? "",
239
- treasuryCapRecipient: signerAddress,
240
- });
241
- }),
242
- ).pipe(
243
- Effect.map((res) => ({ batchCurrencies: currenciesFromResult(res, batchPkgs), gasUsed: res.gasUsed })),
244
- // A rejecting callback is this batch's failure, not a defect: a defect
245
- // would fail the whole forEach and interrupt sibling batches whose
246
- // transactions are already submitted.
247
- Effect.tap(({ batchCurrencies, gasUsed }) =>
248
- onBatch
249
- ? Effect.tryPromise({
250
- try: () => Promise.resolve(onBatch(batchCurrencies, gasUsed)),
251
- catch: (cause) => new SuiRpcError({ operation: "onBatch", cause }),
252
- })
253
- : Effect.void,
293
+ const batches = chunk(packageIds, INITS_PER_PTB);
294
+ // `Effect.result` per batch preserves the predecessor's partial-failure
295
+ // tolerance: one batch's error does not cancel sibling batches already in
296
+ // flight.
297
+ const outcomes = yield* Effect.forEach(
298
+ batches,
299
+ (batchPkgs) =>
300
+ Tx.run(
301
+ (tx) => {
302
+ for (const pkg of batchPkgs) {
303
+ const meta = metaOf(pkg);
304
+ initializeShareCurrency({
305
+ shareCurrencyPackageId: pkg,
306
+ name: meta.name,
307
+ description: meta.description,
308
+ iconUrl: meta.iconUrl ?? "",
309
+ treasuryCapRecipient: opts.signer.address,
310
+ })(tx);
311
+ }
312
+ },
313
+ { signer: opts.signer, gasOwner: opts.gasOwner, sponsor: opts.sponsor },
314
+ ).pipe(
315
+ Effect.flatMap((executed) =>
316
+ Effect.map(currenciesFromResult(executed, batchPkgs), (batchCurrencies) => ({
317
+ batchCurrencies,
318
+ gasUsed: executed.gasUsedTotal,
319
+ })),
320
+ ),
321
+ Effect.flatMap(({ batchCurrencies, gasUsed }) =>
322
+ (opts.onBatch ? opts.onBatch(batchCurrencies, gasUsed) : Effect.void).pipe(
323
+ Effect.as({ batchCurrencies, gasUsed }),
324
+ ),
325
+ ),
326
+ Effect.result,
254
327
  ),
255
- Effect.result,
256
- ),
257
- { concurrency: "unbounded" },
258
- );
328
+ { concurrency: "unbounded" },
329
+ );
259
330
 
260
- const currencies: ShareCurrency[] = [];
261
- const errors: unknown[] = [];
262
- let gasUsed = 0;
263
- for (const outcome of outcomes) {
264
- if (outcome._tag === "Success") {
265
- currencies.push(...outcome.success.batchCurrencies);
266
- gasUsed += outcome.success.gasUsed;
267
- } else {
268
- errors.push(outcome.failure);
331
+ const currencies: ShareCurrency[] = [];
332
+ let gasUsed = 0n;
333
+ let firstFailure: RunError | UnexpectedEffects | E | undefined;
334
+ for (const outcome of outcomes) {
335
+ if (outcome._tag === "Success") {
336
+ currencies.push(...outcome.success.batchCurrencies);
337
+ gasUsed += outcome.success.gasUsed;
338
+ } else if (firstFailure === undefined) {
339
+ firstFailure = outcome.failure;
340
+ }
269
341
  }
270
- }
271
- if (errors.length > 0) {
272
- const msg = errors.map((e) => (e instanceof Error ? e.message : String(e))).join("; ");
273
- throw new Error(`${errors.length}/${batches.length} initialize batch(es) failed: ${msg}`);
274
- }
275
- return { currencies, gasUsed };
276
- });
342
+ if (firstFailure !== undefined) return yield* Effect.fail(firstFailure);
343
+ return { currencies, gasUsed };
344
+ });
345
+ }
@@ -31,6 +31,7 @@
31
31
  // transaction-thunk composition pattern, just crossing a package boundary now).
32
32
 
33
33
  import { Transaction, type TransactionObjectArgument } from "@mysten/sui/transactions";
34
+ import { type Recipe } from "@unconfirmed/sui-effect";
34
35
  import {
35
36
  contracts,
36
37
  createComposition,
@@ -53,8 +54,14 @@ interface ReleaseParts {
53
54
  adminCap: TransactionObjectArgument;
54
55
  }
55
56
 
56
- // `TxThunk` is the protocol SDK's type, re-exported so platform consumers get
57
- // the same nominal shape rather than a structurally-identical twin.
57
+ /**
58
+ * @deprecated `TxThunk` was the predecessor hand-written name for what
59
+ * sui-effect calls `Recipe`. Kept as one minor for source compatibility
60
+ * (misofm/sdks#35's migration map); every builder in this package is typed
61
+ * `Recipe` directly (B8, misofm/sdks#35 verification — `git grep TxThunk
62
+ * packages/platform/src` shows only this re-export). Import `Recipe` from
63
+ * `@unconfirmed/sui-effect` instead.
64
+ */
58
65
  export type { TxThunk };
59
66
 
60
67
  /** New custody is explicit; the legacy address shape remains mutually exclusive. */
@@ -239,7 +246,7 @@ export interface PackageBytecode {
239
246
  }
240
247
 
241
248
  /** Publish a share package and permanently destroy its UpgradeCap in the same PTB. */
242
- export function publishShareCurrency(bytecode: PackageBytecode): TxThunk {
249
+ export function publishShareCurrency(bytecode: PackageBytecode): Recipe {
243
250
  return (tx) => {
244
251
  const upgradeCap = tx.publish(bytecode);
245
252
  tx.moveCall({ target: "0x2::package::make_immutable", arguments: [upgradeCap] });
@@ -256,7 +263,7 @@ export interface InitializeShareCurrencyParams {
256
263
  treasuryCapRecipient: string;
257
264
  }
258
265
 
259
- export function initializeShareCurrency(params: InitializeShareCurrencyParams): TxThunk {
266
+ export function initializeShareCurrency(params: InitializeShareCurrencyParams): Recipe {
260
267
  const { shareCurrencyPackageId, name, description, iconUrl, treasuryCapRecipient } = params;
261
268
  return (tx) => {
262
269
  const treasuryCap = tx.moveCall({
@@ -302,7 +309,7 @@ interface PublishCompositionParamsBase extends ShareCurrencyBinding {
302
309
  export type PublishCompositionParams = PublishCompositionParamsBase & AdminCustodyInput;
303
310
 
304
311
  /** Convenience: publish a composition end-to-end (createComposition → finalizeComposition). */
305
- export function publishComposition(params: PublishCompositionParams): TxThunk {
312
+ export function publishComposition(params: PublishCompositionParams): Recipe {
306
313
  return (tx) => {
307
314
  const parts = createComposition(tx, {
308
315
  shareType: params.shareType,
@@ -365,7 +372,7 @@ interface PublishRecordingParamsBase extends ShareCurrencyBinding {
365
372
  export type PublishRecordingParams = PublishRecordingParamsBase & AdminCustodyInput;
366
373
 
367
374
  /** Convenience: publish a recording against an already-on-chain composition. */
368
- export function publishRecording(params: PublishRecordingParams): TxThunk {
375
+ export function publishRecording(params: PublishRecordingParams): Recipe {
369
376
  return (tx) => {
370
377
  const parts = createRecording(tx, {
371
378
  shareType: params.shareType,
@@ -412,7 +419,7 @@ export interface PublishCompositionAndRecordingParams {
412
419
  * `composition::new` → `recording::new(&comp)` → finalize composition (publish) →
413
420
  * finalize recording (publish).
414
421
  */
415
- export function publishCompositionAndRecording(params: PublishCompositionAndRecordingParams): TxThunk {
422
+ export function publishCompositionAndRecording(params: PublishCompositionAndRecordingParams): Recipe {
416
423
  return (tx) => {
417
424
  const comp = createComposition(tx, {
418
425
  shareType: params.composition.shareType,
@@ -517,7 +524,7 @@ function buildTrackVec(
517
524
  * Convenience: publish a release end-to-end, assembling its tracklist from
518
525
  * recording admin caps held by the sender.
519
526
  */
520
- export function publishRelease(params: PublishReleaseParams): TxThunk {
527
+ export function publishRelease(params: PublishReleaseParams): Recipe {
521
528
  return (tx) => {
522
529
  const { misoPackageId } = params;
523
530
  const trackArgs = params.tracks.map((t) => {
package/src/vault.ts CHANGED
@@ -20,15 +20,7 @@ import type {
20
20
  } from "@mysten/sui/transactions";
21
21
  import { deriveObjectID, normalizeStructTag } from "@mysten/sui/utils";
22
22
  import { Effect, Schema } from "effect";
23
- import {
24
- assertObjectType,
25
- decodeBcs,
26
- getOptionalObjectContent,
27
- SuiClient,
28
- SuiRpcError,
29
- type BcsDecodeError,
30
- type ObjectTypeMismatchError,
31
- } from "@misofm/effect";
23
+ import { ObjectId, Sui, SuiSchema, type BatchItemError, type DecodeError, type ObjectUnavailable, type TransportError } from "@unconfirmed/sui-effect";
32
24
  import * as vault from "./contracts/vault/vault.ts";
33
25
  import * as releaseRevenueDistributor from "./contracts/release_revenue_distributor/release_revenue_distributor.ts";
34
26
  import * as compositionRoyaltyPoolPlugin from "./contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.ts";
@@ -940,6 +932,7 @@ export function parseReleaseRevenueDistributedEvent(content: Uint8Array) {
940
932
  );
941
933
  return {
942
934
  releaseId: event.release_id,
935
+ trackCount: event.track_count.toString(),
943
936
  totalInput: event.total_input.toString(),
944
937
  totalDistributed: event.total_distributed.toString(),
945
938
  remainder: event.remainder.toString(),
@@ -952,7 +945,10 @@ export function parseReleaseTrackRevenueDistributedEvent(content: Uint8Array) {
952
945
  return {
953
946
  releaseId: event.release_id,
954
947
  trackIndex: event.track_index.toString(),
948
+ compositionId: event.composition_id,
955
949
  recordingId: event.recording_id,
950
+ splitBps: event.split_bps,
951
+ totalInput: event.total_input.toString(),
956
952
  amount: event.amount.toString(),
957
953
  };
958
954
  }
@@ -977,17 +973,17 @@ function mapVaultAdminCap(id: string, parsed: ReturnType<typeof vault.VaultAdmin
977
973
  export const getVaultAdminCap = Effect.fn("getVaultAdminCap")(function* (
978
974
  vaultAdminCapId: string,
979
975
  expected: { readonly vaultPackageId: string; readonly capType: string },
980
- ): Effect.fn.Return<VaultAdminCap | null, ObjectTypeMismatchError | BcsDecodeError | SuiRpcError, SuiClient> {
981
- const found = yield* getOptionalObjectContent(vaultAdminCapId);
982
- if (found._tag === "None") return null;
976
+ ): Effect.fn.Return<VaultAdminCap | null, DecodeError | ObjectUnavailable | TransportError, Sui> {
977
+ const sui = yield* Sui;
978
+ const id = ObjectId.make(vaultAdminCapId);
983
979
  const expectedType = normalizeStructTag(`${expected.vaultPackageId}::vault::VaultAdminCap<${expected.capType}>`);
984
- yield* assertObjectType(vaultAdminCapId, normalizeStructTag(found.value.type), expectedType);
985
- return yield* decodeBcs(
986
- { parse: (bytes) => mapVaultAdminCap(vaultAdminCapId, vault.VaultAdminCap.parse(bytes)) },
987
- VaultAdminCap,
988
- found.value.content,
989
- { type: "VaultAdminCap", objectId: vaultAdminCapId },
990
- );
980
+ const found = yield* sui.getObjectOption(id, { expectedType });
981
+ if (found._tag === "None") return null;
982
+ const parsed = yield* SuiSchema.decode(SuiSchema.bcs(vault.VaultAdminCap), found.value.content, {
983
+ objectId: id,
984
+ actualType: found.value.type,
985
+ });
986
+ return new VaultAdminCap(mapVaultAdminCap(vaultAdminCapId, parsed));
991
987
  });
992
988
 
993
989
  /**
@@ -1004,18 +1000,15 @@ export interface ReceivingObjectRef {
1004
1000
  /** Resolve owned coins to the exact references required by a Receiving input. */
1005
1001
  export const resolveReceivingCoins = Effect.fn("resolveReceivingCoins")(function* (
1006
1002
  coinIds: readonly string[],
1007
- ): Effect.fn.Return<ReceivingObjectRef[], SuiRpcError, SuiClient> {
1008
- const client = yield* SuiClient;
1009
- const { objects } = yield* Effect.tryPromise({
1010
- try: (signal) => client.core.getObjects({ objectIds: [...coinIds], signal }),
1011
- catch: (cause) => new SuiRpcError({ operation: "getObjects", cause }),
1012
- });
1013
- return objects.map((coin, index) => {
1014
- if (coin instanceof Error || !coin) {
1015
- throw new Error(`resolveReceivingCoins: could not resolve ${coinIds[index]}`);
1016
- }
1017
- return { objectId: coin.objectId, version: coin.version, digest: coin.digest };
1018
- });
1003
+ ): Effect.fn.Return<ReceivingObjectRef[], BatchItemError | TransportError, Sui> {
1004
+ const sui = yield* Sui;
1005
+ // `getObjectsStrict`: every id must resolve, same "hard read" idiom
1006
+ // `getSale` uses a coin the caller named to receive but that the node
1007
+ // cannot produce is a typed `BatchItemError`, not a hand-rolled defect
1008
+ // from a raw `sui.core.getObjects` per-item `Error | null` check (B9,
1009
+ // misofm/sdks#35 verification).
1010
+ const objects = yield* sui.getObjectsStrict(coinIds.map((id) => ObjectId.make(id)));
1011
+ return objects.map((object) => ({ objectId: object.id, version: String(object.version), digest: object.digest }));
1019
1012
  });
1020
1013
 
1021
1014
  export function receivingCoins(
@@ -1 +0,0 @@
1
- {"version":3,"file":"type_name.d.ts","sourceRoot":"","sources":["../../../../../src/contracts/record_shop/deps/std/type_name.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE,0EAA0E;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAIrD,eAAO,MAAM,QAAQ;IACb;;;;;;;;SAQK;;8BAEL,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"type_name.js","sourceRoot":"","sources":["../../../../../src/contracts/record_shop/deps/std/type_name.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE,0EAA0E;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,MAAM,WAAW,GAAG,gBAAgB,CAAC;AACrC,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,YAAY,EAAE,MAAM,EAAE;QAC3E;;;;;;;;aAQK;QACL,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE;KACrB,EAAE,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- /**************************************************************
2
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
- **************************************************************/
4
- import { MoveTuple } from '../../../utils/index.ts';
5
- export declare const LanguageCode: MoveTuple<readonly [import("@mysten/bcs").BcsType<string, string, "string">], "language_code::language_code::LanguageCode">;
6
- //# sourceMappingURL=language_code.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"language_code.d.ts","sourceRoot":"","sources":["../../../../../src/contracts/recording_language/deps/language_code/language_code.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIpD,eAAO,MAAM,YAAY,6HAAkF,CAAC"}
@@ -1,8 +0,0 @@
1
- /**************************************************************
2
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
- **************************************************************/
4
- import { MoveTuple } from '../../../utils/index.js';
5
- import { bcs } from '@mysten/sui/bcs';
6
- const $moduleName = 'language_code::language_code';
7
- export const LanguageCode = new MoveTuple({ name: `${$moduleName}::LanguageCode`, fields: [bcs.string()] });
8
- //# sourceMappingURL=language_code.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"language_code.js","sourceRoot":"","sources":["../../../../../src/contracts/recording_language/deps/language_code/language_code.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,MAAM,WAAW,GAAG,8BAA8B,CAAC;AACnD,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,gBAAgB,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC"}