@misonetwork/sdk 0.7.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 -139
- package/dist/client.d.ts +1225 -8
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +43 -19
- 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 +1 -1
- package/dist/contracts/miso/composition.js +2 -2
- 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 +1 -1
- package/dist/contracts/miso/recording.js +1 -1
- package/dist/contracts/miso/release.d.ts +61 -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 +2 -2
- package/dist/contracts/miso/track.js +2 -2
- 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.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 -1
- package/dist/parsers.d.ts.map +1 -1
- package/dist/parsers.js +18 -2
- 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 -3
- package/dist/transactions.d.ts.map +1 -1
- package/dist/transactions.js +123 -11
- package/dist/transactions.js.map +1 -1
- package/dist/types.d.ts +18 -0
- 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 -23
- 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 +8 -8
- package/src/contracts/miso/deps/bps/bps.ts +3 -3
- package/src/contracts/miso/recording.ts +10 -10
- package/src/contracts/miso/release.ts +103 -67
- package/src/contracts/miso/track.ts +5 -5
- 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 +0 -4
- package/src/numeric.ts +25 -0
- package/src/packages.ts +251 -0
- package/src/parsers.ts +32 -2
- package/src/queries.ts +227 -25
- package/src/transactions.ts +254 -12
- package/src/types.ts +20 -0
- package/src/view.ts +12 -6
|
@@ -45,13 +45,14 @@
|
|
|
45
45
|
* trusted and publicly attributable rather than cryptographically committed. See
|
|
46
46
|
* `track::new` for the signer-side statement of this boundary.
|
|
47
47
|
*
|
|
48
|
-
* The derived id commits to
|
|
49
|
-
* targeting an id also consents to that namespace's liveness. If
|
|
50
|
-
*
|
|
51
|
-
* never exist and every track or offer targeting it
|
|
52
|
-
* blast-radius class as a release that simply never publishes.
|
|
53
|
-
*
|
|
54
|
-
*
|
|
48
|
+
* The derived id commits to the canonical registry's UID and the digest, not the
|
|
49
|
+
* digest alone — so targeting an id also consents to that namespace's liveness. If
|
|
50
|
+
* that parent were deleted, or its `&mut UID` became permanently unreachable, the
|
|
51
|
+
* release could never exist and every track or offer targeting it would be
|
|
52
|
+
* stranded — the same blast-radius class as a release that simply never publishes.
|
|
53
|
+
* `ReleaseRegistry` is therefore created and shared exactly once at package
|
|
54
|
+
* initialization, and exposes neither a constructor, deletion path, nor mutable
|
|
55
|
+
* UID accessor.
|
|
55
56
|
*
|
|
56
57
|
* ### Lifecycle and trust model
|
|
57
58
|
*
|
|
@@ -70,10 +71,10 @@
|
|
|
70
71
|
* the one trust assumption that never expires: integrators should model the cap
|
|
71
72
|
* holder as able to mutate or delete any extension data, forever.
|
|
72
73
|
*/
|
|
73
|
-
import { MoveEnum, MoveStruct, MoveTuple, normalizeMoveArguments } from
|
|
74
|
+
import { MoveEnum, MoveStruct, MoveTuple, normalizeMoveArguments } from "../utils/index.js";
|
|
74
75
|
import { bcs } from '@mysten/sui/bcs';
|
|
75
76
|
import {} from '@mysten/sui/transactions';
|
|
76
|
-
import * as track from
|
|
77
|
+
import * as track from "./track.js";
|
|
77
78
|
const $moduleName = '@local-pkg/miso::release';
|
|
78
79
|
/** Lifecycle state of a release. */
|
|
79
80
|
export const ReleaseState = new MoveEnum({ name: `${$moduleName}::ReleaseState`, fields: {
|
|
@@ -95,6 +96,9 @@ export const Release = new MoveStruct({ name: `${$moduleName}::Release`, fields:
|
|
|
95
96
|
*/
|
|
96
97
|
tracks: bcs.vector(track.Track)
|
|
97
98
|
} });
|
|
99
|
+
export const ReleaseRegistry = new MoveStruct({ name: `${$moduleName}::ReleaseRegistry`, fields: {
|
|
100
|
+
id: bcs.Address
|
|
101
|
+
} });
|
|
98
102
|
export const ReleaseKey = new MoveTuple({ name: `${$moduleName}::ReleaseKey`, fields: [bcs.vector(bcs.u8())] });
|
|
99
103
|
export const ReleaseAdminCap = new MoveStruct({ name: `${$moduleName}::ReleaseAdminCap`, fields: {
|
|
100
104
|
/** Unique identifier for this capability. */
|
|
@@ -106,22 +110,26 @@ export const ReleaseAdminCapKey = new MoveTuple({ name: `${$moduleName}::Release
|
|
|
106
110
|
export const ReleasePublishedEvent = new MoveStruct({ name: `${$moduleName}::ReleasePublishedEvent`, fields: {
|
|
107
111
|
release_id: bcs.Address
|
|
108
112
|
} });
|
|
113
|
+
export const ReleaseRegistryCreatedEvent = new MoveStruct({ name: `${$moduleName}::ReleaseRegistryCreatedEvent`, fields: {
|
|
114
|
+
registry_id: bcs.Address,
|
|
115
|
+
created_by: bcs.Address
|
|
116
|
+
} });
|
|
109
117
|
/**
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
118
|
+
* Assembles a release under the canonical registry namespace. This is
|
|
119
|
+
* permissionless: consent is carried by the supplied tracks, each of which was
|
|
120
|
+
* created for the exact derived release id. Returns the release and admin
|
|
121
|
+
* capability by value so the caller can compose `publish` and custody in the same
|
|
122
|
+
* PTB.
|
|
115
123
|
*/
|
|
116
124
|
export function _new(options) {
|
|
117
125
|
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
118
126
|
const argumentsTypes = [
|
|
127
|
+
null,
|
|
119
128
|
'0x1::string::String',
|
|
120
129
|
'vector<null>',
|
|
121
|
-
'u256'
|
|
122
|
-
'0x2::object::ID'
|
|
130
|
+
'u256'
|
|
123
131
|
];
|
|
124
|
-
const parameterNames = ["
|
|
132
|
+
const parameterNames = ["self", "title", "tracks", "nonce"];
|
|
125
133
|
return (tx) => tx.moveCall({
|
|
126
134
|
package: packageAddress,
|
|
127
135
|
module: 'release',
|
|
@@ -129,6 +137,46 @@ export function _new(options) {
|
|
|
129
137
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
130
138
|
});
|
|
131
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* Derives the release id that `new` would claim under this registry, without
|
|
142
|
+
* creating a release. This immutable shared-object access remains parallelizable
|
|
143
|
+
* for clients preparing tracks.
|
|
144
|
+
*/
|
|
145
|
+
export function deriveTargetReleaseId(options) {
|
|
146
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
147
|
+
const argumentsTypes = [
|
|
148
|
+
null,
|
|
149
|
+
'vector<0x2::object::ID>',
|
|
150
|
+
'vector<u64>',
|
|
151
|
+
'u256'
|
|
152
|
+
];
|
|
153
|
+
const parameterNames = ["self", "recordingIds", "trackSplitValues", "nonce"];
|
|
154
|
+
return (tx) => tx.moveCall({
|
|
155
|
+
package: packageAddress,
|
|
156
|
+
module: 'release',
|
|
157
|
+
function: 'derive_target_release_id',
|
|
158
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Returns the canonical registry's object ID, which is the derivation parent
|
|
163
|
+
* committed to by `new` and `derive_target_release_id`. Exported as the
|
|
164
|
+
* `ReleaseRegistry.id()` method to avoid colliding with the existing
|
|
165
|
+
* `release::id(&Release)` ABI function.
|
|
166
|
+
*/
|
|
167
|
+
export function releaseRegistryId(options) {
|
|
168
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
169
|
+
const argumentsTypes = [
|
|
170
|
+
null
|
|
171
|
+
];
|
|
172
|
+
const parameterNames = ["self"];
|
|
173
|
+
return (tx) => tx.moveCall({
|
|
174
|
+
package: packageAddress,
|
|
175
|
+
module: 'release',
|
|
176
|
+
function: 'release_registry_id',
|
|
177
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
178
|
+
});
|
|
179
|
+
}
|
|
132
180
|
/**
|
|
133
181
|
* Publishes the release, making it immutable. Track splits must be set and sum to
|
|
134
182
|
* 100% before publishing. Required State: Initialized
|
|
@@ -166,27 +214,6 @@ export function authorize(options) {
|
|
|
166
214
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
167
215
|
});
|
|
168
216
|
}
|
|
169
|
-
/**
|
|
170
|
-
* Derives the target release ID that `new()` would produce for the given inputs
|
|
171
|
-
* and parent, without creating the object. This is the on-chain equivalent of the
|
|
172
|
-
* client-side `deriveReleaseId()` function.
|
|
173
|
-
*/
|
|
174
|
-
export function deriveTargetReleaseId(options) {
|
|
175
|
-
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
176
|
-
const argumentsTypes = [
|
|
177
|
-
'vector<0x2::object::ID>',
|
|
178
|
-
'vector<u64>',
|
|
179
|
-
'u256',
|
|
180
|
-
'0x2::object::ID'
|
|
181
|
-
];
|
|
182
|
-
const parameterNames = ["recordingIds", "trackSplitValues", "nonce", "parent"];
|
|
183
|
-
return (tx) => tx.moveCall({
|
|
184
|
-
package: packageAddress,
|
|
185
|
-
module: 'release',
|
|
186
|
-
function: 'derive_target_release_id',
|
|
187
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
217
|
/** Returns the release's object ID. */
|
|
191
218
|
export function id(options) {
|
|
192
219
|
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release.js","sourceRoot":"","sources":["../../../src/contracts/miso/release.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE
|
|
1
|
+
{"version":3,"file":"release.js","sourceRoot":"","sources":["../../../src/contracts/miso/release.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAEH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,sBAAsB,EAA+B,MAAM,mBAAmB,CAAC;AACzH,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAA8C,MAAM,0BAA0B,CAAC;AACtF,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,MAAM,WAAW,GAAG,0BAA0B,CAAC;AAC/C,oCAAoC;AACpC,M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AC3E,MAAM,UAAU,GAAG,CAAC,OAAmB;IACnC,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,IAAI,iBAAiB,CAAC;IAC5D,MAAM,cAAc,GAAG;QACnB,IAAI;KACqB,CAAC;IAC9B,MAAM,cAAc,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,OAAO,CAAC,EAAe,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,KAAK;QACf,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC;AAYD;;;;;;GAMG;AACH,MAAM,UAAU,MAAM,CAAC,OAAsB;IACzC,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,IAAI,iBAAiB,CAAC;IAC5D,MAAM,cAAc,GAAG;QACnB,IAAI;QACJ,IAAI;KACqB,CAAC;IAC9B,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACvC,OAAO,CAAC,EAAe,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,SAAS;QACnB,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* consumed off-chain and derived from the recording via `recording_id`; a `Track`
|
|
26
26
|
* embeds exactly the facts on-chain consumers cannot reach any other way.
|
|
27
27
|
*/
|
|
28
|
-
import { MoveEnum, MoveStruct, type RawTransactionArgument } from '../utils/index.
|
|
28
|
+
import { MoveEnum, MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
|
|
29
29
|
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
30
30
|
/**
|
|
31
31
|
* Lifecycle state of a track within a release. A track is born `Unassigned`,
|
|
@@ -75,7 +75,7 @@ export declare const Track: MoveStruct<{
|
|
|
75
75
|
* ownership at recording creation, so it is not split out here — a track routes
|
|
76
76
|
* its full share to the recording.
|
|
77
77
|
*/
|
|
78
|
-
split_bps: import("../utils/index.
|
|
78
|
+
split_bps: import("../utils/index.ts").MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<number, number, "u16">], "bps::bps::BPS">;
|
|
79
79
|
}, "@local-pkg/miso::track::Track">;
|
|
80
80
|
export interface NewArguments {
|
|
81
81
|
_: RawTransactionArgument<string>;
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
* consumed off-chain and derived from the recording via `recording_id`; a `Track`
|
|
26
26
|
* embeds exactly the facts on-chain consumers cannot reach any other way.
|
|
27
27
|
*/
|
|
28
|
-
import { MoveEnum, MoveStruct, normalizeMoveArguments } from
|
|
28
|
+
import { MoveEnum, MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
29
29
|
import { bcs } from '@mysten/sui/bcs';
|
|
30
30
|
import {} from '@mysten/sui/transactions';
|
|
31
|
-
import * as bps from
|
|
31
|
+
import * as bps from "./deps/bps/bps.js";
|
|
32
32
|
const $moduleName = '@local-pkg/miso::track';
|
|
33
33
|
/**
|
|
34
34
|
* Lifecycle state of a track within a release. A track is born `Unassigned`,
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* The parental advisory rating for a recording — whether its lyrics are explicit —
|
|
6
|
+
* stored as a dynamic field on the recording's UID and written through its
|
|
7
|
+
* cap-gated `uid_mut`.
|
|
8
|
+
*
|
|
9
|
+
* This is its own package on purpose. Advisory ratings are set by a different
|
|
10
|
+
* person, at a different time, for entirely different reasons than the other facts
|
|
11
|
+
* about a recording, and the standard that governs them moves on its own schedule.
|
|
12
|
+
* Bundling it into a general "recording metadata" object would mean that revising
|
|
13
|
+
* the advisory standard drags every unrelated field through the migration. Kept
|
|
14
|
+
* separate, a consumer implementing some future metadata profile selects this
|
|
15
|
+
* extension or ignores it, and swapping it touches nothing else.
|
|
16
|
+
*
|
|
17
|
+
* The rating is deliberately not a boolean. Every distributor and storefront
|
|
18
|
+
* distinguishes a _cleaned_ edit — an explicit recording re-issued with the
|
|
19
|
+
* offending content removed — from a recording that was never explicit at all.
|
|
20
|
+
* They are merchandised differently and a boolean cannot express the difference,
|
|
21
|
+
* so `Cleaned` is a first-class variant.
|
|
22
|
+
*
|
|
23
|
+
* Attaching the extension IS the statement. There is no "attached but undeclared"
|
|
24
|
+
* state: if a rating is present it has been asserted by the rights holder, and a
|
|
25
|
+
* recording with nothing attached has simply said nothing.
|
|
26
|
+
*/
|
|
27
|
+
import { MoveTuple, MoveEnum, MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
|
|
28
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
29
|
+
export declare const ExtensionKey: MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">], "@local-pkg/recording_advisory::recording_advisory::ExtensionKey">;
|
|
30
|
+
/** A recording's parental advisory rating. */
|
|
31
|
+
export declare const ExplicitRating: MoveEnum<{
|
|
32
|
+
/** Contains explicit content. */
|
|
33
|
+
Explicit: null;
|
|
34
|
+
/** Contains no explicit content, and never did. */
|
|
35
|
+
NotExplicit: null;
|
|
36
|
+
/** An edited version of a recording that was originally explicit. */
|
|
37
|
+
Cleaned: null;
|
|
38
|
+
}, "@local-pkg/recording_advisory::recording_advisory::ExplicitRating">;
|
|
39
|
+
export declare const AdvisoryRatingSetEvent: MoveStruct<{
|
|
40
|
+
recording_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
41
|
+
rating: MoveEnum<{
|
|
42
|
+
/** Contains explicit content. */
|
|
43
|
+
Explicit: null;
|
|
44
|
+
/** Contains no explicit content, and never did. */
|
|
45
|
+
NotExplicit: null;
|
|
46
|
+
/** An edited version of a recording that was originally explicit. */
|
|
47
|
+
Cleaned: null;
|
|
48
|
+
}, "@local-pkg/recording_advisory::recording_advisory::ExplicitRating">;
|
|
49
|
+
}, "@local-pkg/recording_advisory::recording_advisory::AdvisoryRatingSetEvent">;
|
|
50
|
+
export declare const AdvisoryRatingUnsetEvent: MoveStruct<{
|
|
51
|
+
recording_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
52
|
+
}, "@local-pkg/recording_advisory::recording_advisory::AdvisoryRatingUnsetEvent">;
|
|
53
|
+
export interface ExplicitOptions {
|
|
54
|
+
package?: string;
|
|
55
|
+
arguments?: [
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
/** Contains explicit content. */
|
|
59
|
+
export declare function explicit(options?: ExplicitOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
60
|
+
export interface NotExplicitOptions {
|
|
61
|
+
package?: string;
|
|
62
|
+
arguments?: [
|
|
63
|
+
];
|
|
64
|
+
}
|
|
65
|
+
/** Contains no explicit content, and never did. */
|
|
66
|
+
export declare function notExplicit(options?: NotExplicitOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
67
|
+
export interface CleanedOptions {
|
|
68
|
+
package?: string;
|
|
69
|
+
arguments?: [
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
/** An edited version of a recording that was originally explicit. */
|
|
73
|
+
export declare function cleaned(options?: CleanedOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
74
|
+
export interface SetRatingArguments {
|
|
75
|
+
self: RawTransactionArgument<string>;
|
|
76
|
+
cap: RawTransactionArgument<string>;
|
|
77
|
+
rating: TransactionArgument;
|
|
78
|
+
}
|
|
79
|
+
export interface SetRatingOptions {
|
|
80
|
+
package?: string;
|
|
81
|
+
arguments: SetRatingArguments | [
|
|
82
|
+
self: RawTransactionArgument<string>,
|
|
83
|
+
cap: RawTransactionArgument<string>,
|
|
84
|
+
rating: TransactionArgument
|
|
85
|
+
];
|
|
86
|
+
typeArguments: [
|
|
87
|
+
string,
|
|
88
|
+
string
|
|
89
|
+
];
|
|
90
|
+
}
|
|
91
|
+
/** Sets (or replaces) the recording's advisory rating. */
|
|
92
|
+
export declare function setRating(options: SetRatingOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
93
|
+
export interface UnsetRatingArguments {
|
|
94
|
+
self: RawTransactionArgument<string>;
|
|
95
|
+
cap: RawTransactionArgument<string>;
|
|
96
|
+
}
|
|
97
|
+
export interface UnsetRatingOptions {
|
|
98
|
+
package?: string;
|
|
99
|
+
arguments: UnsetRatingArguments | [
|
|
100
|
+
self: RawTransactionArgument<string>,
|
|
101
|
+
cap: RawTransactionArgument<string>
|
|
102
|
+
];
|
|
103
|
+
typeArguments: [
|
|
104
|
+
string,
|
|
105
|
+
string
|
|
106
|
+
];
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Removes the rating, if any. Idempotent — the recording is left having said
|
|
110
|
+
* nothing about its content, which is distinct from asserting `NotExplicit`.
|
|
111
|
+
*/
|
|
112
|
+
export declare function unsetRating(options: UnsetRatingOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
113
|
+
export interface HasRatingArguments {
|
|
114
|
+
self: RawTransactionArgument<string>;
|
|
115
|
+
}
|
|
116
|
+
export interface HasRatingOptions {
|
|
117
|
+
package?: string;
|
|
118
|
+
arguments: HasRatingArguments | [
|
|
119
|
+
self: RawTransactionArgument<string>
|
|
120
|
+
];
|
|
121
|
+
typeArguments: [
|
|
122
|
+
string,
|
|
123
|
+
string
|
|
124
|
+
];
|
|
125
|
+
}
|
|
126
|
+
/** Whether an advisory rating is attached to this recording. */
|
|
127
|
+
export declare function hasRating(options: HasRatingOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
128
|
+
export interface RatingArguments {
|
|
129
|
+
self: RawTransactionArgument<string>;
|
|
130
|
+
}
|
|
131
|
+
export interface RatingOptions {
|
|
132
|
+
package?: string;
|
|
133
|
+
arguments: RatingArguments | [
|
|
134
|
+
self: RawTransactionArgument<string>
|
|
135
|
+
];
|
|
136
|
+
typeArguments: [
|
|
137
|
+
string,
|
|
138
|
+
string
|
|
139
|
+
];
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* The recording's advisory rating. Aborts if none is attached — callers that
|
|
143
|
+
* tolerate an unrated recording should check `has_rating` first, since absence is
|
|
144
|
+
* a meaningful state and must not be silently read as `NotExplicit`.
|
|
145
|
+
*/
|
|
146
|
+
export declare function rating(options: RatingOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
147
|
+
export interface IsExplicitArguments {
|
|
148
|
+
self: TransactionArgument;
|
|
149
|
+
}
|
|
150
|
+
export interface IsExplicitOptions {
|
|
151
|
+
package?: string;
|
|
152
|
+
arguments: IsExplicitArguments | [
|
|
153
|
+
self: TransactionArgument
|
|
154
|
+
];
|
|
155
|
+
}
|
|
156
|
+
/** Whether the recording contains explicit content. */
|
|
157
|
+
export declare function isExplicit(options: IsExplicitOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
158
|
+
export interface IsNotExplicitArguments {
|
|
159
|
+
self: TransactionArgument;
|
|
160
|
+
}
|
|
161
|
+
export interface IsNotExplicitOptions {
|
|
162
|
+
package?: string;
|
|
163
|
+
arguments: IsNotExplicitArguments | [
|
|
164
|
+
self: TransactionArgument
|
|
165
|
+
];
|
|
166
|
+
}
|
|
167
|
+
/** Whether the recording contains no explicit content and never did. */
|
|
168
|
+
export declare function isNotExplicit(options: IsNotExplicitOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
169
|
+
export interface IsCleanedArguments {
|
|
170
|
+
self: TransactionArgument;
|
|
171
|
+
}
|
|
172
|
+
export interface IsCleanedOptions {
|
|
173
|
+
package?: string;
|
|
174
|
+
arguments: IsCleanedArguments | [
|
|
175
|
+
self: TransactionArgument
|
|
176
|
+
];
|
|
177
|
+
}
|
|
178
|
+
/** Whether the recording is an edited version of an originally explicit one. */
|
|
179
|
+
export declare function isCleaned(options: IsCleanedOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
180
|
+
export interface NameArguments {
|
|
181
|
+
self: TransactionArgument;
|
|
182
|
+
}
|
|
183
|
+
export interface NameOptions {
|
|
184
|
+
package?: string;
|
|
185
|
+
arguments: NameArguments | [
|
|
186
|
+
self: TransactionArgument
|
|
187
|
+
];
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* The rating's canonical name, for clients and indexers that need a stable string
|
|
191
|
+
* rather than a Move value.
|
|
192
|
+
*/
|
|
193
|
+
export declare function name(options: NameOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
194
|
+
//# sourceMappingURL=recording_advisory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recording_advisory.d.ts","sourceRoot":"","sources":["../../../src/contracts/recording_advisory/recording_advisory.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAA0B,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEzH,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEtF,eAAO,MAAM,YAAY,sJAAgF,CAAC;AAC1G,8CAA8C;AAC9C,eAAO,MAAM,cAAc;IACnB,iCAAiC;;IAEjC,mDAAmD;;IAEnD,qEAAqE;;uEAErE,CAAC;AACT,eAAO,MAAM,sBAAsB;;;QAP3B,iCAAiC;;QAEjC,mDAAmD;;QAEnD,q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AiB;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,mBAAmB,GAAG;QAC7B,IAAI,EAAE,mBAAmB;KAC5B,CAAC;CACL;AACD,uDAAuD;AACvD,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,IAMzC,IAAI,WAAW,0DAM1B;AACD,MAAM,WAAW,sBAAsB;IACnC,IAAI,EAAE,mBAAmB,CAAC;CAC7B;AACD,MAAM,WAAW,oBAAoB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,sBAAsB,GAAG;QAChC,IAAI,EAAE,mBAAmB;KAC5B,CAAC;CACL;AACD,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,IAM/C,IAAI,WAAW,0DAM1B;AACD,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,mBAAmB,CAAC;CAC7B;AACD,MAAM,WAAW,gBAAgB;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,kBAAkB,GAAG;QAC5B,IAAI,EAAE,mBAAmB;KAC5B,CAAC;CACL;AACD,gFAAgF;AAChF,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,IAMvC,IAAI,WAAW,0DAM1B;AACD,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,mBAAmB,CAAC;CAC7B;AACD,MAAM,WAAW,WAAW;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,aAAa,GAAG;QACvB,IAAI,EAAE,mBAAmB;KAC5B,CAAC;CACL;AACD;;;GAGG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,WAAW,IAM7B,IAAI,WAAW,0DAM1B"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* The parental advisory rating for a recording — whether its lyrics are explicit —
|
|
6
|
+
* stored as a dynamic field on the recording's UID and written through its
|
|
7
|
+
* cap-gated `uid_mut`.
|
|
8
|
+
*
|
|
9
|
+
* This is its own package on purpose. Advisory ratings are set by a different
|
|
10
|
+
* person, at a different time, for entirely different reasons than the other facts
|
|
11
|
+
* about a recording, and the standard that governs them moves on its own schedule.
|
|
12
|
+
* Bundling it into a general "recording metadata" object would mean that revising
|
|
13
|
+
* the advisory standard drags every unrelated field through the migration. Kept
|
|
14
|
+
* separate, a consumer implementing some future metadata profile selects this
|
|
15
|
+
* extension or ignores it, and swapping it touches nothing else.
|
|
16
|
+
*
|
|
17
|
+
* The rating is deliberately not a boolean. Every distributor and storefront
|
|
18
|
+
* distinguishes a _cleaned_ edit — an explicit recording re-issued with the
|
|
19
|
+
* offending content removed — from a recording that was never explicit at all.
|
|
20
|
+
* They are merchandised differently and a boolean cannot express the difference,
|
|
21
|
+
* so `Cleaned` is a first-class variant.
|
|
22
|
+
*
|
|
23
|
+
* Attaching the extension IS the statement. There is no "attached but undeclared"
|
|
24
|
+
* state: if a rating is present it has been asserted by the rights holder, and a
|
|
25
|
+
* recording with nothing attached has simply said nothing.
|
|
26
|
+
*/
|
|
27
|
+
import { MoveTuple, MoveEnum, MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
28
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
29
|
+
import {} from '@mysten/sui/transactions';
|
|
30
|
+
const $moduleName = '@local-pkg/recording_advisory::recording_advisory';
|
|
31
|
+
export const ExtensionKey = new MoveTuple({ name: `${$moduleName}::ExtensionKey`, fields: [bcs.bool()] });
|
|
32
|
+
/** A recording's parental advisory rating. */
|
|
33
|
+
export const ExplicitRating = new MoveEnum({ name: `${$moduleName}::ExplicitRating`, fields: {
|
|
34
|
+
/** Contains explicit content. */
|
|
35
|
+
Explicit: null,
|
|
36
|
+
/** Contains no explicit content, and never did. */
|
|
37
|
+
NotExplicit: null,
|
|
38
|
+
/** An edited version of a recording that was originally explicit. */
|
|
39
|
+
Cleaned: null
|
|
40
|
+
} });
|
|
41
|
+
export const AdvisoryRatingSetEvent = new MoveStruct({ name: `${$moduleName}::AdvisoryRatingSetEvent`, fields: {
|
|
42
|
+
recording_id: bcs.Address,
|
|
43
|
+
rating: ExplicitRating
|
|
44
|
+
} });
|
|
45
|
+
export const AdvisoryRatingUnsetEvent = new MoveStruct({ name: `${$moduleName}::AdvisoryRatingUnsetEvent`, fields: {
|
|
46
|
+
recording_id: bcs.Address
|
|
47
|
+
} });
|
|
48
|
+
/** Contains explicit content. */
|
|
49
|
+
export function explicit(options = {}) {
|
|
50
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
51
|
+
return (tx) => tx.moveCall({
|
|
52
|
+
package: packageAddress,
|
|
53
|
+
module: 'recording_advisory',
|
|
54
|
+
function: 'explicit',
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/** Contains no explicit content, and never did. */
|
|
58
|
+
export function notExplicit(options = {}) {
|
|
59
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
60
|
+
return (tx) => tx.moveCall({
|
|
61
|
+
package: packageAddress,
|
|
62
|
+
module: 'recording_advisory',
|
|
63
|
+
function: 'not_explicit',
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/** An edited version of a recording that was originally explicit. */
|
|
67
|
+
export function cleaned(options = {}) {
|
|
68
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
69
|
+
return (tx) => tx.moveCall({
|
|
70
|
+
package: packageAddress,
|
|
71
|
+
module: 'recording_advisory',
|
|
72
|
+
function: 'cleaned',
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/** Sets (or replaces) the recording's advisory rating. */
|
|
76
|
+
export function setRating(options) {
|
|
77
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
78
|
+
const argumentsTypes = [
|
|
79
|
+
null,
|
|
80
|
+
null,
|
|
81
|
+
null
|
|
82
|
+
];
|
|
83
|
+
const parameterNames = ["self", "cap", "rating"];
|
|
84
|
+
return (tx) => tx.moveCall({
|
|
85
|
+
package: packageAddress,
|
|
86
|
+
module: 'recording_advisory',
|
|
87
|
+
function: 'set_rating',
|
|
88
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
89
|
+
typeArguments: options.typeArguments
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Removes the rating, if any. Idempotent — the recording is left having said
|
|
94
|
+
* nothing about its content, which is distinct from asserting `NotExplicit`.
|
|
95
|
+
*/
|
|
96
|
+
export function unsetRating(options) {
|
|
97
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
98
|
+
const argumentsTypes = [
|
|
99
|
+
null,
|
|
100
|
+
null
|
|
101
|
+
];
|
|
102
|
+
const parameterNames = ["self", "cap"];
|
|
103
|
+
return (tx) => tx.moveCall({
|
|
104
|
+
package: packageAddress,
|
|
105
|
+
module: 'recording_advisory',
|
|
106
|
+
function: 'unset_rating',
|
|
107
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
108
|
+
typeArguments: options.typeArguments
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/** Whether an advisory rating is attached to this recording. */
|
|
112
|
+
export function hasRating(options) {
|
|
113
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
114
|
+
const argumentsTypes = [
|
|
115
|
+
null
|
|
116
|
+
];
|
|
117
|
+
const parameterNames = ["self"];
|
|
118
|
+
return (tx) => tx.moveCall({
|
|
119
|
+
package: packageAddress,
|
|
120
|
+
module: 'recording_advisory',
|
|
121
|
+
function: 'has_rating',
|
|
122
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
123
|
+
typeArguments: options.typeArguments
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* The recording's advisory rating. Aborts if none is attached — callers that
|
|
128
|
+
* tolerate an unrated recording should check `has_rating` first, since absence is
|
|
129
|
+
* a meaningful state and must not be silently read as `NotExplicit`.
|
|
130
|
+
*/
|
|
131
|
+
export function rating(options) {
|
|
132
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
133
|
+
const argumentsTypes = [
|
|
134
|
+
null
|
|
135
|
+
];
|
|
136
|
+
const parameterNames = ["self"];
|
|
137
|
+
return (tx) => tx.moveCall({
|
|
138
|
+
package: packageAddress,
|
|
139
|
+
module: 'recording_advisory',
|
|
140
|
+
function: 'rating',
|
|
141
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
142
|
+
typeArguments: options.typeArguments
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
/** Whether the recording contains explicit content. */
|
|
146
|
+
export function isExplicit(options) {
|
|
147
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
148
|
+
const argumentsTypes = [
|
|
149
|
+
null
|
|
150
|
+
];
|
|
151
|
+
const parameterNames = ["self"];
|
|
152
|
+
return (tx) => tx.moveCall({
|
|
153
|
+
package: packageAddress,
|
|
154
|
+
module: 'recording_advisory',
|
|
155
|
+
function: 'is_explicit',
|
|
156
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
/** Whether the recording contains no explicit content and never did. */
|
|
160
|
+
export function isNotExplicit(options) {
|
|
161
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
162
|
+
const argumentsTypes = [
|
|
163
|
+
null
|
|
164
|
+
];
|
|
165
|
+
const parameterNames = ["self"];
|
|
166
|
+
return (tx) => tx.moveCall({
|
|
167
|
+
package: packageAddress,
|
|
168
|
+
module: 'recording_advisory',
|
|
169
|
+
function: 'is_not_explicit',
|
|
170
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
/** Whether the recording is an edited version of an originally explicit one. */
|
|
174
|
+
export function isCleaned(options) {
|
|
175
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
176
|
+
const argumentsTypes = [
|
|
177
|
+
null
|
|
178
|
+
];
|
|
179
|
+
const parameterNames = ["self"];
|
|
180
|
+
return (tx) => tx.moveCall({
|
|
181
|
+
package: packageAddress,
|
|
182
|
+
module: 'recording_advisory',
|
|
183
|
+
function: 'is_cleaned',
|
|
184
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* The rating's canonical name, for clients and indexers that need a stable string
|
|
189
|
+
* rather than a Move value.
|
|
190
|
+
*/
|
|
191
|
+
export function name(options) {
|
|
192
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
193
|
+
const argumentsTypes = [
|
|
194
|
+
null
|
|
195
|
+
];
|
|
196
|
+
const parameterNames = ["self"];
|
|
197
|
+
return (tx) => tx.moveCall({
|
|
198
|
+
package: packageAddress,
|
|
199
|
+
module: 'recording_advisory',
|
|
200
|
+
function: 'name',
|
|
201
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=recording_advisory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recording_advisory.js","sourceRoot":"","sources":["../../../src/contracts/recording_advisory/recording_advisory.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,sBAAsB,EAA+B,MAAM,mBAAmB,CAAC;AACzH,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAA8C,MAAM,0BAA0B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