@misofm/musicos 0.1.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/LICENSE +201 -0
- package/README.md +75 -0
- package/dist/client.d.ts +309 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +216 -0
- package/dist/client.js.map +1 -0
- package/dist/contracts/musicos/composition.d.ts +195 -0
- package/dist/contracts/musicos/composition.d.ts.map +1 -0
- package/dist/contracts/musicos/composition.js +195 -0
- package/dist/contracts/musicos/composition.js.map +1 -0
- package/dist/contracts/musicos/deps/bps/bps.d.ts +17 -0
- package/dist/contracts/musicos/deps/bps/bps.d.ts.map +1 -0
- package/dist/contracts/musicos/deps/bps/bps.js +19 -0
- package/dist/contracts/musicos/deps/bps/bps.js.map +1 -0
- package/dist/contracts/musicos/recording.d.ts +238 -0
- package/dist/contracts/musicos/recording.d.ts.map +1 -0
- package/dist/contracts/musicos/recording.js +232 -0
- package/dist/contracts/musicos/recording.js.map +1 -0
- package/dist/contracts/musicos/release.d.ts +298 -0
- package/dist/contracts/musicos/release.d.ts.map +1 -0
- package/dist/contracts/musicos/release.js +298 -0
- package/dist/contracts/musicos/release.js.map +1 -0
- package/dist/contracts/musicos/track.d.ts +193 -0
- package/dist/contracts/musicos/track.d.ts.map +1 -0
- package/dist/contracts/musicos/track.js +197 -0
- package/dist/contracts/musicos/track.js.map +1 -0
- package/dist/contracts/utils/index.d.ts +104 -0
- package/dist/contracts/utils/index.d.ts.map +1 -0
- package/dist/contracts/utils/index.js +272 -0
- package/dist/contracts/utils/index.js.map +1 -0
- package/dist/contracts.d.ts +9 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +14 -0
- package/dist/contracts.js.map +1 -0
- package/dist/deployments.d.ts +60 -0
- package/dist/deployments.d.ts.map +1 -0
- package/dist/deployments.js +109 -0
- package/dist/deployments.js.map +1 -0
- package/dist/events.d.ts +16 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +25 -0
- package/dist/events.js.map +1 -0
- package/dist/execute.d.ts +49 -0
- package/dist/execute.d.ts.map +1 -0
- package/dist/execute.js +110 -0
- package/dist/execute.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/internal.d.ts +17 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +46 -0
- package/dist/internal.js.map +1 -0
- package/dist/numeric.d.ts +5 -0
- package/dist/numeric.d.ts.map +1 -0
- package/dist/numeric.js +21 -0
- package/dist/numeric.js.map +1 -0
- package/dist/packages.d.ts +67 -0
- package/dist/packages.d.ts.map +1 -0
- package/dist/packages.js +85 -0
- package/dist/packages.js.map +1 -0
- package/dist/parsers.d.ts +9 -0
- package/dist/parsers.d.ts.map +1 -0
- package/dist/parsers.js +40 -0
- package/dist/parsers.js.map +1 -0
- package/dist/queries.d.ts +178 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +611 -0
- package/dist/queries.js.map +1 -0
- package/dist/transactions.d.ts +136 -0
- package/dist/transactions.d.ts.map +1 -0
- package/dist/transactions.js +145 -0
- package/dist/transactions.js.map +1 -0
- package/dist/types.d.ts +194 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/dist/view.d.ts +22 -0
- package/dist/view.d.ts.map +1 -0
- package/dist/view.js +42 -0
- package/dist/view.js.map +1 -0
- package/package.json +119 -0
- package/src/client.ts +341 -0
- package/src/contracts/musicos/composition.ts +280 -0
- package/src/contracts/musicos/deps/bps/bps.ts +22 -0
- package/src/contracts/musicos/recording.ts +308 -0
- package/src/contracts/musicos/release.ts +409 -0
- package/src/contracts/musicos/track.ts +255 -0
- package/src/contracts/utils/index.ts +428 -0
- package/src/contracts.ts +29 -0
- package/src/deployments.ts +166 -0
- package/src/events.ts +30 -0
- package/src/execute.ts +137 -0
- package/src/index.ts +21 -0
- package/src/internal.ts +78 -0
- package/src/numeric.ts +25 -0
- package/src/packages.ts +117 -0
- package/src/parsers.ts +66 -0
- package/src/queries.ts +928 -0
- package/src/transactions.ts +305 -0
- package/src/types.ts +222 -0
- package/src/view.ts +65 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* Represents a music release in musicos. A release is an ordered tracklist with
|
|
6
|
+
* per-track revenue distribution configuration. Cover art lives in the `cover_art`
|
|
7
|
+
* extension, not in core.
|
|
8
|
+
*
|
|
9
|
+
* The tracklist is deliberately FLAT — a `vector<Track>` with no disc structure.
|
|
10
|
+
* Grouping a sequence into discs, vinyl sides, acts, or movements is a property of
|
|
11
|
+
* a distribution medium, not of the release: it has more than one correct
|
|
12
|
+
* rendering, which makes it presentation, and presentation lives in the metadata
|
|
13
|
+
* extension. A consequence worth stating: the stored tracklist and the digest
|
|
14
|
+
* pre-image have the same shape, so what signers consented to is exactly what is
|
|
15
|
+
* stored — nothing structural is chosen after consent except the title.
|
|
16
|
+
*
|
|
17
|
+
* ### Key Features:
|
|
18
|
+
*
|
|
19
|
+
* - Ordered flat tracklist (grouping is presentation, in the metadata extension)
|
|
20
|
+
* - Configurable per-track revenue splits
|
|
21
|
+
* - State machine: Initialized -> Published
|
|
22
|
+
*
|
|
23
|
+
* Attribution (credits, primary/featured artists) is intentionally NOT part of
|
|
24
|
+
* core: it is display-oriented, varies across platforms, and is never read by the
|
|
25
|
+
* economics. It lives in a first-party credits extension attached via `uid_mut`,
|
|
26
|
+
* so core takes no dependency on an identity package and core publish enforces no
|
|
27
|
+
* attribution.
|
|
28
|
+
*
|
|
29
|
+
* The same rule governs naming. Core stores what a thing _is_ — identity and
|
|
30
|
+
* everything the economics read; extensions describe it. The release's `title` is
|
|
31
|
+
* the one embedded name: it is constitutive (naming the package is part of
|
|
32
|
+
* creating it) and freezing it at publish is a buyer-facing guarantee. Edition
|
|
33
|
+
* naming ("Deluxe Edition"), disc titles, localized titles, and DSP-shaped slots
|
|
34
|
+
* all have more than one correct rendering — presentation — and live in the
|
|
35
|
+
* metadata extension.
|
|
36
|
+
*
|
|
37
|
+
* ### Consent scope
|
|
38
|
+
*
|
|
39
|
+
* The release digest — and therefore the derived release id every `Track` commits
|
|
40
|
+
* to at creation — binds the economics and membership of the release: the ordered
|
|
41
|
+
* list of `(recording, split)` pairs and the creator's nonce. It deliberately
|
|
42
|
+
* binds nothing else. The title — the one embedded field outside the digest — and
|
|
43
|
+
* everything in the extension layer (artwork, credits, display grouping) are
|
|
44
|
+
* chosen by the release creator, before or after tracks are created, and are
|
|
45
|
+
* trusted and publicly attributable rather than cryptographically committed. See
|
|
46
|
+
* `track::new` for the signer-side statement of this boundary.
|
|
47
|
+
*
|
|
48
|
+
* The derived id commits to the canonical registry's UID and the digest, not the
|
|
49
|
+
* digest alone — so targeting an id also consents to that namespace's liveness. If
|
|
50
|
+
* that parent were deleted, or its `&mut UID` became permanently unreachable, the
|
|
51
|
+
* release could never exist and every track or offer targeting it would be
|
|
52
|
+
* stranded — the same blast-radius class as a release that simply never publishes.
|
|
53
|
+
* `ReleaseRegistry` is therefore created and shared exactly once at package
|
|
54
|
+
* initialization, and exposes neither a constructor, deletion path, nor mutable
|
|
55
|
+
* UID accessor.
|
|
56
|
+
*
|
|
57
|
+
* ### Lifecycle and trust model
|
|
58
|
+
*
|
|
59
|
+
* A release is `key`-only with no `drop`: a fresh `Initialized` object cannot be
|
|
60
|
+
* transferred, wrapped, publicly shared, or discarded, and its only by-value
|
|
61
|
+
* consumer is `publish`. Create-and-publish is therefore atomic by construction —
|
|
62
|
+
* an `Initialized` release cannot outlive its creating transaction, and every
|
|
63
|
+
* release that exists on-chain is `Published` and shared. There is deliberately no
|
|
64
|
+
* keep function; assembling tracks, discs, and the release must fit one
|
|
65
|
+
* transaction.
|
|
66
|
+
*
|
|
67
|
+
* `uid_mut` works in any lifecycle state and is permanent root over ALL dynamic
|
|
68
|
+
* fields on the object — including fields attached by other extensions. "Immutable
|
|
69
|
+
* after publish" covers the embedded fields only; extension-layer data stays
|
|
70
|
+
* admin-mutable in perpetuity. This is the designed extension surface, and it is
|
|
71
|
+
* the one trust assumption that never expires: integrators should model the cap
|
|
72
|
+
* holder as able to mutate or delete any extension data, forever.
|
|
73
|
+
*/
|
|
74
|
+
import { MoveEnum, MoveStruct, MoveTuple, type RawTransactionArgument } from '../utils/index.ts';
|
|
75
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
76
|
+
/** Lifecycle state of a release. */
|
|
77
|
+
export declare const ReleaseState: MoveEnum<{
|
|
78
|
+
/** Release is initialized but not yet published. */
|
|
79
|
+
Initialized: null;
|
|
80
|
+
/** Release is published and immutable. Includes publication timestamp. */
|
|
81
|
+
Published: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
82
|
+
}, "@local-pkg/musicos::release::ReleaseState">;
|
|
83
|
+
export declare const Release: MoveStruct<{
|
|
84
|
+
/** Unique identifier for this release. */
|
|
85
|
+
id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
86
|
+
/** Current lifecycle state. */
|
|
87
|
+
state: MoveEnum<{
|
|
88
|
+
/** Release is initialized but not yet published. */
|
|
89
|
+
Initialized: null;
|
|
90
|
+
/** Release is published and immutable. Includes publication timestamp. */
|
|
91
|
+
Published: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
92
|
+
}, "@local-pkg/musicos::release::ReleaseState">;
|
|
93
|
+
/** Title of the release. */
|
|
94
|
+
title: import("@mysten/bcs").BcsType<string, string, "string">;
|
|
95
|
+
/**
|
|
96
|
+
* The ordered tracklist. Same shape as the digest pre-image every track's creator
|
|
97
|
+
* consented to; display grouping lives in the metadata extension.
|
|
98
|
+
*/
|
|
99
|
+
tracks: import("@mysten/bcs").BcsType<{
|
|
100
|
+
state: import("@mysten/bcs").EnumOutputShapeWithKeys<{
|
|
101
|
+
Unassigned: string;
|
|
102
|
+
Assigned: true;
|
|
103
|
+
}, "Assigned" | "Unassigned">;
|
|
104
|
+
composition_id: string;
|
|
105
|
+
recording_id: string;
|
|
106
|
+
split_bps: [number];
|
|
107
|
+
}[], Iterable<{
|
|
108
|
+
state: import("@mysten/bcs").EnumInputShape<{
|
|
109
|
+
Unassigned: string | Uint8Array<ArrayBufferLike>;
|
|
110
|
+
Assigned: boolean | object | null;
|
|
111
|
+
}>;
|
|
112
|
+
composition_id: string | Uint8Array<ArrayBufferLike>;
|
|
113
|
+
recording_id: string | Uint8Array<ArrayBufferLike>;
|
|
114
|
+
split_bps: readonly [number];
|
|
115
|
+
}> & {
|
|
116
|
+
length: number;
|
|
117
|
+
}, string>;
|
|
118
|
+
}, "@local-pkg/musicos::release::Release">;
|
|
119
|
+
export declare const ReleaseRegistry: MoveStruct<{
|
|
120
|
+
id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
121
|
+
}, "@local-pkg/musicos::release::ReleaseRegistry">;
|
|
122
|
+
export declare const ReleaseKey: MoveTuple<readonly [import("@mysten/bcs").BcsType<number[], Iterable<number> & {
|
|
123
|
+
length: number;
|
|
124
|
+
}, string>], "@local-pkg/musicos::release::ReleaseKey">;
|
|
125
|
+
export declare const ReleaseAdminCap: MoveStruct<{
|
|
126
|
+
/** Unique identifier for this capability. */
|
|
127
|
+
id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
128
|
+
/** ID of the release this capability controls. */
|
|
129
|
+
release_id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
130
|
+
}, "@local-pkg/musicos::release::ReleaseAdminCap">;
|
|
131
|
+
export declare const ReleaseAdminCapKey: MoveTuple<readonly [import("@mysten/bcs").BcsType<boolean, boolean, "bool">], "@local-pkg/musicos::release::ReleaseAdminCapKey">;
|
|
132
|
+
export declare const ReleasePublishedEvent: MoveStruct<{
|
|
133
|
+
release_id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
134
|
+
}, "@local-pkg/musicos::release::ReleasePublishedEvent">;
|
|
135
|
+
export declare const ReleaseRegistryCreatedEvent: MoveStruct<{
|
|
136
|
+
registry_id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
137
|
+
created_by: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
138
|
+
}, "@local-pkg/musicos::release::ReleaseRegistryCreatedEvent">;
|
|
139
|
+
export interface NewArguments {
|
|
140
|
+
self: RawTransactionArgument<string>;
|
|
141
|
+
title: RawTransactionArgument<string>;
|
|
142
|
+
tracks: TransactionArgument;
|
|
143
|
+
nonce: RawTransactionArgument<number | bigint>;
|
|
144
|
+
}
|
|
145
|
+
export interface NewOptions {
|
|
146
|
+
package?: string;
|
|
147
|
+
arguments: NewArguments | [
|
|
148
|
+
self: RawTransactionArgument<string>,
|
|
149
|
+
title: RawTransactionArgument<string>,
|
|
150
|
+
tracks: TransactionArgument,
|
|
151
|
+
nonce: RawTransactionArgument<number | bigint>
|
|
152
|
+
];
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Assembles a release under the canonical registry namespace. This is
|
|
156
|
+
* permissionless: consent is carried by the supplied tracks, each of which was
|
|
157
|
+
* created for the exact derived release id. Returns the release and admin
|
|
158
|
+
* capability by value so the caller can compose `publish` and custody in the same
|
|
159
|
+
* PTB.
|
|
160
|
+
*/
|
|
161
|
+
export declare function _new(options: NewOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
162
|
+
export interface DeriveTargetReleaseIdArguments {
|
|
163
|
+
self: RawTransactionArgument<string>;
|
|
164
|
+
recordingIds: RawTransactionArgument<Array<string>>;
|
|
165
|
+
trackSplitValues: RawTransactionArgument<Array<number | bigint>>;
|
|
166
|
+
nonce: RawTransactionArgument<number | bigint>;
|
|
167
|
+
}
|
|
168
|
+
export interface DeriveTargetReleaseIdOptions {
|
|
169
|
+
package?: string;
|
|
170
|
+
arguments: DeriveTargetReleaseIdArguments | [
|
|
171
|
+
self: RawTransactionArgument<string>,
|
|
172
|
+
recordingIds: RawTransactionArgument<Array<string>>,
|
|
173
|
+
trackSplitValues: RawTransactionArgument<Array<number | bigint>>,
|
|
174
|
+
nonce: RawTransactionArgument<number | bigint>
|
|
175
|
+
];
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Derives the release id that `new` would claim under this registry, without
|
|
179
|
+
* creating a release. This immutable shared-object access remains parallelizable
|
|
180
|
+
* for clients preparing tracks.
|
|
181
|
+
*/
|
|
182
|
+
export declare function deriveTargetReleaseId(options: DeriveTargetReleaseIdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
183
|
+
export interface ReleaseRegistryIdArguments {
|
|
184
|
+
self: RawTransactionArgument<string>;
|
|
185
|
+
}
|
|
186
|
+
export interface ReleaseRegistryIdOptions {
|
|
187
|
+
package?: string;
|
|
188
|
+
arguments: ReleaseRegistryIdArguments | [
|
|
189
|
+
self: RawTransactionArgument<string>
|
|
190
|
+
];
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Returns the canonical registry's object ID, which is the derivation parent
|
|
194
|
+
* committed to by `new` and `derive_target_release_id`. Exported as the
|
|
195
|
+
* `ReleaseRegistry.id()` method to avoid colliding with the existing
|
|
196
|
+
* `release::id(&Release)` ABI function.
|
|
197
|
+
*/
|
|
198
|
+
export declare function releaseRegistryId(options: ReleaseRegistryIdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
199
|
+
export interface PublishArguments {
|
|
200
|
+
self: RawTransactionArgument<string>;
|
|
201
|
+
cap: RawTransactionArgument<string>;
|
|
202
|
+
}
|
|
203
|
+
export interface PublishOptions {
|
|
204
|
+
package?: string;
|
|
205
|
+
arguments: PublishArguments | [
|
|
206
|
+
self: RawTransactionArgument<string>,
|
|
207
|
+
cap: RawTransactionArgument<string>
|
|
208
|
+
];
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Publishes the release, making it immutable. Track splits must be set and sum to
|
|
212
|
+
* 100% before publishing. Required State: Initialized
|
|
213
|
+
*
|
|
214
|
+
* Note: core enforces no attribution requirement — credits live in the credits
|
|
215
|
+
* extension and may be attached before or after publish via `uid_mut`.
|
|
216
|
+
*/
|
|
217
|
+
export declare function publish(options: PublishOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
218
|
+
export interface AuthorizeArguments {
|
|
219
|
+
self: RawTransactionArgument<string>;
|
|
220
|
+
cap: RawTransactionArgument<string>;
|
|
221
|
+
}
|
|
222
|
+
export interface AuthorizeOptions {
|
|
223
|
+
package?: string;
|
|
224
|
+
arguments: AuthorizeArguments | [
|
|
225
|
+
self: RawTransactionArgument<string>,
|
|
226
|
+
cap: RawTransactionArgument<string>
|
|
227
|
+
];
|
|
228
|
+
}
|
|
229
|
+
/** Verifies that the admin capability matches this release. */
|
|
230
|
+
export declare function authorize(options: AuthorizeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
231
|
+
export interface TitleArguments {
|
|
232
|
+
self: RawTransactionArgument<string>;
|
|
233
|
+
}
|
|
234
|
+
export interface TitleOptions {
|
|
235
|
+
package?: string;
|
|
236
|
+
arguments: TitleArguments | [
|
|
237
|
+
self: RawTransactionArgument<string>
|
|
238
|
+
];
|
|
239
|
+
}
|
|
240
|
+
/** Returns the release title. */
|
|
241
|
+
export declare function title(options: TitleOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
242
|
+
export interface TracksArguments {
|
|
243
|
+
self: RawTransactionArgument<string>;
|
|
244
|
+
}
|
|
245
|
+
export interface TracksOptions {
|
|
246
|
+
package?: string;
|
|
247
|
+
arguments: TracksArguments | [
|
|
248
|
+
self: RawTransactionArgument<string>
|
|
249
|
+
];
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Returns a reference to the ordered tracklist. The single tracklist accessor —
|
|
253
|
+
* consumers derive length, membership, and per-track data from it
|
|
254
|
+
* (`tracks().length()`, `tracks().any!(..)`, indexing).
|
|
255
|
+
*/
|
|
256
|
+
export declare function tracks(options: TracksOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
257
|
+
export interface ReleaseAdminCapReleaseIdArguments {
|
|
258
|
+
cap: RawTransactionArgument<string>;
|
|
259
|
+
}
|
|
260
|
+
export interface ReleaseAdminCapReleaseIdOptions {
|
|
261
|
+
package?: string;
|
|
262
|
+
arguments: ReleaseAdminCapReleaseIdArguments | [
|
|
263
|
+
cap: RawTransactionArgument<string>
|
|
264
|
+
];
|
|
265
|
+
}
|
|
266
|
+
/** Returns the release ID associated with the admin capability. */
|
|
267
|
+
export declare function releaseAdminCapReleaseId(options: ReleaseAdminCapReleaseIdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
268
|
+
export interface UidArguments {
|
|
269
|
+
self: RawTransactionArgument<string>;
|
|
270
|
+
}
|
|
271
|
+
export interface UidOptions {
|
|
272
|
+
package?: string;
|
|
273
|
+
arguments: UidArguments | [
|
|
274
|
+
self: RawTransactionArgument<string>
|
|
275
|
+
];
|
|
276
|
+
}
|
|
277
|
+
/** Returns a reference to the release's UID for reading dynamic fields. */
|
|
278
|
+
export declare function uid(options: UidOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
279
|
+
export interface UidMutArguments {
|
|
280
|
+
self: RawTransactionArgument<string>;
|
|
281
|
+
cap: RawTransactionArgument<string>;
|
|
282
|
+
}
|
|
283
|
+
export interface UidMutOptions {
|
|
284
|
+
package?: string;
|
|
285
|
+
arguments: UidMutArguments | [
|
|
286
|
+
self: RawTransactionArgument<string>,
|
|
287
|
+
cap: RawTransactionArgument<string>
|
|
288
|
+
];
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Returns a mutable reference to the release's UID. Requires the admin capability.
|
|
292
|
+
* Works in any lifecycle state — dynamic fields are the extension surface (e.g.
|
|
293
|
+
* credits) and stay admin-mutable after publish; only the embedded fields are
|
|
294
|
+
* frozen. The reference is root over every dynamic field on the object, including
|
|
295
|
+
* fields attached by other extensions.
|
|
296
|
+
*/
|
|
297
|
+
export declare function uidMut(options: UidMutOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
298
|
+
//# sourceMappingURL=release.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/contracts/musicos/release.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAEH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAA0B,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAGzH,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGtF,oCAAoC;AACpC,eAAO,MAAM,YAAY;IACjB,oDAAoD;;IAEpD,0EAA0E;;+CAE1E,CAAC;AACT,eAAO,MAAM,OAAO;IACZ,0CAA0C;;IAE1C,+BAA+B;;QAR/B,oDAAoD;;QAEpD,0EAA0E;;;IAQ1E,4BAA4B;;IAE5B;;;OAGG;;;;;;;;;;;;;;;;;;;;0CAEH,CAAC;AACT,eAAO,MAAM,eAAe;;kDAEpB,CAAC;AACT,eAAO,MAAM,UAAU;;uDAAwF,CAAC;AAChH,eAAO,MAAM,eAAe;IACpB,6CAA6C;;IAE7C,kDAAkD;;kDAElD,CAAC;AACT,eAAO,MAAM,kBAAkB,kIAAsF,CAAC;AACtH,eAAO,MAAM,q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AAC;KACvC,CAAC;CACL;AACD,2EAA2E;AAC3E,wBAAgB,GAAG,CAAC,OAAO,EAAE,UAAU,QAMvB,WAAW,0DAM1B;AACD,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IACrC,GAAG,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;CACvC;AACD,MAAM,WAAW,aAAa;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,eAAe,GAAG;QACzB,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;QACpC,GAAG,EAAE,sBAAsB,CAAC,MAAM,CAAC;KACtC,CAAC;CACL;AACD;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,aAAa,QAO7B,WAAW,0DAM1B"}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* Represents a music release in musicos. A release is an ordered tracklist with
|
|
6
|
+
* per-track revenue distribution configuration. Cover art lives in the `cover_art`
|
|
7
|
+
* extension, not in core.
|
|
8
|
+
*
|
|
9
|
+
* The tracklist is deliberately FLAT — a `vector<Track>` with no disc structure.
|
|
10
|
+
* Grouping a sequence into discs, vinyl sides, acts, or movements is a property of
|
|
11
|
+
* a distribution medium, not of the release: it has more than one correct
|
|
12
|
+
* rendering, which makes it presentation, and presentation lives in the metadata
|
|
13
|
+
* extension. A consequence worth stating: the stored tracklist and the digest
|
|
14
|
+
* pre-image have the same shape, so what signers consented to is exactly what is
|
|
15
|
+
* stored — nothing structural is chosen after consent except the title.
|
|
16
|
+
*
|
|
17
|
+
* ### Key Features:
|
|
18
|
+
*
|
|
19
|
+
* - Ordered flat tracklist (grouping is presentation, in the metadata extension)
|
|
20
|
+
* - Configurable per-track revenue splits
|
|
21
|
+
* - State machine: Initialized -> Published
|
|
22
|
+
*
|
|
23
|
+
* Attribution (credits, primary/featured artists) is intentionally NOT part of
|
|
24
|
+
* core: it is display-oriented, varies across platforms, and is never read by the
|
|
25
|
+
* economics. It lives in a first-party credits extension attached via `uid_mut`,
|
|
26
|
+
* so core takes no dependency on an identity package and core publish enforces no
|
|
27
|
+
* attribution.
|
|
28
|
+
*
|
|
29
|
+
* The same rule governs naming. Core stores what a thing _is_ — identity and
|
|
30
|
+
* everything the economics read; extensions describe it. The release's `title` is
|
|
31
|
+
* the one embedded name: it is constitutive (naming the package is part of
|
|
32
|
+
* creating it) and freezing it at publish is a buyer-facing guarantee. Edition
|
|
33
|
+
* naming ("Deluxe Edition"), disc titles, localized titles, and DSP-shaped slots
|
|
34
|
+
* all have more than one correct rendering — presentation — and live in the
|
|
35
|
+
* metadata extension.
|
|
36
|
+
*
|
|
37
|
+
* ### Consent scope
|
|
38
|
+
*
|
|
39
|
+
* The release digest — and therefore the derived release id every `Track` commits
|
|
40
|
+
* to at creation — binds the economics and membership of the release: the ordered
|
|
41
|
+
* list of `(recording, split)` pairs and the creator's nonce. It deliberately
|
|
42
|
+
* binds nothing else. The title — the one embedded field outside the digest — and
|
|
43
|
+
* everything in the extension layer (artwork, credits, display grouping) are
|
|
44
|
+
* chosen by the release creator, before or after tracks are created, and are
|
|
45
|
+
* trusted and publicly attributable rather than cryptographically committed. See
|
|
46
|
+
* `track::new` for the signer-side statement of this boundary.
|
|
47
|
+
*
|
|
48
|
+
* The derived id commits to the canonical registry's UID and the digest, not the
|
|
49
|
+
* digest alone — so targeting an id also consents to that namespace's liveness. If
|
|
50
|
+
* that parent were deleted, or its `&mut UID` became permanently unreachable, the
|
|
51
|
+
* release could never exist and every track or offer targeting it would be
|
|
52
|
+
* stranded — the same blast-radius class as a release that simply never publishes.
|
|
53
|
+
* `ReleaseRegistry` is therefore created and shared exactly once at package
|
|
54
|
+
* initialization, and exposes neither a constructor, deletion path, nor mutable
|
|
55
|
+
* UID accessor.
|
|
56
|
+
*
|
|
57
|
+
* ### Lifecycle and trust model
|
|
58
|
+
*
|
|
59
|
+
* A release is `key`-only with no `drop`: a fresh `Initialized` object cannot be
|
|
60
|
+
* transferred, wrapped, publicly shared, or discarded, and its only by-value
|
|
61
|
+
* consumer is `publish`. Create-and-publish is therefore atomic by construction —
|
|
62
|
+
* an `Initialized` release cannot outlive its creating transaction, and every
|
|
63
|
+
* release that exists on-chain is `Published` and shared. There is deliberately no
|
|
64
|
+
* keep function; assembling tracks, discs, and the release must fit one
|
|
65
|
+
* transaction.
|
|
66
|
+
*
|
|
67
|
+
* `uid_mut` works in any lifecycle state and is permanent root over ALL dynamic
|
|
68
|
+
* fields on the object — including fields attached by other extensions. "Immutable
|
|
69
|
+
* after publish" covers the embedded fields only; extension-layer data stays
|
|
70
|
+
* admin-mutable in perpetuity. This is the designed extension surface, and it is
|
|
71
|
+
* the one trust assumption that never expires: integrators should model the cap
|
|
72
|
+
* holder as able to mutate or delete any extension data, forever.
|
|
73
|
+
*/
|
|
74
|
+
import { MoveEnum, MoveStruct, MoveTuple, normalizeMoveArguments } from '../utils/index.js';
|
|
75
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
76
|
+
import {} from '@mysten/sui/transactions';
|
|
77
|
+
import * as track from './track.js';
|
|
78
|
+
const $moduleName = '@local-pkg/musicos::release';
|
|
79
|
+
/** Lifecycle state of a release. */
|
|
80
|
+
export const ReleaseState = new MoveEnum({ name: `${$moduleName}::ReleaseState`, fields: {
|
|
81
|
+
/** Release is initialized but not yet published. */
|
|
82
|
+
Initialized: null,
|
|
83
|
+
/** Release is published and immutable. Includes publication timestamp. */
|
|
84
|
+
Published: bcs.u64()
|
|
85
|
+
} });
|
|
86
|
+
export const Release = new MoveStruct({ name: `${$moduleName}::Release`, fields: {
|
|
87
|
+
/** Unique identifier for this release. */
|
|
88
|
+
id: bcs.Address,
|
|
89
|
+
/** Current lifecycle state. */
|
|
90
|
+
state: ReleaseState,
|
|
91
|
+
/** Title of the release. */
|
|
92
|
+
title: bcs.string(),
|
|
93
|
+
/**
|
|
94
|
+
* The ordered tracklist. Same shape as the digest pre-image every track's creator
|
|
95
|
+
* consented to; display grouping lives in the metadata extension.
|
|
96
|
+
*/
|
|
97
|
+
tracks: bcs.vector(track.Track)
|
|
98
|
+
} });
|
|
99
|
+
export const ReleaseRegistry = new MoveStruct({ name: `${$moduleName}::ReleaseRegistry`, fields: {
|
|
100
|
+
id: bcs.Address
|
|
101
|
+
} });
|
|
102
|
+
export const ReleaseKey = new MoveTuple({ name: `${$moduleName}::ReleaseKey`, fields: [bcs.vector(bcs.u8())] });
|
|
103
|
+
export const ReleaseAdminCap = new MoveStruct({ name: `${$moduleName}::ReleaseAdminCap`, fields: {
|
|
104
|
+
/** Unique identifier for this capability. */
|
|
105
|
+
id: bcs.Address,
|
|
106
|
+
/** ID of the release this capability controls. */
|
|
107
|
+
release_id: bcs.Address
|
|
108
|
+
} });
|
|
109
|
+
export const ReleaseAdminCapKey = new MoveTuple({ name: `${$moduleName}::ReleaseAdminCapKey`, fields: [bcs.bool()] });
|
|
110
|
+
export const ReleasePublishedEvent = new MoveStruct({ name: `${$moduleName}::ReleasePublishedEvent`, fields: {
|
|
111
|
+
release_id: bcs.Address
|
|
112
|
+
} });
|
|
113
|
+
export const ReleaseRegistryCreatedEvent = new MoveStruct({ name: `${$moduleName}::ReleaseRegistryCreatedEvent`, fields: {
|
|
114
|
+
registry_id: bcs.Address,
|
|
115
|
+
created_by: bcs.Address
|
|
116
|
+
} });
|
|
117
|
+
/**
|
|
118
|
+
* Assembles a release under the canonical registry namespace. This is
|
|
119
|
+
* permissionless: consent is carried by the supplied tracks, each of which was
|
|
120
|
+
* created for the exact derived release id. Returns the release and admin
|
|
121
|
+
* capability by value so the caller can compose `publish` and custody in the same
|
|
122
|
+
* PTB.
|
|
123
|
+
*/
|
|
124
|
+
export function _new(options) {
|
|
125
|
+
const packageAddress = options.package ?? '@local-pkg/musicos';
|
|
126
|
+
const argumentsTypes = [
|
|
127
|
+
null,
|
|
128
|
+
'0x1::string::String',
|
|
129
|
+
'vector<null>',
|
|
130
|
+
'u256'
|
|
131
|
+
];
|
|
132
|
+
const parameterNames = ["self", "title", "tracks", "nonce"];
|
|
133
|
+
return (tx) => tx.moveCall({
|
|
134
|
+
package: packageAddress,
|
|
135
|
+
module: 'release',
|
|
136
|
+
function: 'new',
|
|
137
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Derives the release id that `new` would claim under this registry, without
|
|
142
|
+
* creating a release. This immutable shared-object access remains parallelizable
|
|
143
|
+
* for clients preparing tracks.
|
|
144
|
+
*/
|
|
145
|
+
export function deriveTargetReleaseId(options) {
|
|
146
|
+
const packageAddress = options.package ?? '@local-pkg/musicos';
|
|
147
|
+
const argumentsTypes = [
|
|
148
|
+
null,
|
|
149
|
+
'vector<0x2::object::ID>',
|
|
150
|
+
'vector<u64>',
|
|
151
|
+
'u256'
|
|
152
|
+
];
|
|
153
|
+
const parameterNames = ["self", "recordingIds", "trackSplitValues", "nonce"];
|
|
154
|
+
return (tx) => tx.moveCall({
|
|
155
|
+
package: packageAddress,
|
|
156
|
+
module: 'release',
|
|
157
|
+
function: 'derive_target_release_id',
|
|
158
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Returns the canonical registry's object ID, which is the derivation parent
|
|
163
|
+
* committed to by `new` and `derive_target_release_id`. Exported as the
|
|
164
|
+
* `ReleaseRegistry.id()` method to avoid colliding with the existing
|
|
165
|
+
* `release::id(&Release)` ABI function.
|
|
166
|
+
*/
|
|
167
|
+
export function releaseRegistryId(options) {
|
|
168
|
+
const packageAddress = options.package ?? '@local-pkg/musicos';
|
|
169
|
+
const argumentsTypes = [
|
|
170
|
+
null
|
|
171
|
+
];
|
|
172
|
+
const parameterNames = ["self"];
|
|
173
|
+
return (tx) => tx.moveCall({
|
|
174
|
+
package: packageAddress,
|
|
175
|
+
module: 'release',
|
|
176
|
+
function: 'release_registry_id',
|
|
177
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Publishes the release, making it immutable. Track splits must be set and sum to
|
|
182
|
+
* 100% before publishing. Required State: Initialized
|
|
183
|
+
*
|
|
184
|
+
* Note: core enforces no attribution requirement — credits live in the credits
|
|
185
|
+
* extension and may be attached before or after publish via `uid_mut`.
|
|
186
|
+
*/
|
|
187
|
+
export function publish(options) {
|
|
188
|
+
const packageAddress = options.package ?? '@local-pkg/musicos';
|
|
189
|
+
const argumentsTypes = [
|
|
190
|
+
null,
|
|
191
|
+
null,
|
|
192
|
+
'0x2::clock::Clock'
|
|
193
|
+
];
|
|
194
|
+
const parameterNames = ["self", "cap"];
|
|
195
|
+
return (tx) => tx.moveCall({
|
|
196
|
+
package: packageAddress,
|
|
197
|
+
module: 'release',
|
|
198
|
+
function: 'publish',
|
|
199
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
/** Verifies that the admin capability matches this release. */
|
|
203
|
+
export function authorize(options) {
|
|
204
|
+
const packageAddress = options.package ?? '@local-pkg/musicos';
|
|
205
|
+
const argumentsTypes = [
|
|
206
|
+
null,
|
|
207
|
+
null
|
|
208
|
+
];
|
|
209
|
+
const parameterNames = ["self", "cap"];
|
|
210
|
+
return (tx) => tx.moveCall({
|
|
211
|
+
package: packageAddress,
|
|
212
|
+
module: 'release',
|
|
213
|
+
function: 'authorize',
|
|
214
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
/** Returns the release title. */
|
|
218
|
+
export function title(options) {
|
|
219
|
+
const packageAddress = options.package ?? '@local-pkg/musicos';
|
|
220
|
+
const argumentsTypes = [
|
|
221
|
+
null
|
|
222
|
+
];
|
|
223
|
+
const parameterNames = ["self"];
|
|
224
|
+
return (tx) => tx.moveCall({
|
|
225
|
+
package: packageAddress,
|
|
226
|
+
module: 'release',
|
|
227
|
+
function: 'title',
|
|
228
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Returns a reference to the ordered tracklist. The single tracklist accessor —
|
|
233
|
+
* consumers derive length, membership, and per-track data from it
|
|
234
|
+
* (`tracks().length()`, `tracks().any!(..)`, indexing).
|
|
235
|
+
*/
|
|
236
|
+
export function tracks(options) {
|
|
237
|
+
const packageAddress = options.package ?? '@local-pkg/musicos';
|
|
238
|
+
const argumentsTypes = [
|
|
239
|
+
null
|
|
240
|
+
];
|
|
241
|
+
const parameterNames = ["self"];
|
|
242
|
+
return (tx) => tx.moveCall({
|
|
243
|
+
package: packageAddress,
|
|
244
|
+
module: 'release',
|
|
245
|
+
function: 'tracks',
|
|
246
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
/** Returns the release ID associated with the admin capability. */
|
|
250
|
+
export function releaseAdminCapReleaseId(options) {
|
|
251
|
+
const packageAddress = options.package ?? '@local-pkg/musicos';
|
|
252
|
+
const argumentsTypes = [
|
|
253
|
+
null
|
|
254
|
+
];
|
|
255
|
+
const parameterNames = ["cap"];
|
|
256
|
+
return (tx) => tx.moveCall({
|
|
257
|
+
package: packageAddress,
|
|
258
|
+
module: 'release',
|
|
259
|
+
function: 'release_admin_cap_release_id',
|
|
260
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
/** Returns a reference to the release's UID for reading dynamic fields. */
|
|
264
|
+
export function uid(options) {
|
|
265
|
+
const packageAddress = options.package ?? '@local-pkg/musicos';
|
|
266
|
+
const argumentsTypes = [
|
|
267
|
+
null
|
|
268
|
+
];
|
|
269
|
+
const parameterNames = ["self"];
|
|
270
|
+
return (tx) => tx.moveCall({
|
|
271
|
+
package: packageAddress,
|
|
272
|
+
module: 'release',
|
|
273
|
+
function: 'uid',
|
|
274
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Returns a mutable reference to the release's UID. Requires the admin capability.
|
|
279
|
+
* Works in any lifecycle state — dynamic fields are the extension surface (e.g.
|
|
280
|
+
* credits) and stay admin-mutable after publish; only the embedded fields are
|
|
281
|
+
* frozen. The reference is root over every dynamic field on the object, including
|
|
282
|
+
* fields attached by other extensions.
|
|
283
|
+
*/
|
|
284
|
+
export function uidMut(options) {
|
|
285
|
+
const packageAddress = options.package ?? '@local-pkg/musicos';
|
|
286
|
+
const argumentsTypes = [
|
|
287
|
+
null,
|
|
288
|
+
null
|
|
289
|
+
];
|
|
290
|
+
const parameterNames = ["self", "cap"];
|
|
291
|
+
return (tx) => tx.moveCall({
|
|
292
|
+
package: packageAddress,
|
|
293
|
+
module: 'release',
|
|
294
|
+
function: 'uid_mut',
|
|
295
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
//# sourceMappingURL=release.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release.js","sourceRoot":"","sources":["../../../src/contracts/musicos/release.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAEH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,sBAAsB,EAA+B,MAAM,mBAAmB,CAAC;AACz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