@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
|
@@ -196,19 +196,19 @@ export function receiveAndDeposit(options: ReceiveAndDepositOptions) {
|
|
|
196
196
|
typeArguments: options.typeArguments
|
|
197
197
|
});
|
|
198
198
|
}
|
|
199
|
-
export interface
|
|
199
|
+
export interface RedeemAndDepositArguments {
|
|
200
200
|
vault: RawTransactionArgument<string>;
|
|
201
201
|
composition: RawTransactionArgument<string>;
|
|
202
202
|
pool: RawTransactionArgument<string>;
|
|
203
|
-
|
|
203
|
+
value: RawTransactionArgument<number | bigint>;
|
|
204
204
|
}
|
|
205
|
-
export interface
|
|
205
|
+
export interface RedeemAndDepositOptions {
|
|
206
206
|
package?: string;
|
|
207
|
-
arguments:
|
|
207
|
+
arguments: RedeemAndDepositArguments | [
|
|
208
208
|
vault: RawTransactionArgument<string>,
|
|
209
209
|
composition: RawTransactionArgument<string>,
|
|
210
210
|
pool: RawTransactionArgument<string>,
|
|
211
|
-
|
|
211
|
+
value: RawTransactionArgument<number | bigint>
|
|
212
212
|
];
|
|
213
213
|
typeArguments: [
|
|
214
214
|
string,
|
|
@@ -216,25 +216,25 @@ export interface SweepAndDepositOptions {
|
|
|
216
216
|
];
|
|
217
217
|
}
|
|
218
218
|
/**
|
|
219
|
-
* Redeem the
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
219
|
+
* Redeem `value` from the Composition's funds accumulator and deposit it into the
|
|
220
|
+
* canonical pool. Anyone may crank this after installation.
|
|
221
|
+
*
|
|
222
|
+
* A PTB can obtain `value` from `sui::balance::settled_funds_value` and pass that
|
|
223
|
+
* command result directly to this function.
|
|
224
224
|
*/
|
|
225
|
-
export function
|
|
225
|
+
export function redeemAndDeposit(options: RedeemAndDepositOptions) {
|
|
226
226
|
const packageAddress = options.package ?? '@local-pkg/composition_royalty_pool';
|
|
227
227
|
const argumentsTypes = [
|
|
228
228
|
null,
|
|
229
229
|
null,
|
|
230
230
|
null,
|
|
231
|
-
|
|
231
|
+
'u64'
|
|
232
232
|
] satisfies (string | null)[];
|
|
233
|
-
const parameterNames = ["vault", "composition", "pool", "
|
|
233
|
+
const parameterNames = ["vault", "composition", "pool", "value"];
|
|
234
234
|
return (tx: Transaction) => tx.moveCall({
|
|
235
235
|
package: packageAddress,
|
|
236
236
|
module: 'composition_royalty_pool',
|
|
237
|
-
function: '
|
|
237
|
+
function: 'redeem_and_deposit',
|
|
238
238
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
239
239
|
typeArguments: options.typeArguments
|
|
240
240
|
});
|
|
@@ -292,4 +292,4 @@ export function poolAddress(options: PoolAddressOptions) {
|
|
|
292
292
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
293
293
|
typeArguments: options.typeArguments
|
|
294
294
|
});
|
|
295
|
-
}
|
|
295
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { type BcsType, bcs } from '@mysten/sui/bcs';
|
|
5
|
+
import { MoveStruct } from '../../../utils/index.js';
|
|
6
|
+
const $moduleName = '0x2::vec_set';
|
|
7
|
+
/**
|
|
8
|
+
* A set data structure backed by a vector. The set is guaranteed not to contain
|
|
9
|
+
* duplicate keys. All operations are O(N) in the size of the set
|
|
10
|
+
*
|
|
11
|
+
* - the intention of this data structure is only to provide the convenience of
|
|
12
|
+
* programming against a set API. Sets that need sorted iteration rather than
|
|
13
|
+
* insertion order iteration should be handwritten.
|
|
14
|
+
*/
|
|
15
|
+
export function VecSet<K extends BcsType<any>>(...typeParameters: [
|
|
16
|
+
K
|
|
17
|
+
]) {
|
|
18
|
+
return new MoveStruct({ name: `${$moduleName}::VecSet<${typeParameters[0].name as K['name']}>`, fields: {
|
|
19
|
+
contents: bcs.vector(typeParameters[0])
|
|
20
|
+
} });
|
|
21
|
+
}
|
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* One edition of a Miso release and the complete lifecycle boundary for its
|
|
8
|
+
* Records.
|
|
9
|
+
*
|
|
10
|
+
* A release may have many Pressings, one at each `PressingKey(edition)`. Each
|
|
11
|
+
* Pressing owns an independent Record sequence, an optional immutable maximum
|
|
12
|
+
* supply, and the set of distributor witness types allowed to mint from that
|
|
13
|
+
* edition. Distributors own delivery mechanics; the Pressing owns issuance.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { MoveTuple, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
17
|
+
import { bcs, type BcsType } from '@mysten/sui/bcs';
|
|
18
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
19
|
+
import * as vec_set from './deps/sui/vec_set.js';
|
|
20
|
+
import * as type_name from './deps/std/type_name.js';
|
|
21
|
+
const $moduleName = '@local-pkg/miso_record::pressing';
|
|
22
|
+
export const PressingKey = new MoveTuple({ name: `${$moduleName}::PressingKey`, fields: [bcs.u16()] });
|
|
23
|
+
export const PressingAdminCapKey = new MoveTuple({ name: `${$moduleName}::PressingAdminCapKey`, fields: [bcs.bool()] });
|
|
24
|
+
export const Pressing = new MoveStruct({ name: `${$moduleName}::Pressing`, fields: {
|
|
25
|
+
/** The Pressing's derived object identity. */
|
|
26
|
+
id: bcs.Address,
|
|
27
|
+
/** The parent release represented by this edition. */
|
|
28
|
+
release_id: bcs.Address,
|
|
29
|
+
/** The edition number. */
|
|
30
|
+
edition: bcs.u16(),
|
|
31
|
+
/** The number of Records issued by this Pressing. */
|
|
32
|
+
supply: bcs.u32(),
|
|
33
|
+
/** The immutable supply ceiling, or `none()` for an uncapped Pressing. */
|
|
34
|
+
max_supply: bcs.option(bcs.u32()),
|
|
35
|
+
/** The defining types of distributors currently permitted to mint. */
|
|
36
|
+
distributors: vec_set.VecSet(type_name.TypeName)
|
|
37
|
+
} });
|
|
38
|
+
export const PressingAdminCap = new MoveStruct({ name: `${$moduleName}::PressingAdminCap`, fields: {
|
|
39
|
+
/** The capability's derived object identity. */
|
|
40
|
+
id: bcs.Address,
|
|
41
|
+
/** The Pressing controlled by this capability. */
|
|
42
|
+
pressing_id: bcs.Address
|
|
43
|
+
} });
|
|
44
|
+
export const PressingCreatedEvent = new MoveStruct({ name: `${$moduleName}::PressingCreatedEvent`, fields: {
|
|
45
|
+
/** The newly created Pressing. */
|
|
46
|
+
pressing_id: bcs.Address,
|
|
47
|
+
/** The parent release. */
|
|
48
|
+
release_id: bcs.Address,
|
|
49
|
+
/** The Pressing's edition number. */
|
|
50
|
+
edition: bcs.u16(),
|
|
51
|
+
/** The immutable supply ceiling, if one exists. */
|
|
52
|
+
max_supply: bcs.option(bcs.u32())
|
|
53
|
+
} });
|
|
54
|
+
export const DistributorAuthorizedEvent = new MoveStruct({ name: `${$moduleName}::DistributorAuthorizedEvent`, fields: {
|
|
55
|
+
/** The configured Pressing. */
|
|
56
|
+
pressing_id: bcs.Address,
|
|
57
|
+
/** The authorized distributor's defining type. */
|
|
58
|
+
distributor: type_name.TypeName
|
|
59
|
+
} });
|
|
60
|
+
export const DistributorRevokedEvent = new MoveStruct({ name: `${$moduleName}::DistributorRevokedEvent`, fields: {
|
|
61
|
+
/** The configured Pressing. */
|
|
62
|
+
pressing_id: bcs.Address,
|
|
63
|
+
/** The revoked distributor's defining type. */
|
|
64
|
+
distributor: type_name.TypeName
|
|
65
|
+
} });
|
|
66
|
+
export const RecordPurchasedEvent = new MoveStruct({ name: `${$moduleName}::RecordPurchasedEvent`, fields: {
|
|
67
|
+
/** The purchased Record. */
|
|
68
|
+
record_id: bcs.Address,
|
|
69
|
+
/** The release represented by the Record. */
|
|
70
|
+
release_id: bcs.Address,
|
|
71
|
+
/** The Pressing that issued the Record. */
|
|
72
|
+
pressing_id: bcs.Address,
|
|
73
|
+
/** The edition represented by the Pressing. */
|
|
74
|
+
edition: bcs.u16(),
|
|
75
|
+
/** The Record's number within its edition. */
|
|
76
|
+
number: bcs.u32(),
|
|
77
|
+
/** The defining type of the purchase currency. */
|
|
78
|
+
purchase_currency: type_name.TypeName,
|
|
79
|
+
/** The amount paid for the Record. */
|
|
80
|
+
purchase_price: bcs.u64(),
|
|
81
|
+
/** The transaction sender who purchased the Record. */
|
|
82
|
+
purchased_by: bcs.Address,
|
|
83
|
+
/** The purchase time in Unix milliseconds from Sui's Clock. */
|
|
84
|
+
purchased_timestamp_ms: bcs.u64(),
|
|
85
|
+
/** The defining type of the distributor that authorized the mint. */
|
|
86
|
+
distributor: type_name.TypeName
|
|
87
|
+
} });
|
|
88
|
+
export interface NewArguments {
|
|
89
|
+
release: RawTransactionArgument<string>;
|
|
90
|
+
releaseCap: RawTransactionArgument<string>;
|
|
91
|
+
edition: RawTransactionArgument<number>;
|
|
92
|
+
maxSupply: RawTransactionArgument<number | null>;
|
|
93
|
+
}
|
|
94
|
+
export interface NewOptions {
|
|
95
|
+
package?: string;
|
|
96
|
+
arguments: NewArguments | [
|
|
97
|
+
release: RawTransactionArgument<string>,
|
|
98
|
+
releaseCap: RawTransactionArgument<string>,
|
|
99
|
+
edition: RawTransactionArgument<number>,
|
|
100
|
+
maxSupply: RawTransactionArgument<number | null>
|
|
101
|
+
];
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Create one edition's Pressing under its Release.
|
|
105
|
+
*
|
|
106
|
+
* `max_supply = none()` creates an uncapped edition; `some(quantity)` creates a
|
|
107
|
+
* permanently capped edition. The Pressing and its admin capability are returned
|
|
108
|
+
* for composition before the caller shares the Pressing and custodies the
|
|
109
|
+
* capability.
|
|
110
|
+
*/
|
|
111
|
+
export function _new(options: NewOptions) {
|
|
112
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
113
|
+
const argumentsTypes = [
|
|
114
|
+
null,
|
|
115
|
+
null,
|
|
116
|
+
'u16',
|
|
117
|
+
'0x1::option::Option<u32>'
|
|
118
|
+
] satisfies (string | null)[];
|
|
119
|
+
const parameterNames = ["release", "releaseCap", "edition", "maxSupply"];
|
|
120
|
+
return (tx: Transaction) => tx.moveCall({
|
|
121
|
+
package: packageAddress,
|
|
122
|
+
module: 'pressing',
|
|
123
|
+
function: 'new',
|
|
124
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
export interface ShareArguments {
|
|
128
|
+
self: RawTransactionArgument<string>;
|
|
129
|
+
}
|
|
130
|
+
export interface ShareOptions {
|
|
131
|
+
package?: string;
|
|
132
|
+
arguments: ShareArguments | [
|
|
133
|
+
self: RawTransactionArgument<string>
|
|
134
|
+
];
|
|
135
|
+
}
|
|
136
|
+
/** Share a newly created Pressing after configuring its distributors. */
|
|
137
|
+
export function share(options: ShareOptions) {
|
|
138
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
139
|
+
const argumentsTypes = [
|
|
140
|
+
null
|
|
141
|
+
] satisfies (string | null)[];
|
|
142
|
+
const parameterNames = ["self"];
|
|
143
|
+
return (tx: Transaction) => tx.moveCall({
|
|
144
|
+
package: packageAddress,
|
|
145
|
+
module: 'pressing',
|
|
146
|
+
function: 'share',
|
|
147
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
export interface AuthorizeDistributorArguments {
|
|
151
|
+
self: RawTransactionArgument<string>;
|
|
152
|
+
cap: RawTransactionArgument<string>;
|
|
153
|
+
}
|
|
154
|
+
export interface AuthorizeDistributorOptions {
|
|
155
|
+
package?: string;
|
|
156
|
+
arguments: AuthorizeDistributorArguments | [
|
|
157
|
+
self: RawTransactionArgument<string>,
|
|
158
|
+
cap: RawTransactionArgument<string>
|
|
159
|
+
];
|
|
160
|
+
typeArguments: [
|
|
161
|
+
string
|
|
162
|
+
];
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Authorize distributor witness type `Distributor` for this edition. Reauthorizing
|
|
166
|
+
* an existing distributor is a no-op.
|
|
167
|
+
*/
|
|
168
|
+
export function authorizeDistributor(options: AuthorizeDistributorOptions) {
|
|
169
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
170
|
+
const argumentsTypes = [
|
|
171
|
+
null,
|
|
172
|
+
null
|
|
173
|
+
] satisfies (string | null)[];
|
|
174
|
+
const parameterNames = ["self", "cap"];
|
|
175
|
+
return (tx: Transaction) => tx.moveCall({
|
|
176
|
+
package: packageAddress,
|
|
177
|
+
module: 'pressing',
|
|
178
|
+
function: 'authorize_distributor',
|
|
179
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
180
|
+
typeArguments: options.typeArguments
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
export interface RevokeDistributorArguments {
|
|
184
|
+
self: RawTransactionArgument<string>;
|
|
185
|
+
cap: RawTransactionArgument<string>;
|
|
186
|
+
}
|
|
187
|
+
export interface RevokeDistributorOptions {
|
|
188
|
+
package?: string;
|
|
189
|
+
arguments: RevokeDistributorArguments | [
|
|
190
|
+
self: RawTransactionArgument<string>,
|
|
191
|
+
cap: RawTransactionArgument<string>
|
|
192
|
+
];
|
|
193
|
+
typeArguments: [
|
|
194
|
+
string
|
|
195
|
+
];
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Revoke distributor witness type `Distributor` for this edition. Revoking a
|
|
199
|
+
* missing distributor is a no-op.
|
|
200
|
+
*/
|
|
201
|
+
export function revokeDistributor(options: RevokeDistributorOptions) {
|
|
202
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
203
|
+
const argumentsTypes = [
|
|
204
|
+
null,
|
|
205
|
+
null
|
|
206
|
+
] satisfies (string | null)[];
|
|
207
|
+
const parameterNames = ["self", "cap"];
|
|
208
|
+
return (tx: Transaction) => tx.moveCall({
|
|
209
|
+
package: packageAddress,
|
|
210
|
+
module: 'pressing',
|
|
211
|
+
function: 'revoke_distributor',
|
|
212
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
213
|
+
typeArguments: options.typeArguments
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
export interface MintArguments<Distributor extends BcsType<any>> {
|
|
217
|
+
self: RawTransactionArgument<string>;
|
|
218
|
+
Distributor: RawTransactionArgument<Distributor>;
|
|
219
|
+
purchasePrice: RawTransactionArgument<number | bigint>;
|
|
220
|
+
}
|
|
221
|
+
export interface MintOptions<Distributor extends BcsType<any>> {
|
|
222
|
+
package?: string;
|
|
223
|
+
arguments: MintArguments<Distributor> | [
|
|
224
|
+
self: RawTransactionArgument<string>,
|
|
225
|
+
Distributor: RawTransactionArgument<Distributor>,
|
|
226
|
+
purchasePrice: RawTransactionArgument<number | bigint>
|
|
227
|
+
];
|
|
228
|
+
typeArguments: [
|
|
229
|
+
string,
|
|
230
|
+
string
|
|
231
|
+
];
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Purchase the next Record by consuming an authorized distributor witness.
|
|
235
|
+
*
|
|
236
|
+
* The Record number is allocated here and cannot be selected by the caller. The
|
|
237
|
+
* returned Record remains composable: the distributor decides whether to transfer,
|
|
238
|
+
* wrap, freeze, or otherwise deliver it.
|
|
239
|
+
*/
|
|
240
|
+
export function mint<Distributor extends BcsType<any>>(options: MintOptions<Distributor>) {
|
|
241
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
242
|
+
const argumentsTypes = [
|
|
243
|
+
null,
|
|
244
|
+
`${options.typeArguments[0]}`,
|
|
245
|
+
'u64',
|
|
246
|
+
'0x2::clock::Clock'
|
|
247
|
+
] satisfies (string | null)[];
|
|
248
|
+
const parameterNames = ["self", "Distributor", "purchasePrice"];
|
|
249
|
+
return (tx: Transaction) => tx.moveCall({
|
|
250
|
+
package: packageAddress,
|
|
251
|
+
module: 'pressing',
|
|
252
|
+
function: 'mint',
|
|
253
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
254
|
+
typeArguments: options.typeArguments
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
export interface UidArguments {
|
|
258
|
+
self: RawTransactionArgument<string>;
|
|
259
|
+
}
|
|
260
|
+
export interface UidOptions {
|
|
261
|
+
package?: string;
|
|
262
|
+
arguments: UidArguments | [
|
|
263
|
+
self: RawTransactionArgument<string>
|
|
264
|
+
];
|
|
265
|
+
}
|
|
266
|
+
/** Borrow the Pressing UID for read-only extensions. */
|
|
267
|
+
export function uid(options: UidOptions) {
|
|
268
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
269
|
+
const argumentsTypes = [
|
|
270
|
+
null
|
|
271
|
+
] satisfies (string | null)[];
|
|
272
|
+
const parameterNames = ["self"];
|
|
273
|
+
return (tx: Transaction) => tx.moveCall({
|
|
274
|
+
package: packageAddress,
|
|
275
|
+
module: 'pressing',
|
|
276
|
+
function: 'uid',
|
|
277
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
export interface UidMutArguments {
|
|
281
|
+
self: RawTransactionArgument<string>;
|
|
282
|
+
cap: RawTransactionArgument<string>;
|
|
283
|
+
}
|
|
284
|
+
export interface UidMutOptions {
|
|
285
|
+
package?: string;
|
|
286
|
+
arguments: UidMutArguments | [
|
|
287
|
+
self: RawTransactionArgument<string>,
|
|
288
|
+
cap: RawTransactionArgument<string>
|
|
289
|
+
];
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Mutably access the Pressing UID for cap-authorized extensions, including
|
|
293
|
+
* distributor-owned objects derived from this edition.
|
|
294
|
+
*/
|
|
295
|
+
export function uidMut(options: UidMutOptions) {
|
|
296
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
297
|
+
const argumentsTypes = [
|
|
298
|
+
null,
|
|
299
|
+
null
|
|
300
|
+
] satisfies (string | null)[];
|
|
301
|
+
const parameterNames = ["self", "cap"];
|
|
302
|
+
return (tx: Transaction) => tx.moveCall({
|
|
303
|
+
package: packageAddress,
|
|
304
|
+
module: 'pressing',
|
|
305
|
+
function: 'uid_mut',
|
|
306
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
export interface ReleaseIdArguments {
|
|
310
|
+
self: RawTransactionArgument<string>;
|
|
311
|
+
}
|
|
312
|
+
export interface ReleaseIdOptions {
|
|
313
|
+
package?: string;
|
|
314
|
+
arguments: ReleaseIdArguments | [
|
|
315
|
+
self: RawTransactionArgument<string>
|
|
316
|
+
];
|
|
317
|
+
}
|
|
318
|
+
/** Return the release represented by this Pressing. */
|
|
319
|
+
export function releaseId(options: ReleaseIdOptions) {
|
|
320
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
321
|
+
const argumentsTypes = [
|
|
322
|
+
null
|
|
323
|
+
] satisfies (string | null)[];
|
|
324
|
+
const parameterNames = ["self"];
|
|
325
|
+
return (tx: Transaction) => tx.moveCall({
|
|
326
|
+
package: packageAddress,
|
|
327
|
+
module: 'pressing',
|
|
328
|
+
function: 'release_id',
|
|
329
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
export interface EditionArguments {
|
|
333
|
+
self: RawTransactionArgument<string>;
|
|
334
|
+
}
|
|
335
|
+
export interface EditionOptions {
|
|
336
|
+
package?: string;
|
|
337
|
+
arguments: EditionArguments | [
|
|
338
|
+
self: RawTransactionArgument<string>
|
|
339
|
+
];
|
|
340
|
+
}
|
|
341
|
+
/** Return this Pressing's edition number. */
|
|
342
|
+
export function edition(options: EditionOptions) {
|
|
343
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
344
|
+
const argumentsTypes = [
|
|
345
|
+
null
|
|
346
|
+
] satisfies (string | null)[];
|
|
347
|
+
const parameterNames = ["self"];
|
|
348
|
+
return (tx: Transaction) => tx.moveCall({
|
|
349
|
+
package: packageAddress,
|
|
350
|
+
module: 'pressing',
|
|
351
|
+
function: 'edition',
|
|
352
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
export interface SupplyArguments {
|
|
356
|
+
self: RawTransactionArgument<string>;
|
|
357
|
+
}
|
|
358
|
+
export interface SupplyOptions {
|
|
359
|
+
package?: string;
|
|
360
|
+
arguments: SupplyArguments | [
|
|
361
|
+
self: RawTransactionArgument<string>
|
|
362
|
+
];
|
|
363
|
+
}
|
|
364
|
+
/** Return the number of Records issued by this Pressing. */
|
|
365
|
+
export function supply(options: SupplyOptions) {
|
|
366
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
367
|
+
const argumentsTypes = [
|
|
368
|
+
null
|
|
369
|
+
] satisfies (string | null)[];
|
|
370
|
+
const parameterNames = ["self"];
|
|
371
|
+
return (tx: Transaction) => tx.moveCall({
|
|
372
|
+
package: packageAddress,
|
|
373
|
+
module: 'pressing',
|
|
374
|
+
function: 'supply',
|
|
375
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
export interface MaxSupplyArguments {
|
|
379
|
+
self: RawTransactionArgument<string>;
|
|
380
|
+
}
|
|
381
|
+
export interface MaxSupplyOptions {
|
|
382
|
+
package?: string;
|
|
383
|
+
arguments: MaxSupplyArguments | [
|
|
384
|
+
self: RawTransactionArgument<string>
|
|
385
|
+
];
|
|
386
|
+
}
|
|
387
|
+
/** Return the immutable supply ceiling, if one exists. */
|
|
388
|
+
export function maxSupply(options: MaxSupplyOptions) {
|
|
389
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
390
|
+
const argumentsTypes = [
|
|
391
|
+
null
|
|
392
|
+
] satisfies (string | null)[];
|
|
393
|
+
const parameterNames = ["self"];
|
|
394
|
+
return (tx: Transaction) => tx.moveCall({
|
|
395
|
+
package: packageAddress,
|
|
396
|
+
module: 'pressing',
|
|
397
|
+
function: 'max_supply',
|
|
398
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
export interface DistributorsArguments {
|
|
402
|
+
self: RawTransactionArgument<string>;
|
|
403
|
+
}
|
|
404
|
+
export interface DistributorsOptions {
|
|
405
|
+
package?: string;
|
|
406
|
+
arguments: DistributorsArguments | [
|
|
407
|
+
self: RawTransactionArgument<string>
|
|
408
|
+
];
|
|
409
|
+
}
|
|
410
|
+
/** Borrow the defining types of all currently authorized distributors. */
|
|
411
|
+
export function distributors(options: DistributorsOptions) {
|
|
412
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
413
|
+
const argumentsTypes = [
|
|
414
|
+
null
|
|
415
|
+
] satisfies (string | null)[];
|
|
416
|
+
const parameterNames = ["self"];
|
|
417
|
+
return (tx: Transaction) => tx.moveCall({
|
|
418
|
+
package: packageAddress,
|
|
419
|
+
module: 'pressing',
|
|
420
|
+
function: 'distributors',
|
|
421
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
export interface IsDistributorAuthorizedArguments {
|
|
425
|
+
self: RawTransactionArgument<string>;
|
|
426
|
+
}
|
|
427
|
+
export interface IsDistributorAuthorizedOptions {
|
|
428
|
+
package?: string;
|
|
429
|
+
arguments: IsDistributorAuthorizedArguments | [
|
|
430
|
+
self: RawTransactionArgument<string>
|
|
431
|
+
];
|
|
432
|
+
typeArguments: [
|
|
433
|
+
string
|
|
434
|
+
];
|
|
435
|
+
}
|
|
436
|
+
/** Return whether `Distributor` is currently authorized to mint. */
|
|
437
|
+
export function isDistributorAuthorized(options: IsDistributorAuthorizedOptions) {
|
|
438
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
439
|
+
const argumentsTypes = [
|
|
440
|
+
null
|
|
441
|
+
] satisfies (string | null)[];
|
|
442
|
+
const parameterNames = ["self"];
|
|
443
|
+
return (tx: Transaction) => tx.moveCall({
|
|
444
|
+
package: packageAddress,
|
|
445
|
+
module: 'pressing',
|
|
446
|
+
function: 'is_distributor_authorized',
|
|
447
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
448
|
+
typeArguments: options.typeArguments
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
export interface PressingIdArguments {
|
|
452
|
+
cap: RawTransactionArgument<string>;
|
|
453
|
+
}
|
|
454
|
+
export interface PressingIdOptions {
|
|
455
|
+
package?: string;
|
|
456
|
+
arguments: PressingIdArguments | [
|
|
457
|
+
cap: RawTransactionArgument<string>
|
|
458
|
+
];
|
|
459
|
+
}
|
|
460
|
+
/** Return the Pressing controlled by this capability. */
|
|
461
|
+
export function pressingId(options: PressingIdOptions) {
|
|
462
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
463
|
+
const argumentsTypes = [
|
|
464
|
+
null
|
|
465
|
+
] satisfies (string | null)[];
|
|
466
|
+
const parameterNames = ["cap"];
|
|
467
|
+
return (tx: Transaction) => tx.moveCall({
|
|
468
|
+
package: packageAddress,
|
|
469
|
+
module: 'pressing',
|
|
470
|
+
function: 'pressing_id',
|
|
471
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
export interface DeriveAddressArguments {
|
|
475
|
+
releaseId: RawTransactionArgument<string>;
|
|
476
|
+
edition: RawTransactionArgument<number>;
|
|
477
|
+
}
|
|
478
|
+
export interface DeriveAddressOptions {
|
|
479
|
+
package?: string;
|
|
480
|
+
arguments: DeriveAddressArguments | [
|
|
481
|
+
releaseId: RawTransactionArgument<string>,
|
|
482
|
+
edition: RawTransactionArgument<number>
|
|
483
|
+
];
|
|
484
|
+
}
|
|
485
|
+
/** Derive an edition's Pressing address from its Release ID. */
|
|
486
|
+
export function deriveAddress(options: DeriveAddressOptions) {
|
|
487
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
488
|
+
const argumentsTypes = [
|
|
489
|
+
'0x2::object::ID',
|
|
490
|
+
'u16'
|
|
491
|
+
] satisfies (string | null)[];
|
|
492
|
+
const parameterNames = ["releaseId", "edition"];
|
|
493
|
+
return (tx: Transaction) => tx.moveCall({
|
|
494
|
+
package: packageAddress,
|
|
495
|
+
module: 'pressing',
|
|
496
|
+
function: 'derive_address',
|
|
497
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
export interface DeriveAdminCapAddressArguments {
|
|
501
|
+
pressingId: RawTransactionArgument<string>;
|
|
502
|
+
}
|
|
503
|
+
export interface DeriveAdminCapAddressOptions {
|
|
504
|
+
package?: string;
|
|
505
|
+
arguments: DeriveAdminCapAddressArguments | [
|
|
506
|
+
pressingId: RawTransactionArgument<string>
|
|
507
|
+
];
|
|
508
|
+
}
|
|
509
|
+
/** Derive a Pressing's admin capability address. */
|
|
510
|
+
export function deriveAdminCapAddress(options: DeriveAdminCapAddressOptions) {
|
|
511
|
+
const packageAddress = options.package ?? '@local-pkg/miso_record';
|
|
512
|
+
const argumentsTypes = [
|
|
513
|
+
'0x2::object::ID'
|
|
514
|
+
] satisfies (string | null)[];
|
|
515
|
+
const parameterNames = ["pressingId"];
|
|
516
|
+
return (tx: Transaction) => tx.moveCall({
|
|
517
|
+
package: packageAddress,
|
|
518
|
+
module: 'pressing',
|
|
519
|
+
function: 'derive_admin_cap_address',
|
|
520
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
521
|
+
});
|
|
522
|
+
}
|