@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,153 +0,0 @@
1
- /**************************************************************
2
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
- **************************************************************/
4
- import { type Transaction } from '@mysten/sui/transactions';
5
- import { normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
6
- export interface KeepOptions {
7
- package?: string;
8
- arguments: [RawTransactionArgument<string>];
9
- typeArguments: [string];
10
- }
11
- export function keep(options: KeepOptions) {
12
- const packageAddress =
13
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
14
- const argumentsTypes = [null] satisfies (string | null)[];
15
- return (tx: Transaction) =>
16
- tx.moveCall({
17
- package: packageAddress,
18
- module: 'pay',
19
- function: 'keep',
20
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
21
- typeArguments: options.typeArguments,
22
- });
23
- }
24
- export interface SplitOptions {
25
- package?: string;
26
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<number | bigint>];
27
- typeArguments: [string];
28
- }
29
- export function split(options: SplitOptions) {
30
- const packageAddress =
31
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
32
- const argumentsTypes = [null, 'u64'] satisfies (string | null)[];
33
- return (tx: Transaction) =>
34
- tx.moveCall({
35
- package: packageAddress,
36
- module: 'pay',
37
- function: 'split',
38
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
39
- typeArguments: options.typeArguments,
40
- });
41
- }
42
- export interface SplitVecOptions {
43
- package?: string;
44
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<number | bigint[]>];
45
- typeArguments: [string];
46
- }
47
- export function splitVec(options: SplitVecOptions) {
48
- const packageAddress =
49
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
50
- const argumentsTypes = [null, 'vector<u64>'] satisfies (string | null)[];
51
- return (tx: Transaction) =>
52
- tx.moveCall({
53
- package: packageAddress,
54
- module: 'pay',
55
- function: 'split_vec',
56
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
57
- typeArguments: options.typeArguments,
58
- });
59
- }
60
- export interface SplitAndTransferOptions {
61
- package?: string;
62
- arguments: [
63
- RawTransactionArgument<string>,
64
- RawTransactionArgument<number | bigint>,
65
- RawTransactionArgument<string>,
66
- ];
67
- typeArguments: [string];
68
- }
69
- export function splitAndTransfer(options: SplitAndTransferOptions) {
70
- const packageAddress =
71
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
72
- const argumentsTypes = [null, 'u64', 'address'] satisfies (string | null)[];
73
- return (tx: Transaction) =>
74
- tx.moveCall({
75
- package: packageAddress,
76
- module: 'pay',
77
- function: 'split_and_transfer',
78
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
79
- typeArguments: options.typeArguments,
80
- });
81
- }
82
- export interface DivideAndKeepOptions {
83
- package?: string;
84
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<number | bigint>];
85
- typeArguments: [string];
86
- }
87
- export function divideAndKeep(options: DivideAndKeepOptions) {
88
- const packageAddress =
89
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
90
- const argumentsTypes = [null, 'u64'] satisfies (string | null)[];
91
- return (tx: Transaction) =>
92
- tx.moveCall({
93
- package: packageAddress,
94
- module: 'pay',
95
- function: 'divide_and_keep',
96
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
97
- typeArguments: options.typeArguments,
98
- });
99
- }
100
- export interface JoinOptions {
101
- package?: string;
102
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
103
- typeArguments: [string];
104
- }
105
- export function join(options: JoinOptions) {
106
- const packageAddress =
107
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
108
- const argumentsTypes = [null, null] satisfies (string | null)[];
109
- return (tx: Transaction) =>
110
- tx.moveCall({
111
- package: packageAddress,
112
- module: 'pay',
113
- function: 'join',
114
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
115
- typeArguments: options.typeArguments,
116
- });
117
- }
118
- export interface JoinVecOptions {
119
- package?: string;
120
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<string[]>];
121
- typeArguments: [string];
122
- }
123
- export function joinVec(options: JoinVecOptions) {
124
- const packageAddress =
125
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
126
- const argumentsTypes = [null, 'vector<null>'] satisfies (string | null)[];
127
- return (tx: Transaction) =>
128
- tx.moveCall({
129
- package: packageAddress,
130
- module: 'pay',
131
- function: 'join_vec',
132
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
133
- typeArguments: options.typeArguments,
134
- });
135
- }
136
- export interface JoinVecAndTransferOptions {
137
- package?: string;
138
- arguments: [RawTransactionArgument<string[]>, RawTransactionArgument<string>];
139
- typeArguments: [string];
140
- }
141
- export function joinVecAndTransfer(options: JoinVecAndTransferOptions) {
142
- const packageAddress =
143
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
144
- const argumentsTypes = ['vector<null>', 'address'] satisfies (string | null)[];
145
- return (tx: Transaction) =>
146
- tx.moveCall({
147
- package: packageAddress,
148
- module: 'pay',
149
- function: 'join_vec_and_transfer',
150
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
151
- typeArguments: options.typeArguments,
152
- });
153
- }
@@ -1,21 +0,0 @@
1
- /**************************************************************
2
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
- **************************************************************/
4
- import { type Transaction } from '@mysten/sui/transactions';
5
- import { normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
6
- export interface PoseidonBn254Options {
7
- package?: string;
8
- arguments: [RawTransactionArgument<number | bigint[]>];
9
- }
10
- export function poseidonBn254(options: PoseidonBn254Options) {
11
- const packageAddress =
12
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
13
- const argumentsTypes = ['vector<u256>'] satisfies (string | null)[];
14
- return (tx: Transaction) =>
15
- tx.moveCall({
16
- package: packageAddress,
17
- module: 'poseidon',
18
- function: 'poseidon_bn254',
19
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
20
- });
21
- }
@@ -1,139 +0,0 @@
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, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
6
- import { type Transaction } from '@mysten/sui/transactions';
7
- const $moduleName = '0x2::priority_queue';
8
- export function Entry<T0 extends BcsType<any>>(...typeParameters: [T0]) {
9
- return new MoveStruct({
10
- name: `${$moduleName}::Entry<${typeParameters[0].name as T0['name']}>`,
11
- fields: {
12
- priority: bcs.u64(),
13
- value: typeParameters[0],
14
- },
15
- });
16
- }
17
- export function PriorityQueue<T0 extends BcsType<any>>(...typeParameters: [T0]) {
18
- return new MoveStruct({
19
- name: `${$moduleName}::PriorityQueue<${typeParameters[0].name as T0['name']}>`,
20
- fields: {
21
- entries: bcs.vector(Entry(typeParameters[0])),
22
- },
23
- });
24
- }
25
- export interface NewOptions {
26
- package?: string;
27
- arguments: [RawTransactionArgument<string[]>];
28
- typeArguments: [string];
29
- }
30
- export function _new(options: NewOptions) {
31
- const packageAddress =
32
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
33
- const argumentsTypes = ['vector<null>'] satisfies (string | null)[];
34
- return (tx: Transaction) =>
35
- tx.moveCall({
36
- package: packageAddress,
37
- module: 'priority_queue',
38
- function: 'new',
39
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
40
- typeArguments: options.typeArguments,
41
- });
42
- }
43
- export interface PopMaxOptions {
44
- package?: string;
45
- arguments: [RawTransactionArgument<string>];
46
- typeArguments: [string];
47
- }
48
- export function popMax(options: PopMaxOptions) {
49
- const packageAddress =
50
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
51
- const argumentsTypes = [null] satisfies (string | null)[];
52
- return (tx: Transaction) =>
53
- tx.moveCall({
54
- package: packageAddress,
55
- module: 'priority_queue',
56
- function: 'pop_max',
57
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
58
- typeArguments: options.typeArguments,
59
- });
60
- }
61
- export interface InsertOptions<T0 extends BcsType<any>> {
62
- package?: string;
63
- arguments: [
64
- RawTransactionArgument<string>,
65
- RawTransactionArgument<number | bigint>,
66
- RawTransactionArgument<T0>,
67
- ];
68
- typeArguments: [string];
69
- }
70
- export function insert<T0 extends BcsType<any>>(options: InsertOptions<T0>) {
71
- const packageAddress =
72
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
73
- const argumentsTypes = [null, 'u64', `${options.typeArguments[0]}`] satisfies (string | null)[];
74
- return (tx: Transaction) =>
75
- tx.moveCall({
76
- package: packageAddress,
77
- module: 'priority_queue',
78
- function: 'insert',
79
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
80
- typeArguments: options.typeArguments,
81
- });
82
- }
83
- export interface NewEntryOptions<T0 extends BcsType<any>> {
84
- package?: string;
85
- arguments: [RawTransactionArgument<number | bigint>, RawTransactionArgument<T0>];
86
- typeArguments: [string];
87
- }
88
- export function newEntry<T0 extends BcsType<any>>(options: NewEntryOptions<T0>) {
89
- const packageAddress =
90
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
91
- const argumentsTypes = ['u64', `${options.typeArguments[0]}`] satisfies (string | null)[];
92
- return (tx: Transaction) =>
93
- tx.moveCall({
94
- package: packageAddress,
95
- module: 'priority_queue',
96
- function: 'new_entry',
97
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
98
- typeArguments: options.typeArguments,
99
- });
100
- }
101
- export interface CreateEntriesOptions<T0 extends BcsType<any>> {
102
- package?: string;
103
- arguments: [RawTransactionArgument<number | bigint[]>, RawTransactionArgument<T0[]>];
104
- typeArguments: [string];
105
- }
106
- export function createEntries<T0 extends BcsType<any>>(options: CreateEntriesOptions<T0>) {
107
- const packageAddress =
108
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
109
- const argumentsTypes = ['vector<u64>', `vector<${options.typeArguments[0]}>`] satisfies (
110
- | string
111
- | null
112
- )[];
113
- return (tx: Transaction) =>
114
- tx.moveCall({
115
- package: packageAddress,
116
- module: 'priority_queue',
117
- function: 'create_entries',
118
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
119
- typeArguments: options.typeArguments,
120
- });
121
- }
122
- export interface PrioritiesOptions {
123
- package?: string;
124
- arguments: [RawTransactionArgument<string>];
125
- typeArguments: [string];
126
- }
127
- export function priorities(options: PrioritiesOptions) {
128
- const packageAddress =
129
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
130
- const argumentsTypes = [null] satisfies (string | null)[];
131
- return (tx: Transaction) =>
132
- tx.moveCall({
133
- package: packageAddress,
134
- module: 'priority_queue',
135
- function: 'priorities',
136
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
137
- typeArguments: options.typeArguments,
138
- });
139
- }
@@ -1,294 +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 versioned from './versioned.js';
8
- const $moduleName = '0x2::random';
9
- export const Random = new MoveStruct({
10
- name: `${$moduleName}::Random`,
11
- fields: {
12
- id: bcs.Address,
13
- inner: versioned.Versioned,
14
- },
15
- });
16
- export const RandomInner = new MoveStruct({
17
- name: `${$moduleName}::RandomInner`,
18
- fields: {
19
- version: bcs.u64(),
20
- epoch: bcs.u64(),
21
- randomness_round: bcs.u64(),
22
- random_bytes: bcs.vector(bcs.u8()),
23
- },
24
- });
25
- export const RandomGenerator = new MoveStruct({
26
- name: `${$moduleName}::RandomGenerator`,
27
- fields: {
28
- seed: bcs.vector(bcs.u8()),
29
- counter: bcs.u16(),
30
- buffer: bcs.vector(bcs.u8()),
31
- },
32
- });
33
- export interface NewGeneratorOptions {
34
- package?: string;
35
- arguments?: [];
36
- }
37
- export function newGenerator(options: NewGeneratorOptions = {}) {
38
- const packageAddress =
39
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
40
- const argumentsTypes = ['0x2::random::Random'] satisfies (string | null)[];
41
- return (tx: Transaction) =>
42
- tx.moveCall({
43
- package: packageAddress,
44
- module: 'random',
45
- function: 'new_generator',
46
- arguments: normalizeMoveArguments(options.arguments ?? [], argumentsTypes),
47
- });
48
- }
49
- export interface GenerateBytesOptions {
50
- package?: string;
51
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<number>];
52
- }
53
- export function generateBytes(options: GenerateBytesOptions) {
54
- const packageAddress =
55
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
56
- const argumentsTypes = [null, 'u16'] satisfies (string | null)[];
57
- return (tx: Transaction) =>
58
- tx.moveCall({
59
- package: packageAddress,
60
- module: 'random',
61
- function: 'generate_bytes',
62
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
63
- });
64
- }
65
- export interface GenerateU256Options {
66
- package?: string;
67
- arguments: [RawTransactionArgument<string>];
68
- }
69
- export function generateU256(options: GenerateU256Options) {
70
- const packageAddress =
71
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
72
- const argumentsTypes = [null] satisfies (string | null)[];
73
- return (tx: Transaction) =>
74
- tx.moveCall({
75
- package: packageAddress,
76
- module: 'random',
77
- function: 'generate_u256',
78
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
79
- });
80
- }
81
- export interface GenerateU128Options {
82
- package?: string;
83
- arguments: [RawTransactionArgument<string>];
84
- }
85
- export function generateU128(options: GenerateU128Options) {
86
- const packageAddress =
87
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
88
- const argumentsTypes = [null] satisfies (string | null)[];
89
- return (tx: Transaction) =>
90
- tx.moveCall({
91
- package: packageAddress,
92
- module: 'random',
93
- function: 'generate_u128',
94
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
95
- });
96
- }
97
- export interface GenerateU64Options {
98
- package?: string;
99
- arguments: [RawTransactionArgument<string>];
100
- }
101
- export function generateU64(options: GenerateU64Options) {
102
- const packageAddress =
103
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
104
- const argumentsTypes = [null] satisfies (string | null)[];
105
- return (tx: Transaction) =>
106
- tx.moveCall({
107
- package: packageAddress,
108
- module: 'random',
109
- function: 'generate_u64',
110
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
111
- });
112
- }
113
- export interface GenerateU32Options {
114
- package?: string;
115
- arguments: [RawTransactionArgument<string>];
116
- }
117
- export function generateU32(options: GenerateU32Options) {
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: 'random',
125
- function: 'generate_u32',
126
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
127
- });
128
- }
129
- export interface GenerateU16Options {
130
- package?: string;
131
- arguments: [RawTransactionArgument<string>];
132
- }
133
- export function generateU16(options: GenerateU16Options) {
134
- const packageAddress =
135
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
136
- const argumentsTypes = [null] satisfies (string | null)[];
137
- return (tx: Transaction) =>
138
- tx.moveCall({
139
- package: packageAddress,
140
- module: 'random',
141
- function: 'generate_u16',
142
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
143
- });
144
- }
145
- export interface GenerateU8Options {
146
- package?: string;
147
- arguments: [RawTransactionArgument<string>];
148
- }
149
- export function generateU8(options: GenerateU8Options) {
150
- const packageAddress =
151
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
152
- const argumentsTypes = [null] satisfies (string | null)[];
153
- return (tx: Transaction) =>
154
- tx.moveCall({
155
- package: packageAddress,
156
- module: 'random',
157
- function: 'generate_u8',
158
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
159
- });
160
- }
161
- export interface GenerateBoolOptions {
162
- package?: string;
163
- arguments: [RawTransactionArgument<string>];
164
- }
165
- export function generateBool(options: GenerateBoolOptions) {
166
- const packageAddress =
167
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
168
- const argumentsTypes = [null] satisfies (string | null)[];
169
- return (tx: Transaction) =>
170
- tx.moveCall({
171
- package: packageAddress,
172
- module: 'random',
173
- function: 'generate_bool',
174
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
175
- });
176
- }
177
- export interface GenerateU128InRangeOptions {
178
- package?: string;
179
- arguments: [
180
- RawTransactionArgument<string>,
181
- RawTransactionArgument<number | bigint>,
182
- RawTransactionArgument<number | bigint>,
183
- ];
184
- }
185
- export function generateU128InRange(options: GenerateU128InRangeOptions) {
186
- const packageAddress =
187
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
188
- const argumentsTypes = [null, 'u128', 'u128'] satisfies (string | null)[];
189
- return (tx: Transaction) =>
190
- tx.moveCall({
191
- package: packageAddress,
192
- module: 'random',
193
- function: 'generate_u128_in_range',
194
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
195
- });
196
- }
197
- export interface GenerateU64InRangeOptions {
198
- package?: string;
199
- arguments: [
200
- RawTransactionArgument<string>,
201
- RawTransactionArgument<number | bigint>,
202
- RawTransactionArgument<number | bigint>,
203
- ];
204
- }
205
- export function generateU64InRange(options: GenerateU64InRangeOptions) {
206
- const packageAddress =
207
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
208
- const argumentsTypes = [null, 'u64', 'u64'] satisfies (string | null)[];
209
- return (tx: Transaction) =>
210
- tx.moveCall({
211
- package: packageAddress,
212
- module: 'random',
213
- function: 'generate_u64_in_range',
214
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
215
- });
216
- }
217
- export interface GenerateU32InRangeOptions {
218
- package?: string;
219
- arguments: [
220
- RawTransactionArgument<string>,
221
- RawTransactionArgument<number>,
222
- RawTransactionArgument<number>,
223
- ];
224
- }
225
- export function generateU32InRange(options: GenerateU32InRangeOptions) {
226
- const packageAddress =
227
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
228
- const argumentsTypes = [null, 'u32', 'u32'] satisfies (string | null)[];
229
- return (tx: Transaction) =>
230
- tx.moveCall({
231
- package: packageAddress,
232
- module: 'random',
233
- function: 'generate_u32_in_range',
234
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
235
- });
236
- }
237
- export interface GenerateU16InRangeOptions {
238
- package?: string;
239
- arguments: [
240
- RawTransactionArgument<string>,
241
- RawTransactionArgument<number>,
242
- RawTransactionArgument<number>,
243
- ];
244
- }
245
- export function generateU16InRange(options: GenerateU16InRangeOptions) {
246
- const packageAddress =
247
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
248
- const argumentsTypes = [null, 'u16', 'u16'] satisfies (string | null)[];
249
- return (tx: Transaction) =>
250
- tx.moveCall({
251
- package: packageAddress,
252
- module: 'random',
253
- function: 'generate_u16_in_range',
254
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
255
- });
256
- }
257
- export interface GenerateU8InRangeOptions {
258
- package?: string;
259
- arguments: [
260
- RawTransactionArgument<string>,
261
- RawTransactionArgument<number>,
262
- RawTransactionArgument<number>,
263
- ];
264
- }
265
- export function generateU8InRange(options: GenerateU8InRangeOptions) {
266
- const packageAddress =
267
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
268
- const argumentsTypes = [null, 'u8', 'u8'] satisfies (string | null)[];
269
- return (tx: Transaction) =>
270
- tx.moveCall({
271
- package: packageAddress,
272
- module: 'random',
273
- function: 'generate_u8_in_range',
274
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
275
- });
276
- }
277
- export interface ShuffleOptions<T0 extends BcsType<any>> {
278
- package?: string;
279
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<T0[]>];
280
- typeArguments: [string];
281
- }
282
- export function shuffle<T0 extends BcsType<any>>(options: ShuffleOptions<T0>) {
283
- const packageAddress =
284
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
285
- const argumentsTypes = [null, `vector<${options.typeArguments[0]}>`] satisfies (string | null)[];
286
- return (tx: Transaction) =>
287
- tx.moveCall({
288
- package: packageAddress,
289
- module: 'random',
290
- function: 'shuffle',
291
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
292
- typeArguments: options.typeArguments,
293
- });
294
- }
@@ -1,29 +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 } from '@mysten/sui/bcs';
6
- import { type Transaction } from '@mysten/sui/transactions';
7
- const $moduleName = '0x2::sui';
8
- export const SUI = new MoveStruct({
9
- name: `${$moduleName}::SUI`,
10
- fields: {
11
- dummy_field: bcs.bool(),
12
- },
13
- });
14
- export interface TransferOptions {
15
- package?: string;
16
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
17
- }
18
- export function transfer(options: TransferOptions) {
19
- const packageAddress =
20
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
21
- const argumentsTypes = [null, 'address'] satisfies (string | null)[];
22
- return (tx: Transaction) =>
23
- tx.moveCall({
24
- package: packageAddress,
25
- module: 'sui',
26
- function: 'transfer',
27
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
28
- });
29
- }