@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
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `PerTrack<Data>` — one `Data` value per track of a release, held in tracklist
|
|
8
|
+
* order.
|
|
9
|
+
*
|
|
10
|
+
* A release's tracks are a flat, ordered `vector<Track>`, frozen at release
|
|
11
|
+
* creation. `PerTrack` is the parallel array to that list: index `i` holds the
|
|
12
|
+
* payload for the `i`-th track. It is the shared shape behind per-track release
|
|
13
|
+
* metadata such as cover art (`PerTrack<Option<CoverArt>>`) or genre — and the
|
|
14
|
+
* natural home for display grouping (disc/side boundaries), which core
|
|
15
|
+
* deliberately does not store.
|
|
16
|
+
*
|
|
17
|
+
* Construction reads the `Release` and sizes/validates the array against the
|
|
18
|
+
* tracklist length, so a `PerTrack` is parallel to the tracklist _by construction_
|
|
19
|
+
* — an extension cannot attach a misaligned array. Because a release's tracklist
|
|
20
|
+
* is frozen at creation, that alignment holds for the release's whole life.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import { type BcsType, bcs } from '@mysten/sui/bcs';
|
|
24
|
+
import { MoveTuple } from '../../../utils/index.ts';
|
|
25
|
+
const $moduleName = 'per_track::per_track';
|
|
26
|
+
/**
|
|
27
|
+
* One `Data` per track, indexed by the release's tracklist position. `Data` is the
|
|
28
|
+
* per-track payload — e.g. `CoverArt` when every track carries one, or
|
|
29
|
+
* `Option<CoverArt>` for override-style metadata layered over an album-level
|
|
30
|
+
* default.
|
|
31
|
+
*/
|
|
32
|
+
export function PerTrack<Data extends BcsType<any>>(...typeParameters: [
|
|
33
|
+
Data
|
|
34
|
+
]) {
|
|
35
|
+
return new MoveTuple({ name: `${$moduleName}::PerTrack<${typeParameters[0].name as Data['name']}>`, fields: [bcs.vector(typeParameters[0])] });
|
|
36
|
+
}
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Genre assignment for a Miso release: an album-level primary + secondary genres,
|
|
8
|
+
* plus optional per-track primary overrides.
|
|
9
|
+
*
|
|
10
|
+
* Genre is presentation, not objective recording data, so it is assigned on the
|
|
11
|
+
* release (the consumer object), not the recording. Stored as a single
|
|
12
|
+
* `ReleaseGenre` dynamic field on the release's UID, gated by the
|
|
13
|
+
* `ReleaseAdminCap`.
|
|
14
|
+
*
|
|
15
|
+
* A track's effective primary genre resolves as: its per-track override if set,
|
|
16
|
+
* else the album primary.
|
|
17
|
+
*
|
|
18
|
+
* A genre is either the album primary or a secondary, never both — the two are
|
|
19
|
+
* kept disjoint: setting the primary to a current secondary aborts (remove it from
|
|
20
|
+
* the secondaries first), and adding the current primary as a secondary aborts.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import { MoveTuple, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.ts';
|
|
24
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
25
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
26
|
+
import * as per_track from './deps/per_track/per_track.ts';
|
|
27
|
+
const $moduleName = '@local-pkg/release_genre::release_genre';
|
|
28
|
+
export const ExtensionKey = new MoveTuple({ name: `${$moduleName}::ExtensionKey`, fields: [bcs.bool()] });
|
|
29
|
+
export const ReleaseGenre = new MoveStruct({ name: `${$moduleName}::ReleaseGenre`, fields: {
|
|
30
|
+
primary: bcs.Address,
|
|
31
|
+
secondary: bcs.vector(bcs.Address),
|
|
32
|
+
track_primary: per_track.PerTrack(bcs.option(bcs.Address))
|
|
33
|
+
} });
|
|
34
|
+
export const PrimaryGenreSetEvent = new MoveStruct({ name: `${$moduleName}::PrimaryGenreSetEvent`, fields: {
|
|
35
|
+
release_id: bcs.Address,
|
|
36
|
+
genre_id: bcs.Address
|
|
37
|
+
} });
|
|
38
|
+
export const SecondaryGenreAddedEvent = new MoveStruct({ name: `${$moduleName}::SecondaryGenreAddedEvent`, fields: {
|
|
39
|
+
release_id: bcs.Address,
|
|
40
|
+
genre_id: bcs.Address
|
|
41
|
+
} });
|
|
42
|
+
export const SecondaryGenreRemovedEvent = new MoveStruct({ name: `${$moduleName}::SecondaryGenreRemovedEvent`, fields: {
|
|
43
|
+
release_id: bcs.Address,
|
|
44
|
+
genre_id: bcs.Address
|
|
45
|
+
} });
|
|
46
|
+
export const TrackPrimaryGenreSetEvent = new MoveStruct({ name: `${$moduleName}::TrackPrimaryGenreSetEvent`, fields: {
|
|
47
|
+
release_id: bcs.Address,
|
|
48
|
+
track_index: bcs.u64(),
|
|
49
|
+
genre_id: bcs.Address
|
|
50
|
+
} });
|
|
51
|
+
export const TrackPrimaryGenreUnsetEvent = new MoveStruct({ name: `${$moduleName}::TrackPrimaryGenreUnsetEvent`, fields: {
|
|
52
|
+
release_id: bcs.Address,
|
|
53
|
+
track_index: bcs.u64()
|
|
54
|
+
} });
|
|
55
|
+
export interface SetPrimaryGenreArguments {
|
|
56
|
+
self: RawTransactionArgument<string>;
|
|
57
|
+
cap: RawTransactionArgument<string>;
|
|
58
|
+
genre: RawTransactionArgument<string>;
|
|
59
|
+
}
|
|
60
|
+
export interface SetPrimaryGenreOptions {
|
|
61
|
+
package?: string;
|
|
62
|
+
arguments: SetPrimaryGenreArguments | [
|
|
63
|
+
self: RawTransactionArgument<string>,
|
|
64
|
+
cap: RawTransactionArgument<string>,
|
|
65
|
+
genre: RawTransactionArgument<string>
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Sets (or replaces) the album primary genre. Gated by the release admin cap.
|
|
70
|
+
* Aborts if the genre is currently an album secondary — remove it from the
|
|
71
|
+
* secondaries first (primary and secondary are kept disjoint).
|
|
72
|
+
*/
|
|
73
|
+
export function setPrimaryGenre(options: SetPrimaryGenreOptions) {
|
|
74
|
+
const packageAddress = options.package ?? '@local-pkg/release_genre';
|
|
75
|
+
const argumentsTypes = [
|
|
76
|
+
null,
|
|
77
|
+
null,
|
|
78
|
+
null
|
|
79
|
+
] satisfies (string | null)[];
|
|
80
|
+
const parameterNames = ["self", "cap", "genre"];
|
|
81
|
+
return (tx: Transaction) => tx.moveCall({
|
|
82
|
+
package: packageAddress,
|
|
83
|
+
module: 'release_genre',
|
|
84
|
+
function: 'set_primary_genre',
|
|
85
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
export interface AddSecondaryGenreArguments {
|
|
89
|
+
self: RawTransactionArgument<string>;
|
|
90
|
+
cap: RawTransactionArgument<string>;
|
|
91
|
+
genre: RawTransactionArgument<string>;
|
|
92
|
+
}
|
|
93
|
+
export interface AddSecondaryGenreOptions {
|
|
94
|
+
package?: string;
|
|
95
|
+
arguments: AddSecondaryGenreArguments | [
|
|
96
|
+
self: RawTransactionArgument<string>,
|
|
97
|
+
cap: RawTransactionArgument<string>,
|
|
98
|
+
genre: RawTransactionArgument<string>
|
|
99
|
+
];
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Adds an album secondary genre. Requires the album primary first. Rejects a
|
|
103
|
+
* secondary equal to the primary, duplicates, and counts at/above the maximum.
|
|
104
|
+
*/
|
|
105
|
+
export function addSecondaryGenre(options: AddSecondaryGenreOptions) {
|
|
106
|
+
const packageAddress = options.package ?? '@local-pkg/release_genre';
|
|
107
|
+
const argumentsTypes = [
|
|
108
|
+
null,
|
|
109
|
+
null,
|
|
110
|
+
null
|
|
111
|
+
] satisfies (string | null)[];
|
|
112
|
+
const parameterNames = ["self", "cap", "genre"];
|
|
113
|
+
return (tx: Transaction) => tx.moveCall({
|
|
114
|
+
package: packageAddress,
|
|
115
|
+
module: 'release_genre',
|
|
116
|
+
function: 'add_secondary_genre',
|
|
117
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
export interface RemoveSecondaryGenreArguments {
|
|
121
|
+
self: RawTransactionArgument<string>;
|
|
122
|
+
cap: RawTransactionArgument<string>;
|
|
123
|
+
genre: RawTransactionArgument<string>;
|
|
124
|
+
}
|
|
125
|
+
export interface RemoveSecondaryGenreOptions {
|
|
126
|
+
package?: string;
|
|
127
|
+
arguments: RemoveSecondaryGenreArguments | [
|
|
128
|
+
self: RawTransactionArgument<string>,
|
|
129
|
+
cap: RawTransactionArgument<string>,
|
|
130
|
+
genre: RawTransactionArgument<string>
|
|
131
|
+
];
|
|
132
|
+
}
|
|
133
|
+
/** Removes an album secondary genre. */
|
|
134
|
+
export function removeSecondaryGenre(options: RemoveSecondaryGenreOptions) {
|
|
135
|
+
const packageAddress = options.package ?? '@local-pkg/release_genre';
|
|
136
|
+
const argumentsTypes = [
|
|
137
|
+
null,
|
|
138
|
+
null,
|
|
139
|
+
null
|
|
140
|
+
] satisfies (string | null)[];
|
|
141
|
+
const parameterNames = ["self", "cap", "genre"];
|
|
142
|
+
return (tx: Transaction) => tx.moveCall({
|
|
143
|
+
package: packageAddress,
|
|
144
|
+
module: 'release_genre',
|
|
145
|
+
function: 'remove_secondary_genre',
|
|
146
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
export interface SetTrackPrimaryGenreArguments {
|
|
150
|
+
self: RawTransactionArgument<string>;
|
|
151
|
+
cap: RawTransactionArgument<string>;
|
|
152
|
+
trackIndex: RawTransactionArgument<number | bigint>;
|
|
153
|
+
genre: RawTransactionArgument<string>;
|
|
154
|
+
}
|
|
155
|
+
export interface SetTrackPrimaryGenreOptions {
|
|
156
|
+
package?: string;
|
|
157
|
+
arguments: SetTrackPrimaryGenreArguments | [
|
|
158
|
+
self: RawTransactionArgument<string>,
|
|
159
|
+
cap: RawTransactionArgument<string>,
|
|
160
|
+
trackIndex: RawTransactionArgument<number | bigint>,
|
|
161
|
+
genre: RawTransactionArgument<string>
|
|
162
|
+
];
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Sets (or replaces) a track's primary-genre override (by tracklist index).
|
|
166
|
+
* Requires the album primary first. Aborts if the index is out of range.
|
|
167
|
+
*/
|
|
168
|
+
export function setTrackPrimaryGenre(options: SetTrackPrimaryGenreOptions) {
|
|
169
|
+
const packageAddress = options.package ?? '@local-pkg/release_genre';
|
|
170
|
+
const argumentsTypes = [
|
|
171
|
+
null,
|
|
172
|
+
null,
|
|
173
|
+
'u64',
|
|
174
|
+
null
|
|
175
|
+
] satisfies (string | null)[];
|
|
176
|
+
const parameterNames = ["self", "cap", "trackIndex", "genre"];
|
|
177
|
+
return (tx: Transaction) => tx.moveCall({
|
|
178
|
+
package: packageAddress,
|
|
179
|
+
module: 'release_genre',
|
|
180
|
+
function: 'set_track_primary_genre',
|
|
181
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
export interface UnsetTrackPrimaryGenreArguments {
|
|
185
|
+
self: RawTransactionArgument<string>;
|
|
186
|
+
cap: RawTransactionArgument<string>;
|
|
187
|
+
trackIndex: RawTransactionArgument<number | bigint>;
|
|
188
|
+
}
|
|
189
|
+
export interface UnsetTrackPrimaryGenreOptions {
|
|
190
|
+
package?: string;
|
|
191
|
+
arguments: UnsetTrackPrimaryGenreArguments | [
|
|
192
|
+
self: RawTransactionArgument<string>,
|
|
193
|
+
cap: RawTransactionArgument<string>,
|
|
194
|
+
trackIndex: RawTransactionArgument<number | bigint>
|
|
195
|
+
];
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Removes a track's primary-genre override — the track falls back to the album
|
|
199
|
+
* primary. Aborts if the index is out of range.
|
|
200
|
+
*/
|
|
201
|
+
export function unsetTrackPrimaryGenre(options: UnsetTrackPrimaryGenreOptions) {
|
|
202
|
+
const packageAddress = options.package ?? '@local-pkg/release_genre';
|
|
203
|
+
const argumentsTypes = [
|
|
204
|
+
null,
|
|
205
|
+
null,
|
|
206
|
+
'u64'
|
|
207
|
+
] satisfies (string | null)[];
|
|
208
|
+
const parameterNames = ["self", "cap", "trackIndex"];
|
|
209
|
+
return (tx: Transaction) => tx.moveCall({
|
|
210
|
+
package: packageAddress,
|
|
211
|
+
module: 'release_genre',
|
|
212
|
+
function: 'unset_track_primary_genre',
|
|
213
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
export interface HasGenreArguments {
|
|
217
|
+
self: RawTransactionArgument<string>;
|
|
218
|
+
}
|
|
219
|
+
export interface HasGenreOptions {
|
|
220
|
+
package?: string;
|
|
221
|
+
arguments: HasGenreArguments | [
|
|
222
|
+
self: RawTransactionArgument<string>
|
|
223
|
+
];
|
|
224
|
+
}
|
|
225
|
+
/** Returns whether the release has a genre assignment. */
|
|
226
|
+
export function hasGenre(options: HasGenreOptions) {
|
|
227
|
+
const packageAddress = options.package ?? '@local-pkg/release_genre';
|
|
228
|
+
const argumentsTypes = [
|
|
229
|
+
null
|
|
230
|
+
] satisfies (string | null)[];
|
|
231
|
+
const parameterNames = ["self"];
|
|
232
|
+
return (tx: Transaction) => tx.moveCall({
|
|
233
|
+
package: packageAddress,
|
|
234
|
+
module: 'release_genre',
|
|
235
|
+
function: 'has_genre',
|
|
236
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
export interface PrimaryGenreArguments {
|
|
240
|
+
self: RawTransactionArgument<string>;
|
|
241
|
+
}
|
|
242
|
+
export interface PrimaryGenreOptions {
|
|
243
|
+
package?: string;
|
|
244
|
+
arguments: PrimaryGenreArguments | [
|
|
245
|
+
self: RawTransactionArgument<string>
|
|
246
|
+
];
|
|
247
|
+
}
|
|
248
|
+
/** Returns the album primary genre id, if set. */
|
|
249
|
+
export function primaryGenre(options: PrimaryGenreOptions) {
|
|
250
|
+
const packageAddress = options.package ?? '@local-pkg/release_genre';
|
|
251
|
+
const argumentsTypes = [
|
|
252
|
+
null
|
|
253
|
+
] satisfies (string | null)[];
|
|
254
|
+
const parameterNames = ["self"];
|
|
255
|
+
return (tx: Transaction) => tx.moveCall({
|
|
256
|
+
package: packageAddress,
|
|
257
|
+
module: 'release_genre',
|
|
258
|
+
function: 'primary_genre',
|
|
259
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
export interface SecondaryGenresArguments {
|
|
263
|
+
self: RawTransactionArgument<string>;
|
|
264
|
+
}
|
|
265
|
+
export interface SecondaryGenresOptions {
|
|
266
|
+
package?: string;
|
|
267
|
+
arguments: SecondaryGenresArguments | [
|
|
268
|
+
self: RawTransactionArgument<string>
|
|
269
|
+
];
|
|
270
|
+
}
|
|
271
|
+
/** Returns the album secondary genre ids (empty if none). */
|
|
272
|
+
export function secondaryGenres(options: SecondaryGenresOptions) {
|
|
273
|
+
const packageAddress = options.package ?? '@local-pkg/release_genre';
|
|
274
|
+
const argumentsTypes = [
|
|
275
|
+
null
|
|
276
|
+
] satisfies (string | null)[];
|
|
277
|
+
const parameterNames = ["self"];
|
|
278
|
+
return (tx: Transaction) => tx.moveCall({
|
|
279
|
+
package: packageAddress,
|
|
280
|
+
module: 'release_genre',
|
|
281
|
+
function: 'secondary_genres',
|
|
282
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
export interface TrackPrimaryGenreArguments {
|
|
286
|
+
self: RawTransactionArgument<string>;
|
|
287
|
+
trackIndex: RawTransactionArgument<number | bigint>;
|
|
288
|
+
}
|
|
289
|
+
export interface TrackPrimaryGenreOptions {
|
|
290
|
+
package?: string;
|
|
291
|
+
arguments: TrackPrimaryGenreArguments | [
|
|
292
|
+
self: RawTransactionArgument<string>,
|
|
293
|
+
trackIndex: RawTransactionArgument<number | bigint>
|
|
294
|
+
];
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Returns a track's effective primary genre: its override if set, else the album
|
|
298
|
+
* primary. None if no genre is assigned to the release. Aborts if the track index
|
|
299
|
+
* is out of range (when an assignment exists).
|
|
300
|
+
*/
|
|
301
|
+
export function trackPrimaryGenre(options: TrackPrimaryGenreOptions) {
|
|
302
|
+
const packageAddress = options.package ?? '@local-pkg/release_genre';
|
|
303
|
+
const argumentsTypes = [
|
|
304
|
+
null,
|
|
305
|
+
'u64'
|
|
306
|
+
] satisfies (string | null)[];
|
|
307
|
+
const parameterNames = ["self", "trackIndex"];
|
|
308
|
+
return (tx: Transaction) => tx.moveCall({
|
|
309
|
+
package: packageAddress,
|
|
310
|
+
module: 'release_genre',
|
|
311
|
+
function: 'track_primary_genre',
|
|
312
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
313
|
+
});
|
|
314
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* What a release calls itself — "Album", "EP", "Mixtape", "Split" — asserted by
|
|
8
|
+
* whoever holds the release's admin cap, and believed.
|
|
9
|
+
*
|
|
10
|
+
* Deliberately a free string rather than an enum. An enum would not decide the
|
|
11
|
+
* classification (the admin still picks) but it would decide the _menu_, and
|
|
12
|
+
* deciding which self-descriptions are legitimate is not the protocol's job.
|
|
13
|
+
* Artists release beat tapes and splits and things nobody has named yet; a closed
|
|
14
|
+
* set would make each of those a package swap, and in the meantime would quietly
|
|
15
|
+
* push releases into whichever official-looking box fit worst.
|
|
16
|
+
*
|
|
17
|
+
* Nothing here derives the value or checks it for plausibility. A four-track
|
|
18
|
+
* release may call itself an Album and a twelve-track one an EP; both happen, and
|
|
19
|
+
* the artist's intent is the fact worth recording. The only checks are structural
|
|
20
|
+
* — non-empty and bounded — so the field stays storable.
|
|
21
|
+
*
|
|
22
|
+
* This is the opposite call from `release_genre`, on purpose. Genre is a curated
|
|
23
|
+
* vocabulary because discovery and reward-eligibility depend on releases agreeing
|
|
24
|
+
* with each other about what a genre _is_. Nothing depends on two releases
|
|
25
|
+
* agreeing about what an EP is.
|
|
26
|
+
*
|
|
27
|
+
* The cost of that freedom lands on readers: "EP", "ep" and "Extended Play" are
|
|
28
|
+
* three distinct values here. Clients that group or facet by kind should normalise
|
|
29
|
+
* (case-fold at minimum) rather than expect canonical strings.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
import { MoveTuple, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.ts';
|
|
33
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
34
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
35
|
+
const $moduleName = '@local-pkg/release_kind::release_kind';
|
|
36
|
+
export const ExtensionKey = new MoveTuple({ name: `${$moduleName}::ExtensionKey`, fields: [bcs.bool()] });
|
|
37
|
+
export const KindSetEvent = new MoveStruct({ name: `${$moduleName}::KindSetEvent`, fields: {
|
|
38
|
+
release_id: bcs.Address,
|
|
39
|
+
kind: bcs.string()
|
|
40
|
+
} });
|
|
41
|
+
export const KindUnsetEvent = new MoveStruct({ name: `${$moduleName}::KindUnsetEvent`, fields: {
|
|
42
|
+
release_id: bcs.Address
|
|
43
|
+
} });
|
|
44
|
+
export interface SetKindArguments {
|
|
45
|
+
self: RawTransactionArgument<string>;
|
|
46
|
+
cap: RawTransactionArgument<string>;
|
|
47
|
+
kind: RawTransactionArgument<string>;
|
|
48
|
+
}
|
|
49
|
+
export interface SetKindOptions {
|
|
50
|
+
package?: string;
|
|
51
|
+
arguments: SetKindArguments | [
|
|
52
|
+
self: RawTransactionArgument<string>,
|
|
53
|
+
cap: RawTransactionArgument<string>,
|
|
54
|
+
kind: RawTransactionArgument<string>
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Sets (or replaces) what the release calls itself.
|
|
59
|
+
*
|
|
60
|
+
* The string is stored exactly as given, including case — it is the release's own
|
|
61
|
+
* word for itself, and normalising it here would be the protocol having an opinion
|
|
62
|
+
* after all.
|
|
63
|
+
*/
|
|
64
|
+
export function setKind(options: SetKindOptions) {
|
|
65
|
+
const packageAddress = options.package ?? '@local-pkg/release_kind';
|
|
66
|
+
const argumentsTypes = [
|
|
67
|
+
null,
|
|
68
|
+
null,
|
|
69
|
+
'0x1::string::String'
|
|
70
|
+
] satisfies (string | null)[];
|
|
71
|
+
const parameterNames = ["self", "cap", "kind"];
|
|
72
|
+
return (tx: Transaction) => tx.moveCall({
|
|
73
|
+
package: packageAddress,
|
|
74
|
+
module: 'release_kind',
|
|
75
|
+
function: 'set_kind',
|
|
76
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
export interface UnsetKindArguments {
|
|
80
|
+
self: RawTransactionArgument<string>;
|
|
81
|
+
cap: RawTransactionArgument<string>;
|
|
82
|
+
}
|
|
83
|
+
export interface UnsetKindOptions {
|
|
84
|
+
package?: string;
|
|
85
|
+
arguments: UnsetKindArguments | [
|
|
86
|
+
self: RawTransactionArgument<string>,
|
|
87
|
+
cap: RawTransactionArgument<string>
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Removes the kind, if any. Idempotent. Leaves the release having said nothing
|
|
92
|
+
* about what it is, which is a different state from calling itself anything.
|
|
93
|
+
*/
|
|
94
|
+
export function unsetKind(options: UnsetKindOptions) {
|
|
95
|
+
const packageAddress = options.package ?? '@local-pkg/release_kind';
|
|
96
|
+
const argumentsTypes = [
|
|
97
|
+
null,
|
|
98
|
+
null
|
|
99
|
+
] satisfies (string | null)[];
|
|
100
|
+
const parameterNames = ["self", "cap"];
|
|
101
|
+
return (tx: Transaction) => tx.moveCall({
|
|
102
|
+
package: packageAddress,
|
|
103
|
+
module: 'release_kind',
|
|
104
|
+
function: 'unset_kind',
|
|
105
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
export interface HasKindArguments {
|
|
109
|
+
self: RawTransactionArgument<string>;
|
|
110
|
+
}
|
|
111
|
+
export interface HasKindOptions {
|
|
112
|
+
package?: string;
|
|
113
|
+
arguments: HasKindArguments | [
|
|
114
|
+
self: RawTransactionArgument<string>
|
|
115
|
+
];
|
|
116
|
+
}
|
|
117
|
+
/** Whether a kind is attached to this release. */
|
|
118
|
+
export function hasKind(options: HasKindOptions) {
|
|
119
|
+
const packageAddress = options.package ?? '@local-pkg/release_kind';
|
|
120
|
+
const argumentsTypes = [
|
|
121
|
+
null
|
|
122
|
+
] satisfies (string | null)[];
|
|
123
|
+
const parameterNames = ["self"];
|
|
124
|
+
return (tx: Transaction) => tx.moveCall({
|
|
125
|
+
package: packageAddress,
|
|
126
|
+
module: 'release_kind',
|
|
127
|
+
function: 'has_kind',
|
|
128
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
export interface KindArguments {
|
|
132
|
+
self: RawTransactionArgument<string>;
|
|
133
|
+
}
|
|
134
|
+
export interface KindOptions {
|
|
135
|
+
package?: string;
|
|
136
|
+
arguments: KindArguments | [
|
|
137
|
+
self: RawTransactionArgument<string>
|
|
138
|
+
];
|
|
139
|
+
}
|
|
140
|
+
/** What the release calls itself. Aborts if nothing is attached. */
|
|
141
|
+
export function kind(options: KindOptions) {
|
|
142
|
+
const packageAddress = options.package ?? '@local-pkg/release_kind';
|
|
143
|
+
const argumentsTypes = [
|
|
144
|
+
null
|
|
145
|
+
] satisfies (string | null)[];
|
|
146
|
+
const parameterNames = ["self"];
|
|
147
|
+
return (tx: Transaction) => tx.moveCall({
|
|
148
|
+
package: packageAddress,
|
|
149
|
+
module: 'release_kind',
|
|
150
|
+
function: 'kind',
|
|
151
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
152
|
+
});
|
|
153
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { MoveEnum, MoveStruct, MoveTuple } from '../../../utils/index.ts';
|
|
5
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
6
|
+
const $moduleName = 'ori::walrus_data';
|
|
7
|
+
/**
|
|
8
|
+
* Confidentiality of a stored blob: cleartext, or encrypted with an access policy.
|
|
9
|
+
* Only applies to standalone blobs — a quilt patch is a slice of a shared quilt
|
|
10
|
+
* blob and can never be the direct product of an encryption.
|
|
11
|
+
*/
|
|
12
|
+
export const Confidentiality = new MoveEnum({ name: `${$moduleName}::Confidentiality`, fields: {
|
|
13
|
+
/** The blob is stored in the clear. */
|
|
14
|
+
Unencrypted: null,
|
|
15
|
+
/**
|
|
16
|
+
* The blob is AES-encrypted. `dek` is the AES data-encryption key sealed via Seal
|
|
17
|
+
* — a small ciphertext stored on-chain, not the blob bytes. The sealed DEK is
|
|
18
|
+
* itself a Seal `EncryptedObject`, which already carries the decryption-policy
|
|
19
|
+
* package id, so no separate policy field is stored here. Decryption is gated by
|
|
20
|
+
* that policy package's `seal_approve`, not by this library.
|
|
21
|
+
*/
|
|
22
|
+
Encrypted: new MoveStruct({ name: `Confidentiality.Encrypted`, fields: {
|
|
23
|
+
dek: bcs.vector(bcs.u8())
|
|
24
|
+
} })
|
|
25
|
+
} });
|
|
26
|
+
/** Represents either a standalone Walrus blob or a patch within a quilt. */
|
|
27
|
+
export const WalrusData = new MoveEnum({ name: `${$moduleName}::WalrusData`, fields: {
|
|
28
|
+
/** A standalone Walrus blob. Fields: blob_id, confidentiality. */
|
|
29
|
+
Blob: new MoveTuple({ name: `WalrusData.Blob`, fields: [bcs.u256(), Confidentiality] }),
|
|
30
|
+
/**
|
|
31
|
+
* A patch within a Walrus quilt. Fields: quilt_id, version, start_index,
|
|
32
|
+
* end_index. Always a plaintext reference into a (possibly separately encrypted)
|
|
33
|
+
* quilt blob.
|
|
34
|
+
*/
|
|
35
|
+
QuiltPatch: new MoveTuple({ name: `WalrusData.QuiltPatch`, fields: [bcs.u256(), bcs.u8(), bcs.u16(), bcs.u16()] })
|
|
36
|
+
} });
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The on-chain pointer to a release's snapshot bundle: which Walrus quilt is this
|
|
8
|
+
* release's bundle.
|
|
9
|
+
*
|
|
10
|
+
* A snapshot bundle is curated bonus material a buyer gets access to — one Walrus
|
|
11
|
+
* quilt, assembled after the fact. The quilt is self-describing: its plaintext
|
|
12
|
+
* `manifest.json` patch carries all the metadata, its media patches are
|
|
13
|
+
* chunk-encrypted under one AES envelope key, and that key travels Seal-wrapped
|
|
14
|
+
* inside the quilt as its `key.seal` patch. This package therefore stores none of
|
|
15
|
+
* that — no ciphertext, no metadata, no access policy (unlocking by holding a
|
|
16
|
+
* Record is `miso_record_acl`'s concern, in miso-record-extensions). The stored
|
|
17
|
+
* value is the quilt's `WalrusData` blob reference, and nothing else.
|
|
18
|
+
*
|
|
19
|
+
* The slot is write-once: `set_snapshot_bundle` aborts with `EBundleAlreadySet` if
|
|
20
|
+
* a bundle is already set, and there is NO unset, NO remove, and NO replace
|
|
21
|
+
* function. That absence is a product guarantee: the bundle a buyer's Record
|
|
22
|
+
* points at can never be swapped out from under them. More content later means a
|
|
23
|
+
* new Release.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { MoveTuple, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.ts';
|
|
27
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
28
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
29
|
+
import * as walrus_data from './deps/ori/walrus_data.ts';
|
|
30
|
+
const $moduleName = '@local-pkg/release_snapshot_bundle::release_snapshot_bundle';
|
|
31
|
+
export const ExtensionKey = new MoveTuple({ name: `${$moduleName}::ExtensionKey`, fields: [bcs.bool()] });
|
|
32
|
+
export const SnapshotBundleSetEvent = new MoveStruct({ name: `${$moduleName}::SnapshotBundleSetEvent`, fields: {
|
|
33
|
+
release_id: bcs.Address,
|
|
34
|
+
bundle: walrus_data.WalrusData
|
|
35
|
+
} });
|
|
36
|
+
export interface SetSnapshotBundleArguments {
|
|
37
|
+
self: RawTransactionArgument<string>;
|
|
38
|
+
cap: RawTransactionArgument<string>;
|
|
39
|
+
bundle: TransactionArgument;
|
|
40
|
+
}
|
|
41
|
+
export interface SetSnapshotBundleOptions {
|
|
42
|
+
package?: string;
|
|
43
|
+
arguments: SetSnapshotBundleArguments | [
|
|
44
|
+
self: RawTransactionArgument<string>,
|
|
45
|
+
cap: RawTransactionArgument<string>,
|
|
46
|
+
bundle: TransactionArgument
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Sets the release's snapshot bundle — once. Aborts with `EBundleAlreadySet` if a
|
|
51
|
+
* bundle is already set; there is no way to unset or replace it.
|
|
52
|
+
*
|
|
53
|
+
* The reference must be a plaintext standalone blob. A quilt patch is a slice of
|
|
54
|
+
* some other quilt, not the bundle's own quilt blob. And the outer quilt blob is
|
|
55
|
+
* plaintext by design: its `manifest.json` patch must be readable, encryption is
|
|
56
|
+
* per-patch inside the quilt, and the Seal-wrapped envelope key travels as the
|
|
57
|
+
* quilt's `key.seal` patch — so an encrypted outer reference is structurally
|
|
58
|
+
* wrong. With no replace function either mistake would be permanent, which is why
|
|
59
|
+
* both checks live on-chain rather than in the client.
|
|
60
|
+
*/
|
|
61
|
+
export function setSnapshotBundle(options: SetSnapshotBundleOptions) {
|
|
62
|
+
const packageAddress = options.package ?? '@local-pkg/release_snapshot_bundle';
|
|
63
|
+
const argumentsTypes = [
|
|
64
|
+
null,
|
|
65
|
+
null,
|
|
66
|
+
null
|
|
67
|
+
] satisfies (string | null)[];
|
|
68
|
+
const parameterNames = ["self", "cap", "bundle"];
|
|
69
|
+
return (tx: Transaction) => tx.moveCall({
|
|
70
|
+
package: packageAddress,
|
|
71
|
+
module: 'release_snapshot_bundle',
|
|
72
|
+
function: 'set_snapshot_bundle',
|
|
73
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
export interface HasSnapshotBundleArguments {
|
|
77
|
+
self: RawTransactionArgument<string>;
|
|
78
|
+
}
|
|
79
|
+
export interface HasSnapshotBundleOptions {
|
|
80
|
+
package?: string;
|
|
81
|
+
arguments: HasSnapshotBundleArguments | [
|
|
82
|
+
self: RawTransactionArgument<string>
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
/** Returns whether a snapshot bundle is set on this release. */
|
|
86
|
+
export function hasSnapshotBundle(options: HasSnapshotBundleOptions) {
|
|
87
|
+
const packageAddress = options.package ?? '@local-pkg/release_snapshot_bundle';
|
|
88
|
+
const argumentsTypes = [
|
|
89
|
+
null
|
|
90
|
+
] satisfies (string | null)[];
|
|
91
|
+
const parameterNames = ["self"];
|
|
92
|
+
return (tx: Transaction) => tx.moveCall({
|
|
93
|
+
package: packageAddress,
|
|
94
|
+
module: 'release_snapshot_bundle',
|
|
95
|
+
function: 'has_snapshot_bundle',
|
|
96
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
export interface SnapshotBundleArguments {
|
|
100
|
+
self: RawTransactionArgument<string>;
|
|
101
|
+
}
|
|
102
|
+
export interface SnapshotBundleOptions {
|
|
103
|
+
package?: string;
|
|
104
|
+
arguments: SnapshotBundleArguments | [
|
|
105
|
+
self: RawTransactionArgument<string>
|
|
106
|
+
];
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The release's snapshot bundle reference. Aborts with `ENoSnapshotBundle` if none
|
|
110
|
+
* is set.
|
|
111
|
+
*/
|
|
112
|
+
export function snapshotBundle(options: SnapshotBundleOptions) {
|
|
113
|
+
const packageAddress = options.package ?? '@local-pkg/release_snapshot_bundle';
|
|
114
|
+
const argumentsTypes = [
|
|
115
|
+
null
|
|
116
|
+
] satisfies (string | null)[];
|
|
117
|
+
const parameterNames = ["self"];
|
|
118
|
+
return (tx: Transaction) => tx.moveCall({
|
|
119
|
+
package: packageAddress,
|
|
120
|
+
module: 'release_snapshot_bundle',
|
|
121
|
+
function: 'snapshot_bundle',
|
|
122
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
123
|
+
});
|
|
124
|
+
}
|