@misonetwork/sdk 0.3.1 → 0.5.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.
Files changed (60) hide show
  1. package/README.md +97 -503
  2. package/dist/client.d.ts +6 -55
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +7 -52
  5. package/dist/client.js.map +1 -1
  6. package/dist/contracts/miso/release.d.ts +34 -31
  7. package/dist/contracts/miso/release.d.ts.map +1 -1
  8. package/dist/contracts/miso/release.js +32 -29
  9. package/dist/contracts/miso/release.js.map +1 -1
  10. package/dist/contracts/miso/track.d.ts +66 -22
  11. package/dist/contracts/miso/track.d.ts.map +1 -1
  12. package/dist/contracts/miso/track.js +65 -20
  13. package/dist/contracts/miso/track.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 +0 -1
  19. package/dist/contracts.d.ts.map +1 -1
  20. package/dist/contracts.js +0 -1
  21. package/dist/contracts.js.map +1 -1
  22. package/dist/internal.d.ts +0 -7
  23. package/dist/internal.d.ts.map +1 -1
  24. package/dist/internal.js +0 -22
  25. package/dist/internal.js.map +1 -1
  26. package/dist/parsers.d.ts +1 -4
  27. package/dist/parsers.d.ts.map +1 -1
  28. package/dist/parsers.js +0 -24
  29. package/dist/parsers.js.map +1 -1
  30. package/dist/queries.d.ts +31 -5
  31. package/dist/queries.d.ts.map +1 -1
  32. package/dist/queries.js +179 -56
  33. package/dist/queries.js.map +1 -1
  34. package/dist/transactions.d.ts +10 -71
  35. package/dist/transactions.d.ts.map +1 -1
  36. package/dist/transactions.js +15 -72
  37. package/dist/transactions.js.map +1 -1
  38. package/dist/types.d.ts +3 -40
  39. package/dist/types.d.ts.map +1 -1
  40. package/dist/view.d.ts +7 -7
  41. package/dist/view.d.ts.map +1 -1
  42. package/dist/view.js +9 -9
  43. package/dist/view.js.map +1 -1
  44. package/package.json +4 -4
  45. package/src/client.ts +82 -89
  46. package/src/contracts/miso/release.ts +39 -36
  47. package/src/contracts/miso/track.ts +81 -23
  48. package/src/contracts/utils/index.ts +156 -4
  49. package/src/contracts.ts +0 -1
  50. package/src/internal.ts +0 -24
  51. package/src/parsers.ts +0 -35
  52. package/src/queries.ts +357 -83
  53. package/src/transactions.ts +20 -112
  54. package/src/types.ts +3 -53
  55. package/src/view.ts +13 -13
  56. package/dist/contracts/miso/deal.d.ts +0 -184
  57. package/dist/contracts/miso/deal.d.ts.map +0 -1
  58. package/dist/contracts/miso/deal.js +0 -184
  59. package/dist/contracts/miso/deal.js.map +0 -1
  60. package/src/contracts/miso/deal.ts +0 -257
@@ -70,89 +70,28 @@ export interface CreateRecordingParams extends ShareCurrencyBinding {
70
70
  * one PTB.
71
71
  */
72
72
  export declare function createRecording(tx: Transaction, params: CreateRecordingParams): RecordingParts;
73
- export interface CreateDealParams {
73
+ export interface CreateTrackParams {
74
74
  recordingId: string;
75
75
  recordingAdminCapId?: string;
76
76
  recordingAdminCap?: TransactionObjectArgument;
77
- /** Share type of the recording (the deal's `RecordingShare` phantom). */
77
+ /** Share type of the recording (the track's `RecordingShare` phantom). */
78
78
  recordingShareType: string;
79
- /** Share type of the parent composition (the deal's `CompositionShare` phantom). */
79
+ /** Share type of the parent composition (the track's `CompositionShare` phantom). */
80
80
  compositionShareType: string;
81
- releaseId: string;
81
+ targetReleaseId: string;
82
82
  trackSplitBps: number;
83
83
  misoPackageId: string;
84
84
  }
85
85
  /**
86
- * PRIMITIVE. Appends `deal::new` and returns the `Deal` by value without routing
87
- * it anywhere the caller decides what happens next.
88
- *
89
- * LIFECYCLE NOTE the returned `Deal` MUST be consumed in this same
90
- * transaction. It is `key, store` with no `drop`, so it cannot be discarded, but
91
- * it CAN go to either of two places, which is exactly why this does not choose:
92
- *
93
- * 1. `tx.transferObjects([deal], recipient)` — send it to whoever is
94
- * assembling the release, for them to redeem later. This is the
95
- * cross-party flow: a recording owner signs a deal for someone else's
96
- * release.
97
- * 2. straight into `track::new(deal, &recording)` in this same PTB — the
98
- * same-party flow, where the deal is a transient authorization rather than
99
- * something anyone holds. `@misofm/sdk`'s `publishReleaseGraph` does this.
100
- *
101
- * Both are legitimate, and picking one for the caller would make the other
102
- * awkward, so the disposition stays with the caller. `@misofm/sdk` layers the
103
- * opinionated flows on top.
86
+ * PRIMITIVE. Appends `track::new` and returns its by-value `Track`. A track has
87
+ * `drop, store`, so callers may leave it unused; to assemble a release, pass
88
+ * returned tracks to `tx.makeMoveVec({ type: `${misoPackageId}::track::Track`,
89
+ * elements })` and then call `release_registry::new_release` from `@misofm/sdk`.
104
90
  *
105
91
  * The `recordingAdminCap` may be passed as an on-chain object id
106
92
  * (`recordingAdminCapId`) or as a PTB-local argument (`recordingAdminCap`) —
107
- * the latter lets a deal be signed against a recording created earlier in the
93
+ * the latter lets a track be created against a recording created earlier in the
108
94
  * same transaction, before its cap has been transferred anywhere.
109
95
  */
110
- export declare function createDeal(tx: Transaction, params: CreateDealParams): TransactionObjectArgument;
111
- export interface RejectDealParams {
112
- dealId: string;
113
- /** Share type of the recording (the deal's `RecordingShare` phantom). */
114
- recordingShareType: string;
115
- /** Share type of the parent composition (the deal's `CompositionShare` phantom). */
116
- compositionShareType: string;
117
- misoPackageId: string;
118
- }
119
- /** Rejects (destroys) a deal without including it in a release. Emits `DealRejectedEvent`. */
120
- export declare function rejectDeal(params: RejectDealParams): TxThunk;
121
- /** The two by-value results of `release::new`, for threading onward in a PTB. */
122
- export interface ReleaseParts {
123
- release: TransactionObjectArgument;
124
- adminCap: TransactionObjectArgument;
125
- }
126
- export interface CreateReleaseParams {
127
- title: string;
128
- /** u256 nonce as a decimal string (deterministic release id). */
129
- nonce: string;
130
- releaseRegistryId: string;
131
- misoPackageId: string;
132
- }
133
- /**
134
- * PRIMITIVE. Appends `release::new` over a caller-built `vector<Track>` and
135
- * returns its by-value results without publishing (sharing) the release or
136
- * routing the admin cap — the caller decides what happens next. Mirrors
137
- * {@link createComposition}/{@link createRecording}.
138
- *
139
- * `trackVec` is supplied by the caller because track assembly is the part that
140
- * genuinely varies between release flows: from recording admin caps, from
141
- * pre-made deals, or from a mix of fresh and existing recordings (see
142
- * `@misofm/sdk`'s `publishRelease`/`publishReleaseFromDeals`/
143
- * `publishReleaseGraph`).
144
- *
145
- * LIFECYCLE NOTE — the returned `Release` MUST be consumed by
146
- * `release::publish` in this same transaction. `Release` is `key`-only with no
147
- * `drop`, and `publish` is its only by-value consumer, so an `Initialized`
148
- * release cannot be transferred, wrapped, shared, or discarded, and cannot
149
- * outlive its creating transaction; the protocol deliberately provides no keep
150
- * function. That is a same-PTB requirement, NOT a same-function one — pairing
151
- * this with a later `finalizeRelease` command in the same `tx` satisfies it.
152
- * (`Composition` and `Recording` carry the identical requirement, which is why
153
- * all three primitives have the same shape.) The admin cap has no such
154
- * constraint: `ReleaseAdminCap` is `key, store` and `publish` only borrows it,
155
- * so it is an ordinary transferable value the caller routes as it sees fit.
156
- */
157
- export declare function createRelease(tx: Transaction, params: CreateReleaseParams, trackVec: TransactionObjectArgument): ReleaseParts;
96
+ export declare function createTrack(tx: Transaction, params: CreateTrackParams): TransactionObjectArgument;
158
97
  //# sourceMappingURL=transactions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../src/transactions.ts"],"names":[],"mappings":"AAqCA,OAAO,EAAE,WAAW,EAAE,KAAK,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAOvF,0FAA0F;AAC1F,MAAM,MAAM,OAAO,GAAG,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAMhE;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,eAAe,EAAE,MAAM,CAAC;IAC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yBAAyB,CAAC;IAC9C,0EAA0E;IAC1E,kBAAkB,EAAE,MAAM,CAAC;IAC3B,qFAAqF;IACrF,oBAAoB,EAAE,MAAM,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,iBAAiB,GAAG,yBAAyB,CAiBjG"}
@@ -1,18 +1,17 @@
1
1
  // Copyright (c) Miso Labs, Inc.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  // Transaction builders. Every builder adds commands to a caller-owned
4
- // `Transaction`, so flows compose in a single PTB, but they come in two shapes.
4
+ // `Transaction`, so flows compose in a single PTB.
5
5
  // The `create*` primitives take the `Transaction` as their FIRST argument and
6
6
  // return their by-value results, so those results can be threaded into later
7
- // commands. `rejectDeal` has nothing to hand back, so it keeps the Sui SDK
8
- // thunk shape: `(params) => (tx: Transaction) => …`. Miso calls go through the
9
- // codegen-generated, type-safe call functions.
7
+ // commands. Miso calls go through the codegen-generated, type-safe call
8
+ // functions.
10
9
  //
11
10
  // This module keeps the bare protocol PRIMITIVES only. The rule is: do the
12
11
  // minimum the Move semantics FORCE, and return anything the caller could
13
12
  // legitimately route elsewhere.
14
13
  //
15
- // `createComposition`, `createRecording`, and `createRelease` each append a
14
+ // `createComposition` and `createRecording` each append a
16
15
  // single `::new` and hand back its by-value results — never dispersing a share
17
16
  // supply, publishing (sharing) the object, or routing an admin cap.
18
17
  //
@@ -27,7 +26,7 @@
27
26
  //
28
27
  // The opinionated layers — track assembly, cap disposition, minato dispersal,
29
28
  // the share-currency lifecycle — live in `@misofm/sdk`
30
- // (`publishRelease`/`publishReleaseFromDeals`/`publishReleaseGraph`,
29
+ // (`release_registry::new_release`, `publishRelease`/`publishReleaseGraph`,
31
30
  // `finalizeComposition`/`finalizeRecording`/`finalizeRelease`,
32
31
  // `publishComposition`/`publishRecording`/`publishCompositionAndRecording`,
33
32
  // `share.ts`) as free functions taking `misoPackageId` explicitly. Those import
@@ -36,8 +35,7 @@
36
35
  import { Transaction } from "@mysten/sui/transactions";
37
36
  import * as composition from "./contracts/miso/composition.js";
38
37
  import * as recording from "./contracts/miso/recording.js";
39
- import * as deal from "./contracts/miso/deal.js";
40
- import * as release from "./contracts/miso/release.js";
38
+ import * as track from "./contracts/miso/track.js";
41
39
  /**
42
40
  * PRIMITIVE. Appends `composition::new` and returns its by-value results without
43
41
  * dispersing, sharing, or transferring anything — the caller decides what happens
@@ -70,85 +68,30 @@ export function createRecording(tx, params) {
70
68
  return { recording: result[0], adminCap: result[1], balance: result[2] };
71
69
  }
72
70
  /**
73
- * PRIMITIVE. Appends `deal::new` and returns the `Deal` by value without routing
74
- * it anywhere the caller decides what happens next.
75
- *
76
- * LIFECYCLE NOTE the returned `Deal` MUST be consumed in this same
77
- * transaction. It is `key, store` with no `drop`, so it cannot be discarded, but
78
- * it CAN go to either of two places, which is exactly why this does not choose:
79
- *
80
- * 1. `tx.transferObjects([deal], recipient)` — send it to whoever is
81
- * assembling the release, for them to redeem later. This is the
82
- * cross-party flow: a recording owner signs a deal for someone else's
83
- * release.
84
- * 2. straight into `track::new(deal, &recording)` in this same PTB — the
85
- * same-party flow, where the deal is a transient authorization rather than
86
- * something anyone holds. `@misofm/sdk`'s `publishReleaseGraph` does this.
87
- *
88
- * Both are legitimate, and picking one for the caller would make the other
89
- * awkward, so the disposition stays with the caller. `@misofm/sdk` layers the
90
- * opinionated flows on top.
71
+ * PRIMITIVE. Appends `track::new` and returns its by-value `Track`. A track has
72
+ * `drop, store`, so callers may leave it unused; to assemble a release, pass
73
+ * returned tracks to `tx.makeMoveVec({ type: `${misoPackageId}::track::Track`,
74
+ * elements })` and then call `release_registry::new_release` from `@misofm/sdk`.
91
75
  *
92
76
  * The `recordingAdminCap` may be passed as an on-chain object id
93
77
  * (`recordingAdminCapId`) or as a PTB-local argument (`recordingAdminCap`) —
94
- * the latter lets a deal be signed against a recording created earlier in the
78
+ * the latter lets a track be created against a recording created earlier in the
95
79
  * same transaction, before its cap has been transferred anywhere.
96
80
  */
97
- export function createDeal(tx, params) {
81
+ export function createTrack(tx, params) {
98
82
  if (!params.recordingAdminCap && !params.recordingAdminCapId) {
99
- throw new Error("createDeal: recordingAdminCapId or recordingAdminCap required");
83
+ throw new Error("createTrack: recordingAdminCapId or recordingAdminCap required");
100
84
  }
101
85
  const adminCapArg = params.recordingAdminCap ?? tx.object(params.recordingAdminCapId);
102
- return tx.add(deal._new({
86
+ return tx.add(track._new({
103
87
  package: params.misoPackageId,
104
88
  typeArguments: [params.recordingShareType, params.compositionShareType],
105
89
  arguments: [
106
90
  adminCapArg,
107
91
  tx.object(params.recordingId),
108
- tx.pure.id(params.releaseId),
92
+ tx.pure.id(params.targetReleaseId),
109
93
  tx.pure.u16(params.trackSplitBps),
110
94
  ],
111
95
  }));
112
96
  }
113
- /** Rejects (destroys) a deal without including it in a release. Emits `DealRejectedEvent`. */
114
- export function rejectDeal(params) {
115
- return (tx) => {
116
- tx.add(deal.reject({
117
- package: params.misoPackageId,
118
- typeArguments: [params.recordingShareType, params.compositionShareType],
119
- arguments: [tx.object(params.dealId)],
120
- }));
121
- };
122
- }
123
- /**
124
- * PRIMITIVE. Appends `release::new` over a caller-built `vector<Track>` and
125
- * returns its by-value results without publishing (sharing) the release or
126
- * routing the admin cap — the caller decides what happens next. Mirrors
127
- * {@link createComposition}/{@link createRecording}.
128
- *
129
- * `trackVec` is supplied by the caller because track assembly is the part that
130
- * genuinely varies between release flows: from recording admin caps, from
131
- * pre-made deals, or from a mix of fresh and existing recordings (see
132
- * `@misofm/sdk`'s `publishRelease`/`publishReleaseFromDeals`/
133
- * `publishReleaseGraph`).
134
- *
135
- * LIFECYCLE NOTE — the returned `Release` MUST be consumed by
136
- * `release::publish` in this same transaction. `Release` is `key`-only with no
137
- * `drop`, and `publish` is its only by-value consumer, so an `Initialized`
138
- * release cannot be transferred, wrapped, shared, or discarded, and cannot
139
- * outlive its creating transaction; the protocol deliberately provides no keep
140
- * function. That is a same-PTB requirement, NOT a same-function one — pairing
141
- * this with a later `finalizeRelease` command in the same `tx` satisfies it.
142
- * (`Composition` and `Recording` carry the identical requirement, which is why
143
- * all three primitives have the same shape.) The admin cap has no such
144
- * constraint: `ReleaseAdminCap` is `key, store` and `publish` only borrows it,
145
- * so it is an ordinary transferable value the caller routes as it sees fit.
146
- */
147
- export function createRelease(tx, params, trackVec) {
148
- const result = tx.add(release._new({
149
- package: params.misoPackageId,
150
- arguments: [tx.pure.string(params.title), trackVec, tx.pure.u256(BigInt(params.nonce)), tx.object(params.releaseRegistryId)],
151
- }));
152
- return { release: result[0], adminCap: result[1] };
153
- }
154
97
  //# sourceMappingURL=transactions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transactions.js","sourceRoot":"","sources":["../src/transactions.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAEtC,sEAAsE;AACtE,gFAAgF;AAChF,8EAA8E;AAC9E,6EAA6E;AAC7E,2EAA2E;AAC3E,+EAA+E;AAC/E,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,yEAAyE;AACzE,gCAAgC;AAChC,EAAE;AACF,4EAA4E;AAC5E,+EAA+E;AAC/E,oEAAoE;AACpE,EAAE;AACF,8EAA8E;AAC9E,iFAAiF;AACjF,+EAA+E;AAC/E,gFAAgF;AAChF,0EAA0E;AAC1E,gFAAgF;AAChF,gFAAgF;AAChF,2CAA2C;AAC3C,EAAE;AACF,8EAA8E;AAC9E,uDAAuD;AACvD,qEAAqE;AACrE,+DAA+D;AAC/D,4EAA4E;AAC5E,gFAAgF;AAChF,gFAAgF;AAChF,+BAA+B;AAE/B,OAAO,EAAE,WAAW,EAAkC,MAAM,0BAA0B,CAAC;AAEvF,OAAO,KAAK,WAAW,MAAM,iCAAiC,CAAC;AAC/D,OAAO,KAAK,SAAS,M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,MAAM,CAAC,aAAa,CAAC;SAClC;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
package/dist/types.d.ts CHANGED
@@ -101,24 +101,6 @@ export interface RecordingAdminCap {
101
101
  /** The share type parameter T from RecordingAdminCap<T>. */
102
102
  shareType: string;
103
103
  }
104
- /**
105
- * A deal authorizing a recording's inclusion in a specific release. Created by
106
- * the recording's admin, held (transferably) by whoever assembles the release,
107
- * and consumed by `track::new`. The recording/composition identities ride on
108
- * the object's type parameters; the recording's object id is NOT stored.
109
- */
110
- export interface Deal {
111
- /** The object ID of the deal. */
112
- id: string;
113
- /** The exact release id this deal authorizes (a digest of the full tracklist + nonce). */
114
- releaseId: string;
115
- /** The agreed track split for this recording within the release. */
116
- trackSplitBps: BPS;
117
- /** The recording's share type (first type parameter of `Deal<R, C>`). */
118
- recordingShareType: string;
119
- /** The parent composition's share type (second type parameter of `Deal<R, C>`). */
120
- compositionShareType: string;
121
- }
122
104
  /** Lifecycle state of a track on a release. */
123
105
  export type TrackState = "Unassigned" | "Assigned";
124
106
  /**
@@ -148,7 +130,7 @@ export type ReleaseState = {
148
130
  * A release is a flat, ordered tracklist with per-track revenue distribution
149
131
  * configuration. Display grouping (discs, vinyl sides), cover art, and edition
150
132
  * naming live in extensions — the stored tracklist has the same shape as the
151
- * digest pre-image every deal consented to.
133
+ * digest pre-image every track consented to.
152
134
  *
153
135
  * State machine: Initialized -> Published (immutable after publish)
154
136
  */
@@ -164,8 +146,8 @@ export interface Release {
164
146
  }
165
147
  /**
166
148
  * Emitted once when a release is published. A pure pointer carrying only the
167
- * release's identity — an indexer fetches the full immutable object (discs,
168
- * tracks) by `releaseId`.
149
+ * release's identity — an indexer fetches the full immutable object by
150
+ * `releaseId`.
169
151
  */
170
152
  export interface ReleasePublishedEvent {
171
153
  releaseId: string;
@@ -182,23 +164,4 @@ export interface ReleaseAdminCap {
182
164
  /** The object ID of the Release this cap administers. */
183
165
  releaseId: string;
184
166
  }
185
- export interface DealCreatedEvent {
186
- dealId: string;
187
- releaseId: string;
188
- trackSplitBps: BPS;
189
- }
190
- /**
191
- * Emitted when a deal is accepted: consumed by `track::new` into a track for
192
- * its target release. Treat as provisional until the release publishes (in the
193
- * honest path both land in the same transaction).
194
- */
195
- export interface DealAcceptedEvent {
196
- dealId: string;
197
- releaseId: string;
198
- }
199
- /** Emitted when a deal is rejected: destroyed without inclusion in a release. Terminal. */
200
- export interface DealRejectedEvent {
201
- dealId: string;
202
- releaseId: string;
203
- }
204
167
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAOA,wDAAwD;AACxD,MAAM,WAAW,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAMD,wCAAwC;AACxC,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,GACvB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/C;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,KAAK,EAAE,gBAAgB,CAAC;IACxB,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,gGAAgG;IAChG,WAAW,EAAE,GAAG,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD,sCAAsC;AACtC,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,aAAa,C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,OAAO;IACtB,0CAA0C;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,KAAK,EAAE,YAAY,CAAC;IACpB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;CACnB"}
package/dist/view.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ClientWithCoreApi } from "@mysten/sui/client";
2
- export interface DeriveReleaseIdParams {
2
+ export interface DeriveTargetReleaseIdParams {
3
3
  /** Sender for the simulation (any address; not charged). */
4
4
  sender: string;
5
5
  /** Recording object ids, in track order. */
@@ -8,14 +8,14 @@ export interface DeriveReleaseIdParams {
8
8
  splitBps: number[];
9
9
  /** The release nonce (u256 as a decimal string). */
10
10
  nonce: string;
11
- /** The shared ReleaseRegistry object id. */
12
- releaseRegistryId: string;
11
+ /** The derivation parent's object ID, e.g. an extension's shared ReleaseRegistry. */
12
+ parentId: string;
13
13
  }
14
14
  /**
15
15
  * Derives the release id the on-chain `release::new` will produce for these
16
- * inputs, via a `simulateTransaction` call to `release::derive_release_id`. The
17
- * deals embedded in a release must reference this exact id, so it is computed up
18
- * front and threaded into the release publish builder.
16
+ * inputs, via a `simulateTransaction` call to `release::derive_target_release_id`.
17
+ * Tracks embedded in a release must reference this exact ID, so it is computed
18
+ * up front and threaded into the extension-layer release builder.
19
19
  */
20
- export declare function deriveReleaseId(client: ClientWithCoreApi, misoPackageId: string, params: DeriveReleaseIdParams): Promise<string>;
20
+ export declare function deriveTargetReleaseId(client: ClientWithCoreApi, misoPackageId: string, params: DeriveTargetReleaseIdParams): Promise<string>;
21
21
  //# sourceMappingURL=view.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../src/view.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,MAAM,WAAW,qBAAqB;IACpC,4DAA4D;IAC5D,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,iBAAiB,EACzB,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,MAAM,CAAC,CAsBjB"}
1
+ {"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../src/view.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,MAAM,WAAW,2BAA2B;IAC1C,4DAA4D;IAC5D,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,qFAAqF;IACrF,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,iBAAiB,EACzB,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,MAAM,CAAC,CAsBjB"}
package/dist/view.js CHANGED
@@ -9,28 +9,28 @@ import { bcs } from "@mysten/sui/bcs";
9
9
  import * as release from "./contracts/miso/release.js";
10
10
  /**
11
11
  * Derives the release id the on-chain `release::new` will produce for these
12
- * inputs, via a `simulateTransaction` call to `release::derive_release_id`. The
13
- * deals embedded in a release must reference this exact id, so it is computed up
14
- * front and threaded into the release publish builder.
12
+ * inputs, via a `simulateTransaction` call to `release::derive_target_release_id`.
13
+ * Tracks embedded in a release must reference this exact ID, so it is computed
14
+ * up front and threaded into the extension-layer release builder.
15
15
  */
16
- export async function deriveReleaseId(client, misoPackageId, params) {
16
+ export async function deriveTargetReleaseId(client, misoPackageId, params) {
17
17
  if (params.recordingIds.length !== params.splitBps.length) {
18
- throw new Error(`deriveReleaseId: recordingIds (${params.recordingIds.length}) and splitBps (${params.splitBps.length}) length mismatch.`);
18
+ throw new Error(`deriveTargetReleaseId: recordingIds (${params.recordingIds.length}) and splitBps (${params.splitBps.length}) length mismatch.`);
19
19
  }
20
20
  const tx = new Transaction();
21
21
  tx.setSender(params.sender);
22
- tx.add(release.deriveReleaseId({
22
+ tx.add(release.deriveTargetReleaseId({
23
23
  package: misoPackageId,
24
- arguments: [params.recordingIds, params.splitBps.map((v) => BigInt(v)), BigInt(params.nonce), params.releaseRegistryId],
24
+ arguments: [params.recordingIds, params.splitBps.map((v) => BigInt(v)), BigInt(params.nonce), params.parentId],
25
25
  }));
26
26
  // gRPC/Core equivalent of devInspect: simulate with per-command return values.
27
27
  const res = await client.core.simulateTransaction({ transaction: tx, include: { commandResults: true } });
28
28
  if (res.$kind !== "Transaction") {
29
- throw new Error(`derive_release_id simulation failed: ${JSON.stringify(res.FailedTransaction.status)}`);
29
+ throw new Error(`derive_target_release_id simulation failed: ${JSON.stringify(res.FailedTransaction.status)}`);
30
30
  }
31
31
  const returned = res.commandResults?.[0]?.returnValues?.[0]?.bcs;
32
32
  if (!returned)
33
- throw new Error("derive_release_id returned no value.");
33
+ throw new Error("derive_target_release_id returned no value.");
34
34
  return bcs.Address.parse(returned);
35
35
  }
36
36
  //# sourceMappingURL=view.js.map
package/dist/view.js.map CHANGED
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AC,GAAG,CACJ,OAAO,CAAC,qBAAqB,CAAC;QAC5B,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;KAC/G,CAAC,CACH,CAAC;IAEF,+EAA+E;IAC/E,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IAC1G,IAAI,GAAG,CAAC,KAAK,KAAK,aAAa,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,+CAA+C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACjH,CAAC;IACD,MAAM,QAAQ,GAAG,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;IACjE,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IAC9E,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@misonetwork/sdk",
3
- "version": "0.3.1",
3
+ "version": "0.5.0",
4
4
  "description": "Typed query helpers and transaction builders for the Miso protocol core on Sui.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -31,9 +31,9 @@
31
31
  "test": "bun test",
32
32
  "codegen": "sui-ts-codegen generate",
33
33
  "docs": "typedoc",
34
- "build": "tsc -p tsconfig.build.json",
35
- "prepack": "tsc -p tsconfig.build.json",
36
- "prepare": "tsc -p tsconfig.build.json"
34
+ "build": "rm -rf dist && tsc -p tsconfig.build.json",
35
+ "prepack": "rm -rf dist && tsc -p tsconfig.build.json",
36
+ "prepare": "rm -rf dist && tsc -p tsconfig.build.json"
37
37
  },
38
38
  "exports": {
39
39
  ".": {