@misofm/sdk 0.9.0 → 0.11.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 +121 -18
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +200 -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/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 +13 -2
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +15 -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 +30 -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 +84 -0
- package/dist/release-extensions.d.ts.map +1 -0
- package/dist/release-extensions.js +160 -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 +399 -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/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 +16 -9
- package/src/cover.ts +62 -37
- package/src/credits.ts +64 -51
- package/src/deployments.ts +35 -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 +261 -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,193 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* Genre assignment for a Miso release: an album-level primary + secondary genres,
|
|
6
|
+
* plus optional per-track primary overrides.
|
|
7
|
+
*
|
|
8
|
+
* Genre is presentation, not objective recording data, so it is assigned on the
|
|
9
|
+
* release (the consumer object), not the recording. Stored as a single
|
|
10
|
+
* `ReleaseGenre` dynamic field on the release's UID, gated by the
|
|
11
|
+
* `ReleaseAdminCap`.
|
|
12
|
+
*
|
|
13
|
+
* A track's effective primary genre resolves as: its per-track override if set,
|
|
14
|
+
* else the album primary.
|
|
15
|
+
*
|
|
16
|
+
* A genre is either the album primary or a secondary, never both — the two are
|
|
17
|
+
* kept disjoint: setting the primary to a current secondary aborts (remove it from
|
|
18
|
+
* the secondaries first), and adding the current primary as a secondary aborts.
|
|
19
|
+
*/
|
|
20
|
+
import { MoveTuple, MoveStruct, type RawTransactionArgument } from '../utils/index.js';
|
|
21
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
22
|
+
export declare const ExtensionKey: MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">], "@local-pkg/release_genre::release_genre::ExtensionKey">;
|
|
23
|
+
export declare const ReleaseGenre: MoveStruct<{
|
|
24
|
+
primary: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
25
|
+
secondary: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | Uint8Array<ArrayBufferLike>> & {
|
|
26
|
+
length: number;
|
|
27
|
+
}, string>;
|
|
28
|
+
track_primary: MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<(string | null)[], Iterable<string | Uint8Array<ArrayBufferLike> | null | undefined> & {
|
|
29
|
+
length: number;
|
|
30
|
+
}, string>], "per_track::per_track::PerTrack<Option<bytes[32]>>">;
|
|
31
|
+
}, "@local-pkg/release_genre::release_genre::ReleaseGenre">;
|
|
32
|
+
export declare const PrimaryGenreSetEvent: MoveStruct<{
|
|
33
|
+
release_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
34
|
+
genre_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
35
|
+
}, "@local-pkg/release_genre::release_genre::PrimaryGenreSetEvent">;
|
|
36
|
+
export declare const SecondaryGenreAddedEvent: MoveStruct<{
|
|
37
|
+
release_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
38
|
+
genre_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
39
|
+
}, "@local-pkg/release_genre::release_genre::SecondaryGenreAddedEvent">;
|
|
40
|
+
export declare const SecondaryGenreRemovedEvent: MoveStruct<{
|
|
41
|
+
release_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
42
|
+
genre_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
43
|
+
}, "@local-pkg/release_genre::release_genre::SecondaryGenreRemovedEvent">;
|
|
44
|
+
export declare const TrackPrimaryGenreSetEvent: MoveStruct<{
|
|
45
|
+
release_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
46
|
+
track_index: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
47
|
+
genre_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
48
|
+
}, "@local-pkg/release_genre::release_genre::TrackPrimaryGenreSetEvent">;
|
|
49
|
+
export declare const TrackPrimaryGenreUnsetEvent: MoveStruct<{
|
|
50
|
+
release_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
51
|
+
track_index: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
52
|
+
}, "@local-pkg/release_genre::release_genre::TrackPrimaryGenreUnsetEvent">;
|
|
53
|
+
export interface SetPrimaryGenreArguments {
|
|
54
|
+
self: RawTransactionArgument<string>;
|
|
55
|
+
cap: RawTransactionArgument<string>;
|
|
56
|
+
genre: RawTransactionArgument<string>;
|
|
57
|
+
}
|
|
58
|
+
export interface SetPrimaryGenreOptions {
|
|
59
|
+
package?: string;
|
|
60
|
+
arguments: SetPrimaryGenreArguments | [
|
|
61
|
+
self: RawTransactionArgument<string>,
|
|
62
|
+
cap: RawTransactionArgument<string>,
|
|
63
|
+
genre: RawTransactionArgument<string>
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Sets (or replaces) the album primary genre. Gated by the release admin cap.
|
|
68
|
+
* Aborts if the genre is currently an album secondary — remove it from the
|
|
69
|
+
* secondaries first (primary and secondary are kept disjoint).
|
|
70
|
+
*/
|
|
71
|
+
export declare function setPrimaryGenre(options: SetPrimaryGenreOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
72
|
+
export interface AddSecondaryGenreArguments {
|
|
73
|
+
self: RawTransactionArgument<string>;
|
|
74
|
+
cap: RawTransactionArgument<string>;
|
|
75
|
+
genre: RawTransactionArgument<string>;
|
|
76
|
+
}
|
|
77
|
+
export interface AddSecondaryGenreOptions {
|
|
78
|
+
package?: string;
|
|
79
|
+
arguments: AddSecondaryGenreArguments | [
|
|
80
|
+
self: RawTransactionArgument<string>,
|
|
81
|
+
cap: RawTransactionArgument<string>,
|
|
82
|
+
genre: RawTransactionArgument<string>
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Adds an album secondary genre. Requires the album primary first. Rejects a
|
|
87
|
+
* secondary equal to the primary, duplicates, and counts at/above the maximum.
|
|
88
|
+
*/
|
|
89
|
+
export declare function addSecondaryGenre(options: AddSecondaryGenreOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
90
|
+
export interface RemoveSecondaryGenreArguments {
|
|
91
|
+
self: RawTransactionArgument<string>;
|
|
92
|
+
cap: RawTransactionArgument<string>;
|
|
93
|
+
genre: RawTransactionArgument<string>;
|
|
94
|
+
}
|
|
95
|
+
export interface RemoveSecondaryGenreOptions {
|
|
96
|
+
package?: string;
|
|
97
|
+
arguments: RemoveSecondaryGenreArguments | [
|
|
98
|
+
self: RawTransactionArgument<string>,
|
|
99
|
+
cap: RawTransactionArgument<string>,
|
|
100
|
+
genre: RawTransactionArgument<string>
|
|
101
|
+
];
|
|
102
|
+
}
|
|
103
|
+
/** Removes an album secondary genre. */
|
|
104
|
+
export declare function removeSecondaryGenre(options: RemoveSecondaryGenreOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
105
|
+
export interface SetTrackPrimaryGenreArguments {
|
|
106
|
+
self: RawTransactionArgument<string>;
|
|
107
|
+
cap: RawTransactionArgument<string>;
|
|
108
|
+
trackIndex: RawTransactionArgument<number | bigint>;
|
|
109
|
+
genre: RawTransactionArgument<string>;
|
|
110
|
+
}
|
|
111
|
+
export interface SetTrackPrimaryGenreOptions {
|
|
112
|
+
package?: string;
|
|
113
|
+
arguments: SetTrackPrimaryGenreArguments | [
|
|
114
|
+
self: RawTransactionArgument<string>,
|
|
115
|
+
cap: RawTransactionArgument<string>,
|
|
116
|
+
trackIndex: RawTransactionArgument<number | bigint>,
|
|
117
|
+
genre: RawTransactionArgument<string>
|
|
118
|
+
];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Sets (or replaces) a track's primary-genre override (by tracklist index).
|
|
122
|
+
* Requires the album primary first. Aborts if the index is out of range.
|
|
123
|
+
*/
|
|
124
|
+
export declare function setTrackPrimaryGenre(options: SetTrackPrimaryGenreOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
125
|
+
export interface UnsetTrackPrimaryGenreArguments {
|
|
126
|
+
self: RawTransactionArgument<string>;
|
|
127
|
+
cap: RawTransactionArgument<string>;
|
|
128
|
+
trackIndex: RawTransactionArgument<number | bigint>;
|
|
129
|
+
}
|
|
130
|
+
export interface UnsetTrackPrimaryGenreOptions {
|
|
131
|
+
package?: string;
|
|
132
|
+
arguments: UnsetTrackPrimaryGenreArguments | [
|
|
133
|
+
self: RawTransactionArgument<string>,
|
|
134
|
+
cap: RawTransactionArgument<string>,
|
|
135
|
+
trackIndex: RawTransactionArgument<number | bigint>
|
|
136
|
+
];
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Removes a track's primary-genre override — the track falls back to the album
|
|
140
|
+
* primary. Aborts if the index is out of range.
|
|
141
|
+
*/
|
|
142
|
+
export declare function unsetTrackPrimaryGenre(options: UnsetTrackPrimaryGenreOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
143
|
+
export interface HasGenreArguments {
|
|
144
|
+
self: RawTransactionArgument<string>;
|
|
145
|
+
}
|
|
146
|
+
export interface HasGenreOptions {
|
|
147
|
+
package?: string;
|
|
148
|
+
arguments: HasGenreArguments | [
|
|
149
|
+
self: RawTransactionArgument<string>
|
|
150
|
+
];
|
|
151
|
+
}
|
|
152
|
+
/** Returns whether the release has a genre assignment. */
|
|
153
|
+
export declare function hasGenre(options: HasGenreOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
154
|
+
export interface PrimaryGenreArguments {
|
|
155
|
+
self: RawTransactionArgument<string>;
|
|
156
|
+
}
|
|
157
|
+
export interface PrimaryGenreOptions {
|
|
158
|
+
package?: string;
|
|
159
|
+
arguments: PrimaryGenreArguments | [
|
|
160
|
+
self: RawTransactionArgument<string>
|
|
161
|
+
];
|
|
162
|
+
}
|
|
163
|
+
/** Returns the album primary genre id, if set. */
|
|
164
|
+
export declare function primaryGenre(options: PrimaryGenreOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
165
|
+
export interface SecondaryGenresArguments {
|
|
166
|
+
self: RawTransactionArgument<string>;
|
|
167
|
+
}
|
|
168
|
+
export interface SecondaryGenresOptions {
|
|
169
|
+
package?: string;
|
|
170
|
+
arguments: SecondaryGenresArguments | [
|
|
171
|
+
self: RawTransactionArgument<string>
|
|
172
|
+
];
|
|
173
|
+
}
|
|
174
|
+
/** Returns the album secondary genre ids (empty if none). */
|
|
175
|
+
export declare function secondaryGenres(options: SecondaryGenresOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
176
|
+
export interface TrackPrimaryGenreArguments {
|
|
177
|
+
self: RawTransactionArgument<string>;
|
|
178
|
+
trackIndex: RawTransactionArgument<number | bigint>;
|
|
179
|
+
}
|
|
180
|
+
export interface TrackPrimaryGenreOptions {
|
|
181
|
+
package?: string;
|
|
182
|
+
arguments: TrackPrimaryGenreArguments | [
|
|
183
|
+
self: RawTransactionArgument<string>,
|
|
184
|
+
trackIndex: RawTransactionArgument<number | bigint>
|
|
185
|
+
];
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Returns a track's effective primary genre: its override if set, else the album
|
|
189
|
+
* primary. None if no genre is assigned to the release. Aborts if the track index
|
|
190
|
+
* is out of range (when an assignment exists).
|
|
191
|
+
*/
|
|
192
|
+
export declare function trackPrimaryGenre(options: TrackPrimaryGenreOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
193
|
+
//# sourceMappingURL=release_genre.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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;AACD,MAAM,WAAW,mBAAmB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,qBAAqB,GAAG;QAC/B,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;KACvC,CAAC;CACL;AACD,kDAAkD;AAClD,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,IAM7C,IAAI,WAAW,0DAM1B;AACD,MAAM,WAAW,wBAAwB;IACrC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;CACxC;AACD,MAAM,WAAW,sBAAsB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,wBAAwB,GAAG;QAClC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;KACvC,CAAC;CACL;AACD,6DAA6D;AAC7D,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,IAMnD,IAAI,WAAW,0DAM1B;AACD,MAAM,WAAW,0BAA0B;IACvC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IACrC,UAAU,EAAE,sBAAsB,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;CACvD;AACD,MAAM,WAAW,wBAAwB;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,0BAA0B,GAAG;QACpC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;QACpC,UAAU,EAAE,sBAAsB,CAAC,MAAM,GAAG,MAAM,CAAC;KACtD,CAAC;CACL;AACD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,IAOvD,IAAI,WAAW,0DAM1B"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* Genre assignment for a Miso release: an album-level primary + secondary genres,
|
|
6
|
+
* plus optional per-track primary overrides.
|
|
7
|
+
*
|
|
8
|
+
* Genre is presentation, not objective recording data, so it is assigned on the
|
|
9
|
+
* release (the consumer object), not the recording. Stored as a single
|
|
10
|
+
* `ReleaseGenre` dynamic field on the release's UID, gated by the
|
|
11
|
+
* `ReleaseAdminCap`.
|
|
12
|
+
*
|
|
13
|
+
* A track's effective primary genre resolves as: its per-track override if set,
|
|
14
|
+
* else the album primary.
|
|
15
|
+
*
|
|
16
|
+
* A genre is either the album primary or a secondary, never both — the two are
|
|
17
|
+
* kept disjoint: setting the primary to a current secondary aborts (remove it from
|
|
18
|
+
* the secondaries first), and adding the current primary as a secondary aborts.
|
|
19
|
+
*/
|
|
20
|
+
import { MoveTuple, MoveStruct, normalizeMoveArguments } from '../utils/index.js';
|
|
21
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
22
|
+
import {} from '@mysten/sui/transactions';
|
|
23
|
+
import * as per_track from './deps/per_track/per_track.js';
|
|
24
|
+
const $moduleName = '@local-pkg/release_genre::release_genre';
|
|
25
|
+
export const ExtensionKey = new MoveTuple({ name: `${$moduleName}::ExtensionKey`, fields: [bcs.bool()] });
|
|
26
|
+
export const ReleaseGenre = new MoveStruct({ name: `${$moduleName}::ReleaseGenre`, fields: {
|
|
27
|
+
primary: bcs.Address,
|
|
28
|
+
secondary: bcs.vector(bcs.Address),
|
|
29
|
+
track_primary: per_track.PerTrack(bcs.option(bcs.Address))
|
|
30
|
+
} });
|
|
31
|
+
export const PrimaryGenreSetEvent = new MoveStruct({ name: `${$moduleName}::PrimaryGenreSetEvent`, fields: {
|
|
32
|
+
release_id: bcs.Address,
|
|
33
|
+
genre_id: bcs.Address
|
|
34
|
+
} });
|
|
35
|
+
export const SecondaryGenreAddedEvent = new MoveStruct({ name: `${$moduleName}::SecondaryGenreAddedEvent`, fields: {
|
|
36
|
+
release_id: bcs.Address,
|
|
37
|
+
genre_id: bcs.Address
|
|
38
|
+
} });
|
|
39
|
+
export const SecondaryGenreRemovedEvent = new MoveStruct({ name: `${$moduleName}::SecondaryGenreRemovedEvent`, fields: {
|
|
40
|
+
release_id: bcs.Address,
|
|
41
|
+
genre_id: bcs.Address
|
|
42
|
+
} });
|
|
43
|
+
export const TrackPrimaryGenreSetEvent = new MoveStruct({ name: `${$moduleName}::TrackPrimaryGenreSetEvent`, fields: {
|
|
44
|
+
release_id: bcs.Address,
|
|
45
|
+
track_index: bcs.u64(),
|
|
46
|
+
genre_id: bcs.Address
|
|
47
|
+
} });
|
|
48
|
+
export const TrackPrimaryGenreUnsetEvent = new MoveStruct({ name: `${$moduleName}::TrackPrimaryGenreUnsetEvent`, fields: {
|
|
49
|
+
release_id: bcs.Address,
|
|
50
|
+
track_index: bcs.u64()
|
|
51
|
+
} });
|
|
52
|
+
/**
|
|
53
|
+
* Sets (or replaces) the album primary genre. Gated by the release admin cap.
|
|
54
|
+
* Aborts if the genre is currently an album secondary — remove it from the
|
|
55
|
+
* secondaries first (primary and secondary are kept disjoint).
|
|
56
|
+
*/
|
|
57
|
+
export function setPrimaryGenre(options) {
|
|
58
|
+
const packageAddress = options.package ?? '@local-pkg/release_genre';
|
|
59
|
+
const argumentsTypes = [
|
|
60
|
+
null,
|
|
61
|
+
null,
|
|
62
|
+
null
|
|
63
|
+
];
|
|
64
|
+
const parameterNames = ["self", "cap", "genre"];
|
|
65
|
+
return (tx) => tx.moveCall({
|
|
66
|
+
package: packageAddress,
|
|
67
|
+
module: 'release_genre',
|
|
68
|
+
function: 'set_primary_genre',
|
|
69
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Adds an album secondary genre. Requires the album primary first. Rejects a
|
|
74
|
+
* secondary equal to the primary, duplicates, and counts at/above the maximum.
|
|
75
|
+
*/
|
|
76
|
+
export function addSecondaryGenre(options) {
|
|
77
|
+
const packageAddress = options.package ?? '@local-pkg/release_genre';
|
|
78
|
+
const argumentsTypes = [
|
|
79
|
+
null,
|
|
80
|
+
null,
|
|
81
|
+
null
|
|
82
|
+
];
|
|
83
|
+
const parameterNames = ["self", "cap", "genre"];
|
|
84
|
+
return (tx) => tx.moveCall({
|
|
85
|
+
package: packageAddress,
|
|
86
|
+
module: 'release_genre',
|
|
87
|
+
function: 'add_secondary_genre',
|
|
88
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/** Removes an album secondary genre. */
|
|
92
|
+
export function removeSecondaryGenre(options) {
|
|
93
|
+
const packageAddress = options.package ?? '@local-pkg/release_genre';
|
|
94
|
+
const argumentsTypes = [
|
|
95
|
+
null,
|
|
96
|
+
null,
|
|
97
|
+
null
|
|
98
|
+
];
|
|
99
|
+
const parameterNames = ["self", "cap", "genre"];
|
|
100
|
+
return (tx) => tx.moveCall({
|
|
101
|
+
package: packageAddress,
|
|
102
|
+
module: 'release_genre',
|
|
103
|
+
function: 'remove_secondary_genre',
|
|
104
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Sets (or replaces) a track's primary-genre override (by tracklist index).
|
|
109
|
+
* Requires the album primary first. Aborts if the index is out of range.
|
|
110
|
+
*/
|
|
111
|
+
export function setTrackPrimaryGenre(options) {
|
|
112
|
+
const packageAddress = options.package ?? '@local-pkg/release_genre';
|
|
113
|
+
const argumentsTypes = [
|
|
114
|
+
null,
|
|
115
|
+
null,
|
|
116
|
+
'u64',
|
|
117
|
+
null
|
|
118
|
+
];
|
|
119
|
+
const parameterNames = ["self", "cap", "trackIndex", "genre"];
|
|
120
|
+
return (tx) => tx.moveCall({
|
|
121
|
+
package: packageAddress,
|
|
122
|
+
module: 'release_genre',
|
|
123
|
+
function: 'set_track_primary_genre',
|
|
124
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Removes a track's primary-genre override — the track falls back to the album
|
|
129
|
+
* primary. Aborts if the index is out of range.
|
|
130
|
+
*/
|
|
131
|
+
export function unsetTrackPrimaryGenre(options) {
|
|
132
|
+
const packageAddress = options.package ?? '@local-pkg/release_genre';
|
|
133
|
+
const argumentsTypes = [
|
|
134
|
+
null,
|
|
135
|
+
null,
|
|
136
|
+
'u64'
|
|
137
|
+
];
|
|
138
|
+
const parameterNames = ["self", "cap", "trackIndex"];
|
|
139
|
+
return (tx) => tx.moveCall({
|
|
140
|
+
package: packageAddress,
|
|
141
|
+
module: 'release_genre',
|
|
142
|
+
function: 'unset_track_primary_genre',
|
|
143
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/** Returns whether the release has a genre assignment. */
|
|
147
|
+
export function hasGenre(options) {
|
|
148
|
+
const packageAddress = options.package ?? '@local-pkg/release_genre';
|
|
149
|
+
const argumentsTypes = [
|
|
150
|
+
null
|
|
151
|
+
];
|
|
152
|
+
const parameterNames = ["self"];
|
|
153
|
+
return (tx) => tx.moveCall({
|
|
154
|
+
package: packageAddress,
|
|
155
|
+
module: 'release_genre',
|
|
156
|
+
function: 'has_genre',
|
|
157
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
/** Returns the album primary genre id, if set. */
|
|
161
|
+
export function primaryGenre(options) {
|
|
162
|
+
const packageAddress = options.package ?? '@local-pkg/release_genre';
|
|
163
|
+
const argumentsTypes = [
|
|
164
|
+
null
|
|
165
|
+
];
|
|
166
|
+
const parameterNames = ["self"];
|
|
167
|
+
return (tx) => tx.moveCall({
|
|
168
|
+
package: packageAddress,
|
|
169
|
+
module: 'release_genre',
|
|
170
|
+
function: 'primary_genre',
|
|
171
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
/** Returns the album secondary genre ids (empty if none). */
|
|
175
|
+
export function secondaryGenres(options) {
|
|
176
|
+
const packageAddress = options.package ?? '@local-pkg/release_genre';
|
|
177
|
+
const argumentsTypes = [
|
|
178
|
+
null
|
|
179
|
+
];
|
|
180
|
+
const parameterNames = ["self"];
|
|
181
|
+
return (tx) => tx.moveCall({
|
|
182
|
+
package: packageAddress,
|
|
183
|
+
module: 'release_genre',
|
|
184
|
+
function: 'secondary_genres',
|
|
185
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Returns a track's effective primary genre: its override if set, else the album
|
|
190
|
+
* primary. None if no genre is assigned to the release. Aborts if the track index
|
|
191
|
+
* is out of range (when an assignment exists).
|
|
192
|
+
*/
|
|
193
|
+
export function trackPrimaryGenre(options) {
|
|
194
|
+
const packageAddress = options.package ?? '@local-pkg/release_genre';
|
|
195
|
+
const argumentsTypes = [
|
|
196
|
+
null,
|
|
197
|
+
'u64'
|
|
198
|
+
];
|
|
199
|
+
const parameterNames = ["self", "trackIndex"];
|
|
200
|
+
return (tx) => tx.moveCall({
|
|
201
|
+
package: packageAddress,
|
|
202
|
+
module: 'release_genre',
|
|
203
|
+
function: 'track_primary_genre',
|
|
204
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
//# sourceMappingURL=release_genre.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release_genre.js","sourceRoot":"","sources":["../../../src/contracts/release_genre/release_genre.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,sBAAsB,EAA+B,MAAM,mBAAmB,CAAC;AAC/G,OAAO,EAAE,GAAG,EAAE,MA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,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* What a release calls itself — "Album", "EP", "Mixtape", "Split" — asserted by
|
|
6
|
+
* whoever holds the release's admin cap, and believed.
|
|
7
|
+
*
|
|
8
|
+
* Deliberately a free string rather than an enum. An enum would not decide the
|
|
9
|
+
* classification (the admin still picks) but it would decide the _menu_, and
|
|
10
|
+
* deciding which self-descriptions are legitimate is not the protocol's job.
|
|
11
|
+
* Artists release beat tapes and splits and things nobody has named yet; a closed
|
|
12
|
+
* set would make each of those a package swap, and in the meantime would quietly
|
|
13
|
+
* push releases into whichever official-looking box fit worst.
|
|
14
|
+
*
|
|
15
|
+
* Nothing here derives the value or checks it for plausibility. A four-track
|
|
16
|
+
* release may call itself an Album and a twelve-track one an EP; both happen, and
|
|
17
|
+
* the artist's intent is the fact worth recording. The only checks are structural
|
|
18
|
+
* — non-empty and bounded — so the field stays storable.
|
|
19
|
+
*
|
|
20
|
+
* This is the opposite call from `release_genre`, on purpose. Genre is a curated
|
|
21
|
+
* vocabulary because discovery and reward-eligibility depend on releases agreeing
|
|
22
|
+
* with each other about what a genre _is_. Nothing depends on two releases
|
|
23
|
+
* agreeing about what an EP is.
|
|
24
|
+
*
|
|
25
|
+
* The cost of that freedom lands on readers: "EP", "ep" and "Extended Play" are
|
|
26
|
+
* three distinct values here. Clients that group or facet by kind should normalise
|
|
27
|
+
* (case-fold at minimum) rather than expect canonical strings.
|
|
28
|
+
*/
|
|
29
|
+
import { MoveTuple, MoveStruct, type RawTransactionArgument } from '../utils/index.js';
|
|
30
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
31
|
+
export declare const ExtensionKey: MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">], "@local-pkg/release_kind::release_kind::ExtensionKey">;
|
|
32
|
+
export declare const KindSetEvent: MoveStruct<{
|
|
33
|
+
release_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
34
|
+
kind: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
35
|
+
}, "@local-pkg/release_kind::release_kind::KindSetEvent">;
|
|
36
|
+
export declare const KindUnsetEvent: MoveStruct<{
|
|
37
|
+
release_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
38
|
+
}, "@local-pkg/release_kind::release_kind::KindUnsetEvent">;
|
|
39
|
+
export interface SetKindArguments {
|
|
40
|
+
self: RawTransactionArgument<string>;
|
|
41
|
+
cap: RawTransactionArgument<string>;
|
|
42
|
+
kind: RawTransactionArgument<string>;
|
|
43
|
+
}
|
|
44
|
+
export interface SetKindOptions {
|
|
45
|
+
package?: string;
|
|
46
|
+
arguments: SetKindArguments | [
|
|
47
|
+
self: RawTransactionArgument<string>,
|
|
48
|
+
cap: RawTransactionArgument<string>,
|
|
49
|
+
kind: RawTransactionArgument<string>
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Sets (or replaces) what the release calls itself.
|
|
54
|
+
*
|
|
55
|
+
* The string is stored exactly as given, including case — it is the release's own
|
|
56
|
+
* word for itself, and normalising it here would be the protocol having an opinion
|
|
57
|
+
* after all.
|
|
58
|
+
*/
|
|
59
|
+
export declare function setKind(options: SetKindOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
60
|
+
export interface UnsetKindArguments {
|
|
61
|
+
self: RawTransactionArgument<string>;
|
|
62
|
+
cap: RawTransactionArgument<string>;
|
|
63
|
+
}
|
|
64
|
+
export interface UnsetKindOptions {
|
|
65
|
+
package?: string;
|
|
66
|
+
arguments: UnsetKindArguments | [
|
|
67
|
+
self: RawTransactionArgument<string>,
|
|
68
|
+
cap: RawTransactionArgument<string>
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Removes the kind, if any. Idempotent. Leaves the release having said nothing
|
|
73
|
+
* about what it is, which is a different state from calling itself anything.
|
|
74
|
+
*/
|
|
75
|
+
export declare function unsetKind(options: UnsetKindOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
76
|
+
export interface HasKindArguments {
|
|
77
|
+
self: RawTransactionArgument<string>;
|
|
78
|
+
}
|
|
79
|
+
export interface HasKindOptions {
|
|
80
|
+
package?: string;
|
|
81
|
+
arguments: HasKindArguments | [
|
|
82
|
+
self: RawTransactionArgument<string>
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
/** Whether a kind is attached to this release. */
|
|
86
|
+
export declare function hasKind(options: HasKindOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
87
|
+
export interface KindArguments {
|
|
88
|
+
self: RawTransactionArgument<string>;
|
|
89
|
+
}
|
|
90
|
+
export interface KindOptions {
|
|
91
|
+
package?: string;
|
|
92
|
+
arguments: KindArguments | [
|
|
93
|
+
self: RawTransactionArgument<string>
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
/** What the release calls itself. Aborts if nothing is attached. */
|
|
97
|
+
export declare function kind(options: KindOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
98
|
+
//# sourceMappingURL=release_kind.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release_kind.d.ts","sourceRoot":"","sources":["../../../src/contracts/release_kind/release_kind.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAA0B,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE/G,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,0BAA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AAgB,GAAG;QAC1B,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;KACvC,CAAC;CACL;AACD,kDAAkD;AAClD,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,IAMnC,IAAI,WAAW,0DAM1B;AACD,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;CACxC;AACD,MAAM,WAAW,WAAW;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,aAAa,GAAG;QACvB,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;KACvC,CAAC;CACL;AACD,oEAAoE;AACpE,wBAAgB,IAAI,CAAC,OAAO,EAAE,WAAW,IAM7B,IAAI,WAAW,0DAM1B"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* What a release calls itself — "Album", "EP", "Mixtape", "Split" — asserted by
|
|
6
|
+
* whoever holds the release's admin cap, and believed.
|
|
7
|
+
*
|
|
8
|
+
* Deliberately a free string rather than an enum. An enum would not decide the
|
|
9
|
+
* classification (the admin still picks) but it would decide the _menu_, and
|
|
10
|
+
* deciding which self-descriptions are legitimate is not the protocol's job.
|
|
11
|
+
* Artists release beat tapes and splits and things nobody has named yet; a closed
|
|
12
|
+
* set would make each of those a package swap, and in the meantime would quietly
|
|
13
|
+
* push releases into whichever official-looking box fit worst.
|
|
14
|
+
*
|
|
15
|
+
* Nothing here derives the value or checks it for plausibility. A four-track
|
|
16
|
+
* release may call itself an Album and a twelve-track one an EP; both happen, and
|
|
17
|
+
* the artist's intent is the fact worth recording. The only checks are structural
|
|
18
|
+
* — non-empty and bounded — so the field stays storable.
|
|
19
|
+
*
|
|
20
|
+
* This is the opposite call from `release_genre`, on purpose. Genre is a curated
|
|
21
|
+
* vocabulary because discovery and reward-eligibility depend on releases agreeing
|
|
22
|
+
* with each other about what a genre _is_. Nothing depends on two releases
|
|
23
|
+
* agreeing about what an EP is.
|
|
24
|
+
*
|
|
25
|
+
* The cost of that freedom lands on readers: "EP", "ep" and "Extended Play" are
|
|
26
|
+
* three distinct values here. Clients that group or facet by kind should normalise
|
|
27
|
+
* (case-fold at minimum) rather than expect canonical strings.
|
|
28
|
+
*/
|
|
29
|
+
import { MoveTuple, MoveStruct, normalizeMoveArguments } from '../utils/index.js';
|
|
30
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
31
|
+
import {} from '@mysten/sui/transactions';
|
|
32
|
+
const $moduleName = '@local-pkg/release_kind::release_kind';
|
|
33
|
+
export const ExtensionKey = new MoveTuple({ name: `${$moduleName}::ExtensionKey`, fields: [bcs.bool()] });
|
|
34
|
+
export const KindSetEvent = new MoveStruct({ name: `${$moduleName}::KindSetEvent`, fields: {
|
|
35
|
+
release_id: bcs.Address,
|
|
36
|
+
kind: bcs.string()
|
|
37
|
+
} });
|
|
38
|
+
export const KindUnsetEvent = new MoveStruct({ name: `${$moduleName}::KindUnsetEvent`, fields: {
|
|
39
|
+
release_id: bcs.Address
|
|
40
|
+
} });
|
|
41
|
+
/**
|
|
42
|
+
* Sets (or replaces) what the release calls itself.
|
|
43
|
+
*
|
|
44
|
+
* The string is stored exactly as given, including case — it is the release's own
|
|
45
|
+
* word for itself, and normalising it here would be the protocol having an opinion
|
|
46
|
+
* after all.
|
|
47
|
+
*/
|
|
48
|
+
export function setKind(options) {
|
|
49
|
+
const packageAddress = options.package ?? '@local-pkg/release_kind';
|
|
50
|
+
const argumentsTypes = [
|
|
51
|
+
null,
|
|
52
|
+
null,
|
|
53
|
+
'0x1::string::String'
|
|
54
|
+
];
|
|
55
|
+
const parameterNames = ["self", "cap", "kind"];
|
|
56
|
+
return (tx) => tx.moveCall({
|
|
57
|
+
package: packageAddress,
|
|
58
|
+
module: 'release_kind',
|
|
59
|
+
function: 'set_kind',
|
|
60
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Removes the kind, if any. Idempotent. Leaves the release having said nothing
|
|
65
|
+
* about what it is, which is a different state from calling itself anything.
|
|
66
|
+
*/
|
|
67
|
+
export function unsetKind(options) {
|
|
68
|
+
const packageAddress = options.package ?? '@local-pkg/release_kind';
|
|
69
|
+
const argumentsTypes = [
|
|
70
|
+
null,
|
|
71
|
+
null
|
|
72
|
+
];
|
|
73
|
+
const parameterNames = ["self", "cap"];
|
|
74
|
+
return (tx) => tx.moveCall({
|
|
75
|
+
package: packageAddress,
|
|
76
|
+
module: 'release_kind',
|
|
77
|
+
function: 'unset_kind',
|
|
78
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/** Whether a kind is attached to this release. */
|
|
82
|
+
export function hasKind(options) {
|
|
83
|
+
const packageAddress = options.package ?? '@local-pkg/release_kind';
|
|
84
|
+
const argumentsTypes = [
|
|
85
|
+
null
|
|
86
|
+
];
|
|
87
|
+
const parameterNames = ["self"];
|
|
88
|
+
return (tx) => tx.moveCall({
|
|
89
|
+
package: packageAddress,
|
|
90
|
+
module: 'release_kind',
|
|
91
|
+
function: 'has_kind',
|
|
92
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/** What the release calls itself. Aborts if nothing is attached. */
|
|
96
|
+
export function kind(options) {
|
|
97
|
+
const packageAddress = options.package ?? '@local-pkg/release_kind';
|
|
98
|
+
const argumentsTypes = [
|
|
99
|
+
null
|
|
100
|
+
];
|
|
101
|
+
const parameterNames = ["self"];
|
|
102
|
+
return (tx) => tx.moveCall({
|
|
103
|
+
package: packageAddress,
|
|
104
|
+
module: 'release_kind',
|
|
105
|
+
function: 'kind',
|
|
106
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=release_kind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release_kind.js","sourceRoot":"","sources":["../../../src/contracts/release_kind/release_kind.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,sBAAsB,EAA+B,MAAM,mBAAmB,CAAC;AAC/G,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAoB,MAAM,0BAA0B,CAAC;AAC5D,MAAM,WAAW,GAAG,uCAAuC,CAAC;AAC5D,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,gBAAgB,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;AAC1G,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,gBAAgB,EAAE,MAAM,EAAE;QACnF,UAAU,EAAE,GAAG,CAAC,OAAO;QACvB,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE;KACrB,EAAE,CAAC,CAAC;AACT,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,kBAAkB,EAAE,MAAM,EAAE;QACvF,UAAU,EAAE,GAAG,CAAC,OAAO;KAC1B,EAAE,CAAC,CAAC;AAcT;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,OAAuB;IAC3C,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,IAAI,yBAAyB,CAAC;IACpE,MAAM,cAAc,GAAG;QACnB,IAAI;QACJ,IAAI;QACJ,qBAAqB;KACI,CAAC;IAC9B,MAA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