@misonetwork/sdk 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 +644 -0
- package/dist/client.d.ts +197 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +218 -0
- package/dist/client.js.map +1 -0
- package/dist/contracts/composition_credits/composition_credits.d.ts +181 -0
- package/dist/contracts/composition_credits/composition_credits.d.ts.map +1 -0
- package/dist/contracts/composition_credits/composition_credits.js +109 -0
- package/dist/contracts/composition_credits/composition_credits.js.map +1 -0
- package/dist/contracts/composition_credits/composition_party_role.d.ts +119 -0
- package/dist/contracts/composition_credits/composition_party_role.d.ts.map +1 -0
- package/dist/contracts/composition_credits/composition_party_role.js +139 -0
- package/dist/contracts/composition_credits/composition_party_role.js.map +1 -0
- package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts +24 -0
- package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts.map +1 -0
- package/dist/contracts/composition_credits/deps/miso_credit/credit.js +23 -0
- package/dist/contracts/composition_credits/deps/miso_credit/credit.js.map +1 -0
- package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/composition_credits/deps/sui/vec_map.js +28 -0
- package/dist/contracts/composition_credits/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +87 -0
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +1 -0
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +80 -0
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +1 -0
- package/dist/contracts/cover_art/cover_art.d.ts +85 -0
- package/dist/contracts/cover_art/cover_art.d.ts.map +1 -0
- package/dist/contracts/cover_art/cover_art.js +68 -0
- package/dist/contracts/cover_art/cover_art.js.map +1 -0
- package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts +52 -0
- package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts.map +1 -0
- package/dist/contracts/cover_art/deps/ori/walrus_data.js +37 -0
- package/dist/contracts/cover_art/deps/ori/walrus_data.js.map +1 -0
- package/dist/contracts/miso/composition.d.ts +231 -0
- package/dist/contracts/miso/composition.d.ts.map +1 -0
- package/dist/contracts/miso/composition.js +231 -0
- package/dist/contracts/miso/composition.js.map +1 -0
- package/dist/contracts/miso/deal.d.ts +184 -0
- package/dist/contracts/miso/deal.d.ts.map +1 -0
- package/dist/contracts/miso/deal.js +184 -0
- package/dist/contracts/miso/deal.js.map +1 -0
- package/dist/contracts/miso/deps/bps/bps.d.ts +19 -0
- package/dist/contracts/miso/deps/bps/bps.d.ts.map +1 -0
- package/dist/contracts/miso/deps/bps/bps.js +21 -0
- package/dist/contracts/miso/deps/bps/bps.js.map +1 -0
- package/dist/contracts/miso/recording.d.ts +228 -0
- package/dist/contracts/miso/recording.d.ts.map +1 -0
- package/dist/contracts/miso/recording.js +221 -0
- package/dist/contracts/miso/recording.js.map +1 -0
- package/dist/contracts/miso/release.d.ts +280 -0
- package/dist/contracts/miso/release.d.ts.map +1 -0
- package/dist/contracts/miso/release.js +282 -0
- package/dist/contracts/miso/release.js.map +1 -0
- package/dist/contracts/miso/track.d.ts +118 -0
- package/dist/contracts/miso/track.d.ts.map +1 -0
- package/dist/contracts/miso/track.js +118 -0
- package/dist/contracts/miso/track.js.map +1 -0
- package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts +24 -0
- package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts.map +1 -0
- package/dist/contracts/recording_credits/deps/miso_credit/credit.js +23 -0
- package/dist/contracts/recording_credits/deps/miso_credit/credit.js.map +1 -0
- package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/recording_credits/deps/sui/vec_map.js +28 -0
- package/dist/contracts/recording_credits/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts +21 -0
- package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts.map +1 -0
- package/dist/contracts/recording_credits/deps/sui/vec_set.js +20 -0
- package/dist/contracts/recording_credits/deps/sui/vec_set.js.map +1 -0
- package/dist/contracts/recording_credits/recording_credits.d.ts +2313 -0
- package/dist/contracts/recording_credits/recording_credits.d.ts.map +1 -0
- package/dist/contracts/recording_credits/recording_credits.js +270 -0
- package/dist/contracts/recording_credits/recording_credits.js.map +1 -0
- package/dist/contracts/recording_credits/recording_party_role.d.ts +1174 -0
- package/dist/contracts/recording_credits/recording_party_role.d.ts.map +1 -0
- package/dist/contracts/recording_credits/recording_party_role.js +692 -0
- package/dist/contracts/recording_credits/recording_party_role.js.map +1 -0
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +90 -0
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +1 -0
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +80 -0
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +1 -0
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts +52 -0
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts.map +1 -0
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js +37 -0
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js.map +1 -0
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts +46 -0
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts.map +1 -0
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js +21 -0
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js.map +1 -0
- package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts +33 -0
- package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts.map +1 -0
- package/dist/contracts/release_cover_art/deps/per_track/per_track.js +32 -0
- package/dist/contracts/release_cover_art/deps/per_track/per_track.js.map +1 -0
- package/dist/contracts/release_cover_art/release_cover_art.d.ts +300 -0
- package/dist/contracts/release_cover_art/release_cover_art.d.ts.map +1 -0
- package/dist/contracts/release_cover_art/release_cover_art.js +168 -0
- package/dist/contracts/release_cover_art/release_cover_art.js.map +1 -0
- package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts +24 -0
- package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts.map +1 -0
- package/dist/contracts/release_credits/deps/miso_credit/credit.js +23 -0
- package/dist/contracts/release_credits/deps/miso_credit/credit.js.map +1 -0
- package/dist/contracts/release_credits/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/release_credits/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/release_credits/deps/sui/vec_map.js +28 -0
- package/dist/contracts/release_credits/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/release_credits/release_credits.d.ts +142 -0
- package/dist/contracts/release_credits/release_credits.d.ts.map +1 -0
- package/dist/contracts/release_credits/release_credits.js +108 -0
- package/dist/contracts/release_credits/release_credits.js.map +1 -0
- package/dist/contracts/release_credits/release_party_role.d.ts +58 -0
- package/dist/contracts/release_credits/release_party_role.d.ts.map +1 -0
- package/dist/contracts/release_credits/release_party_role.js +66 -0
- package/dist/contracts/release_credits/release_party_role.js.map +1 -0
- package/dist/contracts/royalty_pool/deps/std/type_name.d.ts +18 -0
- package/dist/contracts/royalty_pool/deps/std/type_name.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/deps/std/type_name.js +20 -0
- package/dist/contracts/royalty_pool/deps/std/type_name.js.map +1 -0
- package/dist/contracts/royalty_pool/deps/sui/balance.d.ts +13 -0
- package/dist/contracts/royalty_pool/deps/sui/balance.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/deps/sui/balance.js +15 -0
- package/dist/contracts/royalty_pool/deps/sui/balance.js.map +1 -0
- package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/deps/sui/vec_map.js +28 -0
- package/dist/contracts/royalty_pool/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/royalty_pool/pool.d.ts +358 -0
- package/dist/contracts/royalty_pool/pool.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/pool.js +352 -0
- package/dist/contracts/royalty_pool/pool.js.map +1 -0
- package/dist/contracts/royalty_pool/stake.d.ts +202 -0
- package/dist/contracts/royalty_pool/stake.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/stake.js +197 -0
- package/dist/contracts/royalty_pool/stake.js.map +1 -0
- package/dist/contracts/utils/index.d.ts +31 -0
- package/dist/contracts/utils/index.d.ts.map +1 -0
- package/dist/contracts/utils/index.js +162 -0
- package/dist/contracts/utils/index.js.map +1 -0
- package/dist/contracts.d.ts +18 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +26 -0
- package/dist/contracts.js.map +1 -0
- package/dist/cover.d.ts +48 -0
- package/dist/cover.d.ts.map +1 -0
- package/dist/cover.js +68 -0
- package/dist/cover.js.map +1 -0
- package/dist/credits.d.ts +171 -0
- package/dist/credits.d.ts.map +1 -0
- package/dist/credits.js +360 -0
- package/dist/credits.js.map +1 -0
- package/dist/execute.d.ts +49 -0
- package/dist/execute.d.ts.map +1 -0
- package/dist/execute.js +114 -0
- package/dist/execute.js.map +1 -0
- package/dist/extensions/royalty-pool.d.ts +32 -0
- package/dist/extensions/royalty-pool.d.ts.map +1 -0
- package/dist/extensions/royalty-pool.js +33 -0
- package/dist/extensions/royalty-pool.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/internal.d.ts +20 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +48 -0
- package/dist/internal.js.map +1 -0
- package/dist/parsers.d.ts +9 -0
- package/dist/parsers.d.ts.map +1 -0
- package/dist/parsers.js +52 -0
- package/dist/parsers.js.map +1 -0
- package/dist/queries.d.ts +105 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +380 -0
- package/dist/queries.js.map +1 -0
- package/dist/schemas.d.ts +99 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +76 -0
- package/dist/schemas.js.map +1 -0
- package/dist/transactions.d.ts +158 -0
- package/dist/transactions.d.ts.map +1 -0
- package/dist/transactions.js +154 -0
- package/dist/transactions.js.map +1 -0
- package/dist/types.d.ts +204 -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 +21 -0
- package/dist/view.d.ts.map +1 -0
- package/dist/view.js +36 -0
- package/dist/view.js.map +1 -0
- package/package.json +111 -0
- package/src/client.ts +278 -0
- package/src/contracts/composition_credits/composition_credits.ts +169 -0
- package/src/contracts/composition_credits/composition_party_role.ts +189 -0
- package/src/contracts/composition_credits/deps/miso_credit/credit.ts +27 -0
- package/src/contracts/composition_credits/deps/sui/vec_map.ts +33 -0
- package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +135 -0
- package/src/contracts/cover_art/cover_art.ts +99 -0
- package/src/contracts/cover_art/deps/ori/walrus_data.ts +36 -0
- package/src/contracts/miso/composition.ts +343 -0
- package/src/contracts/miso/deal.ts +257 -0
- package/src/contracts/miso/deps/bps/bps.ts +23 -0
- package/src/contracts/miso/recording.ts +298 -0
- package/src/contracts/miso/release.ts +392 -0
- package/src/contracts/miso/track.ts +153 -0
- package/src/contracts/recording_credits/deps/miso_credit/credit.ts +27 -0
- package/src/contracts/recording_credits/deps/sui/vec_map.ts +33 -0
- package/src/contracts/recording_credits/deps/sui/vec_set.ts +21 -0
- package/src/contracts/recording_credits/recording_credits.ts +458 -0
- package/src/contracts/recording_credits/recording_party_role.ts +1041 -0
- package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +138 -0
- package/src/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.ts +36 -0
- package/src/contracts/release_cover_art/deps/cover_art/cover_art.ts +23 -0
- package/src/contracts/release_cover_art/deps/per_track/per_track.ts +36 -0
- package/src/contracts/release_cover_art/release_cover_art.ts +251 -0
- package/src/contracts/release_credits/deps/miso_credit/credit.ts +27 -0
- package/src/contracts/release_credits/deps/sui/vec_map.ts +33 -0
- package/src/contracts/release_credits/release_credits.ts +156 -0
- package/src/contracts/release_credits/release_party_role.ts +87 -0
- package/src/contracts/royalty_pool/deps/std/type_name.ts +22 -0
- package/src/contracts/royalty_pool/deps/sui/balance.ts +17 -0
- package/src/contracts/royalty_pool/deps/sui/vec_map.ts +33 -0
- package/src/contracts/royalty_pool/pool.ts +577 -0
- package/src/contracts/royalty_pool/stake.ts +317 -0
- package/src/contracts/utils/index.ts +229 -0
- package/src/contracts.ts +30 -0
- package/src/cover.ts +136 -0
- package/src/credits.ts +645 -0
- package/src/execute.ts +141 -0
- package/src/extensions/royalty-pool.ts +85 -0
- package/src/index.ts +17 -0
- package/src/internal.ts +85 -0
- package/src/parsers.ts +80 -0
- package/src/queries.ts +478 -0
- package/src/schemas.ts +96 -0
- package/src/transactions.ts +290 -0
- package/src/types.ts +244 -0
- package/src/view.ts +59 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* Represents a musical composition (song, instrumental work) in Miso. Compositions
|
|
6
|
+
* are the underlying written works that recordings are based on. Each composition
|
|
7
|
+
* has its own share token for ownership distribution.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features:
|
|
10
|
+
*
|
|
11
|
+
* - Share token initialization with fixed supply (10M tokens, 6 decimals)
|
|
12
|
+
* - State machine: Initialized -> Published (embedded fields immutable after
|
|
13
|
+
* publish; dynamic fields remain extensible via `uid_mut`)
|
|
14
|
+
* - Deterministic addresses via derived object pattern
|
|
15
|
+
*
|
|
16
|
+
* Attribution (credits) is intentionally NOT part of core: it is display-oriented,
|
|
17
|
+
* varies across platforms, and is never read by the economics. It lives in a
|
|
18
|
+
* first-party credits extension attached via `uid_mut`, so core takes no
|
|
19
|
+
* dependency on an identity package and core publish enforces no attribution.
|
|
20
|
+
*
|
|
21
|
+
* ### Lifecycle and trust model
|
|
22
|
+
*
|
|
23
|
+
* A composition is `key`-only with no `drop`: a fresh `Initialized` object cannot
|
|
24
|
+
* be transferred, wrapped, publicly shared, or discarded, and its only by-value
|
|
25
|
+
* consumer is `publish`. Create-and-publish is therefore atomic by construction —
|
|
26
|
+
* an `Initialized` composition cannot outlive its creating transaction, and every
|
|
27
|
+
* composition that exists on-chain is `Published` and shared. There is
|
|
28
|
+
* deliberately no keep function; staged building must fit one transaction.
|
|
29
|
+
*
|
|
30
|
+
* `uid_mut` works in any lifecycle state and is permanent root over ALL dynamic
|
|
31
|
+
* fields on the object — including fields attached by other extensions. "Immutable
|
|
32
|
+
* after publish" covers the embedded fields only; extension-layer data stays
|
|
33
|
+
* admin-mutable in perpetuity. This is the designed extension surface, and it is
|
|
34
|
+
* the one trust assumption that never expires: integrators should model the cap
|
|
35
|
+
* holder as able to mutate or delete any extension data, forever.
|
|
36
|
+
*/
|
|
37
|
+
import { MoveEnum, MoveStruct, MoveTuple, normalizeMoveArguments } from '../utils/index.js';
|
|
38
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
39
|
+
import {} from '@mysten/sui/transactions';
|
|
40
|
+
import * as bps from './deps/bps/bps.js';
|
|
41
|
+
const $moduleName = '@local-pkg/miso::composition';
|
|
42
|
+
/** Lifecycle state of a composition. */
|
|
43
|
+
export const CompositionState = new MoveEnum({ name: `${$moduleName}::CompositionState`, fields: {
|
|
44
|
+
/** Composition is initialized but not published. */
|
|
45
|
+
Initialized: null,
|
|
46
|
+
/** Composition is published and immutable. Includes publication timestamp. */
|
|
47
|
+
Published: bcs.u64()
|
|
48
|
+
} });
|
|
49
|
+
export const Composition = new MoveStruct({ name: `${$moduleName}::Composition<phantom CompositionShare>`, fields: {
|
|
50
|
+
/** Unique identifier for this composition. */
|
|
51
|
+
id: bcs.Address,
|
|
52
|
+
/** Current lifecycle state. */
|
|
53
|
+
state: CompositionState,
|
|
54
|
+
/** Primary title of the composition. */
|
|
55
|
+
title: bcs.string(),
|
|
56
|
+
/** Royalty rate this composition earns from each recording's revenue. */
|
|
57
|
+
royalty_rate: bps.BPS
|
|
58
|
+
} });
|
|
59
|
+
export const CompositionAdminCap = new MoveStruct({ name: `${$moduleName}::CompositionAdminCap<phantom CompositionShare>`, fields: {
|
|
60
|
+
/** Unique identifier for this capability. */
|
|
61
|
+
id: bcs.Address
|
|
62
|
+
} });
|
|
63
|
+
export const CompositionAdminCapKey = new MoveTuple({ name: `${$moduleName}::CompositionAdminCapKey`, fields: [bcs.bool()] });
|
|
64
|
+
export const CompositionPublishedEvent = new MoveStruct({ name: `${$moduleName}::CompositionPublishedEvent<phantom CompositionShare>`, fields: {
|
|
65
|
+
composition_id: bcs.Address
|
|
66
|
+
} });
|
|
67
|
+
export const CompositionRoyaltySetEvent = new MoveStruct({ name: `${$moduleName}::CompositionRoyaltySetEvent<phantom CompositionShare>`, fields: {
|
|
68
|
+
composition_id: bcs.Address,
|
|
69
|
+
previous_royalty_rate_bps: bcs.u16(),
|
|
70
|
+
royalty_rate_bps: bcs.u16(),
|
|
71
|
+
changed_by: bcs.Address
|
|
72
|
+
} });
|
|
73
|
+
/**
|
|
74
|
+
* Creates a new composition with the given title and royalty rate. The royalty
|
|
75
|
+
* rate must not exceed `MAX_ROYALTY_RATE_BPS`; there is no floor, so 0% is
|
|
76
|
+
* permitted (e.g. a generative recording with no authored composition).
|
|
77
|
+
* Initializes share tokens (10M supply, 6 decimals) and returns:
|
|
78
|
+
*
|
|
79
|
+
* - The composition object
|
|
80
|
+
* - Admin capability for the owner
|
|
81
|
+
* - Initial share token balance
|
|
82
|
+
*/
|
|
83
|
+
export function _new(options) {
|
|
84
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
85
|
+
const argumentsTypes = [
|
|
86
|
+
'0x1::string::String',
|
|
87
|
+
'u16',
|
|
88
|
+
null,
|
|
89
|
+
null
|
|
90
|
+
];
|
|
91
|
+
const parameterNames = ["title", "royaltyRateBps", "shareCurrency", "shareTreasuryCap"];
|
|
92
|
+
return (tx) => tx.moveCall({
|
|
93
|
+
package: packageAddress,
|
|
94
|
+
module: 'composition',
|
|
95
|
+
function: 'new',
|
|
96
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
97
|
+
typeArguments: options.typeArguments
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Publishes the composition, making its embedded fields immutable. Required State:
|
|
102
|
+
* Initialized
|
|
103
|
+
*
|
|
104
|
+
* Note: core enforces no attribution requirement — credits live in the credits
|
|
105
|
+
* extension and may be attached before or after publish via `uid_mut`.
|
|
106
|
+
*/
|
|
107
|
+
export function publish(options) {
|
|
108
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
109
|
+
const argumentsTypes = [
|
|
110
|
+
null,
|
|
111
|
+
null,
|
|
112
|
+
'0x2::clock::Clock'
|
|
113
|
+
];
|
|
114
|
+
const parameterNames = ["self", "_"];
|
|
115
|
+
return (tx) => tx.moveCall({
|
|
116
|
+
package: packageAddress,
|
|
117
|
+
module: 'composition',
|
|
118
|
+
function: 'publish',
|
|
119
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
120
|
+
typeArguments: options.typeArguments
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Sets the royalty rate this composition earns from each recording. Must not
|
|
125
|
+
* exceed `MAX_ROYALTY_RATE_BPS` (there is no floor; 0% is allowed). The rate can
|
|
126
|
+
* be changed in any lifecycle state, including after publishing, and takes effect
|
|
127
|
+
* immediately. There is deliberately no rate-change cooldown: a change cannot
|
|
128
|
+
* surprise anyone, because each recording snapshots the rate when it is created
|
|
129
|
+
* (existing recordings keep the rate they captured) and `recording::new`'s
|
|
130
|
+
* `max_royalty_rate_bps` slippage guard means no future recorder can be charged a
|
|
131
|
+
* rate they did not consent to.
|
|
132
|
+
*/
|
|
133
|
+
export function setRoyaltyRate(options) {
|
|
134
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
135
|
+
const argumentsTypes = [
|
|
136
|
+
null,
|
|
137
|
+
null,
|
|
138
|
+
'u16'
|
|
139
|
+
];
|
|
140
|
+
const parameterNames = ["self", "_", "royaltyRateBps"];
|
|
141
|
+
return (tx) => tx.moveCall({
|
|
142
|
+
package: packageAddress,
|
|
143
|
+
module: 'composition',
|
|
144
|
+
function: 'set_royalty_rate',
|
|
145
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
146
|
+
typeArguments: options.typeArguments
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
/** Returns the composition's object ID. */
|
|
150
|
+
export function id(options) {
|
|
151
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
152
|
+
const argumentsTypes = [
|
|
153
|
+
null
|
|
154
|
+
];
|
|
155
|
+
const parameterNames = ["self"];
|
|
156
|
+
return (tx) => tx.moveCall({
|
|
157
|
+
package: packageAddress,
|
|
158
|
+
module: 'composition',
|
|
159
|
+
function: 'id',
|
|
160
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
161
|
+
typeArguments: options.typeArguments
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
/** Returns the primary title. */
|
|
165
|
+
export function title(options) {
|
|
166
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
167
|
+
const argumentsTypes = [
|
|
168
|
+
null
|
|
169
|
+
];
|
|
170
|
+
const parameterNames = ["self"];
|
|
171
|
+
return (tx) => tx.moveCall({
|
|
172
|
+
package: packageAddress,
|
|
173
|
+
module: 'composition',
|
|
174
|
+
function: 'title',
|
|
175
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
176
|
+
typeArguments: options.typeArguments
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
/** Returns the royalty rate this composition earns from each recording. */
|
|
180
|
+
export function royaltyRate(options) {
|
|
181
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
182
|
+
const argumentsTypes = [
|
|
183
|
+
null
|
|
184
|
+
];
|
|
185
|
+
const parameterNames = ["self"];
|
|
186
|
+
return (tx) => tx.moveCall({
|
|
187
|
+
package: packageAddress,
|
|
188
|
+
module: 'composition',
|
|
189
|
+
function: 'royalty_rate',
|
|
190
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
191
|
+
typeArguments: options.typeArguments
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
/** Returns a reference to the composition's UID for reading dynamic fields. */
|
|
195
|
+
export function uid(options) {
|
|
196
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
197
|
+
const argumentsTypes = [
|
|
198
|
+
null
|
|
199
|
+
];
|
|
200
|
+
const parameterNames = ["self"];
|
|
201
|
+
return (tx) => tx.moveCall({
|
|
202
|
+
package: packageAddress,
|
|
203
|
+
module: 'composition',
|
|
204
|
+
function: 'uid',
|
|
205
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
206
|
+
typeArguments: options.typeArguments
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Returns a mutable reference to the composition's UID. Requires the admin
|
|
211
|
+
* capability. Works in any lifecycle state — dynamic fields are the extension
|
|
212
|
+
* surface and stay admin-mutable after publish; only the embedded fields are
|
|
213
|
+
* frozen. The reference is root over every dynamic field on the object, including
|
|
214
|
+
* fields attached by other extensions.
|
|
215
|
+
*/
|
|
216
|
+
export function uidMut(options) {
|
|
217
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
218
|
+
const argumentsTypes = [
|
|
219
|
+
null,
|
|
220
|
+
null
|
|
221
|
+
];
|
|
222
|
+
const parameterNames = ["self", "_"];
|
|
223
|
+
return (tx) => tx.moveCall({
|
|
224
|
+
package: packageAddress,
|
|
225
|
+
module: 'composition',
|
|
226
|
+
function: 'uid_mut',
|
|
227
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
228
|
+
typeArguments: options.typeArguments
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=composition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composition.js","sourceRoot":"","sources":["../../../src/contracts/miso/composition.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,sBAAsB,EAA+B,MAAM,mBAAmB,CAAC;AACzH,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAoB,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,MAAM,WAAW,GAAG,8BAA8B,CAAC;AACnD,wCAAwC;AACxC,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,QAAQ,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,oBAAoB,EAAE,MAAM,EAAE;QACzF,oDAAoD;QACpD,WAAW,EAAE,IAAI;QACjB,8EAA8E;QAC9E,SAAS,EAAE,GAAG,CAAC,GAAG,EAAE;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C,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,IAAI,iBAAiB,CAAC;IAC5D,MAAM,cAAc,GAAG;QACnB,IAAI;QACJ,IAAI;KACqB,CAAC;IAC9B,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,OAAO,CAAC,EAAe,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,aAAa;QACrB,QAAQ,EAAE,SAAS;QACnB,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;QACpF,aAAa,EAAE,OAAO,CAAC,aAAa;KACvC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* Represents a deal authorizing a recording to be included in a release. Deals are
|
|
6
|
+
* created by recording owners to grant permission for their recordings to appear
|
|
7
|
+
* on specific releases with agreed-upon revenue splits.
|
|
8
|
+
*
|
|
9
|
+
* ### Flow:
|
|
10
|
+
*
|
|
11
|
+
* - A recording owner creates a `Deal` specifying the target release and track
|
|
12
|
+
* split.
|
|
13
|
+
* - The deal is consumed by `track::new` to create a track, transferring the
|
|
14
|
+
* recording's authorization into the release.
|
|
15
|
+
* - Deals can be destroyed if no longer needed.
|
|
16
|
+
*
|
|
17
|
+
* `Deal<RecordingShare, CompositionShare>` carries the recording's and
|
|
18
|
+
* composition's identities as phantom type parameters rather than stored values —
|
|
19
|
+
* a `Deal` is consumed one-to-one into a `Track` and is never collected, so it has
|
|
20
|
+
* no reason to flatten to `TypeName`s early. The recording↔composition pairing is
|
|
21
|
+
* type-enforced at `new` via the `Recording<RecordingShare, CompositionShare>`
|
|
22
|
+
* argument — no ID is stored and no runtime assert is needed.
|
|
23
|
+
*
|
|
24
|
+
* A deal stores only what is genuinely release-specific and not carried by the
|
|
25
|
+
* type parameters: the target `release_id` and the `track_split_bps`. The
|
|
26
|
+
* recording is identified by the phantom, so no `recording_id` is stored —
|
|
27
|
+
* `track::new` reads the recording's address from the matching `Recording` it is
|
|
28
|
+
* handed (the phantoms force it to be the right one). Display metadata (title,
|
|
29
|
+
* cover art) is _not_ duplicated here — it is derived from the recording.
|
|
30
|
+
*/
|
|
31
|
+
import { MoveStruct, type RawTransactionArgument } from '../utils/index.js';
|
|
32
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
33
|
+
export declare const Deal: MoveStruct<{
|
|
34
|
+
/** Unique identifier for this deal. */
|
|
35
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
36
|
+
/** ID of the target release this deal authorizes. */
|
|
37
|
+
release_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
38
|
+
/** Revenue split allocated to this track in basis points. */
|
|
39
|
+
track_split_bps: import("../utils/index.js").MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<number, number, "u16">], "bps::bps::BPS">;
|
|
40
|
+
}, "@local-pkg/miso::deal::Deal<phantom RecordingShare, phantom CompositionShare>">;
|
|
41
|
+
export declare const DealCreatedEvent: MoveStruct<{
|
|
42
|
+
/** ID of the deal. */
|
|
43
|
+
deal_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
44
|
+
/** ID of the recording whose inclusion is authorized. */
|
|
45
|
+
recording_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
46
|
+
/** ID of the target release. */
|
|
47
|
+
release_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
48
|
+
/** Track-level revenue split in basis points. */
|
|
49
|
+
track_split_bps_value: import("@mysten/sui/bcs").BcsType<number, number, "u16">;
|
|
50
|
+
created_by: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
51
|
+
}, "@local-pkg/miso::deal::DealCreatedEvent<phantom RecordingShare, phantom CompositionShare>">;
|
|
52
|
+
export declare const DealAcceptedEvent: MoveStruct<{
|
|
53
|
+
/** ID of the deal. */
|
|
54
|
+
deal_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
55
|
+
/** ID of the target release. */
|
|
56
|
+
release_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
57
|
+
}, "@local-pkg/miso::deal::DealAcceptedEvent<phantom RecordingShare, phantom CompositionShare>">;
|
|
58
|
+
export declare const DealRejectedEvent: MoveStruct<{
|
|
59
|
+
/** ID of the deal. */
|
|
60
|
+
deal_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
61
|
+
/** ID of the target release. */
|
|
62
|
+
release_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
63
|
+
}, "@local-pkg/miso::deal::DealRejectedEvent<phantom RecordingShare, phantom CompositionShare>">;
|
|
64
|
+
export interface NewArguments {
|
|
65
|
+
_: RawTransactionArgument<string>;
|
|
66
|
+
recording: RawTransactionArgument<string>;
|
|
67
|
+
releaseId: RawTransactionArgument<string>;
|
|
68
|
+
trackSplitBpsValue: RawTransactionArgument<number>;
|
|
69
|
+
}
|
|
70
|
+
export interface NewOptions {
|
|
71
|
+
package?: string;
|
|
72
|
+
arguments: NewArguments | [
|
|
73
|
+
_: RawTransactionArgument<string>,
|
|
74
|
+
recording: RawTransactionArgument<string>,
|
|
75
|
+
releaseId: RawTransactionArgument<string>,
|
|
76
|
+
trackSplitBpsValue: RawTransactionArgument<number>
|
|
77
|
+
];
|
|
78
|
+
typeArguments: [
|
|
79
|
+
string,
|
|
80
|
+
string
|
|
81
|
+
];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Creates a new deal authorizing a recording for inclusion in a release. Requires
|
|
85
|
+
* the recording admin capability.
|
|
86
|
+
*
|
|
87
|
+
* The composition is identified by the recording's `CompositionShare` phantom, so
|
|
88
|
+
* the recording↔composition pairing is compile-time enforced — there is no
|
|
89
|
+
* `Composition` argument and no runtime ID check.
|
|
90
|
+
*
|
|
91
|
+
* ### What signing a deal consents to
|
|
92
|
+
*
|
|
93
|
+
* `release_id` is derived from the release digest, so targeting it consents to
|
|
94
|
+
* that release's exact economics and membership: the ordered list of
|
|
95
|
+
* `(recording, split)` pairs and the creator's nonce, nothing more. The release's
|
|
96
|
+
* title, artwork, credits, and display grouping are chosen by the release creator
|
|
97
|
+
* — before or after this deal is signed — and are not bound by the digest.
|
|
98
|
+
* Presentation is trusted and publicly attributable, not cryptographically
|
|
99
|
+
* committed.
|
|
100
|
+
*
|
|
101
|
+
* The recording need not be `Published`: its admin can strike deals inside the
|
|
102
|
+
* recording's own creating transaction (an `Initialized` recording cannot escape
|
|
103
|
+
* that transaction, so across transactions deals always reference `Published`,
|
|
104
|
+
* shared recordings).
|
|
105
|
+
*
|
|
106
|
+
* ### A transferred deal is out of its creator's hands
|
|
107
|
+
*
|
|
108
|
+
* A deal has no expiry and cannot be withdrawn by its creator: only the holder can
|
|
109
|
+
* `reject` it, or accept it — at any future time — into exactly the consented
|
|
110
|
+
* release via `track::new`. The digest binding confines a stale deal's blast
|
|
111
|
+
* radius to that one release. Acceptance is itself provisional until the release
|
|
112
|
+
* publishes: an accepted deal's track can be embedded in a release that never
|
|
113
|
+
* publishes, with no extraction path — the deal is then consumed while the
|
|
114
|
+
* recording never ships, and the recording admin's recourse is a new deal for a
|
|
115
|
+
* new release.
|
|
116
|
+
*
|
|
117
|
+
* `recording` is deliberately unread (hence the `#[allow]`): it exists to
|
|
118
|
+
* compile-time-bind the `RecordingShare`/`CompositionShare` phantom pairing.
|
|
119
|
+
*/
|
|
120
|
+
export declare function _new(options: NewOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
121
|
+
export interface RejectArguments {
|
|
122
|
+
self: RawTransactionArgument<string>;
|
|
123
|
+
}
|
|
124
|
+
export interface RejectOptions {
|
|
125
|
+
package?: string;
|
|
126
|
+
arguments: RejectArguments | [
|
|
127
|
+
self: RawTransactionArgument<string>
|
|
128
|
+
];
|
|
129
|
+
typeArguments: [
|
|
130
|
+
string,
|
|
131
|
+
string
|
|
132
|
+
];
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Rejects the deal, destroying it without inclusion in a release. Used when the
|
|
136
|
+
* holder declines or the negotiation falls through. Emits a `DealRejectedEvent`.
|
|
137
|
+
*/
|
|
138
|
+
export declare function reject(options: RejectOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
139
|
+
export interface IdArguments {
|
|
140
|
+
self: RawTransactionArgument<string>;
|
|
141
|
+
}
|
|
142
|
+
export interface IdOptions {
|
|
143
|
+
package?: string;
|
|
144
|
+
arguments: IdArguments | [
|
|
145
|
+
self: RawTransactionArgument<string>
|
|
146
|
+
];
|
|
147
|
+
typeArguments: [
|
|
148
|
+
string,
|
|
149
|
+
string
|
|
150
|
+
];
|
|
151
|
+
}
|
|
152
|
+
/** Returns the deal's object ID. */
|
|
153
|
+
export declare function id(options: IdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
154
|
+
export interface ReleaseIdArguments {
|
|
155
|
+
self: RawTransactionArgument<string>;
|
|
156
|
+
}
|
|
157
|
+
export interface ReleaseIdOptions {
|
|
158
|
+
package?: string;
|
|
159
|
+
arguments: ReleaseIdArguments | [
|
|
160
|
+
self: RawTransactionArgument<string>
|
|
161
|
+
];
|
|
162
|
+
typeArguments: [
|
|
163
|
+
string,
|
|
164
|
+
string
|
|
165
|
+
];
|
|
166
|
+
}
|
|
167
|
+
/** Returns the ID of the target release. */
|
|
168
|
+
export declare function releaseId(options: ReleaseIdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
169
|
+
export interface TrackSplitBpsArguments {
|
|
170
|
+
self: RawTransactionArgument<string>;
|
|
171
|
+
}
|
|
172
|
+
export interface TrackSplitBpsOptions {
|
|
173
|
+
package?: string;
|
|
174
|
+
arguments: TrackSplitBpsArguments | [
|
|
175
|
+
self: RawTransactionArgument<string>
|
|
176
|
+
];
|
|
177
|
+
typeArguments: [
|
|
178
|
+
string,
|
|
179
|
+
string
|
|
180
|
+
];
|
|
181
|
+
}
|
|
182
|
+
/** Returns the track's revenue split in basis points. */
|
|
183
|
+
export declare function trackSplitBps(options: TrackSplitBpsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
184
|
+
//# sourceMappingURL=deal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deal.d.ts","sourceRoot":"","sources":["../../../src/contracts/miso/deal.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,UAAU,EAA0B,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEpG,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D,eAAO,MAAM,IAAI;IACT,uCAAuC;;IAEvC,qDAAqD;;IAErD,6DAA6D;;mFAE7D,CAAC;AACT,eAAO,MAAM,gBAAgB;IACrB,sBAAsB;;IAEtB,yDAAyD;;IAEzD,gCAAgC;;IAEhC,iDAAiD;;;+FAGjD,CAAC;AACT,eAAO,MAAM,iBAAiB;IACtB,sBAAsB;;IAEtB,gCAAgC;;gGAEhC,CAAC;AACT,eAAO,MAAM,iBAAiB;IACtB,sBAAsB;;IAEtB,gCAAgC;;gGAEhC,CAAC;AACT,MAAM,WAAW,YAAY;IACzB,CAAC,EAAE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AC;KACvC,CAAC;IACF,aAAa,EAAE;QACX,MAAM;QACN,MAAM;KACT,CAAC;CACL;AACD,oCAAoC;AACpC,wBAAgB,EAAE,CAAC,OAAO,EAAE,SAAS,IAMzB,IAAI,WAAW,0DAO1B;AACD,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;CACxC;AACD,MAAM,WAAW,gBAAgB;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,kBAAkB,GAAG;QAC5B,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;KACvC,CAAC;IACF,aAAa,EAAE;QACX,MAAM;QACN,MAAM;KACT,CAAC;CACL;AACD,4CAA4C;AAC5C,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,IAMvC,IAAI,WAAW,0DAO1B;AACD,MAAM,WAAW,sBAAsB;IACnC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;CACxC;AACD,MAAM,WAAW,oBAAoB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,sBAAsB,GAAG;QAChC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;KACvC,CAAC;IACF,aAAa,EAAE;QACX,MAAM;QACN,MAAM;KACT,CAAC;CACL;AACD,yDAAyD;AACzD,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,IAM/C,IAAI,WAAW,0DAO1B"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* Represents a deal authorizing a recording to be included in a release. Deals are
|
|
6
|
+
* created by recording owners to grant permission for their recordings to appear
|
|
7
|
+
* on specific releases with agreed-upon revenue splits.
|
|
8
|
+
*
|
|
9
|
+
* ### Flow:
|
|
10
|
+
*
|
|
11
|
+
* - A recording owner creates a `Deal` specifying the target release and track
|
|
12
|
+
* split.
|
|
13
|
+
* - The deal is consumed by `track::new` to create a track, transferring the
|
|
14
|
+
* recording's authorization into the release.
|
|
15
|
+
* - Deals can be destroyed if no longer needed.
|
|
16
|
+
*
|
|
17
|
+
* `Deal<RecordingShare, CompositionShare>` carries the recording's and
|
|
18
|
+
* composition's identities as phantom type parameters rather than stored values —
|
|
19
|
+
* a `Deal` is consumed one-to-one into a `Track` and is never collected, so it has
|
|
20
|
+
* no reason to flatten to `TypeName`s early. The recording↔composition pairing is
|
|
21
|
+
* type-enforced at `new` via the `Recording<RecordingShare, CompositionShare>`
|
|
22
|
+
* argument — no ID is stored and no runtime assert is needed.
|
|
23
|
+
*
|
|
24
|
+
* A deal stores only what is genuinely release-specific and not carried by the
|
|
25
|
+
* type parameters: the target `release_id` and the `track_split_bps`. The
|
|
26
|
+
* recording is identified by the phantom, so no `recording_id` is stored —
|
|
27
|
+
* `track::new` reads the recording's address from the matching `Recording` it is
|
|
28
|
+
* handed (the phantoms force it to be the right one). Display metadata (title,
|
|
29
|
+
* cover art) is _not_ duplicated here — it is derived from the recording.
|
|
30
|
+
*/
|
|
31
|
+
import { MoveStruct, normalizeMoveArguments } from '../utils/index.js';
|
|
32
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
33
|
+
import {} from '@mysten/sui/transactions';
|
|
34
|
+
import * as bps from './deps/bps/bps.js';
|
|
35
|
+
const $moduleName = '@local-pkg/miso::deal';
|
|
36
|
+
export const Deal = new MoveStruct({ name: `${$moduleName}::Deal<phantom RecordingShare, phantom CompositionShare>`, fields: {
|
|
37
|
+
/** Unique identifier for this deal. */
|
|
38
|
+
id: bcs.Address,
|
|
39
|
+
/** ID of the target release this deal authorizes. */
|
|
40
|
+
release_id: bcs.Address,
|
|
41
|
+
/** Revenue split allocated to this track in basis points. */
|
|
42
|
+
track_split_bps: bps.BPS
|
|
43
|
+
} });
|
|
44
|
+
export const DealCreatedEvent = new MoveStruct({ name: `${$moduleName}::DealCreatedEvent<phantom RecordingShare, phantom CompositionShare>`, fields: {
|
|
45
|
+
/** ID of the deal. */
|
|
46
|
+
deal_id: bcs.Address,
|
|
47
|
+
/** ID of the recording whose inclusion is authorized. */
|
|
48
|
+
recording_id: bcs.Address,
|
|
49
|
+
/** ID of the target release. */
|
|
50
|
+
release_id: bcs.Address,
|
|
51
|
+
/** Track-level revenue split in basis points. */
|
|
52
|
+
track_split_bps_value: bcs.u16(),
|
|
53
|
+
created_by: bcs.Address
|
|
54
|
+
} });
|
|
55
|
+
export const DealAcceptedEvent = new MoveStruct({ name: `${$moduleName}::DealAcceptedEvent<phantom RecordingShare, phantom CompositionShare>`, fields: {
|
|
56
|
+
/** ID of the deal. */
|
|
57
|
+
deal_id: bcs.Address,
|
|
58
|
+
/** ID of the target release. */
|
|
59
|
+
release_id: bcs.Address
|
|
60
|
+
} });
|
|
61
|
+
export const DealRejectedEvent = new MoveStruct({ name: `${$moduleName}::DealRejectedEvent<phantom RecordingShare, phantom CompositionShare>`, fields: {
|
|
62
|
+
/** ID of the deal. */
|
|
63
|
+
deal_id: bcs.Address,
|
|
64
|
+
/** ID of the target release. */
|
|
65
|
+
release_id: bcs.Address
|
|
66
|
+
} });
|
|
67
|
+
/**
|
|
68
|
+
* Creates a new deal authorizing a recording for inclusion in a release. Requires
|
|
69
|
+
* the recording admin capability.
|
|
70
|
+
*
|
|
71
|
+
* The composition is identified by the recording's `CompositionShare` phantom, so
|
|
72
|
+
* the recording↔composition pairing is compile-time enforced — there is no
|
|
73
|
+
* `Composition` argument and no runtime ID check.
|
|
74
|
+
*
|
|
75
|
+
* ### What signing a deal consents to
|
|
76
|
+
*
|
|
77
|
+
* `release_id` is derived from the release digest, so targeting it consents to
|
|
78
|
+
* that release's exact economics and membership: the ordered list of
|
|
79
|
+
* `(recording, split)` pairs and the creator's nonce, nothing more. The release's
|
|
80
|
+
* title, artwork, credits, and display grouping are chosen by the release creator
|
|
81
|
+
* — before or after this deal is signed — and are not bound by the digest.
|
|
82
|
+
* Presentation is trusted and publicly attributable, not cryptographically
|
|
83
|
+
* committed.
|
|
84
|
+
*
|
|
85
|
+
* The recording need not be `Published`: its admin can strike deals inside the
|
|
86
|
+
* recording's own creating transaction (an `Initialized` recording cannot escape
|
|
87
|
+
* that transaction, so across transactions deals always reference `Published`,
|
|
88
|
+
* shared recordings).
|
|
89
|
+
*
|
|
90
|
+
* ### A transferred deal is out of its creator's hands
|
|
91
|
+
*
|
|
92
|
+
* A deal has no expiry and cannot be withdrawn by its creator: only the holder can
|
|
93
|
+
* `reject` it, or accept it — at any future time — into exactly the consented
|
|
94
|
+
* release via `track::new`. The digest binding confines a stale deal's blast
|
|
95
|
+
* radius to that one release. Acceptance is itself provisional until the release
|
|
96
|
+
* publishes: an accepted deal's track can be embedded in a release that never
|
|
97
|
+
* publishes, with no extraction path — the deal is then consumed while the
|
|
98
|
+
* recording never ships, and the recording admin's recourse is a new deal for a
|
|
99
|
+
* new release.
|
|
100
|
+
*
|
|
101
|
+
* `recording` is deliberately unread (hence the `#[allow]`): it exists to
|
|
102
|
+
* compile-time-bind the `RecordingShare`/`CompositionShare` phantom pairing.
|
|
103
|
+
*/
|
|
104
|
+
export function _new(options) {
|
|
105
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
106
|
+
const argumentsTypes = [
|
|
107
|
+
null,
|
|
108
|
+
null,
|
|
109
|
+
'0x2::object::ID',
|
|
110
|
+
'u16'
|
|
111
|
+
];
|
|
112
|
+
const parameterNames = ["_", "recording", "releaseId", "trackSplitBpsValue"];
|
|
113
|
+
return (tx) => tx.moveCall({
|
|
114
|
+
package: packageAddress,
|
|
115
|
+
module: 'deal',
|
|
116
|
+
function: 'new',
|
|
117
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
118
|
+
typeArguments: options.typeArguments
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Rejects the deal, destroying it without inclusion in a release. Used when the
|
|
123
|
+
* holder declines or the negotiation falls through. Emits a `DealRejectedEvent`.
|
|
124
|
+
*/
|
|
125
|
+
export function reject(options) {
|
|
126
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
127
|
+
const argumentsTypes = [
|
|
128
|
+
null
|
|
129
|
+
];
|
|
130
|
+
const parameterNames = ["self"];
|
|
131
|
+
return (tx) => tx.moveCall({
|
|
132
|
+
package: packageAddress,
|
|
133
|
+
module: 'deal',
|
|
134
|
+
function: 'reject',
|
|
135
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
136
|
+
typeArguments: options.typeArguments
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/** Returns the deal's object ID. */
|
|
140
|
+
export function id(options) {
|
|
141
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
142
|
+
const argumentsTypes = [
|
|
143
|
+
null
|
|
144
|
+
];
|
|
145
|
+
const parameterNames = ["self"];
|
|
146
|
+
return (tx) => tx.moveCall({
|
|
147
|
+
package: packageAddress,
|
|
148
|
+
module: 'deal',
|
|
149
|
+
function: 'id',
|
|
150
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
151
|
+
typeArguments: options.typeArguments
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/** Returns the ID of the target release. */
|
|
155
|
+
export function releaseId(options) {
|
|
156
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
157
|
+
const argumentsTypes = [
|
|
158
|
+
null
|
|
159
|
+
];
|
|
160
|
+
const parameterNames = ["self"];
|
|
161
|
+
return (tx) => tx.moveCall({
|
|
162
|
+
package: packageAddress,
|
|
163
|
+
module: 'deal',
|
|
164
|
+
function: 'release_id',
|
|
165
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
166
|
+
typeArguments: options.typeArguments
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
/** Returns the track's revenue split in basis points. */
|
|
170
|
+
export function trackSplitBps(options) {
|
|
171
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
172
|
+
const argumentsTypes = [
|
|
173
|
+
null
|
|
174
|
+
];
|
|
175
|
+
const parameterNames = ["self"];
|
|
176
|
+
return (tx) => tx.moveCall({
|
|
177
|
+
package: packageAddress,
|
|
178
|
+
module: 'deal',
|
|
179
|
+
function: 'track_split_bps',
|
|
180
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
181
|
+
typeArguments: options.typeArguments
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=deal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deal.js","sourceRoot":"","sources":["../../../src/contracts/miso/deal.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAA+B,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAoB,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,MAAM,WAAW,GAAG,uBAAuB,CAAC;AAC5C,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,0DAA0D,EAAE,MAAM,EAAE;QACrH,uCAAuC;QACvC,EAAE,EAAE,GAAG,CAAC,OAAO;QACf,qDAAqD;QACrD,UAAU,EAAE,GAAG,CAAC,OAAO;QACvB,6DAA6D;QAC7D,eAAe,EAAE,GAAG,CAAC,GAAG;KAC3B,EAAE,CAAC,CAAC;AACT,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,sEAAsE,EAAE,MAAM,EAAE;QAC7I,sBAAsB;Q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AC5D,MAAM,cAAc,GAAG;QACnB,IAAI;KACqB,CAAC;IAC9B,MAAM,cAAc,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,OAAO,CAAC,EAAe,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,YAAY;QACtB,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;QACpF,aAAa,EAAE,OAAO,CAAC,aAAa;KACvC,CAAC,CAAC;AACP,CAAC;AAcD,yDAAyD;AACzD,MAAM,UAAU,aAAa,CAAC,OAA6B;IACvD,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,IAAI,iBAAiB,CAAC;IAC5D,MAAM,cAAc,GAAG;QACnB,IAAI;KACqB,CAAC;IAC9B,MAAM,cAAc,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,OAAO,CAAC,EAAe,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,iBAAiB;QAC3B,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;QACpF,aAAa,EAAE,OAAO,CAAC,aAAa;KACvC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* Basis-points arithmetic with a newtype wrapper.
|
|
6
|
+
*
|
|
7
|
+
* 1 bps = 0.01%. 10_000 bps = 100%.
|
|
8
|
+
*
|
|
9
|
+
* Storage-optimal: `BPS` stores a `u16` (2 bytes), the tightest width that fits
|
|
10
|
+
* the `[0, 10_000]` range. Apply functions cover every standard integer width
|
|
11
|
+
* (`u8` through `u256`); overflow safety on `u8`–`u128` is delegated to
|
|
12
|
+
* `std::uX::mul_div` / `mul_div_ceil`, which widen to the next-larger type
|
|
13
|
+
* internally. `u256` has no wider type, so the multiplication is performed
|
|
14
|
+
* directly and only overflows for amounts exceeding `u256::MAX / 10_000`
|
|
15
|
+
* (~1.16e73).
|
|
16
|
+
*/
|
|
17
|
+
import { MoveTuple } from '../../../utils/index.js';
|
|
18
|
+
export declare const BPS: MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<number, number, "u16">], "bps::bps::BPS">;
|
|
19
|
+
//# sourceMappingURL=bps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bps.d.ts","sourceRoot":"","sources":["../../../../../src/contracts/miso/deps/bps/bps.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,eAAO,MAAM,GAAG,iGAAsE,CAAC"}
|