@zing-protocol/zing-sdk 0.0.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.
- package/README.md +12 -0
- package/package.json +37 -0
- package/src/_generated/index.js +6 -0
- package/src/_generated/utils/index.ts +181 -0
- package/src/_generated/zing_framework/coin_utils.ts +41 -0
- package/src/_generated/zing_framework/deps/sui/object.ts +16 -0
- package/src/_generated/zing_framework/derived_object_bag.ts +400 -0
- package/src/_generated/zing_framework/derived_table.ts +366 -0
- package/src/_generated/zing_governance/admin.ts +47 -0
- package/src/_generated/zing_governance/deps/sui/object.ts +16 -0
- package/src/_generated/zing_governance/treasury.ts +134 -0
- package/src/_generated/zing_identity/config.ts +191 -0
- package/src/_generated/zing_identity/deps/std/type_name.ts +25 -0
- package/src/_generated/zing_identity/deps/sui/object.ts +16 -0
- package/src/_generated/zing_identity/deps/sui/object_table.ts +26 -0
- package/src/_generated/zing_identity/deps/sui/table.ts +38 -0
- package/src/_generated/zing_identity/deps/sui/vec_set.ts +28 -0
- package/src/_generated/zing_identity/ecdsa.ts +166 -0
- package/src/_generated/zing_identity/identity.ts +661 -0
- package/src/_generated/zing_identity/reclaim.ts +803 -0
- package/src/_generated/zing_studio/app.ts +855 -0
- package/src/_generated/zing_studio/article.ts +598 -0
- package/src/_generated/zing_studio/config.ts +475 -0
- package/src/_generated/zing_studio/deps/std/type_name.ts +25 -0
- package/src/_generated/zing_studio/deps/sui/bag.ts +43 -0
- package/src/_generated/zing_studio/deps/sui/balance.ts +20 -0
- package/src/_generated/zing_studio/deps/sui/coin.ts +21 -0
- package/src/_generated/zing_studio/deps/sui/dynamic_field.ts +272 -0
- package/src/_generated/zing_studio/deps/sui/object.ts +16 -0
- package/src/_generated/zing_studio/deps/sui/table.ts +38 -0
- package/src/_generated/zing_studio/deps/sui/vec_map.ts +39 -0
- package/src/_generated/zing_studio/deps/sui/vec_set.ts +28 -0
- package/src/_generated/zing_studio/deps/walrus/blob.ts +22 -0
- package/src/_generated/zing_studio/deps/walrus/events.ts +124 -0
- package/src/_generated/zing_studio/deps/walrus/metadata.ts +137 -0
- package/src/_generated/zing_studio/deps/walrus/storage_resource.ts +17 -0
- package/src/_generated/zing_studio/deps/zing_framework/derived_object_bag.ts +17 -0
- package/src/_generated/zing_studio/deps/zing_framework/derived_table.ts +17 -0
- package/src/_generated/zing_studio/donation.ts +18 -0
- package/src/_generated/zing_studio/enclave.ts +466 -0
- package/src/_generated/zing_studio/nitro_attestation.ts +308 -0
- package/src/_generated/zing_studio/referral.ts +447 -0
- package/src/_generated/zing_studio/storage.ts +664 -0
- package/src/_generated/zing_studio/studio.ts +682 -0
- package/src/bcs.ts +139 -0
- package/src/client/index.ts +557 -0
- package/src/client/types.ts +28 -0
- package/src/components/index.ts +3 -0
- package/src/components/wallet-provider.tsx +53 -0
- package/src/components/walrus-provider.tsx +212 -0
- package/src/components/zing-provider.tsx +54 -0
- package/src/config/common.ts +82 -0
- package/src/config/index.ts +45 -0
- package/src/config/mainnet.ts +109 -0
- package/src/config/testnet.ts +111 -0
- package/src/config/types.ts +69 -0
- package/src/const.ts +32 -0
- package/src/getters.ts +523 -0
- package/src/hooks/index.ts +14 -0
- package/src/hooks/useGetStudio.ts +22 -0
- package/src/hooks/useGetTierPlan.ts +115 -0
- package/src/hooks/useReclaim.ts +165 -0
- package/src/hooks/useSignAndExecuteTransaction.ts +57 -0
- package/src/hooks/useSignPersonalMessage.ts +28 -0
- package/src/hooks/useZingInfiniteQueries.ts +92 -0
- package/src/hooks/useZingMutation.ts +66 -0
- package/src/hooks/useZingQueries.ts +107 -0
- package/src/hooks/useZingQuery.ts +88 -0
- package/src/index.ts +15 -0
- package/src/lib/utils/colorful-logger.ts +27 -0
- package/src/lib/utils/const.ts +25 -0
- package/src/lib/utils/helpers.ts +78 -0
- package/src/lib/utils/index.ts +5 -0
- package/src/lib/utils/init-app-with-shadow.ts +42 -0
- package/src/lib/utils/quilt.ts +317 -0
- package/src/lib/utils/reclaim.ts +148 -0
- package/src/lib/utils/types.ts +14 -0
- package/src/mutations/index.ts +3 -0
- package/src/mutations/seal.ts +78 -0
- package/src/mutations/signer.ts +241 -0
- package/src/mutations/walrus.ts +862 -0
- package/src/stores/index.ts +3 -0
- package/src/stores/walletStore.ts +360 -0
- package/src/stores/walrusStore.ts +118 -0
- package/src/stores/zkloginStore.ts +53 -0
- package/src/types.ts +120 -0
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,661 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import * as type_name from "./deps/std/type_name.js";
|
|
5
|
+
import * as object from "./deps/sui/object.js";
|
|
6
|
+
import * as table from "./deps/sui/table.js";
|
|
7
|
+
import * as vec_set from "./deps/sui/vec_set.js";
|
|
8
|
+
import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
|
|
9
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
10
|
+
import type { RawTransactionArgument } from "../utils/index.js";
|
|
11
|
+
import type { BcsType } from "@mysten/sui/bcs";
|
|
12
|
+
import type { Transaction } from "@mysten/sui/transactions";
|
|
13
|
+
|
|
14
|
+
const $moduleName = "@local-pkg/zing_identity::identity";
|
|
15
|
+
export const IdentityManager = new MoveStruct({
|
|
16
|
+
name: `${$moduleName}::IdentityManager`,
|
|
17
|
+
fields: {
|
|
18
|
+
id: object.UID,
|
|
19
|
+
address_to_identifier: table.Table,
|
|
20
|
+
identifier_info: table.Table,
|
|
21
|
+
whitelist_modules: vec_set.VecSet(type_name.TypeName),
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
export const IdentifierInfo = new MoveStruct({
|
|
25
|
+
name: `${$moduleName}::IdentifierInfo`,
|
|
26
|
+
fields: {
|
|
27
|
+
owner: bcs.Address,
|
|
28
|
+
updated_at: bcs.u64(),
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
export const ReadAccess = new MoveStruct({
|
|
32
|
+
name: `${$moduleName}::ReadAccess`,
|
|
33
|
+
fields: {
|
|
34
|
+
dummy_field: bcs.bool(),
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
export interface ModuleAddressToIdentifierBorrowArguments<
|
|
38
|
+
T extends BcsType<any>,
|
|
39
|
+
> {
|
|
40
|
+
self: RawTransactionArgument<string>;
|
|
41
|
+
Witness: RawTransactionArgument<T>;
|
|
42
|
+
}
|
|
43
|
+
export interface ModuleAddressToIdentifierBorrowOptions<
|
|
44
|
+
T extends BcsType<any>,
|
|
45
|
+
> {
|
|
46
|
+
package?: string;
|
|
47
|
+
arguments:
|
|
48
|
+
| ModuleAddressToIdentifierBorrowArguments<T>
|
|
49
|
+
| [
|
|
50
|
+
self: RawTransactionArgument<string>,
|
|
51
|
+
Witness: RawTransactionArgument<T>,
|
|
52
|
+
];
|
|
53
|
+
typeArguments: [string];
|
|
54
|
+
}
|
|
55
|
+
export function moduleAddressToIdentifierBorrow<T extends BcsType<any>>(
|
|
56
|
+
options: ModuleAddressToIdentifierBorrowOptions<T>,
|
|
57
|
+
) {
|
|
58
|
+
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
59
|
+
const argumentsTypes = [
|
|
60
|
+
`${packageAddress}::identity::IdentityManager<${options.typeArguments[0]}>`,
|
|
61
|
+
`${options.typeArguments[0]}`,
|
|
62
|
+
] satisfies string[];
|
|
63
|
+
const parameterNames = ["self", "Witness"];
|
|
64
|
+
return (tx: Transaction) =>
|
|
65
|
+
tx.moveCall({
|
|
66
|
+
package: packageAddress,
|
|
67
|
+
module: "identity",
|
|
68
|
+
function: "module_address_to_identifier_borrow",
|
|
69
|
+
arguments: normalizeMoveArguments(
|
|
70
|
+
options.arguments,
|
|
71
|
+
argumentsTypes,
|
|
72
|
+
parameterNames,
|
|
73
|
+
),
|
|
74
|
+
typeArguments: options.typeArguments,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
export interface ModuleAddressToIdentifierBorrowMutArguments<
|
|
78
|
+
T extends BcsType<any>,
|
|
79
|
+
> {
|
|
80
|
+
self: RawTransactionArgument<string>;
|
|
81
|
+
Witness: RawTransactionArgument<T>;
|
|
82
|
+
}
|
|
83
|
+
export interface ModuleAddressToIdentifierBorrowMutOptions<
|
|
84
|
+
T extends BcsType<any>,
|
|
85
|
+
> {
|
|
86
|
+
package?: string;
|
|
87
|
+
arguments:
|
|
88
|
+
| ModuleAddressToIdentifierBorrowMutArguments<T>
|
|
89
|
+
| [
|
|
90
|
+
self: RawTransactionArgument<string>,
|
|
91
|
+
Witness: RawTransactionArgument<T>,
|
|
92
|
+
];
|
|
93
|
+
typeArguments: [string];
|
|
94
|
+
}
|
|
95
|
+
export function moduleAddressToIdentifierBorrowMut<T extends BcsType<any>>(
|
|
96
|
+
options: ModuleAddressToIdentifierBorrowMutOptions<T>,
|
|
97
|
+
) {
|
|
98
|
+
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
99
|
+
const argumentsTypes = [
|
|
100
|
+
`${packageAddress}::identity::IdentityManager<${options.typeArguments[0]}>`,
|
|
101
|
+
`${options.typeArguments[0]}`,
|
|
102
|
+
] satisfies string[];
|
|
103
|
+
const parameterNames = ["self", "Witness"];
|
|
104
|
+
return (tx: Transaction) =>
|
|
105
|
+
tx.moveCall({
|
|
106
|
+
package: packageAddress,
|
|
107
|
+
module: "identity",
|
|
108
|
+
function: "module_address_to_identifier_borrow_mut",
|
|
109
|
+
arguments: normalizeMoveArguments(
|
|
110
|
+
options.arguments,
|
|
111
|
+
argumentsTypes,
|
|
112
|
+
parameterNames,
|
|
113
|
+
),
|
|
114
|
+
typeArguments: options.typeArguments,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
export interface ModuleIdentifierInfoBorrowArguments<T extends BcsType<any>> {
|
|
118
|
+
self: RawTransactionArgument<string>;
|
|
119
|
+
Witness: RawTransactionArgument<T>;
|
|
120
|
+
}
|
|
121
|
+
export interface ModuleIdentifierInfoBorrowOptions<T extends BcsType<any>> {
|
|
122
|
+
package?: string;
|
|
123
|
+
arguments:
|
|
124
|
+
| ModuleIdentifierInfoBorrowArguments<T>
|
|
125
|
+
| [
|
|
126
|
+
self: RawTransactionArgument<string>,
|
|
127
|
+
Witness: RawTransactionArgument<T>,
|
|
128
|
+
];
|
|
129
|
+
typeArguments: [string];
|
|
130
|
+
}
|
|
131
|
+
export function moduleIdentifierInfoBorrow<T extends BcsType<any>>(
|
|
132
|
+
options: ModuleIdentifierInfoBorrowOptions<T>,
|
|
133
|
+
) {
|
|
134
|
+
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
135
|
+
const argumentsTypes = [
|
|
136
|
+
`${packageAddress}::identity::IdentityManager<${options.typeArguments[0]}>`,
|
|
137
|
+
`${options.typeArguments[0]}`,
|
|
138
|
+
] satisfies string[];
|
|
139
|
+
const parameterNames = ["self", "Witness"];
|
|
140
|
+
return (tx: Transaction) =>
|
|
141
|
+
tx.moveCall({
|
|
142
|
+
package: packageAddress,
|
|
143
|
+
module: "identity",
|
|
144
|
+
function: "module_identifier_info_borrow",
|
|
145
|
+
arguments: normalizeMoveArguments(
|
|
146
|
+
options.arguments,
|
|
147
|
+
argumentsTypes,
|
|
148
|
+
parameterNames,
|
|
149
|
+
),
|
|
150
|
+
typeArguments: options.typeArguments,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
export interface ModuleIdentifierInfoBorrowMutArguments<
|
|
154
|
+
T extends BcsType<any>,
|
|
155
|
+
> {
|
|
156
|
+
self: RawTransactionArgument<string>;
|
|
157
|
+
Witness: RawTransactionArgument<T>;
|
|
158
|
+
}
|
|
159
|
+
export interface ModuleIdentifierInfoBorrowMutOptions<T extends BcsType<any>> {
|
|
160
|
+
package?: string;
|
|
161
|
+
arguments:
|
|
162
|
+
| ModuleIdentifierInfoBorrowMutArguments<T>
|
|
163
|
+
| [
|
|
164
|
+
self: RawTransactionArgument<string>,
|
|
165
|
+
Witness: RawTransactionArgument<T>,
|
|
166
|
+
];
|
|
167
|
+
typeArguments: [string];
|
|
168
|
+
}
|
|
169
|
+
export function moduleIdentifierInfoBorrowMut<T extends BcsType<any>>(
|
|
170
|
+
options: ModuleIdentifierInfoBorrowMutOptions<T>,
|
|
171
|
+
) {
|
|
172
|
+
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
173
|
+
const argumentsTypes = [
|
|
174
|
+
`${packageAddress}::identity::IdentityManager<${options.typeArguments[0]}>`,
|
|
175
|
+
`${options.typeArguments[0]}`,
|
|
176
|
+
] satisfies string[];
|
|
177
|
+
const parameterNames = ["self", "Witness"];
|
|
178
|
+
return (tx: Transaction) =>
|
|
179
|
+
tx.moveCall({
|
|
180
|
+
package: packageAddress,
|
|
181
|
+
module: "identity",
|
|
182
|
+
function: "module_identifier_info_borrow_mut",
|
|
183
|
+
arguments: normalizeMoveArguments(
|
|
184
|
+
options.arguments,
|
|
185
|
+
argumentsTypes,
|
|
186
|
+
parameterNames,
|
|
187
|
+
),
|
|
188
|
+
typeArguments: options.typeArguments,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
export interface NewIdentifierInfoArguments {
|
|
192
|
+
owner: RawTransactionArgument<string>;
|
|
193
|
+
updatedAt: RawTransactionArgument<number | bigint>;
|
|
194
|
+
}
|
|
195
|
+
export interface NewIdentifierInfoOptions {
|
|
196
|
+
package?: string;
|
|
197
|
+
arguments:
|
|
198
|
+
| NewIdentifierInfoArguments
|
|
199
|
+
| [
|
|
200
|
+
owner: RawTransactionArgument<string>,
|
|
201
|
+
updatedAt: RawTransactionArgument<number | bigint>,
|
|
202
|
+
];
|
|
203
|
+
}
|
|
204
|
+
export function newIdentifierInfo(options: NewIdentifierInfoOptions) {
|
|
205
|
+
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
206
|
+
const argumentsTypes = ["address", "u64"] satisfies string[];
|
|
207
|
+
const parameterNames = ["owner", "updatedAt"];
|
|
208
|
+
return (tx: Transaction) =>
|
|
209
|
+
tx.moveCall({
|
|
210
|
+
package: packageAddress,
|
|
211
|
+
module: "identity",
|
|
212
|
+
function: "new_identifier_info",
|
|
213
|
+
arguments: normalizeMoveArguments(
|
|
214
|
+
options.arguments,
|
|
215
|
+
argumentsTypes,
|
|
216
|
+
parameterNames,
|
|
217
|
+
),
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
export interface DropIdentifierInfoArguments {
|
|
221
|
+
identifierInfo: RawTransactionArgument<string>;
|
|
222
|
+
}
|
|
223
|
+
export interface DropIdentifierInfoOptions {
|
|
224
|
+
package?: string;
|
|
225
|
+
arguments:
|
|
226
|
+
| DropIdentifierInfoArguments
|
|
227
|
+
| [identifierInfo: RawTransactionArgument<string>];
|
|
228
|
+
}
|
|
229
|
+
export function dropIdentifierInfo(options: DropIdentifierInfoOptions) {
|
|
230
|
+
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
231
|
+
const argumentsTypes = [
|
|
232
|
+
`${packageAddress}::identity::IdentifierInfo`,
|
|
233
|
+
] satisfies string[];
|
|
234
|
+
const parameterNames = ["identifierInfo"];
|
|
235
|
+
return (tx: Transaction) =>
|
|
236
|
+
tx.moveCall({
|
|
237
|
+
package: packageAddress,
|
|
238
|
+
module: "identity",
|
|
239
|
+
function: "drop_identifier_info",
|
|
240
|
+
arguments: normalizeMoveArguments(
|
|
241
|
+
options.arguments,
|
|
242
|
+
argumentsTypes,
|
|
243
|
+
parameterNames,
|
|
244
|
+
),
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
export interface OwnerArguments {
|
|
248
|
+
info: RawTransactionArgument<string>;
|
|
249
|
+
}
|
|
250
|
+
export interface OwnerOptions {
|
|
251
|
+
package?: string;
|
|
252
|
+
arguments: OwnerArguments | [info: RawTransactionArgument<string>];
|
|
253
|
+
}
|
|
254
|
+
export function owner(options: OwnerOptions) {
|
|
255
|
+
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
256
|
+
const argumentsTypes = [
|
|
257
|
+
`${packageAddress}::identity::IdentifierInfo`,
|
|
258
|
+
] satisfies string[];
|
|
259
|
+
const parameterNames = ["info"];
|
|
260
|
+
return (tx: Transaction) =>
|
|
261
|
+
tx.moveCall({
|
|
262
|
+
package: packageAddress,
|
|
263
|
+
module: "identity",
|
|
264
|
+
function: "owner",
|
|
265
|
+
arguments: normalizeMoveArguments(
|
|
266
|
+
options.arguments,
|
|
267
|
+
argumentsTypes,
|
|
268
|
+
parameterNames,
|
|
269
|
+
),
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
export interface UpdatedAtArguments {
|
|
273
|
+
info: RawTransactionArgument<string>;
|
|
274
|
+
}
|
|
275
|
+
export interface UpdatedAtOptions {
|
|
276
|
+
package?: string;
|
|
277
|
+
arguments: UpdatedAtArguments | [info: RawTransactionArgument<string>];
|
|
278
|
+
}
|
|
279
|
+
export function updatedAt(options: UpdatedAtOptions) {
|
|
280
|
+
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
281
|
+
const argumentsTypes = [
|
|
282
|
+
`${packageAddress}::identity::IdentifierInfo`,
|
|
283
|
+
] satisfies string[];
|
|
284
|
+
const parameterNames = ["info"];
|
|
285
|
+
return (tx: Transaction) =>
|
|
286
|
+
tx.moveCall({
|
|
287
|
+
package: packageAddress,
|
|
288
|
+
module: "identity",
|
|
289
|
+
function: "updated_at",
|
|
290
|
+
arguments: normalizeMoveArguments(
|
|
291
|
+
options.arguments,
|
|
292
|
+
argumentsTypes,
|
|
293
|
+
parameterNames,
|
|
294
|
+
),
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
export interface UpdateOwnerArguments {
|
|
298
|
+
info: RawTransactionArgument<string>;
|
|
299
|
+
owner: RawTransactionArgument<string>;
|
|
300
|
+
}
|
|
301
|
+
export interface UpdateOwnerOptions {
|
|
302
|
+
package?: string;
|
|
303
|
+
arguments:
|
|
304
|
+
| UpdateOwnerArguments
|
|
305
|
+
| [
|
|
306
|
+
info: RawTransactionArgument<string>,
|
|
307
|
+
owner: RawTransactionArgument<string>,
|
|
308
|
+
];
|
|
309
|
+
}
|
|
310
|
+
export function updateOwner(options: UpdateOwnerOptions) {
|
|
311
|
+
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
312
|
+
const argumentsTypes = [
|
|
313
|
+
`${packageAddress}::identity::IdentifierInfo`,
|
|
314
|
+
"address",
|
|
315
|
+
] satisfies string[];
|
|
316
|
+
const parameterNames = ["info", "owner"];
|
|
317
|
+
return (tx: Transaction) =>
|
|
318
|
+
tx.moveCall({
|
|
319
|
+
package: packageAddress,
|
|
320
|
+
module: "identity",
|
|
321
|
+
function: "update_owner",
|
|
322
|
+
arguments: normalizeMoveArguments(
|
|
323
|
+
options.arguments,
|
|
324
|
+
argumentsTypes,
|
|
325
|
+
parameterNames,
|
|
326
|
+
),
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
export interface UpdateUpdatedAtArguments {
|
|
330
|
+
info: RawTransactionArgument<string>;
|
|
331
|
+
updatedAt: RawTransactionArgument<number | bigint>;
|
|
332
|
+
}
|
|
333
|
+
export interface UpdateUpdatedAtOptions {
|
|
334
|
+
package?: string;
|
|
335
|
+
arguments:
|
|
336
|
+
| UpdateUpdatedAtArguments
|
|
337
|
+
| [
|
|
338
|
+
info: RawTransactionArgument<string>,
|
|
339
|
+
updatedAt: RawTransactionArgument<number | bigint>,
|
|
340
|
+
];
|
|
341
|
+
}
|
|
342
|
+
export function updateUpdatedAt(options: UpdateUpdatedAtOptions) {
|
|
343
|
+
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
344
|
+
const argumentsTypes = [
|
|
345
|
+
`${packageAddress}::identity::IdentifierInfo`,
|
|
346
|
+
"u64",
|
|
347
|
+
] satisfies string[];
|
|
348
|
+
const parameterNames = ["info", "updatedAt"];
|
|
349
|
+
return (tx: Transaction) =>
|
|
350
|
+
tx.moveCall({
|
|
351
|
+
package: packageAddress,
|
|
352
|
+
module: "identity",
|
|
353
|
+
function: "update_updated_at",
|
|
354
|
+
arguments: normalizeMoveArguments(
|
|
355
|
+
options.arguments,
|
|
356
|
+
argumentsTypes,
|
|
357
|
+
parameterNames,
|
|
358
|
+
),
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
export interface GetReadAccessArguments {
|
|
362
|
+
config: RawTransactionArgument<string>;
|
|
363
|
+
treasury: RawTransactionArgument<string>;
|
|
364
|
+
balance: RawTransactionArgument<string>;
|
|
365
|
+
}
|
|
366
|
+
export interface GetReadAccessOptions {
|
|
367
|
+
package?: string;
|
|
368
|
+
arguments:
|
|
369
|
+
| GetReadAccessArguments
|
|
370
|
+
| [
|
|
371
|
+
config: RawTransactionArgument<string>,
|
|
372
|
+
treasury: RawTransactionArgument<string>,
|
|
373
|
+
balance: RawTransactionArgument<string>,
|
|
374
|
+
];
|
|
375
|
+
}
|
|
376
|
+
export function getReadAccess(options: GetReadAccessOptions) {
|
|
377
|
+
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
378
|
+
const argumentsTypes = [
|
|
379
|
+
`${packageAddress}::config::Config`,
|
|
380
|
+
`${packageAddress}::treasury::Treasury`,
|
|
381
|
+
"0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI>",
|
|
382
|
+
] satisfies string[];
|
|
383
|
+
const parameterNames = ["config", "treasury", "balance"];
|
|
384
|
+
return (tx: Transaction) =>
|
|
385
|
+
tx.moveCall({
|
|
386
|
+
package: packageAddress,
|
|
387
|
+
module: "identity",
|
|
388
|
+
function: "get_read_access",
|
|
389
|
+
arguments: normalizeMoveArguments(
|
|
390
|
+
options.arguments,
|
|
391
|
+
argumentsTypes,
|
|
392
|
+
parameterNames,
|
|
393
|
+
),
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
export interface IdentifierByAddressWithReadAccessArguments {
|
|
397
|
+
self: RawTransactionArgument<string>;
|
|
398
|
+
Access: RawTransactionArgument<string>;
|
|
399
|
+
user: RawTransactionArgument<string>;
|
|
400
|
+
}
|
|
401
|
+
export interface IdentifierByAddressWithReadAccessOptions {
|
|
402
|
+
package?: string;
|
|
403
|
+
arguments:
|
|
404
|
+
| IdentifierByAddressWithReadAccessArguments
|
|
405
|
+
| [
|
|
406
|
+
self: RawTransactionArgument<string>,
|
|
407
|
+
Access: RawTransactionArgument<string>,
|
|
408
|
+
user: RawTransactionArgument<string>,
|
|
409
|
+
];
|
|
410
|
+
typeArguments: [string];
|
|
411
|
+
}
|
|
412
|
+
export function identifierByAddressWithReadAccess(
|
|
413
|
+
options: IdentifierByAddressWithReadAccessOptions,
|
|
414
|
+
) {
|
|
415
|
+
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
416
|
+
const argumentsTypes = [
|
|
417
|
+
`${packageAddress}::identity::IdentityManager<${options.typeArguments[0]}>`,
|
|
418
|
+
`${packageAddress}::identity::ReadAccess`,
|
|
419
|
+
"address",
|
|
420
|
+
] satisfies string[];
|
|
421
|
+
const parameterNames = ["self", "Access", "user"];
|
|
422
|
+
return (tx: Transaction) =>
|
|
423
|
+
tx.moveCall({
|
|
424
|
+
package: packageAddress,
|
|
425
|
+
module: "identity",
|
|
426
|
+
function: "identifier_by_address_with_read_access",
|
|
427
|
+
arguments: normalizeMoveArguments(
|
|
428
|
+
options.arguments,
|
|
429
|
+
argumentsTypes,
|
|
430
|
+
parameterNames,
|
|
431
|
+
),
|
|
432
|
+
typeArguments: options.typeArguments,
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
export interface IdentifierInfoWithReadAccessArguments {
|
|
436
|
+
self: RawTransactionArgument<string>;
|
|
437
|
+
Access: RawTransactionArgument<string>;
|
|
438
|
+
identifier: RawTransactionArgument<string>;
|
|
439
|
+
}
|
|
440
|
+
export interface IdentifierInfoWithReadAccessOptions {
|
|
441
|
+
package?: string;
|
|
442
|
+
arguments:
|
|
443
|
+
| IdentifierInfoWithReadAccessArguments
|
|
444
|
+
| [
|
|
445
|
+
self: RawTransactionArgument<string>,
|
|
446
|
+
Access: RawTransactionArgument<string>,
|
|
447
|
+
identifier: RawTransactionArgument<string>,
|
|
448
|
+
];
|
|
449
|
+
typeArguments: [string];
|
|
450
|
+
}
|
|
451
|
+
export function identifierInfoWithReadAccess(
|
|
452
|
+
options: IdentifierInfoWithReadAccessOptions,
|
|
453
|
+
) {
|
|
454
|
+
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
455
|
+
const argumentsTypes = [
|
|
456
|
+
`${packageAddress}::identity::IdentityManager<${options.typeArguments[0]}>`,
|
|
457
|
+
`${packageAddress}::identity::ReadAccess`,
|
|
458
|
+
"0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
|
|
459
|
+
] satisfies string[];
|
|
460
|
+
const parameterNames = ["self", "Access", "identifier"];
|
|
461
|
+
return (tx: Transaction) =>
|
|
462
|
+
tx.moveCall({
|
|
463
|
+
package: packageAddress,
|
|
464
|
+
module: "identity",
|
|
465
|
+
function: "identifier_info_with_read_access",
|
|
466
|
+
arguments: normalizeMoveArguments(
|
|
467
|
+
options.arguments,
|
|
468
|
+
argumentsTypes,
|
|
469
|
+
parameterNames,
|
|
470
|
+
),
|
|
471
|
+
typeArguments: options.typeArguments,
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
export interface NewArguments {
|
|
475
|
+
config: RawTransactionArgument<string>;
|
|
476
|
+
Cap: RawTransactionArgument<string>;
|
|
477
|
+
}
|
|
478
|
+
export interface NewOptions {
|
|
479
|
+
package?: string;
|
|
480
|
+
arguments:
|
|
481
|
+
| NewArguments
|
|
482
|
+
| [
|
|
483
|
+
config: RawTransactionArgument<string>,
|
|
484
|
+
Cap: RawTransactionArgument<string>,
|
|
485
|
+
];
|
|
486
|
+
typeArguments: [string];
|
|
487
|
+
}
|
|
488
|
+
export function _new(options: NewOptions) {
|
|
489
|
+
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
490
|
+
const argumentsTypes = [
|
|
491
|
+
`${packageAddress}::config::Config`,
|
|
492
|
+
`${packageAddress}::admin::AdminCap`,
|
|
493
|
+
] satisfies string[];
|
|
494
|
+
const parameterNames = ["config", "Cap"];
|
|
495
|
+
return (tx: Transaction) =>
|
|
496
|
+
tx.moveCall({
|
|
497
|
+
package: packageAddress,
|
|
498
|
+
module: "identity",
|
|
499
|
+
function: "new",
|
|
500
|
+
arguments: normalizeMoveArguments(
|
|
501
|
+
options.arguments,
|
|
502
|
+
argumentsTypes,
|
|
503
|
+
parameterNames,
|
|
504
|
+
),
|
|
505
|
+
typeArguments: options.typeArguments,
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
export interface AddWhiteslitArguments {
|
|
509
|
+
self: RawTransactionArgument<string>;
|
|
510
|
+
Cap: RawTransactionArgument<string>;
|
|
511
|
+
}
|
|
512
|
+
export interface AddWhiteslitOptions {
|
|
513
|
+
package?: string;
|
|
514
|
+
arguments:
|
|
515
|
+
| AddWhiteslitArguments
|
|
516
|
+
| [
|
|
517
|
+
self: RawTransactionArgument<string>,
|
|
518
|
+
Cap: RawTransactionArgument<string>,
|
|
519
|
+
];
|
|
520
|
+
typeArguments: [string, string];
|
|
521
|
+
}
|
|
522
|
+
export function addWhiteslit(options: AddWhiteslitOptions) {
|
|
523
|
+
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
524
|
+
const argumentsTypes = [
|
|
525
|
+
`${packageAddress}::identity::IdentityManager<${options.typeArguments[0]}>`,
|
|
526
|
+
`${packageAddress}::admin::AdminCap`,
|
|
527
|
+
] satisfies string[];
|
|
528
|
+
const parameterNames = ["self", "Cap"];
|
|
529
|
+
return (tx: Transaction) =>
|
|
530
|
+
tx.moveCall({
|
|
531
|
+
package: packageAddress,
|
|
532
|
+
module: "identity",
|
|
533
|
+
function: "add_whiteslit",
|
|
534
|
+
arguments: normalizeMoveArguments(
|
|
535
|
+
options.arguments,
|
|
536
|
+
argumentsTypes,
|
|
537
|
+
parameterNames,
|
|
538
|
+
),
|
|
539
|
+
typeArguments: options.typeArguments,
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
export interface RemoveWhiteslitArguments {
|
|
543
|
+
self: RawTransactionArgument<string>;
|
|
544
|
+
Cap: RawTransactionArgument<string>;
|
|
545
|
+
}
|
|
546
|
+
export interface RemoveWhiteslitOptions {
|
|
547
|
+
package?: string;
|
|
548
|
+
arguments:
|
|
549
|
+
| RemoveWhiteslitArguments
|
|
550
|
+
| [
|
|
551
|
+
self: RawTransactionArgument<string>,
|
|
552
|
+
Cap: RawTransactionArgument<string>,
|
|
553
|
+
];
|
|
554
|
+
typeArguments: [string, string];
|
|
555
|
+
}
|
|
556
|
+
export function removeWhiteslit(options: RemoveWhiteslitOptions) {
|
|
557
|
+
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
558
|
+
const argumentsTypes = [
|
|
559
|
+
`${packageAddress}::identity::IdentityManager<${options.typeArguments[0]}>`,
|
|
560
|
+
`${packageAddress}::admin::AdminCap`,
|
|
561
|
+
] satisfies string[];
|
|
562
|
+
const parameterNames = ["self", "Cap"];
|
|
563
|
+
return (tx: Transaction) =>
|
|
564
|
+
tx.moveCall({
|
|
565
|
+
package: packageAddress,
|
|
566
|
+
module: "identity",
|
|
567
|
+
function: "remove_whiteslit",
|
|
568
|
+
arguments: normalizeMoveArguments(
|
|
569
|
+
options.arguments,
|
|
570
|
+
argumentsTypes,
|
|
571
|
+
parameterNames,
|
|
572
|
+
),
|
|
573
|
+
typeArguments: options.typeArguments,
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
export interface IdentifierByAddressWithWhitelistArguments<
|
|
577
|
+
Whitelist extends BcsType<any>,
|
|
578
|
+
> {
|
|
579
|
+
self: RawTransactionArgument<string>;
|
|
580
|
+
_: RawTransactionArgument<Whitelist>;
|
|
581
|
+
user: RawTransactionArgument<string>;
|
|
582
|
+
}
|
|
583
|
+
export interface IdentifierByAddressWithWhitelistOptions<
|
|
584
|
+
Whitelist extends BcsType<any>,
|
|
585
|
+
> {
|
|
586
|
+
package?: string;
|
|
587
|
+
arguments:
|
|
588
|
+
| IdentifierByAddressWithWhitelistArguments<Whitelist>
|
|
589
|
+
| [
|
|
590
|
+
self: RawTransactionArgument<string>,
|
|
591
|
+
_: RawTransactionArgument<Whitelist>,
|
|
592
|
+
user: RawTransactionArgument<string>,
|
|
593
|
+
];
|
|
594
|
+
typeArguments: [string, string];
|
|
595
|
+
}
|
|
596
|
+
export function identifierByAddressWithWhitelist<
|
|
597
|
+
Whitelist extends BcsType<any>,
|
|
598
|
+
>(options: IdentifierByAddressWithWhitelistOptions<Whitelist>) {
|
|
599
|
+
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
600
|
+
const argumentsTypes = [
|
|
601
|
+
`${packageAddress}::identity::IdentityManager<${options.typeArguments[0]}>`,
|
|
602
|
+
`${options.typeArguments[1]}`,
|
|
603
|
+
"address",
|
|
604
|
+
] satisfies string[];
|
|
605
|
+
const parameterNames = ["self", "_", "user"];
|
|
606
|
+
return (tx: Transaction) =>
|
|
607
|
+
tx.moveCall({
|
|
608
|
+
package: packageAddress,
|
|
609
|
+
module: "identity",
|
|
610
|
+
function: "identifier_by_address_with_whitelist",
|
|
611
|
+
arguments: normalizeMoveArguments(
|
|
612
|
+
options.arguments,
|
|
613
|
+
argumentsTypes,
|
|
614
|
+
parameterNames,
|
|
615
|
+
),
|
|
616
|
+
typeArguments: options.typeArguments,
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
export interface IdentifierInfoWithWhitelistArguments<
|
|
620
|
+
Whitelist extends BcsType<any>,
|
|
621
|
+
> {
|
|
622
|
+
self: RawTransactionArgument<string>;
|
|
623
|
+
_: RawTransactionArgument<Whitelist>;
|
|
624
|
+
identifier: RawTransactionArgument<string>;
|
|
625
|
+
}
|
|
626
|
+
export interface IdentifierInfoWithWhitelistOptions<
|
|
627
|
+
Whitelist extends BcsType<any>,
|
|
628
|
+
> {
|
|
629
|
+
package?: string;
|
|
630
|
+
arguments:
|
|
631
|
+
| IdentifierInfoWithWhitelistArguments<Whitelist>
|
|
632
|
+
| [
|
|
633
|
+
self: RawTransactionArgument<string>,
|
|
634
|
+
_: RawTransactionArgument<Whitelist>,
|
|
635
|
+
identifier: RawTransactionArgument<string>,
|
|
636
|
+
];
|
|
637
|
+
typeArguments: [string, string];
|
|
638
|
+
}
|
|
639
|
+
export function identifierInfoWithWhitelist<Whitelist extends BcsType<any>>(
|
|
640
|
+
options: IdentifierInfoWithWhitelistOptions<Whitelist>,
|
|
641
|
+
) {
|
|
642
|
+
const packageAddress = options.package ?? "@local-pkg/zing_identity";
|
|
643
|
+
const argumentsTypes = [
|
|
644
|
+
`${packageAddress}::identity::IdentityManager<${options.typeArguments[0]}>`,
|
|
645
|
+
`${options.typeArguments[1]}`,
|
|
646
|
+
"0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
|
|
647
|
+
] satisfies string[];
|
|
648
|
+
const parameterNames = ["self", "_", "identifier"];
|
|
649
|
+
return (tx: Transaction) =>
|
|
650
|
+
tx.moveCall({
|
|
651
|
+
package: packageAddress,
|
|
652
|
+
module: "identity",
|
|
653
|
+
function: "identifier_info_with_whitelist",
|
|
654
|
+
arguments: normalizeMoveArguments(
|
|
655
|
+
options.arguments,
|
|
656
|
+
argumentsTypes,
|
|
657
|
+
parameterNames,
|
|
658
|
+
),
|
|
659
|
+
typeArguments: options.typeArguments,
|
|
660
|
+
});
|
|
661
|
+
}
|