@misonetwork/sdk 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/README.md +181 -124
  2. package/dist/client.d.ts +1229 -15
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +43 -21
  5. package/dist/client.js.map +1 -1
  6. package/dist/contracts/composition_credits/composition_credits.d.ts +181 -0
  7. package/dist/contracts/composition_credits/composition_credits.d.ts.map +1 -0
  8. package/dist/contracts/composition_credits/composition_credits.js +109 -0
  9. package/dist/contracts/composition_credits/composition_credits.js.map +1 -0
  10. package/dist/contracts/composition_credits/composition_party_role.d.ts +119 -0
  11. package/dist/contracts/composition_credits/composition_party_role.d.ts.map +1 -0
  12. package/dist/contracts/composition_credits/composition_party_role.js +139 -0
  13. package/dist/contracts/composition_credits/composition_party_role.js.map +1 -0
  14. package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts +24 -0
  15. package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts.map +1 -0
  16. package/dist/contracts/composition_credits/deps/miso_credit/credit.js +23 -0
  17. package/dist/contracts/composition_credits/deps/miso_credit/credit.js.map +1 -0
  18. package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts +37 -0
  19. package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts.map +1 -0
  20. package/dist/contracts/composition_credits/deps/sui/vec_map.js +28 -0
  21. package/dist/contracts/composition_credits/deps/sui/vec_map.js.map +1 -0
  22. package/dist/contracts/miso/composition.d.ts +17 -39
  23. package/dist/contracts/miso/composition.d.ts.map +1 -1
  24. package/dist/contracts/miso/composition.js +18 -39
  25. package/dist/contracts/miso/composition.js.map +1 -1
  26. package/dist/contracts/miso/deps/bps/bps.d.ts +1 -1
  27. package/dist/contracts/miso/deps/bps/bps.js +1 -1
  28. package/dist/contracts/miso/recording.d.ts +44 -19
  29. package/dist/contracts/miso/recording.d.ts.map +1 -1
  30. package/dist/contracts/miso/recording.js +46 -20
  31. package/dist/contracts/miso/recording.js.map +1 -1
  32. package/dist/contracts/miso/release.d.ts +63 -37
  33. package/dist/contracts/miso/release.d.ts.map +1 -1
  34. package/dist/contracts/miso/release.js +65 -38
  35. package/dist/contracts/miso/release.js.map +1 -1
  36. package/dist/contracts/miso/track.d.ts +41 -10
  37. package/dist/contracts/miso/track.d.ts.map +1 -1
  38. package/dist/contracts/miso/track.js +44 -10
  39. package/dist/contracts/miso/track.js.map +1 -1
  40. package/dist/contracts/recording_advisory/recording_advisory.d.ts +194 -0
  41. package/dist/contracts/recording_advisory/recording_advisory.d.ts.map +1 -0
  42. package/dist/contracts/recording_advisory/recording_advisory.js +204 -0
  43. package/dist/contracts/recording_advisory/recording_advisory.js.map +1 -0
  44. package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts +24 -0
  45. package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts.map +1 -0
  46. package/dist/contracts/recording_credits/deps/miso_credit/credit.js +23 -0
  47. package/dist/contracts/recording_credits/deps/miso_credit/credit.js.map +1 -0
  48. package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts +37 -0
  49. package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts.map +1 -0
  50. package/dist/contracts/recording_credits/deps/sui/vec_map.js +28 -0
  51. package/dist/contracts/recording_credits/deps/sui/vec_map.js.map +1 -0
  52. package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts +21 -0
  53. package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts.map +1 -0
  54. package/dist/contracts/recording_credits/deps/sui/vec_set.js +20 -0
  55. package/dist/contracts/recording_credits/deps/sui/vec_set.js.map +1 -0
  56. package/dist/contracts/recording_credits/recording_credits.d.ts +2313 -0
  57. package/dist/contracts/recording_credits/recording_credits.d.ts.map +1 -0
  58. package/dist/contracts/recording_credits/recording_credits.js +270 -0
  59. package/dist/contracts/recording_credits/recording_credits.js.map +1 -0
  60. package/dist/contracts/recording_credits/recording_party_role.d.ts +1174 -0
  61. package/dist/contracts/recording_credits/recording_party_role.d.ts.map +1 -0
  62. package/dist/contracts/recording_credits/recording_party_role.js +692 -0
  63. package/dist/contracts/recording_credits/recording_party_role.js.map +1 -0
  64. package/dist/contracts/recording_language/deps/language_code/language_code.d.ts +6 -0
  65. package/dist/contracts/recording_language/deps/language_code/language_code.d.ts.map +1 -0
  66. package/dist/contracts/recording_language/deps/language_code/language_code.js +8 -0
  67. package/dist/contracts/recording_language/deps/language_code/language_code.js.map +1 -0
  68. package/dist/contracts/recording_language/recording_language.d.ts +152 -0
  69. package/dist/contracts/recording_language/recording_language.d.ts.map +1 -0
  70. package/dist/contracts/recording_language/recording_language.js +149 -0
  71. package/dist/contracts/recording_language/recording_language.js.map +1 -0
  72. package/dist/contracts/recording_master_reference/deps/ori/walrus_data.d.ts +52 -0
  73. package/dist/contracts/recording_master_reference/deps/ori/walrus_data.d.ts.map +1 -0
  74. package/dist/contracts/recording_master_reference/deps/ori/walrus_data.js +37 -0
  75. package/dist/contracts/recording_master_reference/deps/ori/walrus_data.js.map +1 -0
  76. package/dist/contracts/recording_master_reference/recording_master_reference.d.ts +131 -0
  77. package/dist/contracts/recording_master_reference/recording_master_reference.d.ts.map +1 -0
  78. package/dist/contracts/recording_master_reference/recording_master_reference.js +121 -0
  79. package/dist/contracts/recording_master_reference/recording_master_reference.js.map +1 -0
  80. package/dist/contracts/recording_preview/deps/ori/walrus_data.d.ts +52 -0
  81. package/dist/contracts/recording_preview/deps/ori/walrus_data.d.ts.map +1 -0
  82. package/dist/contracts/recording_preview/deps/ori/walrus_data.js +37 -0
  83. package/dist/contracts/recording_preview/deps/ori/walrus_data.js.map +1 -0
  84. package/dist/contracts/recording_preview/recording_preview.d.ts +104 -0
  85. package/dist/contracts/recording_preview/recording_preview.d.ts.map +1 -0
  86. package/dist/contracts/recording_preview/recording_preview.js +94 -0
  87. package/dist/contracts/recording_preview/recording_preview.js.map +1 -0
  88. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts +52 -0
  89. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts.map +1 -0
  90. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js +37 -0
  91. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js.map +1 -0
  92. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts +46 -0
  93. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts.map +1 -0
  94. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js +21 -0
  95. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js.map +1 -0
  96. package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts +33 -0
  97. package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts.map +1 -0
  98. package/dist/contracts/release_cover_art/deps/per_track/per_track.js +32 -0
  99. package/dist/contracts/release_cover_art/deps/per_track/per_track.js.map +1 -0
  100. package/dist/contracts/release_cover_art/release_cover_art.d.ts +300 -0
  101. package/dist/contracts/release_cover_art/release_cover_art.d.ts.map +1 -0
  102. package/dist/contracts/release_cover_art/release_cover_art.js +168 -0
  103. package/dist/contracts/release_cover_art/release_cover_art.js.map +1 -0
  104. package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts +24 -0
  105. package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts.map +1 -0
  106. package/dist/contracts/release_credits/deps/miso_credit/credit.js +23 -0
  107. package/dist/contracts/release_credits/deps/miso_credit/credit.js.map +1 -0
  108. package/dist/contracts/release_credits/deps/sui/vec_map.d.ts +37 -0
  109. package/dist/contracts/release_credits/deps/sui/vec_map.d.ts.map +1 -0
  110. package/dist/contracts/release_credits/deps/sui/vec_map.js +28 -0
  111. package/dist/contracts/release_credits/deps/sui/vec_map.js.map +1 -0
  112. package/dist/contracts/release_credits/release_credits.d.ts +142 -0
  113. package/dist/contracts/release_credits/release_credits.d.ts.map +1 -0
  114. package/dist/contracts/release_credits/release_credits.js +108 -0
  115. package/dist/contracts/release_credits/release_credits.js.map +1 -0
  116. package/dist/contracts/release_credits/release_party_role.d.ts +58 -0
  117. package/dist/contracts/release_credits/release_party_role.d.ts.map +1 -0
  118. package/dist/contracts/release_credits/release_party_role.js +66 -0
  119. package/dist/contracts/release_credits/release_party_role.js.map +1 -0
  120. package/dist/contracts/release_description/release_description.d.ts +112 -0
  121. package/dist/contracts/release_description/release_description.d.ts.map +1 -0
  122. package/dist/contracts/release_description/release_description.js +123 -0
  123. package/dist/contracts/release_description/release_description.js.map +1 -0
  124. package/dist/contracts/release_dsp_link/release_dsp_link.d.ts +644 -0
  125. package/dist/contracts/release_dsp_link/release_dsp_link.d.ts.map +1 -0
  126. package/dist/contracts/release_dsp_link/release_dsp_link.js +556 -0
  127. package/dist/contracts/release_dsp_link/release_dsp_link.js.map +1 -0
  128. package/dist/contracts/release_genre/deps/per_track/per_track.d.ts +33 -0
  129. package/dist/contracts/release_genre/deps/per_track/per_track.d.ts.map +1 -0
  130. package/dist/contracts/release_genre/deps/per_track/per_track.js +32 -0
  131. package/dist/contracts/release_genre/deps/per_track/per_track.js.map +1 -0
  132. package/dist/contracts/release_genre/release_genre.d.ts +193 -0
  133. package/dist/contracts/release_genre/release_genre.d.ts.map +1 -0
  134. package/dist/contracts/release_genre/release_genre.js +207 -0
  135. package/dist/contracts/release_genre/release_genre.js.map +1 -0
  136. package/dist/contracts/release_kind/release_kind.d.ts +98 -0
  137. package/dist/contracts/release_kind/release_kind.d.ts.map +1 -0
  138. package/dist/contracts/release_kind/release_kind.js +109 -0
  139. package/dist/contracts/release_kind/release_kind.js.map +1 -0
  140. package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.d.ts +52 -0
  141. package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.d.ts.map +1 -0
  142. package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.js +37 -0
  143. package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.js.map +1 -0
  144. package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.d.ts +91 -0
  145. package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.d.ts.map +1 -0
  146. package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.js +91 -0
  147. package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.js.map +1 -0
  148. package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts +54 -0
  149. package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts.map +1 -0
  150. package/dist/contracts/routed_stake/deps/royalty_pool/stake.js +37 -0
  151. package/dist/contracts/routed_stake/deps/royalty_pool/stake.js.map +1 -0
  152. package/dist/contracts/routed_stake/deps/std/type_name.d.ts +18 -0
  153. package/dist/contracts/routed_stake/deps/std/type_name.d.ts.map +1 -0
  154. package/dist/contracts/routed_stake/deps/std/type_name.js +20 -0
  155. package/dist/contracts/routed_stake/deps/std/type_name.js.map +1 -0
  156. package/dist/contracts/routed_stake/deps/sui/balance.d.ts +13 -0
  157. package/dist/contracts/routed_stake/deps/sui/balance.d.ts.map +1 -0
  158. package/dist/contracts/routed_stake/deps/sui/balance.js +15 -0
  159. package/dist/contracts/routed_stake/deps/sui/balance.js.map +1 -0
  160. package/dist/contracts/routed_stake/deps/sui/vec_map.d.ts +37 -0
  161. package/dist/contracts/routed_stake/deps/sui/vec_map.d.ts.map +1 -0
  162. package/dist/contracts/routed_stake/deps/sui/vec_map.js +28 -0
  163. package/dist/contracts/routed_stake/deps/sui/vec_map.js.map +1 -0
  164. package/dist/contracts/routed_stake/routed_stake.d.ts +356 -0
  165. package/dist/contracts/routed_stake/routed_stake.d.ts.map +1 -0
  166. package/dist/contracts/routed_stake/routed_stake.js +311 -0
  167. package/dist/contracts/routed_stake/routed_stake.js.map +1 -0
  168. package/dist/contracts/royalty_pool/deps/std/type_name.d.ts +18 -0
  169. package/dist/contracts/royalty_pool/deps/std/type_name.d.ts.map +1 -0
  170. package/dist/contracts/royalty_pool/deps/std/type_name.js +20 -0
  171. package/dist/contracts/royalty_pool/deps/std/type_name.js.map +1 -0
  172. package/dist/contracts/royalty_pool/deps/sui/balance.d.ts +13 -0
  173. package/dist/contracts/royalty_pool/deps/sui/balance.d.ts.map +1 -0
  174. package/dist/contracts/royalty_pool/deps/sui/balance.js +15 -0
  175. package/dist/contracts/royalty_pool/deps/sui/balance.js.map +1 -0
  176. package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts +37 -0
  177. package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts.map +1 -0
  178. package/dist/contracts/royalty_pool/deps/sui/vec_map.js +28 -0
  179. package/dist/contracts/royalty_pool/deps/sui/vec_map.js.map +1 -0
  180. package/dist/contracts/royalty_pool/pool.d.ts +394 -0
  181. package/dist/contracts/royalty_pool/pool.d.ts.map +1 -0
  182. package/dist/contracts/royalty_pool/pool.js +387 -0
  183. package/dist/contracts/royalty_pool/pool.js.map +1 -0
  184. package/dist/contracts/royalty_pool/stake.d.ts +202 -0
  185. package/dist/contracts/royalty_pool/stake.d.ts.map +1 -0
  186. package/dist/contracts/royalty_pool/stake.js +197 -0
  187. package/dist/contracts/royalty_pool/stake.js.map +1 -0
  188. package/dist/contracts.d.ts +37 -3
  189. package/dist/contracts.d.ts.map +1 -1
  190. package/dist/contracts.js +42 -8
  191. package/dist/contracts.js.map +1 -1
  192. package/dist/deployments.d.ts +46 -12
  193. package/dist/deployments.d.ts.map +1 -1
  194. package/dist/deployments.js +119 -11
  195. package/dist/deployments.js.map +1 -1
  196. package/dist/events.d.ts +1081 -0
  197. package/dist/events.d.ts.map +1 -0
  198. package/dist/events.js +124 -0
  199. package/dist/events.js.map +1 -0
  200. package/dist/execute.d.ts.map +1 -1
  201. package/dist/execute.js +0 -4
  202. package/dist/execute.js.map +1 -1
  203. package/dist/index.d.ts +3 -0
  204. package/dist/index.d.ts.map +1 -1
  205. package/dist/index.js +6 -3
  206. package/dist/index.js.map +1 -1
  207. package/dist/internal.d.ts.map +1 -1
  208. package/dist/internal.js +2 -0
  209. package/dist/internal.js.map +1 -1
  210. package/dist/numeric.d.ts +5 -0
  211. package/dist/numeric.d.ts.map +1 -0
  212. package/dist/numeric.js +21 -0
  213. package/dist/numeric.js.map +1 -0
  214. package/dist/packages.d.ts +159 -0
  215. package/dist/packages.d.ts.map +1 -0
  216. package/dist/packages.js +179 -0
  217. package/dist/packages.js.map +1 -0
  218. package/dist/parsers.d.ts +5 -2
  219. package/dist/parsers.d.ts.map +1 -1
  220. package/dist/parsers.js +19 -7
  221. package/dist/parsers.js.map +1 -1
  222. package/dist/queries.d.ts +92 -0
  223. package/dist/queries.d.ts.map +1 -1
  224. package/dist/queries.js +132 -23
  225. package/dist/queries.js.map +1 -1
  226. package/dist/transactions.d.ts +96 -12
  227. package/dist/transactions.d.ts.map +1 -1
  228. package/dist/transactions.js +124 -14
  229. package/dist/transactions.js.map +1 -1
  230. package/dist/types.d.ts +35 -8
  231. package/dist/types.d.ts.map +1 -1
  232. package/dist/view.d.ts +6 -5
  233. package/dist/view.d.ts.map +1 -1
  234. package/dist/view.js +8 -2
  235. package/dist/view.js.map +1 -1
  236. package/package.json +14 -4
  237. package/src/client.ts +57 -25
  238. package/src/contracts/composition_credits/composition_credits.ts +169 -0
  239. package/src/contracts/composition_credits/composition_party_role.ts +189 -0
  240. package/src/contracts/composition_credits/deps/miso_credit/credit.ts +27 -0
  241. package/src/contracts/composition_credits/deps/sui/vec_map.ts +33 -0
  242. package/src/contracts/miso/composition.ts +24 -61
  243. package/src/contracts/miso/deps/bps/bps.ts +3 -3
  244. package/src/contracts/miso/recording.ts +69 -32
  245. package/src/contracts/miso/release.ts +103 -67
  246. package/src/contracts/miso/track.ts +56 -13
  247. package/src/contracts/recording_advisory/recording_advisory.ts +315 -0
  248. package/src/contracts/recording_credits/deps/miso_credit/credit.ts +27 -0
  249. package/src/contracts/recording_credits/deps/sui/vec_map.ts +33 -0
  250. package/src/contracts/recording_credits/deps/sui/vec_set.ts +21 -0
  251. package/src/contracts/recording_credits/recording_credits.ts +458 -0
  252. package/src/contracts/recording_credits/recording_party_role.ts +1041 -0
  253. package/src/contracts/recording_language/deps/language_code/language_code.ts +7 -0
  254. package/src/contracts/recording_language/recording_language.ts +237 -0
  255. package/src/contracts/recording_master_reference/deps/ori/walrus_data.ts +36 -0
  256. package/src/contracts/recording_master_reference/recording_master_reference.ts +181 -0
  257. package/src/contracts/recording_preview/deps/ori/walrus_data.ts +36 -0
  258. package/src/contracts/recording_preview/recording_preview.ts +154 -0
  259. package/src/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.ts +36 -0
  260. package/src/contracts/release_cover_art/deps/cover_art/cover_art.ts +23 -0
  261. package/src/contracts/release_cover_art/deps/per_track/per_track.ts +36 -0
  262. package/src/contracts/release_cover_art/release_cover_art.ts +251 -0
  263. package/src/contracts/release_credits/deps/miso_credit/credit.ts +27 -0
  264. package/src/contracts/release_credits/deps/sui/vec_map.ts +33 -0
  265. package/src/contracts/release_credits/release_credits.ts +156 -0
  266. package/src/contracts/release_credits/release_party_role.ts +87 -0
  267. package/src/contracts/release_description/release_description.ts +167 -0
  268. package/src/contracts/release_dsp_link/release_dsp_link.ts +813 -0
  269. package/src/contracts/release_genre/deps/per_track/per_track.ts +36 -0
  270. package/src/contracts/release_genre/release_genre.ts +314 -0
  271. package/src/contracts/release_kind/release_kind.ts +153 -0
  272. package/src/contracts/release_snapshot_bundle/deps/ori/walrus_data.ts +36 -0
  273. package/src/contracts/release_snapshot_bundle/release_snapshot_bundle.ts +124 -0
  274. package/src/contracts/routed_stake/deps/royalty_pool/stake.ts +39 -0
  275. package/src/contracts/routed_stake/deps/std/type_name.ts +22 -0
  276. package/src/contracts/routed_stake/deps/sui/balance.ts +17 -0
  277. package/src/contracts/routed_stake/deps/sui/vec_map.ts +33 -0
  278. package/src/contracts/routed_stake/routed_stake.ts +508 -0
  279. package/src/contracts/royalty_pool/deps/std/type_name.ts +22 -0
  280. package/src/contracts/royalty_pool/deps/sui/balance.ts +17 -0
  281. package/src/contracts/royalty_pool/deps/sui/vec_map.ts +33 -0
  282. package/src/contracts/royalty_pool/pool.ts +613 -0
  283. package/src/contracts/royalty_pool/stake.ts +317 -0
  284. package/src/contracts.ts +59 -6
  285. package/src/deployments.ts +160 -22
  286. package/src/events.ts +129 -0
  287. package/src/execute.ts +0 -4
  288. package/src/index.ts +6 -3
  289. package/src/internal.ts +2 -4
  290. package/src/numeric.ts +25 -0
  291. package/src/packages.ts +251 -0
  292. package/src/parsers.ts +32 -11
  293. package/src/queries.ts +227 -25
  294. package/src/transactions.ts +255 -23
  295. package/src/types.ts +37 -9
  296. package/src/view.ts +12 -6
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@misonetwork/sdk",
3
- "version": "0.6.0",
4
- "description": "Typed query helpers and transaction builders for the Miso protocol core on Sui.",
3
+ "version": "0.8.0",
4
+ "packageManager": "bun@1.4.0",
5
+ "description": "Typed bindings, queries, event decoders, and PTB builders for the Miso protocol package set on Sui.",
5
6
  "license": "Apache-2.0",
6
7
  "repository": {
7
8
  "type": "git",
@@ -29,11 +30,12 @@
29
30
  "scripts": {
30
31
  "typecheck": "tsc --noEmit",
31
32
  "test": "bun test",
32
- "codegen": "sui-ts-codegen generate",
33
+ "codegen": "bun scripts/codegen.ts",
34
+ "codegen:check": "bun run codegen && git diff --exit-code -- src/contracts",
33
35
  "docs": "typedoc",
34
36
  "build": "rm -rf dist && tsc -p tsconfig.build.json",
35
37
  "prepack": "rm -rf dist && tsc -p tsconfig.build.json",
36
- "prepare": "rm -rf dist && tsc -p tsconfig.build.json"
38
+ "prepare": "rm -rf dist && tsc -p tsconfig.build.json --noCheck"
37
39
  },
38
40
  "exports": {
39
41
  ".": {
@@ -72,6 +74,14 @@
72
74
  "types": "./dist/parsers.d.ts",
73
75
  "default": "./dist/parsers.js"
74
76
  },
77
+ "./events": {
78
+ "types": "./dist/events.d.ts",
79
+ "default": "./dist/events.js"
80
+ },
81
+ "./packages": {
82
+ "types": "./dist/packages.d.ts",
83
+ "default": "./dist/packages.js"
84
+ },
75
85
  "./package.json": "./package.json"
76
86
  },
77
87
  "files": [
package/src/client.ts CHANGED
@@ -8,9 +8,15 @@ import type {
8
8
  import type { SuiGraphQLClient } from "@mysten/sui/graphql";
9
9
  import {
10
10
  getMisoProtocolDeployment,
11
+ normalizeMisoDeployment,
12
+ normalizeMisoProtocolDeployment,
13
+ protocolDeployment,
14
+ type MisoDeployment,
11
15
  type MisoProtocolDeployment,
12
16
  } from "./deployments.ts";
17
+ import { bindModulePackage, MisoPackageBindings, REF_RETURNING_CALLS } from "./packages.ts";
13
18
  import * as parsers from "./parsers.ts";
19
+ import { eventParsers } from "./events.ts";
14
20
  import * as queries from "./queries.ts";
15
21
  import * as view from "./view.ts";
16
22
  import type {
@@ -32,10 +38,10 @@ export interface MisoOptions<Name extends string = "miso"> {
32
38
  /** Name for the client extension. Defaults to "miso". */
33
39
  name?: Name;
34
40
  /**
35
- * Complete custom deployment. Omit for bundled Mainnet/Testnet addresses,
36
- * selected from the Sui client's `network`.
41
+ * Explicit core-only deployment or complete package manifest. Omit only after
42
+ * this SDK has a verified bundled manifest for the client's network.
37
43
  */
38
- deployment?: MisoProtocolDeployment;
44
+ deployment?: MisoProtocolDeployment | MisoDeployment;
39
45
  /** @deprecated Use `deployment`. Retained for compatibility with pre-0.4 callers. */
40
46
  misoPackageId?: string;
41
47
  /**
@@ -47,17 +53,10 @@ export interface MisoOptions<Name extends string = "miso"> {
47
53
  graphqlClient?: SuiGraphQLClient;
48
54
  }
49
55
 
50
- /** Defaults `options.package` to `pkg` for every call-function in a generated module. */
51
- function bindModulePackage<M extends object>(mod: M, pkg: string): M {
52
- const out: Record<string, unknown> = {};
53
- for (const [key, value] of Object.entries({ ...mod })) {
54
- out[key] =
55
- typeof value === "function"
56
- ? (options: { package?: string }) =>
57
- (value as (o: unknown) => unknown)({ package: pkg, ...options })
58
- : value;
59
- }
60
- return out as M;
56
+ function isFullDeployment(
57
+ deployment: MisoProtocolDeployment | MisoDeployment,
58
+ ): deployment is MisoDeployment {
59
+ return "miso" in deployment;
61
60
  }
62
61
 
63
62
  /**
@@ -77,13 +76,21 @@ export function miso<const Name extends string = "miso">(
77
76
  return {
78
77
  name,
79
78
  register: (client) => {
80
- const deployment =
81
- options.deployment ??
82
- (options.misoPackageId
83
- ? { packageId: options.misoPackageId }
84
- : getMisoProtocolDeployment(client.network));
79
+ const supplied = options.deployment;
80
+ const packageDeployment =
81
+ supplied && isFullDeployment(supplied)
82
+ ? normalizeMisoDeployment(supplied)
83
+ : undefined;
84
+ const deployment = supplied
85
+ ? isFullDeployment(supplied)
86
+ ? protocolDeployment(packageDeployment!)
87
+ : normalizeMisoProtocolDeployment(supplied)
88
+ : options.misoPackageId
89
+ ? normalizeMisoProtocolDeployment({ packageId: options.misoPackageId })
90
+ : getMisoProtocolDeployment(client.network);
85
91
  return new MisoProtocolClient(client, {
86
92
  deployment,
93
+ packageDeployment,
87
94
  graphqlClient: options.graphqlClient,
88
95
  });
89
96
  },
@@ -92,6 +99,7 @@ export function miso<const Name extends string = "miso">(
92
99
 
93
100
  export interface MisoProtocolClientOptions {
94
101
  deployment: MisoProtocolDeployment;
102
+ packageDeployment?: MisoDeployment;
95
103
  graphqlClient?: SuiGraphQLClient;
96
104
  }
97
105
 
@@ -99,11 +107,15 @@ export class MisoProtocolClient {
99
107
  #client: ClientWithCoreApi;
100
108
  #graphqlClient?: SuiGraphQLClient;
101
109
  #deployment: MisoProtocolDeployment;
110
+ #packageDeployment?: MisoDeployment;
102
111
 
103
112
  constructor(client: ClientWithCoreApi, options: MisoProtocolClientOptions) {
104
113
  this.#client = client;
105
114
  this.#graphqlClient = options.graphqlClient;
106
- this.#deployment = options.deployment;
115
+ this.#deployment = normalizeMisoProtocolDeployment(options.deployment);
116
+ this.#packageDeployment = options.packageDeployment
117
+ ? normalizeMisoDeployment(options.packageDeployment)
118
+ : undefined;
107
119
  }
108
120
 
109
121
  /** The exact deployment selected for this client. */
@@ -111,6 +123,20 @@ export class MisoProtocolClient {
111
123
  return this.#deployment;
112
124
  }
113
125
 
126
+ /**
127
+ * Complete package-bound calls and BCS codecs, available only when `miso()`
128
+ * was given a full fresh deployment manifest.
129
+ */
130
+ get packages(): MisoPackageBindings {
131
+ if (!this.#packageDeployment) {
132
+ throw new Error(
133
+ "@misonetwork/sdk: full package bindings require a complete MisoDeployment. " +
134
+ "Pass the verified post-publish manifest to miso({ deployment }).",
135
+ );
136
+ }
137
+ return new MisoPackageBindings(this.#packageDeployment);
138
+ }
139
+
114
140
  get #misoPackageId(): string {
115
141
  return this.#deployment.packageId;
116
142
  }
@@ -211,6 +237,10 @@ export class MisoProtocolClient {
211
237
  async getReleaseById(releaseId: string): Promise<Release> {
212
238
  return queries.getReleaseById(this.#client, releaseId);
213
239
  }
240
+ /** Read the shared canonical core `miso::release::ReleaseRegistry`. */
241
+ async getReleaseRegistryById(registryId: string) {
242
+ return queries.getReleaseRegistryById(this.#client, registryId);
243
+ }
214
244
  async getReleasesByIds(ids: string[]): Promise<Record<string, Release>> {
215
245
  return queries.getReleasesByIds(this.#client, ids);
216
246
  }
@@ -260,9 +290,9 @@ export class MisoProtocolClient {
260
290
  get call() {
261
291
  const pkg = this.#misoPackageId;
262
292
  return {
263
- composition: bindModulePackage(composition, pkg),
264
- recording: bindModulePackage(recording, pkg),
265
- release: bindModulePackage(release, pkg),
293
+ composition: bindModulePackage(composition, pkg, REF_RETURNING_CALLS.composition),
294
+ recording: bindModulePackage(recording, pkg, REF_RETURNING_CALLS.recording),
295
+ release: bindModulePackage(release, pkg, REF_RETURNING_CALLS.release),
266
296
  track: bindModulePackage(track, pkg),
267
297
  };
268
298
  }
@@ -276,7 +306,6 @@ export class MisoProtocolClient {
276
306
  Release: release.Release,
277
307
  Track: track.Track,
278
308
  CompositionPublishedEvent: composition.CompositionPublishedEvent,
279
- CompositionRoyaltySetEvent: composition.CompositionRoyaltySetEvent,
280
309
  RecordingPublishedEvent: recording.RecordingPublishedEvent,
281
310
  ReleasePublishedEvent: release.ReleasePublishedEvent,
282
311
  };
@@ -287,9 +316,12 @@ export class MisoProtocolClient {
287
316
  get parse() {
288
317
  return {
289
318
  compositionPublishedEvent: parsers.parseCompositionPublishedEvent,
290
- compositionRoyaltySetEvent: parsers.parseCompositionRoyaltySetEvent,
291
319
  recordingPublishedEvent: parsers.parseRecordingPublishedEvent,
320
+ compositionSharesGrantedEvent:
321
+ parsers.parseCompositionSharesGrantedEvent,
292
322
  releasePublishedEvent: parsers.parseReleasePublishedEvent,
323
+ releaseRegistryCreatedEvent: parsers.parseReleaseRegistryCreatedEvent,
324
+ events: eventParsers,
293
325
  };
294
326
  }
295
327
 
@@ -0,0 +1,169 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /**
7
+ * First-party credits extension for compositions.
8
+ *
9
+ * Attribution (writing credits) is display-oriented and varies across platforms,
10
+ * so it lives here as a dynamic field on the composition rather than in immutable
11
+ * core. The data is attached under `ExtensionKey()` via the composition's
12
+ * cap-gated `uid_mut`, so every mutation is authorized by the composition's admin
13
+ * and credits survive into any lifecycle state (they may be attached before or
14
+ * after the composition is published).
15
+ *
16
+ * This is Miso's canonical credits standard; because it is an extension, other
17
+ * parties may publish their own composition-credits standard against the same
18
+ * `Composition`. Credits are NOT read by the economics — they are attribution.
19
+ */
20
+
21
+ import { MoveTuple, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.ts';
22
+ import { bcs } from '@mysten/sui/bcs';
23
+ import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
24
+ import * as vec_map from './deps/sui/vec_map.ts';
25
+ import * as credit from './deps/miso_credit/credit.ts';
26
+ import * as composition_party_role from './composition_party_role.ts';
27
+ const $moduleName = '@local-pkg/composition_credits::composition_credits';
28
+ export const ExtensionKey = new MoveTuple({ name: `${$moduleName}::ExtensionKey`, fields: [bcs.bool()] });
29
+ export const CompositionCredits = new MoveStruct({ name: `${$moduleName}::CompositionCredits`, fields: {
30
+ /** Map of party IDs to their credit (display name + roles). */
31
+ credits: vec_map.VecMap(bcs.Address, credit.Credit(composition_party_role.CompositionPartyRole))
32
+ } });
33
+ export const CreditAddedEvent = new MoveStruct({ name: `${$moduleName}::CreditAddedEvent`, fields: {
34
+ composition_id: bcs.Address,
35
+ party_id: bcs.Address,
36
+ credit: credit.Credit(composition_party_role.CompositionPartyRole)
37
+ } });
38
+ export const CreditRemovedEvent = new MoveStruct({ name: `${$moduleName}::CreditRemovedEvent`, fields: {
39
+ composition_id: bcs.Address,
40
+ party_id: bcs.Address,
41
+ credit: credit.Credit(composition_party_role.CompositionPartyRole)
42
+ } });
43
+ export interface AddCreditArguments {
44
+ self: RawTransactionArgument<string>;
45
+ cap: RawTransactionArgument<string>;
46
+ party: RawTransactionArgument<string>;
47
+ credit: TransactionArgument;
48
+ }
49
+ export interface AddCreditOptions {
50
+ package?: string;
51
+ arguments: AddCreditArguments | [
52
+ self: RawTransactionArgument<string>,
53
+ cap: RawTransactionArgument<string>,
54
+ party: RawTransactionArgument<string>,
55
+ credit: TransactionArgument
56
+ ];
57
+ typeArguments: [
58
+ string
59
+ ];
60
+ }
61
+ /**
62
+ * Adds a credit for a party on the composition, lazily creating the credits record
63
+ * on first use. Each credit must have 1-5 roles, and a party may hold at most one
64
+ * credit. Requires the composition's admin capability.
65
+ */
66
+ export function addCredit(options: AddCreditOptions) {
67
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
68
+ const argumentsTypes = [
69
+ null,
70
+ null,
71
+ null,
72
+ null
73
+ ] satisfies (string | null)[];
74
+ const parameterNames = ["self", "cap", "party", "credit"];
75
+ return (tx: Transaction) => tx.moveCall({
76
+ package: packageAddress,
77
+ module: 'composition_credits',
78
+ function: 'add_credit',
79
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
80
+ typeArguments: options.typeArguments
81
+ });
82
+ }
83
+ export interface RemoveCreditArguments {
84
+ self: RawTransactionArgument<string>;
85
+ cap: RawTransactionArgument<string>;
86
+ partyId: RawTransactionArgument<string>;
87
+ }
88
+ export interface RemoveCreditOptions {
89
+ package?: string;
90
+ arguments: RemoveCreditArguments | [
91
+ self: RawTransactionArgument<string>,
92
+ cap: RawTransactionArgument<string>,
93
+ partyId: RawTransactionArgument<string>
94
+ ];
95
+ typeArguments: [
96
+ string
97
+ ];
98
+ }
99
+ /** Removes a party's credit. Requires the composition's admin capability. */
100
+ export function removeCredit(options: RemoveCreditOptions) {
101
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
102
+ const argumentsTypes = [
103
+ null,
104
+ null,
105
+ '0x2::object::ID'
106
+ ] satisfies (string | null)[];
107
+ const parameterNames = ["self", "cap", "partyId"];
108
+ return (tx: Transaction) => tx.moveCall({
109
+ package: packageAddress,
110
+ module: 'composition_credits',
111
+ function: 'remove_credit',
112
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
113
+ typeArguments: options.typeArguments
114
+ });
115
+ }
116
+ export interface HasCreditsArguments {
117
+ self: RawTransactionArgument<string>;
118
+ }
119
+ export interface HasCreditsOptions {
120
+ package?: string;
121
+ arguments: HasCreditsArguments | [
122
+ self: RawTransactionArgument<string>
123
+ ];
124
+ typeArguments: [
125
+ string
126
+ ];
127
+ }
128
+ /** Returns whether a credits record has been attached to this composition yet. */
129
+ export function hasCredits(options: HasCreditsOptions) {
130
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
131
+ const argumentsTypes = [
132
+ null
133
+ ] satisfies (string | null)[];
134
+ const parameterNames = ["self"];
135
+ return (tx: Transaction) => tx.moveCall({
136
+ package: packageAddress,
137
+ module: 'composition_credits',
138
+ function: 'has_credits',
139
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
140
+ typeArguments: options.typeArguments
141
+ });
142
+ }
143
+ export interface CreditsArguments {
144
+ self: RawTransactionArgument<string>;
145
+ }
146
+ export interface CreditsOptions {
147
+ package?: string;
148
+ arguments: CreditsArguments | [
149
+ self: RawTransactionArgument<string>
150
+ ];
151
+ typeArguments: [
152
+ string
153
+ ];
154
+ }
155
+ /** Returns the party-to-credit map. Aborts if no credits are attached. */
156
+ export function credits(options: CreditsOptions) {
157
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
158
+ const argumentsTypes = [
159
+ null
160
+ ] satisfies (string | null)[];
161
+ const parameterNames = ["self"];
162
+ return (tx: Transaction) => tx.moveCall({
163
+ package: packageAddress,
164
+ module: 'composition_credits',
165
+ function: 'credits',
166
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
167
+ typeArguments: options.typeArguments
168
+ });
169
+ }
@@ -0,0 +1,189 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /**
7
+ * Defines the roles that parties can hold on a composition. Compositions are the
8
+ * underlying musical works (melody + lyrics), and these roles represent the
9
+ * writing and adaptation contributions to them.
10
+ *
11
+ * ### Design
12
+ *
13
+ * `CompositionPartyRole` is a closed enum: variants can only be constructed and
14
+ * matched inside this module, so the `new_*_role` constructors are the external
15
+ * write-API and `name()` is the external read-API.
16
+ *
17
+ * - **No seniority axis.** Unlike recording roles, composition roles carry no
18
+ * level — a writer either contributed in a given capacity or did not.
19
+ * - **`Custom` is the escape hatch.** The canonical variants cover the common
20
+ * writing vocabulary; anything outside it is a `Custom(name)` whose name is
21
+ * validated. Prefer a canonical variant when one fits.
22
+ * - **`name()` is the canonical identifier**, returned as a stable PascalCase
23
+ * token (e.g. `"Songwriter"`). For `Custom`, `name()` returns the user-supplied
24
+ * string.
25
+ *
26
+ * These identifiers are Miso's own canonical vocabulary; any overlap with an
27
+ * external standard (e.g. DDEX) is coincidental, not a reproduction of it.
28
+ */
29
+
30
+ import { MoveEnum, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.ts';
31
+ import { bcs } from '@mysten/sui/bcs';
32
+ import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
33
+ const $moduleName = '@local-pkg/composition_credits::composition_party_role';
34
+ /** Represents a party's role on a composition. */
35
+ export const CompositionPartyRole = new MoveEnum({ name: `${$moduleName}::CompositionPartyRole`, fields: {
36
+ /** Adapted an existing work into this composition. */
37
+ Adapter: null,
38
+ /** Arranged the musical parts of the composition. */
39
+ Arranger: null,
40
+ /** Composed the music of the composition. */
41
+ Composer: null,
42
+ /** Wrote the lyrics of the composition. */
43
+ Lyricist: null,
44
+ /** Wrote both music and lyrics of the composition. */
45
+ Songwriter: null,
46
+ /** Translated the lyrics of the composition. */
47
+ Translator: null,
48
+ /**
49
+ * A user-defined role not covered by a canonical variant. Carries the role name
50
+ * (validated). An escape hatch — prefer a canonical variant when one fits.
51
+ */
52
+ Custom: bcs.string()
53
+ } });
54
+ export interface NewAdapterRoleOptions {
55
+ package?: string;
56
+ arguments?: [
57
+ ];
58
+ }
59
+ /** Creates a new Adapter role. */
60
+ export function newAdapterRole(options: NewAdapterRoleOptions = {}) {
61
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
62
+ return (tx: Transaction) => tx.moveCall({
63
+ package: packageAddress,
64
+ module: 'composition_party_role',
65
+ function: 'new_adapter_role',
66
+ });
67
+ }
68
+ export interface NewArrangerRoleOptions {
69
+ package?: string;
70
+ arguments?: [
71
+ ];
72
+ }
73
+ /** Creates a new Arranger role. */
74
+ export function newArrangerRole(options: NewArrangerRoleOptions = {}) {
75
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
76
+ return (tx: Transaction) => tx.moveCall({
77
+ package: packageAddress,
78
+ module: 'composition_party_role',
79
+ function: 'new_arranger_role',
80
+ });
81
+ }
82
+ export interface NewComposerRoleOptions {
83
+ package?: string;
84
+ arguments?: [
85
+ ];
86
+ }
87
+ /** Creates a new Composer role. */
88
+ export function newComposerRole(options: NewComposerRoleOptions = {}) {
89
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
90
+ return (tx: Transaction) => tx.moveCall({
91
+ package: packageAddress,
92
+ module: 'composition_party_role',
93
+ function: 'new_composer_role',
94
+ });
95
+ }
96
+ export interface NewLyricistRoleOptions {
97
+ package?: string;
98
+ arguments?: [
99
+ ];
100
+ }
101
+ /** Creates a new Lyricist role. */
102
+ export function newLyricistRole(options: NewLyricistRoleOptions = {}) {
103
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
104
+ return (tx: Transaction) => tx.moveCall({
105
+ package: packageAddress,
106
+ module: 'composition_party_role',
107
+ function: 'new_lyricist_role',
108
+ });
109
+ }
110
+ export interface NewSongwriterRoleOptions {
111
+ package?: string;
112
+ arguments?: [
113
+ ];
114
+ }
115
+ /** Creates a new Songwriter role. */
116
+ export function newSongwriterRole(options: NewSongwriterRoleOptions = {}) {
117
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
118
+ return (tx: Transaction) => tx.moveCall({
119
+ package: packageAddress,
120
+ module: 'composition_party_role',
121
+ function: 'new_songwriter_role',
122
+ });
123
+ }
124
+ export interface NewTranslatorRoleOptions {
125
+ package?: string;
126
+ arguments?: [
127
+ ];
128
+ }
129
+ /** Creates a new Translator role. */
130
+ export function newTranslatorRole(options: NewTranslatorRoleOptions = {}) {
131
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
132
+ return (tx: Transaction) => tx.moveCall({
133
+ package: packageAddress,
134
+ module: 'composition_party_role',
135
+ function: 'new_translator_role',
136
+ });
137
+ }
138
+ export interface NewCustomRoleArguments {
139
+ roleName: RawTransactionArgument<string>;
140
+ }
141
+ export interface NewCustomRoleOptions {
142
+ package?: string;
143
+ arguments: NewCustomRoleArguments | [
144
+ roleName: RawTransactionArgument<string>
145
+ ];
146
+ }
147
+ /**
148
+ * Creates a new Custom role with a user-defined name. The name freezes into
149
+ * credits, so it is validated here. Prefer a canonical variant when one fits.
150
+ */
151
+ export function newCustomRole(options: NewCustomRoleOptions) {
152
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
153
+ const argumentsTypes = [
154
+ '0x1::string::String'
155
+ ] satisfies (string | null)[];
156
+ const parameterNames = ["roleName"];
157
+ return (tx: Transaction) => tx.moveCall({
158
+ package: packageAddress,
159
+ module: 'composition_party_role',
160
+ function: 'new_custom_role',
161
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
162
+ });
163
+ }
164
+ export interface NameArguments {
165
+ self: TransactionArgument;
166
+ }
167
+ export interface NameOptions {
168
+ package?: string;
169
+ arguments: NameArguments | [
170
+ self: TransactionArgument
171
+ ];
172
+ }
173
+ /**
174
+ * Returns the canonical identifier of the role as a stable PascalCase token. For
175
+ * `Custom`, returns the user-supplied name.
176
+ */
177
+ export function name(options: NameOptions) {
178
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
179
+ const argumentsTypes = [
180
+ null
181
+ ] satisfies (string | null)[];
182
+ const parameterNames = ["self"];
183
+ return (tx: Transaction) => tx.moveCall({
184
+ package: packageAddress,
185
+ module: 'composition_party_role',
186
+ function: 'name',
187
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
188
+ });
189
+ }
@@ -0,0 +1,27 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /**
7
+ * Represents a party's credit on a work or activity. A credit pairs a display name
8
+ * with one or more roles, identifying how a party contributed to the work.
9
+ */
10
+
11
+ import { type BcsType, bcs } from '@mysten/sui/bcs';
12
+ import { MoveStruct } from '../../../utils/index.ts';
13
+ const $moduleName = 'miso_credit::credit';
14
+ /**
15
+ * A credit attributing roles to a party on a work. Generic over the role type to
16
+ * support domain-specific roles.
17
+ */
18
+ export function Credit<Role extends BcsType<any>>(...typeParameters: [
19
+ Role
20
+ ]) {
21
+ return new MoveStruct({ name: `${$moduleName}::Credit<${typeParameters[0].name as Role['name']}>`, fields: {
22
+ /** Human-readable name to display for this credit. */
23
+ display_name: bcs.string(),
24
+ /** Roles assigned to the credited party. */
25
+ roles: bcs.vector(typeParameters[0])
26
+ } });
27
+ }
@@ -0,0 +1,33 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ import { type BcsType, bcs } from '@mysten/sui/bcs';
5
+ import { MoveStruct } from '../../../utils/index.ts';
6
+ const $moduleName = '0x2::vec_map';
7
+ /** An entry in the map */
8
+ export function Entry<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [
9
+ K,
10
+ V
11
+ ]) {
12
+ return new MoveStruct({ name: `${$moduleName}::Entry<${typeParameters[0].name as K['name']}, ${typeParameters[1].name as V['name']}>`, fields: {
13
+ key: typeParameters[0],
14
+ value: typeParameters[1]
15
+ } });
16
+ }
17
+ /**
18
+ * A map data structure backed by a vector. The map is guaranteed not to contain
19
+ * duplicate keys, but entries are _not_ sorted by key--entries are included in
20
+ * insertion order. All operations are O(N) in the size of the map--the intention
21
+ * of this data structure is only to provide the convenience of programming against
22
+ * a map API. Large maps should use handwritten parent/child relationships instead.
23
+ * Maps that need sorted iteration rather than insertion order iteration should
24
+ * also be handwritten.
25
+ */
26
+ export function VecMap<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [
27
+ K,
28
+ V
29
+ ]) {
30
+ return new MoveStruct({ name: `${$moduleName}::VecMap<${typeParameters[0].name as K['name']}, ${typeParameters[1].name as V['name']}>`, fields: {
31
+ contents: bcs.vector(Entry(typeParameters[0], typeParameters[1]))
32
+ } });
33
+ }