@misofm/sdk 0.16.0 → 0.17.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 (307) hide show
  1. package/README.md +79 -34
  2. package/dist/client.d.ts +72 -24
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +229 -84
  5. package/dist/client.js.map +1 -1
  6. package/dist/contracts/composition_credits/composition_credits.d.ts +10 -10
  7. package/dist/contracts/composition_credits/composition_credits.d.ts.map +1 -1
  8. package/dist/contracts/composition_credits/composition_credits.js.map +1 -1
  9. package/dist/contracts/composition_credits/composition_party_role.d.ts +1 -1
  10. package/dist/contracts/composition_credits/composition_party_role.d.ts.map +1 -1
  11. package/dist/contracts/composition_credits/composition_party_role.js.map +1 -1
  12. package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts.map +1 -1
  13. package/dist/contracts/composition_credits/deps/miso_credit/credit.js.map +1 -1
  14. package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts.map +1 -1
  15. package/dist/contracts/composition_credits/deps/sui/vec_map.js.map +1 -1
  16. package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts +29 -93
  17. package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts.map +1 -1
  18. package/dist/contracts/composition_routed_stake/composition_routed_stake.js +19 -79
  19. package/dist/contracts/composition_routed_stake/composition_routed_stake.js.map +1 -1
  20. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +15 -99
  21. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +1 -1
  22. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +12 -94
  23. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +1 -1
  24. package/dist/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.d.ts +90 -0
  25. package/dist/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.d.ts.map +1 -0
  26. package/dist/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.js +85 -0
  27. package/dist/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.js.map +1 -0
  28. package/dist/contracts/{party_wallet → composition_royalty_pool_plugin}/witness.d.ts +1 -1
  29. package/dist/contracts/composition_royalty_pool_plugin/witness.d.ts.map +1 -0
  30. package/dist/contracts/{recording_royalty_pool → composition_royalty_pool_plugin}/witness.js +1 -1
  31. package/dist/contracts/composition_royalty_pool_plugin/witness.js.map +1 -0
  32. package/dist/contracts/cover_art/cover_art.d.ts +4 -4
  33. package/dist/contracts/cover_art/cover_art.d.ts.map +1 -1
  34. package/dist/contracts/cover_art/cover_art.js.map +1 -1
  35. package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts +4 -4
  36. package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts.map +1 -1
  37. package/dist/contracts/cover_art/deps/ori/walrus_data.js.map +1 -1
  38. package/dist/contracts/genre/genre.d.ts +6 -6
  39. package/dist/contracts/genre/genre.d.ts.map +1 -1
  40. package/dist/contracts/genre/genre.js.map +1 -1
  41. package/dist/contracts/miso_record/deps/std/type_name.d.ts +1 -1
  42. package/dist/contracts/miso_record/deps/std/type_name.d.ts.map +1 -1
  43. package/dist/contracts/miso_record/deps/std/type_name.js.map +1 -1
  44. package/dist/contracts/miso_record/deps/sui/vec_set.d.ts.map +1 -1
  45. package/dist/contracts/miso_record/deps/sui/vec_set.js.map +1 -1
  46. package/dist/contracts/miso_record/pressing.d.ts.map +1 -1
  47. package/dist/contracts/miso_record/pressing.js.map +1 -1
  48. package/dist/contracts/miso_record/record.d.ts +17 -17
  49. package/dist/contracts/miso_record/record.d.ts.map +1 -1
  50. package/dist/contracts/miso_record/record.js.map +1 -1
  51. package/dist/contracts/miso_record_shop/deps/std/type_name.d.ts +1 -1
  52. package/dist/contracts/miso_record_shop/deps/std/type_name.d.ts.map +1 -1
  53. package/dist/contracts/miso_record_shop/deps/std/type_name.js.map +1 -1
  54. package/dist/contracts/miso_record_shop/listing.d.ts +29 -29
  55. package/dist/contracts/miso_record_shop/listing.d.ts.map +1 -1
  56. package/dist/contracts/miso_record_shop/listing.js.map +1 -1
  57. package/dist/contracts/miso_record_shop/witness.d.ts +1 -1
  58. package/dist/contracts/miso_record_shop/witness.d.ts.map +1 -1
  59. package/dist/contracts/miso_record_shop/witness.js.map +1 -1
  60. package/dist/contracts/party_wallet/party_wallet.d.ts +41 -168
  61. package/dist/contracts/party_wallet/party_wallet.d.ts.map +1 -1
  62. package/dist/contracts/party_wallet/party_wallet.js +27 -152
  63. package/dist/contracts/party_wallet/party_wallet.js.map +1 -1
  64. package/dist/contracts/recording_advisory/recording_advisory.d.ts +3 -3
  65. package/dist/contracts/recording_advisory/recording_advisory.d.ts.map +1 -1
  66. package/dist/contracts/recording_advisory/recording_advisory.js.map +1 -1
  67. package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts.map +1 -1
  68. package/dist/contracts/recording_credits/deps/miso_credit/credit.js.map +1 -1
  69. package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts.map +1 -1
  70. package/dist/contracts/recording_credits/deps/sui/vec_map.js.map +1 -1
  71. package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts.map +1 -1
  72. package/dist/contracts/recording_credits/deps/sui/vec_set.js.map +1 -1
  73. package/dist/contracts/recording_credits/recording_credits.d.ts +20 -20
  74. package/dist/contracts/recording_credits/recording_credits.d.ts.map +1 -1
  75. package/dist/contracts/recording_credits/recording_credits.js.map +1 -1
  76. package/dist/contracts/recording_credits/recording_party_role.d.ts +30 -30
  77. package/dist/contracts/recording_credits/recording_party_role.d.ts.map +1 -1
  78. package/dist/contracts/recording_credits/recording_party_role.js.map +1 -1
  79. package/dist/contracts/recording_language/deps/language_code/language_code.d.ts +1 -1
  80. package/dist/contracts/recording_language/deps/language_code/language_code.d.ts.map +1 -1
  81. package/dist/contracts/recording_language/deps/language_code/language_code.js.map +1 -1
  82. package/dist/contracts/recording_language/recording_language.d.ts +4 -4
  83. package/dist/contracts/recording_language/recording_language.d.ts.map +1 -1
  84. package/dist/contracts/recording_language/recording_language.js.map +1 -1
  85. package/dist/contracts/recording_master_reference/deps/ori/walrus_data.d.ts +4 -4
  86. package/dist/contracts/recording_master_reference/deps/ori/walrus_data.d.ts.map +1 -1
  87. package/dist/contracts/recording_master_reference/deps/ori/walrus_data.js.map +1 -1
  88. package/dist/contracts/recording_master_reference/recording_master_reference.d.ts +6 -6
  89. package/dist/contracts/recording_master_reference/recording_master_reference.d.ts.map +1 -1
  90. package/dist/contracts/recording_master_reference/recording_master_reference.js.map +1 -1
  91. package/dist/contracts/recording_preview/deps/ori/walrus_data.d.ts +4 -4
  92. package/dist/contracts/recording_preview/deps/ori/walrus_data.d.ts.map +1 -1
  93. package/dist/contracts/recording_preview/deps/ori/walrus_data.js.map +1 -1
  94. package/dist/contracts/recording_preview/recording_preview.d.ts +6 -6
  95. package/dist/contracts/recording_preview/recording_preview.d.ts.map +1 -1
  96. package/dist/contracts/recording_preview/recording_preview.js.map +1 -1
  97. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +14 -100
  98. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +1 -1
  99. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +11 -94
  100. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +1 -1
  101. package/dist/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.d.ts +92 -0
  102. package/dist/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.d.ts.map +1 -0
  103. package/dist/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.js +85 -0
  104. package/dist/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.js.map +1 -0
  105. package/dist/contracts/{composition_royalty_pool → recording_royalty_pool_plugin}/witness.d.ts +1 -1
  106. package/dist/contracts/recording_royalty_pool_plugin/witness.d.ts.map +1 -0
  107. package/dist/contracts/{party_wallet → recording_royalty_pool_plugin}/witness.js +1 -1
  108. package/dist/contracts/recording_royalty_pool_plugin/witness.js.map +1 -0
  109. package/dist/contracts/release_cover_art/deps/{0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78 → 0xf35cf353a62cef01084b51a9cf3da4c64c8724685ad1862f2f8284b71bd26c1a}/walrus_data.d.ts +7 -7
  110. package/dist/contracts/release_cover_art/deps/{0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78 → 0xf35cf353a62cef01084b51a9cf3da4c64c8724685ad1862f2f8284b71bd26c1a}/walrus_data.d.ts.map +1 -1
  111. package/dist/contracts/release_cover_art/deps/{0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78 → 0xf35cf353a62cef01084b51a9cf3da4c64c8724685ad1862f2f8284b71bd26c1a}/walrus_data.js +1 -1
  112. package/dist/contracts/release_cover_art/deps/{0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78 → 0xf35cf353a62cef01084b51a9cf3da4c64c8724685ad1862f2f8284b71bd26c1a}/walrus_data.js.map +1 -1
  113. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts +7 -7
  114. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts.map +1 -1
  115. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js +1 -1
  116. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js.map +1 -1
  117. package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts.map +1 -1
  118. package/dist/contracts/release_cover_art/deps/per_track/per_track.js.map +1 -1
  119. package/dist/contracts/release_cover_art/release_cover_art.d.ts +23 -23
  120. package/dist/contracts/release_cover_art/release_cover_art.d.ts.map +1 -1
  121. package/dist/contracts/release_cover_art/release_cover_art.js.map +1 -1
  122. package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts.map +1 -1
  123. package/dist/contracts/release_credits/deps/miso_credit/credit.js.map +1 -1
  124. package/dist/contracts/release_credits/deps/sui/vec_map.d.ts.map +1 -1
  125. package/dist/contracts/release_credits/deps/sui/vec_map.js.map +1 -1
  126. package/dist/contracts/release_credits/release_credits.d.ts +10 -10
  127. package/dist/contracts/release_credits/release_credits.d.ts.map +1 -1
  128. package/dist/contracts/release_credits/release_credits.js.map +1 -1
  129. package/dist/contracts/release_description/release_description.d.ts +4 -4
  130. package/dist/contracts/release_description/release_description.d.ts.map +1 -1
  131. package/dist/contracts/release_description/release_description.js.map +1 -1
  132. package/dist/contracts/release_dsp_link/release_dsp_link.d.ts +41 -42
  133. package/dist/contracts/release_dsp_link/release_dsp_link.d.ts.map +1 -1
  134. package/dist/contracts/release_dsp_link/release_dsp_link.js +4 -5
  135. package/dist/contracts/release_dsp_link/release_dsp_link.js.map +1 -1
  136. package/dist/contracts/release_genre/deps/per_track/per_track.d.ts.map +1 -1
  137. package/dist/contracts/release_genre/deps/per_track/per_track.js.map +1 -1
  138. package/dist/contracts/release_genre/release_genre.d.ts +15 -15
  139. package/dist/contracts/release_genre/release_genre.d.ts.map +1 -1
  140. package/dist/contracts/release_genre/release_genre.js.map +1 -1
  141. package/dist/contracts/release_kind/release_kind.d.ts +4 -4
  142. package/dist/contracts/release_kind/release_kind.d.ts.map +1 -1
  143. package/dist/contracts/release_kind/release_kind.js.map +1 -1
  144. package/dist/contracts/release_revenue_distributor/release_revenue_distributor.d.ts +46 -59
  145. package/dist/contracts/release_revenue_distributor/release_revenue_distributor.d.ts.map +1 -1
  146. package/dist/contracts/release_revenue_distributor/release_revenue_distributor.js +27 -48
  147. package/dist/contracts/release_revenue_distributor/release_revenue_distributor.js.map +1 -1
  148. package/dist/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.d.ts +75 -0
  149. package/dist/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.d.ts.map +1 -0
  150. package/dist/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.js +80 -0
  151. package/dist/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.js.map +1 -0
  152. package/dist/contracts/{recording_royalty_pool → release_revenue_distributor_plugin}/witness.d.ts +1 -1
  153. package/dist/contracts/release_revenue_distributor_plugin/witness.d.ts.map +1 -0
  154. package/dist/contracts/{composition_royalty_pool → release_revenue_distributor_plugin}/witness.js +1 -1
  155. package/dist/contracts/release_revenue_distributor_plugin/witness.js.map +1 -0
  156. package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts +5 -5
  157. package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts.map +1 -1
  158. package/dist/contracts/routed_stake/deps/royalty_pool/stake.js.map +1 -1
  159. package/dist/contracts/routed_stake/deps/std/type_name.d.ts +1 -1
  160. package/dist/contracts/routed_stake/deps/std/type_name.d.ts.map +1 -1
  161. package/dist/contracts/routed_stake/deps/std/type_name.js.map +1 -1
  162. package/dist/contracts/routed_stake/deps/sui/balance.d.ts +1 -1
  163. package/dist/contracts/routed_stake/deps/sui/balance.d.ts.map +1 -1
  164. package/dist/contracts/routed_stake/deps/sui/balance.js.map +1 -1
  165. package/dist/contracts/routed_stake/deps/sui/vec_map.d.ts.map +1 -1
  166. package/dist/contracts/routed_stake/deps/sui/vec_map.js.map +1 -1
  167. package/dist/contracts/routed_stake/routed_stake.d.ts +15 -15
  168. package/dist/contracts/routed_stake/routed_stake.d.ts.map +1 -1
  169. package/dist/contracts/routed_stake/routed_stake.js.map +1 -1
  170. package/dist/contracts/royalty_pool/deps/std/type_name.d.ts +1 -1
  171. package/dist/contracts/royalty_pool/deps/std/type_name.d.ts.map +1 -1
  172. package/dist/contracts/royalty_pool/deps/std/type_name.js.map +1 -1
  173. package/dist/contracts/royalty_pool/deps/sui/balance.d.ts +1 -1
  174. package/dist/contracts/royalty_pool/deps/sui/balance.d.ts.map +1 -1
  175. package/dist/contracts/royalty_pool/deps/sui/balance.js.map +1 -1
  176. package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts.map +1 -1
  177. package/dist/contracts/royalty_pool/deps/sui/vec_map.js.map +1 -1
  178. package/dist/contracts/royalty_pool/pool.d.ts +19 -19
  179. package/dist/contracts/royalty_pool/pool.d.ts.map +1 -1
  180. package/dist/contracts/royalty_pool/pool.js.map +1 -1
  181. package/dist/contracts/royalty_pool/stake.d.ts +9 -9
  182. package/dist/contracts/royalty_pool/stake.d.ts.map +1 -1
  183. package/dist/contracts/royalty_pool/stake.js.map +1 -1
  184. package/dist/contracts/vault/deps/sui/bag.d.ts +2 -2
  185. package/dist/contracts/vault/deps/sui/bag.d.ts.map +1 -1
  186. package/dist/contracts/vault/deps/sui/bag.js.map +1 -1
  187. package/dist/contracts/vault/deps/sui/borrow.d.ts.map +1 -1
  188. package/dist/contracts/vault/deps/sui/borrow.js.map +1 -1
  189. package/dist/contracts/vault/vault.d.ts +19 -93
  190. package/dist/contracts/vault/vault.d.ts.map +1 -1
  191. package/dist/contracts/vault/vault.js +16 -95
  192. package/dist/contracts/vault/vault.js.map +1 -1
  193. package/dist/contracts.d.ts +3 -0
  194. package/dist/contracts.d.ts.map +1 -1
  195. package/dist/contracts.js +4 -1
  196. package/dist/contracts.js.map +1 -1
  197. package/dist/deployments.d.ts +125 -79
  198. package/dist/deployments.d.ts.map +1 -1
  199. package/dist/deployments.js +111 -35
  200. package/dist/deployments.js.map +1 -1
  201. package/dist/index.d.ts +1 -1
  202. package/dist/index.d.ts.map +1 -1
  203. package/dist/index.js +1 -1
  204. package/dist/index.js.map +1 -1
  205. package/dist/internal.d.ts +9 -0
  206. package/dist/internal.d.ts.map +1 -1
  207. package/dist/internal.js +23 -0
  208. package/dist/internal.js.map +1 -1
  209. package/dist/publication.d.ts +1 -4
  210. package/dist/publication.d.ts.map +1 -1
  211. package/dist/publication.js +79 -60
  212. package/dist/publication.js.map +1 -1
  213. package/dist/read/config.d.ts.map +1 -1
  214. package/dist/read/config.js +9 -1
  215. package/dist/read/config.js.map +1 -1
  216. package/dist/vault.d.ts +42 -38
  217. package/dist/vault.d.ts.map +1 -1
  218. package/dist/vault.js +96 -169
  219. package/dist/vault.js.map +1 -1
  220. package/package.json +13 -10
  221. package/src/client.ts +291 -107
  222. package/src/contracts/composition_credits/composition_credits.ts +3 -2
  223. package/src/contracts/composition_credits/composition_party_role.ts +5 -4
  224. package/src/contracts/composition_credits/deps/miso_credit/credit.ts +1 -0
  225. package/src/contracts/composition_credits/deps/sui/vec_map.ts +1 -0
  226. package/src/contracts/composition_routed_stake/composition_routed_stake.ts +36 -146
  227. package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +20 -161
  228. package/src/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.ts +165 -0
  229. package/src/contracts/{recording_royalty_pool → composition_royalty_pool_plugin}/witness.ts +2 -1
  230. package/src/contracts/cover_art/cover_art.ts +2 -1
  231. package/src/contracts/cover_art/deps/ori/walrus_data.ts +1 -0
  232. package/src/contracts/genre/genre.ts +3 -2
  233. package/src/contracts/miso_record/deps/std/type_name.ts +1 -0
  234. package/src/contracts/miso_record/deps/sui/vec_set.ts +1 -0
  235. package/src/contracts/miso_record/pressing.ts +1 -0
  236. package/src/contracts/miso_record/record.ts +1 -0
  237. package/src/contracts/miso_record_shop/deps/std/type_name.ts +1 -0
  238. package/src/contracts/miso_record_shop/listing.ts +1 -0
  239. package/src/contracts/miso_record_shop/witness.ts +1 -0
  240. package/src/contracts/party_wallet/party_wallet.ts +41 -256
  241. package/src/contracts/recording_advisory/recording_advisory.ts +4 -3
  242. package/src/contracts/recording_credits/deps/miso_credit/credit.ts +1 -0
  243. package/src/contracts/recording_credits/deps/sui/vec_map.ts +1 -0
  244. package/src/contracts/recording_credits/deps/sui/vec_set.ts +1 -0
  245. package/src/contracts/recording_credits/recording_credits.ts +3 -2
  246. package/src/contracts/recording_credits/recording_party_role.ts +5 -4
  247. package/src/contracts/recording_language/deps/language_code/language_code.ts +1 -0
  248. package/src/contracts/recording_language/recording_language.ts +5 -4
  249. package/src/contracts/recording_master_reference/deps/ori/walrus_data.ts +1 -0
  250. package/src/contracts/recording_master_reference/recording_master_reference.ts +6 -5
  251. package/src/contracts/recording_preview/deps/ori/walrus_data.ts +1 -0
  252. package/src/contracts/recording_preview/recording_preview.ts +2 -1
  253. package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +19 -162
  254. package/src/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.ts +167 -0
  255. package/src/contracts/{party_wallet → recording_royalty_pool_plugin}/witness.ts +2 -1
  256. package/src/contracts/release_cover_art/deps/{0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78 → 0xf35cf353a62cef01084b51a9cf3da4c64c8724685ad1862f2f8284b71bd26c1a}/walrus_data.ts +2 -1
  257. package/src/contracts/release_cover_art/deps/cover_art/cover_art.ts +3 -2
  258. package/src/contracts/release_cover_art/deps/per_track/per_track.ts +3 -2
  259. package/src/contracts/release_cover_art/release_cover_art.ts +2 -1
  260. package/src/contracts/release_credits/deps/miso_credit/credit.ts +1 -0
  261. package/src/contracts/release_credits/deps/sui/vec_map.ts +1 -0
  262. package/src/contracts/release_credits/release_credits.ts +4 -3
  263. package/src/contracts/release_credits/release_party_role.ts +4 -4
  264. package/src/contracts/release_description/release_description.ts +6 -5
  265. package/src/contracts/release_dsp_link/release_dsp_link.ts +8 -8
  266. package/src/contracts/release_genre/deps/per_track/per_track.ts +3 -2
  267. package/src/contracts/release_genre/release_genre.ts +4 -3
  268. package/src/contracts/release_kind/release_kind.ts +5 -4
  269. package/src/contracts/release_revenue_distributor/release_revenue_distributor.ts +50 -85
  270. package/src/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.ts +145 -0
  271. package/src/contracts/{composition_royalty_pool → release_revenue_distributor_plugin}/witness.ts +2 -1
  272. package/src/contracts/routed_stake/deps/royalty_pool/stake.ts +1 -0
  273. package/src/contracts/routed_stake/deps/std/type_name.ts +1 -0
  274. package/src/contracts/routed_stake/deps/sui/balance.ts +1 -0
  275. package/src/contracts/routed_stake/deps/sui/vec_map.ts +1 -0
  276. package/src/contracts/routed_stake/routed_stake.ts +4 -3
  277. package/src/contracts/royalty_pool/deps/std/type_name.ts +1 -0
  278. package/src/contracts/royalty_pool/deps/sui/balance.ts +1 -0
  279. package/src/contracts/royalty_pool/deps/sui/vec_map.ts +1 -0
  280. package/src/contracts/royalty_pool/pool.ts +1 -0
  281. package/src/contracts/royalty_pool/stake.ts +1 -0
  282. package/src/contracts/vault/deps/sui/bag.ts +3 -2
  283. package/src/contracts/vault/deps/sui/borrow.ts +2 -1
  284. package/src/contracts/vault/vault.ts +27 -152
  285. package/src/contracts.ts +4 -1
  286. package/src/deployments.ts +185 -60
  287. package/src/index.ts +3 -0
  288. package/src/internal.ts +27 -0
  289. package/src/publication.ts +87 -69
  290. package/src/read/config.ts +12 -1
  291. package/src/vault.ts +150 -256
  292. package/dist/contracts/composition_routed_stake/witness.d.ts +0 -7
  293. package/dist/contracts/composition_routed_stake/witness.d.ts.map +0 -1
  294. package/dist/contracts/composition_routed_stake/witness.js +0 -9
  295. package/dist/contracts/composition_routed_stake/witness.js.map +0 -1
  296. package/dist/contracts/composition_royalty_pool/witness.d.ts.map +0 -1
  297. package/dist/contracts/composition_royalty_pool/witness.js.map +0 -1
  298. package/dist/contracts/party_wallet/witness.d.ts.map +0 -1
  299. package/dist/contracts/party_wallet/witness.js.map +0 -1
  300. package/dist/contracts/recording_royalty_pool/witness.d.ts.map +0 -1
  301. package/dist/contracts/recording_royalty_pool/witness.js.map +0 -1
  302. package/dist/contracts/release_revenue_distributor/witness.d.ts +0 -7
  303. package/dist/contracts/release_revenue_distributor/witness.d.ts.map +0 -1
  304. package/dist/contracts/release_revenue_distributor/witness.js +0 -9
  305. package/dist/contracts/release_revenue_distributor/witness.js.map +0 -1
  306. package/src/contracts/composition_routed_stake/witness.ts +0 -11
  307. package/src/contracts/release_revenue_distributor/witness.ts +0 -11
package/src/client.ts CHANGED
@@ -31,8 +31,10 @@ import type {
31
31
  ClientWithCoreApi,
32
32
  SuiClientRegistration,
33
33
  } from "@mysten/sui/client";
34
+ import type {} from "@mysten/bcs";
34
35
  import type { Signer } from "@mysten/sui/cryptography";
35
36
  import type { SuiGraphQLClient } from "@mysten/sui/graphql";
37
+ import type { ParallelTransactionExecutor } from "@mysten/sui/transactions";
36
38
  import {
37
39
  miso as protocolMiso,
38
40
  type MisoProtocolClient,
@@ -53,6 +55,9 @@ import * as compositionRoyaltyPoolContract from "./contracts/composition_royalty
53
55
  import * as recordingRoyaltyPoolContract from "./contracts/recording_royalty_pool/recording_royalty_pool.ts";
54
56
  import * as partyWalletContract from "./contracts/party_wallet/party_wallet.ts";
55
57
  import * as compositionRoutedStakeContract from "./contracts/composition_routed_stake/composition_routed_stake.ts";
58
+ import * as compositionRoyaltyPoolPluginContract from "./contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.ts";
59
+ import * as recordingRoyaltyPoolPluginContract from "./contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.ts";
60
+ import * as releaseRevenueDistributorPluginContract from "./contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.ts";
56
61
  import * as routedStakeContract from "./contracts/routed_stake/routed_stake.ts";
57
62
  import * as royaltyPoolContract from "./contracts/royalty_pool/pool.ts";
58
63
  import * as recordingAdvisoryContract from "./contracts/recording_advisory/recording_advisory.ts";
@@ -115,10 +120,13 @@ import {
115
120
  } from "./release-graph.ts";
116
121
  import {
117
122
  getMisoPlatformDeployment,
123
+ requireOperationsDeployment,
118
124
  requireRecordSalesDeployment,
119
125
  type MisoPlatformDeployment,
126
+ type OperationsDeployment,
120
127
  type RecordSalesDeployment,
121
128
  } from "./deployments.ts";
129
+ import { immutableSnapshot } from "./internal.ts";
122
130
  import {
123
131
  deriveGenreAddress,
124
132
  setReleaseDescription,
@@ -137,6 +145,10 @@ import {
137
145
  type SetReleaseCoverParams,
138
146
  type SetReleaseTrackCoverParams,
139
147
  } from "./cover.ts";
148
+ import {
149
+ executeViaExecutor as executePlatformViaExecutor,
150
+ type PlatformExecResult,
151
+ } from "./execute.ts";
140
152
 
141
153
  type BoundMoveFunction<F> = F extends (options: infer Options) => infer Result
142
154
  ? Options extends { package?: unknown }
@@ -169,6 +181,43 @@ function bindModulePackage<M extends object, K extends readonly (keyof M)[]>(
169
181
  return out as BoundModule<M, K>;
170
182
  }
171
183
 
184
+ /** Keep synchronous, client-bound surfaces unusable until the endpoint's exact
185
+ * ledger has been validated. The underlying standalone builders remain pure. */
186
+ function requireReadyOnFunctions<T extends object>(
187
+ surface: T,
188
+ requireReady: (operation: string) => void,
189
+ namespace: string,
190
+ ): T {
191
+ return new Proxy(surface, {
192
+ get(target, property, receiver) {
193
+ const value = Reflect.get(target, property, receiver) as unknown;
194
+ if (typeof value !== "function") return value;
195
+ return (...args: unknown[]) => {
196
+ requireReady(`${namespace}.${String(property)}`);
197
+ return Reflect.apply(value, target, args);
198
+ };
199
+ },
200
+ });
201
+ }
202
+
203
+ function requireReadyOnModuleFunctions<T extends object>(
204
+ surface: T,
205
+ requireReady: (operation: string) => void,
206
+ namespace: string,
207
+ ): T {
208
+ return new Proxy(surface, {
209
+ get(target, property, receiver) {
210
+ const value = Reflect.get(target, property, receiver) as unknown;
211
+ if (!value || typeof value !== "object") return value;
212
+ return requireReadyOnFunctions(
213
+ value,
214
+ requireReady,
215
+ `${namespace}.${String(property)}`,
216
+ );
217
+ },
218
+ });
219
+ }
220
+
172
221
  export interface MisoOptions<Name extends string = "miso"> {
173
222
  /** Name for the client extension. Defaults to `miso`. */
174
223
  name?: Name;
@@ -178,7 +227,44 @@ export interface MisoOptions<Name extends string = "miso"> {
178
227
  graphqlClient?: SuiGraphQLClient;
179
228
  }
180
229
 
230
+ export class MisoNetworkMismatchError extends Error {
231
+ override readonly name = "MisoNetworkMismatchError";
232
+ constructor(
233
+ readonly clientNetwork: string,
234
+ readonly deploymentNetwork: string,
235
+ ) {
236
+ super(
237
+ `@misofm/sdk: client network "${clientNetwork}" does not match deployment network "${deploymentNetwork}"`,
238
+ );
239
+ }
240
+ }
241
+
242
+ export class MisoChainIdentifierMismatchError extends Error {
243
+ override readonly name = "MisoChainIdentifierMismatchError";
244
+ constructor(
245
+ readonly actual: string,
246
+ readonly expected: string,
247
+ ) {
248
+ super(
249
+ `@misofm/sdk: endpoint chain identifier "${actual}" does not match deployment chain identifier "${expected}"`,
250
+ );
251
+ }
252
+ }
253
+
254
+ export class MisoClientNotReadyError extends Error {
255
+ override readonly name = "MisoClientNotReadyError";
256
+ constructor(readonly operation: string) {
257
+ super(
258
+ `@misofm/sdk: ${operation} requires an exact-chain validation lifecycle; call and await client.miso.ready() first`,
259
+ );
260
+ }
261
+ }
262
+
181
263
  export interface MisoPlatformConfig {
264
+ /** Exact client network label for deprecated `misoPlatform()` registration. */
265
+ network?: string;
266
+ /** Exact ledger identifier required by deprecated `misoPlatform().ready()`. */
267
+ chainIdentifier?: string;
182
268
  /** Finalized immutable Record + Record Shop identities, or an explicit
183
269
  * unavailable legacy state that makes every sales API fail closed. */
184
270
  recordSales?: RecordSalesDeployment;
@@ -206,19 +292,11 @@ export interface MisoPlatformConfig {
206
292
  recordingLanguagePackageId?: string;
207
293
  recordingMasterReferencePackageId?: string;
208
294
  recordingPreviewPackageId?: string;
209
- /** Shared custody package; needed for VaultAdminCap authority orchestration. */
210
- vaultPackageId?: string;
211
- /** Shared singleton from which canonical Vault IDs are derived. */
212
- vaultRegistryId?: string;
295
+ /** Structurally complete Vault/Action/plugin identity set. */
296
+ operations?: OperationsDeployment;
213
297
  /** Generic royalty-pool value package used by pool and routed-stake helpers. */
214
298
  royaltyPoolPackageId?: string;
215
- /** Vault plugins, deliberately separate from data-extension package ids. */
216
- vaultCompositionRoyaltyPoolPluginPackageId?: string;
217
- vaultRecordingRoyaltyPoolPluginPackageId?: string;
218
- vaultPartyWalletPluginPackageId?: string;
219
- vaultCompositionRoutedStakePluginPackageId?: string;
220
299
  routedStakePackageId?: string;
221
- vaultReleaseRevenueDistributorPluginPackageId?: string;
222
300
  releaseCreditsPackageId?: string;
223
301
  misoCreditPackageId?: string;
224
302
  coverArtPackageId?: string;
@@ -289,10 +367,13 @@ export type ConfiguredReleaseGraphParams = Omit<
289
367
  export class MisoPlatformClient {
290
368
  readonly #client: ClientWithCoreApi;
291
369
  readonly #config: MisoPlatformConfig;
292
- /** The permissionless protocol layer wrapped by this platform facade. */
293
- readonly protocol?: MisoProtocolClient;
370
+ readonly #protocol?: MisoProtocolClient;
371
+ readonly #chainIdentifier?: string;
294
372
  /** Bundled/custom deployment selected for the full facade, when available. */
295
373
  readonly deployment?: MisoPlatformDeployment;
374
+ #readyState: "unvalidated" | "validating" | "ready" | "failed" =
375
+ "unvalidated";
376
+ #readyPromise?: Promise<void>;
296
377
 
297
378
  constructor(
298
379
  client: ClientWithCoreApi,
@@ -300,29 +381,113 @@ export class MisoPlatformClient {
300
381
  protocol?: MisoProtocolClient,
301
382
  deployment?: MisoPlatformDeployment,
302
383
  ) {
384
+ const configSnapshot = immutableSnapshot(config);
385
+ const deploymentSnapshot = deployment
386
+ ? immutableSnapshot(deployment)
387
+ : undefined;
303
388
  this.#client = client;
304
- this.#config = config;
389
+ this.#config = configSnapshot;
390
+ if (configSnapshot.operations?.status === "available") {
391
+ requireOperationsDeployment(configSnapshot.operations);
392
+ }
305
393
  // A pressing-only facade must not implicitly register a fail-closed core
306
394
  // extension. Supply a core deployment/misoPackageId when `protocol` is
307
395
  // needed; otherwise this remains a safe, independent pressing client.
308
- this.protocol =
396
+ this.#protocol =
309
397
  protocol ??
310
- (config.misoPackageId
398
+ (configSnapshot.misoPackageId
311
399
  ? protocolMiso({
312
- deployment: { packageId: config.misoPackageId },
400
+ deployment: { packageId: configSnapshot.misoPackageId },
313
401
  }).register(client)
314
402
  : undefined);
315
- this.deployment = deployment;
403
+ this.deployment = deploymentSnapshot;
404
+ this.#chainIdentifier =
405
+ deploymentSnapshot?.chainIdentifier ?? configSnapshot.chainIdentifier;
406
+ }
407
+
408
+ /** Permissionless protocol APIs bound to the same validated ledger. */
409
+ get protocol(): MisoProtocolClient | undefined {
410
+ if (!this.#protocol) return undefined;
411
+ this.#requireReady("protocol APIs");
412
+ return this.#protocol;
413
+ }
414
+
415
+ /**
416
+ * Memoized exact-ledger readiness gate. Registration already rejects a
417
+ * synchronous network-label mismatch; this Core API read protects every
418
+ * client-bound write surface from a mislabeled or custom endpoint.
419
+ */
420
+ ready(): Promise<void> {
421
+ if (!this.#readyPromise) {
422
+ this.#readyState = "validating";
423
+ this.#readyPromise = (async () => {
424
+ try {
425
+ if (!this.#chainIdentifier) {
426
+ throw new Error(
427
+ "misoPlatform: chain readiness requires a complete deployment or an explicit `chainIdentifier`.",
428
+ );
429
+ }
430
+ const { chainIdentifier } =
431
+ await this.#client.core.getChainIdentifier();
432
+ if (chainIdentifier !== this.#chainIdentifier) {
433
+ throw new MisoChainIdentifierMismatchError(
434
+ chainIdentifier,
435
+ this.#chainIdentifier,
436
+ );
437
+ }
438
+ this.#readyState = "ready";
439
+ } catch (error) {
440
+ this.#readyState = "failed";
441
+ throw error;
442
+ }
443
+ })();
444
+ }
445
+ return this.#readyPromise;
446
+ }
447
+
448
+ /** Compatibility hook; prefer `await client.miso.ready()`. */
449
+ async validateChainIdentifier(): Promise<string> {
450
+ await this.ready();
451
+ return this.#chainIdentifier!;
452
+ }
453
+
454
+ #requireReady(operation: string): void {
455
+ // Capability availability remains the first fail-closed boundary. This
456
+ // keeps an unavailable deployment from masquerading as a mere lifecycle
457
+ // error while still preventing configured builders from running pre-ready.
458
+ if (
459
+ operation === "ids.pressing" ||
460
+ operation === "ids.pressingAdminCap" ||
461
+ operation === "ids.record" ||
462
+ operation === "ids.listing" ||
463
+ operation === "ids.sale" ||
464
+ operation === "tx.purchaseRecord" ||
465
+ operation === "tx.openPressing" ||
466
+ operation === "tx.openListing" ||
467
+ operation === "tx.authorizeRecordShop" ||
468
+ operation === "tx.revokeRecordShop" ||
469
+ operation === "tx.setListingPrice" ||
470
+ operation === "tx.setListingState"
471
+ ) {
472
+ this.#recordSales();
473
+ }
474
+ if (operation === "ids.vault" || operation === "ids.vaultAdminCap") {
475
+ this.#operations();
476
+ }
477
+ if (this.#readyState !== "ready") {
478
+ throw new MisoClientNotReadyError(operation);
479
+ }
316
480
  }
317
481
 
318
482
  /** Party identity and profile APIs, backed by the network SDK. */
319
483
  get party(): PartyProtocolClient {
320
- if (!this.protocol) {
484
+ if (!this.#protocol) {
321
485
  throw new Error(
322
486
  "misoPlatform: Party APIs require the complete platform deployment. Use miso({ deployment }).",
323
487
  );
324
488
  }
325
- return this.protocol.party;
489
+ this.#requireReady("party APIs");
490
+ return this.#protocol.party;
326
491
  }
327
492
 
328
493
  #recordSales() {
@@ -335,6 +500,16 @@ export class MisoPlatformClient {
335
500
  );
336
501
  }
337
502
 
503
+ #operations() {
504
+ return requireOperationsDeployment(this.#config.operations);
505
+ }
506
+
507
+ #availableOperations() {
508
+ return this.#config.operations?.status === "available"
509
+ ? requireOperationsDeployment(this.#config.operations)
510
+ : undefined;
511
+ }
512
+
338
513
  get recordPackageId(): string {
339
514
  return this.#recordSales().recordPackageId;
340
515
  }
@@ -388,25 +563,29 @@ export class MisoPlatformClient {
388
563
  // ── Reads ─────────────────────────────────────────────────────────────────
389
564
 
390
565
  /** The run itself, or `null` if this release has never opened one. */
391
- getPressing(pressingId: string): Promise<PressingView | null> {
566
+ async getPressing(pressingId: string): Promise<PressingView | null> {
567
+ await this.ready();
392
568
  return getPressing(this.#client, pressingId, this.recordPackageId);
393
569
  }
394
570
 
395
571
  /** One currency's offer, or `null` if the run does not sell in it. */
396
- getListing(listingId: string): Promise<ListingView | null> {
572
+ async getListing(listingId: string): Promise<ListingView | null> {
573
+ await this.ready();
397
574
  return getListing(this.#client, listingId, this.recordShopPackageId);
398
575
  }
399
576
 
400
577
  /** One concrete purchased Record, including immutable purchase provenance. */
401
- getRecord(recordId: string): Promise<RecordView | null> {
578
+ async getRecord(recordId: string): Promise<RecordView | null> {
579
+ await this.ready();
402
580
  return getRecord(this.#client, recordId, this.recordPackageId);
403
581
  }
404
582
 
405
583
  /** Run + one currency's offer in a single round trip, by address math. */
406
- getSale(p: Configured<GetSaleParams>): Promise<{
584
+ async getSale(p: Configured<GetSaleParams>): Promise<{
407
585
  pressing: PressingView | null;
408
586
  listing: ListingView | null;
409
587
  }> {
588
+ await this.ready();
410
589
  return getSale(this.#client, {
411
590
  ...p,
412
591
  recordPackageId: this.recordPackageId,
@@ -416,7 +595,7 @@ export class MisoPlatformClient {
416
595
 
417
596
  // ── Address math ──────────────────────────────────────────────────────────
418
597
 
419
- readonly ids = {
598
+ readonly ids = requireReadyOnFunctions({
420
599
  pressing: (releaseId: string, edition: number) =>
421
600
  derivePressingId(releaseId, edition, this.recordPackageId),
422
601
  pressingAdminCap: (pressingId: string) =>
@@ -435,21 +614,15 @@ export class MisoPlatformClient {
435
614
  ),
436
615
  vault: (capId: string, capType: string) =>
437
616
  vaultActions.deriveVaultId({
438
- vaultRegistryId: this.#requiredConfig(
439
- "vaultRegistryId",
440
- "Vault ID derivation",
441
- ),
617
+ vaultRegistryId: this.#operations().vault.registryId,
442
618
  capId,
443
619
  capType,
444
- vaultPackageId: this.#requiredConfig(
445
- "vaultPackageId",
446
- "Vault ID derivation",
447
- ),
620
+ vaultPackageId: this.#operations().vault.packageId,
448
621
  }),
449
622
  vaultAdminCap: (vaultId: string) =>
450
623
  vaultActions.deriveVaultAdminCapId(
451
624
  vaultId,
452
- this.#requiredConfig("vaultPackageId", "VaultAdminCap ID derivation"),
625
+ this.#operations().vault.packageId,
453
626
  ),
454
627
  genre: (canonicalName: string) =>
455
628
  deriveGenreAddress(
@@ -457,11 +630,13 @@ export class MisoPlatformClient {
457
630
  this.#requiredConfig("genrePackageId", "genre id derivation"),
458
631
  canonicalName,
459
632
  ),
460
- };
633
+ }, (operation) => this.#requireReady(operation), "ids");
461
634
 
462
635
  // ── Transaction builders ──────────────────────────────────────────────────
463
636
 
464
- readonly tx = {
637
+ /** Client-bound builders require a successful `await client.miso.ready()`.
638
+ * Standalone exports remain pure for explicitly managed offline workflows. */
639
+ readonly tx = requireReadyOnFunctions({
465
640
  purchaseRecord: (p: Configured<PurchaseRecordParams>): TxThunk =>
466
641
  purchaseRecord({
467
642
  ...p,
@@ -611,14 +786,18 @@ export class MisoPlatformClient {
611
786
  "setReleaseTrackCover",
612
787
  ),
613
788
  }),
614
- };
789
+ }, (operation) => this.#requireReady(operation), "tx");
615
790
 
616
791
  /**
617
792
  * Vault-aware builders and parsers. These take explicit object ids because a
618
793
  * VaultAdminCap is owner-held while the Vault is shared; package ids can come
619
794
  * from the deployment config or be supplied for private deployments.
620
795
  */
621
- readonly vault = vaultActions;
796
+ get vault(): typeof vaultActions | undefined {
797
+ if (!this.#availableOperations()) return undefined;
798
+ this.#requireReady("vault builders");
799
+ return vaultActions;
800
+ }
622
801
 
623
802
  // ── Share currency provisioning (executes; Signer pattern) ─────────────────
624
803
 
@@ -627,9 +806,19 @@ export class MisoPlatformClient {
627
806
  signer: Signer,
628
807
  params: share.CreateShareCurrencyParams,
629
808
  ): Promise<share.ShareCurrency> {
809
+ await this.ready();
630
810
  return share.createShareCurrency(this.#client, signer, params);
631
811
  }
632
812
 
813
+ /** Execute a composed platform PTB only after exact-ledger validation. */
814
+ async executeViaExecutor(
815
+ executor: ParallelTransactionExecutor,
816
+ ...thunks: TxThunk[]
817
+ ): Promise<PlatformExecResult> {
818
+ await this.ready();
819
+ return executePlatformViaExecutor(executor, ...thunks);
820
+ }
821
+
633
822
  // ── Generated layer ───────────────────────────────────────────────────────
634
823
 
635
824
  /** Generated Move-call bindings, for commands this facade doesn't wrap. */
@@ -638,7 +827,8 @@ export class MisoPlatformClient {
638
827
  this.#config.recordSales?.status === "available"
639
828
  ? this.#config.recordSales
640
829
  : undefined;
641
- return {
830
+ const operations = this.#availableOperations();
831
+ return requireReadyOnModuleFunctions({
642
832
  record: sales
643
833
  ? bindModulePackage(recordContract, sales.recordPackageId, [
644
834
  "destroy",
@@ -755,102 +945,94 @@ export class MisoPlatformClient {
755
945
  ["setKind", "unsetKind", "hasKind"] as const,
756
946
  )
757
947
  : undefined,
758
- releaseRevenueDistributor: this.#config
759
- .vaultReleaseRevenueDistributorPluginPackageId
948
+ releaseRevenueDistributor: operations
760
949
  ? bindModulePackage(
761
950
  releaseRevenueDistributorContract,
762
- this.#config.vaultReleaseRevenueDistributorPluginPackageId,
951
+ operations.actions.releaseRevenueDistributor,
952
+ [
953
+ "redeemAndDistribute",
954
+ "redeemAllAndDistribute",
955
+ "receiveAndDistribute",
956
+ ] as const,
957
+ )
958
+ : undefined,
959
+ releaseRevenueDistributorPlugin: operations
960
+ ? bindModulePackage(
961
+ releaseRevenueDistributorPluginContract,
962
+ operations.plugins.releaseRevenueDistributor,
763
963
  [
764
964
  "install",
765
965
  "uninstall",
766
- "redeemAndDistribute",
966
+ "redeemAllAndDistribute",
767
967
  "receiveAndDistribute",
768
968
  "isInstalled",
769
969
  ] as const,
770
970
  )
771
971
  : undefined,
772
- vault: this.#config.vaultPackageId
773
- ? bindModulePackage(vaultContract, this.#config.vaultPackageId, [
972
+ vault: operations
973
+ ? bindModulePackage(vaultContract, operations.vault.packageId, [
774
974
  "share",
775
- "transferAdminCap",
776
975
  "withdrawCap",
777
976
  "restoreCap",
778
- "vaultAddress",
779
- "vaultAdminCapAddress",
780
- "vaultId",
977
+ "derivedAddress",
781
978
  "capId",
782
- "isOccupied",
783
- "authorizedPluginsId",
784
- "authorizedPluginCount",
979
+ "isActive",
980
+ "authorizedPlugins",
785
981
  "isPluginAuthorized",
786
982
  ] as const)
787
983
  : undefined,
788
- compositionRoyaltyPool: this.#config
789
- .vaultCompositionRoyaltyPoolPluginPackageId
984
+ compositionRoyaltyPool: operations
790
985
  ? bindModulePackage(
791
986
  compositionRoyaltyPoolContract,
792
- this.#config.vaultCompositionRoyaltyPoolPluginPackageId,
987
+ operations.actions.compositionRoyaltyPool,
988
+ ["newPool", "receiveAndDeposit", "redeemAndDeposit", "poolAddress"] as const,
989
+ )
990
+ : undefined,
991
+ compositionRoyaltyPoolPlugin: operations
992
+ ? bindModulePackage(
993
+ compositionRoyaltyPoolPluginContract,
994
+ operations.plugins.compositionRoyaltyPool,
793
995
  [
794
996
  "install",
795
997
  "uninstall",
796
- "newPool",
797
- "initializePool",
798
998
  "receiveAndDeposit",
799
999
  "redeemAndDeposit",
800
1000
  "isInstalled",
801
- "poolAddress",
802
1001
  ] as const,
803
1002
  )
804
1003
  : undefined,
805
- recordingRoyaltyPool: this.#config
806
- .vaultRecordingRoyaltyPoolPluginPackageId
1004
+ recordingRoyaltyPool: operations
807
1005
  ? bindModulePackage(
808
1006
  recordingRoyaltyPoolContract,
809
- this.#config.vaultRecordingRoyaltyPoolPluginPackageId,
1007
+ operations.actions.recordingRoyaltyPool,
1008
+ ["newPool", "receiveAndDeposit", "redeemAndDeposit", "poolAddress"] as const,
1009
+ )
1010
+ : undefined,
1011
+ recordingRoyaltyPoolPlugin: operations
1012
+ ? bindModulePackage(
1013
+ recordingRoyaltyPoolPluginContract,
1014
+ operations.plugins.recordingRoyaltyPool,
810
1015
  [
811
1016
  "install",
812
1017
  "uninstall",
813
- "newPool",
814
- "initializePool",
815
1018
  "receiveAndDeposit",
816
1019
  "redeemAndDeposit",
817
1020
  "isInstalled",
818
- "poolAddress",
819
1021
  ] as const,
820
1022
  )
821
1023
  : undefined,
822
- partyWallet: this.#config.vaultPartyWalletPluginPackageId
1024
+ partyWallet: operations
823
1025
  ? bindModulePackage(
824
1026
  partyWalletContract,
825
- this.#config.vaultPartyWalletPluginPackageId,
826
- [
827
- "install",
828
- "uninstall",
829
- "receiveObject",
830
- "receiveObjects",
831
- "receiveCoins",
832
- "redeemBalance",
833
- "isInstalled",
834
- "inboxAddress",
835
- ] as const,
1027
+ operations.actions.partyWallet,
1028
+ ["receive", "receiveBalance", "redeemBalance", "inboxAddress"] as const,
836
1029
  )
837
1030
  : undefined,
838
- compositionRoutedStake: this.#config
839
- .vaultCompositionRoutedStakePluginPackageId
1031
+ compositionRoutedStake: operations
840
1032
  ? bindModulePackage(
841
1033
  compositionRoutedStakeContract,
842
- this.#config.vaultCompositionRoutedStakePluginPackageId,
843
- [
844
- "install",
845
- "uninstall",
846
- "createStake",
847
- "register",
848
- "unregister",
849
- "unstake",
850
- "restake",
851
- "isInstalled",
852
- "stakeAddress",
853
- ] as const,
1034
+ operations.actions.compositionRoutedStake,
1035
+ ["createStake", "register", "unregister", "unstake", "restake", "stakeAddress"] as const,
854
1036
  )
855
1037
  : undefined,
856
1038
  routedStake: this.#config.routedStakePackageId
@@ -964,7 +1146,7 @@ export class MisoPlatformClient {
964
1146
  ["addCredit", "removeCredit", "hasCredits"] as const,
965
1147
  )
966
1148
  : undefined,
967
- };
1149
+ }, (operation) => this.#requireReady(operation), "call");
968
1150
  }
969
1151
 
970
1152
  /** Generated BCS definitions, for parsing objects or events yourself. */
@@ -992,6 +1174,11 @@ export class MisoPlatformClient {
992
1174
  VaultCreatedEvent: vaultContract.VaultCreatedEvent,
993
1175
  VaultCapabilityWithdrawnEvent: vaultContract.VaultCapabilityWithdrawnEvent,
994
1176
  VaultCapabilityRestoredEvent: vaultContract.VaultCapabilityRestoredEvent,
1177
+ PartyObjectReceivedEvent: partyWalletContract.ObjectReceivedEvent,
1178
+ PartyCoinsReceivedEvent: partyWalletContract.CoinsReceivedEvent,
1179
+ PartyFundsRedeemedEvent: partyWalletContract.FundsRedeemedEvent,
1180
+ ReleaseTrackRevenueDistributedEvent:
1181
+ releaseRevenueDistributorContract.ReleaseTrackRevenueDistributedEvent,
995
1182
  ReleaseRevenueDistributedEvent:
996
1183
  releaseRevenueDistributorContract.ReleaseRevenueDistributedEvent,
997
1184
  };
@@ -1013,8 +1200,12 @@ export function miso<const Name extends string = "miso">(
1013
1200
  return {
1014
1201
  name,
1015
1202
  register: (client: ClientWithCoreApi) => {
1016
- const deployment =
1017
- options.deployment ?? getMisoPlatformDeployment(client.network);
1203
+ const deployment = immutableSnapshot(
1204
+ options.deployment ?? getMisoPlatformDeployment(client.network),
1205
+ );
1206
+ if (deployment.network !== client.network) {
1207
+ throw new MisoNetworkMismatchError(client.network, deployment.network);
1208
+ }
1018
1209
  const protocol = protocolMiso({
1019
1210
  deployment: deployment.protocol,
1020
1211
  graphqlClient: options.graphqlClient,
@@ -1035,20 +1226,9 @@ export function miso<const Name extends string = "miso">(
1035
1226
  recordingMasterReferencePackageId:
1036
1227
  deployment.packages.recordingMasterReference,
1037
1228
  recordingPreviewPackageId: deployment.packages.recordingPreview,
1038
- vaultPackageId: deployment.packages.vault,
1039
- vaultRegistryId: deployment.objects.vaultRegistry,
1229
+ operations: deployment.operations,
1040
1230
  royaltyPoolPackageId: deployment.packages.royaltyPool,
1041
- vaultCompositionRoyaltyPoolPluginPackageId:
1042
- deployment.packages.vaultCompositionRoyaltyPoolPlugin,
1043
- vaultRecordingRoyaltyPoolPluginPackageId:
1044
- deployment.packages.vaultRecordingRoyaltyPoolPlugin,
1045
- vaultPartyWalletPluginPackageId:
1046
- deployment.packages.vaultPartyWalletPlugin,
1047
- vaultCompositionRoutedStakePluginPackageId:
1048
- deployment.packages.vaultCompositionRoutedStakePlugin,
1049
1231
  routedStakePackageId: deployment.packages.routedStake,
1050
- vaultReleaseRevenueDistributorPluginPackageId:
1051
- deployment.packages.vaultReleaseRevenueDistributorPlugin,
1052
1232
  releaseCreditsPackageId: deployment.packages.releaseCredits,
1053
1233
  misoCreditPackageId: deployment.packages.credit,
1054
1234
  coverArtPackageId: deployment.packages.coverArt,
@@ -1072,12 +1252,16 @@ export function misoPlatform(config: MisoPlatformConfig) {
1072
1252
  return {
1073
1253
  name: "misoPlatform" as const,
1074
1254
  register: (client: ClientWithCoreApi) => {
1075
- const protocol = config.misoPackageId
1255
+ const configSnapshot = immutableSnapshot(config);
1256
+ if (configSnapshot.network && configSnapshot.network !== client.network) {
1257
+ throw new MisoNetworkMismatchError(client.network, configSnapshot.network);
1258
+ }
1259
+ const protocol = configSnapshot.misoPackageId
1076
1260
  ? protocolMiso({
1077
- deployment: { packageId: config.misoPackageId },
1261
+ deployment: { packageId: configSnapshot.misoPackageId },
1078
1262
  }).register(client)
1079
1263
  : undefined;
1080
- return new MisoPlatformClient(client, config, protocol);
1264
+ return new MisoPlatformClient(client, configSnapshot, protocol);
1081
1265
  },
1082
1266
  };
1083
1267
  }
@@ -5,14 +5,14 @@
5
5
 
6
6
  /**
7
7
  * First-party credits extension for compositions.
8
- *
8
+ *
9
9
  * Attribution (writing credits) is display-oriented and varies across platforms,
10
10
  * so it lives here as a dynamic field on the composition rather than in immutable
11
11
  * core. The data is attached under `ExtensionKey()` via the composition's
12
12
  * cap-gated `uid_mut`, so every mutation is authorized by the composition's admin
13
13
  * and credits survive into any lifecycle state (they may be attached before or
14
14
  * after the composition is published).
15
- *
15
+ *
16
16
  * This is Miso's canonical credits standard; because it is an extension, other
17
17
  * parties may publish their own composition-credits standard against the same
18
18
  * `Composition`. Credits are NOT read by the economics — they are attribution.
@@ -20,6 +20,7 @@
20
20
 
21
21
  import { MoveTuple, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
22
22
  import { bcs } from '@mysten/sui/bcs';
23
+ import type {} from "@mysten/bcs";
23
24
  import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
24
25
  import * as vec_map from './deps/sui/vec_map.js';
25
26
  import * as credit from './deps/miso_credit/credit.js';