@misofm/sdk 0.6.0 → 0.8.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 +37 -29
- package/dist/client.d.ts +46 -6
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +97 -6
- package/dist/client.js.map +1 -1
- package/dist/contracts/release_registry/release_registry.d.ts +114 -0
- package/dist/contracts/release_registry/release_registry.d.ts.map +1 -0
- package/dist/contracts/release_registry/release_registry.js +119 -0
- package/dist/contracts/release_registry/release_registry.js.map +1 -0
- package/dist/contracts/royalty_pool/pool.d.ts +28 -2
- package/dist/contracts/royalty_pool/pool.d.ts.map +1 -1
- package/dist/contracts/royalty_pool/pool.js +28 -2
- package/dist/contracts/royalty_pool/pool.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 +1 -0
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +4 -1
- package/dist/contracts.js.map +1 -1
- package/dist/cover.d.ts +3 -6
- package/dist/cover.d.ts.map +1 -1
- package/dist/cover.js +7 -16
- package/dist/cover.js.map +1 -1
- package/dist/credits.d.ts.map +1 -1
- package/dist/credits.js +17 -43
- package/dist/credits.js.map +1 -1
- package/dist/deployments.d.ts +95 -0
- package/dist/deployments.d.ts.map +1 -0
- package/dist/deployments.js +64 -0
- package/dist/deployments.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/read/catalog.d.ts +2 -12
- package/dist/read/catalog.d.ts.map +1 -1
- package/dist/read/catalog.js +9 -24
- package/dist/read/catalog.js.map +1 -1
- package/dist/read/config.d.ts +7 -9
- package/dist/read/config.d.ts.map +1 -1
- package/dist/read/config.js +24 -38
- package/dist/read/config.js.map +1 -1
- package/dist/read/index.d.ts +1 -1
- package/dist/read/index.d.ts.map +1 -1
- package/dist/read/index.js +1 -1
- package/dist/read/index.js.map +1 -1
- package/dist/read/types.d.ts +1 -1
- package/dist/read/types.d.ts.map +1 -1
- package/dist/read/wallet.d.ts +3 -7
- package/dist/read/wallet.d.ts.map +1 -1
- package/dist/read/wallet.js +11 -38
- package/dist/read/wallet.js.map +1 -1
- package/dist/read/works.d.ts +2 -5
- package/dist/read/works.d.ts.map +1 -1
- package/dist/read/works.js +7 -37
- package/dist/read/works.js.map +1 -1
- package/dist/release-graph.d.ts +6 -19
- package/dist/release-graph.d.ts.map +1 -1
- package/dist/release-graph.js +29 -43
- package/dist/release-graph.js.map +1 -1
- package/dist/transactions.d.ts +12 -28
- package/dist/transactions.d.ts.map +1 -1
- package/dist/transactions.js +23 -28
- package/dist/transactions.js.map +1 -1
- package/package.json +8 -4
- package/src/client.ts +152 -10
- package/src/contracts/release_registry/release_registry.ts +160 -0
- package/src/contracts/royalty_pool/pool.ts +28 -2
- package/src/contracts/utils/index.ts +156 -4
- package/src/contracts.ts +5 -1
- package/src/cover.ts +8 -19
- package/src/credits.ts +23 -63
- package/src/deployments.ts +148 -0
- package/src/index.ts +6 -3
- package/src/read/catalog.ts +9 -29
- package/src/read/config.ts +29 -46
- package/src/read/index.ts +0 -1
- package/src/read/types.ts +1 -1
- package/src/read/wallet.ts +11 -37
- package/src/read/works.ts +5 -42
- package/src/release-graph.ts +40 -75
- package/src/transactions.ts +33 -62
package/README.md
CHANGED
|
@@ -62,14 +62,17 @@ Register the extension on any client implementing Sui's Core API
|
|
|
62
62
|
```ts
|
|
63
63
|
import { SuiGrpcClient } from "@mysten/sui/grpc";
|
|
64
64
|
import { Transaction } from "@mysten/sui/transactions";
|
|
65
|
-
import {
|
|
65
|
+
import { miso } from "@misofm/sdk";
|
|
66
66
|
|
|
67
67
|
const client = new SuiGrpcClient({ network: "testnet", baseUrl }).$extend(
|
|
68
|
-
|
|
68
|
+
miso(),
|
|
69
69
|
);
|
|
70
70
|
|
|
71
|
+
// The permissionless protocol SDK is part of the same facade.
|
|
72
|
+
const release = await client.miso.protocol.getReleaseById(releaseId);
|
|
73
|
+
|
|
71
74
|
// Read: run + one currency's offer, one round trip, no registry lookup.
|
|
72
|
-
const { pressing, listing } = await client.
|
|
75
|
+
const { pressing, listing } = await client.miso.getSale({
|
|
73
76
|
releaseId,
|
|
74
77
|
currencyType: USD_COIN_TYPE,
|
|
75
78
|
});
|
|
@@ -77,7 +80,7 @@ const { pressing, listing } = await client.misoPlatform.getSale({
|
|
|
77
80
|
// Write: a thunk, so it composes with protocol calls in the same PTB.
|
|
78
81
|
const tx = new Transaction();
|
|
79
82
|
tx.add(
|
|
80
|
-
client.
|
|
83
|
+
client.miso.tx.buyRecord({
|
|
81
84
|
releaseId,
|
|
82
85
|
currencyType: USD_COIN_TYPE,
|
|
83
86
|
amount: listing.price.amount,
|
|
@@ -93,6 +96,11 @@ Holding the ids yourself? Every builder and reader is exported bare, taking
|
|
|
93
96
|
import { buyRecord, getSale } from "@misofm/sdk/pressing";
|
|
94
97
|
```
|
|
95
98
|
|
|
99
|
+
Mainnet is selected automatically once the complete platform deployment is
|
|
100
|
+
included in this SDK. Until then, registering `miso()` on a Mainnet client fails
|
|
101
|
+
closed. Localnet, Devnet, forks, and private deployments can provide one complete
|
|
102
|
+
explicit deployment through `miso({ deployment })`.
|
|
103
|
+
|
|
96
104
|
### High-level platform reads
|
|
97
105
|
|
|
98
106
|
`@misofm/sdk/read` turns protocol, pressing, PartyOS, credits, cover, and wallet
|
|
@@ -179,21 +187,17 @@ back its by-value parts (the object, its admin cap, its freshly-minted share
|
|
|
179
187
|
supplies the opinionated finish on top:
|
|
180
188
|
|
|
181
189
|
```ts
|
|
182
|
-
import {
|
|
190
|
+
import { miso } from "@misofm/sdk";
|
|
183
191
|
|
|
184
192
|
const client = new SuiGrpcClient({ network: "testnet", baseUrl }).$extend(
|
|
185
|
-
|
|
186
|
-
packageId: MISO_PRESSING_PACKAGE_ID,
|
|
187
|
-
misoPackageId: MISO_PROTOCOL_PACKAGE_ID, // required for publish builders
|
|
188
|
-
minatoPackageId: MINATO_PACKAGE_ID, // required — they disperse shares via minato
|
|
189
|
-
}),
|
|
193
|
+
miso(),
|
|
190
194
|
);
|
|
191
195
|
|
|
192
196
|
// Mints the composition's share supply, disperses it to shareRecipients via
|
|
193
197
|
// minato, publishes (shares) the composition, and transfers the
|
|
194
198
|
// CompositionAdminCap to adminAddress — createComposition → finalizeComposition
|
|
195
199
|
// in one PTB.
|
|
196
|
-
const thunk = client.
|
|
200
|
+
const thunk = client.miso.tx.publishComposition({
|
|
197
201
|
title: "Song Title",
|
|
198
202
|
royaltyRateBps: 1000,
|
|
199
203
|
shareType: "0x...::share::Share",
|
|
@@ -204,13 +208,13 @@ const thunk = client.misoPlatform.tx.publishComposition({
|
|
|
204
208
|
});
|
|
205
209
|
```
|
|
206
210
|
|
|
207
|
-
`client.
|
|
211
|
+
`client.miso.tx.publishRecording` and `publishCompositionAndRecording`
|
|
208
212
|
follow the same shape (the latter atomically, borrow-before-share, in one PTB —
|
|
209
213
|
see `@misonetwork/sdk`'s README for why the ordering is load-bearing).
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
+
The protocol, pressing, record-settings, minato, and release-coordinator
|
|
215
|
+
addresses all come from the deployment selected by the Sui client's network.
|
|
216
|
+
The deprecated `misoPlatform()` constructor still accepts those values manually
|
|
217
|
+
for compatibility with existing integrations.
|
|
214
218
|
|
|
215
219
|
For custom PTBs, the bare primitives (`disperseShares`, `finalizeComposition`,
|
|
216
220
|
`finalizeRecording`) and the whole-graph orchestrator are exported standalone:
|
|
@@ -218,7 +222,7 @@ For custom PTBs, the bare primitives (`disperseShares`, `finalizeComposition`,
|
|
|
218
222
|
```ts
|
|
219
223
|
import { publishReleaseGraph } from "@misofm/sdk";
|
|
220
224
|
|
|
221
|
-
// Every composition and recording, optional royalty pools,
|
|
225
|
+
// Every composition and recording, optional royalty pools, tracks, and
|
|
222
226
|
// the release — with the release id derived ON-CHAIN — in one atomic PTB.
|
|
223
227
|
const thunk = publishReleaseGraph({
|
|
224
228
|
compositions: [{ shareType, shareCurrencyId, shareTreasuryCapId, title: "Song", royaltyRateBps: 1000, shareRecipients, adminAddress }],
|
|
@@ -232,6 +236,7 @@ const thunk = publishReleaseGraph({
|
|
|
232
236
|
},
|
|
233
237
|
misoPackageId: "0x...",
|
|
234
238
|
minatoPackageId: "0x...",
|
|
239
|
+
releaseRegistryPackageId: "0x...",
|
|
235
240
|
});
|
|
236
241
|
```
|
|
237
242
|
|
|
@@ -244,7 +249,7 @@ Publish and initialize are necessarily two transactions:
|
|
|
244
249
|
|
|
245
250
|
```ts
|
|
246
251
|
// Sequential (one currency, two txs):
|
|
247
|
-
const currency = await client.
|
|
252
|
+
const currency = await client.miso.createShareCurrency(signer, {
|
|
248
253
|
name: "Song Shares",
|
|
249
254
|
description: "…",
|
|
250
255
|
});
|
|
@@ -373,7 +378,8 @@ carry an optional `RecordingRoleLevel` (`Producer`, `Vocalist`, `Engineer`,
|
|
|
373
378
|
|
|
374
379
|
```
|
|
375
380
|
src/
|
|
376
|
-
|
|
381
|
+
deployments.ts baked per-network package and singleton object ids
|
|
382
|
+
client.ts the full client.miso facade; protocol lives at client.miso.protocol
|
|
377
383
|
pressing.ts facade: builders, readers, and the id derivations
|
|
378
384
|
queries.ts shared read plumbing (isNotFound, re-exported from @misonetwork/sdk)
|
|
379
385
|
transactions.ts the TxThunk contract + the opinionated publish flow (disperse/finalize/publish*)
|
|
@@ -401,24 +407,26 @@ the on-chain ABI:
|
|
|
401
407
|
bun run codegen # reads sui-codegen.config.ts → src/contracts/
|
|
402
408
|
```
|
|
403
409
|
|
|
404
|
-
`sui-codegen.config.ts` lists the **platform** package (`miso_pressing`)
|
|
410
|
+
`sui-codegen.config.ts` lists the **platform** package (`miso_pressing`), the
|
|
411
|
+
canonical release-minting extension (`release_registry`), and the
|
|
405
412
|
first-party **extension** packages (`royalty_pool`, `composition_royalty_pool`,
|
|
406
413
|
`recording_royalty_pool`, `cover_art`, `release_cover_art`,
|
|
407
414
|
`composition_credits`, `recording_credits`, `release_credits`). The protocol
|
|
408
|
-
CORE (`miso` — composition/recording/release/
|
|
415
|
+
CORE (`miso` — composition/recording/release/track) generates into
|
|
409
416
|
`@misonetwork/sdk` instead, which this package depends on for those bindings —
|
|
410
417
|
adding the core here to save an import is how the split this package exists to
|
|
411
418
|
enforce gets undone.
|
|
412
419
|
|
|
413
420
|
Paths resolve against sibling checkouts, so regenerating requires
|
|
414
|
-
`~/Documents/GitHub/misofm/{sdk, pressing, protocol-extensions}
|
|
421
|
+
`~/Documents/GitHub/misofm/{sdk, pressing, protocol-extensions}` and
|
|
422
|
+
`~/Documents/GitHub/misonetwork/{protocol, share}`.
|
|
415
423
|
|
|
416
424
|
## Dependency on `@misonetwork/sdk`
|
|
417
425
|
|
|
418
|
-
`@misonetwork/sdk` is a `dependencies` entry (not a peer)
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
426
|
+
`@misonetwork/sdk` is a `dependencies` entry (not a peer). This package imports
|
|
427
|
+
its primitives, deployment configuration, and protocol client directly, then
|
|
428
|
+
wraps that client at `client.miso.protocol`; applications do not install or
|
|
429
|
+
register a second protocol extension.
|
|
422
430
|
`@mysten/sui` itself stays a peer dependency here, same as in
|
|
423
431
|
`@misonetwork/sdk`.
|
|
424
432
|
|
|
@@ -432,8 +440,8 @@ bun install
|
|
|
432
440
|
```
|
|
433
441
|
|
|
434
442
|
If you are changing both packages at once, `bun link` still works for a local
|
|
435
|
-
loop — register the protocol SDK with `bun link` in its checkout, `bun
|
|
436
|
-
@misonetwork/sdk` here
|
|
437
|
-
committing. Note that `file:` does NOT work for this: Bun copies a `file:`
|
|
443
|
+
loop — register the protocol SDK with `bun link` in its checkout, then run `bun
|
|
444
|
+
link @misonetwork/sdk` here. Keep `@misonetwork/sdk` at its released semver
|
|
445
|
+
range (`^0.6.0`) when committing. Note that `file:` does NOT work for this: Bun copies a `file:`
|
|
438
446
|
dependency while honouring `.gitignore`, and `@misonetwork/sdk` builds to a
|
|
439
447
|
gitignored `dist/`, so the copy arrives empty and nothing resolves.
|
package/dist/client.d.ts
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
import type { ClientWithCoreApi } from "@mysten/sui/client";
|
|
1
|
+
import type { ClientWithCoreApi, SuiClientRegistration } from "@mysten/sui/client";
|
|
2
2
|
import type { Signer } from "@mysten/sui/cryptography";
|
|
3
|
+
import type { SuiGraphQLClient } from "@mysten/sui/graphql";
|
|
4
|
+
import { type MisoProtocolClient } from "@misonetwork/sdk/client";
|
|
3
5
|
import * as listingContract from "./contracts/miso_pressing/listing.ts";
|
|
4
6
|
import * as pressingContract from "./contracts/miso_pressing/pressing.ts";
|
|
7
|
+
import * as releaseRegistry from "./contracts/release_registry/release_registry.ts";
|
|
5
8
|
import type { BuyRecordParams, GetSaleParams, ListingView, OpenListingParams, OpenPressingParams, PressingView, SetListingPriceParams, SetListingStateParams, SetPressingStateParams } from "./pressing.ts";
|
|
6
9
|
import { publishShareCurrency, initializeShareCurrency } from "./transactions.ts";
|
|
7
|
-
import type { TxThunk, PublishCompositionParams, PublishRecordingParams, PublishCompositionAndRecordingParams } from "./transactions.ts";
|
|
10
|
+
import type { TxThunk, PublishCompositionParams, PublishRecordingParams, PublishCompositionAndRecordingParams, PublishReleaseParams } from "./transactions.ts";
|
|
8
11
|
import * as share from "./share.ts";
|
|
12
|
+
import { type MisoPlatformDeployment } from "./deployments.ts";
|
|
13
|
+
export interface MisoOptions<Name extends string = "miso"> {
|
|
14
|
+
/** Name for the client extension. Defaults to `miso`. */
|
|
15
|
+
name?: Name;
|
|
16
|
+
/** Complete custom deployment; omit to select the bundled client network. */
|
|
17
|
+
deployment?: MisoPlatformDeployment;
|
|
18
|
+
/** Required only by protocol methods that perform global type discovery. */
|
|
19
|
+
graphqlClient?: SuiGraphQLClient;
|
|
20
|
+
}
|
|
9
21
|
export interface MisoPlatformConfig {
|
|
10
22
|
/** The published `miso_pressing` package. */
|
|
11
23
|
packageId: string;
|
|
@@ -27,14 +39,24 @@ export interface MisoPlatformConfig {
|
|
|
27
39
|
* builders (they disperse shares via minato).
|
|
28
40
|
*/
|
|
29
41
|
minatoPackageId?: string;
|
|
42
|
+
/** The published `release_registry` extension package used to mint releases. */
|
|
43
|
+
releaseRegistryPackageId?: string;
|
|
44
|
+
/** The one shared `ReleaseRegistry` object created by that package's `init`. */
|
|
45
|
+
releaseRegistryId?: string;
|
|
30
46
|
}
|
|
31
47
|
/** Params with the ids this client already knows dropped from the call site. */
|
|
32
48
|
type Configured<T> = Omit<T, "misoPressingPackageId" | "settingsId">;
|
|
33
49
|
/** Publish-builder params with the protocol/minato ids this client already knows dropped. */
|
|
34
50
|
type ConfiguredPublish<T> = Omit<T, "misoPackageId" | "minatoPackageId">;
|
|
51
|
+
/** Release-builder params with this client's core, share, and registry ids dropped. */
|
|
52
|
+
type ConfiguredRelease<T> = Omit<T, "misoPackageId" | "minatoPackageId" | "releaseRegistryPackageId" | "releaseRegistryId">;
|
|
35
53
|
export declare class MisoPlatformClient {
|
|
36
54
|
#private;
|
|
37
|
-
|
|
55
|
+
/** The permissionless protocol layer wrapped by this platform facade. */
|
|
56
|
+
readonly protocol: MisoProtocolClient;
|
|
57
|
+
/** Bundled/custom deployment selected for the full facade, when available. */
|
|
58
|
+
readonly deployment?: MisoPlatformDeployment;
|
|
59
|
+
constructor(client: ClientWithCoreApi, config: MisoPlatformConfig, protocol?: MisoProtocolClient, deployment?: MisoPlatformDeployment);
|
|
38
60
|
get packageId(): string;
|
|
39
61
|
/** The run itself, or `null` if this release has never opened one. */
|
|
40
62
|
getPressing(pressingId: string): Promise<PressingView | null>;
|
|
@@ -66,13 +88,15 @@ export declare class MisoPlatformClient {
|
|
|
66
88
|
publishComposition: (p: ConfiguredPublish<PublishCompositionParams>) => TxThunk;
|
|
67
89
|
publishRecording: (p: ConfiguredPublish<PublishRecordingParams>) => TxThunk;
|
|
68
90
|
publishCompositionAndRecording: (p: ConfiguredPublish<PublishCompositionAndRecordingParams>) => TxThunk;
|
|
91
|
+
publishRelease: (p: ConfiguredRelease<PublishReleaseParams>) => TxThunk;
|
|
69
92
|
};
|
|
70
93
|
/** Publishes + initializes a fresh share currency (two txs). */
|
|
71
94
|
createShareCurrency(signer: Signer, params: share.CreateShareCurrencyParams): Promise<share.ShareCurrency>;
|
|
72
95
|
/** Generated Move-call bindings, for commands this facade doesn't wrap. */
|
|
73
|
-
|
|
96
|
+
get call(): {
|
|
74
97
|
listing: typeof listingContract;
|
|
75
98
|
pressing: typeof pressingContract;
|
|
99
|
+
releaseRegistry: typeof releaseRegistry;
|
|
76
100
|
};
|
|
77
101
|
/** Generated BCS definitions, for parsing objects or events yourself. */
|
|
78
102
|
readonly bcs: {
|
|
@@ -117,10 +141,27 @@ export declare class MisoPlatformClient {
|
|
|
117
141
|
amount: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
118
142
|
}, "Price.Floor">;
|
|
119
143
|
}, "@local-pkg/miso_pressing::listing::Price">;
|
|
144
|
+
ReleaseRegistry: import("./contracts/utils/index.ts").MoveStruct<{
|
|
145
|
+
id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
146
|
+
}, "@local-pkg/release_registry::release_registry::ReleaseRegistry">;
|
|
147
|
+
ReleaseRegistryCreatedEvent: import("./contracts/utils/index.ts").MoveStruct<{
|
|
148
|
+
registry_id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
149
|
+
created_by: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
150
|
+
}, "@local-pkg/release_registry::release_registry::ReleaseRegistryCreatedEvent">;
|
|
120
151
|
};
|
|
121
152
|
}
|
|
153
|
+
/** The full Miso client exposed by `@misofm/sdk`. */
|
|
154
|
+
export { MisoPlatformClient as MisoClient };
|
|
155
|
+
/**
|
|
156
|
+
* Registers the complete Miso facade at `client.miso`.
|
|
157
|
+
*
|
|
158
|
+
* Platform operations live directly on `client.miso`; the lower-level
|
|
159
|
+
* permissionless protocol SDK is available at `client.miso.protocol`.
|
|
160
|
+
*/
|
|
161
|
+
export declare function miso<const Name extends string = "miso">(options?: MisoOptions<Name>): SuiClientRegistration<ClientWithCoreApi, Name, MisoPlatformClient>;
|
|
122
162
|
/**
|
|
123
|
-
*
|
|
163
|
+
* @deprecated Prefer zero-config `miso()`, which registers the complete facade
|
|
164
|
+
* at `client.miso` and exposes the protocol layer at `client.miso.protocol`.
|
|
124
165
|
*
|
|
125
166
|
* `settingsId` is optional so a read-only client (an indexer, a catalog page) can
|
|
126
167
|
* skip it; asking to build a purchase without it throws rather than sending a
|
|
@@ -130,5 +171,4 @@ export declare function misoPlatform(config: MisoPlatformConfig): {
|
|
|
130
171
|
name: "misoPlatform";
|
|
131
172
|
register: (client: ClientWithCoreApi) => MisoPlatformClient;
|
|
132
173
|
};
|
|
133
|
-
export {};
|
|
134
174
|
//# 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":"AA4BA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,eAAe,MAAM,sCAAsC,CAAC;AACxE,OAAO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BAE3C,UAAU,CAAC,qBAAqB,CAAC,KAAG,OAAO;8BAE1C,UAAU,CAAC,sBAAsB,CAAC,KAAG,OAAO;;;gCAU1C,iBAAiB,CAAC,wBAAwB,CAAC,KAAG,OAAO;8BAEvD,iBAAiB,CAAC,sBAAsB,CAAC,KAAG,OAAO;4CAErC,iBAAiB,CAAC,oCAAoC,CAAC,KAAG,OAAO;4BAEjF,iBAAiB,CAAC,oBAAoB,CAAC,KAAG,OAAO;MASrE;IAIF,gEAAgE;IAC1D,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC;IAMhH,2EAA2E;IAC3E,IAAI,IAAI;;;;MAWP;IAED,yEAAyE;IACzE,QAAQ,CAAC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAOV;CACH;AAED,qDAAqD;AACrD,OAAO,EAAE,kBAAkB,IAAI,UAAU,EAAE,CAAC;AAE5C;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,KAAK,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,EACrD,OAAO,GAAE,WAAW,CAAC,IAAI,CAAM,GAC9B,qBAAqB,CAAC,iBAAiB,EAAE,IAAI,EAAE,kBAAkB,CAAC,CA0BpE;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,kBAAkB;;uBAGhC,iBAAiB;EAWvC"}
|
package/dist/client.js
CHANGED
|
@@ -1,16 +1,42 @@
|
|
|
1
1
|
// Copyright (c) Miso Labs, Inc.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { miso as protocolMiso, } from "@misonetwork/sdk/client";
|
|
3
4
|
import * as listingContract from "./contracts/miso_pressing/listing.js";
|
|
4
5
|
import * as pressingContract from "./contracts/miso_pressing/pressing.js";
|
|
6
|
+
import * as releaseRegistry from "./contracts/release_registry/release_registry.js";
|
|
5
7
|
import { buyRecord, deriveListingId, derivePressingAdminCapId, derivePressingId, deriveSaleIds, getListing, getPressing, getSale, openListing, openPressing, setListingPrice, setListingState, setPressingState, } from "./pressing.js";
|
|
6
|
-
import { publishShareCurrency, initializeShareCurrency, publishComposition, publishRecording, publishCompositionAndRecording, } from "./transactions.js";
|
|
8
|
+
import { publishShareCurrency, initializeShareCurrency, publishComposition, publishRecording, publishCompositionAndRecording, publishRelease, } from "./transactions.js";
|
|
7
9
|
import * as share from "./share.js";
|
|
10
|
+
import { getMisoPlatformDeployment, } from "./deployments.js";
|
|
11
|
+
/** Defaults `options.package` to `pkg` for every generated call function. */
|
|
12
|
+
function bindModulePackage(mod, pkg) {
|
|
13
|
+
const out = {};
|
|
14
|
+
for (const [key, value] of Object.entries({ ...mod })) {
|
|
15
|
+
out[key] =
|
|
16
|
+
typeof value === "function"
|
|
17
|
+
? (options) => value({ package: pkg, ...options })
|
|
18
|
+
: value;
|
|
19
|
+
}
|
|
20
|
+
return out;
|
|
21
|
+
}
|
|
8
22
|
export class MisoPlatformClient {
|
|
9
23
|
#client;
|
|
10
24
|
#config;
|
|
11
|
-
|
|
25
|
+
/** The permissionless protocol layer wrapped by this platform facade. */
|
|
26
|
+
protocol;
|
|
27
|
+
/** Bundled/custom deployment selected for the full facade, when available. */
|
|
28
|
+
deployment;
|
|
29
|
+
constructor(client, config, protocol, deployment) {
|
|
12
30
|
this.#client = client;
|
|
13
31
|
this.#config = config;
|
|
32
|
+
this.protocol =
|
|
33
|
+
protocol ??
|
|
34
|
+
protocolMiso({
|
|
35
|
+
deployment: config.misoPackageId
|
|
36
|
+
? { packageId: config.misoPackageId }
|
|
37
|
+
: undefined,
|
|
38
|
+
}).register(client);
|
|
39
|
+
this.deployment = deployment;
|
|
14
40
|
}
|
|
15
41
|
get packageId() {
|
|
16
42
|
return this.#config.packageId;
|
|
@@ -26,7 +52,7 @@ export class MisoPlatformClient {
|
|
|
26
52
|
const { misoPackageId } = this.#config;
|
|
27
53
|
if (!misoPackageId) {
|
|
28
54
|
throw new Error("misoPlatform: `misoPackageId` is required for the publish builders " +
|
|
29
|
-
"(publishComposition, publishRecording, publishCompositionAndRecording) — pass it to misoPlatform({ misoPackageId }).");
|
|
55
|
+
"(publishComposition, publishRecording, publishCompositionAndRecording, publishRelease) — pass it to misoPlatform({ misoPackageId }).");
|
|
30
56
|
}
|
|
31
57
|
return misoPackageId;
|
|
32
58
|
}
|
|
@@ -38,6 +64,13 @@ export class MisoPlatformClient {
|
|
|
38
64
|
}
|
|
39
65
|
return minatoPackageId;
|
|
40
66
|
}
|
|
67
|
+
#releaseRegistry() {
|
|
68
|
+
const { releaseRegistryPackageId: packageId, releaseRegistryId: id } = this.#config;
|
|
69
|
+
if (!packageId || !id) {
|
|
70
|
+
throw new Error("misoPlatform: `releaseRegistryPackageId` and `releaseRegistryId` are required to build a release — pass both to misoPlatform(...).");
|
|
71
|
+
}
|
|
72
|
+
return { packageId, id };
|
|
73
|
+
}
|
|
41
74
|
// ── Reads ─────────────────────────────────────────────────────────────────
|
|
42
75
|
/** The run itself, or `null` if this release has never opened one. */
|
|
43
76
|
getPressing(pressingId) {
|
|
@@ -80,6 +113,15 @@ export class MisoPlatformClient {
|
|
|
80
113
|
publishComposition: (p) => publishComposition({ ...p, misoPackageId: this.#misoPackageId(), minatoPackageId: this.#minatoPackageId() }),
|
|
81
114
|
publishRecording: (p) => publishRecording({ ...p, misoPackageId: this.#misoPackageId(), minatoPackageId: this.#minatoPackageId() }),
|
|
82
115
|
publishCompositionAndRecording: (p) => publishCompositionAndRecording({ ...p, misoPackageId: this.#misoPackageId(), minatoPackageId: this.#minatoPackageId() }),
|
|
116
|
+
publishRelease: (p) => {
|
|
117
|
+
const registry = this.#releaseRegistry();
|
|
118
|
+
return publishRelease({
|
|
119
|
+
...p,
|
|
120
|
+
misoPackageId: this.#misoPackageId(),
|
|
121
|
+
releaseRegistryPackageId: registry.packageId,
|
|
122
|
+
releaseRegistryId: registry.id,
|
|
123
|
+
});
|
|
124
|
+
},
|
|
83
125
|
};
|
|
84
126
|
// ── Share currency provisioning (executes; Signer pattern) ─────────────────
|
|
85
127
|
/** Publishes + initializes a fresh share currency (two txs). */
|
|
@@ -88,17 +130,57 @@ export class MisoPlatformClient {
|
|
|
88
130
|
}
|
|
89
131
|
// ── Generated layer ───────────────────────────────────────────────────────
|
|
90
132
|
/** Generated Move-call bindings, for commands this facade doesn't wrap. */
|
|
91
|
-
call
|
|
133
|
+
get call() {
|
|
134
|
+
return {
|
|
135
|
+
listing: bindModulePackage(listingContract, this.packageId),
|
|
136
|
+
pressing: bindModulePackage(pressingContract, this.packageId),
|
|
137
|
+
releaseRegistry: this.#config.releaseRegistryPackageId
|
|
138
|
+
? bindModulePackage(releaseRegistry, this.#config.releaseRegistryPackageId)
|
|
139
|
+
: releaseRegistry,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
92
142
|
/** Generated BCS definitions, for parsing objects or events yourself. */
|
|
93
143
|
bcs = {
|
|
94
144
|
Pressing: pressingContract.Pressing,
|
|
95
145
|
PressingAdminCap: pressingContract.PressingAdminCap,
|
|
96
146
|
Listing: listingContract.Listing,
|
|
97
147
|
Price: listingContract.Price,
|
|
148
|
+
ReleaseRegistry: releaseRegistry.ReleaseRegistry,
|
|
149
|
+
ReleaseRegistryCreatedEvent: releaseRegistry.ReleaseRegistryCreatedEvent,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/** The full Miso client exposed by `@misofm/sdk`. */
|
|
153
|
+
export { MisoPlatformClient as MisoClient };
|
|
154
|
+
/**
|
|
155
|
+
* Registers the complete Miso facade at `client.miso`.
|
|
156
|
+
*
|
|
157
|
+
* Platform operations live directly on `client.miso`; the lower-level
|
|
158
|
+
* permissionless protocol SDK is available at `client.miso.protocol`.
|
|
159
|
+
*/
|
|
160
|
+
export function miso(options = {}) {
|
|
161
|
+
const name = (options.name ?? "miso");
|
|
162
|
+
return {
|
|
163
|
+
name,
|
|
164
|
+
register: (client) => {
|
|
165
|
+
const deployment = options.deployment ?? getMisoPlatformDeployment(client.network);
|
|
166
|
+
const protocol = protocolMiso({
|
|
167
|
+
deployment: deployment.protocol,
|
|
168
|
+
graphqlClient: options.graphqlClient,
|
|
169
|
+
}).register(client);
|
|
170
|
+
return new MisoPlatformClient(client, {
|
|
171
|
+
packageId: deployment.packages.pressing,
|
|
172
|
+
settingsId: deployment.objects.recordSettings,
|
|
173
|
+
misoPackageId: deployment.protocol.packageId,
|
|
174
|
+
minatoPackageId: deployment.packages.minato,
|
|
175
|
+
releaseRegistryPackageId: deployment.packages.releaseRegistry,
|
|
176
|
+
releaseRegistryId: deployment.objects.releaseRegistry,
|
|
177
|
+
}, protocol, deployment);
|
|
178
|
+
},
|
|
98
179
|
};
|
|
99
180
|
}
|
|
100
181
|
/**
|
|
101
|
-
*
|
|
182
|
+
* @deprecated Prefer zero-config `miso()`, which registers the complete facade
|
|
183
|
+
* at `client.miso` and exposes the protocol layer at `client.miso.protocol`.
|
|
102
184
|
*
|
|
103
185
|
* `settingsId` is optional so a read-only client (an indexer, a catalog page) can
|
|
104
186
|
* skip it; asking to build a purchase without it throws rather than sending a
|
|
@@ -107,7 +189,16 @@ export class MisoPlatformClient {
|
|
|
107
189
|
export function misoPlatform(config) {
|
|
108
190
|
return {
|
|
109
191
|
name: "misoPlatform",
|
|
110
|
-
register: (client) =>
|
|
192
|
+
register: (client) => {
|
|
193
|
+
const protocol = protocolMiso({
|
|
194
|
+
deployment: config.misoPackageId
|
|
195
|
+
? {
|
|
196
|
+
packageId: config.misoPackageId,
|
|
197
|
+
}
|
|
198
|
+
: undefined,
|
|
199
|
+
}).register(client);
|
|
200
|
+
return new MisoPlatformClient(client, config, protocol);
|
|
201
|
+
},
|
|
111
202
|
};
|
|
112
203
|
}
|
|
113
204
|
//# 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,sCAAsC;AAiCtC,OAAO,EACL,IAAI,IAAI,YAAY,GAErB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,eAAe,MAAM,sCAAsC,CAAC;AACxE,OAAO,KAAK,gBAAgB,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,eAAe,MAAM,kDAAkD,CAAC;AACpF,OAAO,EACL,SAAS,EACT,eAAe,EACf,wBAAwB,EACxB,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,WAAW,EACX,OAAO,EACP,WAAW,EACX,YAAY,EACZ,eAAe,EACf,eAAe,EACf,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAYvB,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,EAChB,8BAA8B,EAC9B,cAAc,GACf,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,EACL,yBAAyB,GAE1B,MAAM,kBAAkB,CAAC;AAE1B,6EAA6E;AAC7E,SAAS,iBAAiB,CAAmB,GAAM,EAAE,GAAW;IAC9D,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC;QACtD,GAAG,CAAC,GAAG,CAAC;YACN,OAAO,KAAK,KAAK,UAAU;gBACzB,CAAC,CAAC,CAAC,OAA6B,EAAE,EAAE,CAC/B,KAAiC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;gBACpE,CAAC,CAAC,KAAK,CAAC;IACd,CAAC;IACD,OAAO,GAAQ,CAAC;AAClB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AACH,MAAM,UAAU,YAAY,CAAC,MAA0B;IACrD,OAAO;QACL,IAAI,EAAE,cAAuB;QAC7B,QAAQ,EAAE,CAAC,MAAyB,EAAE,EAAE;YACtC,MAAM,QAAQ,GAAG,YAAY,CAAC;gBAC5B,UAAU,EAAE,MAAM,CAAC,aAAa;oBAC9B,CAAC,CAAC;wBACE,SAAS,EAAE,MAAM,CAAC,aAAa;qBAChC;oBACH,CAAC,CAAC,SAAS;aACd,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YACpB,OAAO,IAAI,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC1D,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* The recommended canonical parent namespace for `miso::release::new`.
|
|
6
|
+
*
|
|
7
|
+
* `miso::release::new` takes `parent: &mut UID` and derives every release's id
|
|
8
|
+
* from `(parent, digest)`: core is deliberately parent-agnostic and implements no
|
|
9
|
+
* coordination policy of its own (see the "Consent scope" section of
|
|
10
|
+
* `miso::release`'s module doc). This package supplies the one recommended parent
|
|
11
|
+
* — a shared, permissionless, undeletable `UID` — and is deliberately the _only_
|
|
12
|
+
* policy it implements: it neither gates who may assemble a release through it nor
|
|
13
|
+
* interprets what a `Track` means.
|
|
14
|
+
*
|
|
15
|
+
* ### One instance, ever
|
|
16
|
+
*
|
|
17
|
+
* The module exposes no constructor: the only `ReleaseRegistry` that can ever
|
|
18
|
+
* exist is the canonical one created and shared by package initialization. "The
|
|
19
|
+
* registry" is therefore unambiguous on-chain — the type itself names the
|
|
20
|
+
* namespace, not a config convention. Every `new_release` takes `&mut` on that one
|
|
21
|
+
* shared object, so release creation through it serializes per checkpoint; the
|
|
22
|
+
* ceiling is accepted — releases are rare events. Alternative namespaces are still
|
|
23
|
+
* possible, but they live in other packages: core is parent-agnostic, and any
|
|
24
|
+
* object exposing a `&mut UID` (a release escrow, for instance) can parent its own
|
|
25
|
+
* releases; ids derived under different parents never collide, by construction of
|
|
26
|
+
* `derive_address`.
|
|
27
|
+
*
|
|
28
|
+
* ### Liveness
|
|
29
|
+
*
|
|
30
|
+
* The canonical instance is shared at publish, and this module exposes no delete
|
|
31
|
+
* function and no `uid_mut`: its only capability is being a derivation parent.
|
|
32
|
+
* That undeletability is a consent guarantee, not an accident — a `Track`'s
|
|
33
|
+
* `target_release_id` commits to this namespace's liveness (see `miso::release`'s
|
|
34
|
+
* module doc), and a deletable parent would strand every track and offer that ever
|
|
35
|
+
* targeted it. Keeping the surface to exactly one capability is what makes that
|
|
36
|
+
* guarantee durable: there is nothing else here to reason about.
|
|
37
|
+
*
|
|
38
|
+
* ### Permissionless
|
|
39
|
+
*
|
|
40
|
+
* No capability gates `new_release`: anyone holding a fully-formed `vector<Track>`
|
|
41
|
+
* may assemble and claim a release through this registry. That is not a gap —
|
|
42
|
+
* consent already lives in the `Track`s themselves, each one minted by its
|
|
43
|
+
* recording's admin via cap-gated `miso::track::new` against this exact digest.
|
|
44
|
+
* Assembly is bookkeeping over consent already given, not a second authorization
|
|
45
|
+
* step.
|
|
46
|
+
*/
|
|
47
|
+
import { MoveStruct, type RawTransactionArgument } from '../utils/index.js';
|
|
48
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
49
|
+
export declare const ReleaseRegistry: MoveStruct<{
|
|
50
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
51
|
+
}, "@local-pkg/release_registry::release_registry::ReleaseRegistry">;
|
|
52
|
+
export declare const ReleaseRegistryCreatedEvent: MoveStruct<{
|
|
53
|
+
registry_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
54
|
+
created_by: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
55
|
+
}, "@local-pkg/release_registry::release_registry::ReleaseRegistryCreatedEvent">;
|
|
56
|
+
export interface NewReleaseArguments {
|
|
57
|
+
self: RawTransactionArgument<string>;
|
|
58
|
+
title: RawTransactionArgument<string>;
|
|
59
|
+
tracks: TransactionArgument;
|
|
60
|
+
nonce: RawTransactionArgument<number | bigint>;
|
|
61
|
+
}
|
|
62
|
+
export interface NewReleaseOptions {
|
|
63
|
+
package?: string;
|
|
64
|
+
arguments: NewReleaseArguments | [
|
|
65
|
+
self: RawTransactionArgument<string>,
|
|
66
|
+
title: RawTransactionArgument<string>,
|
|
67
|
+
tracks: TransactionArgument,
|
|
68
|
+
nonce: RawTransactionArgument<number | bigint>
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Assembles a release by delegating to `miso::release::new` with this registry as
|
|
73
|
+
* parent. Returns the `(Release, ReleaseAdminCap)` pair rather than transferring
|
|
74
|
+
* or sharing either: the release is not on-chain-final until `release::publish`
|
|
75
|
+
* consumes it by value — typically later in the same PTB — and where the cap ends
|
|
76
|
+
* up is the caller's decision, not this function's.
|
|
77
|
+
*/
|
|
78
|
+
export declare function newRelease(options: NewReleaseOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
79
|
+
export interface DeriveTargetReleaseIdArguments {
|
|
80
|
+
self: RawTransactionArgument<string>;
|
|
81
|
+
recordingIds: RawTransactionArgument<Array<string>>;
|
|
82
|
+
trackSplitValues: RawTransactionArgument<Array<number | bigint>>;
|
|
83
|
+
nonce: RawTransactionArgument<number | bigint>;
|
|
84
|
+
}
|
|
85
|
+
export interface DeriveTargetReleaseIdOptions {
|
|
86
|
+
package?: string;
|
|
87
|
+
arguments: DeriveTargetReleaseIdArguments | [
|
|
88
|
+
self: RawTransactionArgument<string>,
|
|
89
|
+
recordingIds: RawTransactionArgument<Array<string>>,
|
|
90
|
+
trackSplitValues: RawTransactionArgument<Array<number | bigint>>,
|
|
91
|
+
nonce: RawTransactionArgument<number | bigint>
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Derives the release id `new_release` would produce for the given inputs under
|
|
96
|
+
* this registry, without creating anything. Delegates to
|
|
97
|
+
* `miso::release::derive_target_release_id` with this registry's own id as parent.
|
|
98
|
+
*/
|
|
99
|
+
export declare function deriveTargetReleaseId(options: DeriveTargetReleaseIdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
100
|
+
export interface IdArguments {
|
|
101
|
+
self: RawTransactionArgument<string>;
|
|
102
|
+
}
|
|
103
|
+
export interface IdOptions {
|
|
104
|
+
package?: string;
|
|
105
|
+
arguments: IdArguments | [
|
|
106
|
+
self: RawTransactionArgument<string>
|
|
107
|
+
];
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Returns the registry's object id — the derivation parent that
|
|
111
|
+
* `derive_target_release_id` and `new_release` both commit to.
|
|
112
|
+
*/
|
|
113
|
+
export declare function id(options: IdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
114
|
+
//# sourceMappingURL=release_registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release_registry.d.ts","sourceRoot":"","sources":["../../../src/contracts/release_registry/release_registry.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAE,UAAU,EAA0B,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEpG,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEtF,eAAO,MAAM,eAAe;;oEAEpB,CAAC;AACT,eAAO,MAAM,2BAA2B;;;gFAGhC,CAAC;AACT,MAAM,WAAW,mBAAmB;IAChC,IAAI,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