@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,30 +0,0 @@
1
- /**************************************************************
2
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
- **************************************************************/
4
- import { MoveStruct } from '../utils/index.js';
5
- import { bcs, type BcsType } from '@mysten/sui/bcs';
6
- const $moduleName = '0x2::config';
7
- export const Config = new MoveStruct({
8
- name: `${$moduleName}::Config`,
9
- fields: {
10
- id: bcs.Address,
11
- },
12
- });
13
- export function SettingData<T0 extends BcsType<any>>(...typeParameters: [T0]) {
14
- return new MoveStruct({
15
- name: `${$moduleName}::SettingData<${typeParameters[0].name as T0['name']}>`,
16
- fields: {
17
- newer_value_epoch: bcs.u64(),
18
- newer_value: bcs.option(typeParameters[0]),
19
- older_value_opt: bcs.option(typeParameters[0]),
20
- },
21
- });
22
- }
23
- export function Setting<T0 extends BcsType<any>>(...typeParameters: [T0]) {
24
- return new MoveStruct({
25
- name: `${$moduleName}::Setting<${typeParameters[0].name as T0['name']}>`,
26
- fields: {
27
- data: bcs.option(SettingData(typeParameters[0])),
28
- },
29
- });
30
- }
@@ -1,55 +0,0 @@
1
- /**************************************************************
2
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
- **************************************************************/
4
- import { MoveStruct } from '../utils/index.js';
5
- import { bcs } from '@mysten/sui/bcs';
6
- import * as bag from './bag.js';
7
- import * as table from './table.js';
8
- const $moduleName = '0x2::deny_list';
9
- export const DenyList = new MoveStruct({
10
- name: `${$moduleName}::DenyList`,
11
- fields: {
12
- id: bcs.Address,
13
- lists: bag.Bag,
14
- },
15
- });
16
- export const ConfigWriteCap = new MoveStruct({
17
- name: `${$moduleName}::ConfigWriteCap`,
18
- fields: {
19
- dummy_field: bcs.bool(),
20
- },
21
- });
22
- export const ConfigKey = new MoveStruct({
23
- name: `${$moduleName}::ConfigKey`,
24
- fields: {
25
- per_type_index: bcs.u64(),
26
- per_type_key: bcs.vector(bcs.u8()),
27
- },
28
- });
29
- export const AddressKey = new MoveStruct({
30
- name: `${$moduleName}::AddressKey`,
31
- fields: {
32
- pos0: bcs.Address,
33
- },
34
- });
35
- export const GlobalPauseKey = new MoveStruct({
36
- name: `${$moduleName}::GlobalPauseKey`,
37
- fields: {
38
- dummy_field: bcs.bool(),
39
- },
40
- });
41
- export const PerTypeConfigCreated = new MoveStruct({
42
- name: `${$moduleName}::PerTypeConfigCreated`,
43
- fields: {
44
- key: ConfigKey,
45
- config_id: bcs.Address,
46
- },
47
- });
48
- export const PerTypeList = new MoveStruct({
49
- name: `${$moduleName}::PerTypeList`,
50
- fields: {
51
- id: bcs.Address,
52
- denied_count: table.Table,
53
- denied_addresses: table.Table,
54
- },
55
- });
@@ -1,95 +0,0 @@
1
- /**************************************************************
2
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
- **************************************************************/
4
- import {
5
- MoveStruct,
6
- MoveEnum,
7
- normalizeMoveArguments,
8
- type RawTransactionArgument,
9
- } from '../utils/index.js';
10
- import { bcs, type BcsType } from '@mysten/sui/bcs';
11
- import { type Transaction } from '@mysten/sui/transactions';
12
- const $moduleName = '0x2::derived_object';
13
- export const Claimed = new MoveStruct({
14
- name: `${$moduleName}::Claimed`,
15
- fields: {
16
- pos0: bcs.Address,
17
- },
18
- });
19
- export function DerivedObjectKey<T0 extends BcsType<any>>(...typeParameters: [T0]) {
20
- return new MoveStruct({
21
- name: `${$moduleName}::DerivedObjectKey<${typeParameters[0].name as T0['name']}>`,
22
- fields: {
23
- pos0: typeParameters[0],
24
- },
25
- });
26
- }
27
- export const ClaimedStatus = new MoveEnum({
28
- name: `${$moduleName}::ClaimedStatus`,
29
- fields: {
30
- Reserved: null,
31
- },
32
- });
33
- export interface ClaimOptions<T0 extends BcsType<any>> {
34
- package?: string;
35
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<T0>];
36
- typeArguments: [string];
37
- }
38
- export function claim<T0 extends BcsType<any>>(options: ClaimOptions<T0>) {
39
- const packageAddress =
40
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
41
- const argumentsTypes = ['0x2::object::ID', `${options.typeArguments[0]}`] satisfies (
42
- | string
43
- | null
44
- )[];
45
- return (tx: Transaction) =>
46
- tx.moveCall({
47
- package: packageAddress,
48
- module: 'derived_object',
49
- function: 'claim',
50
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
51
- typeArguments: options.typeArguments,
52
- });
53
- }
54
- export interface ExistsOptions<T0 extends BcsType<any>> {
55
- package?: string;
56
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<T0>];
57
- typeArguments: [string];
58
- }
59
- export function exists<T0 extends BcsType<any>>(options: ExistsOptions<T0>) {
60
- const packageAddress =
61
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
62
- const argumentsTypes = ['0x2::object::ID', `${options.typeArguments[0]}`] satisfies (
63
- | string
64
- | null
65
- )[];
66
- return (tx: Transaction) =>
67
- tx.moveCall({
68
- package: packageAddress,
69
- module: 'derived_object',
70
- function: 'exists',
71
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
72
- typeArguments: options.typeArguments,
73
- });
74
- }
75
- export interface DeriveAddressOptions<T0 extends BcsType<any>> {
76
- package?: string;
77
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<T0>];
78
- typeArguments: [string];
79
- }
80
- export function deriveAddress<T0 extends BcsType<any>>(options: DeriveAddressOptions<T0>) {
81
- const packageAddress =
82
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
83
- const argumentsTypes = ['0x2::object::ID', `${options.typeArguments[0]}`] satisfies (
84
- | string
85
- | null
86
- )[];
87
- return (tx: Transaction) =>
88
- tx.moveCall({
89
- package: packageAddress,
90
- module: 'derived_object',
91
- function: 'derive_address',
92
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
93
- typeArguments: options.typeArguments,
94
- });
95
- }
@@ -1,258 +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
- import * as vec_map from './vec_map.js';
8
- const $moduleName = '0x2::display';
9
- export const Display = new MoveStruct({
10
- name: `${$moduleName}::Display`,
11
- fields: {
12
- id: bcs.Address,
13
- fields: vec_map.VecMap(bcs.string(), bcs.string()),
14
- version: bcs.u16(),
15
- },
16
- });
17
- export const DisplayCreated = new MoveStruct({
18
- name: `${$moduleName}::DisplayCreated`,
19
- fields: {
20
- id: bcs.Address,
21
- },
22
- });
23
- export const VersionUpdated = new MoveStruct({
24
- name: `${$moduleName}::VersionUpdated`,
25
- fields: {
26
- id: bcs.Address,
27
- version: bcs.u16(),
28
- fields: vec_map.VecMap(bcs.string(), bcs.string()),
29
- },
30
- });
31
- export interface NewOptions {
32
- package?: string;
33
- arguments: [RawTransactionArgument<string>];
34
- typeArguments: [string];
35
- }
36
- export function _new(options: NewOptions) {
37
- const packageAddress =
38
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
39
- const argumentsTypes = [null] satisfies (string | null)[];
40
- return (tx: Transaction) =>
41
- tx.moveCall({
42
- package: packageAddress,
43
- module: 'display',
44
- function: 'new',
45
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
46
- typeArguments: options.typeArguments,
47
- });
48
- }
49
- export interface NewWithFieldsOptions {
50
- package?: string;
51
- arguments: [
52
- RawTransactionArgument<string>,
53
- RawTransactionArgument<string[]>,
54
- RawTransactionArgument<string[]>,
55
- ];
56
- typeArguments: [string];
57
- }
58
- export function newWithFields(options: NewWithFieldsOptions) {
59
- const packageAddress =
60
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
61
- const argumentsTypes = [
62
- null,
63
- 'vector<0x1::string::String>',
64
- 'vector<0x1::string::String>',
65
- ] satisfies (string | null)[];
66
- return (tx: Transaction) =>
67
- tx.moveCall({
68
- package: packageAddress,
69
- module: 'display',
70
- function: 'new_with_fields',
71
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
72
- typeArguments: options.typeArguments,
73
- });
74
- }
75
- export interface CreateAndKeepOptions {
76
- package?: string;
77
- arguments: [RawTransactionArgument<string>];
78
- typeArguments: [string];
79
- }
80
- export function createAndKeep(options: CreateAndKeepOptions) {
81
- const packageAddress =
82
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
83
- const argumentsTypes = [null] satisfies (string | null)[];
84
- return (tx: Transaction) =>
85
- tx.moveCall({
86
- package: packageAddress,
87
- module: 'display',
88
- function: 'create_and_keep',
89
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
90
- typeArguments: options.typeArguments,
91
- });
92
- }
93
- export interface UpdateVersionOptions {
94
- package?: string;
95
- arguments: [RawTransactionArgument<string>];
96
- typeArguments: [string];
97
- }
98
- export function updateVersion(options: UpdateVersionOptions) {
99
- const packageAddress =
100
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
101
- const argumentsTypes = [null] satisfies (string | null)[];
102
- return (tx: Transaction) =>
103
- tx.moveCall({
104
- package: packageAddress,
105
- module: 'display',
106
- function: 'update_version',
107
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
108
- typeArguments: options.typeArguments,
109
- });
110
- }
111
- export interface AddOptions {
112
- package?: string;
113
- arguments: [
114
- RawTransactionArgument<string>,
115
- RawTransactionArgument<string>,
116
- RawTransactionArgument<string>,
117
- ];
118
- typeArguments: [string];
119
- }
120
- export function add(options: AddOptions) {
121
- const packageAddress =
122
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
123
- const argumentsTypes = [null, '0x1::string::String', '0x1::string::String'] satisfies (
124
- | string
125
- | null
126
- )[];
127
- return (tx: Transaction) =>
128
- tx.moveCall({
129
- package: packageAddress,
130
- module: 'display',
131
- function: 'add',
132
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
133
- typeArguments: options.typeArguments,
134
- });
135
- }
136
- export interface AddMultipleOptions {
137
- package?: string;
138
- arguments: [
139
- RawTransactionArgument<string>,
140
- RawTransactionArgument<string[]>,
141
- RawTransactionArgument<string[]>,
142
- ];
143
- typeArguments: [string];
144
- }
145
- export function addMultiple(options: AddMultipleOptions) {
146
- const packageAddress =
147
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
148
- const argumentsTypes = [
149
- null,
150
- 'vector<0x1::string::String>',
151
- 'vector<0x1::string::String>',
152
- ] satisfies (string | null)[];
153
- return (tx: Transaction) =>
154
- tx.moveCall({
155
- package: packageAddress,
156
- module: 'display',
157
- function: 'add_multiple',
158
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
159
- typeArguments: options.typeArguments,
160
- });
161
- }
162
- export interface EditOptions {
163
- package?: string;
164
- arguments: [
165
- RawTransactionArgument<string>,
166
- RawTransactionArgument<string>,
167
- RawTransactionArgument<string>,
168
- ];
169
- typeArguments: [string];
170
- }
171
- export function edit(options: EditOptions) {
172
- const packageAddress =
173
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
174
- const argumentsTypes = [null, '0x1::string::String', '0x1::string::String'] satisfies (
175
- | string
176
- | null
177
- )[];
178
- return (tx: Transaction) =>
179
- tx.moveCall({
180
- package: packageAddress,
181
- module: 'display',
182
- function: 'edit',
183
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
184
- typeArguments: options.typeArguments,
185
- });
186
- }
187
- export interface RemoveOptions {
188
- package?: string;
189
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<string>];
190
- typeArguments: [string];
191
- }
192
- export function remove(options: RemoveOptions) {
193
- const packageAddress =
194
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
195
- const argumentsTypes = [null, '0x1::string::String'] satisfies (string | null)[];
196
- return (tx: Transaction) =>
197
- tx.moveCall({
198
- package: packageAddress,
199
- module: 'display',
200
- function: 'remove',
201
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
202
- typeArguments: options.typeArguments,
203
- });
204
- }
205
- export interface IsAuthorizedOptions {
206
- package?: string;
207
- arguments: [RawTransactionArgument<string>];
208
- typeArguments: [string];
209
- }
210
- export function isAuthorized(options: IsAuthorizedOptions) {
211
- const packageAddress =
212
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
213
- const argumentsTypes = [null] satisfies (string | null)[];
214
- return (tx: Transaction) =>
215
- tx.moveCall({
216
- package: packageAddress,
217
- module: 'display',
218
- function: 'is_authorized',
219
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
220
- typeArguments: options.typeArguments,
221
- });
222
- }
223
- export interface VersionOptions {
224
- package?: string;
225
- arguments: [RawTransactionArgument<string>];
226
- typeArguments: [string];
227
- }
228
- export function version(options: VersionOptions) {
229
- const packageAddress =
230
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
231
- const argumentsTypes = [null] satisfies (string | null)[];
232
- return (tx: Transaction) =>
233
- tx.moveCall({
234
- package: packageAddress,
235
- module: 'display',
236
- function: 'version',
237
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
238
- typeArguments: options.typeArguments,
239
- });
240
- }
241
- export interface FieldsOptions {
242
- package?: string;
243
- arguments: [RawTransactionArgument<string>];
244
- typeArguments: [string];
245
- }
246
- export function fields(options: FieldsOptions) {
247
- const packageAddress =
248
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
249
- const argumentsTypes = [null] satisfies (string | null)[];
250
- return (tx: Transaction) =>
251
- tx.moveCall({
252
- package: packageAddress,
253
- module: 'display',
254
- function: 'fields',
255
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
256
- typeArguments: options.typeArguments,
257
- });
258
- }
@@ -1,171 +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::dynamic_field';
8
- export function Field<T0 extends BcsType<any>, T1 extends BcsType<any>>(
9
- ...typeParameters: [T0, T1]
10
- ) {
11
- return new MoveStruct({
12
- name: `${$moduleName}::Field<${typeParameters[0].name as T0['name']}, ${typeParameters[1].name as T1['name']}>`,
13
- fields: {
14
- id: bcs.Address,
15
- name: typeParameters[0],
16
- value: typeParameters[1],
17
- },
18
- });
19
- }
20
- export interface AddOptions<T0 extends BcsType<any>, T1 extends BcsType<any>> {
21
- package?: string;
22
- arguments: [
23
- RawTransactionArgument<string>,
24
- RawTransactionArgument<T0>,
25
- RawTransactionArgument<T1>,
26
- ];
27
- typeArguments: [string, string];
28
- }
29
- export function add<T0 extends BcsType<any>, T1 extends BcsType<any>>(options: AddOptions<T0, T1>) {
30
- const packageAddress =
31
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
32
- const argumentsTypes = [
33
- '0x2::object::ID',
34
- `${options.typeArguments[0]}`,
35
- `${options.typeArguments[1]}`,
36
- ] satisfies (string | null)[];
37
- return (tx: Transaction) =>
38
- tx.moveCall({
39
- package: packageAddress,
40
- module: 'dynamic_field',
41
- function: 'add',
42
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
43
- typeArguments: options.typeArguments,
44
- });
45
- }
46
- export interface BorrowOptions<T0 extends BcsType<any>> {
47
- package?: string;
48
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<T0>];
49
- typeArguments: [string, string];
50
- }
51
- export function borrow<T0 extends BcsType<any>>(options: BorrowOptions<T0>) {
52
- const packageAddress =
53
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
54
- const argumentsTypes = ['0x2::object::ID', `${options.typeArguments[0]}`] satisfies (
55
- | string
56
- | null
57
- )[];
58
- return (tx: Transaction) =>
59
- tx.moveCall({
60
- package: packageAddress,
61
- module: 'dynamic_field',
62
- function: 'borrow',
63
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
64
- typeArguments: options.typeArguments,
65
- });
66
- }
67
- export interface BorrowMutOptions<T0 extends BcsType<any>> {
68
- package?: string;
69
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<T0>];
70
- typeArguments: [string, string];
71
- }
72
- export function borrowMut<T0 extends BcsType<any>>(options: BorrowMutOptions<T0>) {
73
- const packageAddress =
74
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
75
- const argumentsTypes = ['0x2::object::ID', `${options.typeArguments[0]}`] satisfies (
76
- | string
77
- | null
78
- )[];
79
- return (tx: Transaction) =>
80
- tx.moveCall({
81
- package: packageAddress,
82
- module: 'dynamic_field',
83
- function: 'borrow_mut',
84
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
85
- typeArguments: options.typeArguments,
86
- });
87
- }
88
- export interface RemoveOptions<T0 extends BcsType<any>> {
89
- package?: string;
90
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<T0>];
91
- typeArguments: [string, string];
92
- }
93
- export function remove<T0 extends BcsType<any>>(options: RemoveOptions<T0>) {
94
- const packageAddress =
95
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
96
- const argumentsTypes = ['0x2::object::ID', `${options.typeArguments[0]}`] satisfies (
97
- | string
98
- | null
99
- )[];
100
- return (tx: Transaction) =>
101
- tx.moveCall({
102
- package: packageAddress,
103
- module: 'dynamic_field',
104
- function: 'remove',
105
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
106
- typeArguments: options.typeArguments,
107
- });
108
- }
109
- export interface Exists_Options<T0 extends BcsType<any>> {
110
- package?: string;
111
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<T0>];
112
- typeArguments: [string];
113
- }
114
- export function exists_<T0 extends BcsType<any>>(options: Exists_Options<T0>) {
115
- const packageAddress =
116
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
117
- const argumentsTypes = ['0x2::object::ID', `${options.typeArguments[0]}`] satisfies (
118
- | string
119
- | null
120
- )[];
121
- return (tx: Transaction) =>
122
- tx.moveCall({
123
- package: packageAddress,
124
- module: 'dynamic_field',
125
- function: 'exists_',
126
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
127
- typeArguments: options.typeArguments,
128
- });
129
- }
130
- export interface RemoveIfExistsOptions<T0 extends BcsType<any>> {
131
- package?: string;
132
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<T0>];
133
- typeArguments: [string, string];
134
- }
135
- export function removeIfExists<T0 extends BcsType<any>>(options: RemoveIfExistsOptions<T0>) {
136
- const packageAddress =
137
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
138
- const argumentsTypes = ['0x2::object::ID', `${options.typeArguments[0]}`] satisfies (
139
- | string
140
- | null
141
- )[];
142
- return (tx: Transaction) =>
143
- tx.moveCall({
144
- package: packageAddress,
145
- module: 'dynamic_field',
146
- function: 'remove_if_exists',
147
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
148
- typeArguments: options.typeArguments,
149
- });
150
- }
151
- export interface ExistsWithTypeOptions<T0 extends BcsType<any>> {
152
- package?: string;
153
- arguments: [RawTransactionArgument<string>, RawTransactionArgument<T0>];
154
- typeArguments: [string, string];
155
- }
156
- export function existsWithType<T0 extends BcsType<any>>(options: ExistsWithTypeOptions<T0>) {
157
- const packageAddress =
158
- options.package ?? '0x0000000000000000000000000000000000000000000000000000000000000002';
159
- const argumentsTypes = ['0x2::object::ID', `${options.typeArguments[0]}`] satisfies (
160
- | string
161
- | null
162
- )[];
163
- return (tx: Transaction) =>
164
- tx.moveCall({
165
- package: packageAddress,
166
- module: 'dynamic_field',
167
- function: 'exists_with_type',
168
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes),
169
- typeArguments: options.typeArguments,
170
- });
171
- }