@misofm/sdk 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -56
- package/dist/client.d.ts +126 -18
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +210 -44
- package/dist/client.js.map +1 -1
- package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts +205 -0
- package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts.map +1 -0
- package/dist/contracts/composition_routed_stake/composition_routed_stake.js +184 -0
- package/dist/contracts/composition_routed_stake/composition_routed_stake.js.map +1 -0
- package/dist/contracts/composition_routed_stake/witness.d.ts +7 -0
- package/dist/contracts/composition_routed_stake/witness.d.ts.map +1 -0
- package/dist/contracts/composition_routed_stake/witness.js +9 -0
- package/dist/contracts/composition_routed_stake/witness.js.map +1 -0
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +89 -28
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +1 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +84 -23
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +1 -1
- package/dist/contracts/composition_royalty_pool/witness.d.ts +6 -0
- package/dist/contracts/composition_royalty_pool/witness.d.ts.map +1 -0
- package/dist/contracts/composition_royalty_pool/witness.js +8 -0
- package/dist/contracts/composition_royalty_pool/witness.js.map +1 -0
- package/dist/contracts/genre/genre.d.ts +96 -0
- package/dist/contracts/genre/genre.d.ts.map +1 -0
- package/dist/contracts/genre/genre.js +107 -0
- package/dist/contracts/genre/genre.js.map +1 -0
- 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_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/recording_royalty_pool/recording_royalty_pool.d.ts +90 -28
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +1 -1
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +84 -23
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +1 -1
- package/dist/contracts/recording_royalty_pool/witness.d.ts +6 -0
- package/dist/contracts/recording_royalty_pool/witness.d.ts.map +1 -0
- package/dist/contracts/recording_royalty_pool/witness.js +8 -0
- package/dist/contracts/recording_royalty_pool/witness.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_revenue_distributor/release_revenue_distributor.d.ts +106 -0
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.d.ts.map +1 -0
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.js +113 -0
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.js.map +1 -0
- package/dist/contracts/release_revenue_distributor/witness.d.ts +7 -0
- package/dist/contracts/release_revenue_distributor/witness.d.ts.map +1 -0
- package/dist/contracts/release_revenue_distributor/witness.js +9 -0
- package/dist/contracts/release_revenue_distributor/witness.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/pool.d.ts +27 -17
- package/dist/contracts/royalty_pool/pool.d.ts.map +1 -1
- package/dist/contracts/royalty_pool/pool.js +26 -17
- package/dist/contracts/royalty_pool/pool.js.map +1 -1
- package/dist/contracts/vault/deps/sui/bag.d.ts +35 -0
- package/dist/contracts/vault/deps/sui/bag.d.ts.map +1 -0
- package/dist/contracts/vault/deps/sui/bag.js +37 -0
- package/dist/contracts/vault/deps/sui/bag.js.map +1 -0
- package/dist/contracts/vault/deps/sui/borrow.d.ts +20 -0
- package/dist/contracts/vault/deps/sui/borrow.d.ts.map +1 -0
- package/dist/contracts/vault/deps/sui/borrow.js +21 -0
- package/dist/contracts/vault/deps/sui/borrow.js.map +1 -0
- package/dist/contracts/vault/vault.d.ts +276 -0
- package/dist/contracts/vault/vault.d.ts.map +1 -0
- package/dist/contracts/vault/vault.js +274 -0
- package/dist/contracts/vault/vault.js.map +1 -0
- package/dist/contracts.d.ts +14 -2
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +16 -7
- package/dist/contracts.js.map +1 -1
- package/dist/cover.d.ts +17 -3
- package/dist/cover.d.ts.map +1 -1
- package/dist/cover.js +43 -20
- package/dist/cover.js.map +1 -1
- package/dist/credits.d.ts +31 -12
- package/dist/credits.d.ts.map +1 -1
- package/dist/credits.js +41 -25
- package/dist/credits.js.map +1 -1
- package/dist/deployments.d.ts +31 -57
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +5 -53
- package/dist/deployments.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/pressing.d.ts +8 -7
- package/dist/pressing.d.ts.map +1 -1
- package/dist/pressing.js +91 -32
- package/dist/pressing.js.map +1 -1
- package/dist/read/artist.js +3 -3
- package/dist/read/artist.js.map +1 -1
- package/dist/read/catalog.d.ts +14 -9
- package/dist/read/catalog.d.ts.map +1 -1
- package/dist/read/catalog.js +71 -37
- package/dist/read/catalog.js.map +1 -1
- package/dist/read/client.d.ts +4 -2
- package/dist/read/client.d.ts.map +1 -1
- package/dist/read/client.js +15 -4
- package/dist/read/client.js.map +1 -1
- package/dist/read/config.d.ts +14 -11
- package/dist/read/config.d.ts.map +1 -1
- package/dist/read/config.js +10 -37
- package/dist/read/config.js.map +1 -1
- package/dist/read/index.d.ts +2 -2
- package/dist/read/index.d.ts.map +1 -1
- package/dist/read/index.js +1 -1
- package/dist/read/index.js.map +1 -1
- package/dist/read/receipts.d.ts +24 -7
- package/dist/read/receipts.d.ts.map +1 -1
- package/dist/read/receipts.js +78 -25
- package/dist/read/receipts.js.map +1 -1
- package/dist/read/types.d.ts +43 -25
- package/dist/read/types.d.ts.map +1 -1
- package/dist/read/types.js +2 -2
- package/dist/read/types.js.map +1 -1
- package/dist/recording-extensions.d.ts +37 -0
- package/dist/recording-extensions.d.ts.map +1 -0
- package/dist/recording-extensions.js +61 -0
- package/dist/recording-extensions.js.map +1 -0
- package/dist/release-extensions.d.ts +92 -0
- package/dist/release-extensions.d.ts.map +1 -0
- package/dist/release-extensions.js +175 -0
- package/dist/release-extensions.js.map +1 -0
- package/dist/release-graph.d.ts +17 -26
- package/dist/release-graph.d.ts.map +1 -1
- package/dist/release-graph.js +55 -49
- package/dist/release-graph.js.map +1 -1
- package/dist/transactions.d.ts +43 -24
- package/dist/transactions.d.ts.map +1 -1
- package/dist/transactions.js +48 -27
- package/dist/transactions.js.map +1 -1
- package/dist/vault.d.ts +268 -0
- package/dist/vault.d.ts.map +1 -0
- package/dist/vault.js +389 -0
- package/dist/vault.js.map +1 -0
- package/package.json +17 -11
- package/src/client.ts +428 -61
- package/src/contracts/composition_routed_stake/composition_routed_stake.ts +346 -0
- package/src/contracts/composition_routed_stake/witness.ts +11 -0
- package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +151 -35
- package/src/contracts/composition_royalty_pool/witness.ts +7 -0
- package/src/contracts/genre/genre.ts +151 -0
- package/src/contracts/recording_advisory/recording_advisory.ts +315 -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/recording_royalty_pool/recording_royalty_pool.ts +152 -35
- package/src/contracts/recording_royalty_pool/witness.ts +7 -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_revenue_distributor/release_revenue_distributor.ts +178 -0
- package/src/contracts/release_revenue_distributor/witness.ts +11 -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/pool.ts +34 -24
- package/src/contracts/vault/deps/sui/bag.ts +39 -0
- package/src/contracts/vault/deps/sui/borrow.ts +25 -0
- package/src/contracts/vault/vault.ts +454 -0
- package/src/contracts.ts +17 -9
- package/src/cover.ts +62 -37
- package/src/credits.ts +64 -51
- package/src/deployments.ts +36 -97
- package/src/index.ts +11 -5
- package/src/pressing.ts +135 -39
- package/src/read/artist.ts +3 -3
- package/src/read/catalog.ts +99 -44
- package/src/read/client.ts +20 -4
- package/src/read/config.ts +23 -49
- package/src/read/index.ts +3 -1
- package/src/read/receipts.ts +103 -26
- package/src/read/types.ts +44 -27
- package/src/recording-extensions.ts +102 -0
- package/src/release-extensions.ts +286 -0
- package/src/release-graph.ts +68 -81
- package/src/transactions.ts +79 -53
- package/src/vault.ts +777 -0
- package/dist/contracts/miso_drop/drop.d.ts +0 -550
- package/dist/contracts/miso_drop/drop.d.ts.map +0 -1
- package/dist/contracts/miso_drop/drop.js +0 -523
- package/dist/contracts/miso_drop/drop.js.map +0 -1
- package/dist/contracts/release_registry/release_registry.d.ts +0 -114
- package/dist/contracts/release_registry/release_registry.d.ts.map +0 -1
- package/dist/contracts/release_registry/release_registry.js +0 -119
- package/dist/contracts/release_registry/release_registry.js.map +0 -1
- package/dist/drop.d.ts +0 -127
- package/dist/drop.d.ts.map +0 -1
- package/dist/drop.js +0 -202
- package/dist/drop.js.map +0 -1
- package/dist/extensions/royalty-pool.d.ts +0 -32
- package/dist/extensions/royalty-pool.d.ts.map +0 -1
- package/dist/extensions/royalty-pool.js +0 -33
- package/dist/extensions/royalty-pool.js.map +0 -1
- package/src/contracts/miso_drop/drop.ts +0 -798
- package/src/contracts/release_registry/release_registry.ts +0 -160
- package/src/drop.ts +0 -376
- package/src/extensions/royalty-pool.ts +0 -90
|
@@ -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.js';
|
|
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.js';
|
|
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.js';
|
|
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.js';
|
|
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,178 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Vault-authorized release revenue routing for Miso.
|
|
8
|
+
*
|
|
9
|
+
* Revenue is split from the immutable Release tracklist and sent to each track's
|
|
10
|
+
* Recording address. A caller can select only the funds to receive or the amount
|
|
11
|
+
* to redeem; it cannot select recipients or alter split amounts. Recording-level
|
|
12
|
+
* plugins may subsequently fold those funds into canonical Recording royalty
|
|
13
|
+
* pools.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
17
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
18
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
19
|
+
const $moduleName = '@local-pkg/release_revenue_distributor::release_revenue_distributor';
|
|
20
|
+
export const ReleaseTrackRevenueDistributedEvent = new MoveStruct({ name: `${$moduleName}::ReleaseTrackRevenueDistributedEvent<phantom Currency>`, fields: {
|
|
21
|
+
release_id: bcs.Address,
|
|
22
|
+
track_index: bcs.u64(),
|
|
23
|
+
recording_id: bcs.Address,
|
|
24
|
+
amount: bcs.u64()
|
|
25
|
+
} });
|
|
26
|
+
export const ReleaseRevenueDistributedEvent = new MoveStruct({ name: `${$moduleName}::ReleaseRevenueDistributedEvent<phantom Currency>`, fields: {
|
|
27
|
+
release_id: bcs.Address,
|
|
28
|
+
total_input: bcs.u64(),
|
|
29
|
+
total_distributed: bcs.u64(),
|
|
30
|
+
remainder: bcs.u64()
|
|
31
|
+
} });
|
|
32
|
+
export interface InstallArguments {
|
|
33
|
+
vault: RawTransactionArgument<string>;
|
|
34
|
+
vaultAdminCap: RawTransactionArgument<string>;
|
|
35
|
+
}
|
|
36
|
+
export interface InstallOptions {
|
|
37
|
+
package?: string;
|
|
38
|
+
arguments: InstallArguments | [
|
|
39
|
+
vault: RawTransactionArgument<string>,
|
|
40
|
+
vaultAdminCap: RawTransactionArgument<string>
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
/** Authorize this package on a Release capability Vault. */
|
|
44
|
+
export function install(options: InstallOptions) {
|
|
45
|
+
const packageAddress = options.package ?? '@local-pkg/release_revenue_distributor';
|
|
46
|
+
const argumentsTypes = [
|
|
47
|
+
null,
|
|
48
|
+
null
|
|
49
|
+
] satisfies (string | null)[];
|
|
50
|
+
const parameterNames = ["vault", "vaultAdminCap"];
|
|
51
|
+
return (tx: Transaction) => tx.moveCall({
|
|
52
|
+
package: packageAddress,
|
|
53
|
+
module: 'release_revenue_distributor',
|
|
54
|
+
function: 'install',
|
|
55
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
export interface UninstallArguments {
|
|
59
|
+
vault: RawTransactionArgument<string>;
|
|
60
|
+
vaultAdminCap: RawTransactionArgument<string>;
|
|
61
|
+
}
|
|
62
|
+
export interface UninstallOptions {
|
|
63
|
+
package?: string;
|
|
64
|
+
arguments: UninstallArguments | [
|
|
65
|
+
vault: RawTransactionArgument<string>,
|
|
66
|
+
vaultAdminCap: RawTransactionArgument<string>
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
/** Revoke this package from a Release capability Vault. */
|
|
70
|
+
export function uninstall(options: UninstallOptions) {
|
|
71
|
+
const packageAddress = options.package ?? '@local-pkg/release_revenue_distributor';
|
|
72
|
+
const argumentsTypes = [
|
|
73
|
+
null,
|
|
74
|
+
null
|
|
75
|
+
] satisfies (string | null)[];
|
|
76
|
+
const parameterNames = ["vault", "vaultAdminCap"];
|
|
77
|
+
return (tx: Transaction) => tx.moveCall({
|
|
78
|
+
package: packageAddress,
|
|
79
|
+
module: 'release_revenue_distributor',
|
|
80
|
+
function: 'uninstall',
|
|
81
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
export interface RedeemAndDistributeArguments {
|
|
85
|
+
vault: RawTransactionArgument<string>;
|
|
86
|
+
release: RawTransactionArgument<string>;
|
|
87
|
+
value: RawTransactionArgument<number | bigint>;
|
|
88
|
+
}
|
|
89
|
+
export interface RedeemAndDistributeOptions {
|
|
90
|
+
package?: string;
|
|
91
|
+
arguments: RedeemAndDistributeArguments | [
|
|
92
|
+
vault: RawTransactionArgument<string>,
|
|
93
|
+
release: RawTransactionArgument<string>,
|
|
94
|
+
value: RawTransactionArgument<number | bigint>
|
|
95
|
+
];
|
|
96
|
+
typeArguments: [
|
|
97
|
+
string
|
|
98
|
+
];
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Redeem `value` from the Release address and distribute it according to the
|
|
102
|
+
* immutable tracklist. Anyone may crank this after installation.
|
|
103
|
+
*/
|
|
104
|
+
export function redeemAndDistribute(options: RedeemAndDistributeOptions) {
|
|
105
|
+
const packageAddress = options.package ?? '@local-pkg/release_revenue_distributor';
|
|
106
|
+
const argumentsTypes = [
|
|
107
|
+
null,
|
|
108
|
+
null,
|
|
109
|
+
'u64'
|
|
110
|
+
] satisfies (string | null)[];
|
|
111
|
+
const parameterNames = ["vault", "release", "value"];
|
|
112
|
+
return (tx: Transaction) => tx.moveCall({
|
|
113
|
+
package: packageAddress,
|
|
114
|
+
module: 'release_revenue_distributor',
|
|
115
|
+
function: 'redeem_and_distribute',
|
|
116
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
117
|
+
typeArguments: options.typeArguments
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
export interface ReceiveAndDistributeArguments {
|
|
121
|
+
vault: RawTransactionArgument<string>;
|
|
122
|
+
release: RawTransactionArgument<string>;
|
|
123
|
+
coins: TransactionArgument;
|
|
124
|
+
}
|
|
125
|
+
export interface ReceiveAndDistributeOptions {
|
|
126
|
+
package?: string;
|
|
127
|
+
arguments: ReceiveAndDistributeArguments | [
|
|
128
|
+
vault: RawTransactionArgument<string>,
|
|
129
|
+
release: RawTransactionArgument<string>,
|
|
130
|
+
coins: TransactionArgument
|
|
131
|
+
];
|
|
132
|
+
typeArguments: [
|
|
133
|
+
string
|
|
134
|
+
];
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Receive selected `Coin<Currency>` objects sent to the Release and distribute
|
|
138
|
+
* their combined value according to the immutable tracklist. Anyone may crank this
|
|
139
|
+
* after installation.
|
|
140
|
+
*/
|
|
141
|
+
export function receiveAndDistribute(options: ReceiveAndDistributeOptions) {
|
|
142
|
+
const packageAddress = options.package ?? '@local-pkg/release_revenue_distributor';
|
|
143
|
+
const argumentsTypes = [
|
|
144
|
+
null,
|
|
145
|
+
null,
|
|
146
|
+
'vector<null>'
|
|
147
|
+
] satisfies (string | null)[];
|
|
148
|
+
const parameterNames = ["vault", "release", "coins"];
|
|
149
|
+
return (tx: Transaction) => tx.moveCall({
|
|
150
|
+
package: packageAddress,
|
|
151
|
+
module: 'release_revenue_distributor',
|
|
152
|
+
function: 'receive_and_distribute',
|
|
153
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
154
|
+
typeArguments: options.typeArguments
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
export interface IsInstalledArguments {
|
|
158
|
+
vault: RawTransactionArgument<string>;
|
|
159
|
+
}
|
|
160
|
+
export interface IsInstalledOptions {
|
|
161
|
+
package?: string;
|
|
162
|
+
arguments: IsInstalledArguments | [
|
|
163
|
+
vault: RawTransactionArgument<string>
|
|
164
|
+
];
|
|
165
|
+
}
|
|
166
|
+
export function isInstalled(options: IsInstalledOptions) {
|
|
167
|
+
const packageAddress = options.package ?? '@local-pkg/release_revenue_distributor';
|
|
168
|
+
const argumentsTypes = [
|
|
169
|
+
null
|
|
170
|
+
] satisfies (string | null)[];
|
|
171
|
+
const parameterNames = ["vault"];
|
|
172
|
+
return (tx: Transaction) => tx.moveCall({
|
|
173
|
+
package: packageAddress,
|
|
174
|
+
module: 'release_revenue_distributor',
|
|
175
|
+
function: 'is_installed',
|
|
176
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
177
|
+
});
|
|
178
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/** Canonical installation identity for the release revenue distributor. */
|
|
7
|
+
|
|
8
|
+
import { MoveTuple } from '../utils/index.js';
|
|
9
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
10
|
+
const $moduleName = '@local-pkg/release_revenue_distributor::witness';
|
|
11
|
+
export const Witness = new MoveTuple({ name: `${$moduleName}::Witness`, fields: [bcs.bool()] });
|