@misofm/sdk 0.10.0 → 0.12.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 (124) hide show
  1. package/README.md +9 -7
  2. package/dist/client.d.ts +11 -22
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +16 -32
  5. package/dist/client.js.map +1 -1
  6. package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts +4 -2
  7. package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts.map +1 -1
  8. package/dist/contracts/composition_routed_stake/composition_routed_stake.js +3 -2
  9. package/dist/contracts/composition_routed_stake/composition_routed_stake.js.map +1 -1
  10. package/dist/contracts/genre/genre.d.ts +6 -17
  11. package/dist/contracts/genre/genre.d.ts.map +1 -1
  12. package/dist/contracts/genre/genre.js +4 -18
  13. package/dist/contracts/genre/genre.js.map +1 -1
  14. package/dist/contracts/miso_pressing/certificate.d.ts +37 -26
  15. package/dist/contracts/miso_pressing/certificate.d.ts.map +1 -1
  16. package/dist/contracts/miso_pressing/certificate.js +41 -24
  17. package/dist/contracts/miso_pressing/certificate.js.map +1 -1
  18. package/dist/contracts/miso_pressing/listing.d.ts +3 -18
  19. package/dist/contracts/miso_pressing/listing.d.ts.map +1 -1
  20. package/dist/contracts/miso_pressing/listing.js +3 -18
  21. package/dist/contracts/miso_pressing/listing.js.map +1 -1
  22. package/dist/contracts/miso_pressing/pressing.d.ts +6 -37
  23. package/dist/contracts/miso_pressing/pressing.d.ts.map +1 -1
  24. package/dist/contracts/miso_pressing/pressing.js +6 -43
  25. package/dist/contracts/miso_pressing/pressing.js.map +1 -1
  26. package/dist/contracts/routed_stake/routed_stake.d.ts +0 -14
  27. package/dist/contracts/routed_stake/routed_stake.d.ts.map +1 -1
  28. package/dist/contracts/routed_stake/routed_stake.js +0 -14
  29. package/dist/contracts/routed_stake/routed_stake.js.map +1 -1
  30. package/dist/contracts/royalty_pool/pool.d.ts +0 -14
  31. package/dist/contracts/royalty_pool/pool.d.ts.map +1 -1
  32. package/dist/contracts/royalty_pool/pool.js +0 -14
  33. package/dist/contracts/royalty_pool/pool.js.map +1 -1
  34. package/dist/contracts/royalty_pool/stake.d.ts +0 -13
  35. package/dist/contracts/royalty_pool/stake.d.ts.map +1 -1
  36. package/dist/contracts/royalty_pool/stake.js +0 -14
  37. package/dist/contracts/royalty_pool/stake.js.map +1 -1
  38. package/dist/contracts/vault/vault.d.ts +0 -13
  39. package/dist/contracts/vault/vault.d.ts.map +1 -1
  40. package/dist/contracts/vault/vault.js +0 -14
  41. package/dist/contracts/vault/vault.js.map +1 -1
  42. package/dist/contracts.d.ts +0 -1
  43. package/dist/contracts.d.ts.map +1 -1
  44. package/dist/contracts.js +0 -1
  45. package/dist/contracts.js.map +1 -1
  46. package/dist/cover.d.ts +1 -1
  47. package/dist/cover.js +1 -1
  48. package/dist/deployments.d.ts +3 -23
  49. package/dist/deployments.d.ts.map +1 -1
  50. package/dist/deployments.js.map +1 -1
  51. package/dist/pressing.d.ts +0 -3
  52. package/dist/pressing.d.ts.map +1 -1
  53. package/dist/pressing.js +1 -1
  54. package/dist/pressing.js.map +1 -1
  55. package/dist/read/artist.d.ts +2 -3
  56. package/dist/read/artist.d.ts.map +1 -1
  57. package/dist/read/artist.js +8 -53
  58. package/dist/read/artist.js.map +1 -1
  59. package/dist/read/catalog.js +3 -3
  60. package/dist/read/catalog.js.map +1 -1
  61. package/dist/read/client.d.ts +3 -3
  62. package/dist/read/client.d.ts.map +1 -1
  63. package/dist/read/client.js +4 -10
  64. package/dist/read/client.js.map +1 -1
  65. package/dist/read/config.d.ts +3 -23
  66. package/dist/read/config.d.ts.map +1 -1
  67. package/dist/read/config.js.map +1 -1
  68. package/dist/read/index.d.ts +2 -2
  69. package/dist/read/index.d.ts.map +1 -1
  70. package/dist/read/index.js +3 -3
  71. package/dist/read/index.js.map +1 -1
  72. package/dist/read/receipts.js +1 -1
  73. package/dist/read/receipts.js.map +1 -1
  74. package/dist/read/types.d.ts +0 -11
  75. package/dist/read/types.d.ts.map +1 -1
  76. package/dist/read/wallet.js +9 -10
  77. package/dist/read/wallet.js.map +1 -1
  78. package/dist/release-extensions.d.ts +4 -10
  79. package/dist/release-extensions.d.ts.map +1 -1
  80. package/dist/release-extensions.js +6 -19
  81. package/dist/release-extensions.js.map +1 -1
  82. package/dist/release-graph.d.ts.map +1 -1
  83. package/dist/release-graph.js +7 -1
  84. package/dist/release-graph.js.map +1 -1
  85. package/dist/vault.d.ts +1 -1
  86. package/dist/vault.d.ts.map +1 -1
  87. package/dist/vault.js +1 -0
  88. package/dist/vault.js.map +1 -1
  89. package/package.json +6 -12
  90. package/src/client.ts +21 -60
  91. package/src/contracts/composition_routed_stake/composition_routed_stake.ts +7 -4
  92. package/src/contracts/genre/genre.ts +7 -30
  93. package/src/contracts/miso_pressing/certificate.ts +64 -29
  94. package/src/contracts/miso_pressing/listing.ts +4 -33
  95. package/src/contracts/miso_pressing/pressing.ts +6 -61
  96. package/src/contracts/routed_stake/routed_stake.ts +0 -27
  97. package/src/contracts/royalty_pool/pool.ts +0 -27
  98. package/src/contracts/royalty_pool/stake.ts +0 -26
  99. package/src/contracts/vault/vault.ts +0 -26
  100. package/src/contracts.ts +0 -1
  101. package/src/cover.ts +1 -1
  102. package/src/deployments.ts +3 -23
  103. package/src/pressing.ts +1 -4
  104. package/src/read/artist.ts +9 -66
  105. package/src/read/catalog.ts +3 -3
  106. package/src/read/client.ts +6 -13
  107. package/src/read/config.ts +4 -24
  108. package/src/read/index.ts +2 -4
  109. package/src/read/receipts.ts +1 -1
  110. package/src/read/types.ts +0 -12
  111. package/src/read/wallet.ts +9 -9
  112. package/src/release-extensions.ts +6 -29
  113. package/src/release-graph.ts +7 -1
  114. package/src/vault.ts +2 -1
  115. package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.d.ts +0 -52
  116. package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.d.ts.map +0 -1
  117. package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.js +0 -37
  118. package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.js.map +0 -1
  119. package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.d.ts +0 -91
  120. package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.d.ts.map +0 -1
  121. package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.js +0 -91
  122. package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.js.map +0 -1
  123. package/src/contracts/release_snapshot_bundle/deps/ori/walrus_data.ts +0 -36
  124. package/src/contracts/release_snapshot_bundle/release_snapshot_bundle.ts +0 -124
package/src/client.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  // Two things this buys over calling the bare functions:
15
15
  //
16
16
  // IDS ARE CONFIGURED ONCE. Every builder and reader below needs the pressing
17
- // package id, and half of them need the record `Settings` too. Threading those
17
+ // package id. Threading those
18
18
  // through 20 call sites is how an app ends up publishing against one package and
19
19
  // reading against another.
20
20
  //
@@ -36,6 +36,7 @@ import {
36
36
  miso as protocolMiso,
37
37
  type MisoProtocolClient,
38
38
  } from "@misonetwork/sdk/client";
39
+ import type { PartyProtocolClient } from "@misonetwork/sdk/party";
39
40
 
40
41
  import * as listingContract from "./contracts/miso_pressing/listing.ts";
41
42
  import * as pressingContract from "./contracts/miso_pressing/pressing.ts";
@@ -56,7 +57,6 @@ import * as recordingLanguageContract from "./contracts/recording_language/recor
56
57
  import * as recordingMasterReferenceContract from "./contracts/recording_master_reference/recording_master_reference.ts";
57
58
  import * as recordingPreviewContract from "./contracts/recording_preview/recording_preview.ts";
58
59
  import * as vaultActions from "./vault.ts";
59
- import * as releaseSnapshotBundleContract from "./contracts/release_snapshot_bundle/release_snapshot_bundle.ts";
60
60
  import * as coverArtContract from "./contracts/cover_art/cover_art.ts";
61
61
  import * as releaseCoverArtContract from "./contracts/release_cover_art/release_cover_art.ts";
62
62
  import * as releaseCreditsContract from "./contracts/release_credits/release_credits.ts";
@@ -111,17 +111,15 @@ import {
111
111
  type MisoPlatformDeployment,
112
112
  } from "./deployments.ts";
113
113
  import {
114
- deriveGenreId,
114
+ deriveGenreAddress,
115
115
  setReleaseDescription,
116
116
  setReleaseDspLinks,
117
117
  setReleaseGenres,
118
118
  setReleaseKind,
119
- setReleaseSnapshotBundle,
120
119
  type SetReleaseDescriptionParams,
121
120
  type SetReleaseDspLinksParams,
122
121
  type SetReleaseGenresParams,
123
122
  type SetReleaseKindParams,
124
- type SetReleaseSnapshotBundleParams,
125
123
  } from "./release-extensions.ts";
126
124
  import { addReleaseCredit, type AddReleaseCreditParams } from "./credits.ts";
127
125
  import {
@@ -174,11 +172,6 @@ export interface MisoOptions<Name extends string = "miso"> {
174
172
  export interface MisoPlatformConfig {
175
173
  /** The published `miso_pressing` package. */
176
174
  packageId: string;
177
- /**
178
- * The `miso_record` shared `Settings` that authorizes `miso_pressing`'s
179
- * `MintWitness`. Required to buy; optional if this client only ever reads.
180
- */
181
- settingsId?: string;
182
175
  /**
183
176
  * The `@misonetwork/sdk` protocol package (miso core). Required for the
184
177
  * publish builders (`publishComposition`, `publishRecording`,
@@ -199,7 +192,6 @@ export interface MisoPlatformConfig {
199
192
  releaseDescriptionPackageId?: string;
200
193
  releaseGenrePackageId?: string;
201
194
  releaseDspLinkPackageId?: string;
202
- releaseSnapshotBundlePackageId?: string;
203
195
  recordingAdvisoryPackageId?: string;
204
196
  recordingLanguagePackageId?: string;
205
197
  recordingMasterReferencePackageId?: string;
@@ -227,7 +219,7 @@ export interface MisoPlatformConfig {
227
219
 
228
220
  /** Params with the ids this client already knows dropped from the call site. */
229
221
  type DistributiveOmit<T, Keys extends PropertyKey> = T extends unknown ? Omit<T, Keys> : never;
230
- type Configured<T> = DistributiveOmit<T, "misoPressingPackageId" | "settingsId">;
222
+ type Configured<T> = DistributiveOmit<T, "misoPressingPackageId">;
231
223
 
232
224
  /** Publish-builder params with the protocol/minato ids this client already knows dropped. */
233
225
  type ConfiguredPublish<T> = DistributiveOmit<T, "misoPackageId" | "minatoPackageId">;
@@ -253,10 +245,6 @@ type ConfiguredReleaseDspLinks = DistributiveOmit<
253
245
  SetReleaseDspLinksParams,
254
246
  "releaseDspLinkPackageId"
255
247
  >;
256
- type ConfiguredReleaseSnapshotBundle = DistributiveOmit<
257
- SetReleaseSnapshotBundleParams,
258
- "releaseSnapshotBundlePackageId" | "oriPackageId"
259
- >;
260
248
  type ConfiguredReleaseCredit = DistributiveOmit<
261
249
  AddReleaseCreditParams,
262
250
  "releaseCreditsPackageId" | "misoCreditPackageId"
@@ -298,18 +286,18 @@ export class MisoPlatformClient {
298
286
  this.deployment = deployment;
299
287
  }
300
288
 
301
- get packageId(): string {
302
- return this.#config.packageId;
303
- }
304
-
305
- #settings(): string {
306
- const { settingsId } = this.#config;
307
- if (!settingsId) {
289
+ /** Party identity and profile APIs, backed by the network SDK. */
290
+ get party(): PartyProtocolClient {
291
+ if (!this.protocol) {
308
292
  throw new Error(
309
- "misoPlatform: `settingsId` is required to build a purchase pass it to misoPlatform({ settingsId }).",
293
+ "misoPlatform: Party APIs require the complete platform deployment. Use miso({ deployment }).",
310
294
  );
311
295
  }
312
- return settingsId;
296
+ return this.protocol.party;
297
+ }
298
+
299
+ get packageId(): string {
300
+ return this.#config.packageId;
313
301
  }
314
302
 
315
303
  #misoPackageId(): string {
@@ -389,7 +377,7 @@ export class MisoPlatformClient {
389
377
  sale: (releaseId: string, currencyType: string) =>
390
378
  deriveSaleIds(releaseId, currencyType, this.packageId),
391
379
  genre: (canonicalName: string) =>
392
- deriveGenreId(
380
+ deriveGenreAddress(
393
381
  this.#requiredConfig("genreRegistryId", "genre id derivation"),
394
382
  this.#requiredConfig("genrePackageId", "genre id derivation"),
395
383
  canonicalName,
@@ -402,7 +390,6 @@ export class MisoPlatformClient {
402
390
  buyRecord: (p: Configured<BuyRecordParams>): TxThunk =>
403
391
  buyRecord({
404
392
  ...p,
405
- settingsId: this.#settings(),
406
393
  misoPressingPackageId: this.packageId,
407
394
  }),
408
395
  openPressing: (p: Configured<OpenPressingParams>): TxThunk =>
@@ -491,18 +478,6 @@ export class MisoPlatformClient {
491
478
  "setReleaseDspLinks",
492
479
  ),
493
480
  }),
494
- setReleaseSnapshotBundle: (p: ConfiguredReleaseSnapshotBundle): TxThunk =>
495
- setReleaseSnapshotBundle({
496
- ...p,
497
- releaseSnapshotBundlePackageId: this.#requiredConfig(
498
- "releaseSnapshotBundlePackageId",
499
- "setReleaseSnapshotBundle",
500
- ),
501
- oriPackageId: this.#requiredConfig(
502
- "oriPackageId",
503
- "setReleaseSnapshotBundle",
504
- ),
505
- }),
506
481
  addReleaseCredit: (p: ConfiguredReleaseCredit): TxThunk =>
507
482
  addReleaseCredit({
508
483
  ...p,
@@ -568,10 +543,10 @@ export class MisoPlatformClient {
568
543
  /** Generated Move-call bindings, for commands this facade doesn't wrap. */
569
544
  get call() {
570
545
  return {
571
- listing: bindModulePackage(listingContract, this.packageId, ["newFixedPrice", "newFloorPrice", "newEnabledState", "newDisabledState", "buy", "setState", "setPrice", "deriveId", "hasListing", "id", "releaseId", "pressingId", "price", "state", "isLive", "amount"] as const),
572
- pressing: bindModulePackage(pressingContract, this.packageId, ["newScheduledState", "newActiveState", "newPausedState", "setState", "deriveId", "id", "releaseId", "supply", "isSelling", "pressingAdminCapPressingId", "verifyRecord"] as const),
546
+ listing: bindModulePackage(listingContract, this.packageId, ["newFixedPrice", "newFloorPrice", "newEnabledState", "newDisabledState", "buy", "setState", "setPrice", "deriveId", "hasListing", "releaseId", "pressingId", "price", "state", "isLive", "amount"] as const),
547
+ pressing: bindModulePackage(pressingContract, this.packageId, ["newScheduledState", "newActiveState", "newPausedState", "setState", "deriveId", "releaseId", "supply", "isSelling", "pressingAdminCapPressingId"] as const),
573
548
  genre: this.#config.genrePackageId
574
- ? bindModulePackage(genreContract, this.#config.genrePackageId, ["deriveGenreId", "id"] as const)
549
+ ? bindModulePackage(genreContract, this.#config.genrePackageId, ["deriveAddress"] as const)
575
550
  : undefined,
576
551
  releaseDescription: this.#config.releaseDescriptionPackageId
577
552
  ? bindModulePackage(
@@ -609,7 +584,7 @@ export class MisoPlatformClient {
609
584
  )
610
585
  : undefined,
611
586
  vault: this.#config.vaultPackageId
612
- ? bindModulePackage(vaultContract, this.#config.vaultPackageId, ["share", "id", "vaultId", "authorizedPluginsId", "authorizedPluginCount", "isPluginAuthorized"] as const)
587
+ ? bindModulePackage(vaultContract, this.#config.vaultPackageId, ["share", "vaultId", "authorizedPluginsId", "authorizedPluginCount", "isPluginAuthorized"] as const)
613
588
  : undefined,
614
589
  compositionRoyaltyPool: this.#config.compositionRoyaltyPoolPluginPackageId
615
590
  ? bindModulePackage(
@@ -633,10 +608,10 @@ export class MisoPlatformClient {
633
608
  )
634
609
  : undefined,
635
610
  routedStake: this.#config.routedStakePackageId
636
- ? bindModulePackage(routedStakeContract, this.#config.routedStakePackageId, ["share", "register", "unregister", "sweep", "unstake", "restake", "id"] as const)
611
+ ? bindModulePackage(routedStakeContract, this.#config.routedStakePackageId, ["share", "register", "unregister", "sweep", "unstake", "restake", "derivedAddress"] as const)
637
612
  : undefined,
638
613
  royaltyPool: this.#config.royaltyPoolPackageId
639
- ? bindModulePackage(royaltyPoolContract, this.#config.royaltyPoolPackageId, ["share", "deposit", "redeemAndDeposit", "receiveAndDeposit", "registerStake", "unregisterStake", "claimRewards", "pendingRewards", "id", "stakedShares", "cumulativeRewardPerShare", "cumulativeDeposits", "derivedAddress", "assertDerivedFrom"] as const)
614
+ ? bindModulePackage(royaltyPoolContract, this.#config.royaltyPoolPackageId, ["share", "deposit", "redeemAndDeposit", "receiveAndDeposit", "registerStake", "unregisterStake", "claimRewards", "pendingRewards", "stakedShares", "cumulativeRewardPerShare", "cumulativeDeposits", "derivedAddress", "assertDerivedFrom"] as const)
640
615
  : undefined,
641
616
  recordingAdvisory: this.#config.recordingAdvisoryPackageId
642
617
  ? bindModulePackage(recordingAdvisoryContract, this.#config.recordingAdvisoryPackageId, ["explicit", "notExplicit", "cleaned", "setRating", "unsetRating", "hasRating", "isExplicit", "isNotExplicit", "isCleaned"] as const)
@@ -650,13 +625,6 @@ export class MisoPlatformClient {
650
625
  recordingPreview: this.#config.recordingPreviewPackageId
651
626
  ? bindModulePackage(recordingPreviewContract, this.#config.recordingPreviewPackageId, ["setPreview", "unsetPreview", "hasPreview"] as const)
652
627
  : undefined,
653
- releaseSnapshotBundle: this.#config.releaseSnapshotBundlePackageId
654
- ? bindModulePackage(
655
- releaseSnapshotBundleContract,
656
- this.#config.releaseSnapshotBundlePackageId,
657
- ["setSnapshotBundle", "hasSnapshotBundle"],
658
- )
659
- : undefined,
660
628
  coverArt: this.#config.coverArtPackageId
661
629
  ? bindModulePackage(coverArtContract, this.#config.coverArtPackageId, [] as const)
662
630
  : undefined,
@@ -716,16 +684,13 @@ export function miso<const Name extends string = "miso">(
716
684
  client,
717
685
  {
718
686
  packageId: deployment.packages.pressing,
719
- settingsId: deployment.objects.recordSettings,
720
- misoPackageId: deployment.protocol.packageId,
687
+ misoPackageId: deployment.protocol.miso,
721
688
  minatoPackageId: deployment.packages.minato,
722
689
  releaseRegistryId: deployment.objects.releaseRegistry,
723
690
  releaseKindPackageId: deployment.packages.releaseKind,
724
691
  releaseDescriptionPackageId: deployment.packages.releaseDescription,
725
692
  releaseGenrePackageId: deployment.packages.releaseGenre,
726
693
  releaseDspLinkPackageId: deployment.packages.releaseDspLink,
727
- releaseSnapshotBundlePackageId:
728
- deployment.packages.releaseSnapshotBundle,
729
694
  recordingAdvisoryPackageId: deployment.packages.recordingAdvisory,
730
695
  recordingLanguagePackageId: deployment.packages.recordingLanguage,
731
696
  recordingMasterReferencePackageId: deployment.packages.recordingMasterReference,
@@ -759,10 +724,6 @@ export function miso<const Name extends string = "miso">(
759
724
  /**
760
725
  * @deprecated Prefer zero-config `miso()`, which registers the complete facade
761
726
  * at `client.miso` and exposes the protocol layer at `client.miso.protocol`.
762
- *
763
- * `settingsId` is optional so a read-only client (an indexer, a catalog page) can
764
- * skip it; asking to build a purchase without it throws rather than sending a
765
- * transaction against the wrong `Settings`.
766
727
  */
767
728
  export function misoPlatform(config: MisoPlatformConfig) {
768
729
  return {
@@ -78,7 +78,7 @@ export function uninstall(options: UninstallOptions) {
78
78
  export interface CreateStakeArguments {
79
79
  vault: RawTransactionArgument<string>;
80
80
  composition: RawTransactionArgument<string>;
81
- Recording: RawTransactionArgument<string>;
81
+ recording: RawTransactionArgument<string>;
82
82
  vaultAdminCap: RawTransactionArgument<string>;
83
83
  value: RawTransactionArgument<number | bigint>;
84
84
  }
@@ -87,7 +87,7 @@ export interface CreateStakeOptions {
87
87
  arguments: CreateStakeArguments | [
88
88
  vault: RawTransactionArgument<string>,
89
89
  composition: RawTransactionArgument<string>,
90
- Recording: RawTransactionArgument<string>,
90
+ recording: RawTransactionArgument<string>,
91
91
  vaultAdminCap: RawTransactionArgument<string>,
92
92
  value: RawTransactionArgument<number | bigint>
93
93
  ];
@@ -110,7 +110,7 @@ export function createStake(options: CreateStakeOptions) {
110
110
  null,
111
111
  'u64'
112
112
  ] satisfies (string | null)[];
113
- const parameterNames = ["vault", "composition", "Recording", "vaultAdminCap", "value"];
113
+ const parameterNames = ["vault", "composition", "recording", "vaultAdminCap", "value"];
114
114
  return (tx: Transaction) => tx.moveCall({
115
115
  package: packageAddress,
116
116
  module: 'composition_routed_stake',
@@ -169,6 +169,7 @@ export function register(options: RegisterOptions) {
169
169
  export interface UnregisterArguments {
170
170
  vault: RawTransactionArgument<string>;
171
171
  composition: RawTransactionArgument<string>;
172
+ recording: RawTransactionArgument<string>;
172
173
  routed: RawTransactionArgument<string>;
173
174
  pool: RawTransactionArgument<string>;
174
175
  vaultAdminCap: RawTransactionArgument<string>;
@@ -178,6 +179,7 @@ export interface UnregisterOptions {
178
179
  arguments: UnregisterArguments | [
179
180
  vault: RawTransactionArgument<string>,
180
181
  composition: RawTransactionArgument<string>,
182
+ recording: RawTransactionArgument<string>,
181
183
  routed: RawTransactionArgument<string>,
182
184
  pool: RawTransactionArgument<string>,
183
185
  vaultAdminCap: RawTransactionArgument<string>
@@ -196,9 +198,10 @@ export function unregister(options: UnregisterOptions) {
196
198
  null,
197
199
  null,
198
200
  null,
201
+ null,
199
202
  null
200
203
  ] satisfies (string | null)[];
201
- const parameterNames = ["vault", "composition", "routed", "pool", "vaultAdminCap"];
204
+ const parameterNames = ["vault", "composition", "recording", "routed", "pool", "vaultAdminCap"];
202
205
  return (tx: Transaction) => tx.moveCall({
203
206
  package: packageAddress,
204
207
  module: 'composition_routed_stake',
@@ -74,22 +74,22 @@ export function _new(options: NewOptions) {
74
74
  arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
75
75
  });
76
76
  }
77
- export interface DeriveGenreIdArguments {
77
+ export interface DeriveAddressArguments {
78
78
  self: RawTransactionArgument<string>;
79
79
  name: RawTransactionArgument<string>;
80
80
  }
81
- export interface DeriveGenreIdOptions {
81
+ export interface DeriveAddressOptions {
82
82
  package?: string;
83
- arguments: DeriveGenreIdArguments | [
83
+ arguments: DeriveAddressArguments | [
84
84
  self: RawTransactionArgument<string>,
85
85
  name: RawTransactionArgument<string>
86
86
  ];
87
87
  }
88
88
  /**
89
- * Derives the object id a `Genre` with the given name would have, without creating
90
- * it. Lets clients resolve/check a genre id offline.
89
+ * Derives the address a `Genre` with the given name would have, without creating
90
+ * it. Lets clients resolve/check a genre address offline.
91
91
  */
92
- export function deriveGenreId(options: DeriveGenreIdOptions) {
92
+ export function deriveAddress(options: DeriveAddressOptions) {
93
93
  const packageAddress = options.package ?? '@local-pkg/genre';
94
94
  const argumentsTypes = [
95
95
  null,
@@ -99,30 +99,7 @@ export function deriveGenreId(options: DeriveGenreIdOptions) {
99
99
  return (tx: Transaction) => tx.moveCall({
100
100
  package: packageAddress,
101
101
  module: 'genre',
102
- function: 'derive_genre_id',
103
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
104
- });
105
- }
106
- export interface IdArguments {
107
- self: RawTransactionArgument<string>;
108
- }
109
- export interface IdOptions {
110
- package?: string;
111
- arguments: IdArguments | [
112
- self: RawTransactionArgument<string>
113
- ];
114
- }
115
- /** Returns the genre's object id. */
116
- export function id(options: IdOptions) {
117
- const packageAddress = options.package ?? '@local-pkg/genre';
118
- const argumentsTypes = [
119
- null
120
- ] satisfies (string | null)[];
121
- const parameterNames = ["self"];
122
- return (tx: Transaction) => tx.moveCall({
123
- package: packageAddress,
124
- module: 'genre',
125
- function: 'id',
102
+ function: 'derive_address',
126
103
  arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
127
104
  });
128
105
  }
@@ -4,60 +4,51 @@
4
4
 
5
5
 
6
6
  /**
7
- * The pressing's certificate on a record.
7
+ * Immutable provenance for a record pressed by `miso_pressing`.
8
8
  *
9
- * One struct holds everything the sale fixed about a copy: where it sits in the
10
- * run, and what was paid for it. These were two dynamic fields — a certificate and
11
- * a receipt and separating them bought nothing: both are written once, in the
12
- * same transaction, by the same call, and neither is meaningful without the other.
13
- *
14
- * A serial is only meaningful inside the sequence that issued it — a different
15
- * production package counts from 1 again — so the number never travels alone. It
16
- * does not need to carry its pressing's id to say which sequence it means: a
17
- * release has exactly one pressing, at a derived address, so
18
- * `pressing::derive_id( record.release_id())` recomputes it from the record
19
- * itself. Storing it would be storing a value that is pure arithmetic on values
20
- * already present.
9
+ * `Certificate` is embedded in `Record<Certificate>`, never attached as a dynamic
10
+ * field. Its private fields and package-only constructor mean an external package
11
+ * cannot construct this certificate or mint the trusted record specialization.
21
12
  */
22
13
 
23
- import { MoveTuple, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
14
+ import { MoveStruct, normalizeMoveArguments } from '../utils/index.js';
24
15
  import { bcs } from '@mysten/sui/bcs';
25
16
  import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
26
17
  import * as type_name from './deps/std/type_name.js';
27
18
  const $moduleName = '@local-pkg/miso_pressing::certificate';
28
- export const CertificateKey = new MoveTuple({ name: `${$moduleName}::CertificateKey`, fields: [bcs.bool()] });
29
19
  export const Certificate = new MoveStruct({ name: `${$moduleName}::Certificate`, fields: {
20
+ /** The object whose derived-UID namespace issued this record. */
21
+ parent_id: bcs.Address,
30
22
  /** Position in the pressing's run (1-based). */
31
23
  number: bcs.u64(),
24
+ /** The transaction sender that purchased the record from its listing. */
25
+ purchased_by: bcs.Address,
32
26
  /** The currency type the buyer paid in. */
33
27
  purchase_currency: type_name.TypeName,
34
28
  /** The exact amount paid. Under a floor price this includes any tip above it. */
35
- purchase_price: bcs.u64()
29
+ purchase_price: bcs.u64(),
30
+ /** The timestamp stamped from the shared Clock on the pressing path. */
31
+ created_at_ms: bcs.u64()
36
32
  } });
37
- export interface OfArguments {
38
- record: RawTransactionArgument<string>;
33
+ export interface ParentIdArguments {
34
+ self: TransactionArgument;
39
35
  }
40
- export interface OfOptions {
36
+ export interface ParentIdOptions {
41
37
  package?: string;
42
- arguments: OfArguments | [
43
- record: RawTransactionArgument<string>
38
+ arguments: ParentIdArguments | [
39
+ self: TransactionArgument
44
40
  ];
45
41
  }
46
- /**
47
- * The certificate on `record`, or `none` for a record minted by some other
48
- * package. The only way to read the field, since only this module can construct
49
- * its key.
50
- */
51
- export function _of(options: OfOptions) {
42
+ export function parentId(options: ParentIdOptions) {
52
43
  const packageAddress = options.package ?? '@local-pkg/miso_pressing';
53
44
  const argumentsTypes = [
54
45
  null
55
46
  ] satisfies (string | null)[];
56
- const parameterNames = ["record"];
47
+ const parameterNames = ["self"];
57
48
  return (tx: Transaction) => tx.moveCall({
58
49
  package: packageAddress,
59
50
  module: 'certificate',
60
- function: 'of',
51
+ function: 'parent_id',
61
52
  arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
62
53
  });
63
54
  }
@@ -83,6 +74,28 @@ export function number(options: NumberOptions) {
83
74
  arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
84
75
  });
85
76
  }
77
+ export interface PurchasedByArguments {
78
+ self: TransactionArgument;
79
+ }
80
+ export interface PurchasedByOptions {
81
+ package?: string;
82
+ arguments: PurchasedByArguments | [
83
+ self: TransactionArgument
84
+ ];
85
+ }
86
+ export function purchasedBy(options: PurchasedByOptions) {
87
+ const packageAddress = options.package ?? '@local-pkg/miso_pressing';
88
+ const argumentsTypes = [
89
+ null
90
+ ] satisfies (string | null)[];
91
+ const parameterNames = ["self"];
92
+ return (tx: Transaction) => tx.moveCall({
93
+ package: packageAddress,
94
+ module: 'certificate',
95
+ function: 'purchased_by',
96
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
97
+ });
98
+ }
86
99
  export interface PurchaseCurrencyArguments {
87
100
  self: TransactionArgument;
88
101
  }
@@ -126,4 +139,26 @@ export function purchasePrice(options: PurchasePriceOptions) {
126
139
  function: 'purchase_price',
127
140
  arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
128
141
  });
142
+ }
143
+ export interface CreatedAtMsArguments {
144
+ self: TransactionArgument;
145
+ }
146
+ export interface CreatedAtMsOptions {
147
+ package?: string;
148
+ arguments: CreatedAtMsArguments | [
149
+ self: TransactionArgument
150
+ ];
151
+ }
152
+ export function createdAtMs(options: CreatedAtMsOptions) {
153
+ const packageAddress = options.package ?? '@local-pkg/miso_pressing';
154
+ const argumentsTypes = [
155
+ null
156
+ ] satisfies (string | null)[];
157
+ const parameterNames = ["self"];
158
+ return (tx: Transaction) => tx.moveCall({
159
+ package: packageAddress,
160
+ module: 'certificate',
161
+ function: 'created_at_ms',
162
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
163
+ });
129
164
  }
@@ -250,15 +250,13 @@ export interface BuyArguments {
250
250
  self: RawTransactionArgument<string>;
251
251
  pressing: RawTransactionArgument<string>;
252
252
  payment: TransactionArgument;
253
- settings: RawTransactionArgument<string>;
254
253
  }
255
254
  export interface BuyOptions {
256
255
  package?: string;
257
256
  arguments: BuyArguments | [
258
257
  self: RawTransactionArgument<string>,
259
258
  pressing: RawTransactionArgument<string>,
260
- payment: TransactionArgument,
261
- settings: RawTransactionArgument<string>
259
+ payment: TransactionArgument
262
260
  ];
263
261
  typeArguments: [
264
262
  string
@@ -273,8 +271,8 @@ export interface BuyOptions {
273
271
  * address — under `Floor`, anything above the floor is kept as a tip, not
274
272
  * refunded. The record's number is the pressing's next 1-based value, shared with
275
273
  * every other currency selling the same run, and its UID is derived off the
276
- * pressing. The sale's terms ride out on the record's `Certificate`. `settings`
277
- * must authorize this package's `MintWitness`.
274
+ * pressing. The sale's transaction sender and terms are embedded in the record's
275
+ * `Certificate`.
278
276
  *
279
277
  * Both switches must be open: this listing `Enabled`, checked here, and the run
280
278
  * selling at this moment, checked in `pressing::mint_next`.
@@ -285,10 +283,9 @@ export function buy(options: BuyOptions) {
285
283
  null,
286
284
  null,
287
285
  null,
288
- null,
289
286
  '0x2::clock::Clock'
290
287
  ] satisfies (string | null)[];
291
- const parameterNames = ["self", "pressing", "payment", "settings"];
288
+ const parameterNames = ["self", "pressing", "payment"];
292
289
  return (tx: Transaction) => tx.moveCall({
293
290
  package: packageAddress,
294
291
  module: 'listing',
@@ -431,32 +428,6 @@ export function hasListing(options: HasListingOptions) {
431
428
  typeArguments: options.typeArguments
432
429
  });
433
430
  }
434
- export interface IdArguments {
435
- self: RawTransactionArgument<string>;
436
- }
437
- export interface IdOptions {
438
- package?: string;
439
- arguments: IdArguments | [
440
- self: RawTransactionArgument<string>
441
- ];
442
- typeArguments: [
443
- string
444
- ];
445
- }
446
- export function id(options: IdOptions) {
447
- const packageAddress = options.package ?? '@local-pkg/miso_pressing';
448
- const argumentsTypes = [
449
- null
450
- ] satisfies (string | null)[];
451
- const parameterNames = ["self"];
452
- return (tx: Transaction) => tx.moveCall({
453
- package: packageAddress,
454
- module: 'listing',
455
- function: 'id',
456
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
457
- typeArguments: options.typeArguments
458
- });
459
- }
460
431
  export interface ReleaseIdArguments {
461
432
  self: RawTransactionArgument<string>;
462
433
  }
@@ -30,8 +30,8 @@
30
30
  * and no stored set of listings: a listing either exists at its derived address or
31
31
  * it does not (`listing::has_listing`), and `ListingOpenedEvent<Currency>`
32
32
  * enumerates them for an indexer. It also makes the number sequence gap-free for
33
- * free, and every record verifiable against its pressing from chain state alone
34
- * (`verify_record`).
33
+ * free, and every record verifiable against its pressing from chain state alone by
34
+ * comparing the certificate and derived address.
35
35
  *
36
36
  * # Starting and stopping is state, never teardown
37
37
  *
@@ -60,20 +60,17 @@
60
60
  * yields `release::uid_mut`, and `balance::withdraw_funds_from_object` is gated on
61
61
  * `&mut UID` alone — so the release cap can withdraw the sales revenue that `buy`
62
62
  * forwards to the release's address. Under one cap, "may reprice a listing" and
63
- * "may take the money" would be the same grant. The pressing cap is the routine
64
- * one, safe to delegate to whoever runs the shop; the release cap stays with the
65
- * rightsholder.
63
+ * "may take the money" would be the same grant. The caps may be held together. If
64
+ * separated, the pressing cap remains issuance authority: it controls listing
65
+ * creation, price, and availability, but cannot withdraw revenue.
66
66
  */
67
67
 
68
- import { MoveTuple, MoveStruct, MoveEnum, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
68
+ import { MoveTuple, MoveEnum, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
69
69
  import { bcs } from '@mysten/sui/bcs';
70
70
  import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
71
71
  const $moduleName = '@local-pkg/miso_pressing::pressing';
72
72
  export const PressingKey = new MoveTuple({ name: `${$moduleName}::PressingKey`, fields: [bcs.bool()] });
73
73
  export const PressingAdminCapKey = new MoveTuple({ name: `${$moduleName}::PressingAdminCapKey`, fields: [bcs.bool()] });
74
- export const MintWitness = new MoveStruct({ name: `${$moduleName}::MintWitness`, fields: {
75
- dummy_field: bcs.bool()
76
- } });
77
74
  /**
78
75
  * Whether the run sells, over every currency at once. The lifecycle runs
79
76
  * `Scheduled → Active → Paused → Active`: a pressing opens itself at its drop
@@ -301,28 +298,6 @@ export function deriveId(options: DeriveIdOptions) {
301
298
  arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
302
299
  });
303
300
  }
304
- export interface IdArguments {
305
- self: RawTransactionArgument<string>;
306
- }
307
- export interface IdOptions {
308
- package?: string;
309
- arguments: IdArguments | [
310
- self: RawTransactionArgument<string>
311
- ];
312
- }
313
- export function id(options: IdOptions) {
314
- const packageAddress = options.package ?? '@local-pkg/miso_pressing';
315
- const argumentsTypes = [
316
- null
317
- ] satisfies (string | null)[];
318
- const parameterNames = ["self"];
319
- return (tx: Transaction) => tx.moveCall({
320
- package: packageAddress,
321
- module: 'pressing',
322
- function: 'id',
323
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
324
- });
325
- }
326
301
  export interface ReleaseIdArguments {
327
302
  self: RawTransactionArgument<string>;
328
303
  }
@@ -421,34 +396,4 @@ export function pressingAdminCapPressingId(options: PressingAdminCapPressingIdOp
421
396
  function: 'pressing_admin_cap_pressing_id',
422
397
  arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
423
398
  });
424
- }
425
- export interface VerifyRecordArguments {
426
- record: RawTransactionArgument<string>;
427
- }
428
- export interface VerifyRecordOptions {
429
- package?: string;
430
- arguments: VerifyRecordArguments | [
431
- record: RawTransactionArgument<string>
432
- ];
433
- }
434
- /**
435
- * Whether `record` is genuinely the copy its certificate claims it is, checked
436
- * from chain state alone and without needing the `Pressing` object.
437
- *
438
- * The record must sit at exactly the address its certificate number derives to off
439
- * its release's pressing. The certificate is the readable form of what the address
440
- * already proves.
441
- */
442
- export function verifyRecord(options: VerifyRecordOptions) {
443
- const packageAddress = options.package ?? '@local-pkg/miso_pressing';
444
- const argumentsTypes = [
445
- null
446
- ] satisfies (string | null)[];
447
- const parameterNames = ["record"];
448
- return (tx: Transaction) => tx.moveCall({
449
- package: packageAddress,
450
- module: 'pressing',
451
- function: 'verify_record',
452
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
453
- });
454
399
  }