@mysten/kiosk 1.0.1 → 1.1.1

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 (101) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/client/kiosk-client.d.mts +4 -4
  3. package/dist/client/kiosk-client.d.mts.map +1 -1
  4. package/dist/client/kiosk-client.mjs.map +1 -1
  5. package/dist/contracts/0x2/bag.mjs.map +1 -1
  6. package/dist/contracts/0x2/balance.mjs +1 -5
  7. package/dist/contracts/0x2/balance.mjs.map +1 -1
  8. package/dist/contracts/0x2/kiosk.mjs +5 -5
  9. package/dist/contracts/0x2/kiosk.mjs.map +1 -1
  10. package/dist/contracts/0x2/kiosk_extension.mjs +1 -1
  11. package/dist/contracts/0x2/kiosk_extension.mjs.map +1 -1
  12. package/dist/contracts/0x2/transfer_policy.mjs +6 -6
  13. package/dist/contracts/0x2/transfer_policy.mjs.map +1 -1
  14. package/dist/contracts/0x2/vec_set.mjs.map +1 -1
  15. package/dist/index.d.mts +4 -4
  16. package/dist/index.mjs +2 -2
  17. package/dist/query/client-utils.mjs +186 -1
  18. package/dist/query/client-utils.mjs.map +1 -1
  19. package/dist/query/kiosk.mjs +2 -1
  20. package/dist/query/kiosk.mjs.map +1 -1
  21. package/dist/query/transfer-policy.mjs +1 -1
  22. package/dist/query/transfer-policy.mjs.map +1 -1
  23. package/dist/types/index.d.mts +7 -4
  24. package/dist/types/index.d.mts.map +1 -1
  25. package/dist/types/kiosk.d.mts +13 -3
  26. package/dist/types/kiosk.d.mts.map +1 -1
  27. package/dist/types/kiosk.mjs.map +1 -1
  28. package/dist/utils.d.mts +3 -9
  29. package/dist/utils.d.mts.map +1 -1
  30. package/dist/utils.mjs +5 -24
  31. package/dist/utils.mjs.map +1 -1
  32. package/package.json +8 -7
  33. package/src/client/kiosk-client.ts +4 -3
  34. package/src/contracts/0x2/bag.ts +2 -181
  35. package/src/contracts/0x2/balance.ts +3 -260
  36. package/src/contracts/0x2/kiosk.ts +4 -4
  37. package/src/contracts/0x2/kiosk_extension.ts +1 -1
  38. package/src/contracts/0x2/transfer_policy.ts +6 -6
  39. package/src/contracts/0x2/vec_set.ts +1 -198
  40. package/src/contracts/kiosk/witness_rule.ts +1 -1
  41. package/src/query/client-utils.ts +253 -2
  42. package/src/query/kiosk.ts +3 -2
  43. package/src/query/transfer-policy.ts +4 -5
  44. package/src/types/index.ts +6 -2
  45. package/src/types/kiosk.ts +15 -3
  46. package/src/utils.ts +8 -38
  47. package/src/contracts/0x2/accumulator.ts +0 -24
  48. package/src/contracts/0x2/accumulator_metadata.ts +0 -38
  49. package/src/contracts/0x2/accumulator_settlement.ts +0 -14
  50. package/src/contracts/0x2/address.ts +0 -145
  51. package/src/contracts/0x2/address_alias.ts +0 -92
  52. package/src/contracts/0x2/authenticator_state.ts +0 -44
  53. package/src/contracts/0x2/bcs.ts +0 -495
  54. package/src/contracts/0x2/bls12381.ts +0 -717
  55. package/src/contracts/0x2/borrow.ts +0 -99
  56. package/src/contracts/0x2/clock.ts +0 -30
  57. package/src/contracts/0x2/coin.ts +0 -977
  58. package/src/contracts/0x2/coin_registry.ts +0 -874
  59. package/src/contracts/0x2/config.ts +0 -30
  60. package/src/contracts/0x2/deny_list.ts +0 -55
  61. package/src/contracts/0x2/derived_object.ts +0 -95
  62. package/src/contracts/0x2/display.ts +0 -258
  63. package/src/contracts/0x2/dynamic_field.ts +0 -171
  64. package/src/contracts/0x2/dynamic_object_field.ts +0 -167
  65. package/src/contracts/0x2/ecdsa_k1.ts +0 -65
  66. package/src/contracts/0x2/ecdsa_r1.ts +0 -49
  67. package/src/contracts/0x2/ecvrf.ts +0 -29
  68. package/src/contracts/0x2/ed25519.ts +0 -25
  69. package/src/contracts/0x2/event.ts +0 -42
  70. package/src/contracts/0x2/funds_accumulator.ts +0 -86
  71. package/src/contracts/0x2/groth16.ts +0 -171
  72. package/src/contracts/0x2/group_ops.ts +0 -49
  73. package/src/contracts/0x2/hash.ts +0 -37
  74. package/src/contracts/0x2/hex.ts +0 -37
  75. package/src/contracts/0x2/hmac.ts +0 -21
  76. package/src/contracts/0x2/linked_table.ts +0 -354
  77. package/src/contracts/0x2/math.ts +0 -117
  78. package/src/contracts/0x2/nitro_attestation.ts +0 -186
  79. package/src/contracts/0x2/object.ts +0 -249
  80. package/src/contracts/0x2/object_bag.ts +0 -210
  81. package/src/contracts/0x2/object_table.ts +0 -200
  82. package/src/contracts/0x2/package.ts +0 -414
  83. package/src/contracts/0x2/party.ts +0 -37
  84. package/src/contracts/0x2/pay.ts +0 -153
  85. package/src/contracts/0x2/poseidon.ts +0 -21
  86. package/src/contracts/0x2/priority_queue.ts +0 -139
  87. package/src/contracts/0x2/random.ts +0 -294
  88. package/src/contracts/0x2/sui.ts +0 -29
  89. package/src/contracts/0x2/table.ts +0 -200
  90. package/src/contracts/0x2/table_vec.ts +0 -232
  91. package/src/contracts/0x2/token.ts +0 -873
  92. package/src/contracts/0x2/transfer.ts +0 -216
  93. package/src/contracts/0x2/tx_context.ts +0 -129
  94. package/src/contracts/0x2/types.ts +0 -24
  95. package/src/contracts/0x2/url.ts +0 -77
  96. package/src/contracts/0x2/vdf.ts +0 -45
  97. package/src/contracts/0x2/vec_map.ts +0 -401
  98. package/src/contracts/0x2/versioned.ts +0 -153
  99. package/src/contracts/0x2/zklogin_verified_id.ts +0 -172
  100. package/src/contracts/0x2/zklogin_verified_issuer.ts +0 -99
  101. package/src/contracts/kiosk/deps/sui/object.ts +0 -15
@@ -1,873 +0,0 @@
1
- /**************************************************************
2
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
- **************************************************************/
4
- import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
5
- import { bcs, type BcsType } from '@mysten/sui/bcs';
6
- import { type Transaction } from '@mysten/sui/transactions';
7
- import * as balance from './balance.js';
8
- import * as vec_map from './vec_map.js';
9
- import * as vec_set from './vec_set.js';
10
- import * as type_name from './deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.js';
11
- const $moduleName = '0x2::token';
12
- export const Token = new MoveStruct({
13
- name: `${$moduleName}::Token`,
14
- fields: {
15
- id: bcs.Address,
16
- balance: balance.Balance,
17
- },
18
- });
19
- export const TokenPolicyCap = new MoveStruct({
20
- name: `${$moduleName}::TokenPolicyCap`,
21
- fields: {
22
- id: bcs.Address,
23
- for: bcs.Address,
24
- },
25
- });
26
- export const TokenPolicy = new MoveStruct({
27
- name: `${$moduleName}::TokenPolicy`,
28
- fields: {
29
- id: bcs.Address,
30
- spent_balance: balance.Balance,
31
- rules: vec_map.VecMap(bcs.string(), vec_set.VecSet(type_name.TypeName)),
32
- },
33
- });
34
- export const ActionRequest = new MoveStruct({
35
- name: `${$moduleName}::ActionRequest`,
36
- fields: {
37
- name: bcs.string(),
38
- amount: bcs.u64(),
39
- sender: bcs.Address,
40
- recipient: bcs.option(bcs.Address),
41
- spent_balance: bcs.option(balance.Balance),
42
- approvals: vec_set.VecSet(type_name.TypeName),
43
- },
44
- });
45
- export const RuleKey = new MoveStruct({
46
- name: `${$moduleName}::RuleKey`,
47
- fields: {
48
- is_protected: bcs.bool(),
49
- },
50
- });
51
- export const TokenPolicyCreated = new MoveStruct({
52
- name: `${$moduleName}::TokenPolicyCreated`,
53
- fields: {
54
- id: bcs.Address,
55
- is_mutable: bcs.bool(),
56
- },
57
- });
58
- export interface NewPolicyOptions {
59
- package?: string;
60
- arguments: [RawTransactionArgument<string>];
61
- typeArguments: [string];
62
- }
63
- export function newPolicy(options: NewPolicyOptions) {
64
- const packageAddress =
65
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
66
- const argumentsTypes = [null] satisfies (string | null)[];
67
- return (tx: Transaction) =>
68
- tx.moveCall({
69
- package: packageAddress,
70
- module: 'token',
71
- function: 'new_policy',
72
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
73
- typeArguments: options.typeArguments,
74
- });
75
- }
76
- export interface SharePolicyOptions {
77
- package?: string;
78
- arguments: [RawTransactionArgument<string>];
79
- typeArguments: [string];
80
- }
81
- export function sharePolicy(options: SharePolicyOptions) {
82
- const packageAddress =
83
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
84
- const argumentsTypes = [null] satisfies (string | null)[];
85
- return (tx: Transaction) =>
86
- tx.moveCall({
87
- package: packageAddress,
88
- module: 'token',
89
- function: 'share_policy',
90
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
91
- typeArguments: options.typeArguments,
92
- });
93
- }
94
- export interface TransferOptions {
95
- package?: string;
96
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
97
- typeArguments: [string];
98
- }
99
- export function transfer(options: TransferOptions) {
100
- const packageAddress =
101
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
102
- const argumentsTypes = [null, 'address'] satisfies (string | null)[];
103
- return (tx: Transaction) =>
104
- tx.moveCall({
105
- package: packageAddress,
106
- module: 'token',
107
- function: 'transfer',
108
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
109
- typeArguments: options.typeArguments,
110
- });
111
- }
112
- export interface SpendOptions {
113
- package?: string;
114
- arguments: [RawTransactionArgument<string>];
115
- typeArguments: [string];
116
- }
117
- export function spend(options: SpendOptions) {
118
- const packageAddress =
119
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
120
- const argumentsTypes = [null] satisfies (string | null)[];
121
- return (tx: Transaction) =>
122
- tx.moveCall({
123
- package: packageAddress,
124
- module: 'token',
125
- function: 'spend',
126
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
127
- typeArguments: options.typeArguments,
128
- });
129
- }
130
- export interface ToCoinOptions {
131
- package?: string;
132
- arguments: [RawTransactionArgument<string>];
133
- typeArguments: [string];
134
- }
135
- export function toCoin(options: ToCoinOptions) {
136
- const packageAddress =
137
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
138
- const argumentsTypes = [null] satisfies (string | null)[];
139
- return (tx: Transaction) =>
140
- tx.moveCall({
141
- package: packageAddress,
142
- module: 'token',
143
- function: 'to_coin',
144
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
145
- typeArguments: options.typeArguments,
146
- });
147
- }
148
- export interface FromCoinOptions {
149
- package?: string;
150
- arguments: [RawTransactionArgument<string>];
151
- typeArguments: [string];
152
- }
153
- export function fromCoin(options: FromCoinOptions) {
154
- const packageAddress =
155
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
156
- const argumentsTypes = [null] satisfies (string | null)[];
157
- return (tx: Transaction) =>
158
- tx.moveCall({
159
- package: packageAddress,
160
- module: 'token',
161
- function: 'from_coin',
162
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
163
- typeArguments: options.typeArguments,
164
- });
165
- }
166
- export interface JoinOptions {
167
- package?: string;
168
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
169
- typeArguments: [string];
170
- }
171
- export function join(options: JoinOptions) {
172
- const packageAddress =
173
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
174
- const argumentsTypes = [null, null] satisfies (string | null)[];
175
- return (tx: Transaction) =>
176
- tx.moveCall({
177
- package: packageAddress,
178
- module: 'token',
179
- function: 'join',
180
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
181
- typeArguments: options.typeArguments,
182
- });
183
- }
184
- export interface SplitOptions {
185
- package?: string;
186
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<number | bigint>];
187
- typeArguments: [string];
188
- }
189
- export function split(options: SplitOptions) {
190
- const packageAddress =
191
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
192
- const argumentsTypes = [null, 'u64'] satisfies (string | null)[];
193
- return (tx: Transaction) =>
194
- tx.moveCall({
195
- package: packageAddress,
196
- module: 'token',
197
- function: 'split',
198
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
199
- typeArguments: options.typeArguments,
200
- });
201
- }
202
- export interface ZeroOptions {
203
- package?: string;
204
- arguments?: [];
205
- typeArguments: [string];
206
- }
207
- export function zero(options: ZeroOptions) {
208
- const packageAddress =
209
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
210
- return (tx: Transaction) =>
211
- tx.moveCall({
212
- package: packageAddress,
213
- module: 'token',
214
- function: 'zero',
215
- typeArguments: options.typeArguments,
216
- });
217
- }
218
- export interface DestroyZeroOptions {
219
- package?: string;
220
- arguments: [RawTransactionArgument<string>];
221
- typeArguments: [string];
222
- }
223
- export function destroyZero(options: DestroyZeroOptions) {
224
- const packageAddress =
225
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
226
- const argumentsTypes = [null] satisfies (string | null)[];
227
- return (tx: Transaction) =>
228
- tx.moveCall({
229
- package: packageAddress,
230
- module: 'token',
231
- function: 'destroy_zero',
232
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
233
- typeArguments: options.typeArguments,
234
- });
235
- }
236
- export interface KeepOptions {
237
- package?: string;
238
- arguments: [RawTransactionArgument<string>];
239
- typeArguments: [string];
240
- }
241
- export function keep(options: KeepOptions) {
242
- const packageAddress =
243
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
244
- const argumentsTypes = [null] satisfies (string | null)[];
245
- return (tx: Transaction) =>
246
- tx.moveCall({
247
- package: packageAddress,
248
- module: 'token',
249
- function: 'keep',
250
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
251
- typeArguments: options.typeArguments,
252
- });
253
- }
254
- export interface NewRequestOptions {
255
- package?: string;
256
- arguments: [
257
- RawTransactionArgument<string>,
258
- RawTransactionArgument<number | bigint>,
259
- RawTransactionArgument<string | null>,
260
- RawTransactionArgument<string | null>,
261
- ];
262
- typeArguments: [string];
263
- }
264
- export function newRequest(options: NewRequestOptions) {
265
- const packageAddress =
266
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
267
- const argumentsTypes = [
268
- '0x1::string::String',
269
- 'u64',
270
- '0x1::option::Option<address>',
271
- '0x1::option::Option<null>',
272
- ] satisfies (string | null)[];
273
- return (tx: Transaction) =>
274
- tx.moveCall({
275
- package: packageAddress,
276
- module: 'token',
277
- function: 'new_request',
278
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
279
- typeArguments: options.typeArguments,
280
- });
281
- }
282
- export interface ConfirmRequestOptions {
283
- package?: string;
284
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
285
- typeArguments: [string];
286
- }
287
- export function confirmRequest(options: ConfirmRequestOptions) {
288
- const packageAddress =
289
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
290
- const argumentsTypes = [null, null] satisfies (string | null)[];
291
- return (tx: Transaction) =>
292
- tx.moveCall({
293
- package: packageAddress,
294
- module: 'token',
295
- function: 'confirm_request',
296
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
297
- typeArguments: options.typeArguments,
298
- });
299
- }
300
- export interface ConfirmRequestMutOptions {
301
- package?: string;
302
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
303
- typeArguments: [string];
304
- }
305
- export function confirmRequestMut(options: ConfirmRequestMutOptions) {
306
- const packageAddress =
307
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
308
- const argumentsTypes = [null, null] satisfies (string | null)[];
309
- return (tx: Transaction) =>
310
- tx.moveCall({
311
- package: packageAddress,
312
- module: 'token',
313
- function: 'confirm_request_mut',
314
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
315
- typeArguments: options.typeArguments,
316
- });
317
- }
318
- export interface ConfirmWithPolicyCapOptions {
319
- package?: string;
320
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
321
- typeArguments: [string];
322
- }
323
- export function confirmWithPolicyCap(options: ConfirmWithPolicyCapOptions) {
324
- const packageAddress =
325
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
326
- const argumentsTypes = [null, null] satisfies (string | null)[];
327
- return (tx: Transaction) =>
328
- tx.moveCall({
329
- package: packageAddress,
330
- module: 'token',
331
- function: 'confirm_with_policy_cap',
332
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
333
- typeArguments: options.typeArguments,
334
- });
335
- }
336
- export interface ConfirmWithTreasuryCapOptions {
337
- package?: string;
338
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
339
- typeArguments: [string];
340
- }
341
- export function confirmWithTreasuryCap(options: ConfirmWithTreasuryCapOptions) {
342
- const packageAddress =
343
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
344
- const argumentsTypes = [null, null] satisfies (string | null)[];
345
- return (tx: Transaction) =>
346
- tx.moveCall({
347
- package: packageAddress,
348
- module: 'token',
349
- function: 'confirm_with_treasury_cap',
350
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
351
- typeArguments: options.typeArguments,
352
- });
353
- }
354
- export interface AddApprovalOptions<T1 extends BcsType<any>> {
355
- package?: string;
356
- arguments: [RawTransactionArgument<T1>, RawTransactionArgument<string>];
357
- typeArguments: [string, string];
358
- }
359
- export function addApproval<T1 extends BcsType<any>>(options: AddApprovalOptions<T1>) {
360
- const packageAddress =
361
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
362
- const argumentsTypes = [`${options.typeArguments[1]}`, null] satisfies (string | null)[];
363
- return (tx: Transaction) =>
364
- tx.moveCall({
365
- package: packageAddress,
366
- module: 'token',
367
- function: 'add_approval',
368
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
369
- typeArguments: options.typeArguments,
370
- });
371
- }
372
- export interface AddRuleConfigOptions<T1 extends BcsType<any>, T2 extends BcsType<any>> {
373
- package?: string;
374
- arguments: [
375
- RawTransactionArgument<T1>,
376
- RawTransactionArgument<string>,
377
- RawTransactionArgument<string>,
378
- RawTransactionArgument<T2>,
379
- ];
380
- typeArguments: [string, string, string];
381
- }
382
- export function addRuleConfig<T1 extends BcsType<any>, T2 extends BcsType<any>>(
383
- options: AddRuleConfigOptions<T1, T2>,
384
- ) {
385
- const packageAddress =
386
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
387
- const argumentsTypes = [
388
- `${options.typeArguments[1]}`,
389
- null,
390
- null,
391
- `${options.typeArguments[2]}`,
392
- ] satisfies (string | null)[];
393
- return (tx: Transaction) =>
394
- tx.moveCall({
395
- package: packageAddress,
396
- module: 'token',
397
- function: 'add_rule_config',
398
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
399
- typeArguments: options.typeArguments,
400
- });
401
- }
402
- export interface RuleConfigOptions<T1 extends BcsType<any>> {
403
- package?: string;
404
- arguments: [RawTransactionArgument<T1>, RawTransactionArgument<string>];
405
- typeArguments: [string, string, string];
406
- }
407
- export function ruleConfig<T1 extends BcsType<any>>(options: RuleConfigOptions<T1>) {
408
- const packageAddress =
409
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
410
- const argumentsTypes = [`${options.typeArguments[1]}`, null] satisfies (string | null)[];
411
- return (tx: Transaction) =>
412
- tx.moveCall({
413
- package: packageAddress,
414
- module: 'token',
415
- function: 'rule_config',
416
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
417
- typeArguments: options.typeArguments,
418
- });
419
- }
420
- export interface RuleConfigMutOptions<T1 extends BcsType<any>> {
421
- package?: string;
422
- arguments: [
423
- RawTransactionArgument<T1>,
424
- RawTransactionArgument<string>,
425
- RawTransactionArgument<string>,
426
- ];
427
- typeArguments: [string, string, string];
428
- }
429
- export function ruleConfigMut<T1 extends BcsType<any>>(options: RuleConfigMutOptions<T1>) {
430
- const packageAddress =
431
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
432
- const argumentsTypes = [`${options.typeArguments[1]}`, null, null] satisfies (string | null)[];
433
- return (tx: Transaction) =>
434
- tx.moveCall({
435
- package: packageAddress,
436
- module: 'token',
437
- function: 'rule_config_mut',
438
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
439
- typeArguments: options.typeArguments,
440
- });
441
- }
442
- export interface RemoveRuleConfigOptions {
443
- package?: string;
444
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
445
- typeArguments: [string, string, string];
446
- }
447
- export function removeRuleConfig(options: RemoveRuleConfigOptions) {
448
- const packageAddress =
449
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
450
- const argumentsTypes = [null, null] satisfies (string | null)[];
451
- return (tx: Transaction) =>
452
- tx.moveCall({
453
- package: packageAddress,
454
- module: 'token',
455
- function: 'remove_rule_config',
456
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
457
- typeArguments: options.typeArguments,
458
- });
459
- }
460
- export interface HasRuleConfigOptions {
461
- package?: string;
462
- arguments: [RawTransactionArgument<string>];
463
- typeArguments: [string, string];
464
- }
465
- export function hasRuleConfig(options: HasRuleConfigOptions) {
466
- const packageAddress =
467
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
468
- const argumentsTypes = [null] satisfies (string | null)[];
469
- return (tx: Transaction) =>
470
- tx.moveCall({
471
- package: packageAddress,
472
- module: 'token',
473
- function: 'has_rule_config',
474
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
475
- typeArguments: options.typeArguments,
476
- });
477
- }
478
- export interface HasRuleConfigWithTypeOptions {
479
- package?: string;
480
- arguments: [RawTransactionArgument<string>];
481
- typeArguments: [string, string, string];
482
- }
483
- export function hasRuleConfigWithType(options: HasRuleConfigWithTypeOptions) {
484
- const packageAddress =
485
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
486
- const argumentsTypes = [null] satisfies (string | null)[];
487
- return (tx: Transaction) =>
488
- tx.moveCall({
489
- package: packageAddress,
490
- module: 'token',
491
- function: 'has_rule_config_with_type',
492
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
493
- typeArguments: options.typeArguments,
494
- });
495
- }
496
- export interface AllowOptions {
497
- package?: string;
498
- arguments: [
499
- RawTransactionArgument<string>,
500
- RawTransactionArgument<string>,
501
- RawTransactionArgument<string>,
502
- ];
503
- typeArguments: [string];
504
- }
505
- export function allow(options: AllowOptions) {
506
- const packageAddress =
507
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
508
- const argumentsTypes = [null, null, '0x1::string::String'] satisfies (string | null)[];
509
- return (tx: Transaction) =>
510
- tx.moveCall({
511
- package: packageAddress,
512
- module: 'token',
513
- function: 'allow',
514
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
515
- typeArguments: options.typeArguments,
516
- });
517
- }
518
- export interface DisallowOptions {
519
- package?: string;
520
- arguments: [
521
- RawTransactionArgument<string>,
522
- RawTransactionArgument<string>,
523
- RawTransactionArgument<string>,
524
- ];
525
- typeArguments: [string];
526
- }
527
- export function disallow(options: DisallowOptions) {
528
- const packageAddress =
529
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
530
- const argumentsTypes = [null, null, '0x1::string::String'] satisfies (string | null)[];
531
- return (tx: Transaction) =>
532
- tx.moveCall({
533
- package: packageAddress,
534
- module: 'token',
535
- function: 'disallow',
536
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
537
- typeArguments: options.typeArguments,
538
- });
539
- }
540
- export interface AddRuleForActionOptions {
541
- package?: string;
542
- arguments: [
543
- RawTransactionArgument<string>,
544
- RawTransactionArgument<string>,
545
- RawTransactionArgument<string>,
546
- ];
547
- typeArguments: [string, string];
548
- }
549
- export function addRuleForAction(options: AddRuleForActionOptions) {
550
- const packageAddress =
551
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
552
- const argumentsTypes = [null, null, '0x1::string::String'] satisfies (string | null)[];
553
- return (tx: Transaction) =>
554
- tx.moveCall({
555
- package: packageAddress,
556
- module: 'token',
557
- function: 'add_rule_for_action',
558
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
559
- typeArguments: options.typeArguments,
560
- });
561
- }
562
- export interface RemoveRuleForActionOptions {
563
- package?: string;
564
- arguments: [
565
- RawTransactionArgument<string>,
566
- RawTransactionArgument<string>,
567
- RawTransactionArgument<string>,
568
- ];
569
- typeArguments: [string, string];
570
- }
571
- export function removeRuleForAction(options: RemoveRuleForActionOptions) {
572
- const packageAddress =
573
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
574
- const argumentsTypes = [null, null, '0x1::string::String'] satisfies (string | null)[];
575
- return (tx: Transaction) =>
576
- tx.moveCall({
577
- package: packageAddress,
578
- module: 'token',
579
- function: 'remove_rule_for_action',
580
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
581
- typeArguments: options.typeArguments,
582
- });
583
- }
584
- export interface MintOptions {
585
- package?: string;
586
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<number | bigint>];
587
- typeArguments: [string];
588
- }
589
- export function mint(options: MintOptions) {
590
- const packageAddress =
591
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
592
- const argumentsTypes = [null, 'u64'] satisfies (string | null)[];
593
- return (tx: Transaction) =>
594
- tx.moveCall({
595
- package: packageAddress,
596
- module: 'token',
597
- function: 'mint',
598
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
599
- typeArguments: options.typeArguments,
600
- });
601
- }
602
- export interface BurnOptions {
603
- package?: string;
604
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
605
- typeArguments: [string];
606
- }
607
- export function burn(options: BurnOptions) {
608
- const packageAddress =
609
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
610
- const argumentsTypes = [null, null] satisfies (string | null)[];
611
- return (tx: Transaction) =>
612
- tx.moveCall({
613
- package: packageAddress,
614
- module: 'token',
615
- function: 'burn',
616
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
617
- typeArguments: options.typeArguments,
618
- });
619
- }
620
- export interface FlushOptions {
621
- package?: string;
622
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
623
- typeArguments: [string];
624
- }
625
- export function flush(options: FlushOptions) {
626
- const packageAddress =
627
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
628
- const argumentsTypes = [null, null] satisfies (string | null)[];
629
- return (tx: Transaction) =>
630
- tx.moveCall({
631
- package: packageAddress,
632
- module: 'token',
633
- function: 'flush',
634
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
635
- typeArguments: options.typeArguments,
636
- });
637
- }
638
- export interface IsAllowedOptions {
639
- package?: string;
640
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
641
- typeArguments: [string];
642
- }
643
- export function isAllowed(options: IsAllowedOptions) {
644
- const packageAddress =
645
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
646
- const argumentsTypes = [null, '0x1::string::String'] satisfies (string | null)[];
647
- return (tx: Transaction) =>
648
- tx.moveCall({
649
- package: packageAddress,
650
- module: 'token',
651
- function: 'is_allowed',
652
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
653
- typeArguments: options.typeArguments,
654
- });
655
- }
656
- export interface RulesOptions {
657
- package?: string;
658
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
659
- typeArguments: [string];
660
- }
661
- export function rules(options: RulesOptions) {
662
- const packageAddress =
663
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
664
- const argumentsTypes = [null, '0x1::string::String'] satisfies (string | null)[];
665
- return (tx: Transaction) =>
666
- tx.moveCall({
667
- package: packageAddress,
668
- module: 'token',
669
- function: 'rules',
670
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
671
- typeArguments: options.typeArguments,
672
- });
673
- }
674
- export interface SpentBalanceOptions {
675
- package?: string;
676
- arguments: [RawTransactionArgument<string>];
677
- typeArguments: [string];
678
- }
679
- export function spentBalance(options: SpentBalanceOptions) {
680
- const packageAddress =
681
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
682
- const argumentsTypes = [null] satisfies (string | null)[];
683
- return (tx: Transaction) =>
684
- tx.moveCall({
685
- package: packageAddress,
686
- module: 'token',
687
- function: 'spent_balance',
688
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
689
- typeArguments: options.typeArguments,
690
- });
691
- }
692
- export interface ValueOptions {
693
- package?: string;
694
- arguments: [RawTransactionArgument<string>];
695
- typeArguments: [string];
696
- }
697
- export function value(options: ValueOptions) {
698
- const packageAddress =
699
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
700
- const argumentsTypes = [null] satisfies (string | null)[];
701
- return (tx: Transaction) =>
702
- tx.moveCall({
703
- package: packageAddress,
704
- module: 'token',
705
- function: 'value',
706
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
707
- typeArguments: options.typeArguments,
708
- });
709
- }
710
- export interface TransferActionOptions {
711
- package?: string;
712
- arguments?: [];
713
- }
714
- export function transferAction(options: TransferActionOptions = {}) {
715
- const packageAddress =
716
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
717
- return (tx: Transaction) =>
718
- tx.moveCall({
719
- package: packageAddress,
720
- module: 'token',
721
- function: 'transfer_action',
722
- });
723
- }
724
- export interface SpendActionOptions {
725
- package?: string;
726
- arguments?: [];
727
- }
728
- export function spendAction(options: SpendActionOptions = {}) {
729
- const packageAddress =
730
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
731
- return (tx: Transaction) =>
732
- tx.moveCall({
733
- package: packageAddress,
734
- module: 'token',
735
- function: 'spend_action',
736
- });
737
- }
738
- export interface ToCoinActionOptions {
739
- package?: string;
740
- arguments?: [];
741
- }
742
- export function toCoinAction(options: ToCoinActionOptions = {}) {
743
- const packageAddress =
744
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
745
- return (tx: Transaction) =>
746
- tx.moveCall({
747
- package: packageAddress,
748
- module: 'token',
749
- function: 'to_coin_action',
750
- });
751
- }
752
- export interface FromCoinActionOptions {
753
- package?: string;
754
- arguments?: [];
755
- }
756
- export function fromCoinAction(options: FromCoinActionOptions = {}) {
757
- const packageAddress =
758
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
759
- return (tx: Transaction) =>
760
- tx.moveCall({
761
- package: packageAddress,
762
- module: 'token',
763
- function: 'from_coin_action',
764
- });
765
- }
766
- export interface ActionOptions {
767
- package?: string;
768
- arguments: [RawTransactionArgument<string>];
769
- typeArguments: [string];
770
- }
771
- export function action(options: ActionOptions) {
772
- const packageAddress =
773
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
774
- const argumentsTypes = [null] satisfies (string | null)[];
775
- return (tx: Transaction) =>
776
- tx.moveCall({
777
- package: packageAddress,
778
- module: 'token',
779
- function: 'action',
780
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
781
- typeArguments: options.typeArguments,
782
- });
783
- }
784
- export interface AmountOptions {
785
- package?: string;
786
- arguments: [RawTransactionArgument<string>];
787
- typeArguments: [string];
788
- }
789
- export function amount(options: AmountOptions) {
790
- const packageAddress =
791
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
792
- const argumentsTypes = [null] satisfies (string | null)[];
793
- return (tx: Transaction) =>
794
- tx.moveCall({
795
- package: packageAddress,
796
- module: 'token',
797
- function: 'amount',
798
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
799
- typeArguments: options.typeArguments,
800
- });
801
- }
802
- export interface SenderOptions {
803
- package?: string;
804
- arguments: [RawTransactionArgument<string>];
805
- typeArguments: [string];
806
- }
807
- export function sender(options: SenderOptions) {
808
- const packageAddress =
809
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
810
- const argumentsTypes = [null] satisfies (string | null)[];
811
- return (tx: Transaction) =>
812
- tx.moveCall({
813
- package: packageAddress,
814
- module: 'token',
815
- function: 'sender',
816
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
817
- typeArguments: options.typeArguments,
818
- });
819
- }
820
- export interface RecipientOptions {
821
- package?: string;
822
- arguments: [RawTransactionArgument<string>];
823
- typeArguments: [string];
824
- }
825
- export function recipient(options: RecipientOptions) {
826
- const packageAddress =
827
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
828
- const argumentsTypes = [null] satisfies (string | null)[];
829
- return (tx: Transaction) =>
830
- tx.moveCall({
831
- package: packageAddress,
832
- module: 'token',
833
- function: 'recipient',
834
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
835
- typeArguments: options.typeArguments,
836
- });
837
- }
838
- export interface ApprovalsOptions {
839
- package?: string;
840
- arguments: [RawTransactionArgument<string>];
841
- typeArguments: [string];
842
- }
843
- export function approvals(options: ApprovalsOptions) {
844
- const packageAddress =
845
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
846
- const argumentsTypes = [null] satisfies (string | null)[];
847
- return (tx: Transaction) =>
848
- tx.moveCall({
849
- package: packageAddress,
850
- module: 'token',
851
- function: 'approvals',
852
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
853
- typeArguments: options.typeArguments,
854
- });
855
- }
856
- export interface SpentOptions {
857
- package?: string;
858
- arguments: [RawTransactionArgument<string>];
859
- typeArguments: [string];
860
- }
861
- export function spent(options: SpentOptions) {
862
- const packageAddress =
863
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
864
- const argumentsTypes = [null] satisfies (string | null)[];
865
- return (tx: Transaction) =>
866
- tx.moveCall({
867
- package: packageAddress,
868
- module: 'token',
869
- function: 'spent',
870
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
871
- typeArguments: options.typeArguments,
872
- });
873
- }