@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,151 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Genre vocabulary for Miso — a curated, deduplicated set of `Genre` objects.
|
|
8
|
+
*
|
|
9
|
+
* Genre is a classification, not protocol-verifiable state, so it lives in an
|
|
10
|
+
* extension rather than core. This module owns the **vocabulary**: `Genre` objects
|
|
11
|
+
* created by a `GenreRegistryCap` holder (Miso), derived by canonical name so the
|
|
12
|
+
* set stays deduplicated and canonical (no "hip-hop" vs "Hip Hop" forks).
|
|
13
|
+
*
|
|
14
|
+
* Genre _assignment_ — classifying a release and its individual tracks — lives in
|
|
15
|
+
* the `release_genre` module. How a recording is presented and classified is a
|
|
16
|
+
* property of the release (the consumer object), not of the recording's objective
|
|
17
|
+
* sound data, so nothing here touches `Recording`.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { MoveStruct, MoveTuple, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
21
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
22
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
23
|
+
const $moduleName = '@local-pkg/genre::genre';
|
|
24
|
+
export const GENRE = new MoveStruct({ name: `${$moduleName}::GENRE`, fields: {
|
|
25
|
+
dummy_field: bcs.bool()
|
|
26
|
+
} });
|
|
27
|
+
export const GenreRegistry = new MoveStruct({ name: `${$moduleName}::GenreRegistry`, fields: {
|
|
28
|
+
id: bcs.Address
|
|
29
|
+
} });
|
|
30
|
+
export const GenreRegistryCap = new MoveStruct({ name: `${$moduleName}::GenreRegistryCap`, fields: {
|
|
31
|
+
id: bcs.Address
|
|
32
|
+
} });
|
|
33
|
+
export const Genre = new MoveStruct({ name: `${$moduleName}::Genre`, fields: {
|
|
34
|
+
id: bcs.Address,
|
|
35
|
+
/** Canonical genre name (e.g. "HIP_HOP"). */
|
|
36
|
+
name: bcs.string()
|
|
37
|
+
} });
|
|
38
|
+
export const GenreKey = new MoveTuple({ name: `${$moduleName}::GenreKey`, fields: [bcs.string()] });
|
|
39
|
+
export const GenreCreatedEvent = new MoveStruct({ name: `${$moduleName}::GenreCreatedEvent`, fields: {
|
|
40
|
+
genre_id: bcs.Address,
|
|
41
|
+
name: bcs.string()
|
|
42
|
+
} });
|
|
43
|
+
export interface NewArguments {
|
|
44
|
+
_: RawTransactionArgument<string>;
|
|
45
|
+
registry: RawTransactionArgument<string>;
|
|
46
|
+
name: RawTransactionArgument<string>;
|
|
47
|
+
}
|
|
48
|
+
export interface NewOptions {
|
|
49
|
+
package?: string;
|
|
50
|
+
arguments: NewArguments | [
|
|
51
|
+
_: RawTransactionArgument<string>,
|
|
52
|
+
registry: RawTransactionArgument<string>,
|
|
53
|
+
name: RawTransactionArgument<string>
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Creates a new genre in the canonical vocabulary. Cap-gated: only the registry
|
|
58
|
+
* curator can extend the vocabulary. Derived by canonical name, so creating the
|
|
59
|
+
* same name twice aborts (dedup is automatic). The `Genre` is frozen — immutable
|
|
60
|
+
* and globally readable by reference.
|
|
61
|
+
*/
|
|
62
|
+
export function _new(options: NewOptions) {
|
|
63
|
+
const packageAddress = options.package ?? '@local-pkg/genre';
|
|
64
|
+
const argumentsTypes = [
|
|
65
|
+
null,
|
|
66
|
+
null,
|
|
67
|
+
'0x1::string::String'
|
|
68
|
+
] satisfies (string | null)[];
|
|
69
|
+
const parameterNames = ["_", "registry", "name"];
|
|
70
|
+
return (tx: Transaction) => tx.moveCall({
|
|
71
|
+
package: packageAddress,
|
|
72
|
+
module: 'genre',
|
|
73
|
+
function: 'new',
|
|
74
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
export interface DeriveGenreIdArguments {
|
|
78
|
+
self: RawTransactionArgument<string>;
|
|
79
|
+
name: RawTransactionArgument<string>;
|
|
80
|
+
}
|
|
81
|
+
export interface DeriveGenreIdOptions {
|
|
82
|
+
package?: string;
|
|
83
|
+
arguments: DeriveGenreIdArguments | [
|
|
84
|
+
self: RawTransactionArgument<string>,
|
|
85
|
+
name: RawTransactionArgument<string>
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Derives the object id a `Genre` with the given name would have, without creating
|
|
90
|
+
* it. Lets clients resolve/check a genre id offline.
|
|
91
|
+
*/
|
|
92
|
+
export function deriveGenreId(options: DeriveGenreIdOptions) {
|
|
93
|
+
const packageAddress = options.package ?? '@local-pkg/genre';
|
|
94
|
+
const argumentsTypes = [
|
|
95
|
+
null,
|
|
96
|
+
'0x1::string::String'
|
|
97
|
+
] satisfies (string | null)[];
|
|
98
|
+
const parameterNames = ["self", "name"];
|
|
99
|
+
return (tx: Transaction) => tx.moveCall({
|
|
100
|
+
package: packageAddress,
|
|
101
|
+
module: 'genre',
|
|
102
|
+
function: 'derive_genre_id',
|
|
103
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
export interface IdArguments {
|
|
107
|
+
self: RawTransactionArgument<string>;
|
|
108
|
+
}
|
|
109
|
+
export interface IdOptions {
|
|
110
|
+
package?: string;
|
|
111
|
+
arguments: IdArguments | [
|
|
112
|
+
self: RawTransactionArgument<string>
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
/** Returns the genre's object id. */
|
|
116
|
+
export function id(options: IdOptions) {
|
|
117
|
+
const packageAddress = options.package ?? '@local-pkg/genre';
|
|
118
|
+
const argumentsTypes = [
|
|
119
|
+
null
|
|
120
|
+
] satisfies (string | null)[];
|
|
121
|
+
const parameterNames = ["self"];
|
|
122
|
+
return (tx: Transaction) => tx.moveCall({
|
|
123
|
+
package: packageAddress,
|
|
124
|
+
module: 'genre',
|
|
125
|
+
function: 'id',
|
|
126
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
export interface NameArguments {
|
|
130
|
+
self: RawTransactionArgument<string>;
|
|
131
|
+
}
|
|
132
|
+
export interface NameOptions {
|
|
133
|
+
package?: string;
|
|
134
|
+
arguments: NameArguments | [
|
|
135
|
+
self: RawTransactionArgument<string>
|
|
136
|
+
];
|
|
137
|
+
}
|
|
138
|
+
/** Returns the genre's canonical name. */
|
|
139
|
+
export function name(options: NameOptions) {
|
|
140
|
+
const packageAddress = options.package ?? '@local-pkg/genre';
|
|
141
|
+
const argumentsTypes = [
|
|
142
|
+
null
|
|
143
|
+
] satisfies (string | null)[];
|
|
144
|
+
const parameterNames = ["self"];
|
|
145
|
+
return (tx: Transaction) => tx.moveCall({
|
|
146
|
+
package: packageAddress,
|
|
147
|
+
module: 'genre',
|
|
148
|
+
function: 'name',
|
|
149
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
150
|
+
});
|
|
151
|
+
}
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The parental advisory rating for a recording — whether its lyrics are explicit —
|
|
8
|
+
* stored as a dynamic field on the recording's UID and written through its
|
|
9
|
+
* cap-gated `uid_mut`.
|
|
10
|
+
*
|
|
11
|
+
* This is its own package on purpose. Advisory ratings are set by a different
|
|
12
|
+
* person, at a different time, for entirely different reasons than the other facts
|
|
13
|
+
* about a recording, and the standard that governs them moves on its own schedule.
|
|
14
|
+
* Bundling it into a general "recording metadata" object would mean that revising
|
|
15
|
+
* the advisory standard drags every unrelated field through the migration. Kept
|
|
16
|
+
* separate, a consumer implementing some future metadata profile selects this
|
|
17
|
+
* extension or ignores it, and swapping it touches nothing else.
|
|
18
|
+
*
|
|
19
|
+
* The rating is deliberately not a boolean. Every distributor and storefront
|
|
20
|
+
* distinguishes a _cleaned_ edit — an explicit recording re-issued with the
|
|
21
|
+
* offending content removed — from a recording that was never explicit at all.
|
|
22
|
+
* They are merchandised differently and a boolean cannot express the difference,
|
|
23
|
+
* so `Cleaned` is a first-class variant.
|
|
24
|
+
*
|
|
25
|
+
* Attaching the extension IS the statement. There is no "attached but undeclared"
|
|
26
|
+
* state: if a rating is present it has been asserted by the rights holder, and a
|
|
27
|
+
* recording with nothing attached has simply said nothing.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
import { MoveTuple, MoveEnum, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
31
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
32
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
33
|
+
const $moduleName = '@local-pkg/recording_advisory::recording_advisory';
|
|
34
|
+
export const ExtensionKey = new MoveTuple({ name: `${$moduleName}::ExtensionKey`, fields: [bcs.bool()] });
|
|
35
|
+
/** A recording's parental advisory rating. */
|
|
36
|
+
export const ExplicitRating = new MoveEnum({ name: `${$moduleName}::ExplicitRating`, fields: {
|
|
37
|
+
/** Contains explicit content. */
|
|
38
|
+
Explicit: null,
|
|
39
|
+
/** Contains no explicit content, and never did. */
|
|
40
|
+
NotExplicit: null,
|
|
41
|
+
/** An edited version of a recording that was originally explicit. */
|
|
42
|
+
Cleaned: null
|
|
43
|
+
} });
|
|
44
|
+
export const AdvisoryRatingSetEvent = new MoveStruct({ name: `${$moduleName}::AdvisoryRatingSetEvent`, fields: {
|
|
45
|
+
recording_id: bcs.Address,
|
|
46
|
+
rating: ExplicitRating
|
|
47
|
+
} });
|
|
48
|
+
export const AdvisoryRatingUnsetEvent = new MoveStruct({ name: `${$moduleName}::AdvisoryRatingUnsetEvent`, fields: {
|
|
49
|
+
recording_id: bcs.Address
|
|
50
|
+
} });
|
|
51
|
+
export interface ExplicitOptions {
|
|
52
|
+
package?: string;
|
|
53
|
+
arguments?: [
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
/** Contains explicit content. */
|
|
57
|
+
export function explicit(options: ExplicitOptions = {}) {
|
|
58
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
59
|
+
return (tx: Transaction) => tx.moveCall({
|
|
60
|
+
package: packageAddress,
|
|
61
|
+
module: 'recording_advisory',
|
|
62
|
+
function: 'explicit',
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
export interface NotExplicitOptions {
|
|
66
|
+
package?: string;
|
|
67
|
+
arguments?: [
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
/** Contains no explicit content, and never did. */
|
|
71
|
+
export function notExplicit(options: NotExplicitOptions = {}) {
|
|
72
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
73
|
+
return (tx: Transaction) => tx.moveCall({
|
|
74
|
+
package: packageAddress,
|
|
75
|
+
module: 'recording_advisory',
|
|
76
|
+
function: 'not_explicit',
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
export interface CleanedOptions {
|
|
80
|
+
package?: string;
|
|
81
|
+
arguments?: [
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
/** An edited version of a recording that was originally explicit. */
|
|
85
|
+
export function cleaned(options: CleanedOptions = {}) {
|
|
86
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
87
|
+
return (tx: Transaction) => tx.moveCall({
|
|
88
|
+
package: packageAddress,
|
|
89
|
+
module: 'recording_advisory',
|
|
90
|
+
function: 'cleaned',
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
export interface SetRatingArguments {
|
|
94
|
+
self: RawTransactionArgument<string>;
|
|
95
|
+
cap: RawTransactionArgument<string>;
|
|
96
|
+
rating: TransactionArgument;
|
|
97
|
+
}
|
|
98
|
+
export interface SetRatingOptions {
|
|
99
|
+
package?: string;
|
|
100
|
+
arguments: SetRatingArguments | [
|
|
101
|
+
self: RawTransactionArgument<string>,
|
|
102
|
+
cap: RawTransactionArgument<string>,
|
|
103
|
+
rating: TransactionArgument
|
|
104
|
+
];
|
|
105
|
+
typeArguments: [
|
|
106
|
+
string,
|
|
107
|
+
string
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
/** Sets (or replaces) the recording's advisory rating. */
|
|
111
|
+
export function setRating(options: SetRatingOptions) {
|
|
112
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
113
|
+
const argumentsTypes = [
|
|
114
|
+
null,
|
|
115
|
+
null,
|
|
116
|
+
null
|
|
117
|
+
] satisfies (string | null)[];
|
|
118
|
+
const parameterNames = ["self", "cap", "rating"];
|
|
119
|
+
return (tx: Transaction) => tx.moveCall({
|
|
120
|
+
package: packageAddress,
|
|
121
|
+
module: 'recording_advisory',
|
|
122
|
+
function: 'set_rating',
|
|
123
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
124
|
+
typeArguments: options.typeArguments
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
export interface UnsetRatingArguments {
|
|
128
|
+
self: RawTransactionArgument<string>;
|
|
129
|
+
cap: RawTransactionArgument<string>;
|
|
130
|
+
}
|
|
131
|
+
export interface UnsetRatingOptions {
|
|
132
|
+
package?: string;
|
|
133
|
+
arguments: UnsetRatingArguments | [
|
|
134
|
+
self: RawTransactionArgument<string>,
|
|
135
|
+
cap: RawTransactionArgument<string>
|
|
136
|
+
];
|
|
137
|
+
typeArguments: [
|
|
138
|
+
string,
|
|
139
|
+
string
|
|
140
|
+
];
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Removes the rating, if any. Idempotent — the recording is left having said
|
|
144
|
+
* nothing about its content, which is distinct from asserting `NotExplicit`.
|
|
145
|
+
*/
|
|
146
|
+
export function unsetRating(options: UnsetRatingOptions) {
|
|
147
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
148
|
+
const argumentsTypes = [
|
|
149
|
+
null,
|
|
150
|
+
null
|
|
151
|
+
] satisfies (string | null)[];
|
|
152
|
+
const parameterNames = ["self", "cap"];
|
|
153
|
+
return (tx: Transaction) => tx.moveCall({
|
|
154
|
+
package: packageAddress,
|
|
155
|
+
module: 'recording_advisory',
|
|
156
|
+
function: 'unset_rating',
|
|
157
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
158
|
+
typeArguments: options.typeArguments
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
export interface HasRatingArguments {
|
|
162
|
+
self: RawTransactionArgument<string>;
|
|
163
|
+
}
|
|
164
|
+
export interface HasRatingOptions {
|
|
165
|
+
package?: string;
|
|
166
|
+
arguments: HasRatingArguments | [
|
|
167
|
+
self: RawTransactionArgument<string>
|
|
168
|
+
];
|
|
169
|
+
typeArguments: [
|
|
170
|
+
string,
|
|
171
|
+
string
|
|
172
|
+
];
|
|
173
|
+
}
|
|
174
|
+
/** Whether an advisory rating is attached to this recording. */
|
|
175
|
+
export function hasRating(options: HasRatingOptions) {
|
|
176
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
177
|
+
const argumentsTypes = [
|
|
178
|
+
null
|
|
179
|
+
] satisfies (string | null)[];
|
|
180
|
+
const parameterNames = ["self"];
|
|
181
|
+
return (tx: Transaction) => tx.moveCall({
|
|
182
|
+
package: packageAddress,
|
|
183
|
+
module: 'recording_advisory',
|
|
184
|
+
function: 'has_rating',
|
|
185
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
186
|
+
typeArguments: options.typeArguments
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
export interface RatingArguments {
|
|
190
|
+
self: RawTransactionArgument<string>;
|
|
191
|
+
}
|
|
192
|
+
export interface RatingOptions {
|
|
193
|
+
package?: string;
|
|
194
|
+
arguments: RatingArguments | [
|
|
195
|
+
self: RawTransactionArgument<string>
|
|
196
|
+
];
|
|
197
|
+
typeArguments: [
|
|
198
|
+
string,
|
|
199
|
+
string
|
|
200
|
+
];
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* The recording's advisory rating. Aborts if none is attached — callers that
|
|
204
|
+
* tolerate an unrated recording should check `has_rating` first, since absence is
|
|
205
|
+
* a meaningful state and must not be silently read as `NotExplicit`.
|
|
206
|
+
*/
|
|
207
|
+
export function rating(options: RatingOptions) {
|
|
208
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
209
|
+
const argumentsTypes = [
|
|
210
|
+
null
|
|
211
|
+
] satisfies (string | null)[];
|
|
212
|
+
const parameterNames = ["self"];
|
|
213
|
+
return (tx: Transaction) => tx.moveCall({
|
|
214
|
+
package: packageAddress,
|
|
215
|
+
module: 'recording_advisory',
|
|
216
|
+
function: 'rating',
|
|
217
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
218
|
+
typeArguments: options.typeArguments
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
export interface IsExplicitArguments {
|
|
222
|
+
self: TransactionArgument;
|
|
223
|
+
}
|
|
224
|
+
export interface IsExplicitOptions {
|
|
225
|
+
package?: string;
|
|
226
|
+
arguments: IsExplicitArguments | [
|
|
227
|
+
self: TransactionArgument
|
|
228
|
+
];
|
|
229
|
+
}
|
|
230
|
+
/** Whether the recording contains explicit content. */
|
|
231
|
+
export function isExplicit(options: IsExplicitOptions) {
|
|
232
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
233
|
+
const argumentsTypes = [
|
|
234
|
+
null
|
|
235
|
+
] satisfies (string | null)[];
|
|
236
|
+
const parameterNames = ["self"];
|
|
237
|
+
return (tx: Transaction) => tx.moveCall({
|
|
238
|
+
package: packageAddress,
|
|
239
|
+
module: 'recording_advisory',
|
|
240
|
+
function: 'is_explicit',
|
|
241
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
export interface IsNotExplicitArguments {
|
|
245
|
+
self: TransactionArgument;
|
|
246
|
+
}
|
|
247
|
+
export interface IsNotExplicitOptions {
|
|
248
|
+
package?: string;
|
|
249
|
+
arguments: IsNotExplicitArguments | [
|
|
250
|
+
self: TransactionArgument
|
|
251
|
+
];
|
|
252
|
+
}
|
|
253
|
+
/** Whether the recording contains no explicit content and never did. */
|
|
254
|
+
export function isNotExplicit(options: IsNotExplicitOptions) {
|
|
255
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
256
|
+
const argumentsTypes = [
|
|
257
|
+
null
|
|
258
|
+
] satisfies (string | null)[];
|
|
259
|
+
const parameterNames = ["self"];
|
|
260
|
+
return (tx: Transaction) => tx.moveCall({
|
|
261
|
+
package: packageAddress,
|
|
262
|
+
module: 'recording_advisory',
|
|
263
|
+
function: 'is_not_explicit',
|
|
264
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
export interface IsCleanedArguments {
|
|
268
|
+
self: TransactionArgument;
|
|
269
|
+
}
|
|
270
|
+
export interface IsCleanedOptions {
|
|
271
|
+
package?: string;
|
|
272
|
+
arguments: IsCleanedArguments | [
|
|
273
|
+
self: TransactionArgument
|
|
274
|
+
];
|
|
275
|
+
}
|
|
276
|
+
/** Whether the recording is an edited version of an originally explicit one. */
|
|
277
|
+
export function isCleaned(options: IsCleanedOptions) {
|
|
278
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
279
|
+
const argumentsTypes = [
|
|
280
|
+
null
|
|
281
|
+
] satisfies (string | null)[];
|
|
282
|
+
const parameterNames = ["self"];
|
|
283
|
+
return (tx: Transaction) => tx.moveCall({
|
|
284
|
+
package: packageAddress,
|
|
285
|
+
module: 'recording_advisory',
|
|
286
|
+
function: 'is_cleaned',
|
|
287
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
export interface NameArguments {
|
|
291
|
+
self: TransactionArgument;
|
|
292
|
+
}
|
|
293
|
+
export interface NameOptions {
|
|
294
|
+
package?: string;
|
|
295
|
+
arguments: NameArguments | [
|
|
296
|
+
self: TransactionArgument
|
|
297
|
+
];
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* The rating's canonical name, for clients and indexers that need a stable string
|
|
301
|
+
* rather than a Move value.
|
|
302
|
+
*/
|
|
303
|
+
export function name(options: NameOptions) {
|
|
304
|
+
const packageAddress = options.package ?? '@local-pkg/recording_advisory';
|
|
305
|
+
const argumentsTypes = [
|
|
306
|
+
null
|
|
307
|
+
] satisfies (string | null)[];
|
|
308
|
+
const parameterNames = ["self"];
|
|
309
|
+
return (tx: Transaction) => tx.moveCall({
|
|
310
|
+
package: packageAddress,
|
|
311
|
+
module: 'recording_advisory',
|
|
312
|
+
function: 'name',
|
|
313
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
314
|
+
});
|
|
315
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { MoveTuple } from '../../../utils/index.js';
|
|
5
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
6
|
+
const $moduleName = 'language_code::language_code';
|
|
7
|
+
export const LanguageCode = new MoveTuple({ name: `${$moduleName}::LanguageCode`, fields: [bcs.string()] });
|