@misonetwork/sdk 0.6.0 → 0.7.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 +18 -3
- package/dist/client.d.ts +4 -7
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +0 -2
- package/dist/client.js.map +1 -1
- package/dist/contracts/miso/composition.d.ts +16 -38
- package/dist/contracts/miso/composition.d.ts.map +1 -1
- package/dist/contracts/miso/composition.js +16 -37
- package/dist/contracts/miso/composition.js.map +1 -1
- package/dist/contracts/miso/recording.d.ts +43 -18
- package/dist/contracts/miso/recording.d.ts.map +1 -1
- package/dist/contracts/miso/recording.js +45 -19
- package/dist/contracts/miso/recording.js.map +1 -1
- package/dist/contracts/miso/release.d.ts +2 -0
- package/dist/contracts/miso/release.d.ts.map +1 -1
- package/dist/contracts/miso/track.d.ts +39 -8
- package/dist/contracts/miso/track.d.ts.map +1 -1
- package/dist/contracts/miso/track.js +42 -8
- package/dist/contracts/miso/track.js.map +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +2 -0
- package/dist/internal.js.map +1 -1
- package/dist/parsers.d.ts +1 -2
- package/dist/parsers.d.ts.map +1 -1
- package/dist/parsers.js +1 -5
- package/dist/parsers.js.map +1 -1
- package/dist/transactions.d.ts +0 -9
- package/dist/transactions.d.ts.map +1 -1
- package/dist/transactions.js +1 -3
- package/dist/transactions.js.map +1 -1
- package/dist/types.d.ts +17 -8
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +0 -2
- package/src/contracts/miso/composition.ts +16 -53
- package/src/contracts/miso/recording.ts +59 -22
- package/src/contracts/miso/track.ts +51 -8
- package/src/internal.ts +2 -0
- package/src/parsers.ts +1 -10
- package/src/transactions.ts +1 -11
- package/src/types.ts +17 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/contracts/miso/release.ts"],"names":[],"mappings":"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Y,GAAG;QACtB,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;KACvC,CAAC;CACL;AACD,2EAA2E;AAC3E,wBAAgB,GAAG,CAAC,OAAO,EAAE,UAAU,IAM3B,IAAI,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,IAOjC,IAAI,WAAW,0DAM1B"}
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
* - `recording_id` — the routing target for the track's revenue, and the handle
|
|
11
11
|
* through which all other metadata (title, cover art, and the
|
|
12
12
|
* recording/composition share-type identities) is reached.
|
|
13
|
+
* - `composition_id` — the identity of the recording's underlying work, so the
|
|
14
|
+
* composition–recording–release graph is walkable on-chain from the release
|
|
15
|
+
* alone. Move cannot chase an ID to an object, so this edge is unreachable in a
|
|
16
|
+
* track loop unless embedded here.
|
|
13
17
|
* - `split_bps` — this track's share of the release's revenue; genuinely
|
|
14
18
|
* release-specific and not derivable from the recording.
|
|
15
19
|
* - `state` — the assign-once lifecycle that carries (then sheds) the recording
|
|
@@ -17,8 +21,9 @@
|
|
|
17
21
|
*
|
|
18
22
|
* `Track` is intentionally monomorphic: a `Release` holds a `vector<Track>` of
|
|
19
23
|
* tracks from many different recordings/compositions, so it cannot be generic over
|
|
20
|
-
* their share types. It stores no title, cover art, or share-type —
|
|
21
|
-
* from the recording via `recording_id
|
|
24
|
+
* their share types. It stores no title, cover art, or share-type — those are
|
|
25
|
+
* consumed off-chain and derived from the recording via `recording_id`; a `Track`
|
|
26
|
+
* embeds exactly the facts on-chain consumers cannot reach any other way.
|
|
22
27
|
*/
|
|
23
28
|
import { MoveEnum, MoveStruct, type RawTransactionArgument } from '../utils/index.js';
|
|
24
29
|
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
@@ -50,6 +55,14 @@ export declare const Track: MoveStruct<{
|
|
|
50
55
|
/** Track has been assigned to its target release. */
|
|
51
56
|
Assigned: null;
|
|
52
57
|
}, "@local-pkg/miso::track::TrackState">;
|
|
58
|
+
/**
|
|
59
|
+
* ID of the composition underlying this track's recording. An identity and
|
|
60
|
+
* membership handle — NOT a revenue routing target: the composition is paid
|
|
61
|
+
* through its recording-share ownership (settled at `recording::new`), so a track
|
|
62
|
+
* routes its full split to the recording. Immutable and safe to denormalize: the
|
|
63
|
+
* recording↔composition pairing is fixed at recording creation.
|
|
64
|
+
*/
|
|
65
|
+
composition_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
53
66
|
/**
|
|
54
67
|
* ID of the recording on this track. The routing target for the track's revenue;
|
|
55
68
|
* also the handle a consumer uses to fetch the recording (whose type carries the
|
|
@@ -91,9 +104,10 @@ export interface NewOptions {
|
|
|
91
104
|
* would be unable to distinguish pending from dead. Pre-publish observability is
|
|
92
105
|
* the responsibility of whatever wraps the track (see below).
|
|
93
106
|
*
|
|
94
|
-
* The composition is
|
|
95
|
-
*
|
|
96
|
-
*
|
|
107
|
+
* The recording↔composition pairing is compile-time enforced by the recording's
|
|
108
|
+
* `CompositionShare` phantom, and its address-level counterpart is embedded on the
|
|
109
|
+
* recording at creation — so the composition id is copied from the `&Recording`
|
|
110
|
+
* argument with no `Composition` argument and no runtime check needed.
|
|
97
111
|
*
|
|
98
112
|
* ### What creating a track consents to
|
|
99
113
|
*
|
|
@@ -117,9 +131,10 @@ export interface NewOptions {
|
|
|
117
131
|
* encodes — visible in its type, not in core.
|
|
118
132
|
*
|
|
119
133
|
* `recording` compile-time-binds the `RecordingShare`/`CompositionShare` phantom
|
|
120
|
-
* pairing, and is read for its id
|
|
121
|
-
*
|
|
122
|
-
*
|
|
134
|
+
* pairing, and is read for its own id and its embedded composition id: the
|
|
135
|
+
* monomorphic `Track` must store both _addresses_ — the recording's for revenue
|
|
136
|
+
* routing, the composition's for graph reachability — and an address cannot come
|
|
137
|
+
* from a phantom.
|
|
123
138
|
*/
|
|
124
139
|
export declare function _new(options: NewOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
125
140
|
export interface RecordingIdArguments {
|
|
@@ -133,6 +148,22 @@ export interface RecordingIdOptions {
|
|
|
133
148
|
}
|
|
134
149
|
/** Returns the ID of the recording. */
|
|
135
150
|
export declare function recordingId(options: RecordingIdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
151
|
+
export interface CompositionIdArguments {
|
|
152
|
+
self: TransactionArgument;
|
|
153
|
+
}
|
|
154
|
+
export interface CompositionIdOptions {
|
|
155
|
+
package?: string;
|
|
156
|
+
arguments: CompositionIdArguments | [
|
|
157
|
+
self: TransactionArgument
|
|
158
|
+
];
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Returns the ID of the composition underlying this track's recording. An
|
|
162
|
+
* identity/membership handle (e.g. "is this composition on this release?") — not a
|
|
163
|
+
* revenue routing target: the composition is paid via its recording-share
|
|
164
|
+
* ownership, and a track routes its full split to the recording.
|
|
165
|
+
*/
|
|
166
|
+
export declare function compositionId(options: CompositionIdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
136
167
|
export interface SplitBpsArguments {
|
|
137
168
|
self: TransactionArgument;
|
|
138
169
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track.d.ts","sourceRoot":"","sources":["../../../src/contracts/miso/track.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE
|
|
1
|
+
{"version":3,"file":"track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ACjC,IAAI,EAAE,mBAAmB,CAAC;CAC7B;AACD,MAAM,WAAW,kBAAkB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,oBAAoB,GAAG;QAC9B,IAAI,EAAE,mBAAmB;KAC5B,CAAC;CACL;AACD,uCAAuC;AACvC,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,IAM3C,IAAI,WAAW,0DAM1B;AACD,MAAM,WAAW,sBAAsB;IACnC,IAAI,EAAE,mBAAmB,CAAC;CAC7B;AACD,MAAM,WAAW,oBAAoB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,sBAAsB,GAAG;QAChC,IAAI,EAAE,mBAAmB;KAC5B,CAAC;CACL;AACD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,IAM/C,IAAI,WAAW,0DAM1B;AACD,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,mBAAmB,CAAC;CAC7B;AACD,MAAM,WAAW,eAAe;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,iBAAiB,GAAG;QAC3B,IAAI,EAAE,mBAAmB;KAC5B,CAAC;CACL;AACD,6EAA6E;AAC7E,wBAAgB,QAAQ,CAAC,OAAO,EAAE,eAAe,IAMrC,IAAI,WAAW,0DAM1B;AACD,MAAM,WAAW,wBAAwB;IACrC,IAAI,EAAE,mBAAmB,CAAC;CAC7B;AACD,MAAM,WAAW,sBAAsB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,wBAAwB,GAAG;QAClC,IAAI,EAAE,mBAAmB;KAC5B,CAAC;CACL;AACD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,IAMnD,IAAI,WAAW,0DAM1B"}
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
* - `recording_id` — the routing target for the track's revenue, and the handle
|
|
11
11
|
* through which all other metadata (title, cover art, and the
|
|
12
12
|
* recording/composition share-type identities) is reached.
|
|
13
|
+
* - `composition_id` — the identity of the recording's underlying work, so the
|
|
14
|
+
* composition–recording–release graph is walkable on-chain from the release
|
|
15
|
+
* alone. Move cannot chase an ID to an object, so this edge is unreachable in a
|
|
16
|
+
* track loop unless embedded here.
|
|
13
17
|
* - `split_bps` — this track's share of the release's revenue; genuinely
|
|
14
18
|
* release-specific and not derivable from the recording.
|
|
15
19
|
* - `state` — the assign-once lifecycle that carries (then sheds) the recording
|
|
@@ -17,8 +21,9 @@
|
|
|
17
21
|
*
|
|
18
22
|
* `Track` is intentionally monomorphic: a `Release` holds a `vector<Track>` of
|
|
19
23
|
* tracks from many different recordings/compositions, so it cannot be generic over
|
|
20
|
-
* their share types. It stores no title, cover art, or share-type —
|
|
21
|
-
* from the recording via `recording_id
|
|
24
|
+
* their share types. It stores no title, cover art, or share-type — those are
|
|
25
|
+
* consumed off-chain and derived from the recording via `recording_id`; a `Track`
|
|
26
|
+
* embeds exactly the facts on-chain consumers cannot reach any other way.
|
|
22
27
|
*/
|
|
23
28
|
import { MoveEnum, MoveStruct, normalizeMoveArguments } from '../utils/index.js';
|
|
24
29
|
import { bcs } from '@mysten/sui/bcs';
|
|
@@ -45,6 +50,14 @@ export const TrackState = new MoveEnum({ name: `${$moduleName}::TrackState`, fie
|
|
|
45
50
|
export const Track = new MoveStruct({ name: `${$moduleName}::Track`, fields: {
|
|
46
51
|
/** Current state of the track. */
|
|
47
52
|
state: TrackState,
|
|
53
|
+
/**
|
|
54
|
+
* ID of the composition underlying this track's recording. An identity and
|
|
55
|
+
* membership handle — NOT a revenue routing target: the composition is paid
|
|
56
|
+
* through its recording-share ownership (settled at `recording::new`), so a track
|
|
57
|
+
* routes its full split to the recording. Immutable and safe to denormalize: the
|
|
58
|
+
* recording↔composition pairing is fixed at recording creation.
|
|
59
|
+
*/
|
|
60
|
+
composition_id: bcs.Address,
|
|
48
61
|
/**
|
|
49
62
|
* ID of the recording on this track. The routing target for the track's revenue;
|
|
50
63
|
* also the handle a consumer uses to fetch the recording (whose type carries the
|
|
@@ -67,9 +80,10 @@ export const Track = new MoveStruct({ name: `${$moduleName}::Track`, fields: {
|
|
|
67
80
|
* would be unable to distinguish pending from dead. Pre-publish observability is
|
|
68
81
|
* the responsibility of whatever wraps the track (see below).
|
|
69
82
|
*
|
|
70
|
-
* The composition is
|
|
71
|
-
*
|
|
72
|
-
*
|
|
83
|
+
* The recording↔composition pairing is compile-time enforced by the recording's
|
|
84
|
+
* `CompositionShare` phantom, and its address-level counterpart is embedded on the
|
|
85
|
+
* recording at creation — so the composition id is copied from the `&Recording`
|
|
86
|
+
* argument with no `Composition` argument and no runtime check needed.
|
|
73
87
|
*
|
|
74
88
|
* ### What creating a track consents to
|
|
75
89
|
*
|
|
@@ -93,9 +107,10 @@ export const Track = new MoveStruct({ name: `${$moduleName}::Track`, fields: {
|
|
|
93
107
|
* encodes — visible in its type, not in core.
|
|
94
108
|
*
|
|
95
109
|
* `recording` compile-time-binds the `RecordingShare`/`CompositionShare` phantom
|
|
96
|
-
* pairing, and is read for its id
|
|
97
|
-
*
|
|
98
|
-
*
|
|
110
|
+
* pairing, and is read for its own id and its embedded composition id: the
|
|
111
|
+
* monomorphic `Track` must store both _addresses_ — the recording's for revenue
|
|
112
|
+
* routing, the composition's for graph reachability — and an address cannot come
|
|
113
|
+
* from a phantom.
|
|
99
114
|
*/
|
|
100
115
|
export function _new(options) {
|
|
101
116
|
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
@@ -128,6 +143,25 @@ export function recordingId(options) {
|
|
|
128
143
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
129
144
|
});
|
|
130
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* Returns the ID of the composition underlying this track's recording. An
|
|
148
|
+
* identity/membership handle (e.g. "is this composition on this release?") — not a
|
|
149
|
+
* revenue routing target: the composition is paid via its recording-share
|
|
150
|
+
* ownership, and a track routes its full split to the recording.
|
|
151
|
+
*/
|
|
152
|
+
export function compositionId(options) {
|
|
153
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
154
|
+
const argumentsTypes = [
|
|
155
|
+
null
|
|
156
|
+
];
|
|
157
|
+
const parameterNames = ["self"];
|
|
158
|
+
return (tx) => tx.moveCall({
|
|
159
|
+
package: packageAddress,
|
|
160
|
+
module: 'track',
|
|
161
|
+
function: 'composition_id',
|
|
162
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
163
|
+
});
|
|
164
|
+
}
|
|
131
165
|
/** Returns this track's share of the release's revenue (in basis points). */
|
|
132
166
|
export function splitBps(options) {
|
|
133
167
|
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track.js","sourceRoot":"","sources":["../../../src/contracts/miso/track.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE
|
|
1
|
+
{"version":3,"file":"track.js","sourceRoot":"","sources":["../../../src/contracts/miso/track.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,sBAAsB,EAA+B,MAAM,mBAAmB,CAAC;AAC9G,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAA8C,MAAM,0BAA0B,CAAC;AACtF,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAC7C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,QAAQ,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,cAAc,EAAE,MAAM,EAAE;QAC7E;;;YAGI;QACJ,UAAU,EAAE,GAAG,CAAC,OAAO;QACvB,qDAAqD;QACrD,QAAQ,EAAE,IAAI;KACjB,EAAE,CAAC,CAAC;AACT,MAA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Ac,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,OAAO;QACf,QAAQ,EAAE,mBAAmB;QAC7B,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC"}
|
package/dist/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,GAAG,EACH,WAAW,EACX,SAAS,EACT,OAAO,IAAI,WAAW,EACtB,KAAK,EAEN,MAAM,YAAY,CAAC;AAKpB,KAAK,MAAM,GAAG,GAAG,CAAC;AAIlB,kEAAkE;AAClE,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAErC;AAED,6DAA6D;AAC7D,wBAAgB,QAAQ,CACtB,CAAC,EAAE,MAAM,GACR;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAGtE;AAID,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,WAAW,CAOjE;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,GAAG,EACH,WAAW,EACX,SAAS,EACT,OAAO,IAAI,WAAW,EACtB,KAAK,EAEN,MAAM,YAAY,CAAC;AAKpB,KAAK,MAAM,GAAG,GAAG,CAAC;AAIlB,kEAAkE;AAClE,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAErC;AAED,6DAA6D;AAC7D,wBAAgB,QAAQ,CACtB,CAAC,EAAE,MAAM,GACR;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAGtE;AAID,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,WAAW,CAOjE;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAM7D;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,KAAK,CAOzC;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,WAAW,CAO7D"}
|
package/dist/internal.js
CHANGED
|
@@ -24,11 +24,13 @@ export function mapRecording(id, d) {
|
|
|
24
24
|
return {
|
|
25
25
|
id,
|
|
26
26
|
state: mapState(d.state),
|
|
27
|
+
compositionId: d.composition_id,
|
|
27
28
|
};
|
|
28
29
|
}
|
|
29
30
|
export function mapTrack(d) {
|
|
30
31
|
return {
|
|
31
32
|
state: (d.state?.$kind ?? "Unassigned"),
|
|
33
|
+
compositionId: d.composition_id,
|
|
32
34
|
recordingId: d.recording_id,
|
|
33
35
|
splitBps: mapBps(d.split_bps),
|
|
34
36
|
};
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AA8BtC,qBAAqB;AAErB,kEAAkE;AAClE,MAAM,UAAU,MAAM,CAAC,CAAS;IAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CA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edEvent, ReleasePublishedEvent } from "./types.ts";
|
|
2
2
|
export declare function parseCompositionPublishedEvent(bytes: Uint8Array): CompositionPublishedEvent;
|
|
3
|
-
export declare function parseCompositionRoyaltySetEvent(bytes: Uint8Array): CompositionRoyaltySetEvent;
|
|
4
3
|
export declare function parseRecordingPublishedEvent(bytes: Uint8Array): RecordingPublishedEvent;
|
|
5
4
|
export declare function parseReleasePublishedEvent(bytes: Uint8Array): ReleasePublishedEvent;
|
|
6
5
|
//# sourceMappingURL=parsers.d.ts.map
|
package/dist/parsers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../src/parsers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../src/parsers.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAIpB,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,UAAU,GAAG,yBAAyB,CAG3F;AAID,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,UAAU,GAAG,uBAAuB,CAGvF;AAID,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,UAAU,GAAG,qBAAqB,CAGnF"}
|
package/dist/parsers.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Event parsers. The BCS layouts come from the codegen-generated structs (so
|
|
4
4
|
// they track the on-chain ABI automatically); these functions parse raw event
|
|
5
5
|
// bytes and map them to the public camelCase event types.
|
|
6
|
-
import { CompositionPublishedEvent as CompositionPublishedEventBcs
|
|
6
|
+
import { CompositionPublishedEvent as CompositionPublishedEventBcs } from "./contracts/miso/composition.js";
|
|
7
7
|
import { RecordingPublishedEvent as RecordingPublishedEventBcs } from "./contracts/miso/recording.js";
|
|
8
8
|
import { ReleasePublishedEvent as ReleasePublishedEventBcs } from "./contracts/miso/release.js";
|
|
9
9
|
// === Composition ===
|
|
@@ -11,10 +11,6 @@ export function parseCompositionPublishedEvent(bytes) {
|
|
|
11
11
|
const e = CompositionPublishedEventBcs.parse(bytes);
|
|
12
12
|
return { compositionId: e.composition_id };
|
|
13
13
|
}
|
|
14
|
-
export function parseCompositionRoyaltySetEvent(bytes) {
|
|
15
|
-
const e = CompositionRoyaltySetEventBcs.parse(bytes);
|
|
16
|
-
return { royaltyRateBps: e.royalty_rate_bps };
|
|
17
|
-
}
|
|
18
14
|
// === Recording ===
|
|
19
15
|
export function parseRecordingPublishedEvent(bytes) {
|
|
20
16
|
const e = RecordingPublishedEventBcs.parse(bytes);
|
package/dist/parsers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parsers.js","sourceRoot":"","sources":["../src/parsers.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAEtC,6EAA6E;AAC7E,8EAA8E;AAC9E,0DAA0D;AAE1D,OAAO,
|
|
1
|
+
{"version":3,"file":"parsers.js","sourceRoot":"","sources":["../src/parsers.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAEtC,6EAA6E;AAC7E,8EAA8E;AAC9E,0DAA0D;AAE1D,OAAO,EAAE,yBAAyB,IAAI,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAC5G,OAAO,EAAE,uBAAuB,IAAI,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AACtG,OAAO,EAAE,qBAAqB,IAAI,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAOhG,sBAAsB;AAEtB,MAAM,UAAU,8BAA8B,CAAC,KAAiB;IAC9D,MAAM,CAAC,GAAG,4BAA4B,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACpD,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC,cAAc,EAAE,CAAC;AAC7C,CAAC;AAED,oBAAoB;AAEpB,MAAM,UAAU,4BAA4B,CAAC,KAAiB;IAC5D,MAAM,CAAC,GAAG,0BAA0B,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAClD,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC,YAAY,EAAE,CAAC;AACzC,CAAC;AAED,kBAAkB;AAElB,MAAM,UAAU,0BAA0B,CAAC,KAAiB;IAC1D,MAAM,CAAC,GAAG,wBAAwB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAChD,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC;AACrC,CAAC"}
|
package/dist/transactions.d.ts
CHANGED
|
@@ -42,8 +42,6 @@ export interface RecordingParts {
|
|
|
42
42
|
/** The creator's remaining share supply after the composition's cut is split off. */
|
|
43
43
|
balance: TransactionObjectArgument;
|
|
44
44
|
}
|
|
45
|
-
/** The protocol's maximum composition royalty rate (`MAX_ROYALTY_RATE_BPS`). */
|
|
46
|
-
export declare const PROTOCOL_MAX_ROYALTY_RATE_BPS = 2000;
|
|
47
45
|
export interface CreateRecordingParams extends ShareCurrencyBinding {
|
|
48
46
|
/** Share type of the parent composition (the recording's `CompositionShare` phantom). */
|
|
49
47
|
compositionShareType: string;
|
|
@@ -53,13 +51,6 @@ export interface CreateRecordingParams extends ShareCurrencyBinding {
|
|
|
53
51
|
* unshared, transaction-local `createComposition(...).composition` result.
|
|
54
52
|
*/
|
|
55
53
|
composition: TransactionObjectArgument;
|
|
56
|
-
/**
|
|
57
|
-
* Slippage guard: the maximum composition royalty rate (bps) the recorder will
|
|
58
|
-
* grant — `recording::new` aborts if the composition's live rate exceeds it.
|
|
59
|
-
* Pass the rate you observed. Defaults to the protocol maximum (2000), which
|
|
60
|
-
* accepts any legal rate.
|
|
61
|
-
*/
|
|
62
|
-
maxRoyaltyRateBps?: number;
|
|
63
54
|
misoPackageId: string;
|
|
64
55
|
}
|
|
65
56
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../src/transactions.ts"],"names":[],"mapp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AAoB,EAAE,MAAM,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,iBAAiB,GAAG,yBAAyB,CAiBjG"}
|
package/dist/transactions.js
CHANGED
|
@@ -50,8 +50,6 @@ export function createComposition(tx, params) {
|
|
|
50
50
|
}));
|
|
51
51
|
return { composition: result[0], adminCap: result[1], balance: result[2] };
|
|
52
52
|
}
|
|
53
|
-
/** The protocol's maximum composition royalty rate (`MAX_ROYALTY_RATE_BPS`). */
|
|
54
|
-
export const PROTOCOL_MAX_ROYALTY_RATE_BPS = 2000;
|
|
55
53
|
/**
|
|
56
54
|
* PRIMITIVE. Appends `recording::new` and returns its by-value results without
|
|
57
55
|
* publishing/dispersing/transferring. Because it borrows the composition by
|
|
@@ -63,7 +61,7 @@ export function createRecording(tx, params) {
|
|
|
63
61
|
const result = tx.add(recording._new({
|
|
64
62
|
package: params.misoPackageId,
|
|
65
63
|
typeArguments: [params.shareType, params.compositionShareType],
|
|
66
|
-
arguments: [params.composition, tx.object(params.shareCurrencyId), tx.object(params.shareTreasuryCapId)
|
|
64
|
+
arguments: [params.composition, tx.object(params.shareCurrencyId), tx.object(params.shareTreasuryCapId)],
|
|
67
65
|
}));
|
|
68
66
|
return { recording: result[0], adminCap: result[1], balance: result[2] };
|
|
69
67
|
}
|
package/dist/transactions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../src/transactions.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAEtC,sEAAsE;AACtE,mDAAmD;AACnD,8EAA8E;AAC9E,6EAA6E;AAC7E,wEAAwE;AACxE,aAAa;AACb,EAAE;AACF,2EAA2E;AAC3E,yEAAyE;AACzE,gCAAgC;A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CAAC,oBAAoB,CAAC;QACvE,SAAS,EAAE;YACT,WAAW;YACX,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;YAC7B,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;YAClC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC;SAClC;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -25,7 +25,10 @@ export interface Composition {
|
|
|
25
25
|
state: CompositionState;
|
|
26
26
|
/** Primary title of the composition. */
|
|
27
27
|
title: string;
|
|
28
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Royalty rate this composition earns from each recording's revenue (basis
|
|
30
|
+
* points, 0-10000). Immutable for the composition's lifetime.
|
|
31
|
+
*/
|
|
29
32
|
royaltyRate: BPS;
|
|
30
33
|
}
|
|
31
34
|
/**
|
|
@@ -36,13 +39,6 @@ export interface Composition {
|
|
|
36
39
|
export interface CompositionPublishedEvent {
|
|
37
40
|
compositionId: string;
|
|
38
41
|
}
|
|
39
|
-
/**
|
|
40
|
-
* Emitted when a composition's royalty rate is set or changed. The composition
|
|
41
|
-
* is identified by the event's `CompositionShare` phantom type, not a field.
|
|
42
|
-
*/
|
|
43
|
-
export interface CompositionRoyaltySetEvent {
|
|
44
|
-
royaltyRateBps: number;
|
|
45
|
-
}
|
|
46
42
|
/**
|
|
47
43
|
* Admin cap for a Composition, derived deterministically from the Composition object ID.
|
|
48
44
|
*
|
|
@@ -80,6 +76,12 @@ export interface Recording {
|
|
|
80
76
|
id: string;
|
|
81
77
|
/** Current lifecycle state. */
|
|
82
78
|
state: RecordingState;
|
|
79
|
+
/**
|
|
80
|
+
* Object ID of the parent composition. An identity/membership handle — not a
|
|
81
|
+
* revenue routing target: the composition is paid via its recording-share
|
|
82
|
+
* ownership, settled at recording creation. Immutable.
|
|
83
|
+
*/
|
|
84
|
+
compositionId: string;
|
|
83
85
|
}
|
|
84
86
|
/**
|
|
85
87
|
* Emitted once when a recording is published. A pure pointer carrying only the
|
|
@@ -112,6 +114,13 @@ export type TrackState = "Unassigned" | "Assigned";
|
|
|
112
114
|
export interface Track {
|
|
113
115
|
/** Current state of the track (Unassigned until the release claims it, then Assigned). */
|
|
114
116
|
state: TrackState;
|
|
117
|
+
/**
|
|
118
|
+
* ID of the composition underlying this track's recording. An identity/
|
|
119
|
+
* membership handle — not a revenue routing target: the composition is paid
|
|
120
|
+
* via its recording-share ownership, and a track routes its full split to the
|
|
121
|
+
* recording.
|
|
122
|
+
*/
|
|
123
|
+
compositionId: string;
|
|
115
124
|
/** ID of the recording on this track. */
|
|
116
125
|
recordingId: string;
|
|
117
126
|
/** Revenue split for this track within the release (in basis points). */
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAOA,wDAAwD;AACxD,MAAM,WAAW,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAMD,wCAAwC;AACxC,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,GACvB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/C;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,KAAK,EAAE,gBAAgB,CAAC;IACxB,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAOA,wDAAwD;AACxD,MAAM,WAAW,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAMD,wCAAwC;AACxC,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,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AC1F,KAAK,EAAE,UAAU,CAAC;IAClB;;;;;OAKG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,yEAAyE;IACzE,QAAQ,EAAE,GAAG,CAAC;CACf;AAMD,oCAAoC;AACpC,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,GACvB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/C;;;;;;;;;GASG;AACH,MAAM,WAAW,OAAO;IACtB,0CAA0C;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,KAAK,EAAE,YAAY,CAAC;IACpB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -276,7 +276,6 @@ export class MisoProtocolClient {
|
|
|
276
276
|
Release: release.Release,
|
|
277
277
|
Track: track.Track,
|
|
278
278
|
CompositionPublishedEvent: composition.CompositionPublishedEvent,
|
|
279
|
-
CompositionRoyaltySetEvent: composition.CompositionRoyaltySetEvent,
|
|
280
279
|
RecordingPublishedEvent: recording.RecordingPublishedEvent,
|
|
281
280
|
ReleasePublishedEvent: release.ReleasePublishedEvent,
|
|
282
281
|
};
|
|
@@ -287,7 +286,6 @@ export class MisoProtocolClient {
|
|
|
287
286
|
get parse() {
|
|
288
287
|
return {
|
|
289
288
|
compositionPublishedEvent: parsers.parseCompositionPublishedEvent,
|
|
290
|
-
compositionRoyaltySetEvent: parsers.parseCompositionRoyaltySetEvent,
|
|
291
289
|
recordingPublishedEvent: parsers.parseRecordingPublishedEvent,
|
|
292
290
|
releasePublishedEvent: parsers.parseReleasePublishedEvent,
|
|
293
291
|
};
|
|
@@ -67,12 +67,6 @@ export const CompositionAdminCapKey = new MoveTuple({ name: `${$moduleName}::Com
|
|
|
67
67
|
export const CompositionPublishedEvent = new MoveStruct({ name: `${$moduleName}::CompositionPublishedEvent<phantom CompositionShare>`, fields: {
|
|
68
68
|
composition_id: bcs.Address
|
|
69
69
|
} });
|
|
70
|
-
export const CompositionRoyaltySetEvent = new MoveStruct({ name: `${$moduleName}::CompositionRoyaltySetEvent<phantom CompositionShare>`, fields: {
|
|
71
|
-
composition_id: bcs.Address,
|
|
72
|
-
previous_royalty_rate_bps: bcs.u16(),
|
|
73
|
-
royalty_rate_bps: bcs.u16(),
|
|
74
|
-
changed_by: bcs.Address
|
|
75
|
-
} });
|
|
76
70
|
export interface NewArguments {
|
|
77
71
|
title: RawTransactionArgument<string>;
|
|
78
72
|
royaltyRateBps: RawTransactionArgument<number>;
|
|
@@ -92,10 +86,17 @@ export interface NewOptions {
|
|
|
92
86
|
];
|
|
93
87
|
}
|
|
94
88
|
/**
|
|
95
|
-
* Creates a new composition with the given title and royalty rate.
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
89
|
+
* Creates a new composition with the given title and royalty rate.
|
|
90
|
+
*
|
|
91
|
+
* The rate is set once, here, and is immutable for the composition's lifetime: it
|
|
92
|
+
* is a permanent standing offer that recorders and share buyers can price against
|
|
93
|
+
* without trusting the admin. The protocol imposes no opinion on it beyond the
|
|
94
|
+
* arithmetic bound of 100% (10000 bps, enforced by `bps::new`). There is no floor
|
|
95
|
+
* — 0% is permitted (e.g. a generative recording with no authored composition) —
|
|
96
|
+
* and no protocol ceiling: an uncompetitive rate simply attracts no recordings.
|
|
97
|
+
* What rate is reasonable is a client-side concern; per-deal deviations settle as
|
|
98
|
+
* voluntary share transfers after recording creation. Initializes share tokens
|
|
99
|
+
* (10M supply, 6 decimals) and returns:
|
|
99
100
|
*
|
|
100
101
|
* - The composition object
|
|
101
102
|
* - Admin capability for the owner
|
|
@@ -155,48 +156,6 @@ export function publish(options: PublishOptions) {
|
|
|
155
156
|
typeArguments: options.typeArguments
|
|
156
157
|
});
|
|
157
158
|
}
|
|
158
|
-
export interface SetRoyaltyRateArguments {
|
|
159
|
-
self: RawTransactionArgument<string>;
|
|
160
|
-
_: RawTransactionArgument<string>;
|
|
161
|
-
royaltyRateBps: RawTransactionArgument<number>;
|
|
162
|
-
}
|
|
163
|
-
export interface SetRoyaltyRateOptions {
|
|
164
|
-
package?: string;
|
|
165
|
-
arguments: SetRoyaltyRateArguments | [
|
|
166
|
-
self: RawTransactionArgument<string>,
|
|
167
|
-
_: RawTransactionArgument<string>,
|
|
168
|
-
royaltyRateBps: RawTransactionArgument<number>
|
|
169
|
-
];
|
|
170
|
-
typeArguments: [
|
|
171
|
-
string
|
|
172
|
-
];
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Sets the royalty rate this composition earns from each recording. Must not
|
|
176
|
-
* exceed `MAX_ROYALTY_RATE_BPS` (there is no floor; 0% is allowed). The rate can
|
|
177
|
-
* be changed in any lifecycle state, including after publishing, and takes effect
|
|
178
|
-
* immediately. There is deliberately no rate-change cooldown: a change cannot
|
|
179
|
-
* surprise anyone, because each recording snapshots the rate when it is created
|
|
180
|
-
* (existing recordings keep the rate they captured) and `recording::new`'s
|
|
181
|
-
* `max_royalty_rate_bps` slippage guard means no future recorder can be charged a
|
|
182
|
-
* rate they did not consent to.
|
|
183
|
-
*/
|
|
184
|
-
export function setRoyaltyRate(options: SetRoyaltyRateOptions) {
|
|
185
|
-
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
186
|
-
const argumentsTypes = [
|
|
187
|
-
null,
|
|
188
|
-
null,
|
|
189
|
-
'u16'
|
|
190
|
-
] satisfies (string | null)[];
|
|
191
|
-
const parameterNames = ["self", "_", "royaltyRateBps"];
|
|
192
|
-
return (tx: Transaction) => tx.moveCall({
|
|
193
|
-
package: packageAddress,
|
|
194
|
-
module: 'composition',
|
|
195
|
-
function: 'set_royalty_rate',
|
|
196
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
197
|
-
typeArguments: options.typeArguments
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
159
|
export interface IdArguments {
|
|
201
160
|
self: RawTransactionArgument<string>;
|
|
202
161
|
}
|
|
@@ -263,7 +222,11 @@ export interface RoyaltyRateOptions {
|
|
|
263
222
|
string
|
|
264
223
|
];
|
|
265
224
|
}
|
|
266
|
-
/**
|
|
225
|
+
/**
|
|
226
|
+
* Returns the royalty rate this composition earns from each recording. Immutable
|
|
227
|
+
* for the composition's lifetime — the value read here is, by construction, the
|
|
228
|
+
* value `recording::new` will apply.
|
|
229
|
+
*/
|
|
267
230
|
export function royaltyRate(options: RoyaltyRateOptions) {
|
|
268
231
|
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
269
232
|
const argumentsTypes = [
|