@misofm/sdk 0.6.0 → 0.7.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.
Files changed (78) hide show
  1. package/README.md +13 -9
  2. package/dist/client.d.ts +17 -1
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +22 -3
  5. package/dist/client.js.map +1 -1
  6. package/dist/contracts/release_registry/release_registry.d.ts +114 -0
  7. package/dist/contracts/release_registry/release_registry.d.ts.map +1 -0
  8. package/dist/contracts/release_registry/release_registry.js +119 -0
  9. package/dist/contracts/release_registry/release_registry.js.map +1 -0
  10. package/dist/contracts/royalty_pool/pool.d.ts +28 -2
  11. package/dist/contracts/royalty_pool/pool.d.ts.map +1 -1
  12. package/dist/contracts/royalty_pool/pool.js +28 -2
  13. package/dist/contracts/royalty_pool/pool.js.map +1 -1
  14. package/dist/contracts/utils/index.d.ts +44 -0
  15. package/dist/contracts/utils/index.d.ts.map +1 -1
  16. package/dist/contracts/utils/index.js +104 -2
  17. package/dist/contracts/utils/index.js.map +1 -1
  18. package/dist/contracts.d.ts +1 -0
  19. package/dist/contracts.d.ts.map +1 -1
  20. package/dist/contracts.js +4 -1
  21. package/dist/contracts.js.map +1 -1
  22. package/dist/cover.d.ts +3 -6
  23. package/dist/cover.d.ts.map +1 -1
  24. package/dist/cover.js +7 -16
  25. package/dist/cover.js.map +1 -1
  26. package/dist/credits.d.ts.map +1 -1
  27. package/dist/credits.js +17 -43
  28. package/dist/credits.js.map +1 -1
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +3 -1
  31. package/dist/index.js.map +1 -1
  32. package/dist/read/catalog.d.ts +2 -12
  33. package/dist/read/catalog.d.ts.map +1 -1
  34. package/dist/read/catalog.js +9 -24
  35. package/dist/read/catalog.js.map +1 -1
  36. package/dist/read/config.d.ts +3 -8
  37. package/dist/read/config.d.ts.map +1 -1
  38. package/dist/read/config.js +15 -50
  39. package/dist/read/config.js.map +1 -1
  40. package/dist/read/index.d.ts +1 -1
  41. package/dist/read/index.d.ts.map +1 -1
  42. package/dist/read/index.js +1 -1
  43. package/dist/read/index.js.map +1 -1
  44. package/dist/read/types.d.ts +1 -1
  45. package/dist/read/types.d.ts.map +1 -1
  46. package/dist/read/wallet.d.ts +3 -7
  47. package/dist/read/wallet.d.ts.map +1 -1
  48. package/dist/read/wallet.js +11 -38
  49. package/dist/read/wallet.js.map +1 -1
  50. package/dist/read/works.d.ts +2 -5
  51. package/dist/read/works.d.ts.map +1 -1
  52. package/dist/read/works.js +7 -37
  53. package/dist/read/works.js.map +1 -1
  54. package/dist/release-graph.d.ts +6 -19
  55. package/dist/release-graph.d.ts.map +1 -1
  56. package/dist/release-graph.js +29 -43
  57. package/dist/release-graph.js.map +1 -1
  58. package/dist/transactions.d.ts +12 -28
  59. package/dist/transactions.d.ts.map +1 -1
  60. package/dist/transactions.js +23 -28
  61. package/dist/transactions.js.map +1 -1
  62. package/package.json +3 -3
  63. package/src/client.ts +33 -2
  64. package/src/contracts/release_registry/release_registry.ts +160 -0
  65. package/src/contracts/royalty_pool/pool.ts +28 -2
  66. package/src/contracts/utils/index.ts +156 -4
  67. package/src/contracts.ts +5 -1
  68. package/src/cover.ts +8 -19
  69. package/src/credits.ts +23 -63
  70. package/src/index.ts +3 -1
  71. package/src/read/catalog.ts +9 -29
  72. package/src/read/config.ts +18 -58
  73. package/src/read/index.ts +0 -1
  74. package/src/read/types.ts +1 -1
  75. package/src/read/wallet.ts +11 -37
  76. package/src/read/works.ts +5 -42
  77. package/src/release-graph.ts +40 -75
  78. package/src/transactions.ts +33 -62
@@ -1 +1 @@
1
- {"version":3,"file":"transactions.js","sourceRoot":"","sources":["../src/transactions.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAEtC,6EAA6E;AAC7E,sEAAsE;AACtE,8EAA8E;AAC9E,wBAAwB;AACxB,EAAE;AACF,+EAA+E;AAC/E,uEAAuE;AACvE,sEAAsE;AACtE,uCAAuC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AAe,CAAC,UAAU,CAAC;YACzB,OAAO,EAAE,wBAAwB;YACjC,SAAS,EAAE;gBACT,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC;gBACnC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;gBAC5B,aAAa,CAAC,EAAE,EAAE,aAAa,EAAE,SAAS,CAAC;gBAC3C,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;aAC1C;SACF,CAAC,CACH,CAAC;QACF,MAAM,KAAK,GAAiB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAE,EAAE,CAAC;QAC5E,eAAe,CAAC,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,aAAa,EAAE,CAAC,CAAC;IACtF,CAAC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@misofm/sdk",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "description": "Complete client SDK for the Miso platform on Sui \u2014 high-level reads, pressings, listings, records, and work publishing.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -102,7 +102,7 @@
102
102
  "package.json"
103
103
  ],
104
104
  "scripts": {
105
- "codegen": "sui-codegen generate",
105
+ "codegen": "sui-ts-codegen generate",
106
106
  "typecheck": "tsc --noEmit",
107
107
  "test": "bun test",
108
108
  "build": "tsc -p tsconfig.build.json",
@@ -122,7 +122,7 @@
122
122
  },
123
123
  "dependencies": {
124
124
  "@misonetwork/miso-party": "^0.2.0",
125
- "@misonetwork/sdk": "^0.3.1"
125
+ "@misonetwork/sdk": "^0.5.0"
126
126
  },
127
127
  "main": "./dist/index.js"
128
128
  }
package/src/client.ts CHANGED
@@ -31,6 +31,7 @@ import type { Signer } from "@mysten/sui/cryptography";
31
31
 
32
32
  import * as listingContract from "./contracts/miso_pressing/listing.ts";
33
33
  import * as pressingContract from "./contracts/miso_pressing/pressing.ts";
34
+ import * as releaseRegistry from "./contracts/release_registry/release_registry.ts";
34
35
  import {
35
36
  buyRecord,
36
37
  deriveListingId,
@@ -63,12 +64,14 @@ import {
63
64
  publishComposition,
64
65
  publishRecording,
65
66
  publishCompositionAndRecording,
67
+ publishRelease,
66
68
  } from "./transactions.ts";
67
69
  import type {
68
70
  TxThunk,
69
71
  PublishCompositionParams,
70
72
  PublishRecordingParams,
71
73
  PublishCompositionAndRecordingParams,
74
+ PublishReleaseParams,
72
75
  } from "./transactions.ts";
73
76
  import * as share from "./share.ts";
74
77
 
@@ -93,6 +96,10 @@ export interface MisoPlatformConfig {
93
96
  * builders (they disperse shares via minato).
94
97
  */
95
98
  minatoPackageId?: string;
99
+ /** The published `release_registry` extension package used to mint releases. */
100
+ releaseRegistryPackageId?: string;
101
+ /** The one shared `ReleaseRegistry` object created by that package's `init`. */
102
+ releaseRegistryId?: string;
96
103
  }
97
104
 
98
105
  /** Params with the ids this client already knows dropped from the call site. */
@@ -101,6 +108,9 @@ type Configured<T> = Omit<T, "misoPressingPackageId" | "settingsId">;
101
108
  /** Publish-builder params with the protocol/minato ids this client already knows dropped. */
102
109
  type ConfiguredPublish<T> = Omit<T, "misoPackageId" | "minatoPackageId">;
103
110
 
111
+ /** Release-builder params with this client's core, share, and registry ids dropped. */
112
+ type ConfiguredRelease<T> = Omit<T, "misoPackageId" | "minatoPackageId" | "releaseRegistryPackageId" | "releaseRegistryId">;
113
+
104
114
  export class MisoPlatformClient {
105
115
  readonly #client: ClientWithCoreApi;
106
116
  readonly #config: MisoPlatformConfig;
@@ -129,7 +139,7 @@ export class MisoPlatformClient {
129
139
  if (!misoPackageId) {
130
140
  throw new Error(
131
141
  "misoPlatform: `misoPackageId` is required for the publish builders " +
132
- "(publishComposition, publishRecording, publishCompositionAndRecording) — pass it to misoPlatform({ misoPackageId }).",
142
+ "(publishComposition, publishRecording, publishCompositionAndRecording, publishRelease) — pass it to misoPlatform({ misoPackageId }).",
133
143
  );
134
144
  }
135
145
  return misoPackageId;
@@ -146,6 +156,16 @@ export class MisoPlatformClient {
146
156
  return minatoPackageId;
147
157
  }
148
158
 
159
+ #releaseRegistry(): { packageId: string; id: string } {
160
+ const { releaseRegistryPackageId: packageId, releaseRegistryId: id } = this.#config;
161
+ if (!packageId || !id) {
162
+ throw new Error(
163
+ "misoPlatform: `releaseRegistryPackageId` and `releaseRegistryId` are required to build a release — pass both to misoPlatform(...).",
164
+ );
165
+ }
166
+ return { packageId, id };
167
+ }
168
+
149
169
  // ── Reads ─────────────────────────────────────────────────────────────────
150
170
 
151
171
  /** The run itself, or `null` if this release has never opened one. */
@@ -211,6 +231,15 @@ export class MisoPlatformClient {
211
231
  publishRecording({ ...p, misoPackageId: this.#misoPackageId(), minatoPackageId: this.#minatoPackageId() }),
212
232
  publishCompositionAndRecording: (p: ConfiguredPublish<PublishCompositionAndRecordingParams>): TxThunk =>
213
233
  publishCompositionAndRecording({ ...p, misoPackageId: this.#misoPackageId(), minatoPackageId: this.#minatoPackageId() }),
234
+ publishRelease: (p: ConfiguredRelease<PublishReleaseParams>): TxThunk => {
235
+ const registry = this.#releaseRegistry();
236
+ return publishRelease({
237
+ ...p,
238
+ misoPackageId: this.#misoPackageId(),
239
+ releaseRegistryPackageId: registry.packageId,
240
+ releaseRegistryId: registry.id,
241
+ });
242
+ },
214
243
  };
215
244
 
216
245
  // ── Share currency provisioning (executes; Signer pattern) ─────────────────
@@ -223,7 +252,7 @@ export class MisoPlatformClient {
223
252
  // ── Generated layer ───────────────────────────────────────────────────────
224
253
 
225
254
  /** Generated Move-call bindings, for commands this facade doesn't wrap. */
226
- readonly call = { listing: listingContract, pressing: pressingContract };
255
+ readonly call = { listing: listingContract, pressing: pressingContract, releaseRegistry };
227
256
 
228
257
  /** Generated BCS definitions, for parsing objects or events yourself. */
229
258
  readonly bcs = {
@@ -231,6 +260,8 @@ export class MisoPlatformClient {
231
260
  PressingAdminCap: pressingContract.PressingAdminCap,
232
261
  Listing: listingContract.Listing,
233
262
  Price: listingContract.Price,
263
+ ReleaseRegistry: releaseRegistry.ReleaseRegistry,
264
+ ReleaseRegistryCreatedEvent: releaseRegistry.ReleaseRegistryCreatedEvent,
234
265
  };
235
266
  }
236
267
 
@@ -0,0 +1,160 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /**
7
+ * The recommended canonical parent namespace for `miso::release::new`.
8
+ *
9
+ * `miso::release::new` takes `parent: &mut UID` and derives every release's id
10
+ * from `(parent, digest)`: core is deliberately parent-agnostic and implements no
11
+ * coordination policy of its own (see the "Consent scope" section of
12
+ * `miso::release`'s module doc). This package supplies the one recommended parent
13
+ * — a shared, permissionless, undeletable `UID` — and is deliberately the _only_
14
+ * policy it implements: it neither gates who may assemble a release through it nor
15
+ * interprets what a `Track` means.
16
+ *
17
+ * ### One instance, ever
18
+ *
19
+ * The module exposes no constructor: the only `ReleaseRegistry` that can ever
20
+ * exist is the canonical one created and shared by package initialization. "The
21
+ * registry" is therefore unambiguous on-chain — the type itself names the
22
+ * namespace, not a config convention. Every `new_release` takes `&mut` on that one
23
+ * shared object, so release creation through it serializes per checkpoint; the
24
+ * ceiling is accepted — releases are rare events. Alternative namespaces are still
25
+ * possible, but they live in other packages: core is parent-agnostic, and any
26
+ * object exposing a `&mut UID` (a release escrow, for instance) can parent its own
27
+ * releases; ids derived under different parents never collide, by construction of
28
+ * `derive_address`.
29
+ *
30
+ * ### Liveness
31
+ *
32
+ * The canonical instance is shared at publish, and this module exposes no delete
33
+ * function and no `uid_mut`: its only capability is being a derivation parent.
34
+ * That undeletability is a consent guarantee, not an accident — a `Track`'s
35
+ * `target_release_id` commits to this namespace's liveness (see `miso::release`'s
36
+ * module doc), and a deletable parent would strand every track and offer that ever
37
+ * targeted it. Keeping the surface to exactly one capability is what makes that
38
+ * guarantee durable: there is nothing else here to reason about.
39
+ *
40
+ * ### Permissionless
41
+ *
42
+ * No capability gates `new_release`: anyone holding a fully-formed `vector<Track>`
43
+ * may assemble and claim a release through this registry. That is not a gap —
44
+ * consent already lives in the `Track`s themselves, each one minted by its
45
+ * recording's admin via cap-gated `miso::track::new` against this exact digest.
46
+ * Assembly is bookkeeping over consent already given, not a second authorization
47
+ * step.
48
+ */
49
+
50
+ import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
51
+ import { bcs } from '@mysten/sui/bcs';
52
+ import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
53
+ const $moduleName = '@local-pkg/release_registry::release_registry';
54
+ export const ReleaseRegistry = new MoveStruct({ name: `${$moduleName}::ReleaseRegistry`, fields: {
55
+ id: bcs.Address
56
+ } });
57
+ export const ReleaseRegistryCreatedEvent = new MoveStruct({ name: `${$moduleName}::ReleaseRegistryCreatedEvent`, fields: {
58
+ registry_id: bcs.Address,
59
+ created_by: bcs.Address
60
+ } });
61
+ export interface NewReleaseArguments {
62
+ self: RawTransactionArgument<string>;
63
+ title: RawTransactionArgument<string>;
64
+ tracks: TransactionArgument;
65
+ nonce: RawTransactionArgument<number | bigint>;
66
+ }
67
+ export interface NewReleaseOptions {
68
+ package?: string;
69
+ arguments: NewReleaseArguments | [
70
+ self: RawTransactionArgument<string>,
71
+ title: RawTransactionArgument<string>,
72
+ tracks: TransactionArgument,
73
+ nonce: RawTransactionArgument<number | bigint>
74
+ ];
75
+ }
76
+ /**
77
+ * Assembles a release by delegating to `miso::release::new` with this registry as
78
+ * parent. Returns the `(Release, ReleaseAdminCap)` pair rather than transferring
79
+ * or sharing either: the release is not on-chain-final until `release::publish`
80
+ * consumes it by value — typically later in the same PTB — and where the cap ends
81
+ * up is the caller's decision, not this function's.
82
+ */
83
+ export function newRelease(options: NewReleaseOptions) {
84
+ const packageAddress = options.package ?? '@local-pkg/release_registry';
85
+ const argumentsTypes = [
86
+ null,
87
+ '0x1::string::String',
88
+ 'vector<null>',
89
+ 'u256'
90
+ ] satisfies (string | null)[];
91
+ const parameterNames = ["self", "title", "tracks", "nonce"];
92
+ return (tx: Transaction) => tx.moveCall({
93
+ package: packageAddress,
94
+ module: 'release_registry',
95
+ function: 'new_release',
96
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
97
+ });
98
+ }
99
+ export interface DeriveTargetReleaseIdArguments {
100
+ self: RawTransactionArgument<string>;
101
+ recordingIds: RawTransactionArgument<Array<string>>;
102
+ trackSplitValues: RawTransactionArgument<Array<number | bigint>>;
103
+ nonce: RawTransactionArgument<number | bigint>;
104
+ }
105
+ export interface DeriveTargetReleaseIdOptions {
106
+ package?: string;
107
+ arguments: DeriveTargetReleaseIdArguments | [
108
+ self: RawTransactionArgument<string>,
109
+ recordingIds: RawTransactionArgument<Array<string>>,
110
+ trackSplitValues: RawTransactionArgument<Array<number | bigint>>,
111
+ nonce: RawTransactionArgument<number | bigint>
112
+ ];
113
+ }
114
+ /**
115
+ * Derives the release id `new_release` would produce for the given inputs under
116
+ * this registry, without creating anything. Delegates to
117
+ * `miso::release::derive_target_release_id` with this registry's own id as parent.
118
+ */
119
+ export function deriveTargetReleaseId(options: DeriveTargetReleaseIdOptions) {
120
+ const packageAddress = options.package ?? '@local-pkg/release_registry';
121
+ const argumentsTypes = [
122
+ null,
123
+ 'vector<0x2::object::ID>',
124
+ 'vector<u64>',
125
+ 'u256'
126
+ ] satisfies (string | null)[];
127
+ const parameterNames = ["self", "recordingIds", "trackSplitValues", "nonce"];
128
+ return (tx: Transaction) => tx.moveCall({
129
+ package: packageAddress,
130
+ module: 'release_registry',
131
+ function: 'derive_target_release_id',
132
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
133
+ });
134
+ }
135
+ export interface IdArguments {
136
+ self: RawTransactionArgument<string>;
137
+ }
138
+ export interface IdOptions {
139
+ package?: string;
140
+ arguments: IdArguments | [
141
+ self: RawTransactionArgument<string>
142
+ ];
143
+ }
144
+ /**
145
+ * Returns the registry's object id — the derivation parent that
146
+ * `derive_target_release_id` and `new_release` both commit to.
147
+ */
148
+ export function id(options: IdOptions) {
149
+ const packageAddress = options.package ?? '@local-pkg/release_registry';
150
+ const argumentsTypes = [
151
+ null
152
+ ] satisfies (string | null)[];
153
+ const parameterNames = ["self"];
154
+ return (tx: Transaction) => tx.moveCall({
155
+ package: packageAddress,
156
+ module: 'release_registry',
157
+ function: 'id',
158
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
159
+ });
160
+ }
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
  /**
7
- * Generic accumulator-based royalty distribution pool.
7
+ * Accumulator-based royalty distribution pool for the protocol's share tokens.
8
8
  *
9
9
  * A `RoyaltyPool<Share, Currency>` is a derived object of any UID-bearing parent.
10
10
  * Its address is deterministically derived from `(parent_id, Currency)` — at most
@@ -21,7 +21,33 @@
21
21
  * transfers or balances credited to the pool's funds-accumulator. Both are
22
22
  * permissionless: anyone who notices stuck funds can fold them in. The canonical
23
23
  * funding path remains `deposit(balance)` from a higher-layer extension (e.g.
24
- * `composition_royalty_distributor`) that pulls from the parent's address.
24
+ * `composition_royalty_distributor`) that pulls from the parent's address. Note
25
+ * the recovery valves run through `deposit`, which aborts while no shares are
26
+ * staked — and the pool has no other withdrawal path — so funds sent to the pool's
27
+ * address before the first registration stay locked until a stake registers.
28
+ * Payers should always target the parent's address, never the pool's.
29
+ *
30
+ * ### No activation delay (deliberate)
31
+ *
32
+ * Registration earns from the next deposit onward; there is no bonding or
33
+ * unbonding period (contrast Sui native staking's next-epoch activation). With the
34
+ * protocol's fixed-supply share token this is safe: a stake's take of any deposit
35
+ * is `v · s / S` with `S` (total registered) bounded by the share supply, so a
36
+ * continuously registered stake is guaranteed at least its pro-rata share of total
37
+ * supply on every deposit. Short-lived or just-in-time registrations can only
38
+ * compete for the _unregistered_ supply's drift — the designed incentive for being
39
+ * registered — never below any registered stake's floor.
40
+ *
41
+ * ### Precision
42
+ *
43
+ * The share token's shape is fixed at issuance by the protocol — exactly 10¹³ base
44
+ * units, 6 decimals, supply made immutable via `miso_share::share::initialize`
45
+ * (`make_supply_fixed`) — so `staked_shares ≤ 10¹³` objectively. A deposit of
46
+ * `value ≥ 1` base units therefore advances the accumulator by
47
+ * `value · PRECISION / staked_shares ≥ 10¹⁸ / 10¹³ = 10⁵`: the truncation-to-zero
48
+ * case that would permanently lock a deposit in the pool balance is impossible by
49
+ * construction, not by convention. Sub-base-unit claim residue (the remaining
50
+ * source of locked dust) is documented on `unregister_stake`.
25
51
  */
26
52
 
27
53
  import { MoveStruct, MoveTuple, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
@@ -8,7 +8,7 @@ import {
8
8
  BcsEnum,
9
9
  BcsTuple,
10
10
  } from '@mysten/sui/bcs';
11
- import { normalizeSuiAddress } from '@mysten/sui/utils';
11
+ import { normalizeStructTag, normalizeSuiAddress } from '@mysten/sui/utils';
12
12
  import { type TransactionArgument, isArgument } from '@mysten/sui/transactions';
13
13
  import { type ClientWithCoreApi, type SuiClientTypes } from '@mysten/sui/client';
14
14
 
@@ -158,10 +158,140 @@ export function normalizeMoveArguments(
158
158
  return normalizedArgs;
159
159
  }
160
160
 
161
+ /* -------------------------- Move type tags -------------------------- */
162
+
163
+ /** A type argument: a type tag string, or a BCS type whose name is a Move type. */
164
+ export type TypeArgument = string | BcsType<any>;
165
+
166
+ export interface TypeTagOptions {
167
+ package?: string;
168
+ typeArguments?: readonly TypeArgument[];
169
+ }
170
+
171
+ /**
172
+ * `typeArguments` is required when the type's name contains unfilled
173
+ * `phantom X` parameters (at any depth). Everything else — argument arity,
174
+ * position contents, and tag validity — is validated at runtime.
175
+ */
176
+ type TypeTagParams<Name extends string> = Name extends `${string}phantom ${string}`
177
+ ? [options: TypeTagOptions & { typeArguments: readonly TypeArgument[] }]
178
+ : [options?: TypeTagOptions];
179
+
180
+ type ResolveTypeTagOptions<Name extends string> = { client: ClientWithCoreApi } & (
181
+ Name extends `${string}phantom ${string}`
182
+ ? TypeTagOptions & { typeArguments: readonly TypeArgument[] }
183
+ : TypeTagOptions
184
+ );
185
+
186
+ const HAS_PHANTOM_REGEX = /phantom [A-Za-z_$][A-Za-z0-9_$]*/;
187
+
188
+ function splitTopLevelTypeArgs(inner: string): string[] {
189
+ const parts: string[] = [];
190
+ let depth = 0;
191
+ let current = '';
192
+ for (const char of inner) {
193
+ if (char === ',' && depth === 0) {
194
+ parts.push(current.trim());
195
+ current = '';
196
+ continue;
197
+ }
198
+ if (char === '<') depth++;
199
+ if (char === '>') depth--;
200
+ current += char;
201
+ }
202
+ if (current) parts.push(current.trim());
203
+ return parts;
204
+ }
205
+
206
+ function buildTypeTag(name: string, options: TypeTagOptions | undefined): string {
207
+ const lt = name.indexOf('<');
208
+ const base = lt === -1 ? name : name.slice(0, lt);
209
+
210
+ if (base.split('::').length !== 3) {
211
+ throw new Error(`${name} is not a top-level Move type`);
212
+ }
213
+
214
+ let result = name;
215
+
216
+ if (options?.typeArguments) {
217
+ const baked = lt === -1 ? [] : splitTopLevelTypeArgs(name.slice(lt + 1, -1));
218
+ const supplied = options.typeArguments.map((arg) => {
219
+ if (typeof arg === 'string') {
220
+ return arg;
221
+ }
222
+ if (arg && typeof arg.serialize === 'function' && typeof arg.name === 'string') {
223
+ return arg.name;
224
+ }
225
+ throw new Error(`Invalid type argument ${stringify(arg)}`);
226
+ });
227
+
228
+ if (supplied.length !== baked.length) {
229
+ throw new Error(
230
+ `Expected ${baked.length} type arguments for ${base}, got ${supplied.length}`,
231
+ );
232
+ }
233
+
234
+ result = supplied.length === 0 ? base : `${base}<${supplied.join(', ')}>`;
235
+ }
236
+
237
+ if (HAS_PHANTOM_REGEX.test(result)) {
238
+ throw new Error(
239
+ options?.typeArguments
240
+ ? `A type argument contains an unfilled phantom parameter in ${result}`
241
+ : `Missing type arguments for ${result}`,
242
+ );
243
+ }
244
+
245
+ if (options?.package) {
246
+ const [, ...rest] = result.split('::');
247
+ result = [options.package, ...rest].join('::');
248
+ }
249
+
250
+ // fully validate address-only tags (MVR names can't be parsed as type tags)
251
+ if (!HAS_PHANTOM_REGEX.test(result) && !/[@/]/.test(result)) {
252
+ TypeTagSerializer.parseFromStr(result);
253
+ }
254
+
255
+ return result;
256
+ }
257
+
258
+ async function resolveBuiltTypeTag(
259
+ name: string,
260
+ options: { client: ClientWithCoreApi } & TypeTagOptions,
261
+ ): Promise<string> {
262
+ const { client, ...rest } = options;
263
+ const { type } = await client.core.mvr.resolveType({
264
+ type: buildTypeTag(name, rest),
265
+ });
266
+ return normalizeStructTag(type);
267
+ }
268
+
161
269
  export class MoveStruct<
162
270
  T extends Record<string, BcsType<any>>,
163
271
  const Name extends string = string,
164
272
  > extends BcsStruct<T, Name> {
273
+ /**
274
+ * Build the type tag for this struct.
275
+ *
276
+ * `typeArguments` is the full positional list, in Move declaration order, and
277
+ * is required when the struct has unfilled phantom parameters. The result may
278
+ * contain MVR names: those are valid in transaction `typeArguments`, but for
279
+ * queries or comparisons against on-chain data use `resolveTypeTag` instead.
280
+ */
281
+ typeTag(...args: TypeTagParams<Name>): string {
282
+ return buildTypeTag(this.name, args[0] as TypeTagOptions | undefined);
283
+ }
284
+
285
+ /**
286
+ * Build the type tag for this struct, then resolve any MVR names through the
287
+ * client (using its configured overrides and the MVR API) and return the
288
+ * normalized, address-only form suitable for queries and comparisons against
289
+ * on-chain data.
290
+ */
291
+ async resolveTypeTag(options: ResolveTypeTagOptions<Name>): Promise<string> {
292
+ return resolveBuiltTypeTag(this.name, options as { client: ClientWithCoreApi } & TypeTagOptions);
293
+ }
294
+
165
295
  async get<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({
166
296
  objectId,
167
297
  ...options
@@ -210,16 +340,38 @@ export class MoveStruct<
210
340
  export class MoveEnum<
211
341
  T extends Record<string, BcsType<any> | null>,
212
342
  const Name extends string,
213
- > extends BcsEnum<T, Name> {}
343
+ > extends BcsEnum<T, Name> {
344
+ /** Build the type tag for this enum. See `MoveStruct.typeTag` for semantics. */
345
+ typeTag(...args: TypeTagParams<Name>): string {
346
+ return buildTypeTag(this.name, args[0] as TypeTagOptions | undefined);
347
+ }
348
+
349
+ /** Build and resolve the type tag for this enum. See `MoveStruct.resolveTypeTag`. */
350
+ async resolveTypeTag(options: ResolveTypeTagOptions<Name>): Promise<string> {
351
+ return resolveBuiltTypeTag(this.name, options as { client: ClientWithCoreApi } & TypeTagOptions);
352
+ }
353
+ }
214
354
 
215
355
  export class MoveTuple<
216
356
  const T extends readonly BcsType<any>[],
217
357
  const Name extends string,
218
- > extends BcsTuple<T, Name> {}
358
+ > extends BcsTuple<T, Name> {
359
+ /** Build the type tag for this struct. See `MoveStruct.typeTag` for semantics. */
360
+ typeTag(...args: TypeTagParams<Name>): string {
361
+ return buildTypeTag(this.name, args[0] as TypeTagOptions | undefined);
362
+ }
363
+
364
+ /** Build and resolve the type tag for this struct. See `MoveStruct.resolveTypeTag`. */
365
+ async resolveTypeTag(options: ResolveTypeTagOptions<Name>): Promise<string> {
366
+ return resolveBuiltTypeTag(this.name, options as { client: ClientWithCoreApi } & TypeTagOptions);
367
+ }
368
+ }
219
369
 
220
370
  function stringify(val: unknown) {
221
371
  if (typeof val === 'object') {
222
- return JSON.stringify(val, (val: unknown) => val);
372
+ return JSON.stringify(val, (_key, value) =>
373
+ typeof value === 'bigint' ? value.toString() : value,
374
+ );
223
375
  }
224
376
  if (typeof val === 'bigint') {
225
377
  return val.toString();
package/src/contracts.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  // Move calls). Re-exported from the package root as the `contracts` namespace.
6
6
  //
7
7
  // PLATFORM + EXTENSION packages. The protocol core (`miso`: Composition,
8
- // Recording, Release, Deal, Track) generates into `@misonetwork/sdk` and is
8
+ // Recording, Release, Track) generates into `@misonetwork/sdk` and is
9
9
  // re-exported from ITS `contracts` namespace — import it from there rather than
10
10
  // mirroring it here.
11
11
 
@@ -14,6 +14,10 @@ export * as pressing from "./contracts/miso_pressing/pressing.ts";
14
14
  export * as listing from "./contracts/miso_pressing/listing.ts";
15
15
  export * as certificate from "./contracts/miso_pressing/certificate.ts";
16
16
 
17
+ // The canonical release-id derivation parent — the only PTB-callable path to
18
+ // minting a `Release` now that core's `release::new` takes `&mut UID`.
19
+ export * as releaseRegistry from "./contracts/release_registry/release_registry.ts";
20
+
17
21
  // Existing launch drops remain readable and purchasable while releases move to
18
22
  // the pressing/listing contracts.
19
23
  export * as drop from "./contracts/miso_drop/drop.ts";
package/src/cover.ts CHANGED
@@ -145,7 +145,7 @@ export async function getReleaseCover(
145
145
  await getReleaseCoversByIds(
146
146
  client,
147
147
  [releaseId],
148
- [releaseCoverArtPackageId],
148
+ releaseCoverArtPackageId,
149
149
  )
150
150
  )[releaseId] ?? null
151
151
  );
@@ -166,7 +166,7 @@ export function parseReleaseCoverContent(
166
166
  };
167
167
  }
168
168
 
169
- /** Deterministic dynamic-field id for one release-cover package generation. */
169
+ /** Deterministic dynamic-field id for the configured release-cover package. */
170
170
  export function releaseCoverFieldId(
171
171
  releaseId: string,
172
172
  releaseCoverArtPackageId: string,
@@ -179,24 +179,18 @@ export function releaseCoverFieldId(
179
179
  }
180
180
 
181
181
  /**
182
- * Read covers for many releases and package generations in one Core request.
183
- *
184
- * Package IDs are ordered newest to oldest. If both fields exist, the newest
185
- * wins; legacy fallbacks add bytes to the same bulk request, not serial probes.
182
+ * Read covers for many releases from the configured package in one Core request.
186
183
  */
187
184
  export async function getReleaseCoversByIds(
188
185
  client: ClientWithCoreApi,
189
186
  releaseIdsInput: readonly string[],
190
- releaseCoverArtPackageIds: readonly string[],
187
+ releaseCoverArtPackageId: string,
191
188
  ): Promise<Partial<Record<string, ReleaseCoverView>>> {
192
189
  const releaseIds = [...new Set(releaseIdsInput)];
193
- const targets = releaseIds.flatMap((releaseId) =>
194
- releaseCoverArtPackageIds.map((packageId, priority) => ({
195
- releaseId,
196
- priority,
197
- fieldId: releaseCoverFieldId(releaseId, packageId),
198
- })),
199
- );
190
+ const targets = releaseIds.map((releaseId) => ({
191
+ releaseId,
192
+ fieldId: releaseCoverFieldId(releaseId, releaseCoverArtPackageId),
193
+ }));
200
194
  if (targets.length === 0) return {};
201
195
 
202
196
  const { objects } = await client.core.getObjects({
@@ -204,17 +198,12 @@ export async function getReleaseCoversByIds(
204
198
  include: { content: true },
205
199
  });
206
200
  const out: Partial<Record<string, ReleaseCoverView>> = {};
207
- const priorities = new Map<string, number>();
208
201
  objects.forEach((object, index) => {
209
202
  const target = targets[index];
210
203
  if (!target || object instanceof Error || !object.content) return;
211
- const currentPriority = priorities.get(target.releaseId);
212
- if (currentPriority !== undefined && currentPriority <= target.priority)
213
- return;
214
204
  const cover = parseReleaseCoverContent(object.content);
215
205
  if (cover) {
216
206
  out[target.releaseId] = cover;
217
- priorities.set(target.releaseId, target.priority);
218
207
  }
219
208
  });
220
209
  return out;