@misofm/sdk 0.15.11 → 0.16.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 (139) hide show
  1. package/README.md +145 -53
  2. package/dist/client.d.ts +156 -48
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +289 -48
  5. package/dist/client.js.map +1 -1
  6. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +11 -11
  7. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +1 -1
  8. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +9 -9
  9. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +1 -1
  10. package/dist/contracts/miso_record/deps/std/type_name.d.ts.map +1 -0
  11. package/dist/contracts/miso_record/deps/std/type_name.js.map +1 -0
  12. package/dist/contracts/miso_record/deps/sui/vec_set.d.ts +21 -0
  13. package/dist/contracts/miso_record/deps/sui/vec_set.d.ts.map +1 -0
  14. package/dist/contracts/miso_record/deps/sui/vec_set.js +20 -0
  15. package/dist/contracts/miso_record/deps/sui/vec_set.js.map +1 -0
  16. package/dist/contracts/miso_record/pressing.d.ts +327 -0
  17. package/dist/contracts/miso_record/pressing.d.ts.map +1 -0
  18. package/dist/contracts/miso_record/pressing.js +345 -0
  19. package/dist/contracts/miso_record/pressing.js.map +1 -0
  20. package/dist/contracts/miso_record/record.d.ts +190 -0
  21. package/dist/contracts/miso_record/record.d.ts.map +1 -0
  22. package/dist/contracts/miso_record/record.js +226 -0
  23. package/dist/contracts/miso_record/record.js.map +1 -0
  24. package/dist/contracts/miso_record_shop/deps/std/type_name.d.ts +18 -0
  25. package/dist/contracts/miso_record_shop/deps/std/type_name.d.ts.map +1 -0
  26. package/dist/contracts/miso_record_shop/deps/std/type_name.js +20 -0
  27. package/dist/contracts/miso_record_shop/deps/std/type_name.js.map +1 -0
  28. package/dist/contracts/miso_record_shop/listing.d.ts +387 -0
  29. package/dist/contracts/miso_record_shop/listing.d.ts.map +1 -0
  30. package/dist/contracts/miso_record_shop/listing.js +380 -0
  31. package/dist/contracts/miso_record_shop/listing.js.map +1 -0
  32. package/dist/contracts/miso_record_shop/witness.d.ts +7 -0
  33. package/dist/contracts/miso_record_shop/witness.d.ts.map +1 -0
  34. package/dist/contracts/miso_record_shop/witness.js +9 -0
  35. package/dist/contracts/miso_record_shop/witness.js.map +1 -0
  36. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +10 -12
  37. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +1 -1
  38. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +8 -10
  39. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +1 -1
  40. package/dist/contracts.d.ts +3 -3
  41. package/dist/contracts.d.ts.map +1 -1
  42. package/dist/contracts.js +5 -4
  43. package/dist/contracts.js.map +1 -1
  44. package/dist/deployments.d.ts +37 -4
  45. package/dist/deployments.d.ts.map +1 -1
  46. package/dist/deployments.js +40 -2
  47. package/dist/deployments.js.map +1 -1
  48. package/dist/index.d.ts +2 -0
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +2 -0
  51. package/dist/index.js.map +1 -1
  52. package/dist/mix.d.ts +144 -0
  53. package/dist/mix.d.ts.map +1 -0
  54. package/dist/mix.js +656 -0
  55. package/dist/mix.js.map +1 -0
  56. package/dist/pressing.d.ts +72 -156
  57. package/dist/pressing.d.ts.map +1 -1
  58. package/dist/pressing.js +269 -261
  59. package/dist/pressing.js.map +1 -1
  60. package/dist/publication.d.ts +5 -2
  61. package/dist/publication.d.ts.map +1 -1
  62. package/dist/publication.js +57 -32
  63. package/dist/publication.js.map +1 -1
  64. package/dist/read/catalog.d.ts +8 -5
  65. package/dist/read/catalog.d.ts.map +1 -1
  66. package/dist/read/catalog.js +47 -35
  67. package/dist/read/catalog.js.map +1 -1
  68. package/dist/read/config.d.ts +6 -4
  69. package/dist/read/config.d.ts.map +1 -1
  70. package/dist/read/config.js +1 -2
  71. package/dist/read/config.js.map +1 -1
  72. package/dist/read/index.d.ts +1 -1
  73. package/dist/read/index.d.ts.map +1 -1
  74. package/dist/read/index.js +1 -1
  75. package/dist/read/index.js.map +1 -1
  76. package/dist/read/internal/scalars.d.ts.map +1 -1
  77. package/dist/read/internal/scalars.js +4 -3
  78. package/dist/read/internal/scalars.js.map +1 -1
  79. package/dist/read/internal/walrus.d.ts.map +1 -1
  80. package/dist/read/internal/walrus.js +2 -1
  81. package/dist/read/internal/walrus.js.map +1 -1
  82. package/dist/read/receipts.d.ts +21 -12
  83. package/dist/read/receipts.d.ts.map +1 -1
  84. package/dist/read/receipts.js +159 -56
  85. package/dist/read/receipts.js.map +1 -1
  86. package/dist/read/types.d.ts +34 -24
  87. package/dist/read/types.d.ts.map +1 -1
  88. package/dist/read/wallet.d.ts.map +1 -1
  89. package/dist/read/wallet.js +31 -46
  90. package/dist/read/wallet.js.map +1 -1
  91. package/dist/vault.d.ts +40 -11
  92. package/dist/vault.d.ts.map +1 -1
  93. package/dist/vault.js +94 -22
  94. package/dist/vault.js.map +1 -1
  95. package/package.json +10 -3
  96. package/src/client.ts +386 -72
  97. package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +15 -15
  98. package/src/contracts/miso_record/deps/sui/vec_set.ts +21 -0
  99. package/src/contracts/miso_record/pressing.ts +522 -0
  100. package/src/contracts/miso_record/record.ts +338 -0
  101. package/src/contracts/miso_record_shop/deps/std/type_name.ts +22 -0
  102. package/src/contracts/miso_record_shop/listing.ts +602 -0
  103. package/src/contracts/miso_record_shop/witness.ts +11 -0
  104. package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +14 -16
  105. package/src/contracts.ts +5 -4
  106. package/src/deployments.ts +131 -38
  107. package/src/index.ts +2 -0
  108. package/src/mix.ts +910 -0
  109. package/src/pressing.ts +428 -423
  110. package/src/publication.ts +62 -33
  111. package/src/read/catalog.ts +49 -34
  112. package/src/read/config.ts +7 -7
  113. package/src/read/index.ts +9 -1
  114. package/src/read/internal/scalars.ts +4 -2
  115. package/src/read/internal/walrus.ts +2 -1
  116. package/src/read/receipts.ts +181 -66
  117. package/src/read/types.ts +35 -22
  118. package/src/read/wallet.ts +29 -50
  119. package/src/vault.ts +142 -32
  120. package/dist/contracts/miso_pressing/certificate.d.ts +0 -89
  121. package/dist/contracts/miso_pressing/certificate.d.ts.map +0 -1
  122. package/dist/contracts/miso_pressing/certificate.js +0 -108
  123. package/dist/contracts/miso_pressing/certificate.js.map +0 -1
  124. package/dist/contracts/miso_pressing/deps/std/type_name.d.ts.map +0 -1
  125. package/dist/contracts/miso_pressing/deps/std/type_name.js.map +0 -1
  126. package/dist/contracts/miso_pressing/listing.d.ts +0 -434
  127. package/dist/contracts/miso_pressing/listing.d.ts.map +0 -1
  128. package/dist/contracts/miso_pressing/listing.js +0 -401
  129. package/dist/contracts/miso_pressing/listing.js.map +0 -1
  130. package/dist/contracts/miso_pressing/pressing.d.ts +0 -334
  131. package/dist/contracts/miso_pressing/pressing.d.ts.map +0 -1
  132. package/dist/contracts/miso_pressing/pressing.js +0 -298
  133. package/dist/contracts/miso_pressing/pressing.js.map +0 -1
  134. package/src/contracts/miso_pressing/certificate.ts +0 -164
  135. package/src/contracts/miso_pressing/listing.ts +0 -592
  136. package/src/contracts/miso_pressing/pressing.ts +0 -399
  137. /package/dist/contracts/{miso_pressing → miso_record}/deps/std/type_name.d.ts +0 -0
  138. /package/dist/contracts/{miso_pressing → miso_record}/deps/std/type_name.js +0 -0
  139. /package/src/contracts/{miso_pressing → miso_record}/deps/std/type_name.ts +0 -0
@@ -0,0 +1,602 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /**
7
+ * A fixed-price or minimum-price Record Shop listing for one Pressing.
8
+ *
9
+ * There is no Record Shop singleton. Each `Listing<Currency>` derives directly
10
+ * from its Pressing and is independently shared, so currencies and Pressings
11
+ * remain separate consensus lanes except for their common edition sequence.
12
+ */
13
+
14
+ import { MoveTuple, MoveEnum, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
15
+ import { bcs } from '@mysten/sui/bcs';
16
+ import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
17
+ import * as type_name from './deps/std/type_name.js';
18
+ const $moduleName = '@local-pkg/miso_record_shop::listing';
19
+ export const ListingKey = new MoveTuple({ name: `${$moduleName}::ListingKey<phantom Currency>`, fields: [bcs.bool()] });
20
+ /** Payment rule for a Listing. */
21
+ export const Pricing = new MoveEnum({ name: `${$moduleName}::Pricing`, fields: {
22
+ /** Require payment to equal the configured price. */
23
+ Fixed: bcs.u64(),
24
+ /** Require payment to be at least the configured price. */
25
+ Floor: bcs.u64()
26
+ } });
27
+ /** Whether purchases are accepted. */
28
+ export const State = new MoveEnum({ name: `${$moduleName}::State`, fields: {
29
+ Enabled: null,
30
+ Disabled: null
31
+ } });
32
+ export const Listing = new MoveStruct({ name: `${$moduleName}::Listing<phantom Currency>`, fields: {
33
+ /** The Listing's derived object identity. */
34
+ id: bcs.Address,
35
+ /** The release that receives payments from this Listing. */
36
+ release_id: bcs.Address,
37
+ /** The Pressing from which this Listing purchases Records. */
38
+ pressing_id: bcs.Address,
39
+ /** The active payment rule. */
40
+ pricing: Pricing,
41
+ /** Whether the Listing currently accepts purchases. */
42
+ state: State
43
+ } });
44
+ export const ListingCreatedEvent = new MoveStruct({ name: `${$moduleName}::ListingCreatedEvent<phantom Currency>`, fields: {
45
+ /** The newly created Listing. */
46
+ listing_id: bcs.Address,
47
+ /** The release that receives Listing payments. */
48
+ release_id: bcs.Address,
49
+ /** The Pressing sold by the Listing. */
50
+ pressing_id: bcs.Address,
51
+ /** The Listing's initial payment rule. */
52
+ pricing: Pricing,
53
+ /** The Listing's initial state. */
54
+ state: State
55
+ } });
56
+ export const ListingPriceChangedEvent = new MoveStruct({ name: `${$moduleName}::ListingPriceChangedEvent<phantom Currency>`, fields: {
57
+ /** The updated Listing. */
58
+ listing_id: bcs.Address,
59
+ /** The new payment rule. */
60
+ pricing: Pricing
61
+ } });
62
+ export const ListingStateChangedEvent = new MoveStruct({ name: `${$moduleName}::ListingStateChangedEvent<phantom Currency>`, fields: {
63
+ /** The updated Listing. */
64
+ listing_id: bcs.Address,
65
+ /** The new Listing state. */
66
+ state: State
67
+ } });
68
+ export const RecordSoldEvent = new MoveStruct({ name: `${$moduleName}::RecordSoldEvent<phantom Currency>`, fields: {
69
+ /** The Listing that completed the sale. */
70
+ listing_id: bcs.Address,
71
+ /** The purchased Record. */
72
+ record_id: bcs.Address,
73
+ /** The release that received payment. */
74
+ release_id: bcs.Address,
75
+ /** The Pressing that issued the Record. */
76
+ pressing_id: bcs.Address,
77
+ /** The edition represented by the Pressing. */
78
+ edition: bcs.u16(),
79
+ /** The Record's number within its edition. */
80
+ number: bcs.u32(),
81
+ /** The defining type of the purchase currency. */
82
+ purchase_currency: type_name.TypeName,
83
+ /** The amount paid for the Record. */
84
+ purchase_price: bcs.u64(),
85
+ /** The transaction sender who purchased the Record. */
86
+ purchased_by: bcs.Address,
87
+ /** The purchase time in Unix milliseconds from Sui's Clock. */
88
+ purchased_timestamp_ms: bcs.u64(),
89
+ /** The payment rule accepted for the sale. */
90
+ pricing: Pricing
91
+ } });
92
+ export interface FixedArguments {
93
+ price: RawTransactionArgument<number | bigint>;
94
+ }
95
+ export interface FixedOptions {
96
+ package?: string;
97
+ arguments: FixedArguments | [
98
+ price: RawTransactionArgument<number | bigint>
99
+ ];
100
+ }
101
+ /** Construct an exact-payment pricing rule. */
102
+ export function fixed(options: FixedOptions) {
103
+ const packageAddress = options.package ?? '@local-pkg/miso_record_shop';
104
+ const argumentsTypes = [
105
+ 'u64'
106
+ ] satisfies (string | null)[];
107
+ const parameterNames = ["price"];
108
+ return (tx: Transaction) => tx.moveCall({
109
+ package: packageAddress,
110
+ module: 'listing',
111
+ function: 'fixed',
112
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
113
+ });
114
+ }
115
+ export interface FloorArguments {
116
+ price: RawTransactionArgument<number | bigint>;
117
+ }
118
+ export interface FloorOptions {
119
+ package?: string;
120
+ arguments: FloorArguments | [
121
+ price: RawTransactionArgument<number | bigint>
122
+ ];
123
+ }
124
+ /** Construct a minimum-payment pricing rule. */
125
+ export function floor(options: FloorOptions) {
126
+ const packageAddress = options.package ?? '@local-pkg/miso_record_shop';
127
+ const argumentsTypes = [
128
+ 'u64'
129
+ ] satisfies (string | null)[];
130
+ const parameterNames = ["price"];
131
+ return (tx: Transaction) => tx.moveCall({
132
+ package: packageAddress,
133
+ module: 'listing',
134
+ function: 'floor',
135
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
136
+ });
137
+ }
138
+ export interface EnabledOptions {
139
+ package?: string;
140
+ arguments?: [
141
+ ];
142
+ }
143
+ /** Construct the state that accepts purchases. */
144
+ export function enabled(options: EnabledOptions = {}) {
145
+ const packageAddress = options.package ?? '@local-pkg/miso_record_shop';
146
+ return (tx: Transaction) => tx.moveCall({
147
+ package: packageAddress,
148
+ module: 'listing',
149
+ function: 'enabled',
150
+ });
151
+ }
152
+ export interface DisabledOptions {
153
+ package?: string;
154
+ arguments?: [
155
+ ];
156
+ }
157
+ /** Construct the state that rejects purchases. */
158
+ export function disabled(options: DisabledOptions = {}) {
159
+ const packageAddress = options.package ?? '@local-pkg/miso_record_shop';
160
+ return (tx: Transaction) => tx.moveCall({
161
+ package: packageAddress,
162
+ module: 'listing',
163
+ function: 'disabled',
164
+ });
165
+ }
166
+ export interface NewArguments {
167
+ pressing: RawTransactionArgument<string>;
168
+ cap: RawTransactionArgument<string>;
169
+ pricing: TransactionArgument;
170
+ }
171
+ export interface NewOptions {
172
+ package?: string;
173
+ arguments: NewArguments | [
174
+ pressing: RawTransactionArgument<string>,
175
+ cap: RawTransactionArgument<string>,
176
+ pricing: TransactionArgument
177
+ ];
178
+ typeArguments: [
179
+ string
180
+ ];
181
+ }
182
+ /**
183
+ * Create the permanent Listing for `Currency` under this Pressing.
184
+ *
185
+ * The Listing starts enabled and is returned unshared so callers can compose
186
+ * further configuration before calling `share`.
187
+ */
188
+ export function _new(options: NewOptions) {
189
+ const packageAddress = options.package ?? '@local-pkg/miso_record_shop';
190
+ const argumentsTypes = [
191
+ null,
192
+ null,
193
+ null
194
+ ] satisfies (string | null)[];
195
+ const parameterNames = ["pressing", "cap", "pricing"];
196
+ return (tx: Transaction) => tx.moveCall({
197
+ package: packageAddress,
198
+ module: 'listing',
199
+ function: 'new',
200
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
201
+ typeArguments: options.typeArguments
202
+ });
203
+ }
204
+ export interface ShareArguments {
205
+ self: RawTransactionArgument<string>;
206
+ }
207
+ export interface ShareOptions {
208
+ package?: string;
209
+ arguments: ShareArguments | [
210
+ self: RawTransactionArgument<string>
211
+ ];
212
+ typeArguments: [
213
+ string
214
+ ];
215
+ }
216
+ /** Share a newly created Listing. */
217
+ export function share(options: ShareOptions) {
218
+ const packageAddress = options.package ?? '@local-pkg/miso_record_shop';
219
+ const argumentsTypes = [
220
+ null
221
+ ] satisfies (string | null)[];
222
+ const parameterNames = ["self"];
223
+ return (tx: Transaction) => tx.moveCall({
224
+ package: packageAddress,
225
+ module: 'listing',
226
+ function: 'share',
227
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
228
+ typeArguments: options.typeArguments
229
+ });
230
+ }
231
+ export interface SetPriceArguments {
232
+ self: RawTransactionArgument<string>;
233
+ cap: RawTransactionArgument<string>;
234
+ pricing: TransactionArgument;
235
+ }
236
+ export interface SetPriceOptions {
237
+ package?: string;
238
+ arguments: SetPriceArguments | [
239
+ self: RawTransactionArgument<string>,
240
+ cap: RawTransactionArgument<string>,
241
+ pricing: TransactionArgument
242
+ ];
243
+ typeArguments: [
244
+ string
245
+ ];
246
+ }
247
+ /** Change the payment rule using the capability for the bound Pressing. */
248
+ export function setPrice(options: SetPriceOptions) {
249
+ const packageAddress = options.package ?? '@local-pkg/miso_record_shop';
250
+ const argumentsTypes = [
251
+ null,
252
+ null,
253
+ null
254
+ ] satisfies (string | null)[];
255
+ const parameterNames = ["self", "cap", "pricing"];
256
+ return (tx: Transaction) => tx.moveCall({
257
+ package: packageAddress,
258
+ module: 'listing',
259
+ function: 'set_price',
260
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
261
+ typeArguments: options.typeArguments
262
+ });
263
+ }
264
+ export interface SetStateArguments {
265
+ self: RawTransactionArgument<string>;
266
+ cap: RawTransactionArgument<string>;
267
+ state: TransactionArgument;
268
+ }
269
+ export interface SetStateOptions {
270
+ package?: string;
271
+ arguments: SetStateArguments | [
272
+ self: RawTransactionArgument<string>,
273
+ cap: RawTransactionArgument<string>,
274
+ state: TransactionArgument
275
+ ];
276
+ typeArguments: [
277
+ string
278
+ ];
279
+ }
280
+ /** Enable or disable purchases using the capability for the bound Pressing. */
281
+ export function setState(options: SetStateOptions) {
282
+ const packageAddress = options.package ?? '@local-pkg/miso_record_shop';
283
+ const argumentsTypes = [
284
+ null,
285
+ null,
286
+ null
287
+ ] satisfies (string | null)[];
288
+ const parameterNames = ["self", "cap", "state"];
289
+ return (tx: Transaction) => tx.moveCall({
290
+ package: packageAddress,
291
+ module: 'listing',
292
+ function: 'set_state',
293
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
294
+ typeArguments: options.typeArguments
295
+ });
296
+ }
297
+ export interface PurchaseArguments {
298
+ self: RawTransactionArgument<string>;
299
+ pressing: RawTransactionArgument<string>;
300
+ payment: TransactionArgument;
301
+ expectedPricing: TransactionArgument;
302
+ }
303
+ export interface PurchaseOptions {
304
+ package?: string;
305
+ arguments: PurchaseArguments | [
306
+ self: RawTransactionArgument<string>,
307
+ pressing: RawTransactionArgument<string>,
308
+ payment: TransactionArgument,
309
+ expectedPricing: TransactionArgument
310
+ ];
311
+ typeArguments: [
312
+ string
313
+ ];
314
+ }
315
+ /**
316
+ * Purchase and return the next Record from the bound Pressing.
317
+ *
318
+ * `expected_pricing` protects the buyer against stale price or pricing-rule
319
+ * changes. The entire payment is deposited into the Release object's funds
320
+ * accumulator; a Floor overpayment is not refunded. The caller decides how to
321
+ * transfer or compose the returned Record.
322
+ */
323
+ export function purchase(options: PurchaseOptions) {
324
+ const packageAddress = options.package ?? '@local-pkg/miso_record_shop';
325
+ const argumentsTypes = [
326
+ null,
327
+ null,
328
+ null,
329
+ null,
330
+ '0x2::clock::Clock'
331
+ ] satisfies (string | null)[];
332
+ const parameterNames = ["self", "pressing", "payment", "expectedPricing"];
333
+ return (tx: Transaction) => tx.moveCall({
334
+ package: packageAddress,
335
+ module: 'listing',
336
+ function: 'purchase',
337
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
338
+ typeArguments: options.typeArguments
339
+ });
340
+ }
341
+ export interface ReleaseIdArguments {
342
+ self: RawTransactionArgument<string>;
343
+ }
344
+ export interface ReleaseIdOptions {
345
+ package?: string;
346
+ arguments: ReleaseIdArguments | [
347
+ self: RawTransactionArgument<string>
348
+ ];
349
+ typeArguments: [
350
+ string
351
+ ];
352
+ }
353
+ /** Return the release that receives Listing payments. */
354
+ export function releaseId(options: ReleaseIdOptions) {
355
+ const packageAddress = options.package ?? '@local-pkg/miso_record_shop';
356
+ const argumentsTypes = [
357
+ null
358
+ ] satisfies (string | null)[];
359
+ const parameterNames = ["self"];
360
+ return (tx: Transaction) => tx.moveCall({
361
+ package: packageAddress,
362
+ module: 'listing',
363
+ function: 'release_id',
364
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
365
+ typeArguments: options.typeArguments
366
+ });
367
+ }
368
+ export interface PressingIdArguments {
369
+ self: RawTransactionArgument<string>;
370
+ }
371
+ export interface PressingIdOptions {
372
+ package?: string;
373
+ arguments: PressingIdArguments | [
374
+ self: RawTransactionArgument<string>
375
+ ];
376
+ typeArguments: [
377
+ string
378
+ ];
379
+ }
380
+ /** Return the Pressing sold by this Listing. */
381
+ export function pressingId(options: PressingIdOptions) {
382
+ const packageAddress = options.package ?? '@local-pkg/miso_record_shop';
383
+ const argumentsTypes = [
384
+ null
385
+ ] satisfies (string | null)[];
386
+ const parameterNames = ["self"];
387
+ return (tx: Transaction) => tx.moveCall({
388
+ package: packageAddress,
389
+ module: 'listing',
390
+ function: 'pressing_id',
391
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
392
+ typeArguments: options.typeArguments
393
+ });
394
+ }
395
+ export interface PricingArguments {
396
+ self: RawTransactionArgument<string>;
397
+ }
398
+ export interface PricingOptions {
399
+ package?: string;
400
+ arguments: PricingArguments | [
401
+ self: RawTransactionArgument<string>
402
+ ];
403
+ typeArguments: [
404
+ string
405
+ ];
406
+ }
407
+ /** Return this Listing's payment rule. */
408
+ export function pricing(options: PricingOptions) {
409
+ const packageAddress = options.package ?? '@local-pkg/miso_record_shop';
410
+ const argumentsTypes = [
411
+ null
412
+ ] satisfies (string | null)[];
413
+ const parameterNames = ["self"];
414
+ return (tx: Transaction) => tx.moveCall({
415
+ package: packageAddress,
416
+ module: 'listing',
417
+ function: 'pricing',
418
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
419
+ typeArguments: options.typeArguments
420
+ });
421
+ }
422
+ export interface PriceArguments {
423
+ self: RawTransactionArgument<string>;
424
+ }
425
+ export interface PriceOptions {
426
+ package?: string;
427
+ arguments: PriceArguments | [
428
+ self: RawTransactionArgument<string>
429
+ ];
430
+ typeArguments: [
431
+ string
432
+ ];
433
+ }
434
+ /** Return the amount configured by this Listing's payment rule. */
435
+ export function price(options: PriceOptions) {
436
+ const packageAddress = options.package ?? '@local-pkg/miso_record_shop';
437
+ const argumentsTypes = [
438
+ null
439
+ ] satisfies (string | null)[];
440
+ const parameterNames = ["self"];
441
+ return (tx: Transaction) => tx.moveCall({
442
+ package: packageAddress,
443
+ module: 'listing',
444
+ function: 'price',
445
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
446
+ typeArguments: options.typeArguments
447
+ });
448
+ }
449
+ export interface StateArguments {
450
+ self: RawTransactionArgument<string>;
451
+ }
452
+ export interface StateOptions {
453
+ package?: string;
454
+ arguments: StateArguments | [
455
+ self: RawTransactionArgument<string>
456
+ ];
457
+ typeArguments: [
458
+ string
459
+ ];
460
+ }
461
+ /** Return this Listing's current state. */
462
+ export function state(options: StateOptions) {
463
+ const packageAddress = options.package ?? '@local-pkg/miso_record_shop';
464
+ const argumentsTypes = [
465
+ null
466
+ ] satisfies (string | null)[];
467
+ const parameterNames = ["self"];
468
+ return (tx: Transaction) => tx.moveCall({
469
+ package: packageAddress,
470
+ module: 'listing',
471
+ function: 'state',
472
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
473
+ typeArguments: options.typeArguments
474
+ });
475
+ }
476
+ export interface IsEnabledArguments {
477
+ self: RawTransactionArgument<string>;
478
+ }
479
+ export interface IsEnabledOptions {
480
+ package?: string;
481
+ arguments: IsEnabledArguments | [
482
+ self: RawTransactionArgument<string>
483
+ ];
484
+ typeArguments: [
485
+ string
486
+ ];
487
+ }
488
+ /** Return whether this Listing currently accepts purchases. */
489
+ export function isEnabled(options: IsEnabledOptions) {
490
+ const packageAddress = options.package ?? '@local-pkg/miso_record_shop';
491
+ const argumentsTypes = [
492
+ null
493
+ ] satisfies (string | null)[];
494
+ const parameterNames = ["self"];
495
+ return (tx: Transaction) => tx.moveCall({
496
+ package: packageAddress,
497
+ module: 'listing',
498
+ function: 'is_enabled',
499
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
500
+ typeArguments: options.typeArguments
501
+ });
502
+ }
503
+ export interface IsDisabledArguments {
504
+ self: RawTransactionArgument<string>;
505
+ }
506
+ export interface IsDisabledOptions {
507
+ package?: string;
508
+ arguments: IsDisabledArguments | [
509
+ self: RawTransactionArgument<string>
510
+ ];
511
+ typeArguments: [
512
+ string
513
+ ];
514
+ }
515
+ /** Return whether this Listing currently rejects purchases. */
516
+ export function isDisabled(options: IsDisabledOptions) {
517
+ const packageAddress = options.package ?? '@local-pkg/miso_record_shop';
518
+ const argumentsTypes = [
519
+ null
520
+ ] satisfies (string | null)[];
521
+ const parameterNames = ["self"];
522
+ return (tx: Transaction) => tx.moveCall({
523
+ package: packageAddress,
524
+ module: 'listing',
525
+ function: 'is_disabled',
526
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
527
+ typeArguments: options.typeArguments
528
+ });
529
+ }
530
+ export interface IsFixedArguments {
531
+ pricing: TransactionArgument;
532
+ }
533
+ export interface IsFixedOptions {
534
+ package?: string;
535
+ arguments: IsFixedArguments | [
536
+ pricing: TransactionArgument
537
+ ];
538
+ }
539
+ /** Return whether `pricing` requires an exact payment. */
540
+ export function isFixed(options: IsFixedOptions) {
541
+ const packageAddress = options.package ?? '@local-pkg/miso_record_shop';
542
+ const argumentsTypes = [
543
+ null
544
+ ] satisfies (string | null)[];
545
+ const parameterNames = ["pricing"];
546
+ return (tx: Transaction) => tx.moveCall({
547
+ package: packageAddress,
548
+ module: 'listing',
549
+ function: 'is_fixed',
550
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
551
+ });
552
+ }
553
+ export interface IsFloorArguments {
554
+ pricing: TransactionArgument;
555
+ }
556
+ export interface IsFloorOptions {
557
+ package?: string;
558
+ arguments: IsFloorArguments | [
559
+ pricing: TransactionArgument
560
+ ];
561
+ }
562
+ /** Return whether `pricing` permits payment above its configured floor. */
563
+ export function isFloor(options: IsFloorOptions) {
564
+ const packageAddress = options.package ?? '@local-pkg/miso_record_shop';
565
+ const argumentsTypes = [
566
+ null
567
+ ] satisfies (string | null)[];
568
+ const parameterNames = ["pricing"];
569
+ return (tx: Transaction) => tx.moveCall({
570
+ package: packageAddress,
571
+ module: 'listing',
572
+ function: 'is_floor',
573
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
574
+ });
575
+ }
576
+ export interface DeriveAddressArguments {
577
+ pressingId: RawTransactionArgument<string>;
578
+ }
579
+ export interface DeriveAddressOptions {
580
+ package?: string;
581
+ arguments: DeriveAddressArguments | [
582
+ pressingId: RawTransactionArgument<string>
583
+ ];
584
+ typeArguments: [
585
+ string
586
+ ];
587
+ }
588
+ /** Derive the one Listing address for `(pressing_id, Currency)`. */
589
+ export function deriveAddress(options: DeriveAddressOptions) {
590
+ const packageAddress = options.package ?? '@local-pkg/miso_record_shop';
591
+ const argumentsTypes = [
592
+ '0x2::object::ID'
593
+ ] satisfies (string | null)[];
594
+ const parameterNames = ["pressingId"];
595
+ return (tx: Transaction) => tx.moveCall({
596
+ package: packageAddress,
597
+ module: 'listing',
598
+ function: 'derive_address',
599
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
600
+ typeArguments: options.typeArguments
601
+ });
602
+ }
@@ -0,0 +1,11 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /** Module-controlled authority used by the Miso Record Shop to mint Records. */
7
+
8
+ import { MoveTuple } from '../utils/index.js';
9
+ import { bcs } from '@mysten/sui/bcs';
10
+ const $moduleName = '@local-pkg/miso_record_shop::witness';
11
+ export const Witness = new MoveTuple({ name: `${$moduleName}::Witness`, fields: [bcs.bool()] });
@@ -199,19 +199,19 @@ export function receiveAndDeposit(options: ReceiveAndDepositOptions) {
199
199
  typeArguments: options.typeArguments
200
200
  });
201
201
  }
202
- export interface SweepAndDepositArguments {
202
+ export interface RedeemAndDepositArguments {
203
203
  vault: RawTransactionArgument<string>;
204
204
  recording: RawTransactionArgument<string>;
205
205
  pool: RawTransactionArgument<string>;
206
- root: RawTransactionArgument<string>;
206
+ value: RawTransactionArgument<number | bigint>;
207
207
  }
208
- export interface SweepAndDepositOptions {
208
+ export interface RedeemAndDepositOptions {
209
209
  package?: string;
210
- arguments: SweepAndDepositArguments | [
210
+ arguments: RedeemAndDepositArguments | [
211
211
  vault: RawTransactionArgument<string>,
212
212
  recording: RawTransactionArgument<string>,
213
213
  pool: RawTransactionArgument<string>,
214
- root: RawTransactionArgument<string>
214
+ value: RawTransactionArgument<number | bigint>
215
215
  ];
216
216
  typeArguments: [
217
217
  string,
@@ -220,27 +220,25 @@ export interface SweepAndDepositOptions {
220
220
  ];
221
221
  }
222
222
  /**
223
- * Redeem the settled `Currency` amount reported for the Recording address and
224
- * deposit it into the canonical pool. Anyone may crank this after installation.
223
+ * Redeem `value` from the Recording's funds accumulator and deposit it into the
224
+ * canonical pool. Anyone may crank this after installation.
225
225
  *
226
- * Funds sent during the current consensus commit are not yet settled and remain
227
- * available for a later sweep. Aborts with `ENoSettledFunds` when the settled
228
- * amount is zero. The framework caps the reported amount at `u64::MAX`; any excess
229
- * remains for a later sweep.
226
+ * A PTB can obtain `value` from `sui::balance::settled_funds_value` and pass that
227
+ * command result directly to this function.
230
228
  */
231
- export function sweepAndDeposit(options: SweepAndDepositOptions) {
229
+ export function redeemAndDeposit(options: RedeemAndDepositOptions) {
232
230
  const packageAddress = options.package ?? '@local-pkg/recording_royalty_pool';
233
231
  const argumentsTypes = [
234
232
  null,
235
233
  null,
236
234
  null,
237
- null
235
+ 'u64'
238
236
  ] satisfies (string | null)[];
239
- const parameterNames = ["vault", "recording", "pool", "root"];
237
+ const parameterNames = ["vault", "recording", "pool", "value"];
240
238
  return (tx: Transaction) => tx.moveCall({
241
239
  package: packageAddress,
242
240
  module: 'recording_royalty_pool',
243
- function: 'sweep_and_deposit',
241
+ function: 'redeem_and_deposit',
244
242
  arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
245
243
  typeArguments: options.typeArguments
246
244
  });
@@ -299,4 +297,4 @@ export function poolAddress(options: PoolAddressOptions) {
299
297
  arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
300
298
  typeArguments: options.typeArguments
301
299
  });
302
- }
300
+ }
package/src/contracts.ts CHANGED
@@ -9,10 +9,11 @@
9
9
  // re-exported from ITS `contracts` namespace — import it from there rather than
10
10
  // mirroring it here.
11
11
 
12
- // The record production line (pressing runs + their per-currency listings).
13
- export * as pressing from "./contracts/miso_pressing/pressing.ts";
14
- export * as listing from "./contracts/miso_pressing/listing.ts";
15
- export * as certificate from "./contracts/miso_pressing/certificate.ts";
12
+ // Record identity/issuance and Record Shop primary-sale mechanics. The
13
+ // package-restricted witness constructor is intentionally not exported here.
14
+ export * as record from "./contracts/miso_record/record.ts";
15
+ export * as pressing from "./contracts/miso_record/pressing.ts";
16
+ export * as listing from "./contracts/miso_record_shop/listing.ts";
16
17
 
17
18
  // Generic royalty-pool primitive plus vault-custodied business-logic plugins.
18
19
  export * as royaltyPool from "./contracts/royalty_pool/pool.ts";