@mysten/kiosk 1.1.0 → 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 (74) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/contracts/0x2/bag.mjs.map +1 -1
  3. package/dist/contracts/0x2/balance.mjs +1 -5
  4. package/dist/contracts/0x2/balance.mjs.map +1 -1
  5. package/dist/contracts/0x2/kiosk.mjs +4 -4
  6. package/dist/contracts/0x2/kiosk.mjs.map +1 -1
  7. package/dist/contracts/0x2/kiosk_extension.mjs +1 -1
  8. package/dist/contracts/0x2/kiosk_extension.mjs.map +1 -1
  9. package/dist/contracts/0x2/transfer_policy.mjs +6 -6
  10. package/dist/contracts/0x2/transfer_policy.mjs.map +1 -1
  11. package/dist/contracts/0x2/vec_set.mjs.map +1 -1
  12. package/package.json +8 -7
  13. package/src/contracts/0x2/bag.ts +2 -181
  14. package/src/contracts/0x2/balance.ts +3 -260
  15. package/src/contracts/0x2/kiosk.ts +4 -4
  16. package/src/contracts/0x2/kiosk_extension.ts +1 -1
  17. package/src/contracts/0x2/transfer_policy.ts +6 -6
  18. package/src/contracts/0x2/vec_set.ts +1 -198
  19. package/src/contracts/kiosk/witness_rule.ts +1 -1
  20. package/src/contracts/0x2/accumulator.ts +0 -24
  21. package/src/contracts/0x2/accumulator_metadata.ts +0 -38
  22. package/src/contracts/0x2/accumulator_settlement.ts +0 -14
  23. package/src/contracts/0x2/address.ts +0 -145
  24. package/src/contracts/0x2/address_alias.ts +0 -92
  25. package/src/contracts/0x2/authenticator_state.ts +0 -44
  26. package/src/contracts/0x2/bcs.ts +0 -495
  27. package/src/contracts/0x2/bls12381.ts +0 -717
  28. package/src/contracts/0x2/borrow.ts +0 -99
  29. package/src/contracts/0x2/clock.ts +0 -30
  30. package/src/contracts/0x2/coin.ts +0 -977
  31. package/src/contracts/0x2/coin_registry.ts +0 -874
  32. package/src/contracts/0x2/config.ts +0 -30
  33. package/src/contracts/0x2/deny_list.ts +0 -55
  34. package/src/contracts/0x2/derived_object.ts +0 -95
  35. package/src/contracts/0x2/display.ts +0 -258
  36. package/src/contracts/0x2/dynamic_field.ts +0 -171
  37. package/src/contracts/0x2/dynamic_object_field.ts +0 -167
  38. package/src/contracts/0x2/ecdsa_k1.ts +0 -65
  39. package/src/contracts/0x2/ecdsa_r1.ts +0 -49
  40. package/src/contracts/0x2/ecvrf.ts +0 -29
  41. package/src/contracts/0x2/ed25519.ts +0 -25
  42. package/src/contracts/0x2/event.ts +0 -42
  43. package/src/contracts/0x2/funds_accumulator.ts +0 -86
  44. package/src/contracts/0x2/groth16.ts +0 -171
  45. package/src/contracts/0x2/group_ops.ts +0 -49
  46. package/src/contracts/0x2/hash.ts +0 -37
  47. package/src/contracts/0x2/hex.ts +0 -37
  48. package/src/contracts/0x2/hmac.ts +0 -21
  49. package/src/contracts/0x2/linked_table.ts +0 -354
  50. package/src/contracts/0x2/math.ts +0 -117
  51. package/src/contracts/0x2/nitro_attestation.ts +0 -186
  52. package/src/contracts/0x2/object.ts +0 -249
  53. package/src/contracts/0x2/object_bag.ts +0 -210
  54. package/src/contracts/0x2/object_table.ts +0 -200
  55. package/src/contracts/0x2/package.ts +0 -414
  56. package/src/contracts/0x2/party.ts +0 -37
  57. package/src/contracts/0x2/pay.ts +0 -153
  58. package/src/contracts/0x2/poseidon.ts +0 -21
  59. package/src/contracts/0x2/priority_queue.ts +0 -139
  60. package/src/contracts/0x2/random.ts +0 -294
  61. package/src/contracts/0x2/sui.ts +0 -29
  62. package/src/contracts/0x2/table.ts +0 -200
  63. package/src/contracts/0x2/table_vec.ts +0 -232
  64. package/src/contracts/0x2/token.ts +0 -873
  65. package/src/contracts/0x2/transfer.ts +0 -216
  66. package/src/contracts/0x2/tx_context.ts +0 -129
  67. package/src/contracts/0x2/types.ts +0 -24
  68. package/src/contracts/0x2/url.ts +0 -77
  69. package/src/contracts/0x2/vdf.ts +0 -45
  70. package/src/contracts/0x2/vec_map.ts +0 -401
  71. package/src/contracts/0x2/versioned.ts +0 -153
  72. package/src/contracts/0x2/zklogin_verified_id.ts +0 -172
  73. package/src/contracts/0x2/zklogin_verified_issuer.ts +0 -99
  74. 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
- }