@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.
- package/README.md +181 -124
- package/dist/client.d.ts +1229 -15
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +43 -21
- package/dist/client.js.map +1 -1
- package/dist/contracts/composition_credits/composition_credits.d.ts +181 -0
- package/dist/contracts/composition_credits/composition_credits.d.ts.map +1 -0
- package/dist/contracts/composition_credits/composition_credits.js +109 -0
- package/dist/contracts/composition_credits/composition_credits.js.map +1 -0
- package/dist/contracts/composition_credits/composition_party_role.d.ts +119 -0
- package/dist/contracts/composition_credits/composition_party_role.d.ts.map +1 -0
- package/dist/contracts/composition_credits/composition_party_role.js +139 -0
- package/dist/contracts/composition_credits/composition_party_role.js.map +1 -0
- package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts +24 -0
- package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts.map +1 -0
- package/dist/contracts/composition_credits/deps/miso_credit/credit.js +23 -0
- package/dist/contracts/composition_credits/deps/miso_credit/credit.js.map +1 -0
- package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/composition_credits/deps/sui/vec_map.js +28 -0
- package/dist/contracts/composition_credits/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/miso/composition.d.ts +17 -39
- package/dist/contracts/miso/composition.d.ts.map +1 -1
- package/dist/contracts/miso/composition.js +18 -39
- package/dist/contracts/miso/composition.js.map +1 -1
- package/dist/contracts/miso/deps/bps/bps.d.ts +1 -1
- package/dist/contracts/miso/deps/bps/bps.js +1 -1
- package/dist/contracts/miso/recording.d.ts +44 -19
- package/dist/contracts/miso/recording.d.ts.map +1 -1
- package/dist/contracts/miso/recording.js +46 -20
- package/dist/contracts/miso/recording.js.map +1 -1
- package/dist/contracts/miso/release.d.ts +63 -37
- package/dist/contracts/miso/release.d.ts.map +1 -1
- package/dist/contracts/miso/release.js +65 -38
- package/dist/contracts/miso/release.js.map +1 -1
- package/dist/contracts/miso/track.d.ts +41 -10
- package/dist/contracts/miso/track.d.ts.map +1 -1
- package/dist/contracts/miso/track.js +44 -10
- package/dist/contracts/miso/track.js.map +1 -1
- package/dist/contracts/recording_advisory/recording_advisory.d.ts +194 -0
- package/dist/contracts/recording_advisory/recording_advisory.d.ts.map +1 -0
- package/dist/contracts/recording_advisory/recording_advisory.js +204 -0
- package/dist/contracts/recording_advisory/recording_advisory.js.map +1 -0
- package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts +24 -0
- package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts.map +1 -0
- package/dist/contracts/recording_credits/deps/miso_credit/credit.js +23 -0
- package/dist/contracts/recording_credits/deps/miso_credit/credit.js.map +1 -0
- package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/recording_credits/deps/sui/vec_map.js +28 -0
- package/dist/contracts/recording_credits/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts +21 -0
- package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts.map +1 -0
- package/dist/contracts/recording_credits/deps/sui/vec_set.js +20 -0
- package/dist/contracts/recording_credits/deps/sui/vec_set.js.map +1 -0
- package/dist/contracts/recording_credits/recording_credits.d.ts +2313 -0
- package/dist/contracts/recording_credits/recording_credits.d.ts.map +1 -0
- package/dist/contracts/recording_credits/recording_credits.js +270 -0
- package/dist/contracts/recording_credits/recording_credits.js.map +1 -0
- package/dist/contracts/recording_credits/recording_party_role.d.ts +1174 -0
- package/dist/contracts/recording_credits/recording_party_role.d.ts.map +1 -0
- package/dist/contracts/recording_credits/recording_party_role.js +692 -0
- package/dist/contracts/recording_credits/recording_party_role.js.map +1 -0
- package/dist/contracts/recording_language/deps/language_code/language_code.d.ts +6 -0
- package/dist/contracts/recording_language/deps/language_code/language_code.d.ts.map +1 -0
- package/dist/contracts/recording_language/deps/language_code/language_code.js +8 -0
- package/dist/contracts/recording_language/deps/language_code/language_code.js.map +1 -0
- package/dist/contracts/recording_language/recording_language.d.ts +152 -0
- package/dist/contracts/recording_language/recording_language.d.ts.map +1 -0
- package/dist/contracts/recording_language/recording_language.js +149 -0
- package/dist/contracts/recording_language/recording_language.js.map +1 -0
- package/dist/contracts/recording_master_reference/deps/ori/walrus_data.d.ts +52 -0
- package/dist/contracts/recording_master_reference/deps/ori/walrus_data.d.ts.map +1 -0
- package/dist/contracts/recording_master_reference/deps/ori/walrus_data.js +37 -0
- package/dist/contracts/recording_master_reference/deps/ori/walrus_data.js.map +1 -0
- package/dist/contracts/recording_master_reference/recording_master_reference.d.ts +131 -0
- package/dist/contracts/recording_master_reference/recording_master_reference.d.ts.map +1 -0
- package/dist/contracts/recording_master_reference/recording_master_reference.js +121 -0
- package/dist/contracts/recording_master_reference/recording_master_reference.js.map +1 -0
- package/dist/contracts/recording_preview/deps/ori/walrus_data.d.ts +52 -0
- package/dist/contracts/recording_preview/deps/ori/walrus_data.d.ts.map +1 -0
- package/dist/contracts/recording_preview/deps/ori/walrus_data.js +37 -0
- package/dist/contracts/recording_preview/deps/ori/walrus_data.js.map +1 -0
- package/dist/contracts/recording_preview/recording_preview.d.ts +104 -0
- package/dist/contracts/recording_preview/recording_preview.d.ts.map +1 -0
- package/dist/contracts/recording_preview/recording_preview.js +94 -0
- package/dist/contracts/recording_preview/recording_preview.js.map +1 -0
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts +52 -0
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts.map +1 -0
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js +37 -0
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js.map +1 -0
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts +46 -0
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts.map +1 -0
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js +21 -0
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js.map +1 -0
- package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts +33 -0
- package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts.map +1 -0
- package/dist/contracts/release_cover_art/deps/per_track/per_track.js +32 -0
- package/dist/contracts/release_cover_art/deps/per_track/per_track.js.map +1 -0
- package/dist/contracts/release_cover_art/release_cover_art.d.ts +300 -0
- package/dist/contracts/release_cover_art/release_cover_art.d.ts.map +1 -0
- package/dist/contracts/release_cover_art/release_cover_art.js +168 -0
- package/dist/contracts/release_cover_art/release_cover_art.js.map +1 -0
- package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts +24 -0
- package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts.map +1 -0
- package/dist/contracts/release_credits/deps/miso_credit/credit.js +23 -0
- package/dist/contracts/release_credits/deps/miso_credit/credit.js.map +1 -0
- package/dist/contracts/release_credits/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/release_credits/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/release_credits/deps/sui/vec_map.js +28 -0
- package/dist/contracts/release_credits/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/release_credits/release_credits.d.ts +142 -0
- package/dist/contracts/release_credits/release_credits.d.ts.map +1 -0
- package/dist/contracts/release_credits/release_credits.js +108 -0
- package/dist/contracts/release_credits/release_credits.js.map +1 -0
- package/dist/contracts/release_credits/release_party_role.d.ts +58 -0
- package/dist/contracts/release_credits/release_party_role.d.ts.map +1 -0
- package/dist/contracts/release_credits/release_party_role.js +66 -0
- package/dist/contracts/release_credits/release_party_role.js.map +1 -0
- package/dist/contracts/release_description/release_description.d.ts +112 -0
- package/dist/contracts/release_description/release_description.d.ts.map +1 -0
- package/dist/contracts/release_description/release_description.js +123 -0
- package/dist/contracts/release_description/release_description.js.map +1 -0
- package/dist/contracts/release_dsp_link/release_dsp_link.d.ts +644 -0
- package/dist/contracts/release_dsp_link/release_dsp_link.d.ts.map +1 -0
- package/dist/contracts/release_dsp_link/release_dsp_link.js +556 -0
- package/dist/contracts/release_dsp_link/release_dsp_link.js.map +1 -0
- package/dist/contracts/release_genre/deps/per_track/per_track.d.ts +33 -0
- package/dist/contracts/release_genre/deps/per_track/per_track.d.ts.map +1 -0
- package/dist/contracts/release_genre/deps/per_track/per_track.js +32 -0
- package/dist/contracts/release_genre/deps/per_track/per_track.js.map +1 -0
- package/dist/contracts/release_genre/release_genre.d.ts +193 -0
- package/dist/contracts/release_genre/release_genre.d.ts.map +1 -0
- package/dist/contracts/release_genre/release_genre.js +207 -0
- package/dist/contracts/release_genre/release_genre.js.map +1 -0
- package/dist/contracts/release_kind/release_kind.d.ts +98 -0
- package/dist/contracts/release_kind/release_kind.d.ts.map +1 -0
- package/dist/contracts/release_kind/release_kind.js +109 -0
- package/dist/contracts/release_kind/release_kind.js.map +1 -0
- package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.d.ts +52 -0
- package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.d.ts.map +1 -0
- package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.js +37 -0
- package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.js.map +1 -0
- package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.d.ts +91 -0
- package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.d.ts.map +1 -0
- package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.js +91 -0
- package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.js.map +1 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts +54 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts.map +1 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.js +37 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.js.map +1 -0
- package/dist/contracts/routed_stake/deps/std/type_name.d.ts +18 -0
- package/dist/contracts/routed_stake/deps/std/type_name.d.ts.map +1 -0
- package/dist/contracts/routed_stake/deps/std/type_name.js +20 -0
- package/dist/contracts/routed_stake/deps/std/type_name.js.map +1 -0
- package/dist/contracts/routed_stake/deps/sui/balance.d.ts +13 -0
- package/dist/contracts/routed_stake/deps/sui/balance.d.ts.map +1 -0
- package/dist/contracts/routed_stake/deps/sui/balance.js +15 -0
- package/dist/contracts/routed_stake/deps/sui/balance.js.map +1 -0
- package/dist/contracts/routed_stake/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/routed_stake/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/routed_stake/deps/sui/vec_map.js +28 -0
- package/dist/contracts/routed_stake/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/routed_stake/routed_stake.d.ts +356 -0
- package/dist/contracts/routed_stake/routed_stake.d.ts.map +1 -0
- package/dist/contracts/routed_stake/routed_stake.js +311 -0
- package/dist/contracts/routed_stake/routed_stake.js.map +1 -0
- package/dist/contracts/royalty_pool/deps/std/type_name.d.ts +18 -0
- package/dist/contracts/royalty_pool/deps/std/type_name.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/deps/std/type_name.js +20 -0
- package/dist/contracts/royalty_pool/deps/std/type_name.js.map +1 -0
- package/dist/contracts/royalty_pool/deps/sui/balance.d.ts +13 -0
- package/dist/contracts/royalty_pool/deps/sui/balance.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/deps/sui/balance.js +15 -0
- package/dist/contracts/royalty_pool/deps/sui/balance.js.map +1 -0
- package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/deps/sui/vec_map.js +28 -0
- package/dist/contracts/royalty_pool/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/royalty_pool/pool.d.ts +394 -0
- package/dist/contracts/royalty_pool/pool.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/pool.js +387 -0
- package/dist/contracts/royalty_pool/pool.js.map +1 -0
- package/dist/contracts/royalty_pool/stake.d.ts +202 -0
- package/dist/contracts/royalty_pool/stake.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/stake.js +197 -0
- package/dist/contracts/royalty_pool/stake.js.map +1 -0
- package/dist/contracts.d.ts +37 -3
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +42 -8
- package/dist/contracts.js.map +1 -1
- package/dist/deployments.d.ts +46 -12
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +119 -11
- package/dist/deployments.js.map +1 -1
- package/dist/events.d.ts +1081 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +124 -0
- package/dist/events.js.map +1 -0
- package/dist/execute.d.ts.map +1 -1
- package/dist/execute.js +0 -4
- package/dist/execute.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +2 -0
- package/dist/internal.js.map +1 -1
- package/dist/numeric.d.ts +5 -0
- package/dist/numeric.d.ts.map +1 -0
- package/dist/numeric.js +21 -0
- package/dist/numeric.js.map +1 -0
- package/dist/packages.d.ts +159 -0
- package/dist/packages.d.ts.map +1 -0
- package/dist/packages.js +179 -0
- package/dist/packages.js.map +1 -0
- package/dist/parsers.d.ts +5 -2
- package/dist/parsers.d.ts.map +1 -1
- package/dist/parsers.js +19 -7
- package/dist/parsers.js.map +1 -1
- package/dist/queries.d.ts +92 -0
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +132 -23
- package/dist/queries.js.map +1 -1
- package/dist/transactions.d.ts +96 -12
- package/dist/transactions.d.ts.map +1 -1
- package/dist/transactions.js +124 -14
- package/dist/transactions.js.map +1 -1
- package/dist/types.d.ts +35 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/view.d.ts +6 -5
- package/dist/view.d.ts.map +1 -1
- package/dist/view.js +8 -2
- package/dist/view.js.map +1 -1
- package/package.json +14 -4
- package/src/client.ts +57 -25
- package/src/contracts/composition_credits/composition_credits.ts +169 -0
- package/src/contracts/composition_credits/composition_party_role.ts +189 -0
- package/src/contracts/composition_credits/deps/miso_credit/credit.ts +27 -0
- package/src/contracts/composition_credits/deps/sui/vec_map.ts +33 -0
- package/src/contracts/miso/composition.ts +24 -61
- package/src/contracts/miso/deps/bps/bps.ts +3 -3
- package/src/contracts/miso/recording.ts +69 -32
- package/src/contracts/miso/release.ts +103 -67
- package/src/contracts/miso/track.ts +56 -13
- package/src/contracts/recording_advisory/recording_advisory.ts +315 -0
- package/src/contracts/recording_credits/deps/miso_credit/credit.ts +27 -0
- package/src/contracts/recording_credits/deps/sui/vec_map.ts +33 -0
- package/src/contracts/recording_credits/deps/sui/vec_set.ts +21 -0
- package/src/contracts/recording_credits/recording_credits.ts +458 -0
- package/src/contracts/recording_credits/recording_party_role.ts +1041 -0
- package/src/contracts/recording_language/deps/language_code/language_code.ts +7 -0
- package/src/contracts/recording_language/recording_language.ts +237 -0
- package/src/contracts/recording_master_reference/deps/ori/walrus_data.ts +36 -0
- package/src/contracts/recording_master_reference/recording_master_reference.ts +181 -0
- package/src/contracts/recording_preview/deps/ori/walrus_data.ts +36 -0
- package/src/contracts/recording_preview/recording_preview.ts +154 -0
- package/src/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.ts +36 -0
- package/src/contracts/release_cover_art/deps/cover_art/cover_art.ts +23 -0
- package/src/contracts/release_cover_art/deps/per_track/per_track.ts +36 -0
- package/src/contracts/release_cover_art/release_cover_art.ts +251 -0
- package/src/contracts/release_credits/deps/miso_credit/credit.ts +27 -0
- package/src/contracts/release_credits/deps/sui/vec_map.ts +33 -0
- package/src/contracts/release_credits/release_credits.ts +156 -0
- package/src/contracts/release_credits/release_party_role.ts +87 -0
- package/src/contracts/release_description/release_description.ts +167 -0
- package/src/contracts/release_dsp_link/release_dsp_link.ts +813 -0
- package/src/contracts/release_genre/deps/per_track/per_track.ts +36 -0
- package/src/contracts/release_genre/release_genre.ts +314 -0
- package/src/contracts/release_kind/release_kind.ts +153 -0
- package/src/contracts/release_snapshot_bundle/deps/ori/walrus_data.ts +36 -0
- package/src/contracts/release_snapshot_bundle/release_snapshot_bundle.ts +124 -0
- package/src/contracts/routed_stake/deps/royalty_pool/stake.ts +39 -0
- package/src/contracts/routed_stake/deps/std/type_name.ts +22 -0
- package/src/contracts/routed_stake/deps/sui/balance.ts +17 -0
- package/src/contracts/routed_stake/deps/sui/vec_map.ts +33 -0
- package/src/contracts/routed_stake/routed_stake.ts +508 -0
- package/src/contracts/royalty_pool/deps/std/type_name.ts +22 -0
- package/src/contracts/royalty_pool/deps/sui/balance.ts +17 -0
- package/src/contracts/royalty_pool/deps/sui/vec_map.ts +33 -0
- package/src/contracts/royalty_pool/pool.ts +613 -0
- package/src/contracts/royalty_pool/stake.ts +317 -0
- package/src/contracts.ts +59 -6
- package/src/deployments.ts +160 -22
- package/src/events.ts +129 -0
- package/src/execute.ts +0 -4
- package/src/index.ts +6 -3
- package/src/internal.ts +2 -4
- package/src/numeric.ts +25 -0
- package/src/packages.ts +251 -0
- package/src/parsers.ts +32 -11
- package/src/queries.ts +227 -25
- package/src/transactions.ts +255 -23
- package/src/types.ts +37 -9
- package/src/view.ts +12 -6
|
@@ -7,28 +7,28 @@
|
|
|
7
7
|
* Represents a musical composition (song, instrumental work) in Miso. Compositions
|
|
8
8
|
* are the underlying written works that recordings are based on. Each composition
|
|
9
9
|
* has its own share token for ownership distribution.
|
|
10
|
-
*
|
|
10
|
+
*
|
|
11
11
|
* ### Key Features:
|
|
12
|
-
*
|
|
12
|
+
*
|
|
13
13
|
* - Share token initialization with fixed supply (10M tokens, 6 decimals)
|
|
14
14
|
* - State machine: Initialized -> Published (embedded fields immutable after
|
|
15
15
|
* publish; dynamic fields remain extensible via `uid_mut`)
|
|
16
16
|
* - Deterministic addresses via derived object pattern
|
|
17
|
-
*
|
|
17
|
+
*
|
|
18
18
|
* Attribution (credits) is intentionally NOT part of core: it is display-oriented,
|
|
19
19
|
* varies across platforms, and is never read by the economics. It lives in a
|
|
20
20
|
* first-party credits extension attached via `uid_mut`, so core takes no
|
|
21
21
|
* dependency on an identity package and core publish enforces no attribution.
|
|
22
|
-
*
|
|
22
|
+
*
|
|
23
23
|
* ### Lifecycle and trust model
|
|
24
|
-
*
|
|
24
|
+
*
|
|
25
25
|
* A composition is `key`-only with no `drop`: a fresh `Initialized` object cannot
|
|
26
26
|
* be transferred, wrapped, publicly shared, or discarded, and its only by-value
|
|
27
27
|
* consumer is `publish`. Create-and-publish is therefore atomic by construction —
|
|
28
28
|
* an `Initialized` composition cannot outlive its creating transaction, and every
|
|
29
29
|
* composition that exists on-chain is `Published` and shared. There is
|
|
30
30
|
* deliberately no keep function; staged building must fit one transaction.
|
|
31
|
-
*
|
|
31
|
+
*
|
|
32
32
|
* `uid_mut` works in any lifecycle state and is permanent root over ALL dynamic
|
|
33
33
|
* fields on the object — including fields attached by other extensions. "Immutable
|
|
34
34
|
* after publish" covers the embedded fields only; extension-layer data stays
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
* holder as able to mutate or delete any extension data, forever.
|
|
38
38
|
*/
|
|
39
39
|
|
|
40
|
-
import { MoveEnum, MoveStruct, MoveTuple, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.
|
|
40
|
+
import { MoveEnum, MoveStruct, MoveTuple, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.ts';
|
|
41
41
|
import { bcs } from '@mysten/sui/bcs';
|
|
42
42
|
import { type Transaction } from '@mysten/sui/transactions';
|
|
43
|
-
import * as bps from './deps/bps/bps.
|
|
43
|
+
import * as bps from './deps/bps/bps.ts';
|
|
44
44
|
const $moduleName = '@local-pkg/miso::composition';
|
|
45
45
|
/** Lifecycle state of a composition. */
|
|
46
46
|
export const CompositionState = new MoveEnum({ name: `${$moduleName}::CompositionState`, fields: {
|
|
@@ -67,12 +67,6 @@ export const CompositionAdminCapKey = new MoveTuple({ name: `${$moduleName}::Com
|
|
|
67
67
|
export const CompositionPublishedEvent = new MoveStruct({ name: `${$moduleName}::CompositionPublishedEvent<phantom CompositionShare>`, fields: {
|
|
68
68
|
composition_id: bcs.Address
|
|
69
69
|
} });
|
|
70
|
-
export const CompositionRoyaltySetEvent = new MoveStruct({ name: `${$moduleName}::CompositionRoyaltySetEvent<phantom CompositionShare>`, fields: {
|
|
71
|
-
composition_id: bcs.Address,
|
|
72
|
-
previous_royalty_rate_bps: bcs.u16(),
|
|
73
|
-
royalty_rate_bps: bcs.u16(),
|
|
74
|
-
changed_by: bcs.Address
|
|
75
|
-
} });
|
|
76
70
|
export interface NewArguments {
|
|
77
71
|
title: RawTransactionArgument<string>;
|
|
78
72
|
royaltyRateBps: RawTransactionArgument<number>;
|
|
@@ -92,10 +86,17 @@ export interface NewOptions {
|
|
|
92
86
|
];
|
|
93
87
|
}
|
|
94
88
|
/**
|
|
95
|
-
* Creates a new composition with the given title and royalty rate.
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
89
|
+
* Creates a new composition with the given title and royalty rate.
|
|
90
|
+
*
|
|
91
|
+
* The rate is set once, here, and is immutable for the composition's lifetime: it
|
|
92
|
+
* is a permanent standing offer that recorders and share buyers can price against
|
|
93
|
+
* without trusting the admin. The protocol imposes no opinion on it beyond the
|
|
94
|
+
* arithmetic bound of 100% (10000 bps, enforced by `bps::new`). There is no floor
|
|
95
|
+
* — 0% is permitted (e.g. a generative recording with no authored composition) —
|
|
96
|
+
* and no protocol ceiling: an uncompetitive rate simply attracts no recordings.
|
|
97
|
+
* What rate is reasonable is a client-side concern; per-deal deviations settle as
|
|
98
|
+
* voluntary share transfers after recording creation. Initializes share tokens
|
|
99
|
+
* (10M supply, 6 decimals) and returns:
|
|
99
100
|
*
|
|
100
101
|
* - The composition object
|
|
101
102
|
* - Admin capability for the owner
|
|
@@ -155,48 +156,6 @@ export function publish(options: PublishOptions) {
|
|
|
155
156
|
typeArguments: options.typeArguments
|
|
156
157
|
});
|
|
157
158
|
}
|
|
158
|
-
export interface SetRoyaltyRateArguments {
|
|
159
|
-
self: RawTransactionArgument<string>;
|
|
160
|
-
_: RawTransactionArgument<string>;
|
|
161
|
-
royaltyRateBps: RawTransactionArgument<number>;
|
|
162
|
-
}
|
|
163
|
-
export interface SetRoyaltyRateOptions {
|
|
164
|
-
package?: string;
|
|
165
|
-
arguments: SetRoyaltyRateArguments | [
|
|
166
|
-
self: RawTransactionArgument<string>,
|
|
167
|
-
_: RawTransactionArgument<string>,
|
|
168
|
-
royaltyRateBps: RawTransactionArgument<number>
|
|
169
|
-
];
|
|
170
|
-
typeArguments: [
|
|
171
|
-
string
|
|
172
|
-
];
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Sets the royalty rate this composition earns from each recording. Must not
|
|
176
|
-
* exceed `MAX_ROYALTY_RATE_BPS` (there is no floor; 0% is allowed). The rate can
|
|
177
|
-
* be changed in any lifecycle state, including after publishing, and takes effect
|
|
178
|
-
* immediately. There is deliberately no rate-change cooldown: a change cannot
|
|
179
|
-
* surprise anyone, because each recording snapshots the rate when it is created
|
|
180
|
-
* (existing recordings keep the rate they captured) and `recording::new`'s
|
|
181
|
-
* `max_royalty_rate_bps` slippage guard means no future recorder can be charged a
|
|
182
|
-
* rate they did not consent to.
|
|
183
|
-
*/
|
|
184
|
-
export function setRoyaltyRate(options: SetRoyaltyRateOptions) {
|
|
185
|
-
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
186
|
-
const argumentsTypes = [
|
|
187
|
-
null,
|
|
188
|
-
null,
|
|
189
|
-
'u16'
|
|
190
|
-
] satisfies (string | null)[];
|
|
191
|
-
const parameterNames = ["self", "_", "royaltyRateBps"];
|
|
192
|
-
return (tx: Transaction) => tx.moveCall({
|
|
193
|
-
package: packageAddress,
|
|
194
|
-
module: 'composition',
|
|
195
|
-
function: 'set_royalty_rate',
|
|
196
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
197
|
-
typeArguments: options.typeArguments
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
159
|
export interface IdArguments {
|
|
201
160
|
self: RawTransactionArgument<string>;
|
|
202
161
|
}
|
|
@@ -263,7 +222,11 @@ export interface RoyaltyRateOptions {
|
|
|
263
222
|
string
|
|
264
223
|
];
|
|
265
224
|
}
|
|
266
|
-
/**
|
|
225
|
+
/**
|
|
226
|
+
* Returns the royalty rate this composition earns from each recording. Immutable
|
|
227
|
+
* for the composition's lifetime — the value read here is, by construction, the
|
|
228
|
+
* value `recording::new` will apply.
|
|
229
|
+
*/
|
|
267
230
|
export function royaltyRate(options: RoyaltyRateOptions) {
|
|
268
231
|
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
269
232
|
const argumentsTypes = [
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Basis-points arithmetic with a newtype wrapper.
|
|
8
|
-
*
|
|
8
|
+
*
|
|
9
9
|
* 1 bps = 0.01%. 10_000 bps = 100%.
|
|
10
|
-
*
|
|
10
|
+
*
|
|
11
11
|
* Storage-optimal: `BPS` stores a `u16` (2 bytes), the tightest width that fits
|
|
12
12
|
* the `[0, 10_000]` range. Apply functions cover every standard integer width
|
|
13
13
|
* (`u8` through `u256`); overflow safety on `u8`–`u128` is delegated to
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* (~1.16e73).
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { MoveTuple } from '../../../utils/index.
|
|
20
|
+
import { MoveTuple } from '../../../utils/index.ts';
|
|
21
21
|
import { bcs } from '@mysten/sui/bcs';
|
|
22
22
|
const $moduleName = 'bps::bps';
|
|
23
23
|
export const BPS = new MoveTuple({ name: `${$moduleName}::BPS`, fields: [bcs.u16()] });
|
|
@@ -7,53 +7,54 @@
|
|
|
7
7
|
* Represents an audio recording of a composition in Miso. Recordings are the audio
|
|
8
8
|
* performances that are distributed and played. Each recording has its own share
|
|
9
9
|
* token for ownership distribution.
|
|
10
|
-
*
|
|
10
|
+
*
|
|
11
11
|
* ### Key Features:
|
|
12
|
-
*
|
|
12
|
+
*
|
|
13
13
|
* - Share token initialization with fixed supply (10M tokens, 6 decimals)
|
|
14
14
|
* - State machine: Initialized -> Published (embedded fields immutable after
|
|
15
15
|
* publish; dynamic fields remain extensible via `uid_mut`, e.g. masters, and
|
|
16
16
|
* credits/attribution attached by the credits extension)
|
|
17
17
|
* - Deterministic addresses via derived object pattern
|
|
18
|
-
*
|
|
18
|
+
*
|
|
19
19
|
* Attribution (credits, primary/featured artists) is intentionally NOT part of
|
|
20
20
|
* core: it is display-oriented, varies across platforms, and is never read by the
|
|
21
21
|
* economics. It lives in a first-party credits extension attached via `uid_mut`,
|
|
22
22
|
* so core takes no dependency on an identity package and core publish enforces no
|
|
23
23
|
* attribution.
|
|
24
|
-
*
|
|
24
|
+
*
|
|
25
25
|
* A recording carries no name of its own. Its display title is its composition's
|
|
26
26
|
* title, read by reference — composition titles are immutable, so an embedded copy
|
|
27
27
|
* would carry no information. Anything that names this particular take — "(Live)",
|
|
28
28
|
* "Radio Edit", a translated title — has more than one correct rendering, which
|
|
29
29
|
* makes it presentation, and presentation lives in the metadata extension, never
|
|
30
30
|
* in the frozen core. Core stores what a recording _is_; extensions describe it.
|
|
31
|
-
*
|
|
31
|
+
*
|
|
32
32
|
* ### Lifecycle and trust model
|
|
33
|
-
*
|
|
33
|
+
*
|
|
34
34
|
* A recording is `key`-only with no `drop`: a fresh `Initialized` object cannot be
|
|
35
35
|
* transferred, wrapped, publicly shared, or discarded, and its only by-value
|
|
36
36
|
* consumer is `publish`. Create-and-publish is therefore atomic by construction —
|
|
37
37
|
* an `Initialized` recording cannot outlive its creating transaction, and every
|
|
38
38
|
* recording that exists on-chain is `Published` and shared. There is deliberately
|
|
39
39
|
* no keep function; staged building must fit one transaction.
|
|
40
|
-
*
|
|
40
|
+
*
|
|
41
41
|
* `uid_mut` works in any lifecycle state and is permanent root over ALL dynamic
|
|
42
42
|
* fields on the object — including fields attached by other extensions. "Immutable
|
|
43
43
|
* after publish" covers the embedded fields only; extension-layer data stays
|
|
44
44
|
* admin-mutable in perpetuity. This is the designed extension surface, and it is
|
|
45
45
|
* the one trust assumption that never expires: integrators should model the cap
|
|
46
46
|
* holder as able to mutate or delete any extension data, forever.
|
|
47
|
-
*
|
|
48
|
-
* The recording carries its parent composition's identity
|
|
49
|
-
* `CompositionShare` phantom type parameter
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
47
|
+
*
|
|
48
|
+
* The recording carries its parent composition's identity two ways. The
|
|
49
|
+
* `CompositionShare` phantom type parameter is the durable identity (a share
|
|
50
|
+
* currency is published independently of miso and survives a fresh republish,
|
|
51
|
+
* whereas an object ID does not) and makes the recording↔composition lineage
|
|
52
|
+
* compile-time enforced wherever the two meet. The embedded `composition_id` is
|
|
53
|
+
* the address-level handle: Move cannot chase a type (or an ID) to an object, so
|
|
54
|
+
* on-chain consumers holding only `&Recording` — or a bare `Track` — could not
|
|
55
|
+
* otherwise reach the composition at all. Both are set at creation and immutable,
|
|
56
|
+
* so they cannot diverge.
|
|
57
|
+
*
|
|
57
58
|
* A recording is its own freshly-created object (`object::new`), not a derived
|
|
58
59
|
* child of its composition: `recording::new` takes a read-only `&Composition`
|
|
59
60
|
* (only to read its royalty rate and id), so publishing recordings under a
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
* collides on a per-composition index.
|
|
62
63
|
*/
|
|
63
64
|
|
|
64
|
-
import { MoveEnum, MoveStruct, MoveTuple, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.
|
|
65
|
+
import { MoveEnum, MoveStruct, MoveTuple, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.ts';
|
|
65
66
|
import { bcs } from '@mysten/sui/bcs';
|
|
66
67
|
import { type Transaction } from '@mysten/sui/transactions';
|
|
67
68
|
const $moduleName = '@local-pkg/miso::recording';
|
|
@@ -76,7 +77,15 @@ export const Recording = new MoveStruct({ name: `${$moduleName}::Recording<phant
|
|
|
76
77
|
/** Unique identifier for this recording. */
|
|
77
78
|
id: bcs.Address,
|
|
78
79
|
/** Current lifecycle state. */
|
|
79
|
-
state: RecordingState
|
|
80
|
+
state: RecordingState,
|
|
81
|
+
/**
|
|
82
|
+
* Object ID of the parent composition. The address-level counterpart of the
|
|
83
|
+
* `CompositionShare` phantom, set from the `&Composition` passed to `new` (the
|
|
84
|
+
* shared phantom proves the pairing). An identity handle — not a revenue routing
|
|
85
|
+
* target: the composition is paid through its recording-share ownership, settled
|
|
86
|
+
* at creation.
|
|
87
|
+
*/
|
|
88
|
+
composition_id: bcs.Address
|
|
80
89
|
} });
|
|
81
90
|
export const RecordingAdminCap = new MoveStruct({ name: `${$moduleName}::RecordingAdminCap<phantom RecordingShare>`, fields: {
|
|
82
91
|
/** Unique identifier for this capability. */
|
|
@@ -99,15 +108,13 @@ export interface NewArguments {
|
|
|
99
108
|
composition: RawTransactionArgument<string>;
|
|
100
109
|
shareCurrency: RawTransactionArgument<string>;
|
|
101
110
|
shareTreasuryCap: RawTransactionArgument<string>;
|
|
102
|
-
maxRoyaltyRateBps: RawTransactionArgument<number>;
|
|
103
111
|
}
|
|
104
112
|
export interface NewOptions {
|
|
105
113
|
package?: string;
|
|
106
114
|
arguments: NewArguments | [
|
|
107
115
|
composition: RawTransactionArgument<string>,
|
|
108
116
|
shareCurrency: RawTransactionArgument<string>,
|
|
109
|
-
shareTreasuryCap: RawTransactionArgument<string
|
|
110
|
-
maxRoyaltyRateBps: RawTransactionArgument<number>
|
|
117
|
+
shareTreasuryCap: RawTransactionArgument<string>
|
|
111
118
|
];
|
|
112
119
|
typeArguments: [
|
|
113
120
|
string,
|
|
@@ -126,13 +133,11 @@ export interface NewOptions {
|
|
|
126
133
|
* composition owner then does with the shares (hold, stake, sell) is outside the
|
|
127
134
|
* protocol's scope.
|
|
128
135
|
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* will grant (pass the rate they observed, or `2000` to accept up to the protocol
|
|
135
|
-
* maximum).
|
|
136
|
+
* The composition's royalty rate is immutable, so the rate a recorder's client
|
|
137
|
+
* displayed is exactly the rate applied here — no slippage protection is needed or
|
|
138
|
+
* possible. Whether that rate is acceptable is the recorder's decision to make
|
|
139
|
+
* before calling; per-deal deviations settle as voluntary share transfers after
|
|
140
|
+
* creation.
|
|
136
141
|
*
|
|
137
142
|
* The composition need not be `Published`: within the composition's own creating
|
|
138
143
|
* transaction its creator can already mint recordings against it. Third parties
|
|
@@ -153,10 +158,9 @@ export function _new(options: NewOptions) {
|
|
|
153
158
|
const argumentsTypes = [
|
|
154
159
|
null,
|
|
155
160
|
null,
|
|
156
|
-
null
|
|
157
|
-
'u16'
|
|
161
|
+
null
|
|
158
162
|
] satisfies (string | null)[];
|
|
159
|
-
const parameterNames = ["composition", "shareCurrency", "shareTreasuryCap"
|
|
163
|
+
const parameterNames = ["composition", "shareCurrency", "shareTreasuryCap"];
|
|
160
164
|
return (tx: Transaction) => tx.moveCall({
|
|
161
165
|
package: packageAddress,
|
|
162
166
|
module: 'recording',
|
|
@@ -203,6 +207,39 @@ export function publish(options: PublishOptions) {
|
|
|
203
207
|
typeArguments: options.typeArguments
|
|
204
208
|
});
|
|
205
209
|
}
|
|
210
|
+
export interface CompositionIdArguments {
|
|
211
|
+
self: RawTransactionArgument<string>;
|
|
212
|
+
}
|
|
213
|
+
export interface CompositionIdOptions {
|
|
214
|
+
package?: string;
|
|
215
|
+
arguments: CompositionIdArguments | [
|
|
216
|
+
self: RawTransactionArgument<string>
|
|
217
|
+
];
|
|
218
|
+
typeArguments: [
|
|
219
|
+
string,
|
|
220
|
+
string
|
|
221
|
+
];
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Returns the object ID of the parent composition. An identity/membership handle
|
|
225
|
+
* (the address-level counterpart of the `CompositionShare` phantom) — not a
|
|
226
|
+
* revenue routing target: the composition is paid via its recording-share
|
|
227
|
+
* ownership.
|
|
228
|
+
*/
|
|
229
|
+
export function compositionId(options: CompositionIdOptions) {
|
|
230
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
231
|
+
const argumentsTypes = [
|
|
232
|
+
null
|
|
233
|
+
] satisfies (string | null)[];
|
|
234
|
+
const parameterNames = ["self"];
|
|
235
|
+
return (tx: Transaction) => tx.moveCall({
|
|
236
|
+
package: packageAddress,
|
|
237
|
+
module: 'recording',
|
|
238
|
+
function: 'composition_id',
|
|
239
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
240
|
+
typeArguments: options.typeArguments
|
|
241
|
+
});
|
|
242
|
+
}
|
|
206
243
|
export interface IdArguments {
|
|
207
244
|
self: RawTransactionArgument<string>;
|
|
208
245
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Represents a music release in Miso. A release is an ordered tracklist with
|
|
8
8
|
* per-track revenue distribution configuration. Cover art lives in the `cover_art`
|
|
9
9
|
* extension, not in core.
|
|
10
|
-
*
|
|
10
|
+
*
|
|
11
11
|
* The tracklist is deliberately FLAT — a `vector<Track>` with no disc structure.
|
|
12
12
|
* Grouping a sequence into discs, vinyl sides, acts, or movements is a property of
|
|
13
13
|
* a distribution medium, not of the release: it has more than one correct
|
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
* extension. A consequence worth stating: the stored tracklist and the digest
|
|
16
16
|
* pre-image have the same shape, so what signers consented to is exactly what is
|
|
17
17
|
* stored — nothing structural is chosen after consent except the title.
|
|
18
|
-
*
|
|
18
|
+
*
|
|
19
19
|
* ### Key Features:
|
|
20
|
-
*
|
|
20
|
+
*
|
|
21
21
|
* - Ordered flat tracklist (grouping is presentation, in the metadata extension)
|
|
22
22
|
* - Configurable per-track revenue splits
|
|
23
23
|
* - State machine: Initialized -> Published
|
|
24
|
-
*
|
|
24
|
+
*
|
|
25
25
|
* Attribution (credits, primary/featured artists) is intentionally NOT part of
|
|
26
26
|
* core: it is display-oriented, varies across platforms, and is never read by the
|
|
27
27
|
* economics. It lives in a first-party credits extension attached via `uid_mut`,
|
|
28
28
|
* so core takes no dependency on an identity package and core publish enforces no
|
|
29
29
|
* attribution.
|
|
30
|
-
*
|
|
30
|
+
*
|
|
31
31
|
* The same rule governs naming. Core stores what a thing _is_ — identity and
|
|
32
32
|
* everything the economics read; extensions describe it. The release's `title` is
|
|
33
33
|
* the one embedded name: it is constitutive (naming the package is part of
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
* naming ("Deluxe Edition"), disc titles, localized titles, and DSP-shaped slots
|
|
36
36
|
* all have more than one correct rendering — presentation — and live in the
|
|
37
37
|
* metadata extension.
|
|
38
|
-
*
|
|
38
|
+
*
|
|
39
39
|
* ### Consent scope
|
|
40
|
-
*
|
|
40
|
+
*
|
|
41
41
|
* The release digest — and therefore the derived release id every `Track` commits
|
|
42
42
|
* to at creation — binds the economics and membership of the release: the ordered
|
|
43
43
|
* list of `(recording, split)` pairs and the creator's nonce. It deliberately
|
|
@@ -46,17 +46,18 @@
|
|
|
46
46
|
* chosen by the release creator, before or after tracks are created, and are
|
|
47
47
|
* trusted and publicly attributable rather than cryptographically committed. See
|
|
48
48
|
* `track::new` for the signer-side statement of this boundary.
|
|
49
|
-
*
|
|
50
|
-
* The derived id commits to
|
|
51
|
-
* targeting an id also consents to that namespace's liveness. If
|
|
52
|
-
*
|
|
53
|
-
* never exist and every track or offer targeting it
|
|
54
|
-
* blast-radius class as a release that simply never publishes.
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
49
|
+
*
|
|
50
|
+
* The derived id commits to the canonical registry's UID and the digest, not the
|
|
51
|
+
* digest alone — so targeting an id also consents to that namespace's liveness. If
|
|
52
|
+
* that parent were deleted, or its `&mut UID` became permanently unreachable, the
|
|
53
|
+
* release could never exist and every track or offer targeting it would be
|
|
54
|
+
* stranded — the same blast-radius class as a release that simply never publishes.
|
|
55
|
+
* `ReleaseRegistry` is therefore created and shared exactly once at package
|
|
56
|
+
* initialization, and exposes neither a constructor, deletion path, nor mutable
|
|
57
|
+
* UID accessor.
|
|
58
|
+
*
|
|
58
59
|
* ### Lifecycle and trust model
|
|
59
|
-
*
|
|
60
|
+
*
|
|
60
61
|
* A release is `key`-only with no `drop`: a fresh `Initialized` object cannot be
|
|
61
62
|
* transferred, wrapped, publicly shared, or discarded, and its only by-value
|
|
62
63
|
* consumer is `publish`. Create-and-publish is therefore atomic by construction —
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
* release that exists on-chain is `Published` and shared. There is deliberately no
|
|
65
66
|
* keep function; assembling tracks, discs, and the release must fit one
|
|
66
67
|
* transaction.
|
|
67
|
-
*
|
|
68
|
+
*
|
|
68
69
|
* `uid_mut` works in any lifecycle state and is permanent root over ALL dynamic
|
|
69
70
|
* fields on the object — including fields attached by other extensions. "Immutable
|
|
70
71
|
* after publish" covers the embedded fields only; extension-layer data stays
|
|
@@ -73,10 +74,10 @@
|
|
|
73
74
|
* holder as able to mutate or delete any extension data, forever.
|
|
74
75
|
*/
|
|
75
76
|
|
|
76
|
-
import { MoveEnum, MoveStruct, MoveTuple, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.
|
|
77
|
+
import { MoveEnum, MoveStruct, MoveTuple, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.ts';
|
|
77
78
|
import { bcs } from '@mysten/sui/bcs';
|
|
78
79
|
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
79
|
-
import * as track from './track.
|
|
80
|
+
import * as track from './track.ts';
|
|
80
81
|
const $moduleName = '@local-pkg/miso::release';
|
|
81
82
|
/** Lifecycle state of a release. */
|
|
82
83
|
export const ReleaseState = new MoveEnum({ name: `${$moduleName}::ReleaseState`, fields: {
|
|
@@ -98,6 +99,9 @@ export const Release = new MoveStruct({ name: `${$moduleName}::Release`, fields:
|
|
|
98
99
|
*/
|
|
99
100
|
tracks: bcs.vector(track.Track)
|
|
100
101
|
} });
|
|
102
|
+
export const ReleaseRegistry = new MoveStruct({ name: `${$moduleName}::ReleaseRegistry`, fields: {
|
|
103
|
+
id: bcs.Address
|
|
104
|
+
} });
|
|
101
105
|
export const ReleaseKey = new MoveTuple({ name: `${$moduleName}::ReleaseKey`, fields: [bcs.vector(bcs.u8())] });
|
|
102
106
|
export const ReleaseAdminCap = new MoveStruct({ name: `${$moduleName}::ReleaseAdminCap`, fields: {
|
|
103
107
|
/** Unique identifier for this capability. */
|
|
@@ -109,37 +113,41 @@ export const ReleaseAdminCapKey = new MoveTuple({ name: `${$moduleName}::Release
|
|
|
109
113
|
export const ReleasePublishedEvent = new MoveStruct({ name: `${$moduleName}::ReleasePublishedEvent`, fields: {
|
|
110
114
|
release_id: bcs.Address
|
|
111
115
|
} });
|
|
116
|
+
export const ReleaseRegistryCreatedEvent = new MoveStruct({ name: `${$moduleName}::ReleaseRegistryCreatedEvent`, fields: {
|
|
117
|
+
registry_id: bcs.Address,
|
|
118
|
+
created_by: bcs.Address
|
|
119
|
+
} });
|
|
112
120
|
export interface NewArguments {
|
|
121
|
+
self: RawTransactionArgument<string>;
|
|
113
122
|
title: RawTransactionArgument<string>;
|
|
114
123
|
tracks: TransactionArgument;
|
|
115
124
|
nonce: RawTransactionArgument<number | bigint>;
|
|
116
|
-
parent: RawTransactionArgument<string>;
|
|
117
125
|
}
|
|
118
126
|
export interface NewOptions {
|
|
119
127
|
package?: string;
|
|
120
128
|
arguments: NewArguments | [
|
|
129
|
+
self: RawTransactionArgument<string>,
|
|
121
130
|
title: RawTransactionArgument<string>,
|
|
122
131
|
tracks: TransactionArgument,
|
|
123
|
-
nonce: RawTransactionArgument<number | bigint
|
|
124
|
-
parent: RawTransactionArgument<string>
|
|
132
|
+
nonce: RawTransactionArgument<number | bigint>
|
|
125
133
|
];
|
|
126
134
|
}
|
|
127
135
|
/**
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
136
|
+
* Assembles a release under the canonical registry namespace. This is
|
|
137
|
+
* permissionless: consent is carried by the supplied tracks, each of which was
|
|
138
|
+
* created for the exact derived release id. Returns the release and admin
|
|
139
|
+
* capability by value so the caller can compose `publish` and custody in the same
|
|
140
|
+
* PTB.
|
|
133
141
|
*/
|
|
134
142
|
export function _new(options: NewOptions) {
|
|
135
143
|
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
136
144
|
const argumentsTypes = [
|
|
145
|
+
null,
|
|
137
146
|
'0x1::string::String',
|
|
138
147
|
'vector<null>',
|
|
139
|
-
'u256'
|
|
140
|
-
'0x2::object::ID'
|
|
148
|
+
'u256'
|
|
141
149
|
] satisfies (string | null)[];
|
|
142
|
-
const parameterNames = ["
|
|
150
|
+
const parameterNames = ["self", "title", "tracks", "nonce"];
|
|
143
151
|
return (tx: Transaction) => tx.moveCall({
|
|
144
152
|
package: packageAddress,
|
|
145
153
|
module: 'release',
|
|
@@ -147,6 +155,70 @@ export function _new(options: NewOptions) {
|
|
|
147
155
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
148
156
|
});
|
|
149
157
|
}
|
|
158
|
+
export interface DeriveTargetReleaseIdArguments {
|
|
159
|
+
self: RawTransactionArgument<string>;
|
|
160
|
+
recordingIds: RawTransactionArgument<Array<string>>;
|
|
161
|
+
trackSplitValues: RawTransactionArgument<Array<number | bigint>>;
|
|
162
|
+
nonce: RawTransactionArgument<number | bigint>;
|
|
163
|
+
}
|
|
164
|
+
export interface DeriveTargetReleaseIdOptions {
|
|
165
|
+
package?: string;
|
|
166
|
+
arguments: DeriveTargetReleaseIdArguments | [
|
|
167
|
+
self: RawTransactionArgument<string>,
|
|
168
|
+
recordingIds: RawTransactionArgument<Array<string>>,
|
|
169
|
+
trackSplitValues: RawTransactionArgument<Array<number | bigint>>,
|
|
170
|
+
nonce: RawTransactionArgument<number | bigint>
|
|
171
|
+
];
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Derives the release id that `new` would claim under this registry, without
|
|
175
|
+
* creating a release. This immutable shared-object access remains parallelizable
|
|
176
|
+
* for clients preparing tracks.
|
|
177
|
+
*/
|
|
178
|
+
export function deriveTargetReleaseId(options: DeriveTargetReleaseIdOptions) {
|
|
179
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
180
|
+
const argumentsTypes = [
|
|
181
|
+
null,
|
|
182
|
+
'vector<0x2::object::ID>',
|
|
183
|
+
'vector<u64>',
|
|
184
|
+
'u256'
|
|
185
|
+
] satisfies (string | null)[];
|
|
186
|
+
const parameterNames = ["self", "recordingIds", "trackSplitValues", "nonce"];
|
|
187
|
+
return (tx: Transaction) => tx.moveCall({
|
|
188
|
+
package: packageAddress,
|
|
189
|
+
module: 'release',
|
|
190
|
+
function: 'derive_target_release_id',
|
|
191
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
export interface ReleaseRegistryIdArguments {
|
|
195
|
+
self: RawTransactionArgument<string>;
|
|
196
|
+
}
|
|
197
|
+
export interface ReleaseRegistryIdOptions {
|
|
198
|
+
package?: string;
|
|
199
|
+
arguments: ReleaseRegistryIdArguments | [
|
|
200
|
+
self: RawTransactionArgument<string>
|
|
201
|
+
];
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Returns the canonical registry's object ID, which is the derivation parent
|
|
205
|
+
* committed to by `new` and `derive_target_release_id`. Exported as the
|
|
206
|
+
* `ReleaseRegistry.id()` method to avoid colliding with the existing
|
|
207
|
+
* `release::id(&Release)` ABI function.
|
|
208
|
+
*/
|
|
209
|
+
export function releaseRegistryId(options: ReleaseRegistryIdOptions) {
|
|
210
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
211
|
+
const argumentsTypes = [
|
|
212
|
+
null
|
|
213
|
+
] satisfies (string | null)[];
|
|
214
|
+
const parameterNames = ["self"];
|
|
215
|
+
return (tx: Transaction) => tx.moveCall({
|
|
216
|
+
package: packageAddress,
|
|
217
|
+
module: 'release',
|
|
218
|
+
function: 'release_registry_id',
|
|
219
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
220
|
+
});
|
|
221
|
+
}
|
|
150
222
|
export interface PublishArguments {
|
|
151
223
|
self: RawTransactionArgument<string>;
|
|
152
224
|
cap: RawTransactionArgument<string>;
|
|
@@ -206,42 +278,6 @@ export function authorize(options: AuthorizeOptions) {
|
|
|
206
278
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
207
279
|
});
|
|
208
280
|
}
|
|
209
|
-
export interface DeriveTargetReleaseIdArguments {
|
|
210
|
-
recordingIds: RawTransactionArgument<Array<string>>;
|
|
211
|
-
trackSplitValues: RawTransactionArgument<Array<number | bigint>>;
|
|
212
|
-
nonce: RawTransactionArgument<number | bigint>;
|
|
213
|
-
parent: RawTransactionArgument<string>;
|
|
214
|
-
}
|
|
215
|
-
export interface DeriveTargetReleaseIdOptions {
|
|
216
|
-
package?: string;
|
|
217
|
-
arguments: DeriveTargetReleaseIdArguments | [
|
|
218
|
-
recordingIds: RawTransactionArgument<Array<string>>,
|
|
219
|
-
trackSplitValues: RawTransactionArgument<Array<number | bigint>>,
|
|
220
|
-
nonce: RawTransactionArgument<number | bigint>,
|
|
221
|
-
parent: RawTransactionArgument<string>
|
|
222
|
-
];
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Derives the target release ID that `new()` would produce for the given inputs
|
|
226
|
-
* and parent, without creating the object. This is the on-chain equivalent of the
|
|
227
|
-
* client-side `deriveReleaseId()` function.
|
|
228
|
-
*/
|
|
229
|
-
export function deriveTargetReleaseId(options: DeriveTargetReleaseIdOptions) {
|
|
230
|
-
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
231
|
-
const argumentsTypes = [
|
|
232
|
-
'vector<0x2::object::ID>',
|
|
233
|
-
'vector<u64>',
|
|
234
|
-
'u256',
|
|
235
|
-
'0x2::object::ID'
|
|
236
|
-
] satisfies (string | null)[];
|
|
237
|
-
const parameterNames = ["recordingIds", "trackSplitValues", "nonce", "parent"];
|
|
238
|
-
return (tx: Transaction) => tx.moveCall({
|
|
239
|
-
package: packageAddress,
|
|
240
|
-
module: 'release',
|
|
241
|
-
function: 'derive_target_release_id',
|
|
242
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
281
|
export interface IdArguments {
|
|
246
282
|
self: RawTransactionArgument<string>;
|
|
247
283
|
}
|