@misofm/sdk 0.9.0 → 0.10.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 (275) hide show
  1. package/README.md +88 -56
  2. package/dist/client.d.ts +126 -18
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +210 -44
  5. package/dist/client.js.map +1 -1
  6. package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts +205 -0
  7. package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts.map +1 -0
  8. package/dist/contracts/composition_routed_stake/composition_routed_stake.js +184 -0
  9. package/dist/contracts/composition_routed_stake/composition_routed_stake.js.map +1 -0
  10. package/dist/contracts/composition_routed_stake/witness.d.ts +7 -0
  11. package/dist/contracts/composition_routed_stake/witness.d.ts.map +1 -0
  12. package/dist/contracts/composition_routed_stake/witness.js +9 -0
  13. package/dist/contracts/composition_routed_stake/witness.js.map +1 -0
  14. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +89 -28
  15. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +1 -1
  16. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +84 -23
  17. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +1 -1
  18. package/dist/contracts/composition_royalty_pool/witness.d.ts +6 -0
  19. package/dist/contracts/composition_royalty_pool/witness.d.ts.map +1 -0
  20. package/dist/contracts/composition_royalty_pool/witness.js +8 -0
  21. package/dist/contracts/composition_royalty_pool/witness.js.map +1 -0
  22. package/dist/contracts/genre/genre.d.ts +96 -0
  23. package/dist/contracts/genre/genre.d.ts.map +1 -0
  24. package/dist/contracts/genre/genre.js +107 -0
  25. package/dist/contracts/genre/genre.js.map +1 -0
  26. package/dist/contracts/recording_advisory/recording_advisory.d.ts +194 -0
  27. package/dist/contracts/recording_advisory/recording_advisory.d.ts.map +1 -0
  28. package/dist/contracts/recording_advisory/recording_advisory.js +204 -0
  29. package/dist/contracts/recording_advisory/recording_advisory.js.map +1 -0
  30. package/dist/contracts/recording_language/deps/language_code/language_code.d.ts +6 -0
  31. package/dist/contracts/recording_language/deps/language_code/language_code.d.ts.map +1 -0
  32. package/dist/contracts/recording_language/deps/language_code/language_code.js +8 -0
  33. package/dist/contracts/recording_language/deps/language_code/language_code.js.map +1 -0
  34. package/dist/contracts/recording_language/recording_language.d.ts +152 -0
  35. package/dist/contracts/recording_language/recording_language.d.ts.map +1 -0
  36. package/dist/contracts/recording_language/recording_language.js +149 -0
  37. package/dist/contracts/recording_language/recording_language.js.map +1 -0
  38. package/dist/contracts/recording_master_reference/deps/ori/walrus_data.d.ts +52 -0
  39. package/dist/contracts/recording_master_reference/deps/ori/walrus_data.d.ts.map +1 -0
  40. package/dist/contracts/recording_master_reference/deps/ori/walrus_data.js +37 -0
  41. package/dist/contracts/recording_master_reference/deps/ori/walrus_data.js.map +1 -0
  42. package/dist/contracts/recording_master_reference/recording_master_reference.d.ts +131 -0
  43. package/dist/contracts/recording_master_reference/recording_master_reference.d.ts.map +1 -0
  44. package/dist/contracts/recording_master_reference/recording_master_reference.js +121 -0
  45. package/dist/contracts/recording_master_reference/recording_master_reference.js.map +1 -0
  46. package/dist/contracts/recording_preview/deps/ori/walrus_data.d.ts +52 -0
  47. package/dist/contracts/recording_preview/deps/ori/walrus_data.d.ts.map +1 -0
  48. package/dist/contracts/recording_preview/deps/ori/walrus_data.js +37 -0
  49. package/dist/contracts/recording_preview/deps/ori/walrus_data.js.map +1 -0
  50. package/dist/contracts/recording_preview/recording_preview.d.ts +104 -0
  51. package/dist/contracts/recording_preview/recording_preview.d.ts.map +1 -0
  52. package/dist/contracts/recording_preview/recording_preview.js +94 -0
  53. package/dist/contracts/recording_preview/recording_preview.js.map +1 -0
  54. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +90 -28
  55. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +1 -1
  56. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +84 -23
  57. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +1 -1
  58. package/dist/contracts/recording_royalty_pool/witness.d.ts +6 -0
  59. package/dist/contracts/recording_royalty_pool/witness.d.ts.map +1 -0
  60. package/dist/contracts/recording_royalty_pool/witness.js +8 -0
  61. package/dist/contracts/recording_royalty_pool/witness.js.map +1 -0
  62. package/dist/contracts/release_description/release_description.d.ts +112 -0
  63. package/dist/contracts/release_description/release_description.d.ts.map +1 -0
  64. package/dist/contracts/release_description/release_description.js +123 -0
  65. package/dist/contracts/release_description/release_description.js.map +1 -0
  66. package/dist/contracts/release_dsp_link/release_dsp_link.d.ts +644 -0
  67. package/dist/contracts/release_dsp_link/release_dsp_link.d.ts.map +1 -0
  68. package/dist/contracts/release_dsp_link/release_dsp_link.js +556 -0
  69. package/dist/contracts/release_dsp_link/release_dsp_link.js.map +1 -0
  70. package/dist/contracts/release_genre/deps/per_track/per_track.d.ts +33 -0
  71. package/dist/contracts/release_genre/deps/per_track/per_track.d.ts.map +1 -0
  72. package/dist/contracts/release_genre/deps/per_track/per_track.js +32 -0
  73. package/dist/contracts/release_genre/deps/per_track/per_track.js.map +1 -0
  74. package/dist/contracts/release_genre/release_genre.d.ts +193 -0
  75. package/dist/contracts/release_genre/release_genre.d.ts.map +1 -0
  76. package/dist/contracts/release_genre/release_genre.js +207 -0
  77. package/dist/contracts/release_genre/release_genre.js.map +1 -0
  78. package/dist/contracts/release_kind/release_kind.d.ts +98 -0
  79. package/dist/contracts/release_kind/release_kind.d.ts.map +1 -0
  80. package/dist/contracts/release_kind/release_kind.js +109 -0
  81. package/dist/contracts/release_kind/release_kind.js.map +1 -0
  82. package/dist/contracts/release_revenue_distributor/release_revenue_distributor.d.ts +106 -0
  83. package/dist/contracts/release_revenue_distributor/release_revenue_distributor.d.ts.map +1 -0
  84. package/dist/contracts/release_revenue_distributor/release_revenue_distributor.js +113 -0
  85. package/dist/contracts/release_revenue_distributor/release_revenue_distributor.js.map +1 -0
  86. package/dist/contracts/release_revenue_distributor/witness.d.ts +7 -0
  87. package/dist/contracts/release_revenue_distributor/witness.d.ts.map +1 -0
  88. package/dist/contracts/release_revenue_distributor/witness.js +9 -0
  89. package/dist/contracts/release_revenue_distributor/witness.js.map +1 -0
  90. package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.d.ts +52 -0
  91. package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.d.ts.map +1 -0
  92. package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.js +37 -0
  93. package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.js.map +1 -0
  94. package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.d.ts +91 -0
  95. package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.d.ts.map +1 -0
  96. package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.js +91 -0
  97. package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.js.map +1 -0
  98. package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts +54 -0
  99. package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts.map +1 -0
  100. package/dist/contracts/routed_stake/deps/royalty_pool/stake.js +37 -0
  101. package/dist/contracts/routed_stake/deps/royalty_pool/stake.js.map +1 -0
  102. package/dist/contracts/routed_stake/deps/std/type_name.d.ts +18 -0
  103. package/dist/contracts/routed_stake/deps/std/type_name.d.ts.map +1 -0
  104. package/dist/contracts/routed_stake/deps/std/type_name.js +20 -0
  105. package/dist/contracts/routed_stake/deps/std/type_name.js.map +1 -0
  106. package/dist/contracts/routed_stake/deps/sui/balance.d.ts +13 -0
  107. package/dist/contracts/routed_stake/deps/sui/balance.d.ts.map +1 -0
  108. package/dist/contracts/routed_stake/deps/sui/balance.js +15 -0
  109. package/dist/contracts/routed_stake/deps/sui/balance.js.map +1 -0
  110. package/dist/contracts/routed_stake/deps/sui/vec_map.d.ts +37 -0
  111. package/dist/contracts/routed_stake/deps/sui/vec_map.d.ts.map +1 -0
  112. package/dist/contracts/routed_stake/deps/sui/vec_map.js +28 -0
  113. package/dist/contracts/routed_stake/deps/sui/vec_map.js.map +1 -0
  114. package/dist/contracts/routed_stake/routed_stake.d.ts +356 -0
  115. package/dist/contracts/routed_stake/routed_stake.d.ts.map +1 -0
  116. package/dist/contracts/routed_stake/routed_stake.js +311 -0
  117. package/dist/contracts/routed_stake/routed_stake.js.map +1 -0
  118. package/dist/contracts/royalty_pool/pool.d.ts +27 -17
  119. package/dist/contracts/royalty_pool/pool.d.ts.map +1 -1
  120. package/dist/contracts/royalty_pool/pool.js +26 -17
  121. package/dist/contracts/royalty_pool/pool.js.map +1 -1
  122. package/dist/contracts/vault/deps/sui/bag.d.ts +35 -0
  123. package/dist/contracts/vault/deps/sui/bag.d.ts.map +1 -0
  124. package/dist/contracts/vault/deps/sui/bag.js +37 -0
  125. package/dist/contracts/vault/deps/sui/bag.js.map +1 -0
  126. package/dist/contracts/vault/deps/sui/borrow.d.ts +20 -0
  127. package/dist/contracts/vault/deps/sui/borrow.d.ts.map +1 -0
  128. package/dist/contracts/vault/deps/sui/borrow.js +21 -0
  129. package/dist/contracts/vault/deps/sui/borrow.js.map +1 -0
  130. package/dist/contracts/vault/vault.d.ts +276 -0
  131. package/dist/contracts/vault/vault.d.ts.map +1 -0
  132. package/dist/contracts/vault/vault.js +274 -0
  133. package/dist/contracts/vault/vault.js.map +1 -0
  134. package/dist/contracts.d.ts +14 -2
  135. package/dist/contracts.d.ts.map +1 -1
  136. package/dist/contracts.js +16 -7
  137. package/dist/contracts.js.map +1 -1
  138. package/dist/cover.d.ts +17 -3
  139. package/dist/cover.d.ts.map +1 -1
  140. package/dist/cover.js +43 -20
  141. package/dist/cover.js.map +1 -1
  142. package/dist/credits.d.ts +31 -12
  143. package/dist/credits.d.ts.map +1 -1
  144. package/dist/credits.js +41 -25
  145. package/dist/credits.js.map +1 -1
  146. package/dist/deployments.d.ts +31 -57
  147. package/dist/deployments.d.ts.map +1 -1
  148. package/dist/deployments.js +5 -53
  149. package/dist/deployments.js.map +1 -1
  150. package/dist/index.d.ts +4 -2
  151. package/dist/index.d.ts.map +1 -1
  152. package/dist/index.js +6 -5
  153. package/dist/index.js.map +1 -1
  154. package/dist/pressing.d.ts +8 -7
  155. package/dist/pressing.d.ts.map +1 -1
  156. package/dist/pressing.js +91 -32
  157. package/dist/pressing.js.map +1 -1
  158. package/dist/read/artist.js +3 -3
  159. package/dist/read/artist.js.map +1 -1
  160. package/dist/read/catalog.d.ts +14 -9
  161. package/dist/read/catalog.d.ts.map +1 -1
  162. package/dist/read/catalog.js +71 -37
  163. package/dist/read/catalog.js.map +1 -1
  164. package/dist/read/client.d.ts +4 -2
  165. package/dist/read/client.d.ts.map +1 -1
  166. package/dist/read/client.js +15 -4
  167. package/dist/read/client.js.map +1 -1
  168. package/dist/read/config.d.ts +14 -11
  169. package/dist/read/config.d.ts.map +1 -1
  170. package/dist/read/config.js +10 -37
  171. package/dist/read/config.js.map +1 -1
  172. package/dist/read/index.d.ts +2 -2
  173. package/dist/read/index.d.ts.map +1 -1
  174. package/dist/read/index.js +1 -1
  175. package/dist/read/index.js.map +1 -1
  176. package/dist/read/receipts.d.ts +24 -7
  177. package/dist/read/receipts.d.ts.map +1 -1
  178. package/dist/read/receipts.js +78 -25
  179. package/dist/read/receipts.js.map +1 -1
  180. package/dist/read/types.d.ts +43 -25
  181. package/dist/read/types.d.ts.map +1 -1
  182. package/dist/read/types.js +2 -2
  183. package/dist/read/types.js.map +1 -1
  184. package/dist/recording-extensions.d.ts +37 -0
  185. package/dist/recording-extensions.d.ts.map +1 -0
  186. package/dist/recording-extensions.js +61 -0
  187. package/dist/recording-extensions.js.map +1 -0
  188. package/dist/release-extensions.d.ts +92 -0
  189. package/dist/release-extensions.d.ts.map +1 -0
  190. package/dist/release-extensions.js +175 -0
  191. package/dist/release-extensions.js.map +1 -0
  192. package/dist/release-graph.d.ts +17 -26
  193. package/dist/release-graph.d.ts.map +1 -1
  194. package/dist/release-graph.js +55 -49
  195. package/dist/release-graph.js.map +1 -1
  196. package/dist/transactions.d.ts +43 -24
  197. package/dist/transactions.d.ts.map +1 -1
  198. package/dist/transactions.js +48 -27
  199. package/dist/transactions.js.map +1 -1
  200. package/dist/vault.d.ts +268 -0
  201. package/dist/vault.d.ts.map +1 -0
  202. package/dist/vault.js +389 -0
  203. package/dist/vault.js.map +1 -0
  204. package/package.json +17 -11
  205. package/src/client.ts +428 -61
  206. package/src/contracts/composition_routed_stake/composition_routed_stake.ts +346 -0
  207. package/src/contracts/composition_routed_stake/witness.ts +11 -0
  208. package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +151 -35
  209. package/src/contracts/composition_royalty_pool/witness.ts +7 -0
  210. package/src/contracts/genre/genre.ts +151 -0
  211. package/src/contracts/recording_advisory/recording_advisory.ts +315 -0
  212. package/src/contracts/recording_language/deps/language_code/language_code.ts +7 -0
  213. package/src/contracts/recording_language/recording_language.ts +237 -0
  214. package/src/contracts/recording_master_reference/deps/ori/walrus_data.ts +36 -0
  215. package/src/contracts/recording_master_reference/recording_master_reference.ts +181 -0
  216. package/src/contracts/recording_preview/deps/ori/walrus_data.ts +36 -0
  217. package/src/contracts/recording_preview/recording_preview.ts +154 -0
  218. package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +152 -35
  219. package/src/contracts/recording_royalty_pool/witness.ts +7 -0
  220. package/src/contracts/release_description/release_description.ts +167 -0
  221. package/src/contracts/release_dsp_link/release_dsp_link.ts +813 -0
  222. package/src/contracts/release_genre/deps/per_track/per_track.ts +36 -0
  223. package/src/contracts/release_genre/release_genre.ts +314 -0
  224. package/src/contracts/release_kind/release_kind.ts +153 -0
  225. package/src/contracts/release_revenue_distributor/release_revenue_distributor.ts +178 -0
  226. package/src/contracts/release_revenue_distributor/witness.ts +11 -0
  227. package/src/contracts/release_snapshot_bundle/deps/ori/walrus_data.ts +36 -0
  228. package/src/contracts/release_snapshot_bundle/release_snapshot_bundle.ts +124 -0
  229. package/src/contracts/routed_stake/deps/royalty_pool/stake.ts +39 -0
  230. package/src/contracts/routed_stake/deps/std/type_name.ts +22 -0
  231. package/src/contracts/routed_stake/deps/sui/balance.ts +17 -0
  232. package/src/contracts/routed_stake/deps/sui/vec_map.ts +33 -0
  233. package/src/contracts/routed_stake/routed_stake.ts +508 -0
  234. package/src/contracts/royalty_pool/pool.ts +34 -24
  235. package/src/contracts/vault/deps/sui/bag.ts +39 -0
  236. package/src/contracts/vault/deps/sui/borrow.ts +25 -0
  237. package/src/contracts/vault/vault.ts +454 -0
  238. package/src/contracts.ts +17 -9
  239. package/src/cover.ts +62 -37
  240. package/src/credits.ts +64 -51
  241. package/src/deployments.ts +36 -97
  242. package/src/index.ts +11 -5
  243. package/src/pressing.ts +135 -39
  244. package/src/read/artist.ts +3 -3
  245. package/src/read/catalog.ts +99 -44
  246. package/src/read/client.ts +20 -4
  247. package/src/read/config.ts +23 -49
  248. package/src/read/index.ts +3 -1
  249. package/src/read/receipts.ts +103 -26
  250. package/src/read/types.ts +44 -27
  251. package/src/recording-extensions.ts +102 -0
  252. package/src/release-extensions.ts +286 -0
  253. package/src/release-graph.ts +68 -81
  254. package/src/transactions.ts +79 -53
  255. package/src/vault.ts +777 -0
  256. package/dist/contracts/miso_drop/drop.d.ts +0 -550
  257. package/dist/contracts/miso_drop/drop.d.ts.map +0 -1
  258. package/dist/contracts/miso_drop/drop.js +0 -523
  259. package/dist/contracts/miso_drop/drop.js.map +0 -1
  260. package/dist/contracts/release_registry/release_registry.d.ts +0 -114
  261. package/dist/contracts/release_registry/release_registry.d.ts.map +0 -1
  262. package/dist/contracts/release_registry/release_registry.js +0 -119
  263. package/dist/contracts/release_registry/release_registry.js.map +0 -1
  264. package/dist/drop.d.ts +0 -127
  265. package/dist/drop.d.ts.map +0 -1
  266. package/dist/drop.js +0 -202
  267. package/dist/drop.js.map +0 -1
  268. package/dist/extensions/royalty-pool.d.ts +0 -32
  269. package/dist/extensions/royalty-pool.d.ts.map +0 -1
  270. package/dist/extensions/royalty-pool.js +0 -33
  271. package/dist/extensions/royalty-pool.js.map +0 -1
  272. package/src/contracts/miso_drop/drop.ts +0 -798
  273. package/src/contracts/release_registry/release_registry.ts +0 -160
  274. package/src/drop.ts +0 -376
  275. package/src/extensions/royalty-pool.ts +0 -90
@@ -4,13 +4,12 @@
4
4
  // Per-network on-chain identity: which packages the reads address, which objects
5
5
  // they read, and which endpoints they read through. Every id that used to be a
6
6
  // hard-coded constant inside miso-app (`lib/party.ts`, `lib/release.ts`,
7
- // `lib/money.ts`, `lib/drops.ts`) lives here instead, so a redeploy is a change
7
+ // `lib/money.ts`, `lib/pressing.ts`) lives here instead, so a redeploy is a change
8
8
  // in ONE file that every surface picks up.
9
9
  //
10
- // Testnet values are baked from the verified 2026-08-19 deployment. Mainnet is
11
- // deliberately unavailable until this ABI is deployed there.
12
-
13
- import { MISO_PLATFORM_DEPLOYMENTS } from "../deployments.ts";
10
+ // There are intentionally no baked network IDs while the immutable stack is
11
+ // republished. A read client must receive a complete verified configuration from
12
+ // its caller; silently retaining the old ABI would be unsafe.
14
13
 
15
14
  export type Network = "testnet" | "mainnet";
16
15
 
@@ -25,15 +24,12 @@ export function networkFrom(value: string | undefined): Network {
25
24
  export interface ProtocolIds {
26
25
  /** `miso` core — Composition / Recording / Release, and the origin of every derived admin cap. */
27
26
  miso: string;
28
- /** `miso_drop` — `drop::buy` and the `Drop` objects the pressing pages read. */
29
- drop: string;
27
+ /** `miso_pressing` — permanent Pressing runs and per-currency Listings. */
28
+ pressing: string;
30
29
  /** `miso_record` package — the exact owner/type namespace for `record::Record`. */
31
30
  record: string;
32
31
  /** `miso_record` shared `Settings` object — the mint witness authorizer. */
33
32
  recordSettings: string;
34
- /** Release coordinator package and its shared derivation-parent object. */
35
- releaseRegistry: string;
36
- releaseRegistryId: string;
37
33
  /** `release_cover_art` — the release cover extension. */
38
34
  releaseCoverArt: string;
39
35
  /** `composition_credits` / `recording_credits` / `release_credits` extensions. */
@@ -65,7 +61,7 @@ export interface PartyIds {
65
61
 
66
62
  /** The currency the app prices records in, and where test dollars come from. */
67
63
  export interface MoneyIds {
68
- /** Coin type balances, drops, and purchases are denominated in. */
64
+ /** Coin type balances, listings, and purchases are denominated in. */
69
65
  usdCoinType: string;
70
66
  usdDecimals: number;
71
67
  }
@@ -91,54 +87,32 @@ export interface MisoConfig {
91
87
  * public host to hand back a URL a browser can actually fetch.
92
88
  */
93
89
  apiBaseUrl: string;
94
- /** Releases the Discover shelf lists, in display order. Resolved to their live drop at read time. */
95
- discoverReleaseIds: readonly string[];
90
+ /** Explicit currency offers on the Discover shelf, in display order. */
91
+ discoverSales: readonly DiscoverSale[];
96
92
  }
97
93
 
98
- const TESTNET: MisoConfig = {
99
- network: "testnet",
100
- protocol: {
101
- miso: MISO_PLATFORM_DEPLOYMENTS.testnet.protocol.packageId,
102
- drop: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.drop,
103
- record: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.record,
104
- recordSettings: MISO_PLATFORM_DEPLOYMENTS.testnet.objects.recordSettings,
105
- releaseRegistry: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.releaseRegistry,
106
- releaseRegistryId: MISO_PLATFORM_DEPLOYMENTS.testnet.objects.releaseRegistry,
107
- releaseCoverArt: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.releaseCoverArt,
108
- compositionCredits: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.compositionCredits,
109
- recordingCredits: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.recordingCredits,
110
- releaseCredits: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.releaseCredits,
111
- credit: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.credit,
112
- },
113
- party: MISO_PLATFORM_DEPLOYMENTS.testnet.party,
114
- money: {
115
- usdCoinType: "0x77774cb7b8cb5622b4ef2658101bf5f1e965418297fe874b683df8f760b6e749::fakeusd::FakeUsd",
116
- usdDecimals: 6,
117
- },
118
- grpcUrl: "https://fullnode.testnet.sui.io",
119
- graphqlUrl: "https://graphql.testnet.sui.io/graphql",
120
- walrusAggregatorUrl: "https://aggregator.walrus-testnet.walrus.space",
121
- apiBaseUrl: "https://api.testnet.miso.fm",
122
- // Content from the retired deployment is intentionally not carried forward.
123
- discoverReleaseIds: [],
124
- };
94
+ /** One release/currency pair to resolve by Pressing and Listing derived address. */
95
+ export interface DiscoverSale {
96
+ releaseId: string;
97
+ currencyType: string;
98
+ }
125
99
 
126
100
  /** Fields a deployment may override without forking the whole config (endpoints, shelf). */
127
101
  export type MisoConfigOverrides = Partial<
128
- Pick<MisoConfig, "grpcUrl" | "graphqlUrl" | "walrusAggregatorUrl" | "apiBaseUrl" | "discoverReleaseIds">
102
+ Pick<MisoConfig, "grpcUrl" | "graphqlUrl" | "walrusAggregatorUrl" | "apiBaseUrl" | "discoverSales">
129
103
  >;
130
104
 
131
105
  /**
132
- * The config for `network`. Mainnet throws until its packages are deployed and
133
- * filled in here a mainnet worker must fail loudly, never read testnet ids.
106
+ * Bundled read configuration is disabled until the admin-cli publish flow has
107
+ * recorded every new immutable package and singleton object. This is fail-closed
108
+ * by design: old testnet types cannot be mistaken for the current ABI.
134
109
  */
135
110
  export function misoConfig(network: Network, overrides: MisoConfigOverrides = {}): MisoConfig {
136
- if (network === "mainnet") {
137
- throw new Error(
138
- `@misofm/sdk/read: no bundled Miso platform deployment for network "${network}".`,
139
- );
140
- }
141
- return { ...TESTNET, ...stripUndefined(overrides) };
111
+ void overrides;
112
+ throw new Error(
113
+ `@misofm/sdk/read: no bundled Miso platform deployment for network "${network}". ` +
114
+ "Pass a complete verified MisoConfig to createMisoClient instead.",
115
+ );
142
116
  }
143
117
 
144
118
  /** `{ a: undefined }` must not clobber a real default when spread. */
package/src/read/index.ts CHANGED
@@ -21,6 +21,7 @@ export { misoConfig, networkFrom } from "./config.ts";
21
21
  export type {
22
22
  MisoConfig,
23
23
  MisoConfigOverrides,
24
+ DiscoverSale,
24
25
  MoneyIds,
25
26
  Network,
26
27
  PartyIds,
@@ -30,12 +31,13 @@ export type {
30
31
  export {
31
32
  currencyInfo,
32
33
  getDiscoverShelf,
33
- getDropPreview,
34
34
  getPressingDetail,
35
+ getPressingPreview,
35
36
  getRecordAlbum,
36
37
  getReleaseDetail,
37
38
  getReleaseResources,
38
39
  getTrackCredits,
40
+ getSaleDetail,
39
41
  primaryArtistNames,
40
42
  readReleaseCover,
41
43
  } from "./catalog.ts";
@@ -5,7 +5,7 @@
5
5
  //
6
6
  // The transaction digest is the receipt's identity: everything shown is
7
7
  // re-derived from chain state, so a receipt link survives a refresh, a deep link,
8
- // or a share to another device. `drop::buy` emits ONE `RecordSoldEvent` carrying
8
+ // or a share to another device. `listing::buy` emits ONE `RecordSoldEvent` carrying
9
9
  // the copy that was minted, its number in the run, and what the buyer paid.
10
10
  //
11
11
  // Two reads, in order, because a receipt is opened at two very different ages:
@@ -20,21 +20,22 @@
20
20
  // read walks. We show the buyer that arithmetic, in the same truncating integer
21
21
  // math the chain does.
22
22
 
23
- import * as dropContract from "../contracts/miso_drop/drop.ts";
23
+ import * as listingContract from "../contracts/miso_pressing/listing.ts";
24
24
  import {
25
25
  extractTypeParams2,
26
26
  getCompositionsByIds,
27
27
  } from "@misonetwork/sdk";
28
+ import { normalizeStructTag, normalizeSuiAddress } from "@mysten/sui/utils";
28
29
  import { getPressingDetail } from "./catalog.ts";
29
30
  import type { MisoClient } from "./client.ts";
30
31
  import { int, u64 } from "./internal/scalars.ts";
31
- import type { PressingDetail, PurchaseReceipt, RecordSale, TrackRoyalty } from "./types.ts";
32
+ import type { Price, PressingDetail, PurchaseReceipt, RecordSale, TrackRoyalty } from "./types.ts";
32
33
  import { getWorkAddressesByShareTypes } from "./works.ts";
33
34
 
34
35
  const BPS = 10_000n;
35
36
 
36
- /** `…::drop::RecordSoldEvent<Currency>` — the one event `drop::buy` emits. */
37
- const RECORD_SOLD_EVENT = "::drop::RecordSoldEvent";
37
+ /** `miso_pressing::listing::RecordSoldEvent<Currency>` — emitted by `listing::buy`. */
38
+ const RECORD_SOLD_EVENT_NAME = "listing::RecordSoldEvent";
38
39
 
39
40
  /**
40
41
  * How long to wait for the fullnode to have the transaction before falling back
@@ -53,6 +54,24 @@ function coerceBigInt(v: unknown): bigint | null {
53
54
  return null;
54
55
  }
55
56
 
57
+ function priceFromUnknown(value: unknown): Price | null {
58
+ if (!value || typeof value !== "object") return null;
59
+ const variants = value as {
60
+ $kind?: string;
61
+ Fixed?: { amount?: unknown };
62
+ Floor?: { amount?: unknown };
63
+ fixed?: { amount?: unknown };
64
+ floor?: { amount?: unknown };
65
+ };
66
+ const fixed = variants.$kind === "Fixed" || variants.Fixed != null || variants.fixed != null;
67
+ const amount = coerceBigInt(
68
+ fixed
69
+ ? (variants.Fixed ?? variants.fixed)?.amount
70
+ : (variants.Floor ?? variants.floor)?.amount,
71
+ );
72
+ return amount == null ? null : { kind: fixed ? "fixed" : "floor", amount: amount.toString() };
73
+ }
74
+
56
75
  /**
57
76
  * The event's JSON projection — the fallback for transports that surface `json`
58
77
  * but no BCS. Field names are the Move ones (snake_case).
@@ -61,35 +80,83 @@ function saleFromJson(json: Record<string, unknown>): RecordSale | null {
61
80
  const number = coerceBigInt(json.number);
62
81
  const paid = coerceBigInt(json.paid);
63
82
  const recordId = json.record_id;
64
- if (number == null || paid == null || typeof recordId !== "string") return null;
83
+ const price = priceFromUnknown(json.price);
84
+ if (number == null || paid == null || !price || typeof recordId !== "string") return null;
65
85
  return {
66
- dropId: typeof json.drop_id === "string" ? json.drop_id : "",
86
+ listingId: typeof json.listing_id === "string" ? json.listing_id : "",
87
+ pressingId: typeof json.pressing_id === "string" ? json.pressing_id : "",
67
88
  releaseId: typeof json.release_id === "string" ? json.release_id : "",
68
- edition: int(coerceBigInt(json.edition) ?? 0n),
69
89
  recordId,
70
90
  number: number.toString(),
71
91
  paid: paid.toString(),
92
+ price,
72
93
  buyer: typeof json.buyer === "string" ? json.buyer : "",
73
94
  };
74
95
  }
75
96
 
97
+ /**
98
+ * Whether `eventType` is this deployment's `listing::RecordSoldEvent<Currency>`.
99
+ *
100
+ * Event BCS is structural, so a same-shaped event from another package must never
101
+ * be decoded as a Miso sale. Normalize both package/type tags and require exactly
102
+ * one (possibly nested) currency type argument.
103
+ */
104
+ export function isRecordSoldEventType(
105
+ eventType: string,
106
+ misoPressingPackageId: string,
107
+ ): boolean {
108
+ let tag: string;
109
+ try {
110
+ tag = normalizeStructTag(eventType);
111
+ } catch {
112
+ return false;
113
+ }
114
+
115
+ const prefix = `${normalizeSuiAddress(misoPressingPackageId)}::${RECORD_SOLD_EVENT_NAME}`;
116
+ if (!tag.startsWith(`${prefix}<`) || !tag.endsWith(">")) return false;
117
+
118
+ const typeArgument = tag.slice(prefix.length + 1, -1);
119
+ if (!typeArgument) return false;
120
+ let depth = 0;
121
+ for (const char of typeArgument) {
122
+ if (char === "<") depth += 1;
123
+ else if (char === ">") {
124
+ depth -= 1;
125
+ if (depth < 0) return false;
126
+ } else if (char === "," && depth === 0) {
127
+ return false;
128
+ }
129
+ }
130
+ return depth === 0;
131
+ }
132
+
76
133
  /**
77
134
  * The sale a transaction recorded, or null if it emitted none. BCS is the stable
78
135
  * shape (a JSON projection's field names vary by transport), so it is tried first.
79
136
  */
80
- function findSale(events: { eventType: string; bcs: Uint8Array; json: Record<string, unknown> | null }[]): RecordSale | null {
137
+ export function findRecordSale(
138
+ events: {
139
+ eventType: string;
140
+ bcs: Uint8Array;
141
+ json: Record<string, unknown> | null;
142
+ }[],
143
+ misoPressingPackageId: string,
144
+ ): RecordSale | null {
81
145
  for (const e of events) {
82
- if (!e.eventType.includes(RECORD_SOLD_EVENT)) continue;
146
+ if (!isRecordSoldEventType(e.eventType, misoPressingPackageId)) continue;
83
147
  try {
84
148
  // The generated struct decodes addresses to 0x-hex and u64s to decimal strings.
85
- const s = dropContract.RecordSoldEvent.parse(e.bcs);
149
+ const s = listingContract.RecordSoldEvent.parse(e.bcs);
150
+ const price = priceFromUnknown(s.price);
151
+ if (!price) continue;
86
152
  return {
87
- dropId: s.drop_id,
153
+ listingId: s.listing_id,
154
+ pressingId: s.pressing_id,
88
155
  releaseId: s.release_id,
89
- edition: int(s.edition),
90
156
  recordId: s.record_id,
91
157
  number: u64(s.number),
92
158
  paid: u64(s.paid),
159
+ price,
93
160
  buyer: s.buyer,
94
161
  };
95
162
  } catch {
@@ -111,7 +178,10 @@ async function saleFromFullnode(client: MisoClient, txDigest: string): Promise<R
111
178
  if (result.$kind !== "Transaction" || !result.Transaction.status.success) {
112
179
  throw new Error(`Transaction did not succeed: ${txDigest}`);
113
180
  }
114
- const sale = findSale(result.Transaction.events);
181
+ const sale = findRecordSale(
182
+ result.Transaction.events,
183
+ client.config.protocol.pressing,
184
+ );
115
185
  if (!sale) throw new Error(`No record purchase in transaction ${txDigest}`);
116
186
  return sale;
117
187
  }
@@ -148,7 +218,15 @@ async function saleFromIndexer(client: MisoClient, txDigest: string): Promise<Re
148
218
 
149
219
  for (const node of effects.events?.nodes ?? []) {
150
220
  const contents = node.contents;
151
- if (!contents?.type.repr.includes(RECORD_SOLD_EVENT)) continue;
221
+ if (
222
+ !contents ||
223
+ !isRecordSoldEventType(
224
+ contents.type.repr,
225
+ client.config.protocol.pressing,
226
+ )
227
+ ) {
228
+ continue;
229
+ }
152
230
  const sale =
153
231
  typeof contents.json === "object" && contents.json !== null
154
232
  ? saleFromJson(contents.json as Record<string, unknown>)
@@ -233,22 +311,21 @@ export function breakdown(
233
311
  }
234
312
 
235
313
  /**
236
- * The receipt for `txDigest`, a purchase from `pressingId`.
314
+ * The receipt for `txDigest`. The event identifies the exact immutable Pressing
315
+ * and Listing; callers cannot accidentally reinterpret a Pressing id as a
316
+ * retired drop id.
237
317
  *
238
- * The sale and the pressing detail are fetched together arriving from the buy
239
- * button costs one round of work, not two. `null` when the pressing no longer
240
- * exists (a superseded edition), which the caller renders as "not found" rather
241
- * than as an error.
318
+ * The sale identifies the Pressing before its detail is fetched. `null` only when
319
+ * that immutable Pressing cannot be read; it is never superseded or destroyed.
242
320
  */
243
321
  export async function getPurchaseReceipt(
244
322
  client: MisoClient,
245
- pressingId: string,
246
323
  txDigest: string,
247
324
  ): Promise<PurchaseReceipt | null> {
248
- const [sale, detail] = await Promise.all([
249
- saleFromFullnode(client, txDigest).catch(() => saleFromIndexer(client, txDigest)),
250
- getPressingDetail(client, pressingId),
251
- ]);
325
+ const sale = await saleFromFullnode(client, txDigest).catch(() =>
326
+ saleFromIndexer(client, txDigest),
327
+ );
328
+ const detail = await getPressingDetail(client, sale.pressingId);
252
329
  if (!detail) return null;
253
330
 
254
331
  // Best-effort: a failed composition lookup costs the sub-rows, not the page.
@@ -260,7 +337,7 @@ export async function getPurchaseReceipt(
260
337
  return {
261
338
  sale,
262
339
  detail,
263
- price: detail.pressing.price.amount,
340
+ price: sale.price.amount,
264
341
  tracks: breakdown(detail.release.tracks, sale.paid, rates),
265
342
  };
266
343
  }
package/src/read/types.ts CHANGED
@@ -5,8 +5,8 @@
5
5
  //
6
6
  // ONE RULE GOVERNS THIS FILE: these shapes must survive `JSON.stringify`.
7
7
  //
8
- // The protocol SDK hands back `bigint` for every u64/u128 (`DropView.price.amount`,
9
- // `quantitySold`, timestamps, balances). `JSON.stringify` THROWS on a bigint, so a
8
+ // The protocol SDK hands back `bigint` for every u64/u128 (pressing supply, listing
9
+ // prices, timestamps, balances). `JSON.stringify` THROWS on a bigint, so a
10
10
  // view type that carries one cannot cross an HTTP boundary — it would work in the
11
11
  // browser-direct world these shapes came from and fail the moment an API serves
12
12
  // them. Every such field is therefore a DECIMAL STRING here, converted once at the
@@ -104,28 +104,40 @@ export interface Price {
104
104
 
105
105
  /** Symbol + decimals for a pressing's currency, resolved from its coin type. */
106
106
  export interface Currency {
107
- /** Full Move coin type, or null when the drop's type tag was unreadable. */
107
+ /** Full Move coin type, or null when the Listing type tag was unreadable. */
108
108
  type: string | null;
109
109
  symbol: string;
110
110
  decimals: number;
111
111
  }
112
112
 
113
- /** A pressing (a record sale) as the buy page and shelf tiles read it. */
113
+ /** A permanent record-production run derived from a release. */
114
114
  export interface PressingView {
115
115
  id: string;
116
116
  releaseId: string;
117
- edition: number;
117
+ /** The one run-wide sale switch. Scheduled carries its opening time. */
118
+ state:
119
+ | { kind: "scheduled"; startTimestampMs: number }
120
+ | { kind: "active" }
121
+ | { kind: "paused" };
122
+ /** Records pressed so far, decimal string. The run is intentionally uncapped. */
123
+ supply: string;
124
+ }
125
+
126
+ /** One permanent currency offer derived from a Pressing. */
127
+ export interface ListingView {
128
+ id: string;
129
+ pressingId: string;
130
+ releaseId: string;
118
131
  price: Price;
119
132
  currency: Currency;
120
- /** Copies sold so far, decimal string. */
121
- quantitySold: string;
122
- /** Null = uncapped (an open edition). Decimal string otherwise. */
123
- maxSupply: string | null;
124
- startTimestampMs: number;
125
- /** Null = evergreen. */
126
- endTimestampMs: number | null;
127
- /** Derived: `quantitySold >= maxSupply`. Always false for an open edition. */
128
- soldOut: boolean;
133
+ /** The per-currency switch; the Pressing state still governs every purchase. */
134
+ state: "enabled" | "disabled";
135
+ }
136
+
137
+ /** A Pressing plus the requested currency's Listing. */
138
+ export interface SaleView {
139
+ pressing: PressingView;
140
+ listing: ListingView;
129
141
  }
130
142
 
131
143
  /** Everything the pressing buy page renders. */
@@ -134,9 +146,15 @@ export interface PressingDetail {
134
146
  release: ReleaseDetail;
135
147
  }
136
148
 
149
+ /** Everything a currency-specific buy page renders. */
150
+ export interface SaleDetail {
151
+ sale: SaleView;
152
+ release: ReleaseDetail;
153
+ }
154
+
137
155
  /** One tile on the Discover shelf. */
138
156
  export interface DiscoverItem {
139
- pressing: PressingView;
157
+ sale: SaleView;
140
158
  releaseId: string;
141
159
  title: string;
142
160
  /** Primary artists, joined for display. Empty when no credits are set. */
@@ -153,14 +171,14 @@ export interface RecordAlbum {
153
171
  release?: ReleaseDetail | null;
154
172
  }
155
173
 
156
- /** The confirmation preview shown when an owner pastes a pressing id to pin. */
157
- export interface DropPreview {
174
+ /** The confirmation preview shown when an owner pastes a Pressing id to pin. */
175
+ export interface PressingPreview {
158
176
  pressingId: string;
159
- currency: Currency;
160
177
  title: string;
161
178
  subtitle: string | null;
162
179
  coverUrl: string | null;
163
- price: Price;
180
+ state: PressingView["state"];
181
+ supply: string;
164
182
  trackCount: number;
165
183
  }
166
184
 
@@ -249,7 +267,7 @@ export interface ArtistProfile {
249
267
  avatarUrl: string;
250
268
  }
251
269
 
252
- /** A party's pinned pressing, fully resolved. Null when nothing is pinned. */
270
+ /** A party's pinned Pressing, fully resolved. Null when nothing is pinned. */
253
271
  export interface FeaturedRelease {
254
272
  pressingId: string;
255
273
  releaseId: string;
@@ -345,15 +363,17 @@ export interface Ownership {
345
363
 
346
364
  /** The sale itself, as the chain recorded it. */
347
365
  export interface RecordSale {
348
- dropId: string;
366
+ listingId: string;
367
+ pressingId: string;
349
368
  releaseId: string;
350
- edition: number;
351
369
  /** The `Record` object minted to the buyer. */
352
370
  recordId: string;
353
- /** This copy's number in the edition's run (1-based), decimal string. */
371
+ /** This copy's number in the Pressing run (1-based), decimal string. */
354
372
  number: string;
355
373
  /** What the buyer actually paid, in the currency's base units. */
356
374
  paid: string;
375
+ /** The fixed or floor price that the Listing accepted at this sale. */
376
+ price: Price;
357
377
  buyer: string;
358
378
  }
359
379
 
@@ -378,10 +398,7 @@ export interface PurchaseReceipt {
378
398
  sale: RecordSale;
379
399
  /** The pressing/release the copy came from — cover, title, tracklist. */
380
400
  detail: PressingDetail;
381
- /**
382
- * The drop's list price. Differs from `sale.paid` when the buyer paid over a
383
- * floor price, or when the price changed in a later edition.
384
- */
401
+ /** The Listing price captured at sale time, not its mutable current value. */
385
402
  price: string;
386
403
  tracks: TrackRoyalty[];
387
404
  }
@@ -0,0 +1,102 @@
1
+ // Copyright (c) Miso Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ /** Cap-authorized builders for data-only Recording metadata extensions. */
5
+
6
+ import type { TransactionArgument } from "@mysten/sui/transactions";
7
+ import type { TxThunk } from "./transactions.ts";
8
+ import { invokeWithAdminCap, type AdminCapAuthority } from "./vault.ts";
9
+ import * as advisory from "./contracts/recording_advisory/recording_advisory.ts";
10
+ import * as language from "./contracts/recording_language/recording_language.ts";
11
+ import * as masterReference from "./contracts/recording_master_reference/recording_master_reference.ts";
12
+ import * as preview from "./contracts/recording_preview/recording_preview.ts";
13
+
14
+ export interface RecordingExtensionTarget {
15
+ readonly recordingId: string;
16
+ readonly authority: AdminCapAuthority;
17
+ readonly recordingShareType: string;
18
+ readonly compositionShareType: string;
19
+ }
20
+
21
+ type Rating = "Explicit" | "NotExplicit" | "Cleaned";
22
+ export interface SetRecordingAdvisoryParams extends RecordingExtensionTarget {
23
+ readonly recordingAdvisoryPackageId: string;
24
+ readonly rating: Rating;
25
+ }
26
+
27
+ export function setRecordingAdvisory(p: SetRecordingAdvisoryParams): TxThunk {
28
+ return (tx) => {
29
+ const rating = tx.add(
30
+ p.rating === "Explicit" ? advisory.explicit({ package: p.recordingAdvisoryPackageId })
31
+ : p.rating === "NotExplicit" ? advisory.notExplicit({ package: p.recordingAdvisoryPackageId })
32
+ : advisory.cleaned({ package: p.recordingAdvisoryPackageId }),
33
+ );
34
+ invokeWithAdminCap(tx, p.authority, {
35
+ target: `${p.recordingAdvisoryPackageId}::recording_advisory::set_rating`,
36
+ typeArguments: [p.recordingShareType, p.compositionShareType],
37
+ arguments: [tx.object(p.recordingId), rating],
38
+ adminCapIndex: 1,
39
+ });
40
+ };
41
+ }
42
+
43
+ export interface SetRecordingLanguagesParams extends RecordingExtensionTarget {
44
+ readonly recordingLanguagePackageId: string;
45
+ /** A vector<LanguageCode> built by the language-code package in this PTB. */
46
+ readonly languages: TransactionArgument;
47
+ }
48
+
49
+ export function setRecordingLanguages(p: SetRecordingLanguagesParams): TxThunk {
50
+ return (tx) => {
51
+ invokeWithAdminCap(tx, p.authority, {
52
+ target: `${p.recordingLanguagePackageId}::recording_language::set_languages`,
53
+ typeArguments: [p.recordingShareType, p.compositionShareType],
54
+ arguments: [tx.object(p.recordingId), p.languages],
55
+ adminCapIndex: 1,
56
+ });
57
+ };
58
+ }
59
+
60
+ export function setRecordingInstrumental(p: Omit<SetRecordingLanguagesParams, "languages">): TxThunk {
61
+ return (tx) => {
62
+ invokeWithAdminCap(tx, p.authority, {
63
+ target: `${p.recordingLanguagePackageId}::recording_language::set_instrumental`,
64
+ typeArguments: [p.recordingShareType, p.compositionShareType],
65
+ arguments: [tx.object(p.recordingId)],
66
+ adminCapIndex: 1,
67
+ });
68
+ };
69
+ }
70
+
71
+ interface RecordingWalrusReferenceParams extends RecordingExtensionTarget {
72
+ /** An ori::WalrusData value assembled in the same PTB (must be a standalone blob on chain). */
73
+ readonly reference: TransactionArgument;
74
+ }
75
+
76
+ export interface SetRecordingMasterReferenceParams extends RecordingWalrusReferenceParams {
77
+ readonly recordingMasterReferencePackageId: string;
78
+ }
79
+ export function setRecordingMasterReference(p: SetRecordingMasterReferenceParams): TxThunk {
80
+ return (tx) => {
81
+ invokeWithAdminCap(tx, p.authority, {
82
+ target: `${p.recordingMasterReferencePackageId}::recording_master_reference::set_master_reference`,
83
+ typeArguments: [p.recordingShareType, p.compositionShareType],
84
+ arguments: [tx.object(p.recordingId), p.reference],
85
+ adminCapIndex: 1,
86
+ });
87
+ };
88
+ }
89
+
90
+ export interface SetRecordingPreviewParams extends RecordingWalrusReferenceParams {
91
+ readonly recordingPreviewPackageId: string;
92
+ }
93
+ export function setRecordingPreview(p: SetRecordingPreviewParams): TxThunk {
94
+ return (tx) => {
95
+ invokeWithAdminCap(tx, p.authority, {
96
+ target: `${p.recordingPreviewPackageId}::recording_preview::set_preview`,
97
+ typeArguments: [p.recordingShareType, p.compositionShareType],
98
+ arguments: [tx.object(p.recordingId), p.reference],
99
+ adminCapIndex: 1,
100
+ });
101
+ };
102
+ }