@misonetwork/sdk 0.3.1 → 0.5.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 +97 -503
- package/dist/client.d.ts +6 -55
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +7 -52
- package/dist/client.js.map +1 -1
- package/dist/contracts/miso/release.d.ts +34 -31
- package/dist/contracts/miso/release.d.ts.map +1 -1
- package/dist/contracts/miso/release.js +32 -29
- package/dist/contracts/miso/release.js.map +1 -1
- package/dist/contracts/miso/track.d.ts +66 -22
- package/dist/contracts/miso/track.d.ts.map +1 -1
- package/dist/contracts/miso/track.js +65 -20
- package/dist/contracts/miso/track.js.map +1 -1
- package/dist/contracts/utils/index.d.ts +44 -0
- package/dist/contracts/utils/index.d.ts.map +1 -1
- package/dist/contracts/utils/index.js +104 -2
- package/dist/contracts/utils/index.js.map +1 -1
- package/dist/contracts.d.ts +0 -1
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +0 -1
- package/dist/contracts.js.map +1 -1
- package/dist/internal.d.ts +0 -7
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +0 -22
- package/dist/internal.js.map +1 -1
- package/dist/parsers.d.ts +1 -4
- package/dist/parsers.d.ts.map +1 -1
- package/dist/parsers.js +0 -24
- package/dist/parsers.js.map +1 -1
- package/dist/queries.d.ts +31 -5
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +179 -56
- package/dist/queries.js.map +1 -1
- package/dist/transactions.d.ts +10 -71
- package/dist/transactions.d.ts.map +1 -1
- package/dist/transactions.js +15 -72
- package/dist/transactions.js.map +1 -1
- package/dist/types.d.ts +3 -40
- package/dist/types.d.ts.map +1 -1
- package/dist/view.d.ts +7 -7
- package/dist/view.d.ts.map +1 -1
- package/dist/view.js +9 -9
- package/dist/view.js.map +1 -1
- package/package.json +4 -4
- package/src/client.ts +82 -89
- package/src/contracts/miso/release.ts +39 -36
- package/src/contracts/miso/track.ts +81 -23
- package/src/contracts/utils/index.ts +156 -4
- package/src/contracts.ts +0 -1
- package/src/internal.ts +0 -24
- package/src/parsers.ts +0 -35
- package/src/queries.ts +357 -83
- package/src/transactions.ts +20 -112
- package/src/types.ts +3 -53
- package/src/view.ts +13 -13
- package/dist/contracts/miso/deal.d.ts +0 -184
- package/dist/contracts/miso/deal.d.ts.map +0 -1
- package/dist/contracts/miso/deal.js +0 -184
- package/dist/contracts/miso/deal.js.map +0 -1
- package/src/contracts/miso/deal.ts +0 -257
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release.js","sourceRoot":"","sources":["../../../src/contracts/miso/release.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE
|
|
1
|
+
{"version":3,"file":"release.js","sourceRoot":"","sources":["../../../src/contracts/miso/release.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;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,EAA8C,MAAM,0BAA0B,CAAC;AACtF,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,MAAM,WAAW,GAAG,0BAA0B,CAAC;AAC/C,oCAAoC;AACpC,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,QAAQ,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,gBAAgB,EAAE,MAAM,EAAE;QACjF,oDAAoD;QACpD,WAAW,EAAE,IAAI;QACjB,0EAA0E;QAC1E,SAAS,EAAE,GAAG,CAAC,GAAG,EAAE;KACvB,EAAE,CAAC,CAAC;AACT,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,WAAW,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AE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC;AAUD,2EAA2E;AAC3E,MAAM,UAAU,GAAG,CAAC,OAAmB;IACnC,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,SAAS;QACjB,QAAQ,EAAE,KAAK;QACf,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC;AAYD;;;;;;GAMG;AACH,MAAM,UAAU,MAAM,CAAC,OAAsB;IACzC,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,KAAK,CAAC,CAAC;IACvC,OAAO,CAAC,EAAe,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,SAAS;QACnB,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
* recording/composition share-type identities) is reached.
|
|
13
13
|
* - `split_bps` — this track's share of the release's revenue; genuinely
|
|
14
14
|
* release-specific and not derivable from the recording.
|
|
15
|
-
* - `state` — the assign-once lifecycle that carries (then sheds)
|
|
16
|
-
* target release commitment; see `TrackState`.
|
|
15
|
+
* - `state` — the assign-once lifecycle that carries (then sheds) the recording
|
|
16
|
+
* admin's target release commitment, made at creation; see `TrackState`.
|
|
17
17
|
*
|
|
18
18
|
* `Track` is intentionally monomorphic: a `Release` holds a `vector<Track>` of
|
|
19
19
|
* tracks from many different recordings/compositions, so it cannot be generic over
|
|
@@ -24,16 +24,16 @@ import { MoveEnum, MoveStruct, type RawTransactionArgument } from '../utils/inde
|
|
|
24
24
|
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
25
25
|
/**
|
|
26
26
|
* Lifecycle state of a track within a release. A track is born `Unassigned`,
|
|
27
|
-
* carrying the target
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
27
|
+
* carrying the target release id the consent committed to at creation (the release
|
|
28
|
+
* id is a digest of the whole tracklist, so this is the recording owner's consent
|
|
29
|
+
* to the exact release configuration). At publish the release verifies the match
|
|
30
|
+
* and transitions the track to `Assigned`, which carries no id — shedding the
|
|
31
|
+
* 32-byte commitment once it has served its purpose.
|
|
32
32
|
*/
|
|
33
33
|
export declare const TrackState: MoveEnum<{
|
|
34
34
|
/**
|
|
35
35
|
* Track has been created but not yet assigned to a release. Carries the target
|
|
36
|
-
* release id the
|
|
36
|
+
* release id the consent committed to at creation.
|
|
37
37
|
*/
|
|
38
38
|
Unassigned: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
39
39
|
/** Track has been assigned to its target release. */
|
|
@@ -44,7 +44,7 @@ export declare const Track: MoveStruct<{
|
|
|
44
44
|
state: MoveEnum<{
|
|
45
45
|
/**
|
|
46
46
|
* Track has been created but not yet assigned to a release. Carries the target
|
|
47
|
-
* release id the
|
|
47
|
+
* release id the consent committed to at creation.
|
|
48
48
|
*/
|
|
49
49
|
Unassigned: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
50
50
|
/** Track has been assigned to its target release. */
|
|
@@ -65,14 +65,18 @@ export declare const Track: MoveStruct<{
|
|
|
65
65
|
split_bps: import("../utils/index.js").MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<number, number, "u16">], "bps::bps::BPS">;
|
|
66
66
|
}, "@local-pkg/miso::track::Track">;
|
|
67
67
|
export interface NewArguments {
|
|
68
|
-
|
|
68
|
+
_: RawTransactionArgument<string>;
|
|
69
69
|
recording: RawTransactionArgument<string>;
|
|
70
|
+
targetReleaseId: RawTransactionArgument<string>;
|
|
71
|
+
trackSplitBpsValue: RawTransactionArgument<number>;
|
|
70
72
|
}
|
|
71
73
|
export interface NewOptions {
|
|
72
74
|
package?: string;
|
|
73
75
|
arguments: NewArguments | [
|
|
74
|
-
|
|
75
|
-
recording: RawTransactionArgument<string
|
|
76
|
+
_: RawTransactionArgument<string>,
|
|
77
|
+
recording: RawTransactionArgument<string>,
|
|
78
|
+
targetReleaseId: RawTransactionArgument<string>,
|
|
79
|
+
trackSplitBpsValue: RawTransactionArgument<number>
|
|
76
80
|
];
|
|
77
81
|
typeArguments: [
|
|
78
82
|
string,
|
|
@@ -80,17 +84,42 @@ export interface NewOptions {
|
|
|
80
84
|
];
|
|
81
85
|
}
|
|
82
86
|
/**
|
|
83
|
-
* Creates a new track
|
|
84
|
-
*
|
|
85
|
-
*
|
|
87
|
+
* Creates a new track: the recording admin's consent to that recording's inclusion
|
|
88
|
+
* in a specific future release with an agreed split. Requires the recording admin
|
|
89
|
+
* capability. No event: a `Track` has `drop` and is not an object, so a creation
|
|
90
|
+
* event could announce a consent that is then silently discarded, and indexers
|
|
91
|
+
* would be unable to distinguish pending from dead. Pre-publish observability is
|
|
92
|
+
* the responsibility of whatever wraps the track (see below).
|
|
86
93
|
*
|
|
87
|
-
* The
|
|
88
|
-
*
|
|
89
|
-
* `
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
+
* The composition is identified by the recording's `CompositionShare` phantom, so
|
|
95
|
+
* the recording↔composition pairing is compile-time enforced — there is no
|
|
96
|
+
* `Composition` argument and no runtime ID check.
|
|
97
|
+
*
|
|
98
|
+
* ### What creating a track consents to
|
|
99
|
+
*
|
|
100
|
+
* `target_release_id` is derived from the release digest, so targeting it consents
|
|
101
|
+
* to that release's exact economics and membership: the ordered list of
|
|
102
|
+
* `(recording, split)` pairs and the creator's nonce, nothing more. The release's
|
|
103
|
+
* title, artwork, credits, and display grouping are chosen by the release creator
|
|
104
|
+
* — before or after this track is created — and are not bound by the digest.
|
|
105
|
+
* Presentation is trusted and publicly attributable, not cryptographically
|
|
106
|
+
* committed.
|
|
107
|
+
*
|
|
108
|
+
* The recording need not be `Published`: its admin can create tracks inside the
|
|
109
|
+
* recording's own creating transaction (an `Initialized` recording cannot escape
|
|
110
|
+
* that transaction, so across transactions tracks always reference `Published`,
|
|
111
|
+
* shared recordings).
|
|
112
|
+
*
|
|
113
|
+
* A `Track` has `store`, not `key`: it carries no identity of its own, so it may
|
|
114
|
+
* be exercised synchronously in the same transaction that creates it, or handed to
|
|
115
|
+
* an offer extension that wraps it in a real object with its own identity.
|
|
116
|
+
* Withdrawal, expiry, and rejection are then whatever that wrapping extension
|
|
117
|
+
* encodes — visible in its type, not in core.
|
|
118
|
+
*
|
|
119
|
+
* `recording` compile-time-binds the `RecordingShare`/`CompositionShare` phantom
|
|
120
|
+
* pairing, and is read for its id: the monomorphic `Track` must store the
|
|
121
|
+
* recording's _address_ for revenue routing, and an address cannot come from a
|
|
122
|
+
* phantom.
|
|
94
123
|
*/
|
|
95
124
|
export declare function _new(options: NewOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
96
125
|
export interface RecordingIdArguments {
|
|
@@ -115,4 +144,19 @@ export interface SplitBpsOptions {
|
|
|
115
144
|
}
|
|
116
145
|
/** Returns this track's share of the release's revenue (in basis points). */
|
|
117
146
|
export declare function splitBps(options: SplitBpsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
147
|
+
export interface TargetReleaseIdArguments {
|
|
148
|
+
self: TransactionArgument;
|
|
149
|
+
}
|
|
150
|
+
export interface TargetReleaseIdOptions {
|
|
151
|
+
package?: string;
|
|
152
|
+
arguments: TargetReleaseIdArguments | [
|
|
153
|
+
self: TransactionArgument
|
|
154
|
+
];
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Returns the target release id this track's creator consented to. Aborts if the
|
|
158
|
+
* track is `Assigned`: an assigned track only exists inside a published release,
|
|
159
|
+
* so its release is the object you fetched it from.
|
|
160
|
+
*/
|
|
161
|
+
export declare function targetReleaseId(options: TargetReleaseIdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
118
162
|
//# sourceMappingURL=track.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track.d.ts","sourceRoot":"","sources":["../../../src/contracts/miso/track.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAA0B,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE9G,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGtF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU;IACf;;;QAGI;;IAEJ,qDAAqD;;wCAErD,CAAC;AACT,eAAO,MAAM,KAAK;IACV,kCAAkC;;QATlC;;;YAGI;;QAEJ,qDAAqD;;;IAMrD;;;;OAIG;;IAEH;;;;;OAKG;;mCAEH,CAAC;AACT,MAAM,WAAW,YAAY;IACzB,
|
|
1
|
+
{"version":3,"file":"track.d.ts","sourceRoot":"","sources":["../../../src/contracts/miso/track.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAA0B,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;A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O,EAAE,kBAAkB,IAM3C,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"}
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
* recording/composition share-type identities) is reached.
|
|
13
13
|
* - `split_bps` — this track's share of the release's revenue; genuinely
|
|
14
14
|
* release-specific and not derivable from the recording.
|
|
15
|
-
* - `state` — the assign-once lifecycle that carries (then sheds)
|
|
16
|
-
* target release commitment; see `TrackState`.
|
|
15
|
+
* - `state` — the assign-once lifecycle that carries (then sheds) the recording
|
|
16
|
+
* admin's target release commitment, made at creation; see `TrackState`.
|
|
17
17
|
*
|
|
18
18
|
* `Track` is intentionally monomorphic: a `Release` holds a `vector<Track>` of
|
|
19
19
|
* tracks from many different recordings/compositions, so it cannot be generic over
|
|
@@ -27,16 +27,16 @@ import * as bps from './deps/bps/bps.js';
|
|
|
27
27
|
const $moduleName = '@local-pkg/miso::track';
|
|
28
28
|
/**
|
|
29
29
|
* Lifecycle state of a track within a release. A track is born `Unassigned`,
|
|
30
|
-
* carrying the target
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
30
|
+
* carrying the target release id the consent committed to at creation (the release
|
|
31
|
+
* id is a digest of the whole tracklist, so this is the recording owner's consent
|
|
32
|
+
* to the exact release configuration). At publish the release verifies the match
|
|
33
|
+
* and transitions the track to `Assigned`, which carries no id — shedding the
|
|
34
|
+
* 32-byte commitment once it has served its purpose.
|
|
35
35
|
*/
|
|
36
36
|
export const TrackState = new MoveEnum({ name: `${$moduleName}::TrackState`, fields: {
|
|
37
37
|
/**
|
|
38
38
|
* Track has been created but not yet assigned to a release. Carries the target
|
|
39
|
-
* release id the
|
|
39
|
+
* release id the consent committed to at creation.
|
|
40
40
|
*/
|
|
41
41
|
Unassigned: bcs.Address,
|
|
42
42
|
/** Track has been assigned to its target release. */
|
|
@@ -60,25 +60,52 @@ export const Track = new MoveStruct({ name: `${$moduleName}::Track`, fields: {
|
|
|
60
60
|
split_bps: bps.BPS
|
|
61
61
|
} });
|
|
62
62
|
/**
|
|
63
|
-
* Creates a new track
|
|
64
|
-
*
|
|
65
|
-
*
|
|
63
|
+
* Creates a new track: the recording admin's consent to that recording's inclusion
|
|
64
|
+
* in a specific future release with an agreed split. Requires the recording admin
|
|
65
|
+
* capability. No event: a `Track` has `drop` and is not an object, so a creation
|
|
66
|
+
* event could announce a consent that is then silently discarded, and indexers
|
|
67
|
+
* would be unable to distinguish pending from dead. Pre-publish observability is
|
|
68
|
+
* the responsibility of whatever wraps the track (see below).
|
|
66
69
|
*
|
|
67
|
-
* The
|
|
68
|
-
*
|
|
69
|
-
* `
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
70
|
+
* The composition is identified by the recording's `CompositionShare` phantom, so
|
|
71
|
+
* the recording↔composition pairing is compile-time enforced — there is no
|
|
72
|
+
* `Composition` argument and no runtime ID check.
|
|
73
|
+
*
|
|
74
|
+
* ### What creating a track consents to
|
|
75
|
+
*
|
|
76
|
+
* `target_release_id` is derived from the release digest, so targeting it consents
|
|
77
|
+
* to that release's exact economics and membership: the ordered list of
|
|
78
|
+
* `(recording, split)` pairs and the creator's nonce, nothing more. The release's
|
|
79
|
+
* title, artwork, credits, and display grouping are chosen by the release creator
|
|
80
|
+
* — before or after this track is created — and are not bound by the digest.
|
|
81
|
+
* Presentation is trusted and publicly attributable, not cryptographically
|
|
82
|
+
* committed.
|
|
83
|
+
*
|
|
84
|
+
* The recording need not be `Published`: its admin can create tracks inside the
|
|
85
|
+
* recording's own creating transaction (an `Initialized` recording cannot escape
|
|
86
|
+
* that transaction, so across transactions tracks always reference `Published`,
|
|
87
|
+
* shared recordings).
|
|
88
|
+
*
|
|
89
|
+
* A `Track` has `store`, not `key`: it carries no identity of its own, so it may
|
|
90
|
+
* be exercised synchronously in the same transaction that creates it, or handed to
|
|
91
|
+
* an offer extension that wraps it in a real object with its own identity.
|
|
92
|
+
* Withdrawal, expiry, and rejection are then whatever that wrapping extension
|
|
93
|
+
* encodes — visible in its type, not in core.
|
|
94
|
+
*
|
|
95
|
+
* `recording` compile-time-binds the `RecordingShare`/`CompositionShare` phantom
|
|
96
|
+
* pairing, and is read for its id: the monomorphic `Track` must store the
|
|
97
|
+
* recording's _address_ for revenue routing, and an address cannot come from a
|
|
98
|
+
* phantom.
|
|
74
99
|
*/
|
|
75
100
|
export function _new(options) {
|
|
76
101
|
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
77
102
|
const argumentsTypes = [
|
|
78
103
|
null,
|
|
79
|
-
null
|
|
104
|
+
null,
|
|
105
|
+
'0x2::object::ID',
|
|
106
|
+
'u16'
|
|
80
107
|
];
|
|
81
|
-
const parameterNames = ["
|
|
108
|
+
const parameterNames = ["_", "recording", "targetReleaseId", "trackSplitBpsValue"];
|
|
82
109
|
return (tx) => tx.moveCall({
|
|
83
110
|
package: packageAddress,
|
|
84
111
|
module: 'track',
|
|
@@ -115,4 +142,22 @@ export function splitBps(options) {
|
|
|
115
142
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
116
143
|
});
|
|
117
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Returns the target release id this track's creator consented to. Aborts if the
|
|
147
|
+
* track is `Assigned`: an assigned track only exists inside a published release,
|
|
148
|
+
* so its release is the object you fetched it from.
|
|
149
|
+
*/
|
|
150
|
+
export function targetReleaseId(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: 'track',
|
|
159
|
+
function: 'target_release_id',
|
|
160
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
161
|
+
});
|
|
162
|
+
}
|
|
118
163
|
//# sourceMappingURL=track.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"track.js","sourceRoot":"","sources":["../../../src/contracts/miso/track.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;GAkBG;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,MAAM,CAAC,MAAM,KAAK,GAAG,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,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,WAAW;QACrB,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC;AAUD;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,OAA+B;IAC3D,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,OAAO;QACf,QAAQ,EAAE,mBAAmB;QAC7B,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -10,7 +10,42 @@ export type GetManyOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'c
|
|
|
10
10
|
};
|
|
11
11
|
export declare function getPureBcsSchema(typeTag: string | TypeTag): BcsType<any> | null;
|
|
12
12
|
export declare function normalizeMoveArguments(args: unknown[] | object, argTypes: readonly (string | null)[], parameterNames?: string[]): TransactionArgument[];
|
|
13
|
+
/** A type argument: a type tag string, or a BCS type whose name is a Move type. */
|
|
14
|
+
export type TypeArgument = string | BcsType<any>;
|
|
15
|
+
export interface TypeTagOptions {
|
|
16
|
+
package?: string;
|
|
17
|
+
typeArguments?: readonly TypeArgument[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* `typeArguments` is required when the type's name contains unfilled
|
|
21
|
+
* `phantom X` parameters (at any depth). Everything else — argument arity,
|
|
22
|
+
* position contents, and tag validity — is validated at runtime.
|
|
23
|
+
*/
|
|
24
|
+
type TypeTagParams<Name extends string> = Name extends `${string}phantom ${string}` ? [options: TypeTagOptions & {
|
|
25
|
+
typeArguments: readonly TypeArgument[];
|
|
26
|
+
}] : [options?: TypeTagOptions];
|
|
27
|
+
type ResolveTypeTagOptions<Name extends string> = {
|
|
28
|
+
client: ClientWithCoreApi;
|
|
29
|
+
} & (Name extends `${string}phantom ${string}` ? TypeTagOptions & {
|
|
30
|
+
typeArguments: readonly TypeArgument[];
|
|
31
|
+
} : TypeTagOptions);
|
|
13
32
|
export declare class MoveStruct<T extends Record<string, BcsType<any>>, const Name extends string = string> extends BcsStruct<T, Name> {
|
|
33
|
+
/**
|
|
34
|
+
* Build the type tag for this struct.
|
|
35
|
+
*
|
|
36
|
+
* `typeArguments` is the full positional list, in Move declaration order, and
|
|
37
|
+
* is required when the struct has unfilled phantom parameters. The result may
|
|
38
|
+
* contain MVR names: those are valid in transaction `typeArguments`, but for
|
|
39
|
+
* queries or comparisons against on-chain data use `resolveTypeTag` instead.
|
|
40
|
+
*/
|
|
41
|
+
typeTag(...args: TypeTagParams<Name>): string;
|
|
42
|
+
/**
|
|
43
|
+
* Build the type tag for this struct, then resolve any MVR names through the
|
|
44
|
+
* client (using its configured overrides and the MVR API) and return the
|
|
45
|
+
* normalized, address-only form suitable for queries and comparisons against
|
|
46
|
+
* on-chain data.
|
|
47
|
+
*/
|
|
48
|
+
resolveTypeTag(options: ResolveTypeTagOptions<Name>): Promise<string>;
|
|
14
49
|
get<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({ objectId, ...options }: GetOptions<Include>): Promise<SuiClientTypes.Object<Include & {
|
|
15
50
|
content: true;
|
|
16
51
|
json: true;
|
|
@@ -25,7 +60,16 @@ export declare class MoveStruct<T extends Record<string, BcsType<any>>, const Na
|
|
|
25
60
|
}>>;
|
|
26
61
|
}
|
|
27
62
|
export declare class MoveEnum<T extends Record<string, BcsType<any> | null>, const Name extends string> extends BcsEnum<T, Name> {
|
|
63
|
+
/** Build the type tag for this enum. See `MoveStruct.typeTag` for semantics. */
|
|
64
|
+
typeTag(...args: TypeTagParams<Name>): string;
|
|
65
|
+
/** Build and resolve the type tag for this enum. See `MoveStruct.resolveTypeTag`. */
|
|
66
|
+
resolveTypeTag(options: ResolveTypeTagOptions<Name>): Promise<string>;
|
|
28
67
|
}
|
|
29
68
|
export declare class MoveTuple<const T extends readonly BcsType<any>[], const Name extends string> extends BcsTuple<T, Name> {
|
|
69
|
+
/** Build the type tag for this struct. See `MoveStruct.typeTag` for semantics. */
|
|
70
|
+
typeTag(...args: TypeTagParams<Name>): string;
|
|
71
|
+
/** Build and resolve the type tag for this struct. See `MoveStruct.resolveTypeTag`. */
|
|
72
|
+
resolveTypeTag(options: ResolveTypeTagOptions<Name>): Promise<string>;
|
|
30
73
|
}
|
|
74
|
+
export {};
|
|
31
75
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/contracts/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,KAAK,OAAO,EACZ,KAAK,OAAO,EAEZ,SAAS,EACT,OAAO,EACP,QAAQ,EACR,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,KAAK,mBAAmB,EAAc,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKjF,MAAM,MAAM,sBAAsB,CAAC,CAAC,IAAI,CAAC,GAAG,mBAAmB,CAAC;AAEhE,MAAM,MAAM,UAAU,CAAC,OAAO,SAAS,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,SAAS,CAAC,GAAG,EAAE,IACxF,cAAc,CAAC,gBAAgB,CAAC,OAAO,CAAC,GAAG;IAAE,MAAM,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAE1E,MAAM,MAAM,cAAc,CAAC,OAA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AC,IAAI,SAAS,MAAM,CACxB,SAAQ,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC;IACzB,gFAAgF;IAChF,OAAO,CAAC,GAAG,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG,MAAM;IAI7C,qFAAqF;IAC/E,cAAc,CAAC,OAAO,EAAE,qBAAqB,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CAG3E;AAED,qBAAa,SAAS,CACrB,KAAK,CAAC,CAAC,SAAS,SAAS,OAAO,CAAC,GAAG,CAAC,EAAE,EACvC,KAAK,CAAC,IAAI,SAAS,MAAM,CACxB,SAAQ,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC;IAC1B,kFAAkF;IAClF,OAAO,CAAC,GAAG,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG,MAAM;IAI7C,uFAAuF;IACjF,cAAc,CAAC,OAAO,EAAE,qBAAqB,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CAG3E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { bcs, TypeTagSerializer, BcsStruct, BcsEnum, BcsTuple, } from '@mysten/sui/bcs';
|
|
2
|
-
import { normalizeSuiAddress } from '@mysten/sui/utils';
|
|
2
|
+
import { normalizeStructTag, normalizeSuiAddress } from '@mysten/sui/utils';
|
|
3
3
|
import { isArgument } from '@mysten/sui/transactions';
|
|
4
4
|
import {} from '@mysten/sui/client';
|
|
5
5
|
const MOVE_STDLIB_ADDRESS = normalizeSuiAddress('0x1');
|
|
@@ -116,7 +116,93 @@ export function normalizeMoveArguments(args, argTypes, parameterNames) {
|
|
|
116
116
|
}
|
|
117
117
|
return normalizedArgs;
|
|
118
118
|
}
|
|
119
|
+
const HAS_PHANTOM_REGEX = /phantom [A-Za-z_$][A-Za-z0-9_$]*/;
|
|
120
|
+
function splitTopLevelTypeArgs(inner) {
|
|
121
|
+
const parts = [];
|
|
122
|
+
let depth = 0;
|
|
123
|
+
let current = '';
|
|
124
|
+
for (const char of inner) {
|
|
125
|
+
if (char === ',' && depth === 0) {
|
|
126
|
+
parts.push(current.trim());
|
|
127
|
+
current = '';
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (char === '<')
|
|
131
|
+
depth++;
|
|
132
|
+
if (char === '>')
|
|
133
|
+
depth--;
|
|
134
|
+
current += char;
|
|
135
|
+
}
|
|
136
|
+
if (current)
|
|
137
|
+
parts.push(current.trim());
|
|
138
|
+
return parts;
|
|
139
|
+
}
|
|
140
|
+
function buildTypeTag(name, options) {
|
|
141
|
+
const lt = name.indexOf('<');
|
|
142
|
+
const base = lt === -1 ? name : name.slice(0, lt);
|
|
143
|
+
if (base.split('::').length !== 3) {
|
|
144
|
+
throw new Error(`${name} is not a top-level Move type`);
|
|
145
|
+
}
|
|
146
|
+
let result = name;
|
|
147
|
+
if (options?.typeArguments) {
|
|
148
|
+
const baked = lt === -1 ? [] : splitTopLevelTypeArgs(name.slice(lt + 1, -1));
|
|
149
|
+
const supplied = options.typeArguments.map((arg) => {
|
|
150
|
+
if (typeof arg === 'string') {
|
|
151
|
+
return arg;
|
|
152
|
+
}
|
|
153
|
+
if (arg && typeof arg.serialize === 'function' && typeof arg.name === 'string') {
|
|
154
|
+
return arg.name;
|
|
155
|
+
}
|
|
156
|
+
throw new Error(`Invalid type argument ${stringify(arg)}`);
|
|
157
|
+
});
|
|
158
|
+
if (supplied.length !== baked.length) {
|
|
159
|
+
throw new Error(`Expected ${baked.length} type arguments for ${base}, got ${supplied.length}`);
|
|
160
|
+
}
|
|
161
|
+
result = supplied.length === 0 ? base : `${base}<${supplied.join(', ')}>`;
|
|
162
|
+
}
|
|
163
|
+
if (HAS_PHANTOM_REGEX.test(result)) {
|
|
164
|
+
throw new Error(options?.typeArguments
|
|
165
|
+
? `A type argument contains an unfilled phantom parameter in ${result}`
|
|
166
|
+
: `Missing type arguments for ${result}`);
|
|
167
|
+
}
|
|
168
|
+
if (options?.package) {
|
|
169
|
+
const [, ...rest] = result.split('::');
|
|
170
|
+
result = [options.package, ...rest].join('::');
|
|
171
|
+
}
|
|
172
|
+
// fully validate address-only tags (MVR names can't be parsed as type tags)
|
|
173
|
+
if (!HAS_PHANTOM_REGEX.test(result) && !/[@/]/.test(result)) {
|
|
174
|
+
TypeTagSerializer.parseFromStr(result);
|
|
175
|
+
}
|
|
176
|
+
return result;
|
|
177
|
+
}
|
|
178
|
+
async function resolveBuiltTypeTag(name, options) {
|
|
179
|
+
const { client, ...rest } = options;
|
|
180
|
+
const { type } = await client.core.mvr.resolveType({
|
|
181
|
+
type: buildTypeTag(name, rest),
|
|
182
|
+
});
|
|
183
|
+
return normalizeStructTag(type);
|
|
184
|
+
}
|
|
119
185
|
export class MoveStruct extends BcsStruct {
|
|
186
|
+
/**
|
|
187
|
+
* Build the type tag for this struct.
|
|
188
|
+
*
|
|
189
|
+
* `typeArguments` is the full positional list, in Move declaration order, and
|
|
190
|
+
* is required when the struct has unfilled phantom parameters. The result may
|
|
191
|
+
* contain MVR names: those are valid in transaction `typeArguments`, but for
|
|
192
|
+
* queries or comparisons against on-chain data use `resolveTypeTag` instead.
|
|
193
|
+
*/
|
|
194
|
+
typeTag(...args) {
|
|
195
|
+
return buildTypeTag(this.name, args[0]);
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Build the type tag for this struct, then resolve any MVR names through the
|
|
199
|
+
* client (using its configured overrides and the MVR API) and return the
|
|
200
|
+
* normalized, address-only form suitable for queries and comparisons against
|
|
201
|
+
* on-chain data.
|
|
202
|
+
*/
|
|
203
|
+
async resolveTypeTag(options) {
|
|
204
|
+
return resolveBuiltTypeTag(this.name, options);
|
|
205
|
+
}
|
|
120
206
|
async get({ objectId, ...options }) {
|
|
121
207
|
const [res] = await this.getMany({
|
|
122
208
|
...options,
|
|
@@ -147,12 +233,28 @@ export class MoveStruct extends BcsStruct {
|
|
|
147
233
|
}
|
|
148
234
|
}
|
|
149
235
|
export class MoveEnum extends BcsEnum {
|
|
236
|
+
/** Build the type tag for this enum. See `MoveStruct.typeTag` for semantics. */
|
|
237
|
+
typeTag(...args) {
|
|
238
|
+
return buildTypeTag(this.name, args[0]);
|
|
239
|
+
}
|
|
240
|
+
/** Build and resolve the type tag for this enum. See `MoveStruct.resolveTypeTag`. */
|
|
241
|
+
async resolveTypeTag(options) {
|
|
242
|
+
return resolveBuiltTypeTag(this.name, options);
|
|
243
|
+
}
|
|
150
244
|
}
|
|
151
245
|
export class MoveTuple extends BcsTuple {
|
|
246
|
+
/** Build the type tag for this struct. See `MoveStruct.typeTag` for semantics. */
|
|
247
|
+
typeTag(...args) {
|
|
248
|
+
return buildTypeTag(this.name, args[0]);
|
|
249
|
+
}
|
|
250
|
+
/** Build and resolve the type tag for this struct. See `MoveStruct.resolveTypeTag`. */
|
|
251
|
+
async resolveTypeTag(options) {
|
|
252
|
+
return resolveBuiltTypeTag(this.name, options);
|
|
253
|
+
}
|
|
152
254
|
}
|
|
153
255
|
function stringify(val) {
|
|
154
256
|
if (typeof val === 'object') {
|
|
155
|
-
return JSON.stringify(val, (
|
|
257
|
+
return JSON.stringify(val, (_key, value) => typeof value === 'bigint' ? value.toString() : value);
|
|
156
258
|
}
|
|
157
259
|
if (typeof val === 'bigint') {
|
|
158
260
|
return val.toString();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/contracts/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EACN,GAAG,EAGH,iBAAiB,EACjB,SAAS,EACT,OAAO,EACP,QAAQ,GACR,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/contracts/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EACN,GAAG,EAGH,iBAAiB,EACjB,SAAS,EACT,OAAO,EACP,QAAQ,GACR,MAAM,iBAAiB,CAAC;AAC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,EAAE,OAAyD,CAAC,CAAC;IAClG,CAAC;CACD;AAED,MAAM,OAAO,SAGX,SAAQ,QAAiB;IAC1B,kFAAkF;IAClF,OAAO,CAAC,GAAG,IAAyB;QACnC,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAA+B,CAAC,CAAC;IACvE,CAAC;IAED,uFAAuF;IACvF,KAAK,CAAC,cAAc,CAAC,OAAoC;QACxD,OAAO,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,OAAyD,CAAC,CAAC;IAClG,CAAC;CACD;AAED,SAAS,SAAS,CAAC,GAAY;IAC9B,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAC1C,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,CACpD,CAAC;IACH,CAAC;IACD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;IACvB,CAAC;IAED,OAAO,GAAG,CAAC;AACZ,CAAC"}
|
package/dist/contracts.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export * as composition from "./contracts/miso/composition.ts";
|
|
2
2
|
export * as recording from "./contracts/miso/recording.ts";
|
|
3
3
|
export * as release from "./contracts/miso/release.ts";
|
|
4
|
-
export * as deal from "./contracts/miso/deal.ts";
|
|
5
4
|
export * as track from "./contracts/miso/track.ts";
|
|
6
5
|
//# sourceMappingURL=contracts.d.ts.map
|
package/dist/contracts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,WAAW,MAAM,iCAAiC,CAAC;AAC/D,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AACvD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,WAAW,MAAM,iCAAiC,CAAC;AAC/D,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAC"}
|
package/dist/contracts.js
CHANGED
|
@@ -8,6 +8,5 @@
|
|
|
8
8
|
export * as composition from "./contracts/miso/composition.js";
|
|
9
9
|
export * as recording from "./contracts/miso/recording.js";
|
|
10
10
|
export * as release from "./contracts/miso/release.js";
|
|
11
|
-
export * as deal from "./contracts/miso/deal.js";
|
|
12
11
|
export * as track from "./contracts/miso/track.js";
|
|
13
12
|
//# sourceMappingURL=contracts.js.map
|
package/dist/contracts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAEtC,gFAAgF;AAChF,+EAA+E;AAE/E,kFAAkF;AAClF,uEAAuE;AACvE,iFAAiF;AACjF,OAAO,KAAK,WAAW,MAAM,iCAAiC,CAAC;AAC/D,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AACvD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAEtC,gFAAgF;AAChF,+EAA+E;AAE/E,kFAAkF;AAClF,uEAAuE;AACvE,iFAAiF;AACjF,OAAO,KAAK,WAAW,MAAM,iCAAiC,CAAC;AAC/D,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAC"}
|
package/dist/internal.d.ts
CHANGED
|
@@ -13,12 +13,5 @@ export declare function mapComposition(id: string, d: Parsed): Composition;
|
|
|
13
13
|
export declare function mapRecording(id: string, d: Parsed): Recording;
|
|
14
14
|
export declare function mapTrack(d: Parsed): Track;
|
|
15
15
|
export declare function mapRelease(id: string, d: Parsed): ReleaseType;
|
|
16
|
-
/**
|
|
17
|
-
* Maps the deployed disc-based Release JSON shape to the SDK's flat Release
|
|
18
|
-
* view. The current protocol source stores `tracks` directly, while the
|
|
19
|
-
* existing testnet package stores `discs`; both represent one ordered
|
|
20
|
-
* tracklist to SDK consumers.
|
|
21
|
-
*/
|
|
22
|
-
export declare function mapDiscReleaseJson(id: string, d: Parsed): ReleaseType;
|
|
23
16
|
export {};
|
|
24
17
|
//# sourceMappingURL=internal.d.ts.map
|
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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