@misofm/sdk 0.7.1 → 0.8.1
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 +28 -24
- package/dist/client.d.ts +33 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +86 -4
- package/dist/client.js.map +1 -1
- package/dist/deployments.d.ts +110 -0
- package/dist/deployments.d.ts.map +1 -0
- package/dist/deployments.js +69 -0
- package/dist/deployments.js.map +1 -0
- package/dist/execute.d.ts +1 -0
- package/dist/execute.d.ts.map +1 -1
- package/dist/execute.js +4 -0
- package/dist/execute.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/read/config.d.ts +4 -1
- package/dist/read/config.d.ts.map +1 -1
- package/dist/read/config.js +38 -17
- package/dist/read/config.js.map +1 -1
- package/package.json +7 -3
- package/src/client.ts +139 -9
- package/src/deployments.ts +168 -0
- package/src/execute.ts +5 -0
- package/src/index.ts +7 -2
- package/src/read/config.ts +40 -17
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;AAC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ACzE,kBAAkB;AAClB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,8BAA8B,CAAC;AAE7C,sEAAsE;AACtE,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC"}
|
package/dist/read/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type Network = "testnet" | "mainnet";
|
|
2
|
-
/**
|
|
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":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/read/config.ts"],"names":[],"mappings":"AAcA,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,kGAAkG;IAClG,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,mFAAmF;IACnF,MAAM,EAAE,MAAM,CAAC;IAC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AA4E;IAC5E,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,qGAAqG;IACrG,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AA8BD,4FAA4F;AAC5F,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACvC,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,YAAY,GAAG,qBAAqB,GAAG,YAAY,GAAG,oBAAoB,CAAC,CACzG,CAAC;AAEF;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,GAAE,mBAAwB,GAAG,UAAU,CAO5F"}
|
package/dist/read/config.js
CHANGED
|
@@ -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
|
-
//
|
|
11
|
-
//
|
|
12
|
-
|
|
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
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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"
|
|
33
|
-
throw new Error(
|
|
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
|
}
|
package/dist/read/config.js.map
CHANGED
|
@@ -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,gFAAgF;AAChF,2CAA2C;AAC3C,EAAE;AACF
|
|
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,gFAAgF;AAChF,2CAA2C;AAC3C,EAAE;AACF,+EAA+E;AAC/E,6DAA6D;AAE7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAI9D,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;AA4ED,MAAM,OAAO,GAAe;IAC1B,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE;QACR,IAAI,EAAE,yBAAyB,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS;QAC1D,IAAI,EAAE,yBAAyB,CAAC,OAAO,CAAC,QAAQ,CAAC,IA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AAW,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.
|
|
4
|
-
"description": "Complete client SDK for the Miso platform on Sui
|
|
3
|
+
"version": "0.8.1",
|
|
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.
|
|
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.
|
|
12
|
-
//
|
|
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 {
|
|
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,36 @@ import type {
|
|
|
74
82
|
PublishReleaseParams,
|
|
75
83
|
} from "./transactions.ts";
|
|
76
84
|
import * as share from "./share.ts";
|
|
85
|
+
import {
|
|
86
|
+
publishReleaseGraph,
|
|
87
|
+
type PublishReleaseGraphParams,
|
|
88
|
+
} from "./release-graph.ts";
|
|
89
|
+
import {
|
|
90
|
+
getMisoPlatformDeployment,
|
|
91
|
+
type MisoPlatformDeployment,
|
|
92
|
+
} from "./deployments.ts";
|
|
93
|
+
|
|
94
|
+
/** Defaults `options.package` to `pkg` for every generated call function. */
|
|
95
|
+
function bindModulePackage<M extends object>(mod: M, pkg: string): M {
|
|
96
|
+
const out: Record<string, unknown> = {};
|
|
97
|
+
for (const [key, value] of Object.entries({ ...mod })) {
|
|
98
|
+
out[key] =
|
|
99
|
+
typeof value === "function"
|
|
100
|
+
? (options: { package?: string }) =>
|
|
101
|
+
(value as (o: unknown) => unknown)({ package: pkg, ...options })
|
|
102
|
+
: value;
|
|
103
|
+
}
|
|
104
|
+
return out as M;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface MisoOptions<Name extends string = "miso"> {
|
|
108
|
+
/** Name for the client extension. Defaults to `miso`. */
|
|
109
|
+
name?: Name;
|
|
110
|
+
/** Complete custom deployment; omit to select the bundled client network. */
|
|
111
|
+
deployment?: MisoPlatformDeployment;
|
|
112
|
+
/** Required only by protocol methods that perform global type discovery. */
|
|
113
|
+
graphqlClient?: SuiGraphQLClient;
|
|
114
|
+
}
|
|
77
115
|
|
|
78
116
|
export interface MisoPlatformConfig {
|
|
79
117
|
/** The published `miso_pressing` package. */
|
|
@@ -111,13 +149,36 @@ type ConfiguredPublish<T> = Omit<T, "misoPackageId" | "minatoPackageId">;
|
|
|
111
149
|
/** Release-builder params with this client's core, share, and registry ids dropped. */
|
|
112
150
|
type ConfiguredRelease<T> = Omit<T, "misoPackageId" | "minatoPackageId" | "releaseRegistryPackageId" | "releaseRegistryId">;
|
|
113
151
|
|
|
152
|
+
/** Whole-graph params with this client's package ids dropped. */
|
|
153
|
+
export type ConfiguredReleaseGraphParams = Omit<
|
|
154
|
+
PublishReleaseGraphParams,
|
|
155
|
+
"misoPackageId" | "minatoPackageId" | "releaseRegistryPackageId"
|
|
156
|
+
>;
|
|
157
|
+
|
|
114
158
|
export class MisoPlatformClient {
|
|
115
159
|
readonly #client: ClientWithCoreApi;
|
|
116
160
|
readonly #config: MisoPlatformConfig;
|
|
161
|
+
/** The permissionless protocol layer wrapped by this platform facade. */
|
|
162
|
+
readonly protocol: MisoProtocolClient;
|
|
163
|
+
/** Bundled/custom deployment selected for the full facade, when available. */
|
|
164
|
+
readonly deployment?: MisoPlatformDeployment;
|
|
117
165
|
|
|
118
|
-
constructor(
|
|
166
|
+
constructor(
|
|
167
|
+
client: ClientWithCoreApi,
|
|
168
|
+
config: MisoPlatformConfig,
|
|
169
|
+
protocol?: MisoProtocolClient,
|
|
170
|
+
deployment?: MisoPlatformDeployment,
|
|
171
|
+
) {
|
|
119
172
|
this.#client = client;
|
|
120
173
|
this.#config = config;
|
|
174
|
+
this.protocol =
|
|
175
|
+
protocol ??
|
|
176
|
+
protocolMiso({
|
|
177
|
+
deployment: config.misoPackageId
|
|
178
|
+
? { packageId: config.misoPackageId }
|
|
179
|
+
: undefined,
|
|
180
|
+
}).register(client);
|
|
181
|
+
this.deployment = deployment;
|
|
121
182
|
}
|
|
122
183
|
|
|
123
184
|
get packageId(): string {
|
|
@@ -240,6 +301,15 @@ export class MisoPlatformClient {
|
|
|
240
301
|
releaseRegistryId: registry.id,
|
|
241
302
|
});
|
|
242
303
|
},
|
|
304
|
+
publishReleaseGraph: (p: ConfiguredReleaseGraphParams): TxThunk => {
|
|
305
|
+
const registry = this.#releaseRegistry();
|
|
306
|
+
return publishReleaseGraph({
|
|
307
|
+
...p,
|
|
308
|
+
misoPackageId: this.#misoPackageId(),
|
|
309
|
+
minatoPackageId: this.#minatoPackageId(),
|
|
310
|
+
releaseRegistryPackageId: registry.packageId,
|
|
311
|
+
});
|
|
312
|
+
},
|
|
243
313
|
};
|
|
244
314
|
|
|
245
315
|
// ── Share currency provisioning (executes; Signer pattern) ─────────────────
|
|
@@ -252,7 +322,18 @@ export class MisoPlatformClient {
|
|
|
252
322
|
// ── Generated layer ───────────────────────────────────────────────────────
|
|
253
323
|
|
|
254
324
|
/** Generated Move-call bindings, for commands this facade doesn't wrap. */
|
|
255
|
-
|
|
325
|
+
get call() {
|
|
326
|
+
return {
|
|
327
|
+
listing: bindModulePackage(listingContract, this.packageId),
|
|
328
|
+
pressing: bindModulePackage(pressingContract, this.packageId),
|
|
329
|
+
releaseRegistry: this.#config.releaseRegistryPackageId
|
|
330
|
+
? bindModulePackage(
|
|
331
|
+
releaseRegistry,
|
|
332
|
+
this.#config.releaseRegistryPackageId,
|
|
333
|
+
)
|
|
334
|
+
: releaseRegistry,
|
|
335
|
+
};
|
|
336
|
+
}
|
|
256
337
|
|
|
257
338
|
/** Generated BCS definitions, for parsing objects or events yourself. */
|
|
258
339
|
readonly bcs = {
|
|
@@ -265,8 +346,48 @@ export class MisoPlatformClient {
|
|
|
265
346
|
};
|
|
266
347
|
}
|
|
267
348
|
|
|
349
|
+
/** The full Miso client exposed by `@misofm/sdk`. */
|
|
350
|
+
export { MisoPlatformClient as MisoClient };
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Registers the complete Miso facade at `client.miso`.
|
|
354
|
+
*
|
|
355
|
+
* Platform operations live directly on `client.miso`; the lower-level
|
|
356
|
+
* permissionless protocol SDK is available at `client.miso.protocol`.
|
|
357
|
+
*/
|
|
358
|
+
export function miso<const Name extends string = "miso">(
|
|
359
|
+
options: MisoOptions<Name> = {},
|
|
360
|
+
): SuiClientRegistration<ClientWithCoreApi, Name, MisoPlatformClient> {
|
|
361
|
+
const name = (options.name ?? "miso") as Name;
|
|
362
|
+
return {
|
|
363
|
+
name,
|
|
364
|
+
register: (client: ClientWithCoreApi) => {
|
|
365
|
+
const deployment =
|
|
366
|
+
options.deployment ?? getMisoPlatformDeployment(client.network);
|
|
367
|
+
const protocol = protocolMiso({
|
|
368
|
+
deployment: deployment.protocol,
|
|
369
|
+
graphqlClient: options.graphqlClient,
|
|
370
|
+
}).register(client);
|
|
371
|
+
return new MisoPlatformClient(
|
|
372
|
+
client,
|
|
373
|
+
{
|
|
374
|
+
packageId: deployment.packages.pressing,
|
|
375
|
+
settingsId: deployment.objects.recordSettings,
|
|
376
|
+
misoPackageId: deployment.protocol.packageId,
|
|
377
|
+
minatoPackageId: deployment.packages.minato,
|
|
378
|
+
releaseRegistryPackageId: deployment.packages.releaseRegistry,
|
|
379
|
+
releaseRegistryId: deployment.objects.releaseRegistry,
|
|
380
|
+
},
|
|
381
|
+
protocol,
|
|
382
|
+
deployment,
|
|
383
|
+
);
|
|
384
|
+
},
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
|
|
268
388
|
/**
|
|
269
|
-
*
|
|
389
|
+
* @deprecated Prefer zero-config `miso()`, which registers the complete facade
|
|
390
|
+
* at `client.miso` and exposes the protocol layer at `client.miso.protocol`.
|
|
270
391
|
*
|
|
271
392
|
* `settingsId` is optional so a read-only client (an indexer, a catalog page) can
|
|
272
393
|
* skip it; asking to build a purchase without it throws rather than sending a
|
|
@@ -275,6 +396,15 @@ export class MisoPlatformClient {
|
|
|
275
396
|
export function misoPlatform(config: MisoPlatformConfig) {
|
|
276
397
|
return {
|
|
277
398
|
name: "misoPlatform" as const,
|
|
278
|
-
register: (client: ClientWithCoreApi) =>
|
|
399
|
+
register: (client: ClientWithCoreApi) => {
|
|
400
|
+
const protocol = protocolMiso({
|
|
401
|
+
deployment: config.misoPackageId
|
|
402
|
+
? {
|
|
403
|
+
packageId: config.misoPackageId,
|
|
404
|
+
}
|
|
405
|
+
: undefined,
|
|
406
|
+
}).register(client);
|
|
407
|
+
return new MisoPlatformClient(client, config, protocol);
|
|
408
|
+
},
|
|
279
409
|
};
|
|
280
410
|
}
|
|
@@ -0,0 +1,168 @@
|
|
|
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
|
+
/** Base royalty-pool value library. */
|
|
25
|
+
readonly royaltyPool: string;
|
|
26
|
+
/** Composition royalty-pool extension. */
|
|
27
|
+
readonly compositionRoyaltyPool: string;
|
|
28
|
+
/** Recording royalty-pool extension. */
|
|
29
|
+
readonly recordingRoyaltyPool: string;
|
|
30
|
+
/** Cover-art value type used by the release cover extension. */
|
|
31
|
+
readonly coverArt: string;
|
|
32
|
+
readonly releaseCoverArt: string;
|
|
33
|
+
/** External `ori::walrus_data::WalrusData` dependency used by cover art. */
|
|
34
|
+
readonly ori: string;
|
|
35
|
+
};
|
|
36
|
+
readonly objects: {
|
|
37
|
+
readonly recordSettings: string;
|
|
38
|
+
readonly releaseRegistry: string;
|
|
39
|
+
};
|
|
40
|
+
/** PartyOS packages used by the composed artist and wallet reads. */
|
|
41
|
+
readonly party: {
|
|
42
|
+
readonly partyPackageId: string;
|
|
43
|
+
readonly partyProfilePackageId: string;
|
|
44
|
+
readonly countryCodePackageId: string;
|
|
45
|
+
readonly languageCodePackageId: string;
|
|
46
|
+
readonly partyMediaPackageId: string;
|
|
47
|
+
readonly partyRolesPackageId: string;
|
|
48
|
+
readonly partyTagsPackageId: string;
|
|
49
|
+
readonly partyGenrePackageId: string;
|
|
50
|
+
readonly partyCtaPackageId: string;
|
|
51
|
+
readonly partyPlatformLinkPackageId: string;
|
|
52
|
+
readonly partySocialPackageId: string;
|
|
53
|
+
readonly partyMusicPackageId: string;
|
|
54
|
+
readonly partyProLinkPackageId: string;
|
|
55
|
+
readonly partyFeaturedDropPackageId: string;
|
|
56
|
+
readonly genrePackageId: string;
|
|
57
|
+
};
|
|
58
|
+
readonly legacy: {
|
|
59
|
+
readonly releaseCoverArtPackages: readonly string[];
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Platform deployments bundled with this SDK release.
|
|
65
|
+
*
|
|
66
|
+
* Mainnet is intentionally absent until the complete platform stack is live.
|
|
67
|
+
* Mainnet is intentionally unavailable until this ABI is deployed there.
|
|
68
|
+
*/
|
|
69
|
+
export const MISO_PLATFORM_DEPLOYMENTS = {
|
|
70
|
+
testnet: {
|
|
71
|
+
protocol: MISO_PROTOCOL_DEPLOYMENTS.testnet,
|
|
72
|
+
packages: {
|
|
73
|
+
pressing:
|
|
74
|
+
"0xd0913b584d87a3891a8013c58644e3896f438fd948e819a69db256b47314974e",
|
|
75
|
+
record:
|
|
76
|
+
"0x97e2772d81528c69e21b6681f6702f90deae2a6b079e19da1df53f9f4fdd3271",
|
|
77
|
+
releaseRegistry:
|
|
78
|
+
"0x683b2feb784a815171d2976418345bd41c046e159dcf7a16890c766f69fd7808",
|
|
79
|
+
minato:
|
|
80
|
+
"0x8466e9864c1d947888e73b0e349b035bc22805579eef18f132966f56c8efe1d2",
|
|
81
|
+
drop:
|
|
82
|
+
"0xfc2b51f068dee9d5482d39fa017164f6a8c3601cabb59084a518de5f609ef1c7",
|
|
83
|
+
credit:
|
|
84
|
+
"0x0121926470393cc93b89b5b6d5067737a8bc0c1c545fb96c4447569174116174",
|
|
85
|
+
compositionCredits:
|
|
86
|
+
"0xfa2f62db28f2eb42c8c1a6533097fb2095649efab05c0527be1874b9be6cdc73",
|
|
87
|
+
recordingCredits:
|
|
88
|
+
"0xc794252bd90efb4cc224107f9dd0a56d4f4f5623783628b6af286f6535dd4c1e",
|
|
89
|
+
releaseCredits:
|
|
90
|
+
"0x42e2dbf6098d18782911460ecf79b338af2f1b654ef7ba99c6e7344fd4bf3f94",
|
|
91
|
+
royaltyPool:
|
|
92
|
+
"0x798fb353a5dbed51a0df08a7c10fdc432a11d60b55e016102ca635f9033c654d",
|
|
93
|
+
compositionRoyaltyPool:
|
|
94
|
+
"0xc22693ec50312492d7da23f3544625df637a92cd2be08e09d0f2eb8ff4e0e7ac",
|
|
95
|
+
recordingRoyaltyPool:
|
|
96
|
+
"0x33c9149889ef9e8078a5eba5c5486e8938e2dc69b3bd49a45c5c57e9f3d898a8",
|
|
97
|
+
coverArt:
|
|
98
|
+
"0xb29052d1174835a8061149aeca08f53551fa0691de64350247fc5cb558f797a0",
|
|
99
|
+
releaseCoverArt:
|
|
100
|
+
"0x831a612920343696de7e8f0603ff4c0b21c43ca3de478feb96d230e263cd11d4",
|
|
101
|
+
ori:
|
|
102
|
+
"0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78",
|
|
103
|
+
},
|
|
104
|
+
objects: {
|
|
105
|
+
recordSettings:
|
|
106
|
+
"0x6a005dad071562d421ad7a9d368289f5c9f0408ca495cd466a1f774d65a21fa7",
|
|
107
|
+
releaseRegistry:
|
|
108
|
+
"0x5941b8690916e762a7583363906496d64a6ea3e6cedb078c90e23e7c671544f2",
|
|
109
|
+
},
|
|
110
|
+
party: {
|
|
111
|
+
partyPackageId:
|
|
112
|
+
"0x09a812d46c3aa3978703c8e5a7409ba67b9ba2dfdb91154e48ebdd9d2415da0c",
|
|
113
|
+
partyProfilePackageId:
|
|
114
|
+
"0xce89d3f993dfebc0b697388598c3b01e9db7b73fa2e8df18ed22608cf7ac5aee",
|
|
115
|
+
countryCodePackageId:
|
|
116
|
+
"0x6c3a53f228ccd089825d0fb5ee1f0465a4b7a438bc1b1735b4e2f01df8d056e9",
|
|
117
|
+
languageCodePackageId:
|
|
118
|
+
"0xa18b786807cfc45488691f93aa647800b77cf9993e420d110afd7024c5b15948",
|
|
119
|
+
partyMediaPackageId:
|
|
120
|
+
"0x7db56ef37692f84c1cfb0e0b26bde35ac9f1bc0bcd91ac5d24b3f8b4d1821349",
|
|
121
|
+
partyRolesPackageId:
|
|
122
|
+
"0x41a442a2c39368af2181e73ea5b90e2e0b4f89de09050c121a6e7d79e7c84415",
|
|
123
|
+
partyTagsPackageId:
|
|
124
|
+
"0xa4c7f6b05bb9b612ea7640974c150ce31ad7927ea82d3f9f4673acac7deef0da",
|
|
125
|
+
partyGenrePackageId:
|
|
126
|
+
"0x6ce063438be6cf44ccf5f17bf8892c9e0cef4e2344442aeb44412beead74d3a8",
|
|
127
|
+
partyCtaPackageId:
|
|
128
|
+
"0x85a312210d9ddbae535e0f933032c8a56aa3f0fe1d6c3430d4fa538765008da3",
|
|
129
|
+
partyPlatformLinkPackageId:
|
|
130
|
+
"0x46d9f3e05d2065a926b010fe833baf61e5c250c233d512a260cbe746b02c56af",
|
|
131
|
+
partySocialPackageId:
|
|
132
|
+
"0x438e767ce8f5699f12be1704a12ff69c28045ca241f890ca8a978d55e09f6541",
|
|
133
|
+
partyMusicPackageId:
|
|
134
|
+
"0x89add347dfa779aa77e21b1853a37f2054dbecfce29799b61463d9900877b7b1",
|
|
135
|
+
partyProLinkPackageId:
|
|
136
|
+
"0xe5e8a0d02b43037abb7e6ddb4b742c6197aadf2dc19910957bba98307bef4103",
|
|
137
|
+
partyFeaturedDropPackageId:
|
|
138
|
+
"0x1a7b926686565a6cc82a9e0630839dc1f75c9bf4fafc0ba789a05af2c3c269f0",
|
|
139
|
+
genrePackageId:
|
|
140
|
+
"0xcbbce10e8b0781d458e88ce99d08e0c85f1e674c5b7ec975383d74f87a1d76b1",
|
|
141
|
+
},
|
|
142
|
+
legacy: {
|
|
143
|
+
releaseCoverArtPackages: [
|
|
144
|
+
"0x25c3c87ef4823d62d80dd8bda714ef4976df0f04453997646659a6cebadd655b",
|
|
145
|
+
"0x1ee2cae0da7595d7973c310c912434ef531589b468cc57839296810c1385f7f6",
|
|
146
|
+
"0x7d4a205a68f8e768a408c9f4c45a4d4076722c5edeba9068c0ac058f554e964e",
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
} as const satisfies Partial<Record<MisoNetwork, MisoPlatformDeployment>>;
|
|
151
|
+
|
|
152
|
+
/** Resolve a bundled platform deployment, failing closed when it is unavailable. */
|
|
153
|
+
export function getMisoPlatformDeployment(
|
|
154
|
+
network: string,
|
|
155
|
+
): MisoPlatformDeployment {
|
|
156
|
+
const deployment = (
|
|
157
|
+
MISO_PLATFORM_DEPLOYMENTS as Partial<
|
|
158
|
+
Record<string, MisoPlatformDeployment>
|
|
159
|
+
>
|
|
160
|
+
)[network];
|
|
161
|
+
if (!deployment) {
|
|
162
|
+
throw new Error(
|
|
163
|
+
`@misofm/sdk: no bundled Miso platform deployment for network "${network}". ` +
|
|
164
|
+
"Pass an explicit deployment to miso() for custom networks.",
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
return deployment;
|
|
168
|
+
}
|
package/src/execute.ts
CHANGED
|
@@ -13,6 +13,11 @@ import type { SuiClientTypes } from "@mysten/sui/client";
|
|
|
13
13
|
import { buildTx, toExecResult, FULL_INCLUDE, type ExecResult } from "@misonetwork/sdk";
|
|
14
14
|
import type { TxThunk } from "./transactions.ts";
|
|
15
15
|
|
|
16
|
+
// Consumers of the platform SDK should not need a second direct dependency on
|
|
17
|
+
// the protocol SDK just to execute a composed PTB. Keep the generic execution
|
|
18
|
+
// surface available through this platform-layer entry point as well.
|
|
19
|
+
export * from "@misonetwork/sdk/execute";
|
|
20
|
+
|
|
16
21
|
type FullInclude = typeof FULL_INCLUDE;
|
|
17
22
|
|
|
18
23
|
/**
|
package/src/index.ts
CHANGED
|
@@ -27,8 +27,13 @@
|
|
|
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 {
|
|
30
|
+
export { miso, misoPlatform, MisoClient, MisoPlatformClient } from "./client.ts";
|
|
31
|
+
export type {
|
|
32
|
+
ConfiguredReleaseGraphParams,
|
|
33
|
+
MisoOptions,
|
|
34
|
+
MisoPlatformConfig,
|
|
35
|
+
} from "./client.ts";
|
|
36
|
+
export * from "./deployments.ts";
|
|
32
37
|
export * from "./pressing.ts";
|
|
33
38
|
export * from "./transactions.ts";
|
|
34
39
|
export * from "./execute.ts";
|
package/src/read/config.ts
CHANGED
|
@@ -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
|
-
//
|
|
11
|
-
//
|
|
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
|
-
/**
|
|
17
|
+
/** Missing defaults to Testnet for local development; invalid values fail closed. */
|
|
16
18
|
export function networkFrom(value: string | undefined): Network {
|
|
17
|
-
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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"
|
|
136
|
+
if (network === "mainnet") {
|
|
114
137
|
throw new Error(
|
|
115
|
-
|
|
138
|
+
`@misofm/sdk/read: no bundled Miso platform deployment for network "${network}".`,
|
|
116
139
|
);
|
|
117
140
|
}
|
|
118
141
|
return { ...TESTNET, ...stripUndefined(overrides) };
|