@mysten/kiosk 0.14.6 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/CHANGELOG.md +105 -2
  2. package/dist/client/kiosk-client.d.mts +126 -0
  3. package/dist/client/kiosk-client.d.mts.map +1 -0
  4. package/dist/client/kiosk-client.mjs +124 -0
  5. package/dist/client/kiosk-client.mjs.map +1 -0
  6. package/dist/client/kiosk-transaction.d.mts +236 -0
  7. package/dist/client/kiosk-transaction.d.mts.map +1 -0
  8. package/dist/client/kiosk-transaction.mjs +472 -0
  9. package/dist/client/kiosk-transaction.mjs.map +1 -0
  10. package/dist/client/tp-transaction.d.mts +139 -0
  11. package/dist/client/tp-transaction.d.mts.map +1 -0
  12. package/dist/client/tp-transaction.mjs +273 -0
  13. package/dist/client/tp-transaction.mjs.map +1 -0
  14. package/dist/constants.d.mts +42 -0
  15. package/dist/constants.d.mts.map +1 -0
  16. package/dist/constants.mjs +62 -0
  17. package/dist/constants.mjs.map +1 -0
  18. package/dist/contracts/0x2/bag.mjs +19 -0
  19. package/dist/contracts/0x2/bag.mjs.map +1 -0
  20. package/dist/contracts/0x2/balance.mjs +20 -0
  21. package/dist/contracts/0x2/balance.mjs.map +1 -0
  22. package/dist/contracts/0x2/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.mjs +16 -0
  23. package/dist/contracts/0x2/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.mjs.map +1 -0
  24. package/dist/contracts/0x2/kiosk.mjs +244 -0
  25. package/dist/contracts/0x2/kiosk.mjs.map +1 -0
  26. package/dist/contracts/0x2/kiosk_extension.mjs +25 -0
  27. package/dist/contracts/0x2/kiosk_extension.mjs.map +1 -0
  28. package/dist/contracts/0x2/transfer_policy.mjs +99 -0
  29. package/dist/contracts/0x2/transfer_policy.mjs.map +1 -0
  30. package/dist/contracts/0x2/vec_set.mjs +18 -0
  31. package/dist/contracts/0x2/vec_set.mjs.map +1 -0
  32. package/dist/contracts/kiosk/deps/sui/kiosk.mjs +98 -0
  33. package/dist/contracts/kiosk/deps/sui/kiosk.mjs.map +1 -0
  34. package/dist/contracts/kiosk/floor_price_rule.mjs +70 -0
  35. package/dist/contracts/kiosk/floor_price_rule.mjs.map +1 -0
  36. package/dist/contracts/kiosk/kiosk_lock_rule.mjs +72 -0
  37. package/dist/contracts/kiosk/kiosk_lock_rule.mjs.map +1 -0
  38. package/dist/contracts/kiosk/personal_kiosk.mjs +102 -0
  39. package/dist/contracts/kiosk/personal_kiosk.mjs.map +1 -0
  40. package/dist/contracts/kiosk/personal_kiosk_rule.mjs +66 -0
  41. package/dist/contracts/kiosk/personal_kiosk_rule.mjs.map +1 -0
  42. package/dist/contracts/kiosk/royalty_rule.mjs +115 -0
  43. package/dist/contracts/kiosk/royalty_rule.mjs.map +1 -0
  44. package/dist/contracts/utils/index.mjs +118 -0
  45. package/dist/contracts/utils/index.mjs.map +1 -0
  46. package/dist/index.d.mts +9 -0
  47. package/dist/index.mjs +9 -0
  48. package/dist/query/client-utils.mjs +30 -0
  49. package/dist/query/client-utils.mjs.map +1 -0
  50. package/dist/query/kiosk.mjs +154 -0
  51. package/dist/query/kiosk.mjs.map +1 -0
  52. package/dist/query/transfer-policy.mjs +110 -0
  53. package/dist/query/transfer-policy.mjs.map +1 -0
  54. package/dist/tx/kiosk.mjs +20 -0
  55. package/dist/tx/kiosk.mjs.map +1 -0
  56. package/dist/tx/rules/resolve.mjs +114 -0
  57. package/dist/tx/rules/resolve.mjs.map +1 -0
  58. package/dist/tx/transfer-policy.mjs +38 -0
  59. package/dist/tx/transfer-policy.mjs.map +1 -0
  60. package/dist/types/index.d.mts +23 -0
  61. package/dist/types/index.d.mts.map +1 -0
  62. package/dist/types/kiosk.d.mts +165 -0
  63. package/dist/types/kiosk.d.mts.map +1 -0
  64. package/dist/types/kiosk.mjs +21 -0
  65. package/dist/types/kiosk.mjs.map +1 -0
  66. package/dist/types/transfer-policy.d.mts +56 -0
  67. package/dist/types/transfer-policy.d.mts.map +1 -0
  68. package/dist/types/transfer-policy.mjs +19 -0
  69. package/dist/types/transfer-policy.mjs.map +1 -0
  70. package/dist/utils.d.mts +45 -0
  71. package/dist/utils.d.mts.map +1 -0
  72. package/dist/utils.mjs +156 -0
  73. package/dist/utils.mjs.map +1 -0
  74. package/package.json +31 -20
  75. package/src/client/kiosk-client.ts +42 -5
  76. package/src/client/kiosk-transaction.ts +144 -65
  77. package/src/client/tp-transaction.ts +149 -95
  78. package/src/constants.ts +19 -24
  79. package/src/contracts/0x2/accumulator.ts +24 -0
  80. package/src/contracts/0x2/accumulator_metadata.ts +38 -0
  81. package/src/contracts/0x2/accumulator_settlement.ts +14 -0
  82. package/src/contracts/0x2/address.ts +145 -0
  83. package/src/contracts/0x2/address_alias.ts +92 -0
  84. package/src/contracts/0x2/authenticator_state.ts +44 -0
  85. package/src/contracts/0x2/bag.ts +192 -0
  86. package/src/contracts/0x2/balance.ts +269 -0
  87. package/src/contracts/0x2/bcs.ts +495 -0
  88. package/src/contracts/0x2/bls12381.ts +717 -0
  89. package/src/contracts/0x2/borrow.ts +99 -0
  90. package/src/contracts/0x2/clock.ts +30 -0
  91. package/src/contracts/0x2/coin.ts +977 -0
  92. package/src/contracts/0x2/coin_registry.ts +874 -0
  93. package/src/contracts/0x2/config.ts +30 -0
  94. package/src/contracts/0x2/deny_list.ts +55 -0
  95. package/src/contracts/0x2/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.ts +12 -0
  96. package/src/contracts/0x2/derived_object.ts +95 -0
  97. package/src/contracts/0x2/display.ts +258 -0
  98. package/src/contracts/0x2/dynamic_field.ts +171 -0
  99. package/src/contracts/0x2/dynamic_object_field.ts +167 -0
  100. package/src/contracts/0x2/ecdsa_k1.ts +65 -0
  101. package/src/contracts/0x2/ecdsa_r1.ts +49 -0
  102. package/src/contracts/0x2/ecvrf.ts +29 -0
  103. package/src/contracts/0x2/ed25519.ts +25 -0
  104. package/src/contracts/0x2/event.ts +42 -0
  105. package/src/contracts/0x2/funds_accumulator.ts +86 -0
  106. package/src/contracts/0x2/groth16.ts +171 -0
  107. package/src/contracts/0x2/group_ops.ts +49 -0
  108. package/src/contracts/0x2/hash.ts +37 -0
  109. package/src/contracts/0x2/hex.ts +37 -0
  110. package/src/contracts/0x2/hmac.ts +21 -0
  111. package/src/contracts/0x2/kiosk.ts +797 -0
  112. package/src/contracts/0x2/kiosk_extension.ts +270 -0
  113. package/src/contracts/0x2/linked_table.ts +354 -0
  114. package/src/contracts/0x2/math.ts +117 -0
  115. package/src/contracts/0x2/nitro_attestation.ts +186 -0
  116. package/src/contracts/0x2/object.ts +249 -0
  117. package/src/contracts/0x2/object_bag.ts +210 -0
  118. package/src/contracts/0x2/object_table.ts +200 -0
  119. package/src/contracts/0x2/package.ts +414 -0
  120. package/src/contracts/0x2/party.ts +37 -0
  121. package/src/contracts/0x2/pay.ts +153 -0
  122. package/src/contracts/0x2/poseidon.ts +21 -0
  123. package/src/contracts/0x2/priority_queue.ts +139 -0
  124. package/src/contracts/0x2/random.ts +294 -0
  125. package/src/contracts/0x2/sui.ts +29 -0
  126. package/src/contracts/0x2/table.ts +200 -0
  127. package/src/contracts/0x2/table_vec.ts +232 -0
  128. package/src/contracts/0x2/token.ts +873 -0
  129. package/src/contracts/0x2/transfer.ts +216 -0
  130. package/src/contracts/0x2/transfer_policy.ts +400 -0
  131. package/src/contracts/0x2/tx_context.ts +129 -0
  132. package/src/contracts/0x2/types.ts +24 -0
  133. package/src/contracts/0x2/url.ts +77 -0
  134. package/src/contracts/0x2/vdf.ts +45 -0
  135. package/src/contracts/0x2/vec_map.ts +401 -0
  136. package/src/contracts/0x2/vec_set.ts +211 -0
  137. package/src/contracts/0x2/versioned.ts +153 -0
  138. package/src/contracts/0x2/zklogin_verified_id.ts +172 -0
  139. package/src/contracts/0x2/zklogin_verified_issuer.ts +99 -0
  140. package/src/contracts/kiosk/deps/sui/kiosk.ts +94 -0
  141. package/src/contracts/kiosk/deps/sui/object.ts +15 -0
  142. package/src/contracts/kiosk/floor_price_rule.ts +92 -0
  143. package/src/contracts/kiosk/kiosk_lock_rule.ts +97 -0
  144. package/src/contracts/kiosk/personal_kiosk.ts +295 -0
  145. package/src/contracts/kiosk/personal_kiosk_rule.ts +89 -0
  146. package/src/contracts/kiosk/royalty_rule.ts +144 -0
  147. package/src/contracts/kiosk/witness_rule.ts +92 -0
  148. package/src/contracts/utils/index.ts +234 -0
  149. package/src/query/client-utils.ts +51 -0
  150. package/src/query/kiosk.ts +128 -100
  151. package/src/query/transfer-policy.ts +112 -78
  152. package/src/tx/kiosk.ts +7 -231
  153. package/src/tx/rules/resolve.ts +97 -48
  154. package/src/tx/transfer-policy.ts +25 -86
  155. package/src/types/index.ts +3 -14
  156. package/src/types/kiosk.ts +10 -12
  157. package/src/types/transfer-policy.ts +4 -4
  158. package/src/utils.ts +90 -128
  159. package/dist/cjs/bcs.d.ts +0 -23
  160. package/dist/cjs/bcs.js +0 -50
  161. package/dist/cjs/bcs.js.map +0 -7
  162. package/dist/cjs/client/kiosk-client.d.ts +0 -76
  163. package/dist/cjs/client/kiosk-client.js +0 -123
  164. package/dist/cjs/client/kiosk-client.js.map +0 -7
  165. package/dist/cjs/client/kiosk-transaction.d.ts +0 -186
  166. package/dist/cjs/client/kiosk-transaction.js +0 -462
  167. package/dist/cjs/client/kiosk-transaction.js.map +0 -7
  168. package/dist/cjs/client/tp-transaction.d.ts +0 -114
  169. package/dist/cjs/client/tp-transaction.js +0 -307
  170. package/dist/cjs/client/tp-transaction.js.map +0 -7
  171. package/dist/cjs/constants.d.ts +0 -31
  172. package/dist/cjs/constants.js +0 -102
  173. package/dist/cjs/constants.js.map +0 -7
  174. package/dist/cjs/index.d.ts +0 -6
  175. package/dist/cjs/index.js +0 -24
  176. package/dist/cjs/index.js.map +0 -7
  177. package/dist/cjs/package.json +0 -5
  178. package/dist/cjs/query/kiosk.d.ts +0 -8
  179. package/dist/cjs/query/kiosk.js +0 -181
  180. package/dist/cjs/query/kiosk.js.map +0 -7
  181. package/dist/cjs/query/transfer-policy.d.ts +0 -29
  182. package/dist/cjs/query/transfer-policy.js +0 -92
  183. package/dist/cjs/query/transfer-policy.js.map +0 -7
  184. package/dist/cjs/tx/kiosk.d.ts +0 -71
  185. package/dist/cjs/tx/kiosk.js +0 -130
  186. package/dist/cjs/tx/kiosk.js.map +0 -7
  187. package/dist/cjs/tx/personal-kiosk.d.ts +0 -7
  188. package/dist/cjs/tx/personal-kiosk.js +0 -38
  189. package/dist/cjs/tx/personal-kiosk.js.map +0 -7
  190. package/dist/cjs/tx/rules/attach.d.ts +0 -7
  191. package/dist/cjs/tx/rules/attach.js +0 -62
  192. package/dist/cjs/tx/rules/attach.js.map +0 -7
  193. package/dist/cjs/tx/rules/resolve.d.ts +0 -15
  194. package/dist/cjs/tx/rules/resolve.js +0 -109
  195. package/dist/cjs/tx/rules/resolve.js.map +0 -7
  196. package/dist/cjs/tx/transfer-policy.d.ts +0 -29
  197. package/dist/cjs/tx/transfer-policy.js +0 -78
  198. package/dist/cjs/tx/transfer-policy.js.map +0 -7
  199. package/dist/cjs/types/index.d.ts +0 -27
  200. package/dist/cjs/types/index.js +0 -33
  201. package/dist/cjs/types/index.js.map +0 -7
  202. package/dist/cjs/types/kiosk.d.ts +0 -160
  203. package/dist/cjs/types/kiosk.js +0 -37
  204. package/dist/cjs/types/kiosk.js.map +0 -7
  205. package/dist/cjs/types/transfer-policy.d.ts +0 -53
  206. package/dist/cjs/types/transfer-policy.js +0 -35
  207. package/dist/cjs/types/transfer-policy.js.map +0 -7
  208. package/dist/cjs/utils.d.ts +0 -51
  209. package/dist/cjs/utils.js +0 -198
  210. package/dist/cjs/utils.js.map +0 -7
  211. package/dist/esm/bcs.d.ts +0 -23
  212. package/dist/esm/bcs.js +0 -35
  213. package/dist/esm/bcs.js.map +0 -7
  214. package/dist/esm/client/kiosk-client.d.ts +0 -76
  215. package/dist/esm/client/kiosk-client.js +0 -114
  216. package/dist/esm/client/kiosk-client.js.map +0 -7
  217. package/dist/esm/client/kiosk-transaction.d.ts +0 -186
  218. package/dist/esm/client/kiosk-transaction.js +0 -432
  219. package/dist/esm/client/kiosk-transaction.js.map +0 -7
  220. package/dist/esm/client/tp-transaction.d.ts +0 -114
  221. package/dist/esm/client/tp-transaction.js +0 -298
  222. package/dist/esm/client/tp-transaction.js.map +0 -7
  223. package/dist/esm/constants.d.ts +0 -31
  224. package/dist/esm/constants.js +0 -87
  225. package/dist/esm/constants.js.map +0 -7
  226. package/dist/esm/index.d.ts +0 -6
  227. package/dist/esm/index.js +0 -7
  228. package/dist/esm/index.js.map +0 -7
  229. package/dist/esm/package.json +0 -5
  230. package/dist/esm/query/kiosk.d.ts +0 -8
  231. package/dist/esm/query/kiosk.js +0 -169
  232. package/dist/esm/query/kiosk.js.map +0 -7
  233. package/dist/esm/query/transfer-policy.d.ts +0 -29
  234. package/dist/esm/query/transfer-policy.js +0 -76
  235. package/dist/esm/query/transfer-policy.js.map +0 -7
  236. package/dist/esm/tx/kiosk.d.ts +0 -71
  237. package/dist/esm/tx/kiosk.js +0 -110
  238. package/dist/esm/tx/kiosk.js.map +0 -7
  239. package/dist/esm/tx/personal-kiosk.d.ts +0 -7
  240. package/dist/esm/tx/personal-kiosk.js +0 -18
  241. package/dist/esm/tx/personal-kiosk.js.map +0 -7
  242. package/dist/esm/tx/rules/attach.d.ts +0 -7
  243. package/dist/esm/tx/rules/attach.js +0 -42
  244. package/dist/esm/tx/rules/attach.js.map +0 -7
  245. package/dist/esm/tx/rules/resolve.d.ts +0 -15
  246. package/dist/esm/tx/rules/resolve.js +0 -89
  247. package/dist/esm/tx/rules/resolve.js.map +0 -7
  248. package/dist/esm/tx/transfer-policy.d.ts +0 -29
  249. package/dist/esm/tx/transfer-policy.js +0 -58
  250. package/dist/esm/tx/transfer-policy.js.map +0 -7
  251. package/dist/esm/types/index.d.ts +0 -27
  252. package/dist/esm/types/index.js +0 -12
  253. package/dist/esm/types/index.js.map +0 -7
  254. package/dist/esm/types/kiosk.d.ts +0 -160
  255. package/dist/esm/types/kiosk.js +0 -17
  256. package/dist/esm/types/kiosk.js.map +0 -7
  257. package/dist/esm/types/transfer-policy.d.ts +0 -53
  258. package/dist/esm/types/transfer-policy.js +0 -15
  259. package/dist/esm/types/transfer-policy.js.map +0 -7
  260. package/dist/esm/utils.d.ts +0 -51
  261. package/dist/esm/utils.js +0 -183
  262. package/dist/esm/utils.js.map +0 -7
  263. package/dist/tsconfig.esm.tsbuildinfo +0 -1
  264. package/dist/tsconfig.tsbuildinfo +0 -1
  265. package/src/bcs.ts +0 -39
  266. package/src/tx/personal-kiosk.ts +0 -34
  267. package/src/tx/rules/attach.ts +0 -73
@@ -0,0 +1,270 @@
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 bag from './bag.js';
8
+ const $moduleName = '0x2::kiosk_extension';
9
+ export const Extension = new MoveStruct({
10
+ name: `${$moduleName}::Extension`,
11
+ fields: {
12
+ storage: bag.Bag,
13
+ permissions: bcs.u128(),
14
+ is_enabled: bcs.bool(),
15
+ },
16
+ });
17
+ export const ExtensionKey = new MoveStruct({
18
+ name: `${$moduleName}::ExtensionKey`,
19
+ fields: {
20
+ dummy_field: bcs.bool(),
21
+ },
22
+ });
23
+ export interface AddOptions<T0 extends BcsType<any>> {
24
+ package?: string;
25
+ arguments: [
26
+ RawTransactionArgument<T0>,
27
+ RawTransactionArgument<string>,
28
+ RawTransactionArgument<string>,
29
+ RawTransactionArgument<number | bigint>,
30
+ ];
31
+ typeArguments: [string];
32
+ }
33
+ export function add<T0 extends BcsType<any>>(options: AddOptions<T0>) {
34
+ const packageAddress =
35
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
36
+ const argumentsTypes = [`${options.typeArguments[0]}`, null, null, 'u128'] satisfies (
37
+ | string
38
+ | null
39
+ )[];
40
+ return (tx: Transaction) =>
41
+ tx.moveCall({
42
+ package: packageAddress,
43
+ module: 'kiosk_extension',
44
+ function: 'add',
45
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
46
+ typeArguments: options.typeArguments,
47
+ });
48
+ }
49
+ export interface DisableOptions {
50
+ package?: string;
51
+ arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
52
+ typeArguments: [string];
53
+ }
54
+ export function disable(options: DisableOptions) {
55
+ const packageAddress =
56
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
57
+ const argumentsTypes = [null, null] satisfies (string | null)[];
58
+ return (tx: Transaction) =>
59
+ tx.moveCall({
60
+ package: packageAddress,
61
+ module: 'kiosk_extension',
62
+ function: 'disable',
63
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
64
+ typeArguments: options.typeArguments,
65
+ });
66
+ }
67
+ export interface EnableOptions {
68
+ package?: string;
69
+ arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
70
+ typeArguments: [string];
71
+ }
72
+ export function enable(options: EnableOptions) {
73
+ const packageAddress =
74
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
75
+ const argumentsTypes = [null, null] satisfies (string | null)[];
76
+ return (tx: Transaction) =>
77
+ tx.moveCall({
78
+ package: packageAddress,
79
+ module: 'kiosk_extension',
80
+ function: 'enable',
81
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
82
+ typeArguments: options.typeArguments,
83
+ });
84
+ }
85
+ export interface RemoveOptions {
86
+ package?: string;
87
+ arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
88
+ typeArguments: [string];
89
+ }
90
+ export function remove(options: RemoveOptions) {
91
+ const packageAddress =
92
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
93
+ const argumentsTypes = [null, null] satisfies (string | null)[];
94
+ return (tx: Transaction) =>
95
+ tx.moveCall({
96
+ package: packageAddress,
97
+ module: 'kiosk_extension',
98
+ function: 'remove',
99
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
100
+ typeArguments: options.typeArguments,
101
+ });
102
+ }
103
+ export interface StorageOptions<T0 extends BcsType<any>> {
104
+ package?: string;
105
+ arguments: [RawTransactionArgument<T0>, RawTransactionArgument<string>];
106
+ typeArguments: [string];
107
+ }
108
+ export function storage<T0 extends BcsType<any>>(options: StorageOptions<T0>) {
109
+ const packageAddress =
110
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
111
+ const argumentsTypes = [`${options.typeArguments[0]}`, null] satisfies (string | null)[];
112
+ return (tx: Transaction) =>
113
+ tx.moveCall({
114
+ package: packageAddress,
115
+ module: 'kiosk_extension',
116
+ function: 'storage',
117
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
118
+ typeArguments: options.typeArguments,
119
+ });
120
+ }
121
+ export interface StorageMutOptions<T0 extends BcsType<any>> {
122
+ package?: string;
123
+ arguments: [RawTransactionArgument<T0>, RawTransactionArgument<string>];
124
+ typeArguments: [string];
125
+ }
126
+ export function storageMut<T0 extends BcsType<any>>(options: StorageMutOptions<T0>) {
127
+ const packageAddress =
128
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
129
+ const argumentsTypes = [`${options.typeArguments[0]}`, null] satisfies (string | null)[];
130
+ return (tx: Transaction) =>
131
+ tx.moveCall({
132
+ package: packageAddress,
133
+ module: 'kiosk_extension',
134
+ function: 'storage_mut',
135
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
136
+ typeArguments: options.typeArguments,
137
+ });
138
+ }
139
+ export interface PlaceOptions<T0 extends BcsType<any>, T1 extends BcsType<any>> {
140
+ package?: string;
141
+ arguments: [
142
+ RawTransactionArgument<T0>,
143
+ RawTransactionArgument<string>,
144
+ RawTransactionArgument<T1>,
145
+ RawTransactionArgument<string>,
146
+ ];
147
+ typeArguments: [string, string];
148
+ }
149
+ export function place<T0 extends BcsType<any>, T1 extends BcsType<any>>(
150
+ options: PlaceOptions<T0, T1>,
151
+ ) {
152
+ const packageAddress =
153
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
154
+ const argumentsTypes = [
155
+ `${options.typeArguments[0]}`,
156
+ null,
157
+ `${options.typeArguments[1]}`,
158
+ null,
159
+ ] satisfies (string | null)[];
160
+ return (tx: Transaction) =>
161
+ tx.moveCall({
162
+ package: packageAddress,
163
+ module: 'kiosk_extension',
164
+ function: 'place',
165
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
166
+ typeArguments: options.typeArguments,
167
+ });
168
+ }
169
+ export interface LockOptions<T0 extends BcsType<any>, T1 extends BcsType<any>> {
170
+ package?: string;
171
+ arguments: [
172
+ RawTransactionArgument<T0>,
173
+ RawTransactionArgument<string>,
174
+ RawTransactionArgument<T1>,
175
+ RawTransactionArgument<string>,
176
+ ];
177
+ typeArguments: [string, string];
178
+ }
179
+ export function lock<T0 extends BcsType<any>, T1 extends BcsType<any>>(
180
+ options: LockOptions<T0, T1>,
181
+ ) {
182
+ const packageAddress =
183
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
184
+ const argumentsTypes = [
185
+ `${options.typeArguments[0]}`,
186
+ null,
187
+ `${options.typeArguments[1]}`,
188
+ null,
189
+ ] satisfies (string | null)[];
190
+ return (tx: Transaction) =>
191
+ tx.moveCall({
192
+ package: packageAddress,
193
+ module: 'kiosk_extension',
194
+ function: 'lock',
195
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
196
+ typeArguments: options.typeArguments,
197
+ });
198
+ }
199
+ export interface IsInstalledOptions {
200
+ package?: string;
201
+ arguments: [RawTransactionArgument<string>];
202
+ typeArguments: [string];
203
+ }
204
+ export function isInstalled(options: IsInstalledOptions) {
205
+ const packageAddress =
206
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
207
+ const argumentsTypes = [null] satisfies (string | null)[];
208
+ return (tx: Transaction) =>
209
+ tx.moveCall({
210
+ package: packageAddress,
211
+ module: 'kiosk_extension',
212
+ function: 'is_installed',
213
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
214
+ typeArguments: options.typeArguments,
215
+ });
216
+ }
217
+ export interface IsEnabledOptions {
218
+ package?: string;
219
+ arguments: [RawTransactionArgument<string>];
220
+ typeArguments: [string];
221
+ }
222
+ export function isEnabled(options: IsEnabledOptions) {
223
+ const packageAddress =
224
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
225
+ const argumentsTypes = [null] satisfies (string | null)[];
226
+ return (tx: Transaction) =>
227
+ tx.moveCall({
228
+ package: packageAddress,
229
+ module: 'kiosk_extension',
230
+ function: 'is_enabled',
231
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
232
+ typeArguments: options.typeArguments,
233
+ });
234
+ }
235
+ export interface CanPlaceOptions {
236
+ package?: string;
237
+ arguments: [RawTransactionArgument<string>];
238
+ typeArguments: [string];
239
+ }
240
+ export function canPlace(options: CanPlaceOptions) {
241
+ const packageAddress =
242
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
243
+ const argumentsTypes = [null] satisfies (string | null)[];
244
+ return (tx: Transaction) =>
245
+ tx.moveCall({
246
+ package: packageAddress,
247
+ module: 'kiosk_extension',
248
+ function: 'can_place',
249
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
250
+ typeArguments: options.typeArguments,
251
+ });
252
+ }
253
+ export interface CanLockOptions {
254
+ package?: string;
255
+ arguments: [RawTransactionArgument<string>];
256
+ typeArguments: [string];
257
+ }
258
+ export function canLock(options: CanLockOptions) {
259
+ const packageAddress =
260
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
261
+ const argumentsTypes = [null] satisfies (string | null)[];
262
+ return (tx: Transaction) =>
263
+ tx.moveCall({
264
+ package: packageAddress,
265
+ module: 'kiosk_extension',
266
+ function: 'can_lock',
267
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
268
+ typeArguments: options.typeArguments,
269
+ });
270
+ }
@@ -0,0 +1,354 @@
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::linked_table';
8
+ export function LinkedTable<T0 extends BcsType<any>>(...typeParameters: [T0]) {
9
+ return new MoveStruct({
10
+ name: `${$moduleName}::LinkedTable<${typeParameters[0].name as T0['name']}>`,
11
+ fields: {
12
+ id: bcs.Address,
13
+ size: bcs.u64(),
14
+ head: bcs.option(typeParameters[0]),
15
+ tail: bcs.option(typeParameters[0]),
16
+ },
17
+ });
18
+ }
19
+ export function Node<T0 extends BcsType<any>, T1 extends BcsType<any>>(
20
+ ...typeParameters: [T0, T1]
21
+ ) {
22
+ return new MoveStruct({
23
+ name: `${$moduleName}::Node<${typeParameters[0].name as T0['name']}, ${typeParameters[1].name as T1['name']}>`,
24
+ fields: {
25
+ prev: bcs.option(typeParameters[0]),
26
+ next: bcs.option(typeParameters[0]),
27
+ value: typeParameters[1],
28
+ },
29
+ });
30
+ }
31
+ export interface NewOptions {
32
+ package?: string;
33
+ arguments?: [];
34
+ typeArguments: [string, string];
35
+ }
36
+ export function _new(options: NewOptions) {
37
+ const packageAddress =
38
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
39
+ return (tx: Transaction) =>
40
+ tx.moveCall({
41
+ package: packageAddress,
42
+ module: 'linked_table',
43
+ function: 'new',
44
+ typeArguments: options.typeArguments,
45
+ });
46
+ }
47
+ export interface FrontOptions {
48
+ package?: string;
49
+ arguments: [RawTransactionArgument<string>];
50
+ typeArguments: [string, string];
51
+ }
52
+ export function front(options: FrontOptions) {
53
+ const packageAddress =
54
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
55
+ const argumentsTypes = [null] satisfies (string | null)[];
56
+ return (tx: Transaction) =>
57
+ tx.moveCall({
58
+ package: packageAddress,
59
+ module: 'linked_table',
60
+ function: 'front',
61
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
62
+ typeArguments: options.typeArguments,
63
+ });
64
+ }
65
+ export interface BackOptions {
66
+ package?: string;
67
+ arguments: [RawTransactionArgument<string>];
68
+ typeArguments: [string, string];
69
+ }
70
+ export function back(options: BackOptions) {
71
+ const packageAddress =
72
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
73
+ const argumentsTypes = [null] satisfies (string | null)[];
74
+ return (tx: Transaction) =>
75
+ tx.moveCall({
76
+ package: packageAddress,
77
+ module: 'linked_table',
78
+ function: 'back',
79
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
80
+ typeArguments: options.typeArguments,
81
+ });
82
+ }
83
+ export interface PushFrontOptions<T0 extends BcsType<any>, T1 extends BcsType<any>> {
84
+ package?: string;
85
+ arguments: [
86
+ RawTransactionArgument<string>,
87
+ RawTransactionArgument<T0>,
88
+ RawTransactionArgument<T1>,
89
+ ];
90
+ typeArguments: [string, string];
91
+ }
92
+ export function pushFront<T0 extends BcsType<any>, T1 extends BcsType<any>>(
93
+ options: PushFrontOptions<T0, T1>,
94
+ ) {
95
+ const packageAddress =
96
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
97
+ const argumentsTypes = [
98
+ null,
99
+ `${options.typeArguments[0]}`,
100
+ `${options.typeArguments[1]}`,
101
+ ] satisfies (string | null)[];
102
+ return (tx: Transaction) =>
103
+ tx.moveCall({
104
+ package: packageAddress,
105
+ module: 'linked_table',
106
+ function: 'push_front',
107
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
108
+ typeArguments: options.typeArguments,
109
+ });
110
+ }
111
+ export interface PushBackOptions<T0 extends BcsType<any>, T1 extends BcsType<any>> {
112
+ package?: string;
113
+ arguments: [
114
+ RawTransactionArgument<string>,
115
+ RawTransactionArgument<T0>,
116
+ RawTransactionArgument<T1>,
117
+ ];
118
+ typeArguments: [string, string];
119
+ }
120
+ export function pushBack<T0 extends BcsType<any>, T1 extends BcsType<any>>(
121
+ options: PushBackOptions<T0, T1>,
122
+ ) {
123
+ const packageAddress =
124
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
125
+ const argumentsTypes = [
126
+ null,
127
+ `${options.typeArguments[0]}`,
128
+ `${options.typeArguments[1]}`,
129
+ ] satisfies (string | null)[];
130
+ return (tx: Transaction) =>
131
+ tx.moveCall({
132
+ package: packageAddress,
133
+ module: 'linked_table',
134
+ function: 'push_back',
135
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
136
+ typeArguments: options.typeArguments,
137
+ });
138
+ }
139
+ export interface BorrowOptions<T0 extends BcsType<any>> {
140
+ package?: string;
141
+ arguments: [RawTransactionArgument<string>, RawTransactionArgument<T0>];
142
+ typeArguments: [string, string];
143
+ }
144
+ export function borrow<T0 extends BcsType<any>>(options: BorrowOptions<T0>) {
145
+ const packageAddress =
146
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
147
+ const argumentsTypes = [null, `${options.typeArguments[0]}`] satisfies (string | null)[];
148
+ return (tx: Transaction) =>
149
+ tx.moveCall({
150
+ package: packageAddress,
151
+ module: 'linked_table',
152
+ function: 'borrow',
153
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
154
+ typeArguments: options.typeArguments,
155
+ });
156
+ }
157
+ export interface BorrowMutOptions<T0 extends BcsType<any>> {
158
+ package?: string;
159
+ arguments: [RawTransactionArgument<string>, RawTransactionArgument<T0>];
160
+ typeArguments: [string, string];
161
+ }
162
+ export function borrowMut<T0 extends BcsType<any>>(options: BorrowMutOptions<T0>) {
163
+ const packageAddress =
164
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
165
+ const argumentsTypes = [null, `${options.typeArguments[0]}`] satisfies (string | null)[];
166
+ return (tx: Transaction) =>
167
+ tx.moveCall({
168
+ package: packageAddress,
169
+ module: 'linked_table',
170
+ function: 'borrow_mut',
171
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
172
+ typeArguments: options.typeArguments,
173
+ });
174
+ }
175
+ export interface PrevOptions<T0 extends BcsType<any>> {
176
+ package?: string;
177
+ arguments: [RawTransactionArgument<string>, RawTransactionArgument<T0>];
178
+ typeArguments: [string, string];
179
+ }
180
+ export function prev<T0 extends BcsType<any>>(options: PrevOptions<T0>) {
181
+ const packageAddress =
182
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
183
+ const argumentsTypes = [null, `${options.typeArguments[0]}`] satisfies (string | null)[];
184
+ return (tx: Transaction) =>
185
+ tx.moveCall({
186
+ package: packageAddress,
187
+ module: 'linked_table',
188
+ function: 'prev',
189
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
190
+ typeArguments: options.typeArguments,
191
+ });
192
+ }
193
+ export interface NextOptions<T0 extends BcsType<any>> {
194
+ package?: string;
195
+ arguments: [RawTransactionArgument<string>, RawTransactionArgument<T0>];
196
+ typeArguments: [string, string];
197
+ }
198
+ export function next<T0 extends BcsType<any>>(options: NextOptions<T0>) {
199
+ const packageAddress =
200
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
201
+ const argumentsTypes = [null, `${options.typeArguments[0]}`] satisfies (string | null)[];
202
+ return (tx: Transaction) =>
203
+ tx.moveCall({
204
+ package: packageAddress,
205
+ module: 'linked_table',
206
+ function: 'next',
207
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
208
+ typeArguments: options.typeArguments,
209
+ });
210
+ }
211
+ export interface RemoveOptions<T0 extends BcsType<any>> {
212
+ package?: string;
213
+ arguments: [RawTransactionArgument<string>, RawTransactionArgument<T0>];
214
+ typeArguments: [string, string];
215
+ }
216
+ export function remove<T0 extends BcsType<any>>(options: RemoveOptions<T0>) {
217
+ const packageAddress =
218
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
219
+ const argumentsTypes = [null, `${options.typeArguments[0]}`] satisfies (string | null)[];
220
+ return (tx: Transaction) =>
221
+ tx.moveCall({
222
+ package: packageAddress,
223
+ module: 'linked_table',
224
+ function: 'remove',
225
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
226
+ typeArguments: options.typeArguments,
227
+ });
228
+ }
229
+ export interface PopFrontOptions {
230
+ package?: string;
231
+ arguments: [RawTransactionArgument<string>];
232
+ typeArguments: [string, string];
233
+ }
234
+ export function popFront(options: PopFrontOptions) {
235
+ const packageAddress =
236
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
237
+ const argumentsTypes = [null] satisfies (string | null)[];
238
+ return (tx: Transaction) =>
239
+ tx.moveCall({
240
+ package: packageAddress,
241
+ module: 'linked_table',
242
+ function: 'pop_front',
243
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
244
+ typeArguments: options.typeArguments,
245
+ });
246
+ }
247
+ export interface PopBackOptions {
248
+ package?: string;
249
+ arguments: [RawTransactionArgument<string>];
250
+ typeArguments: [string, string];
251
+ }
252
+ export function popBack(options: PopBackOptions) {
253
+ const packageAddress =
254
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
255
+ const argumentsTypes = [null] satisfies (string | null)[];
256
+ return (tx: Transaction) =>
257
+ tx.moveCall({
258
+ package: packageAddress,
259
+ module: 'linked_table',
260
+ function: 'pop_back',
261
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
262
+ typeArguments: options.typeArguments,
263
+ });
264
+ }
265
+ export interface ContainsOptions<T0 extends BcsType<any>> {
266
+ package?: string;
267
+ arguments: [RawTransactionArgument<string>, RawTransactionArgument<T0>];
268
+ typeArguments: [string, string];
269
+ }
270
+ export function contains<T0 extends BcsType<any>>(options: ContainsOptions<T0>) {
271
+ const packageAddress =
272
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
273
+ const argumentsTypes = [null, `${options.typeArguments[0]}`] satisfies (string | null)[];
274
+ return (tx: Transaction) =>
275
+ tx.moveCall({
276
+ package: packageAddress,
277
+ module: 'linked_table',
278
+ function: 'contains',
279
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
280
+ typeArguments: options.typeArguments,
281
+ });
282
+ }
283
+ export interface LengthOptions {
284
+ package?: string;
285
+ arguments: [RawTransactionArgument<string>];
286
+ typeArguments: [string, string];
287
+ }
288
+ export function length(options: LengthOptions) {
289
+ const packageAddress =
290
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
291
+ const argumentsTypes = [null] satisfies (string | null)[];
292
+ return (tx: Transaction) =>
293
+ tx.moveCall({
294
+ package: packageAddress,
295
+ module: 'linked_table',
296
+ function: 'length',
297
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
298
+ typeArguments: options.typeArguments,
299
+ });
300
+ }
301
+ export interface IsEmptyOptions {
302
+ package?: string;
303
+ arguments: [RawTransactionArgument<string>];
304
+ typeArguments: [string, string];
305
+ }
306
+ export function isEmpty(options: IsEmptyOptions) {
307
+ const packageAddress =
308
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
309
+ const argumentsTypes = [null] satisfies (string | null)[];
310
+ return (tx: Transaction) =>
311
+ tx.moveCall({
312
+ package: packageAddress,
313
+ module: 'linked_table',
314
+ function: 'is_empty',
315
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
316
+ typeArguments: options.typeArguments,
317
+ });
318
+ }
319
+ export interface DestroyEmptyOptions {
320
+ package?: string;
321
+ arguments: [RawTransactionArgument<string>];
322
+ typeArguments: [string, string];
323
+ }
324
+ export function destroyEmpty(options: DestroyEmptyOptions) {
325
+ const packageAddress =
326
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
327
+ const argumentsTypes = [null] satisfies (string | null)[];
328
+ return (tx: Transaction) =>
329
+ tx.moveCall({
330
+ package: packageAddress,
331
+ module: 'linked_table',
332
+ function: 'destroy_empty',
333
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
334
+ typeArguments: options.typeArguments,
335
+ });
336
+ }
337
+ export interface DropOptions {
338
+ package?: string;
339
+ arguments: [RawTransactionArgument<string>];
340
+ typeArguments: [string, string];
341
+ }
342
+ export function drop(options: DropOptions) {
343
+ const packageAddress =
344
+ options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
345
+ const argumentsTypes = [null] satisfies (string | null)[];
346
+ return (tx: Transaction) =>
347
+ tx.moveCall({
348
+ package: packageAddress,
349
+ module: 'linked_table',
350
+ function: 'drop',
351
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
352
+ typeArguments: options.typeArguments,
353
+ });
354
+ }