@misofm/sdk 0.7.1 → 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 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 { misoPlatform } from "@misofm/sdk";
65
+ import { miso } from "@misofm/sdk";
66
66
 
67
67
  const client = new SuiGrpcClient({ network: "testnet", baseUrl }).$extend(
68
- misoPlatform({ packageId: MISO_PRESSING_PACKAGE_ID, settingsId: MISO_RECORD_SETTINGS_ID }),
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.misoPlatform.getSale({
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.misoPlatform.tx.buyRecord({
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 { misoPlatform } from "@misofm/sdk";
190
+ import { miso } from "@misofm/sdk";
183
191
 
184
192
  const client = new SuiGrpcClient({ network: "testnet", baseUrl }).$extend(
185
- misoPlatform({
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.misoPlatform.tx.publishComposition({
200
+ const thunk = client.miso.tx.publishComposition({
197
201
  title: "Song Title",
198
202
  royaltyRateBps: 1000,
199
203
  shareType: "0x...::share::Share",
@@ -204,14 +208,13 @@ const thunk = client.misoPlatform.tx.publishComposition({
204
208
  });
205
209
  ```
206
210
 
207
- `client.misoPlatform.tx.publishRecording` and `publishCompositionAndRecording`
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
- `misoPackageId`/`minatoPackageId`/`releaseRegistryPackageId`/`releaseRegistryId`
211
- are optional on the client a sell-only
212
- client (e.g. a storefront that never mints new works) can omit them; the
213
- publish builders throw at call time, not at client construction, if they're
214
- missing.
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.
215
218
 
216
219
  For custom PTBs, the bare primitives (`disperseShares`, `finalizeComposition`,
217
220
  `finalizeRecording`) and the whole-graph orchestrator are exported standalone:
@@ -246,7 +249,7 @@ Publish and initialize are necessarily two transactions:
246
249
 
247
250
  ```ts
248
251
  // Sequential (one currency, two txs):
249
- const currency = await client.misoPlatform.createShareCurrency(signer, {
252
+ const currency = await client.miso.createShareCurrency(signer, {
250
253
  name: "Song Shares",
251
254
  description: "…",
252
255
  });
@@ -375,7 +378,8 @@ carry an optional `RecordingRoleLevel` (`Producer`, `Vocalist`, `Engineer`,
375
378
 
376
379
  ```
377
380
  src/
378
- client.ts the client extension misoPlatform({ packageId, settingsId, misoPackageId?, minatoPackageId?, releaseRegistryPackageId?, releaseRegistryId? })
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
379
383
  pressing.ts facade: builders, readers, and the id derivations
380
384
  queries.ts shared read plumbing (isNotFound, re-exported from @misonetwork/sdk)
381
385
  transactions.ts the TxThunk contract + the opinionated publish flow (disperse/finalize/publish*)
@@ -419,10 +423,10 @@ Paths resolve against sibling checkouts, so regenerating requires
419
423
 
420
424
  ## Dependency on `@misonetwork/sdk`
421
425
 
422
- `@misonetwork/sdk` is a `dependencies` entry (not a peer) this package
423
- imports its bare primitives and types directly, rather than registering it as
424
- a second client extension via `$extend`, so it isn't the "avoid bundling two
425
- copies of a Mysten package" situation the peer-dependency guidance targets.
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.
426
430
  `@mysten/sui` itself stays a peer dependency here, same as in
427
431
  `@misonetwork/sdk`.
428
432
 
@@ -438,6 +442,6 @@ bun install
438
442
  If you are changing both packages at once, `bun link` still works for a local
439
443
  loop — register the protocol SDK with `bun link` in its checkout, then run `bun
440
444
  link @misonetwork/sdk` here. Keep `@misonetwork/sdk` at its released semver
441
- range (`^0.5.0`) when committing. Note that `file:` does NOT work for this: Bun copies a `file:`
445
+ range (`^0.6.0`) when committing. Note that `file:` does NOT work for this: Bun copies a `file:`
442
446
  dependency while honouring `.gitignore`, and `@misonetwork/sdk` builds to a
443
447
  gitignored `dist/`, so the copy arrives empty and nothing resolves.
package/dist/client.d.ts CHANGED
@@ -1,5 +1,7 @@
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";
5
7
  import * as releaseRegistry from "./contracts/release_registry/release_registry.ts";
@@ -7,6 +9,15 @@ import type { BuyRecordParams, GetSaleParams, ListingView, OpenListingParams, Op
7
9
  import { publishShareCurrency, initializeShareCurrency } from "./transactions.ts";
8
10
  import type { TxThunk, PublishCompositionParams, PublishRecordingParams, PublishCompositionAndRecordingParams, PublishReleaseParams } from "./transactions.ts";
9
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
+ }
10
21
  export interface MisoPlatformConfig {
11
22
  /** The published `miso_pressing` package. */
12
23
  packageId: string;
@@ -41,7 +52,11 @@ type ConfiguredPublish<T> = Omit<T, "misoPackageId" | "minatoPackageId">;
41
52
  type ConfiguredRelease<T> = Omit<T, "misoPackageId" | "minatoPackageId" | "releaseRegistryPackageId" | "releaseRegistryId">;
42
53
  export declare class MisoPlatformClient {
43
54
  #private;
44
- constructor(client: ClientWithCoreApi, config: MisoPlatformConfig);
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);
45
60
  get packageId(): string;
46
61
  /** The run itself, or `null` if this release has never opened one. */
47
62
  getPressing(pressingId: string): Promise<PressingView | null>;
@@ -78,7 +93,7 @@ export declare class MisoPlatformClient {
78
93
  /** Publishes + initializes a fresh share currency (two txs). */
79
94
  createShareCurrency(signer: Signer, params: share.CreateShareCurrencyParams): Promise<share.ShareCurrency>;
80
95
  /** Generated Move-call bindings, for commands this facade doesn't wrap. */
81
- readonly call: {
96
+ get call(): {
82
97
  listing: typeof listingContract;
83
98
  pressing: typeof pressingContract;
84
99
  releaseRegistry: typeof releaseRegistry;
@@ -135,8 +150,18 @@ export declare class MisoPlatformClient {
135
150
  }, "@local-pkg/release_registry::release_registry::ReleaseRegistryCreatedEvent">;
136
151
  };
137
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>;
138
162
  /**
139
- * Registers the platform layer on a Sui client. Pass the result to `$extend`.
163
+ * @deprecated Prefer zero-config `miso()`, which registers the complete facade
164
+ * at `client.miso` and exposes the protocol layer at `client.miso.protocol`.
140
165
  *
141
166
  * `settingsId` is optional so a read-only client (an indexer, a catalog page) can
142
167
  * skip it; asking to build a purchase without it throws rather than sending a
@@ -146,5 +171,4 @@ export declare function misoPlatform(config: MisoPlatformConfig): {
146
171
  name: "misoPlatform";
147
172
  register: (client: ClientWithCoreApi) => MisoPlatformClient;
148
173
  };
149
- export {};
150
174
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,KAAK,eAAe,MAAM,sCAAsC,CAAC;AACxE,OAAO,KAAK,gBAAgB,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,eAAe,MAAM,kDAAkD,CAAC;AAgBpF,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EAKxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,OAAO,EACP,wBAAwB,EACxB,sBAAsB,EACtB,oCAAoC,EACpC,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAEpC,MAAM,WAAW,kBAAkB;IACjC,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gFAAgF;IAChF,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,gFAAgF;IAChF,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,gFAAgF;AAChF,KAAK,UAAU,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,uBAAuB,GAAG,YAAY,CAAC,CAAC;AA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,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,17 +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";
5
6
  import * as releaseRegistry from "./contracts/release_registry/release_registry.js";
6
7
  import { buyRecord, deriveListingId, derivePressingAdminCapId, derivePressingId, deriveSaleIds, getListing, getPressing, getSale, openListing, openPressing, setListingPrice, setListingState, setPressingState, } from "./pressing.js";
7
8
  import { publishShareCurrency, initializeShareCurrency, publishComposition, publishRecording, publishCompositionAndRecording, publishRelease, } from "./transactions.js";
8
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
+ }
9
22
  export class MisoPlatformClient {
10
23
  #client;
11
24
  #config;
12
- constructor(client, config) {
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) {
13
30
  this.#client = client;
14
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;
15
40
  }
16
41
  get packageId() {
17
42
  return this.#config.packageId;
@@ -105,7 +130,15 @@ export class MisoPlatformClient {
105
130
  }
106
131
  // ── Generated layer ───────────────────────────────────────────────────────
107
132
  /** Generated Move-call bindings, for commands this facade doesn't wrap. */
108
- call = { listing: listingContract, pressing: pressingContract, releaseRegistry };
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
+ }
109
142
  /** Generated BCS definitions, for parsing objects or events yourself. */
110
143
  bcs = {
111
144
  Pressing: pressingContract.Pressing,
@@ -116,8 +149,38 @@ export class MisoPlatformClient {
116
149
  ReleaseRegistryCreatedEvent: releaseRegistry.ReleaseRegistryCreatedEvent,
117
150
  };
118
151
  }
152
+ /** The full Miso client exposed by `@misofm/sdk`. */
153
+ export { MisoPlatformClient as MisoClient };
119
154
  /**
120
- * Registers the platform layer on a Sui client. Pass the result to `$extend`.
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
+ },
179
+ };
180
+ }
181
+ /**
182
+ * @deprecated Prefer zero-config `miso()`, which registers the complete facade
183
+ * at `client.miso` and exposes the protocol layer at `client.miso.protocol`.
121
184
  *
122
185
  * `settingsId` is optional so a read-only client (an indexer, a catalog page) can
123
186
  * skip it; asking to build a purchase without it throws rather than sending a
@@ -126,7 +189,16 @@ export class MisoPlatformClient {
126
189
  export function misoPlatform(config) {
127
190
  return {
128
191
  name: "misoPlatform",
129
- register: (client) => new MisoPlatformClient(client, config),
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
+ },
130
202
  };
131
203
  }
132
204
  //# sourceMappingURL=client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AA8BtC,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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,EACR,UAAU,CACX,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;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,95 @@
1
+ import { type MisoProtocolDeployment } from "@misonetwork/sdk/deployments";
2
+ /** Complete on-chain identity used by the Miso platform SDK on one network. */
3
+ export interface MisoPlatformDeployment {
4
+ /** The protocol deployment this platform deployment was built against. */
5
+ readonly protocol: MisoProtocolDeployment;
6
+ readonly packages: {
7
+ readonly pressing: string;
8
+ readonly record: string;
9
+ readonly releaseRegistry: string;
10
+ readonly minato: string;
11
+ readonly drop: string;
12
+ readonly credit: string;
13
+ readonly compositionCredits: string;
14
+ readonly recordingCredits: string;
15
+ readonly releaseCredits: string;
16
+ readonly releaseCoverArt: string;
17
+ };
18
+ readonly objects: {
19
+ readonly recordSettings: string;
20
+ readonly releaseRegistry: string;
21
+ };
22
+ /** PartyOS packages used by the composed artist and wallet reads. */
23
+ readonly party: {
24
+ readonly partyPackageId: string;
25
+ readonly partyProfilePackageId: string;
26
+ readonly countryCodePackageId: string;
27
+ readonly languageCodePackageId: string;
28
+ readonly partyMediaPackageId: string;
29
+ readonly partyRolesPackageId: string;
30
+ readonly partyTagsPackageId: string;
31
+ readonly partyGenrePackageId: string;
32
+ readonly partyCtaPackageId: string;
33
+ readonly partyPlatformLinkPackageId: string;
34
+ readonly partySocialPackageId: string;
35
+ readonly partyMusicPackageId: string;
36
+ readonly partyProLinkPackageId: string;
37
+ readonly partyFeaturedDropPackageId: string;
38
+ readonly genrePackageId: string;
39
+ };
40
+ readonly legacy: {
41
+ readonly releaseCoverArtPackages: readonly string[];
42
+ };
43
+ }
44
+ /**
45
+ * Platform deployments bundled with this SDK release.
46
+ *
47
+ * Mainnet is intentionally absent until the complete platform stack is live.
48
+ * Mainnet is intentionally unavailable until this ABI is deployed there.
49
+ */
50
+ export declare const MISO_PLATFORM_DEPLOYMENTS: {
51
+ readonly testnet: {
52
+ readonly protocol: {
53
+ readonly packageId: "0x974d453e82b09ac90d29cf65d981d3cf3cabe1e5ca9c6348f42860226ef9b5c4";
54
+ };
55
+ readonly packages: {
56
+ readonly pressing: "0xd0913b584d87a3891a8013c58644e3896f438fd948e819a69db256b47314974e";
57
+ readonly record: "0x97e2772d81528c69e21b6681f6702f90deae2a6b079e19da1df53f9f4fdd3271";
58
+ readonly releaseRegistry: "0x683b2feb784a815171d2976418345bd41c046e159dcf7a16890c766f69fd7808";
59
+ readonly minato: "0x8466e9864c1d947888e73b0e349b035bc22805579eef18f132966f56c8efe1d2";
60
+ readonly drop: "0xfc2b51f068dee9d5482d39fa017164f6a8c3601cabb59084a518de5f609ef1c7";
61
+ readonly credit: "0x0121926470393cc93b89b5b6d5067737a8bc0c1c545fb96c4447569174116174";
62
+ readonly compositionCredits: "0xfa2f62db28f2eb42c8c1a6533097fb2095649efab05c0527be1874b9be6cdc73";
63
+ readonly recordingCredits: "0xc794252bd90efb4cc224107f9dd0a56d4f4f5623783628b6af286f6535dd4c1e";
64
+ readonly releaseCredits: "0x42e2dbf6098d18782911460ecf79b338af2f1b654ef7ba99c6e7344fd4bf3f94";
65
+ readonly releaseCoverArt: "0x831a612920343696de7e8f0603ff4c0b21c43ca3de478feb96d230e263cd11d4";
66
+ };
67
+ readonly objects: {
68
+ readonly recordSettings: "0x6a005dad071562d421ad7a9d368289f5c9f0408ca495cd466a1f774d65a21fa7";
69
+ readonly releaseRegistry: "0x5941b8690916e762a7583363906496d64a6ea3e6cedb078c90e23e7c671544f2";
70
+ };
71
+ readonly party: {
72
+ readonly partyPackageId: "0x09a812d46c3aa3978703c8e5a7409ba67b9ba2dfdb91154e48ebdd9d2415da0c";
73
+ readonly partyProfilePackageId: "0xce89d3f993dfebc0b697388598c3b01e9db7b73fa2e8df18ed22608cf7ac5aee";
74
+ readonly countryCodePackageId: "0x6c3a53f228ccd089825d0fb5ee1f0465a4b7a438bc1b1735b4e2f01df8d056e9";
75
+ readonly languageCodePackageId: "0xa18b786807cfc45488691f93aa647800b77cf9993e420d110afd7024c5b15948";
76
+ readonly partyMediaPackageId: "0x7db56ef37692f84c1cfb0e0b26bde35ac9f1bc0bcd91ac5d24b3f8b4d1821349";
77
+ readonly partyRolesPackageId: "0x41a442a2c39368af2181e73ea5b90e2e0b4f89de09050c121a6e7d79e7c84415";
78
+ readonly partyTagsPackageId: "0xa4c7f6b05bb9b612ea7640974c150ce31ad7927ea82d3f9f4673acac7deef0da";
79
+ readonly partyGenrePackageId: "0x6ce063438be6cf44ccf5f17bf8892c9e0cef4e2344442aeb44412beead74d3a8";
80
+ readonly partyCtaPackageId: "0x85a312210d9ddbae535e0f933032c8a56aa3f0fe1d6c3430d4fa538765008da3";
81
+ readonly partyPlatformLinkPackageId: "0x46d9f3e05d2065a926b010fe833baf61e5c250c233d512a260cbe746b02c56af";
82
+ readonly partySocialPackageId: "0x438e767ce8f5699f12be1704a12ff69c28045ca241f890ca8a978d55e09f6541";
83
+ readonly partyMusicPackageId: "0x89add347dfa779aa77e21b1853a37f2054dbecfce29799b61463d9900877b7b1";
84
+ readonly partyProLinkPackageId: "0xe5e8a0d02b43037abb7e6ddb4b742c6197aadf2dc19910957bba98307bef4103";
85
+ readonly partyFeaturedDropPackageId: "0x1a7b926686565a6cc82a9e0630839dc1f75c9bf4fafc0ba789a05af2c3c269f0";
86
+ readonly genrePackageId: "0xcbbce10e8b0781d458e88ce99d08e0c85f1e674c5b7ec975383d74f87a1d76b1";
87
+ };
88
+ readonly legacy: {
89
+ readonly releaseCoverArtPackages: readonly ["0x25c3c87ef4823d62d80dd8bda714ef4976df0f04453997646659a6cebadd655b", "0x1ee2cae0da7595d7973c310c912434ef531589b468cc57839296810c1385f7f6", "0x7d4a205a68f8e768a408c9f4c45a4d4076722c5edeba9068c0ac058f554e964e"];
90
+ };
91
+ };
92
+ };
93
+ /** Resolve a bundled platform deployment, failing closed when it is unavailable. */
94
+ export declare function getMisoPlatformDeployment(network: string): MisoPlatformDeployment;
95
+ //# sourceMappingURL=deployments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployments.d.ts","sourceRoot":"","sources":["../src/deployments.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,8BAA8B,CAAC;AAEtC,+EAA+E;AAC/E,MAAM,WAAW,sBAAsB;IACrC,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE;QACjB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;QACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;QACpC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;QAClC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;QAChC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;KAClC,CAAC;IACF,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,cAAc,EAAE,MAAM,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+ /**
5
+ * Platform deployments bundled with this SDK release.
6
+ *
7
+ * Mainnet is intentionally absent until the complete platform stack is live.
8
+ * Mainnet is intentionally unavailable until this ABI is deployed there.
9
+ */
10
+ export const MISO_PLATFORM_DEPLOYMENTS = {
11
+ testnet: {
12
+ protocol: MISO_PROTOCOL_DEPLOYMENTS.testnet,
13
+ packages: {
14
+ pressing: "0xd0913b584d87a3891a8013c58644e3896f438fd948e819a69db256b47314974e",
15
+ record: "0x97e2772d81528c69e21b6681f6702f90deae2a6b079e19da1df53f9f4fdd3271",
16
+ releaseRegistry: "0x683b2feb784a815171d2976418345bd41c046e159dcf7a16890c766f69fd7808",
17
+ minato: "0x8466e9864c1d947888e73b0e349b035bc22805579eef18f132966f56c8efe1d2",
18
+ drop: "0xfc2b51f068dee9d5482d39fa017164f6a8c3601cabb59084a518de5f609ef1c7",
19
+ credit: "0x0121926470393cc93b89b5b6d5067737a8bc0c1c545fb96c4447569174116174",
20
+ compositionCredits: "0xfa2f62db28f2eb42c8c1a6533097fb2095649efab05c0527be1874b9be6cdc73",
21
+ recordingCredits: "0xc794252bd90efb4cc224107f9dd0a56d4f4f5623783628b6af286f6535dd4c1e",
22
+ releaseCredits: "0x42e2dbf6098d18782911460ecf79b338af2f1b654ef7ba99c6e7344fd4bf3f94",
23
+ releaseCoverArt: "0x831a612920343696de7e8f0603ff4c0b21c43ca3de478feb96d230e263cd11d4",
24
+ },
25
+ objects: {
26
+ recordSettings: "0x6a005dad071562d421ad7a9d368289f5c9f0408ca495cd466a1f774d65a21fa7",
27
+ releaseRegistry: "0x5941b8690916e762a7583363906496d64a6ea3e6cedb078c90e23e7c671544f2",
28
+ },
29
+ party: {
30
+ partyPackageId: "0x09a812d46c3aa3978703c8e5a7409ba67b9ba2dfdb91154e48ebdd9d2415da0c",
31
+ partyProfilePackageId: "0xce89d3f993dfebc0b697388598c3b01e9db7b73fa2e8df18ed22608cf7ac5aee",
32
+ countryCodePackageId: "0x6c3a53f228ccd089825d0fb5ee1f0465a4b7a438bc1b1735b4e2f01df8d056e9",
33
+ languageCodePackageId: "0xa18b786807cfc45488691f93aa647800b77cf9993e420d110afd7024c5b15948",
34
+ partyMediaPackageId: "0x7db56ef37692f84c1cfb0e0b26bde35ac9f1bc0bcd91ac5d24b3f8b4d1821349",
35
+ partyRolesPackageId: "0x41a442a2c39368af2181e73ea5b90e2e0b4f89de09050c121a6e7d79e7c84415",
36
+ partyTagsPackageId: "0xa4c7f6b05bb9b612ea7640974c150ce31ad7927ea82d3f9f4673acac7deef0da",
37
+ partyGenrePackageId: "0x6ce063438be6cf44ccf5f17bf8892c9e0cef4e2344442aeb44412beead74d3a8",
38
+ partyCtaPackageId: "0x85a312210d9ddbae535e0f933032c8a56aa3f0fe1d6c3430d4fa538765008da3",
39
+ partyPlatformLinkPackageId: "0x46d9f3e05d2065a926b010fe833baf61e5c250c233d512a260cbe746b02c56af",
40
+ partySocialPackageId: "0x438e767ce8f5699f12be1704a12ff69c28045ca241f890ca8a978d55e09f6541",
41
+ partyMusicPackageId: "0x89add347dfa779aa77e21b1853a37f2054dbecfce29799b61463d9900877b7b1",
42
+ partyProLinkPackageId: "0xe5e8a0d02b43037abb7e6ddb4b742c6197aadf2dc19910957bba98307bef4103",
43
+ partyFeaturedDropPackageId: "0x1a7b926686565a6cc82a9e0630839dc1f75c9bf4fafc0ba789a05af2c3c269f0",
44
+ genrePackageId: "0xcbbce10e8b0781d458e88ce99d08e0c85f1e674c5b7ec975383d74f87a1d76b1",
45
+ },
46
+ legacy: {
47
+ releaseCoverArtPackages: [
48
+ "0x25c3c87ef4823d62d80dd8bda714ef4976df0f04453997646659a6cebadd655b",
49
+ "0x1ee2cae0da7595d7973c310c912434ef531589b468cc57839296810c1385f7f6",
50
+ "0x7d4a205a68f8e768a408c9f4c45a4d4076722c5edeba9068c0ac058f554e964e",
51
+ ],
52
+ },
53
+ },
54
+ };
55
+ /** Resolve a bundled platform deployment, failing closed when it is unavailable. */
56
+ export function getMisoPlatformDeployment(network) {
57
+ const deployment = MISO_PLATFORM_DEPLOYMENTS[network];
58
+ if (!deployment) {
59
+ throw new Error(`@misofm/sdk: no bundled Miso platform deployment for network "${network}". ` +
60
+ "Pass an explicit deployment to miso() for custom networks.");
61
+ }
62
+ return deployment;
63
+ }
64
+ //# sourceMappingURL=deployments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployments.js","sourceRoot":"","sources":["../src/deployments.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAEtC,OAAO,EACL,yBAAyB,GAG1B,MAAM,8BAA8B,CAAC;AA6CtC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,OAAO,EAAE;QACP,QAAQ,EAAE,yBAAyB,CAAC,OAAO;QAC3C,QAAQ,EAAE;YACR,QAAQ,EACN,oEAAoE;YACtE,MAAM,EACJ,oEAAoE;YACtE,eAAe,EACb,oEAAoE;YACtE,MAAM,EACJ,oEAAoE;YACtE,IAAI,EACF,oEAAoE;YACtE,MAAM,EACJ,oEAAoE;YACtE,kBAAkB,EAChB,oEAAoE;YACtE,gBAAgB,EACd,oEAAoE;YACtE,cAAc,EACZ,oEAAoE;YACtE,eAAe,EACb,oEAAoE;SACvE;QACD,OAAO,EAAE;YACP,cAAc,EACZ,oEAAoE;YACtE,eAAe,EACb,oEAAoE;SACvE;QACD,KAAK,EAAE;YACL,cAAc,EACZ,oEAAoE;YACtE,qBAAqB,EACnB,oEAAoE;YACtE,oBAAoB,EAClB,oEAAoE;YACtE,qBAAqB,EACnB,oEAAoE;YACtE,mBAAmB,EACjB,oEAAoE;YACtE,mBAAmB,EACjB,oEAAoE;YACtE,kBAAkB,EAChB,oEAAoE;YACtE,mBAAmB,EACjB,oEAAoE;YACtE,iBAAiB,EACf,oEAAoE;YACtE,0BAA0B,EACxB,oEAAoE;YACtE,oBAAoB,EAClB,oEAAoE;YACtE,mBAAmB,EACjB,oEAAoE;YACtE,qBAAqB,EACnB,oEAAoE;YACtE,0BAA0B,EACxB,oEAAoE;YACtE,cAAc,EACZ,oEAAoE;SACvE;QACD,MAAM,EAAE;YACN,uBAAuB,EAAE;gBACvB,oEAAoE;gBACpE,oEAAoE;gBACpE,oEAAoE;aACrE;SACF;KACF;CACsE,CAAC;AAE1E,oFAAoF;AACpF,MAAM,UAAU,yBAAyB,CACvC,OAAe;IAEf,MAAM,UAAU,GACd,yBAGD,CAAC,OAAO,CAAC,CAAC;IACX,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CACb,iEAAiE,OAAO,KAAK;YAC3E,4DAA4D,CAC/D,CAAC;IACJ,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- export { misoPlatform, MisoPlatformClient } from "./client.ts";
2
- export type { MisoPlatformConfig } from "./client.ts";
1
+ export { miso, misoPlatform, MisoClient, MisoPlatformClient } from "./client.ts";
2
+ export type { MisoOptions, MisoPlatformConfig } from "./client.ts";
3
+ export * from "./deployments.ts";
3
4
  export * from "./pressing.ts";
4
5
  export * from "./transactions.ts";
5
6
  export * from "./execute.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC/D,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAK7B,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAIxC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,8BAA8B,CAAC;AAG7C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjF,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACnE,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAK7B,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAIxC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,8BAA8B,CAAC;AAG7C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -25,7 +25,8 @@
25
25
  // off it is business logic, and business logic ships from the platform package.
26
26
  // The recommended entry point is the client extension (see ./client.ts); the bare
27
27
  // builders and readers stay exported for callers that hold ids themselves.
28
- export { misoPlatform, MisoPlatformClient } from "./client.js";
28
+ export { miso, misoPlatform, MisoClient, MisoPlatformClient } from "./client.js";
29
+ export * from "./deployments.js";
29
30
  export * from "./pressing.js";
30
31
  export * from "./transactions.js";
31
32
  export * from "./execute.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAEtC,sCAAsC;AACtC,EAAE;AACF,6EAA6E;AAC7E,oEAAoE;AACpE,EAAE;AACF,+EAA+E;AAC/E,oFAAoF;AACpF,8EAA8E;AAC9E,4EAA4E;AAC5E,kEAAkE;AAClE,EAAE;AACF,6EAA6E;AAC7E,iFAA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kB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAE7B,6EAA6E;AAC7E,+EAA+E;AAC/E,oEAAoE;AACpE,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAExC,yEAAyE;AACzE,kBAAkB;AAClB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,8BAA8B,CAAC;AAE7C,sEAAsE;AACtE,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  export type Network = "testnet" | "mainnet";
2
- /** Anything but "mainnet" including unset is testnet. Mirrors miso-api's `networkFromEnv`. */
2
+ /** Missing defaults to Testnet for local development; invalid values fail closed. */
3
3
  export declare function networkFrom(value: string | undefined): Network;
4
4
  /** Package ids for the miso protocol core and the extensions the read layer touches. */
5
5
  export interface ProtocolIds {
@@ -11,6 +11,9 @@ export interface ProtocolIds {
11
11
  record: string;
12
12
  /** `miso_record` shared `Settings` object — the mint witness authorizer. */
13
13
  recordSettings: string;
14
+ /** Release coordinator package and its shared derivation-parent object. */
15
+ releaseRegistry: string;
16
+ releaseRegistryId: string;
14
17
  /** `release_cover_art` — the release cover extension. */
15
18
  releaseCoverArt: string;
16
19
  /** `composition_credits` / `recording_credits` / `release_credits` extensions. */
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/read/config.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAE5C,kGAAkG;AAClG,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAE9D;AAED,wFAAwF;AACxF,MAAM,WAAW,WAAW;IAC1B,kGAAkG;IAClG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wB,GAAG,UAAU,CAO5F"}
@@ -7,30 +7,51 @@
7
7
  // `lib/money.ts`, `lib/drops.ts`) lives here instead, so a redeploy is a change
8
8
  // in ONE file that every surface picks up.
9
9
  //
10
- // Both networks stay unavailable until the fresh protocol publish is configured;
11
- // pre-launch has no compatibility lane for the old deployment.
12
- /** Anything but "mainnet" including unset — is testnet. Mirrors miso-api's `networkFromEnv`. */
10
+ // Testnet values are baked from the verified 2026-08-19 deployment. Mainnet is
11
+ // deliberately unavailable until this ABI is deployed there.
12
+ import { MISO_PLATFORM_DEPLOYMENTS } from "../deployments.js";
13
+ /** Missing defaults to Testnet for local development; invalid values fail closed. */
13
14
  export function networkFrom(value) {
14
- return value === "mainnet" ? "mainnet" : "testnet";
15
+ if (value === undefined || value === "testnet")
16
+ return "testnet";
17
+ if (value === "mainnet")
18
+ return "mainnet";
19
+ throw new Error(`@misofm/sdk/read: unsupported network "${value}".`);
15
20
  }
16
- // TODO(publish): replace this guard with a fresh `TESTNET: MisoConfig` after
17
- // republishing every protocol package. Set every `protocol` package/object id
18
- // from that publish; do not reuse any id from the retired deployment.
19
- // TODO(publish): set `protocol.record` to the fresh `miso_record` package id;
20
- // it is distinct from the `protocol.recordSettings` shared object id.
21
- // TODO(publish): at the `ProtocolIds` declaration above, add `releaseRegistry`
22
- // and `releaseRegistryId`; set the latter from
23
- // `ReleaseRegistryCreatedEvent.registry_id` in the release_registry publish tx.
24
- // TODO(publish): recreate Discover content under the fresh packages, then add
25
- // only those release ids to `discoverReleaseIds`.
26
- const TESTNET = null;
21
+ const TESTNET = {
22
+ network: "testnet",
23
+ protocol: {
24
+ miso: MISO_PLATFORM_DEPLOYMENTS.testnet.protocol.packageId,
25
+ drop: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.drop,
26
+ record: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.record,
27
+ recordSettings: MISO_PLATFORM_DEPLOYMENTS.testnet.objects.recordSettings,
28
+ releaseRegistry: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.releaseRegistry,
29
+ releaseRegistryId: MISO_PLATFORM_DEPLOYMENTS.testnet.objects.releaseRegistry,
30
+ releaseCoverArt: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.releaseCoverArt,
31
+ compositionCredits: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.compositionCredits,
32
+ recordingCredits: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.recordingCredits,
33
+ releaseCredits: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.releaseCredits,
34
+ credit: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.credit,
35
+ },
36
+ party: MISO_PLATFORM_DEPLOYMENTS.testnet.party,
37
+ money: {
38
+ usdCoinType: "0x77774cb7b8cb5622b4ef2658101bf5f1e965418297fe874b683df8f760b6e749::fakeusd::FakeUsd",
39
+ usdDecimals: 6,
40
+ },
41
+ grpcUrl: "https://fullnode.testnet.sui.io",
42
+ graphqlUrl: "https://graphql.testnet.sui.io/graphql",
43
+ walrusAggregatorUrl: "https://aggregator.walrus-testnet.walrus.space",
44
+ apiBaseUrl: "https://api.testnet.miso.fm",
45
+ // Content from the retired deployment is intentionally not carried forward.
46
+ discoverReleaseIds: [],
47
+ };
27
48
  /**
28
49
  * The config for `network`. Mainnet throws until its packages are deployed and
29
50
  * filled in here — a mainnet worker must fail loudly, never read testnet ids.
30
51
  */
31
52
  export function misoConfig(network, overrides = {}) {
32
- if (network === "mainnet" || !TESTNET) {
33
- throw new Error("@misofm/sdk/read: no fresh deployment configuration yet. Publish the protocol packages, then fill in src/read/config.ts.");
53
+ if (network === "mainnet") {
54
+ throw new Error(`@misofm/sdk/read: no bundled Miso platform deployment for network "${network}".`);
34
55
  }
35
56
  return { ...TESTNET, ...stripUndefined(overrides) };
36
57
  }
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/read/config.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AACtC,EAAE;AACF,iFAAi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ACpD,mBAAmB,EAAE,gDAAgD;IACrE,UAAU,EAAE,6BAA6B;IACzC,4EAA4E;IAC5E,kBAAkB,EAAE,EAAE;CACvB,CAAC;AAOF;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,OAAgB,EAAE,YAAiC,EAAE;IAC9E,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CACb,sEAAsE,OAAO,IAAI,CAClF,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC;AACtD,CAAC;AAED,sEAAsE;AACtE,SAAS,cAAc,CAAmB,CAAI;IAC5C,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAe,CAAC;AAChG,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@misofm/sdk",
3
- "version": "0.7.1",
4
- "description": "Complete client SDK for the Miso platform on Sui \u2014 high-level reads, pressings, listings, records, and work publishing.",
3
+ "version": "0.8.0",
4
+ "description": "Complete client SDK for the Miso platform on Sui high-level reads, pressings, listings, records, and work publishing.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -36,6 +36,10 @@
36
36
  "types": "./dist/client.d.ts",
37
37
  "default": "./dist/client.js"
38
38
  },
39
+ "./deployments": {
40
+ "types": "./dist/deployments.d.ts",
41
+ "default": "./dist/deployments.js"
42
+ },
39
43
  "./pressing": {
40
44
  "types": "./dist/pressing.d.ts",
41
45
  "default": "./dist/pressing.js"
@@ -122,7 +126,7 @@
122
126
  },
123
127
  "dependencies": {
124
128
  "@misonetwork/miso-party": "^0.2.0",
125
- "@misonetwork/sdk": "^0.5.0"
129
+ "@misonetwork/sdk": "^0.6.0"
126
130
  },
127
131
  "main": "./dist/index.js"
128
132
  }
package/src/client.ts CHANGED
@@ -5,11 +5,11 @@
5
5
  // (https://sdk.mystenlabs.com/sui/sdk-building). Register it once and the
6
6
  // platform layer hangs off whatever client you already have:
7
7
  //
8
- // const client = new SuiGrpcClient({ network, baseUrl })
9
- // .$extend(misoPlatform({ packageId, settingsId }));
8
+ // const client = new SuiGrpcClient({ network, baseUrl }).$extend(miso());
10
9
  //
11
- // await client.misoPlatform.getSale({ releaseId, currencyType });
12
- // tx.add(client.misoPlatform.tx.buyRecord({ releaseId, currencyType, amount, recipient }));
10
+ // await client.miso.getSale({ releaseId, currencyType });
11
+ // await client.miso.protocol.getReleaseById(releaseId);
12
+ // tx.add(client.miso.tx.buyRecord({ releaseId, currencyType, amount, recipient }));
13
13
  //
14
14
  // Two things this buys over calling the bare functions:
15
15
  //
@@ -26,8 +26,16 @@
26
26
  // `tx` builds transactions without executing, `bcs` exposes the generated struct
27
27
  // definitions, `ids` is the address math that replaces a registry.
28
28
 
29
- import type { ClientWithCoreApi } from "@mysten/sui/client";
29
+ import type {
30
+ ClientWithCoreApi,
31
+ SuiClientRegistration,
32
+ } from "@mysten/sui/client";
30
33
  import type { Signer } from "@mysten/sui/cryptography";
34
+ import type { SuiGraphQLClient } from "@mysten/sui/graphql";
35
+ import {
36
+ miso as protocolMiso,
37
+ type MisoProtocolClient,
38
+ } from "@misonetwork/sdk/client";
31
39
 
32
40
  import * as listingContract from "./contracts/miso_pressing/listing.ts";
33
41
  import * as pressingContract from "./contracts/miso_pressing/pressing.ts";
@@ -74,6 +82,32 @@ import type {
74
82
  PublishReleaseParams,
75
83
  } from "./transactions.ts";
76
84
  import * as share from "./share.ts";
85
+ import {
86
+ getMisoPlatformDeployment,
87
+ type MisoPlatformDeployment,
88
+ } from "./deployments.ts";
89
+
90
+ /** Defaults `options.package` to `pkg` for every generated call function. */
91
+ function bindModulePackage<M extends object>(mod: M, pkg: string): M {
92
+ const out: Record<string, unknown> = {};
93
+ for (const [key, value] of Object.entries({ ...mod })) {
94
+ out[key] =
95
+ typeof value === "function"
96
+ ? (options: { package?: string }) =>
97
+ (value as (o: unknown) => unknown)({ package: pkg, ...options })
98
+ : value;
99
+ }
100
+ return out as M;
101
+ }
102
+
103
+ export interface MisoOptions<Name extends string = "miso"> {
104
+ /** Name for the client extension. Defaults to `miso`. */
105
+ name?: Name;
106
+ /** Complete custom deployment; omit to select the bundled client network. */
107
+ deployment?: MisoPlatformDeployment;
108
+ /** Required only by protocol methods that perform global type discovery. */
109
+ graphqlClient?: SuiGraphQLClient;
110
+ }
77
111
 
78
112
  export interface MisoPlatformConfig {
79
113
  /** The published `miso_pressing` package. */
@@ -114,10 +148,27 @@ type ConfiguredRelease<T> = Omit<T, "misoPackageId" | "minatoPackageId" | "relea
114
148
  export class MisoPlatformClient {
115
149
  readonly #client: ClientWithCoreApi;
116
150
  readonly #config: MisoPlatformConfig;
151
+ /** The permissionless protocol layer wrapped by this platform facade. */
152
+ readonly protocol: MisoProtocolClient;
153
+ /** Bundled/custom deployment selected for the full facade, when available. */
154
+ readonly deployment?: MisoPlatformDeployment;
117
155
 
118
- constructor(client: ClientWithCoreApi, config: MisoPlatformConfig) {
156
+ constructor(
157
+ client: ClientWithCoreApi,
158
+ config: MisoPlatformConfig,
159
+ protocol?: MisoProtocolClient,
160
+ deployment?: MisoPlatformDeployment,
161
+ ) {
119
162
  this.#client = client;
120
163
  this.#config = config;
164
+ this.protocol =
165
+ protocol ??
166
+ protocolMiso({
167
+ deployment: config.misoPackageId
168
+ ? { packageId: config.misoPackageId }
169
+ : undefined,
170
+ }).register(client);
171
+ this.deployment = deployment;
121
172
  }
122
173
 
123
174
  get packageId(): string {
@@ -252,7 +303,18 @@ export class MisoPlatformClient {
252
303
  // ── Generated layer ───────────────────────────────────────────────────────
253
304
 
254
305
  /** Generated Move-call bindings, for commands this facade doesn't wrap. */
255
- readonly call = { listing: listingContract, pressing: pressingContract, releaseRegistry };
306
+ get call() {
307
+ return {
308
+ listing: bindModulePackage(listingContract, this.packageId),
309
+ pressing: bindModulePackage(pressingContract, this.packageId),
310
+ releaseRegistry: this.#config.releaseRegistryPackageId
311
+ ? bindModulePackage(
312
+ releaseRegistry,
313
+ this.#config.releaseRegistryPackageId,
314
+ )
315
+ : releaseRegistry,
316
+ };
317
+ }
256
318
 
257
319
  /** Generated BCS definitions, for parsing objects or events yourself. */
258
320
  readonly bcs = {
@@ -265,8 +327,48 @@ export class MisoPlatformClient {
265
327
  };
266
328
  }
267
329
 
330
+ /** The full Miso client exposed by `@misofm/sdk`. */
331
+ export { MisoPlatformClient as MisoClient };
332
+
333
+ /**
334
+ * Registers the complete Miso facade at `client.miso`.
335
+ *
336
+ * Platform operations live directly on `client.miso`; the lower-level
337
+ * permissionless protocol SDK is available at `client.miso.protocol`.
338
+ */
339
+ export function miso<const Name extends string = "miso">(
340
+ options: MisoOptions<Name> = {},
341
+ ): SuiClientRegistration<ClientWithCoreApi, Name, MisoPlatformClient> {
342
+ const name = (options.name ?? "miso") as Name;
343
+ return {
344
+ name,
345
+ register: (client: ClientWithCoreApi) => {
346
+ const deployment =
347
+ options.deployment ?? getMisoPlatformDeployment(client.network);
348
+ const protocol = protocolMiso({
349
+ deployment: deployment.protocol,
350
+ graphqlClient: options.graphqlClient,
351
+ }).register(client);
352
+ return new MisoPlatformClient(
353
+ client,
354
+ {
355
+ packageId: deployment.packages.pressing,
356
+ settingsId: deployment.objects.recordSettings,
357
+ misoPackageId: deployment.protocol.packageId,
358
+ minatoPackageId: deployment.packages.minato,
359
+ releaseRegistryPackageId: deployment.packages.releaseRegistry,
360
+ releaseRegistryId: deployment.objects.releaseRegistry,
361
+ },
362
+ protocol,
363
+ deployment,
364
+ );
365
+ },
366
+ };
367
+ }
368
+
268
369
  /**
269
- * Registers the platform layer on a Sui client. Pass the result to `$extend`.
370
+ * @deprecated Prefer zero-config `miso()`, which registers the complete facade
371
+ * at `client.miso` and exposes the protocol layer at `client.miso.protocol`.
270
372
  *
271
373
  * `settingsId` is optional so a read-only client (an indexer, a catalog page) can
272
374
  * skip it; asking to build a purchase without it throws rather than sending a
@@ -275,6 +377,15 @@ export class MisoPlatformClient {
275
377
  export function misoPlatform(config: MisoPlatformConfig) {
276
378
  return {
277
379
  name: "misoPlatform" as const,
278
- register: (client: ClientWithCoreApi) => new MisoPlatformClient(client, config),
380
+ register: (client: ClientWithCoreApi) => {
381
+ const protocol = protocolMiso({
382
+ deployment: config.misoPackageId
383
+ ? {
384
+ packageId: config.misoPackageId,
385
+ }
386
+ : undefined,
387
+ }).register(client);
388
+ return new MisoPlatformClient(client, config, protocol);
389
+ },
279
390
  };
280
391
  }
@@ -0,0 +1,148 @@
1
+ // Copyright (c) Miso Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import {
5
+ MISO_PROTOCOL_DEPLOYMENTS,
6
+ type MisoNetwork,
7
+ type MisoProtocolDeployment,
8
+ } from "@misonetwork/sdk/deployments";
9
+
10
+ /** Complete on-chain identity used by the Miso platform SDK on one network. */
11
+ export interface MisoPlatformDeployment {
12
+ /** The protocol deployment this platform deployment was built against. */
13
+ readonly protocol: MisoProtocolDeployment;
14
+ readonly packages: {
15
+ readonly pressing: string;
16
+ readonly record: string;
17
+ readonly releaseRegistry: string;
18
+ readonly minato: string;
19
+ readonly drop: string;
20
+ readonly credit: string;
21
+ readonly compositionCredits: string;
22
+ readonly recordingCredits: string;
23
+ readonly releaseCredits: string;
24
+ readonly releaseCoverArt: string;
25
+ };
26
+ readonly objects: {
27
+ readonly recordSettings: string;
28
+ readonly releaseRegistry: string;
29
+ };
30
+ /** PartyOS packages used by the composed artist and wallet reads. */
31
+ readonly party: {
32
+ readonly partyPackageId: string;
33
+ readonly partyProfilePackageId: string;
34
+ readonly countryCodePackageId: string;
35
+ readonly languageCodePackageId: string;
36
+ readonly partyMediaPackageId: string;
37
+ readonly partyRolesPackageId: string;
38
+ readonly partyTagsPackageId: string;
39
+ readonly partyGenrePackageId: string;
40
+ readonly partyCtaPackageId: string;
41
+ readonly partyPlatformLinkPackageId: string;
42
+ readonly partySocialPackageId: string;
43
+ readonly partyMusicPackageId: string;
44
+ readonly partyProLinkPackageId: string;
45
+ readonly partyFeaturedDropPackageId: string;
46
+ readonly genrePackageId: string;
47
+ };
48
+ readonly legacy: {
49
+ readonly releaseCoverArtPackages: readonly string[];
50
+ };
51
+ }
52
+
53
+ /**
54
+ * Platform deployments bundled with this SDK release.
55
+ *
56
+ * Mainnet is intentionally absent until the complete platform stack is live.
57
+ * Mainnet is intentionally unavailable until this ABI is deployed there.
58
+ */
59
+ export const MISO_PLATFORM_DEPLOYMENTS = {
60
+ testnet: {
61
+ protocol: MISO_PROTOCOL_DEPLOYMENTS.testnet,
62
+ packages: {
63
+ pressing:
64
+ "0xd0913b584d87a3891a8013c58644e3896f438fd948e819a69db256b47314974e",
65
+ record:
66
+ "0x97e2772d81528c69e21b6681f6702f90deae2a6b079e19da1df53f9f4fdd3271",
67
+ releaseRegistry:
68
+ "0x683b2feb784a815171d2976418345bd41c046e159dcf7a16890c766f69fd7808",
69
+ minato:
70
+ "0x8466e9864c1d947888e73b0e349b035bc22805579eef18f132966f56c8efe1d2",
71
+ drop:
72
+ "0xfc2b51f068dee9d5482d39fa017164f6a8c3601cabb59084a518de5f609ef1c7",
73
+ credit:
74
+ "0x0121926470393cc93b89b5b6d5067737a8bc0c1c545fb96c4447569174116174",
75
+ compositionCredits:
76
+ "0xfa2f62db28f2eb42c8c1a6533097fb2095649efab05c0527be1874b9be6cdc73",
77
+ recordingCredits:
78
+ "0xc794252bd90efb4cc224107f9dd0a56d4f4f5623783628b6af286f6535dd4c1e",
79
+ releaseCredits:
80
+ "0x42e2dbf6098d18782911460ecf79b338af2f1b654ef7ba99c6e7344fd4bf3f94",
81
+ releaseCoverArt:
82
+ "0x831a612920343696de7e8f0603ff4c0b21c43ca3de478feb96d230e263cd11d4",
83
+ },
84
+ objects: {
85
+ recordSettings:
86
+ "0x6a005dad071562d421ad7a9d368289f5c9f0408ca495cd466a1f774d65a21fa7",
87
+ releaseRegistry:
88
+ "0x5941b8690916e762a7583363906496d64a6ea3e6cedb078c90e23e7c671544f2",
89
+ },
90
+ party: {
91
+ partyPackageId:
92
+ "0x09a812d46c3aa3978703c8e5a7409ba67b9ba2dfdb91154e48ebdd9d2415da0c",
93
+ partyProfilePackageId:
94
+ "0xce89d3f993dfebc0b697388598c3b01e9db7b73fa2e8df18ed22608cf7ac5aee",
95
+ countryCodePackageId:
96
+ "0x6c3a53f228ccd089825d0fb5ee1f0465a4b7a438bc1b1735b4e2f01df8d056e9",
97
+ languageCodePackageId:
98
+ "0xa18b786807cfc45488691f93aa647800b77cf9993e420d110afd7024c5b15948",
99
+ partyMediaPackageId:
100
+ "0x7db56ef37692f84c1cfb0e0b26bde35ac9f1bc0bcd91ac5d24b3f8b4d1821349",
101
+ partyRolesPackageId:
102
+ "0x41a442a2c39368af2181e73ea5b90e2e0b4f89de09050c121a6e7d79e7c84415",
103
+ partyTagsPackageId:
104
+ "0xa4c7f6b05bb9b612ea7640974c150ce31ad7927ea82d3f9f4673acac7deef0da",
105
+ partyGenrePackageId:
106
+ "0x6ce063438be6cf44ccf5f17bf8892c9e0cef4e2344442aeb44412beead74d3a8",
107
+ partyCtaPackageId:
108
+ "0x85a312210d9ddbae535e0f933032c8a56aa3f0fe1d6c3430d4fa538765008da3",
109
+ partyPlatformLinkPackageId:
110
+ "0x46d9f3e05d2065a926b010fe833baf61e5c250c233d512a260cbe746b02c56af",
111
+ partySocialPackageId:
112
+ "0x438e767ce8f5699f12be1704a12ff69c28045ca241f890ca8a978d55e09f6541",
113
+ partyMusicPackageId:
114
+ "0x89add347dfa779aa77e21b1853a37f2054dbecfce29799b61463d9900877b7b1",
115
+ partyProLinkPackageId:
116
+ "0xe5e8a0d02b43037abb7e6ddb4b742c6197aadf2dc19910957bba98307bef4103",
117
+ partyFeaturedDropPackageId:
118
+ "0x1a7b926686565a6cc82a9e0630839dc1f75c9bf4fafc0ba789a05af2c3c269f0",
119
+ genrePackageId:
120
+ "0xcbbce10e8b0781d458e88ce99d08e0c85f1e674c5b7ec975383d74f87a1d76b1",
121
+ },
122
+ legacy: {
123
+ releaseCoverArtPackages: [
124
+ "0x25c3c87ef4823d62d80dd8bda714ef4976df0f04453997646659a6cebadd655b",
125
+ "0x1ee2cae0da7595d7973c310c912434ef531589b468cc57839296810c1385f7f6",
126
+ "0x7d4a205a68f8e768a408c9f4c45a4d4076722c5edeba9068c0ac058f554e964e",
127
+ ],
128
+ },
129
+ },
130
+ } as const satisfies Partial<Record<MisoNetwork, MisoPlatformDeployment>>;
131
+
132
+ /** Resolve a bundled platform deployment, failing closed when it is unavailable. */
133
+ export function getMisoPlatformDeployment(
134
+ network: string,
135
+ ): MisoPlatformDeployment {
136
+ const deployment = (
137
+ MISO_PLATFORM_DEPLOYMENTS as Partial<
138
+ Record<string, MisoPlatformDeployment>
139
+ >
140
+ )[network];
141
+ if (!deployment) {
142
+ throw new Error(
143
+ `@misofm/sdk: no bundled Miso platform deployment for network "${network}". ` +
144
+ "Pass an explicit deployment to miso() for custom networks.",
145
+ );
146
+ }
147
+ return deployment;
148
+ }
package/src/index.ts CHANGED
@@ -27,8 +27,9 @@
27
27
 
28
28
  // The recommended entry point is the client extension (see ./client.ts); the bare
29
29
  // builders and readers stay exported for callers that hold ids themselves.
30
- export { misoPlatform, MisoPlatformClient } from "./client.ts";
31
- export type { MisoPlatformConfig } from "./client.ts";
30
+ export { miso, misoPlatform, MisoClient, MisoPlatformClient } from "./client.ts";
31
+ export type { MisoOptions, MisoPlatformConfig } from "./client.ts";
32
+ export * from "./deployments.ts";
32
33
  export * from "./pressing.ts";
33
34
  export * from "./transactions.ts";
34
35
  export * from "./execute.ts";
@@ -7,14 +7,18 @@
7
7
  // `lib/money.ts`, `lib/drops.ts`) lives here instead, so a redeploy is a change
8
8
  // in ONE file that every surface picks up.
9
9
  //
10
- // Both networks stay unavailable until the fresh protocol publish is configured;
11
- // pre-launch has no compatibility lane for the old deployment.
10
+ // Testnet values are baked from the verified 2026-08-19 deployment. Mainnet is
11
+ // deliberately unavailable until this ABI is deployed there.
12
+
13
+ import { MISO_PLATFORM_DEPLOYMENTS } from "../deployments.ts";
12
14
 
13
15
  export type Network = "testnet" | "mainnet";
14
16
 
15
- /** Anything but "mainnet" including unset is testnet. Mirrors miso-api's `networkFromEnv`. */
17
+ /** Missing defaults to Testnet for local development; invalid values fail closed. */
16
18
  export function networkFrom(value: string | undefined): Network {
17
- return value === "mainnet" ? "mainnet" : "testnet";
19
+ if (value === undefined || value === "testnet") return "testnet";
20
+ if (value === "mainnet") return "mainnet";
21
+ throw new Error(`@misofm/sdk/read: unsupported network "${value}".`);
18
22
  }
19
23
 
20
24
  /** Package ids for the miso protocol core and the extensions the read layer touches. */
@@ -27,6 +31,9 @@ export interface ProtocolIds {
27
31
  record: string;
28
32
  /** `miso_record` shared `Settings` object — the mint witness authorizer. */
29
33
  recordSettings: string;
34
+ /** Release coordinator package and its shared derivation-parent object. */
35
+ releaseRegistry: string;
36
+ releaseRegistryId: string;
30
37
  /** `release_cover_art` — the release cover extension. */
31
38
  releaseCoverArt: string;
32
39
  /** `composition_credits` / `recording_credits` / `release_credits` extensions. */
@@ -88,17 +95,33 @@ export interface MisoConfig {
88
95
  discoverReleaseIds: readonly string[];
89
96
  }
90
97
 
91
- // TODO(publish): replace this guard with a fresh `TESTNET: MisoConfig` after
92
- // republishing every protocol package. Set every `protocol` package/object id
93
- // from that publish; do not reuse any id from the retired deployment.
94
- // TODO(publish): set `protocol.record` to the fresh `miso_record` package id;
95
- // it is distinct from the `protocol.recordSettings` shared object id.
96
- // TODO(publish): at the `ProtocolIds` declaration above, add `releaseRegistry`
97
- // and `releaseRegistryId`; set the latter from
98
- // `ReleaseRegistryCreatedEvent.registry_id` in the release_registry publish tx.
99
- // TODO(publish): recreate Discover content under the fresh packages, then add
100
- // only those release ids to `discoverReleaseIds`.
101
- const TESTNET: MisoConfig | null = null;
98
+ const TESTNET: MisoConfig = {
99
+ network: "testnet",
100
+ protocol: {
101
+ miso: MISO_PLATFORM_DEPLOYMENTS.testnet.protocol.packageId,
102
+ drop: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.drop,
103
+ record: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.record,
104
+ recordSettings: MISO_PLATFORM_DEPLOYMENTS.testnet.objects.recordSettings,
105
+ releaseRegistry: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.releaseRegistry,
106
+ releaseRegistryId: MISO_PLATFORM_DEPLOYMENTS.testnet.objects.releaseRegistry,
107
+ releaseCoverArt: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.releaseCoverArt,
108
+ compositionCredits: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.compositionCredits,
109
+ recordingCredits: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.recordingCredits,
110
+ releaseCredits: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.releaseCredits,
111
+ credit: MISO_PLATFORM_DEPLOYMENTS.testnet.packages.credit,
112
+ },
113
+ party: MISO_PLATFORM_DEPLOYMENTS.testnet.party,
114
+ money: {
115
+ usdCoinType: "0x77774cb7b8cb5622b4ef2658101bf5f1e965418297fe874b683df8f760b6e749::fakeusd::FakeUsd",
116
+ usdDecimals: 6,
117
+ },
118
+ grpcUrl: "https://fullnode.testnet.sui.io",
119
+ graphqlUrl: "https://graphql.testnet.sui.io/graphql",
120
+ walrusAggregatorUrl: "https://aggregator.walrus-testnet.walrus.space",
121
+ apiBaseUrl: "https://api.testnet.miso.fm",
122
+ // Content from the retired deployment is intentionally not carried forward.
123
+ discoverReleaseIds: [],
124
+ };
102
125
 
103
126
  /** Fields a deployment may override without forking the whole config (endpoints, shelf). */
104
127
  export type MisoConfigOverrides = Partial<
@@ -110,9 +133,9 @@ export type MisoConfigOverrides = Partial<
110
133
  * filled in here — a mainnet worker must fail loudly, never read testnet ids.
111
134
  */
112
135
  export function misoConfig(network: Network, overrides: MisoConfigOverrides = {}): MisoConfig {
113
- if (network === "mainnet" || !TESTNET) {
136
+ if (network === "mainnet") {
114
137
  throw new Error(
115
- "@misofm/sdk/read: no fresh deployment configuration yet. Publish the protocol packages, then fill in src/read/config.ts.",
138
+ `@misofm/sdk/read: no bundled Miso platform deployment for network "${network}".`,
116
139
  );
117
140
  }
118
141
  return { ...TESTNET, ...stripUndefined(overrides) };