@misofm/sdk 0.15.10 → 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.
- package/README.md +153 -56
- package/dist/client.d.ts +175 -47
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +302 -47
- package/dist/client.js.map +1 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +11 -11
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +1 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +9 -9
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +1 -1
- package/dist/contracts/miso_record/deps/std/type_name.d.ts.map +1 -0
- package/dist/contracts/miso_record/deps/std/type_name.js.map +1 -0
- package/dist/contracts/miso_record/deps/sui/vec_set.d.ts +21 -0
- package/dist/contracts/miso_record/deps/sui/vec_set.d.ts.map +1 -0
- package/dist/contracts/miso_record/deps/sui/vec_set.js +20 -0
- package/dist/contracts/miso_record/deps/sui/vec_set.js.map +1 -0
- package/dist/contracts/miso_record/pressing.d.ts +327 -0
- package/dist/contracts/miso_record/pressing.d.ts.map +1 -0
- package/dist/contracts/miso_record/pressing.js +345 -0
- package/dist/contracts/miso_record/pressing.js.map +1 -0
- package/dist/contracts/miso_record/record.d.ts +190 -0
- package/dist/contracts/miso_record/record.d.ts.map +1 -0
- package/dist/contracts/miso_record/record.js +226 -0
- package/dist/contracts/miso_record/record.js.map +1 -0
- package/dist/contracts/miso_record_shop/deps/std/type_name.d.ts +18 -0
- package/dist/contracts/miso_record_shop/deps/std/type_name.d.ts.map +1 -0
- package/dist/contracts/miso_record_shop/deps/std/type_name.js +20 -0
- package/dist/contracts/miso_record_shop/deps/std/type_name.js.map +1 -0
- package/dist/contracts/miso_record_shop/listing.d.ts +387 -0
- package/dist/contracts/miso_record_shop/listing.d.ts.map +1 -0
- package/dist/contracts/miso_record_shop/listing.js +380 -0
- package/dist/contracts/miso_record_shop/listing.js.map +1 -0
- package/dist/contracts/miso_record_shop/witness.d.ts +7 -0
- package/dist/contracts/miso_record_shop/witness.d.ts.map +1 -0
- package/dist/contracts/miso_record_shop/witness.js +9 -0
- package/dist/contracts/miso_record_shop/witness.js.map +1 -0
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +10 -12
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +1 -1
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +8 -10
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +1 -1
- package/dist/contracts/vault/vault.d.ts +149 -23
- package/dist/contracts/vault/vault.d.ts.map +1 -1
- package/dist/contracts/vault/vault.js +144 -18
- package/dist/contracts/vault/vault.js.map +1 -1
- package/dist/contracts.d.ts +3 -3
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +5 -4
- package/dist/contracts.js.map +1 -1
- package/dist/deployments.d.ts +47 -11
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +48 -9
- package/dist/deployments.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/mix.d.ts +144 -0
- package/dist/mix.d.ts.map +1 -0
- package/dist/mix.js +656 -0
- package/dist/mix.js.map +1 -0
- package/dist/pressing.d.ts +72 -156
- package/dist/pressing.d.ts.map +1 -1
- package/dist/pressing.js +269 -261
- package/dist/pressing.js.map +1 -1
- package/dist/publication.d.ts +5 -2
- package/dist/publication.d.ts.map +1 -1
- package/dist/publication.js +63 -34
- package/dist/publication.js.map +1 -1
- package/dist/read/catalog.d.ts +8 -5
- package/dist/read/catalog.d.ts.map +1 -1
- package/dist/read/catalog.js +47 -35
- package/dist/read/catalog.js.map +1 -1
- package/dist/read/config.d.ts +6 -4
- package/dist/read/config.d.ts.map +1 -1
- package/dist/read/config.js +1 -2
- package/dist/read/config.js.map +1 -1
- package/dist/read/index.d.ts +1 -1
- package/dist/read/index.d.ts.map +1 -1
- package/dist/read/index.js +1 -1
- package/dist/read/index.js.map +1 -1
- package/dist/read/internal/scalars.d.ts.map +1 -1
- package/dist/read/internal/scalars.js +4 -3
- package/dist/read/internal/scalars.js.map +1 -1
- package/dist/read/internal/walrus.d.ts.map +1 -1
- package/dist/read/internal/walrus.js +2 -1
- package/dist/read/internal/walrus.js.map +1 -1
- package/dist/read/receipts.d.ts +21 -12
- package/dist/read/receipts.d.ts.map +1 -1
- package/dist/read/receipts.js +159 -56
- package/dist/read/receipts.js.map +1 -1
- package/dist/read/types.d.ts +40 -26
- package/dist/read/types.d.ts.map +1 -1
- package/dist/read/wallet.d.ts +3 -4
- package/dist/read/wallet.d.ts.map +1 -1
- package/dist/read/wallet.js +72 -53
- package/dist/read/wallet.js.map +1 -1
- package/dist/vault.d.ts +71 -15
- package/dist/vault.d.ts.map +1 -1
- package/dist/vault.js +135 -29
- package/dist/vault.js.map +1 -1
- package/package.json +10 -3
- package/src/client.ts +404 -69
- package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +15 -15
- package/src/contracts/miso_record/deps/sui/vec_set.ts +21 -0
- package/src/contracts/miso_record/pressing.ts +522 -0
- package/src/contracts/miso_record/record.ts +338 -0
- package/src/contracts/miso_record_shop/deps/std/type_name.ts +22 -0
- package/src/contracts/miso_record_shop/listing.ts +602 -0
- package/src/contracts/miso_record_shop/witness.ts +11 -0
- package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +14 -16
- package/src/contracts/vault/vault.ts +226 -21
- package/src/contracts.ts +5 -4
- package/src/deployments.ts +134 -38
- package/src/index.ts +2 -0
- package/src/mix.ts +910 -0
- package/src/pressing.ts +428 -423
- package/src/publication.ts +69 -36
- package/src/read/catalog.ts +49 -34
- package/src/read/config.ts +7 -7
- package/src/read/index.ts +9 -1
- package/src/read/internal/scalars.ts +4 -2
- package/src/read/internal/walrus.ts +2 -1
- package/src/read/receipts.ts +181 -66
- package/src/read/types.ts +41 -24
- package/src/read/wallet.ts +70 -57
- package/src/vault.ts +228 -41
- package/dist/contracts/miso_pressing/certificate.d.ts +0 -89
- package/dist/contracts/miso_pressing/certificate.d.ts.map +0 -1
- package/dist/contracts/miso_pressing/certificate.js +0 -108
- package/dist/contracts/miso_pressing/certificate.js.map +0 -1
- package/dist/contracts/miso_pressing/deps/std/type_name.d.ts.map +0 -1
- package/dist/contracts/miso_pressing/deps/std/type_name.js.map +0 -1
- package/dist/contracts/miso_pressing/listing.d.ts +0 -434
- package/dist/contracts/miso_pressing/listing.d.ts.map +0 -1
- package/dist/contracts/miso_pressing/listing.js +0 -401
- package/dist/contracts/miso_pressing/listing.js.map +0 -1
- package/dist/contracts/miso_pressing/pressing.d.ts +0 -334
- package/dist/contracts/miso_pressing/pressing.d.ts.map +0 -1
- package/dist/contracts/miso_pressing/pressing.js +0 -298
- package/dist/contracts/miso_pressing/pressing.js.map +0 -1
- package/src/contracts/miso_pressing/certificate.ts +0 -164
- package/src/contracts/miso_pressing/listing.ts +0 -592
- package/src/contracts/miso_pressing/pressing.ts +0 -399
- /package/dist/contracts/{miso_pressing → miso_record}/deps/std/type_name.d.ts +0 -0
- /package/dist/contracts/{miso_pressing → miso_record}/deps/std/type_name.js +0 -0
- /package/src/contracts/{miso_pressing → miso_record}/deps/std/type_name.ts +0 -0
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* An owned purchase minted from one edition of a Miso release.
|
|
8
|
+
*
|
|
9
|
+
* `Pressing` owns issuance. This module owns only the Record asset and its
|
|
10
|
+
* deterministic identity within that Pressing. Distribution mechanics such as
|
|
11
|
+
* pricing and payment validation live in authorized distributor packages.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { MoveStruct, MoveTuple, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
15
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
16
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
17
|
+
import * as type_name from './deps/std/type_name.js';
|
|
18
|
+
const $moduleName = '@local-pkg/miso_record::record';
|
|
19
|
+
export const Record = new MoveStruct({ name: `${$moduleName}::Record`, fields: {
|
|
20
|
+
id: bcs.Address,
|
|
21
|
+
/** The release this Record is a copy of. */
|
|
22
|
+
release_id: bcs.Address,
|
|
23
|
+
/** The edition-scoped Pressing that minted this Record. */
|
|
24
|
+
pressing_id: bcs.Address,
|
|
25
|
+
/** The edition represented by `pressing_id`. */
|
|
26
|
+
edition: bcs.u16(),
|
|
27
|
+
/** This Record's number within its edition. */
|
|
28
|
+
number: bcs.u32(),
|
|
29
|
+
/** The defining type of the currency used for this purchase. */
|
|
30
|
+
purchase_currency: type_name.TypeName,
|
|
31
|
+
/** The actual amount paid, including any accepted overpayment. */
|
|
32
|
+
purchase_price: bcs.u64(),
|
|
33
|
+
/** The transaction sender who purchased this Record. */
|
|
34
|
+
purchased_by: bcs.Address,
|
|
35
|
+
/** When this Record was purchased, in Unix milliseconds from Sui's Clock. */
|
|
36
|
+
purchased_timestamp_ms: bcs.u64()
|
|
37
|
+
} });
|
|
38
|
+
export const RecordKey = new MoveTuple({ name: `${$moduleName}::RecordKey`, fields: [bcs.u32()] });
|
|
39
|
+
export const RecordCreatedEvent = new MoveStruct({ name: `${$moduleName}::RecordCreatedEvent`, fields: {
|
|
40
|
+
/** The newly created Record. */
|
|
41
|
+
record_id: bcs.Address,
|
|
42
|
+
/** The release represented by the Record. */
|
|
43
|
+
release_id: bcs.Address,
|
|
44
|
+
/** The Pressing that issued the Record. */
|
|
45
|
+
pressing_id: bcs.Address,
|
|
46
|
+
/** The edition represented by the Pressing. */
|
|
47
|
+
edition: bcs.u16(),
|
|
48
|
+
/** The Record's number within the edition. */
|
|
49
|
+
number: bcs.u32()
|
|
50
|
+
} });
|
|
51
|
+
export const RecordDestroyedEvent = new MoveStruct({ name: `${$moduleName}::RecordDestroyedEvent`, fields: {
|
|
52
|
+
/** The destroyed Record. */
|
|
53
|
+
record_id: bcs.Address,
|
|
54
|
+
/** The Pressing that issued the Record. */
|
|
55
|
+
pressing_id: bcs.Address
|
|
56
|
+
} });
|
|
57
|
+
export interface DestroyArguments {
|
|
58
|
+
self: RawTransactionArgument<string>;
|
|
59
|
+
}
|
|
60
|
+
export interface DestroyOptions {
|
|
61
|
+
package?: string;
|
|
62
|
+
arguments: DestroyArguments | [
|
|
63
|
+
self: RawTransactionArgument<string>
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Destroy a Record. Detach any dynamic-field extensions first or they become
|
|
68
|
+
* inaccessible.
|
|
69
|
+
*/
|
|
70
|
+
export function destroy(options: DestroyOptions) {
|
|
71
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
72
|
+
const argumentsTypes = [
|
|
73
|
+
null
|
|
74
|
+
] satisfies (string | null)[];
|
|
75
|
+
const parameterNames = ["self"];
|
|
76
|
+
return (tx: Transaction) => tx.moveCall({
|
|
77
|
+
package: packageAddress,
|
|
78
|
+
module: 'record',
|
|
79
|
+
function: 'destroy',
|
|
80
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
export interface UidArguments {
|
|
84
|
+
self: RawTransactionArgument<string>;
|
|
85
|
+
}
|
|
86
|
+
export interface UidOptions {
|
|
87
|
+
package?: string;
|
|
88
|
+
arguments: UidArguments | [
|
|
89
|
+
self: RawTransactionArgument<string>
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
/** Borrow the Record UID for read-only extensions. */
|
|
93
|
+
export function uid(options: UidOptions) {
|
|
94
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
95
|
+
const argumentsTypes = [
|
|
96
|
+
null
|
|
97
|
+
] satisfies (string | null)[];
|
|
98
|
+
const parameterNames = ["self"];
|
|
99
|
+
return (tx: Transaction) => tx.moveCall({
|
|
100
|
+
package: packageAddress,
|
|
101
|
+
module: 'record',
|
|
102
|
+
function: 'uid',
|
|
103
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
export interface UidMutArguments {
|
|
107
|
+
self: RawTransactionArgument<string>;
|
|
108
|
+
}
|
|
109
|
+
export interface UidMutOptions {
|
|
110
|
+
package?: string;
|
|
111
|
+
arguments: UidMutArguments | [
|
|
112
|
+
self: RawTransactionArgument<string>
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
/** Mutably borrow the Record UID for owner-authorized extensions. */
|
|
116
|
+
export function uidMut(options: UidMutOptions) {
|
|
117
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
118
|
+
const argumentsTypes = [
|
|
119
|
+
null
|
|
120
|
+
] satisfies (string | null)[];
|
|
121
|
+
const parameterNames = ["self"];
|
|
122
|
+
return (tx: Transaction) => tx.moveCall({
|
|
123
|
+
package: packageAddress,
|
|
124
|
+
module: 'record',
|
|
125
|
+
function: 'uid_mut',
|
|
126
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
export interface ReleaseIdArguments {
|
|
130
|
+
self: RawTransactionArgument<string>;
|
|
131
|
+
}
|
|
132
|
+
export interface ReleaseIdOptions {
|
|
133
|
+
package?: string;
|
|
134
|
+
arguments: ReleaseIdArguments | [
|
|
135
|
+
self: RawTransactionArgument<string>
|
|
136
|
+
];
|
|
137
|
+
}
|
|
138
|
+
/** Return the release represented by this Record. */
|
|
139
|
+
export function releaseId(options: ReleaseIdOptions) {
|
|
140
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
141
|
+
const argumentsTypes = [
|
|
142
|
+
null
|
|
143
|
+
] satisfies (string | null)[];
|
|
144
|
+
const parameterNames = ["self"];
|
|
145
|
+
return (tx: Transaction) => tx.moveCall({
|
|
146
|
+
package: packageAddress,
|
|
147
|
+
module: 'record',
|
|
148
|
+
function: 'release_id',
|
|
149
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
export interface PressingIdArguments {
|
|
153
|
+
self: RawTransactionArgument<string>;
|
|
154
|
+
}
|
|
155
|
+
export interface PressingIdOptions {
|
|
156
|
+
package?: string;
|
|
157
|
+
arguments: PressingIdArguments | [
|
|
158
|
+
self: RawTransactionArgument<string>
|
|
159
|
+
];
|
|
160
|
+
}
|
|
161
|
+
/** Return the Pressing that issued this Record. */
|
|
162
|
+
export function pressingId(options: PressingIdOptions) {
|
|
163
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
164
|
+
const argumentsTypes = [
|
|
165
|
+
null
|
|
166
|
+
] satisfies (string | null)[];
|
|
167
|
+
const parameterNames = ["self"];
|
|
168
|
+
return (tx: Transaction) => tx.moveCall({
|
|
169
|
+
package: packageAddress,
|
|
170
|
+
module: 'record',
|
|
171
|
+
function: 'pressing_id',
|
|
172
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
export interface EditionArguments {
|
|
176
|
+
self: RawTransactionArgument<string>;
|
|
177
|
+
}
|
|
178
|
+
export interface EditionOptions {
|
|
179
|
+
package?: string;
|
|
180
|
+
arguments: EditionArguments | [
|
|
181
|
+
self: RawTransactionArgument<string>
|
|
182
|
+
];
|
|
183
|
+
}
|
|
184
|
+
/** Return this Record's edition number. */
|
|
185
|
+
export function edition(options: EditionOptions) {
|
|
186
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
187
|
+
const argumentsTypes = [
|
|
188
|
+
null
|
|
189
|
+
] satisfies (string | null)[];
|
|
190
|
+
const parameterNames = ["self"];
|
|
191
|
+
return (tx: Transaction) => tx.moveCall({
|
|
192
|
+
package: packageAddress,
|
|
193
|
+
module: 'record',
|
|
194
|
+
function: 'edition',
|
|
195
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
export interface NumberArguments {
|
|
199
|
+
self: RawTransactionArgument<string>;
|
|
200
|
+
}
|
|
201
|
+
export interface NumberOptions {
|
|
202
|
+
package?: string;
|
|
203
|
+
arguments: NumberArguments | [
|
|
204
|
+
self: RawTransactionArgument<string>
|
|
205
|
+
];
|
|
206
|
+
}
|
|
207
|
+
/** Return this Record's number within its edition. */
|
|
208
|
+
export function number(options: NumberOptions) {
|
|
209
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
210
|
+
const argumentsTypes = [
|
|
211
|
+
null
|
|
212
|
+
] satisfies (string | null)[];
|
|
213
|
+
const parameterNames = ["self"];
|
|
214
|
+
return (tx: Transaction) => tx.moveCall({
|
|
215
|
+
package: packageAddress,
|
|
216
|
+
module: 'record',
|
|
217
|
+
function: 'number',
|
|
218
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
export interface PurchaseCurrencyArguments {
|
|
222
|
+
self: RawTransactionArgument<string>;
|
|
223
|
+
}
|
|
224
|
+
export interface PurchaseCurrencyOptions {
|
|
225
|
+
package?: string;
|
|
226
|
+
arguments: PurchaseCurrencyArguments | [
|
|
227
|
+
self: RawTransactionArgument<string>
|
|
228
|
+
];
|
|
229
|
+
}
|
|
230
|
+
/** Return the defining type of the purchase currency. */
|
|
231
|
+
export function purchaseCurrency(options: PurchaseCurrencyOptions) {
|
|
232
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
233
|
+
const argumentsTypes = [
|
|
234
|
+
null
|
|
235
|
+
] satisfies (string | null)[];
|
|
236
|
+
const parameterNames = ["self"];
|
|
237
|
+
return (tx: Transaction) => tx.moveCall({
|
|
238
|
+
package: packageAddress,
|
|
239
|
+
module: 'record',
|
|
240
|
+
function: 'purchase_currency',
|
|
241
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
export interface PurchasePriceArguments {
|
|
245
|
+
self: RawTransactionArgument<string>;
|
|
246
|
+
}
|
|
247
|
+
export interface PurchasePriceOptions {
|
|
248
|
+
package?: string;
|
|
249
|
+
arguments: PurchasePriceArguments | [
|
|
250
|
+
self: RawTransactionArgument<string>
|
|
251
|
+
];
|
|
252
|
+
}
|
|
253
|
+
/** Return the amount paid for this Record. */
|
|
254
|
+
export function purchasePrice(options: PurchasePriceOptions) {
|
|
255
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
256
|
+
const argumentsTypes = [
|
|
257
|
+
null
|
|
258
|
+
] satisfies (string | null)[];
|
|
259
|
+
const parameterNames = ["self"];
|
|
260
|
+
return (tx: Transaction) => tx.moveCall({
|
|
261
|
+
package: packageAddress,
|
|
262
|
+
module: 'record',
|
|
263
|
+
function: 'purchase_price',
|
|
264
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
export interface PurchasedByArguments {
|
|
268
|
+
self: RawTransactionArgument<string>;
|
|
269
|
+
}
|
|
270
|
+
export interface PurchasedByOptions {
|
|
271
|
+
package?: string;
|
|
272
|
+
arguments: PurchasedByArguments | [
|
|
273
|
+
self: RawTransactionArgument<string>
|
|
274
|
+
];
|
|
275
|
+
}
|
|
276
|
+
/** Return the transaction sender who purchased this Record. */
|
|
277
|
+
export function purchasedBy(options: PurchasedByOptions) {
|
|
278
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
279
|
+
const argumentsTypes = [
|
|
280
|
+
null
|
|
281
|
+
] satisfies (string | null)[];
|
|
282
|
+
const parameterNames = ["self"];
|
|
283
|
+
return (tx: Transaction) => tx.moveCall({
|
|
284
|
+
package: packageAddress,
|
|
285
|
+
module: 'record',
|
|
286
|
+
function: 'purchased_by',
|
|
287
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
export interface PurchasedTimestampMsArguments {
|
|
291
|
+
self: RawTransactionArgument<string>;
|
|
292
|
+
}
|
|
293
|
+
export interface PurchasedTimestampMsOptions {
|
|
294
|
+
package?: string;
|
|
295
|
+
arguments: PurchasedTimestampMsArguments | [
|
|
296
|
+
self: RawTransactionArgument<string>
|
|
297
|
+
];
|
|
298
|
+
}
|
|
299
|
+
/** Return the purchase time in Unix milliseconds from Sui's Clock. */
|
|
300
|
+
export function purchasedTimestampMs(options: PurchasedTimestampMsOptions) {
|
|
301
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
302
|
+
const argumentsTypes = [
|
|
303
|
+
null
|
|
304
|
+
] satisfies (string | null)[];
|
|
305
|
+
const parameterNames = ["self"];
|
|
306
|
+
return (tx: Transaction) => tx.moveCall({
|
|
307
|
+
package: packageAddress,
|
|
308
|
+
module: 'record',
|
|
309
|
+
function: 'purchased_timestamp_ms',
|
|
310
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
export interface DeriveAddressArguments {
|
|
314
|
+
pressingId: RawTransactionArgument<string>;
|
|
315
|
+
number: RawTransactionArgument<number>;
|
|
316
|
+
}
|
|
317
|
+
export interface DeriveAddressOptions {
|
|
318
|
+
package?: string;
|
|
319
|
+
arguments: DeriveAddressArguments | [
|
|
320
|
+
pressingId: RawTransactionArgument<string>,
|
|
321
|
+
number: RawTransactionArgument<number>
|
|
322
|
+
];
|
|
323
|
+
}
|
|
324
|
+
/** Derive the Record address for `number` in `pressing_id`'s edition. */
|
|
325
|
+
export function deriveAddress(options: DeriveAddressOptions) {
|
|
326
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
327
|
+
const argumentsTypes = [
|
|
328
|
+
'0x2::object::ID',
|
|
329
|
+
'u32'
|
|
330
|
+
] satisfies (string | null)[];
|
|
331
|
+
const parameterNames = ["pressingId", "number"];
|
|
332
|
+
return (tx: Transaction) => tx.moveCall({
|
|
333
|
+
package: packageAddress,
|
|
334
|
+
module: 'record',
|
|
335
|
+
function: 'derive_address',
|
|
336
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
337
|
+
});
|
|
338
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/** Functionality for converting Move types into values. Use with care! */
|
|
7
|
+
|
|
8
|
+
import { MoveStruct } from '../../../utils/index.js';
|
|
9
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
10
|
+
const $moduleName = 'std::type_name';
|
|
11
|
+
export const TypeName = new MoveStruct({ name: `${$moduleName}::TypeName`, fields: {
|
|
12
|
+
/**
|
|
13
|
+
* String representation of the type. All types are represented using their source
|
|
14
|
+
* syntax: "u8", "u64", "bool", "address", "vector", and so on for primitive types.
|
|
15
|
+
* Struct types are represented as fully qualified type names; e.g.
|
|
16
|
+
* `00000000000000000000000000000001::string::String` or
|
|
17
|
+
* `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`
|
|
18
|
+
* Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or
|
|
19
|
+
* 32 depending on the Move platform)
|
|
20
|
+
*/
|
|
21
|
+
name: bcs.string()
|
|
22
|
+
} });
|