@misofm/sdk 0.12.1 → 0.12.2

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.
@@ -27,12 +27,11 @@ export interface MisoClient {
27
27
  export interface CreateMisoClientOptions extends MisoConfigOverrides {
28
28
  /** "testnet" | "mainnet". A bare string (e.g. a Worker's `NETWORK` var) is accepted. */
29
29
  network?: Network | string;
30
- /** Complete verified configuration; required until a deployment is bundled. */
30
+ /** Complete verified configuration for a custom or unbundled deployment. */
31
31
  config?: MisoConfig;
32
32
  }
33
33
  /**
34
- * Build the client from a complete verified configuration. The network-only
35
- * shortcut remains for a future bundled deployment, but currently fails closed.
34
+ * Build the client from a bundled network or a complete verified custom config.
36
35
  */
37
36
  export declare function createMisoClient(options?: CreateMisoClientOptions): MisoClient;
38
37
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/read/client.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAQ,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAA2B,KAAK,UAAU,EAAE,KAAK,mBAAmB,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAM/G;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,cAAc,kBAAkB,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7F,oFAAoF;AACpF,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;AAErD,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,UAAU,CAAC;IACnB,4DAA4D;IAC5D,GAAG,EAAE,aAAa,GAAG;QAAE,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC;IAClD,kEAAkE;IAClE,QAAQ,E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AAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B,4EAA4E;IAC5E,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,uBAA4B,GAAG,UAAU,CA0BlF"}
@@ -23,8 +23,7 @@ function definedOverrides(value) {
23
23
  return Object.fromEntries(Object.entries(value).filter(([, item]) => item !== undefined));
24
24
  }
25
25
  /**
26
- * Build the client from a complete verified configuration. The network-only
27
- * shortcut remains for a future bundled deployment, but currently fails closed.
26
+ * Build the client from a bundled network or a complete verified custom config.
28
27
  */
29
28
  export function createMisoClient(options = {}) {
30
29
  const { network, config: providedConfig, ...overrides } = options;
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/read/client.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AACtC,EAAE;AACF,sDAAsD;AACtD,EAAE;AACF,8CAA8C;AAC9C,6EAA6E;AAC7E,6DAA6D;AAC7D,iFAAiF;AACjF,iFAAiF;AACjF,yEAAyE;AACzE,EAAE;AACF,mFAAmF;AACnF,6DAA6D;AAC7D,EAAE;AACF,gFAAgF;AAChF,0DAA0D;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,IAAI,EAA2B,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,WAAW,EAA2D,MAAM,aAAa,CAAC;AAE/G,SAAS,gBAAgB,CAAmB,KAAQ;IAClD,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAe,CAAC;AAC1G,CAAC;AAgCD;;;GAGG;AACH,MAAM,UAAU,gBAAgB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AM,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IACrF,MAAM,UAAU,GAAG,IAAI,gBAAgB,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IAE7F,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAElE,OAAO;QACL,MAAM;QACN,GAAG;QACH,QAAQ,EAAE,GAAgC;QAC1C,OAAO,EAAE,UAA8C;QACvD,UAAU;KACX,CAAC;AACJ,CAAC"}
@@ -55,10 +55,6 @@ export interface DiscoverSale {
55
55
  }
56
56
  /** Fields a deployment may override without forking the whole config (endpoints, shelf). */
57
57
  export type MisoConfigOverrides = Partial<Pick<MisoConfig, "grpcUrl" | "graphqlUrl" | "walrusAggregatorUrl" | "apiBaseUrl" | "discoverSales">>;
58
- /**
59
- * Bundled read configuration is disabled until the admin-cli publish flow has
60
- * recorded every new immutable package and singleton object. This is fail-closed
61
- * by design: old testnet types cannot be mistaken for the current ABI.
62
- */
58
+ /** The config for `network`, derived from this SDK's verified deployment map. */
63
59
  export declare function misoConfig(network: Network, overrides?: MisoConfigOverrides): MisoConfig;
64
60
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/read/config.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAE5C,qFAAqF;AACrF,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAI9D;AAED,wFAAwF;AACxF,MAAM,WAAW,WAAW;IAC1B,2EAA2E;IAC3E,QAAQ,EAAE,MA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UAAU,EAAE,SAAS,GAAG,YAAY,GAAG,qBAAqB,GAAG,YAAY,GAAG,eAAe,CAAC,CACpG,CAAC;AAEF,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,GAAE,mBAAwB,GAAG,UAAU,CA0B5F"}
@@ -7,9 +7,10 @@
7
7
  // `lib/money.ts`, `lib/pressing.ts`) lives here instead, so a redeploy is a change
8
8
  // in ONE file that every surface picks up.
9
9
  //
10
- // There are intentionally no baked network IDs while the immutable stack is
11
- // republished. A read client must receive a complete verified configuration from
12
- // its caller; silently retaining the old ABI would be unsafe.
10
+ // Testnet values are derived from the same verified deployment record exported
11
+ // by the platform SDK. Mainnet remains deliberately unavailable until a complete
12
+ // deployment is bundled for it.
13
+ import { getMisoPlatformDeployment } from "../deployments.js";
13
14
  /** Missing defaults to Testnet for local development; invalid values fail closed. */
14
15
  export function networkFrom(value) {
15
16
  if (value === undefined || value === "testnet")
@@ -18,15 +19,32 @@ export function networkFrom(value) {
18
19
  return "mainnet";
19
20
  throw new Error(`@misofm/sdk/read: unsupported network "${value}".`);
20
21
  }
21
- /**
22
- * Bundled read configuration is disabled until the admin-cli publish flow has
23
- * recorded every new immutable package and singleton object. This is fail-closed
24
- * by design: old testnet types cannot be mistaken for the current ABI.
25
- */
22
+ /** The config for `network`, derived from this SDK's verified deployment map. */
26
23
  export function misoConfig(network, overrides = {}) {
27
- void overrides;
28
- throw new Error(`@misofm/sdk/read: no bundled Miso platform deployment for network "${network}". ` +
29
- "Pass a complete verified MisoConfig to createMisoClient instead.");
24
+ const platform = getMisoPlatformDeployment(network);
25
+ const config = {
26
+ network,
27
+ deployment: platform.protocol,
28
+ protocol: {
29
+ pressing: platform.packages.pressing,
30
+ record: platform.packages.record,
31
+ releaseCoverArt: platform.packages.releaseCoverArt,
32
+ compositionCredits: platform.packages.compositionCredits,
33
+ recordingCredits: platform.packages.recordingCredits,
34
+ releaseCredits: platform.packages.releaseCredits,
35
+ credit: platform.packages.credit,
36
+ },
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
+ discoverSales: [],
46
+ };
47
+ return { ...config, ...stripUndefined(overrides) };
30
48
  }
31
49
  /** `{ a: undefined }` must not clobber a real default when spread. */
32
50
  function stripUndefined(o) {
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/read/config.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AACtC,EAAE;AACF,iFAAiF;AACjF,+EAA+E;AAC/E,yEAAyE;AACzE,mFAAmF;AACnF,2CAA2C;AAC3C,EAAE;AACF,4EAA4E;AAC5E,iFAAiF;AACjF,8DAA8D;AAM9D,qFAAqF;AACrF,MAAM,UAAU,WAAW,CAAC,KAAyB;IACnD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACjE,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,MAAM,IAAI,KAAK,CAAC,0CAA0C,KAAK,IAAI,CAAC,CAAC;AACvE,CAAC;AA8DD;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,OAAgB,EAAE,YAAiC,EAAE;IAC9E,KAAK,SAAS,CAAC;IACf,MAAM,IAAI,KAAK,CACb,sEAAsE,OAAO,KAAK;QAChF,kEAAkE,CACrE,CAAC;AACJ,CAAC;AAED,sEAAsE;AACtE,SAAS,cAAc,CAAmB,CAAI;IAC5C,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,M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AQ,CAAC,MAAM;SACjC;QACD,KAAK,EAAE;YACL,WAAW,EACT,sFAAsF;YACxF,WAAW,EAAE,CAAC;SACf;QACD,OAAO,EAAE,iCAAiC;QAC1C,UAAU,EAAE,wCAAwC;QACpD,mBAAmB,EAAE,gDAAgD;QACrE,UAAU,EAAE,6BAA6B;QACzC,aAAa,EAAE,EAAE;KAClB,CAAC;IACF,OAAO,EAAE,GAAG,MAAM,EAAE,GAAG,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC;AACrD,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,6 +1,6 @@
1
1
  {
2
2
  "name": "@misofm/sdk",
3
- "version": "0.12.1",
3
+ "version": "0.12.2",
4
4
  "packageManager": "bun@1.4.0",
5
5
  "description": "Complete client SDK for the Miso platform on Sui — high-level reads, pressings, listings, records, and work publishing.",
6
6
  "license": "Apache-2.0",
@@ -51,13 +51,12 @@ export interface MisoClient {
51
51
  export interface CreateMisoClientOptions extends MisoConfigOverrides {
52
52
  /** "testnet" | "mainnet". A bare string (e.g. a Worker's `NETWORK` var) is accepted. */
53
53
  network?: Network | string;
54
- /** Complete verified configuration; required until a deployment is bundled. */
54
+ /** Complete verified configuration for a custom or unbundled deployment. */
55
55
  config?: MisoConfig;
56
56
  }
57
57
 
58
58
  /**
59
- * Build the client from a complete verified configuration. The network-only
60
- * shortcut remains for a future bundled deployment, but currently fails closed.
59
+ * Build the client from a bundled network or a complete verified custom config.
61
60
  */
62
61
  export function createMisoClient(options: CreateMisoClientOptions = {}): MisoClient {
63
62
  const { network, config: providedConfig, ...overrides } = options;
@@ -7,11 +7,12 @@
7
7
  // `lib/money.ts`, `lib/pressing.ts`) lives here instead, so a redeploy is a change
8
8
  // in ONE file that every surface picks up.
9
9
  //
10
- // There are intentionally no baked network IDs while the immutable stack is
11
- // republished. A read client must receive a complete verified configuration from
12
- // its caller; silently retaining the old ABI would be unsafe.
10
+ // Testnet values are derived from the same verified deployment record exported
11
+ // by the platform SDK. Mainnet remains deliberately unavailable until a complete
12
+ // deployment is bundled for it.
13
13
 
14
14
  import type { MisoDeployment } from "@misonetwork/sdk/deployments";
15
+ import { getMisoPlatformDeployment } from "../deployments.ts";
15
16
 
16
17
  export type Network = "testnet" | "mainnet";
17
18
 
@@ -82,17 +83,33 @@ export type MisoConfigOverrides = Partial<
82
83
  Pick<MisoConfig, "grpcUrl" | "graphqlUrl" | "walrusAggregatorUrl" | "apiBaseUrl" | "discoverSales">
83
84
  >;
84
85
 
85
- /**
86
- * Bundled read configuration is disabled until the admin-cli publish flow has
87
- * recorded every new immutable package and singleton object. This is fail-closed
88
- * by design: old testnet types cannot be mistaken for the current ABI.
89
- */
86
+ /** The config for `network`, derived from this SDK's verified deployment map. */
90
87
  export function misoConfig(network: Network, overrides: MisoConfigOverrides = {}): MisoConfig {
91
- void overrides;
92
- throw new Error(
93
- `@misofm/sdk/read: no bundled Miso platform deployment for network "${network}". ` +
94
- "Pass a complete verified MisoConfig to createMisoClient instead.",
95
- );
88
+ const platform = getMisoPlatformDeployment(network);
89
+ const config: MisoConfig = {
90
+ network,
91
+ deployment: platform.protocol,
92
+ protocol: {
93
+ pressing: platform.packages.pressing,
94
+ record: platform.packages.record,
95
+ releaseCoverArt: platform.packages.releaseCoverArt,
96
+ compositionCredits: platform.packages.compositionCredits,
97
+ recordingCredits: platform.packages.recordingCredits,
98
+ releaseCredits: platform.packages.releaseCredits,
99
+ credit: platform.packages.credit,
100
+ },
101
+ money: {
102
+ usdCoinType:
103
+ "0x77774cb7b8cb5622b4ef2658101bf5f1e965418297fe874b683df8f760b6e749::fakeusd::FakeUsd",
104
+ usdDecimals: 6,
105
+ },
106
+ grpcUrl: "https://fullnode.testnet.sui.io",
107
+ graphqlUrl: "https://graphql.testnet.sui.io/graphql",
108
+ walrusAggregatorUrl: "https://aggregator.walrus-testnet.walrus.space",
109
+ apiBaseUrl: "https://api.testnet.miso.fm",
110
+ discoverSales: [],
111
+ };
112
+ return { ...config, ...stripUndefined(overrides) };
96
113
  }
97
114
 
98
115
  /** `{ a: undefined }` must not clobber a real default when spread. */