@misonetwork/sdk 0.4.0 → 0.6.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 +101 -503
- package/dist/client.d.ts +21 -59
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +26 -58
- 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/deployments.d.ts +21 -0
- package/dist/deployments.d.ts.map +1 -0
- package/dist/deployments.js +17 -0
- package/dist/deployments.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.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 +2 -5
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +8 -45
- 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 +8 -4
- package/src/client.ts +47 -86
- 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/deployments.ts +42 -0
- package/src/index.ts +1 -0
- package/src/internal.ts +0 -24
- package/src/parsers.ts +0 -35
- package/src/queries.ts +11 -59
- 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
package/dist/client.d.ts
CHANGED
|
@@ -1,36 +1,28 @@
|
|
|
1
1
|
import type { ClientWithCoreApi, SuiClientRegistration } from "@mysten/sui/client";
|
|
2
2
|
import type { SuiGraphQLClient } from "@mysten/sui/graphql";
|
|
3
|
-
import type
|
|
3
|
+
import { type MisoProtocolDeployment } from "./deployments.ts";
|
|
4
4
|
import * as parsers from "./parsers.ts";
|
|
5
5
|
import * as queries from "./queries.ts";
|
|
6
|
-
import * as transactions from "./transactions.ts";
|
|
7
6
|
import * as view from "./view.ts";
|
|
8
|
-
import type { Composition, CompositionAdminCap,
|
|
7
|
+
import type { Composition, CompositionAdminCap, Recording, RecordingAdminCap, Release, ReleaseAdminCap } from "./types.ts";
|
|
9
8
|
import * as composition from "./contracts/miso/composition.ts";
|
|
10
9
|
import * as recording from "./contracts/miso/recording.ts";
|
|
11
10
|
import * as release from "./contracts/miso/release.ts";
|
|
12
|
-
import * as deal from "./contracts/miso/deal.ts";
|
|
13
11
|
import * as track from "./contracts/miso/track.ts";
|
|
14
12
|
export interface MisoOptions<Name extends string = "miso"> {
|
|
15
13
|
/** Name for the client extension. Defaults to "miso". */
|
|
16
14
|
name?: Name;
|
|
17
|
-
/** The Miso package ID. Required for type-based queries and derivation. */
|
|
18
|
-
misoPackageId: string;
|
|
19
15
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* Created once in `release::init` and shared, so it is FIXED for the lifetime
|
|
23
|
-
* of a published package — deployment config, not runtime state. Supply it
|
|
24
|
-
* (alongside `misoPackageId`, from the same deployment manifest) and
|
|
25
|
-
* `getReleaseRegistry()` needs no network call at all. Omit it and the SDK
|
|
26
|
-
* falls back to a GraphQL scan, which is why this is worth configuring.
|
|
16
|
+
* Complete custom deployment. Omit for bundled Mainnet/Testnet addresses,
|
|
17
|
+
* selected from the Sui client's `network`.
|
|
27
18
|
*/
|
|
28
|
-
|
|
19
|
+
deployment?: MisoProtocolDeployment;
|
|
20
|
+
/** @deprecated Use `deployment`. Retained for compatibility with pre-0.4 callers. */
|
|
21
|
+
misoPackageId?: string;
|
|
29
22
|
/**
|
|
30
23
|
* Optional GraphQL client, required ONLY for the global type-discovery reads
|
|
31
24
|
* the Core API cannot express: `getCompositionByShareType`,
|
|
32
|
-
* `getRecordingByShareType
|
|
33
|
-
* `releaseRegistryId` is not configured. Everything else — including every
|
|
25
|
+
* `getRecordingByShareType`. Everything else — including every
|
|
34
26
|
* `getOwned*AdminCaps` — goes over the Core API.
|
|
35
27
|
*/
|
|
36
28
|
graphqlClient?: SuiGraphQLClient;
|
|
@@ -41,14 +33,20 @@ export interface MisoOptions<Name extends string = "miso"> {
|
|
|
41
33
|
* @example
|
|
42
34
|
* ```ts
|
|
43
35
|
* const client = new SuiGrpcClient({ network: 'testnet' })
|
|
44
|
-
* .$extend(miso(
|
|
36
|
+
* .$extend(miso());
|
|
45
37
|
* const composition = await client.miso.getCompositionById('0x...');
|
|
46
38
|
* ```
|
|
47
39
|
*/
|
|
48
|
-
export declare function miso<const Name extends string = "miso">(options
|
|
49
|
-
export
|
|
40
|
+
export declare function miso<const Name extends string = "miso">(options?: MisoOptions<Name>): SuiClientRegistration<ClientWithCoreApi, Name, MisoProtocolClient>;
|
|
41
|
+
export interface MisoProtocolClientOptions {
|
|
42
|
+
deployment: MisoProtocolDeployment;
|
|
43
|
+
graphqlClient?: SuiGraphQLClient;
|
|
44
|
+
}
|
|
45
|
+
export declare class MisoProtocolClient {
|
|
50
46
|
#private;
|
|
51
|
-
constructor(client: ClientWithCoreApi, options:
|
|
47
|
+
constructor(client: ClientWithCoreApi, options: MisoProtocolClientOptions);
|
|
48
|
+
/** The exact deployment selected for this client. */
|
|
49
|
+
get deployment(): MisoProtocolDeployment;
|
|
52
50
|
getCompositionById(compositionId: string): Promise<Composition>;
|
|
53
51
|
getCompositionsByIds(ids: string[]): Promise<Record<string, Composition>>;
|
|
54
52
|
getWorksByIds(ids: queries.WorkIds): Promise<queries.WorksById>;
|
|
@@ -65,22 +63,11 @@ export declare class MisoClient {
|
|
|
65
63
|
getRecordingAdminCapById(adminCapId: string): Promise<RecordingAdminCap>;
|
|
66
64
|
getOwnedRecordingAdminCaps(owner: string): Promise<RecordingAdminCap[]>;
|
|
67
65
|
deriveRecordingAdminCapId(recordingId: string): string;
|
|
68
|
-
getDealById(dealId: string): Promise<Deal>;
|
|
69
66
|
getReleaseById(releaseId: string): Promise<Release>;
|
|
70
67
|
getReleasesByIds(ids: string[]): Promise<Record<string, Release>>;
|
|
71
68
|
getReleaseAdminCapById(adminCapId: string): Promise<ReleaseAdminCap>;
|
|
72
69
|
deriveReleaseAdminCapId(releaseId: string): string;
|
|
73
70
|
getOwnedReleaseAdminCaps(owner: string): Promise<ReleaseAdminCap[]>;
|
|
74
|
-
/**
|
|
75
|
-
* The deployment's `ReleaseRegistry` object ID.
|
|
76
|
-
*
|
|
77
|
-
* Returns the configured `releaseRegistryId` with no network call. Only when
|
|
78
|
-
* it was not configured does this fall back to a GraphQL scan — a one-time
|
|
79
|
-
* bootstrap for a fresh deployment whose id you have not recorded yet. Prefer
|
|
80
|
-
* configuring it: the registry is created once in `release::init` and never
|
|
81
|
-
* changes, so scanning for it on every call is pure overhead.
|
|
82
|
-
*/
|
|
83
|
-
getReleaseRegistry(): Promise<string>;
|
|
84
71
|
getShareCurrencyType(shareCurrencyId: string): Promise<string>;
|
|
85
72
|
/**
|
|
86
73
|
* The `TreasuryCap<shareType>` owned by `owner`. Takes the share TYPE — if you
|
|
@@ -88,17 +75,13 @@ export declare class MisoClient {
|
|
|
88
75
|
* {@link getShareCurrencyType}.
|
|
89
76
|
*/
|
|
90
77
|
getShareCurrencyTreasuryCap(shareType: string, owner: string): Promise<string>;
|
|
91
|
-
get tx(): {
|
|
92
|
-
rejectDeal: (params: Omit<transactions.RejectDealParams, "misoPackageId">) => TxThunk;
|
|
93
|
-
};
|
|
94
78
|
get view(): {
|
|
95
|
-
|
|
79
|
+
deriveTargetReleaseId: (params: view.DeriveTargetReleaseIdParams) => Promise<string>;
|
|
96
80
|
};
|
|
97
81
|
get call(): {
|
|
98
82
|
composition: typeof composition;
|
|
99
83
|
recording: typeof recording;
|
|
100
84
|
release: typeof release;
|
|
101
|
-
deal: typeof deal;
|
|
102
85
|
track: typeof track;
|
|
103
86
|
};
|
|
104
87
|
get bcs(): {
|
|
@@ -143,11 +126,6 @@ export declare class MisoClient {
|
|
|
143
126
|
length: number;
|
|
144
127
|
}, string>;
|
|
145
128
|
}, "@local-pkg/miso::release::Release">;
|
|
146
|
-
Deal: import("./contracts/utils/index.ts").MoveStruct<{
|
|
147
|
-
id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
148
|
-
release_id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
149
|
-
track_split_bps: import("./contracts/utils/index.ts").MoveTuple<readonly [import("@mysten/bcs").BcsType<number, number, "u16">], "bps::bps::BPS">;
|
|
150
|
-
}, "@local-pkg/miso::deal::Deal<phantom RecordingShare, phantom CompositionShare>">;
|
|
151
129
|
Track: import("./contracts/utils/index.ts").MoveStruct<{
|
|
152
130
|
state: import("./contracts/utils/index.ts").MoveEnum<{
|
|
153
131
|
Unassigned: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
@@ -171,30 +149,14 @@ export declare class MisoClient {
|
|
|
171
149
|
ReleasePublishedEvent: import("./contracts/utils/index.ts").MoveStruct<{
|
|
172
150
|
release_id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
173
151
|
}, "@local-pkg/miso::release::ReleasePublishedEvent">;
|
|
174
|
-
DealCreatedEvent: import("./contracts/utils/index.ts").MoveStruct<{
|
|
175
|
-
deal_id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
176
|
-
recording_id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
177
|
-
release_id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
178
|
-
track_split_bps_value: import("@mysten/bcs").BcsType<number, number, "u16">;
|
|
179
|
-
created_by: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
180
|
-
}, "@local-pkg/miso::deal::DealCreatedEvent<phantom RecordingShare, phantom CompositionShare>">;
|
|
181
|
-
DealAcceptedEvent: import("./contracts/utils/index.ts").MoveStruct<{
|
|
182
|
-
deal_id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
183
|
-
release_id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
184
|
-
}, "@local-pkg/miso::deal::DealAcceptedEvent<phantom RecordingShare, phantom CompositionShare>">;
|
|
185
|
-
DealRejectedEvent: import("./contracts/utils/index.ts").MoveStruct<{
|
|
186
|
-
deal_id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
187
|
-
release_id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
188
|
-
}, "@local-pkg/miso::deal::DealRejectedEvent<phantom RecordingShare, phantom CompositionShare>">;
|
|
189
152
|
};
|
|
190
153
|
get parse(): {
|
|
191
154
|
compositionPublishedEvent: typeof parsers.parseCompositionPublishedEvent;
|
|
192
155
|
compositionRoyaltySetEvent: typeof parsers.parseCompositionRoyaltySetEvent;
|
|
193
156
|
recordingPublishedEvent: typeof parsers.parseRecordingPublishedEvent;
|
|
194
157
|
releasePublishedEvent: typeof parsers.parseReleasePublishedEvent;
|
|
195
|
-
dealCreatedEvent: typeof parsers.parseDealCreatedEvent;
|
|
196
|
-
dealAcceptedEvent: typeof parsers.parseDealAcceptedEvent;
|
|
197
|
-
dealRejectedEvent: typeof parsers.parseDealRejectedEvent;
|
|
198
158
|
};
|
|
199
159
|
}
|
|
160
|
+
/** @deprecated Prefer the layer-specific `MisoProtocolClient` name. */
|
|
161
|
+
export { MisoProtocolClient as MisoClient };
|
|
200
162
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,kBAAkB,CAAC;AAC1B,OA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AG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAGjE,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAG1E,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAG5C,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IASnE,oBAAoB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAGpE;;;;OAIG;IACG,2BAA2B,CAC/B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC;IAMlB,IAAI,IAAI;wCAI4B,IAAI,CAAC,2BAA2B;MAGnE;IAID,IAAI,IAAI;;;;;MAQP;IAID,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAWN;IAID,IAAI,KAAK;;;;;MAOR;CAUF;AAED,uEAAuE;AACvE,OAAO,EAAE,kBAAkB,IAAI,UAAU,EAAE,CAAC"}
|
package/dist/client.js
CHANGED
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
// Copyright (c) Miso Labs, Inc.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { getMisoProtocolDeployment, } from "./deployments.js";
|
|
3
4
|
import * as parsers from "./parsers.js";
|
|
4
5
|
import * as queries from "./queries.js";
|
|
5
|
-
import * as transactions from "./transactions.js";
|
|
6
6
|
import * as view from "./view.js";
|
|
7
7
|
// Generated call modules (type-safe Move calls) and BCS structs.
|
|
8
8
|
import * as composition from "./contracts/miso/composition.js";
|
|
9
9
|
import * as recording from "./contracts/miso/recording.js";
|
|
10
10
|
import * as release from "./contracts/miso/release.js";
|
|
11
|
-
import * as deal from "./contracts/miso/deal.js";
|
|
12
11
|
import * as track from "./contracts/miso/track.js";
|
|
13
|
-
/**
|
|
14
|
-
* Wraps a builder so the client's `misoPackageId` is injected, dropping it from
|
|
15
|
-
* the caller's params. Explicit call-sites (the free functions in
|
|
16
|
-
* `./transactions`) remain available for full control.
|
|
17
|
-
*/
|
|
18
|
-
function bindPackages(fn, misoPackageId) {
|
|
19
|
-
return (params) => fn({ misoPackageId, ...params });
|
|
20
|
-
}
|
|
21
12
|
/** Defaults `options.package` to `pkg` for every call-function in a generated module. */
|
|
22
13
|
function bindModulePackage(mod, pkg) {
|
|
23
14
|
const out = {};
|
|
@@ -35,27 +26,41 @@ function bindModulePackage(mod, pkg) {
|
|
|
35
26
|
* @example
|
|
36
27
|
* ```ts
|
|
37
28
|
* const client = new SuiGrpcClient({ network: 'testnet' })
|
|
38
|
-
* .$extend(miso(
|
|
29
|
+
* .$extend(miso());
|
|
39
30
|
* const composition = await client.miso.getCompositionById('0x...');
|
|
40
31
|
* ```
|
|
41
32
|
*/
|
|
42
|
-
export function miso(options) {
|
|
33
|
+
export function miso(options = {}) {
|
|
43
34
|
const name = (options.name ?? "miso");
|
|
44
35
|
return {
|
|
45
36
|
name,
|
|
46
|
-
register: (client) =>
|
|
37
|
+
register: (client) => {
|
|
38
|
+
const deployment = options.deployment ??
|
|
39
|
+
(options.misoPackageId
|
|
40
|
+
? { packageId: options.misoPackageId }
|
|
41
|
+
: getMisoProtocolDeployment(client.network));
|
|
42
|
+
return new MisoProtocolClient(client, {
|
|
43
|
+
deployment,
|
|
44
|
+
graphqlClient: options.graphqlClient,
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
export class
|
|
49
|
+
export class MisoProtocolClient {
|
|
50
50
|
#client;
|
|
51
51
|
#graphqlClient;
|
|
52
|
-
#
|
|
53
|
-
#releaseRegistryId;
|
|
52
|
+
#deployment;
|
|
54
53
|
constructor(client, options) {
|
|
55
54
|
this.#client = client;
|
|
56
55
|
this.#graphqlClient = options.graphqlClient;
|
|
57
|
-
this.#
|
|
58
|
-
|
|
56
|
+
this.#deployment = options.deployment;
|
|
57
|
+
}
|
|
58
|
+
/** The exact deployment selected for this client. */
|
|
59
|
+
get deployment() {
|
|
60
|
+
return this.#deployment;
|
|
61
|
+
}
|
|
62
|
+
get #misoPackageId() {
|
|
63
|
+
return this.#deployment.packageId;
|
|
59
64
|
}
|
|
60
65
|
// === Composition ===
|
|
61
66
|
async getCompositionById(compositionId) {
|
|
@@ -107,10 +112,6 @@ export class MisoClient {
|
|
|
107
112
|
deriveRecordingAdminCapId(recordingId) {
|
|
108
113
|
return queries.deriveRecordingAdminCapId(recordingId, this.#misoPackageId);
|
|
109
114
|
}
|
|
110
|
-
// === Deal ===
|
|
111
|
-
async getDealById(dealId) {
|
|
112
|
-
return queries.getDealById(this.#client, dealId);
|
|
113
|
-
}
|
|
114
115
|
// === Release ===
|
|
115
116
|
async getReleaseById(releaseId) {
|
|
116
117
|
return queries.getReleaseById(this.#client, releaseId);
|
|
@@ -127,20 +128,6 @@ export class MisoClient {
|
|
|
127
128
|
async getOwnedReleaseAdminCaps(owner) {
|
|
128
129
|
return queries.getOwnedReleaseAdminCaps(this.#client, owner, this.#misoPackageId);
|
|
129
130
|
}
|
|
130
|
-
/**
|
|
131
|
-
* The deployment's `ReleaseRegistry` object ID.
|
|
132
|
-
*
|
|
133
|
-
* Returns the configured `releaseRegistryId` with no network call. Only when
|
|
134
|
-
* it was not configured does this fall back to a GraphQL scan — a one-time
|
|
135
|
-
* bootstrap for a fresh deployment whose id you have not recorded yet. Prefer
|
|
136
|
-
* configuring it: the registry is created once in `release::init` and never
|
|
137
|
-
* changes, so scanning for it on every call is pure overhead.
|
|
138
|
-
*/
|
|
139
|
-
async getReleaseRegistry() {
|
|
140
|
-
if (this.#releaseRegistryId)
|
|
141
|
-
return this.#releaseRegistryId;
|
|
142
|
-
return queries.getReleaseRegistry(this.#requireGraphQL(), this.#misoPackageId);
|
|
143
|
-
}
|
|
144
131
|
// === Share Currency ===
|
|
145
132
|
async getShareCurrencyType(shareCurrencyId) {
|
|
146
133
|
return queries.getShareCurrencyType(this.#client, shareCurrencyId);
|
|
@@ -153,25 +140,12 @@ export class MisoClient {
|
|
|
153
140
|
async getShareCurrencyTreasuryCap(shareType, owner) {
|
|
154
141
|
return queries.getShareCurrencyTreasuryCap(this.#client, shareType, owner);
|
|
155
142
|
}
|
|
156
|
-
// === Transaction builders (thunks) ===
|
|
157
|
-
// Only the `(params) => TxThunk` builders bind here. The primitives that take
|
|
158
|
-
// a `Transaction` directly and return values (`createComposition`,
|
|
159
|
-
// `createRecording`, `createRelease`, `createDeal`) are free functions by
|
|
160
|
-
// design — they thread results into a caller-owned PTB, so there is nothing
|
|
161
|
-
// to bind. Import them from the package root and pass `misoPackageId`
|
|
162
|
-
// explicitly.
|
|
163
|
-
get tx() {
|
|
164
|
-
const miso = this.#misoPackageId;
|
|
165
|
-
return {
|
|
166
|
-
rejectDeal: bindPackages(transactions.rejectDeal, miso),
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
143
|
// === Simulate-based reads (view) ===
|
|
170
144
|
get view() {
|
|
171
145
|
const client = this.#client;
|
|
172
146
|
const misoPackageId = this.#misoPackageId;
|
|
173
147
|
return {
|
|
174
|
-
|
|
148
|
+
deriveTargetReleaseId: (params) => view.deriveTargetReleaseId(client, misoPackageId, params),
|
|
175
149
|
};
|
|
176
150
|
}
|
|
177
151
|
// === Generated type-safe Move calls (for tx.add) ===
|
|
@@ -181,7 +155,6 @@ export class MisoClient {
|
|
|
181
155
|
composition: bindModulePackage(composition, pkg),
|
|
182
156
|
recording: bindModulePackage(recording, pkg),
|
|
183
157
|
release: bindModulePackage(release, pkg),
|
|
184
|
-
deal: bindModulePackage(deal, pkg),
|
|
185
158
|
track: bindModulePackage(track, pkg),
|
|
186
159
|
};
|
|
187
160
|
}
|
|
@@ -191,15 +164,11 @@ export class MisoClient {
|
|
|
191
164
|
Composition: composition.Composition,
|
|
192
165
|
Recording: recording.Recording,
|
|
193
166
|
Release: release.Release,
|
|
194
|
-
Deal: deal.Deal,
|
|
195
167
|
Track: track.Track,
|
|
196
168
|
CompositionPublishedEvent: composition.CompositionPublishedEvent,
|
|
197
169
|
CompositionRoyaltySetEvent: composition.CompositionRoyaltySetEvent,
|
|
198
170
|
RecordingPublishedEvent: recording.RecordingPublishedEvent,
|
|
199
171
|
ReleasePublishedEvent: release.ReleasePublishedEvent,
|
|
200
|
-
DealCreatedEvent: deal.DealCreatedEvent,
|
|
201
|
-
DealAcceptedEvent: deal.DealAcceptedEvent,
|
|
202
|
-
DealRejectedEvent: deal.DealRejectedEvent,
|
|
203
172
|
};
|
|
204
173
|
}
|
|
205
174
|
// === Event parsers ===
|
|
@@ -209,9 +178,6 @@ export class MisoClient {
|
|
|
209
178
|
compositionRoyaltySetEvent: parsers.parseCompositionRoyaltySetEvent,
|
|
210
179
|
recordingPublishedEvent: parsers.parseRecordingPublishedEvent,
|
|
211
180
|
releasePublishedEvent: parsers.parseReleasePublishedEvent,
|
|
212
|
-
dealCreatedEvent: parsers.parseDealCreatedEvent,
|
|
213
|
-
dealAcceptedEvent: parsers.parseDealAcceptedEvent,
|
|
214
|
-
dealRejectedEvent: parsers.parseDealRejectedEvent,
|
|
215
181
|
};
|
|
216
182
|
}
|
|
217
183
|
#requireGraphQL() {
|
|
@@ -221,4 +187,6 @@ export class MisoClient {
|
|
|
221
187
|
return this.#graphqlClient;
|
|
222
188
|
}
|
|
223
189
|
}
|
|
190
|
+
/** @deprecated Prefer the layer-specific `MisoProtocolClient` name. */
|
|
191
|
+
export { MisoProtocolClient as MisoClient };
|
|
224
192
|
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sC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,KAAK;QACP,OAAO;YACL,yBAAyB,EAAE,OAAO,CAAC,8BAA8B;YACjE,0BAA0B,EAAE,OAAO,CAAC,+BAA+B;YACnE,uBAAuB,EAAE,OAAO,CAAC,4BAA4B;YAC7D,qBAAqB,EAAE,OAAO,CAAC,0BAA0B;SAC1D,CAAC;IACJ,CAAC;IAED,eAAe;QACb,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;CACF;AAED,uEAAuE;AACvE,OAAO,EAAE,kBAAkB,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -36,14 +36,22 @@
|
|
|
36
36
|
*
|
|
37
37
|
* ### Consent scope
|
|
38
38
|
*
|
|
39
|
-
* The release digest — and therefore the derived release id every `
|
|
40
|
-
* to — binds the economics and membership of the release: the ordered
|
|
41
|
-
* `(recording, split)` pairs and the creator's nonce. It deliberately
|
|
42
|
-
* nothing else. The title — the one embedded field outside the digest — and
|
|
39
|
+
* The release digest — and therefore the derived release id every `Track` commits
|
|
40
|
+
* to at creation — binds the economics and membership of the release: the ordered
|
|
41
|
+
* list of `(recording, split)` pairs and the creator's nonce. It deliberately
|
|
42
|
+
* binds nothing else. The title — the one embedded field outside the digest — and
|
|
43
43
|
* everything in the extension layer (artwork, credits, display grouping) are
|
|
44
|
-
* chosen by the release creator, before or after
|
|
45
|
-
* and publicly attributable rather than cryptographically committed. See
|
|
46
|
-
* `
|
|
44
|
+
* chosen by the release creator, before or after tracks are created, and are
|
|
45
|
+
* trusted and publicly attributable rather than cryptographically committed. See
|
|
46
|
+
* `track::new` for the signer-side statement of this boundary.
|
|
47
|
+
*
|
|
48
|
+
* The derived id commits to a `(parent, digest)` pair, not the digest alone — so
|
|
49
|
+
* targeting an id also consents to that namespace's liveness. If the parent object
|
|
50
|
+
* is deleted, or its `&mut UID` becomes permanently unreachable, the release can
|
|
51
|
+
* never exist and every track or offer targeting it is stranded — the same
|
|
52
|
+
* blast-radius class as a release that simply never publishes. A coordinator meant
|
|
53
|
+
* to serve as the default parent namespace should therefore be shared and
|
|
54
|
+
* undeletable.
|
|
47
55
|
*
|
|
48
56
|
* ### Lifecycle and trust model
|
|
49
57
|
*
|
|
@@ -62,9 +70,8 @@
|
|
|
62
70
|
* the one trust assumption that never expires: integrators should model the cap
|
|
63
71
|
* holder as able to mutate or delete any extension data, forever.
|
|
64
72
|
*/
|
|
65
|
-
import {
|
|
73
|
+
import { MoveEnum, MoveStruct, MoveTuple, type RawTransactionArgument } from '../utils/index.js';
|
|
66
74
|
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
67
|
-
export declare const RELEASE: MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">], "@local-pkg/miso::release::RELEASE">;
|
|
68
75
|
/** Lifecycle state of a release. */
|
|
69
76
|
export declare const ReleaseState: MoveEnum<{
|
|
70
77
|
/** Release is initialized but not yet published. */
|
|
@@ -85,8 +92,8 @@ export declare const Release: MoveStruct<{
|
|
|
85
92
|
/** Title of the release. */
|
|
86
93
|
title: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
87
94
|
/**
|
|
88
|
-
* The ordered tracklist. Same shape as the digest pre-image every
|
|
89
|
-
* to; display grouping lives in the metadata extension.
|
|
95
|
+
* The ordered tracklist. Same shape as the digest pre-image every track's creator
|
|
96
|
+
* consented to; display grouping lives in the metadata extension.
|
|
90
97
|
*/
|
|
91
98
|
tracks: import("@mysten/sui/bcs").BcsType<{
|
|
92
99
|
state: import("@mysten/bcs").EnumOutputShapeWithKeys<{
|
|
@@ -109,9 +116,6 @@ export declare const Release: MoveStruct<{
|
|
|
109
116
|
export declare const ReleaseKey: MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<number[], Iterable<number> & {
|
|
110
117
|
length: number;
|
|
111
118
|
}, string>], "@local-pkg/miso::release::ReleaseKey">;
|
|
112
|
-
export declare const ReleaseRegistry: MoveStruct<{
|
|
113
|
-
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
114
|
-
}, "@local-pkg/miso::release::ReleaseRegistry">;
|
|
115
119
|
export declare const ReleaseAdminCap: MoveStruct<{
|
|
116
120
|
/** Unique identifier for this capability. */
|
|
117
121
|
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
@@ -119,10 +123,6 @@ export declare const ReleaseAdminCap: MoveStruct<{
|
|
|
119
123
|
release_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
120
124
|
}, "@local-pkg/miso::release::ReleaseAdminCap">;
|
|
121
125
|
export declare const ReleaseAdminCapKey: MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">], "@local-pkg/miso::release::ReleaseAdminCapKey">;
|
|
122
|
-
export declare const ReleaseRegistryCreatedEvent: MoveStruct<{
|
|
123
|
-
registry_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
124
|
-
created_by: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
125
|
-
}, "@local-pkg/miso::release::ReleaseRegistryCreatedEvent">;
|
|
126
126
|
export declare const ReleasePublishedEvent: MoveStruct<{
|
|
127
127
|
release_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
128
128
|
}, "@local-pkg/miso::release::ReleasePublishedEvent">;
|
|
@@ -130,7 +130,7 @@ export interface NewArguments {
|
|
|
130
130
|
title: RawTransactionArgument<string>;
|
|
131
131
|
tracks: TransactionArgument;
|
|
132
132
|
nonce: RawTransactionArgument<number | bigint>;
|
|
133
|
-
|
|
133
|
+
parent: RawTransactionArgument<string>;
|
|
134
134
|
}
|
|
135
135
|
export interface NewOptions {
|
|
136
136
|
package?: string;
|
|
@@ -138,12 +138,15 @@ export interface NewOptions {
|
|
|
138
138
|
title: RawTransactionArgument<string>,
|
|
139
139
|
tracks: TransactionArgument,
|
|
140
140
|
nonce: RawTransactionArgument<number | bigint>,
|
|
141
|
-
|
|
141
|
+
parent: RawTransactionArgument<string>
|
|
142
142
|
];
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
145
|
-
* Creates a new release with the given configuration.
|
|
146
|
-
*
|
|
145
|
+
* Creates a new release with the given configuration. Claims the release's UID as
|
|
146
|
+
* a derived child of `parent`, keyed by the release digest (see the module doc's
|
|
147
|
+
* "Consent scope" section) — so contention is per-parent, and which object serves
|
|
148
|
+
* as parent is entirely the caller's choice. Returns the release and admin
|
|
149
|
+
* capability.
|
|
147
150
|
*/
|
|
148
151
|
export declare function _new(options: NewOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
149
152
|
export interface PublishArguments {
|
|
@@ -178,27 +181,27 @@ export interface AuthorizeOptions {
|
|
|
178
181
|
}
|
|
179
182
|
/** Verifies that the admin capability matches this release. */
|
|
180
183
|
export declare function authorize(options: AuthorizeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
181
|
-
export interface
|
|
184
|
+
export interface DeriveTargetReleaseIdArguments {
|
|
182
185
|
recordingIds: RawTransactionArgument<Array<string>>;
|
|
183
186
|
trackSplitValues: RawTransactionArgument<Array<number | bigint>>;
|
|
184
187
|
nonce: RawTransactionArgument<number | bigint>;
|
|
185
|
-
|
|
188
|
+
parent: RawTransactionArgument<string>;
|
|
186
189
|
}
|
|
187
|
-
export interface
|
|
190
|
+
export interface DeriveTargetReleaseIdOptions {
|
|
188
191
|
package?: string;
|
|
189
|
-
arguments:
|
|
192
|
+
arguments: DeriveTargetReleaseIdArguments | [
|
|
190
193
|
recordingIds: RawTransactionArgument<Array<string>>,
|
|
191
194
|
trackSplitValues: RawTransactionArgument<Array<number | bigint>>,
|
|
192
195
|
nonce: RawTransactionArgument<number | bigint>,
|
|
193
|
-
|
|
196
|
+
parent: RawTransactionArgument<string>
|
|
194
197
|
];
|
|
195
198
|
}
|
|
196
199
|
/**
|
|
197
|
-
* Derives the release ID that `new()` would produce for the given inputs
|
|
198
|
-
* creating the object. This is the on-chain equivalent of the
|
|
199
|
-
* `deriveReleaseId()` function.
|
|
200
|
+
* Derives the target release ID that `new()` would produce for the given inputs
|
|
201
|
+
* and parent, without creating the object. This is the on-chain equivalent of the
|
|
202
|
+
* client-side `deriveReleaseId()` function.
|
|
200
203
|
*/
|
|
201
|
-
export declare function
|
|
204
|
+
export declare function deriveTargetReleaseId(options: DeriveTargetReleaseIdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
202
205
|
export interface IdArguments {
|
|
203
206
|
self: RawTransactionArgument<string>;
|
|
204
207
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/contracts/miso/release.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE
|
|
1
|
+
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/contracts/miso/release.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AAEH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAA0B,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEzH,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGtF,oCAAoC;AACpC,eAAO,MAAM,YAAY;IACjB,oDAAoD;;IAEpD,0EAA0E;;4CAE1E,CAAC;AACT,eAAO,MAAM,OAAO;IACZ,0CAA0C;;IAE1C,+BAA+B;;QAR/B,oDAAoD;;QAEpD,0EAA0E;;;IAQ1E,4BA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