@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.
Files changed (87) hide show
  1. package/README.md +12 -0
  2. package/package.json +37 -0
  3. package/src/_generated/index.js +6 -0
  4. package/src/_generated/utils/index.ts +181 -0
  5. package/src/_generated/zing_framework/coin_utils.ts +41 -0
  6. package/src/_generated/zing_framework/deps/sui/object.ts +16 -0
  7. package/src/_generated/zing_framework/derived_object_bag.ts +400 -0
  8. package/src/_generated/zing_framework/derived_table.ts +366 -0
  9. package/src/_generated/zing_governance/admin.ts +47 -0
  10. package/src/_generated/zing_governance/deps/sui/object.ts +16 -0
  11. package/src/_generated/zing_governance/treasury.ts +134 -0
  12. package/src/_generated/zing_identity/config.ts +191 -0
  13. package/src/_generated/zing_identity/deps/std/type_name.ts +25 -0
  14. package/src/_generated/zing_identity/deps/sui/object.ts +16 -0
  15. package/src/_generated/zing_identity/deps/sui/object_table.ts +26 -0
  16. package/src/_generated/zing_identity/deps/sui/table.ts +38 -0
  17. package/src/_generated/zing_identity/deps/sui/vec_set.ts +28 -0
  18. package/src/_generated/zing_identity/ecdsa.ts +166 -0
  19. package/src/_generated/zing_identity/identity.ts +661 -0
  20. package/src/_generated/zing_identity/reclaim.ts +803 -0
  21. package/src/_generated/zing_studio/app.ts +855 -0
  22. package/src/_generated/zing_studio/article.ts +598 -0
  23. package/src/_generated/zing_studio/config.ts +475 -0
  24. package/src/_generated/zing_studio/deps/std/type_name.ts +25 -0
  25. package/src/_generated/zing_studio/deps/sui/bag.ts +43 -0
  26. package/src/_generated/zing_studio/deps/sui/balance.ts +20 -0
  27. package/src/_generated/zing_studio/deps/sui/coin.ts +21 -0
  28. package/src/_generated/zing_studio/deps/sui/dynamic_field.ts +272 -0
  29. package/src/_generated/zing_studio/deps/sui/object.ts +16 -0
  30. package/src/_generated/zing_studio/deps/sui/table.ts +38 -0
  31. package/src/_generated/zing_studio/deps/sui/vec_map.ts +39 -0
  32. package/src/_generated/zing_studio/deps/sui/vec_set.ts +28 -0
  33. package/src/_generated/zing_studio/deps/walrus/blob.ts +22 -0
  34. package/src/_generated/zing_studio/deps/walrus/events.ts +124 -0
  35. package/src/_generated/zing_studio/deps/walrus/metadata.ts +137 -0
  36. package/src/_generated/zing_studio/deps/walrus/storage_resource.ts +17 -0
  37. package/src/_generated/zing_studio/deps/zing_framework/derived_object_bag.ts +17 -0
  38. package/src/_generated/zing_studio/deps/zing_framework/derived_table.ts +17 -0
  39. package/src/_generated/zing_studio/donation.ts +18 -0
  40. package/src/_generated/zing_studio/enclave.ts +466 -0
  41. package/src/_generated/zing_studio/nitro_attestation.ts +308 -0
  42. package/src/_generated/zing_studio/referral.ts +447 -0
  43. package/src/_generated/zing_studio/storage.ts +664 -0
  44. package/src/_generated/zing_studio/studio.ts +682 -0
  45. package/src/bcs.ts +139 -0
  46. package/src/client/index.ts +557 -0
  47. package/src/client/types.ts +28 -0
  48. package/src/components/index.ts +3 -0
  49. package/src/components/wallet-provider.tsx +53 -0
  50. package/src/components/walrus-provider.tsx +212 -0
  51. package/src/components/zing-provider.tsx +54 -0
  52. package/src/config/common.ts +82 -0
  53. package/src/config/index.ts +45 -0
  54. package/src/config/mainnet.ts +109 -0
  55. package/src/config/testnet.ts +111 -0
  56. package/src/config/types.ts +69 -0
  57. package/src/const.ts +32 -0
  58. package/src/getters.ts +523 -0
  59. package/src/hooks/index.ts +14 -0
  60. package/src/hooks/useGetStudio.ts +22 -0
  61. package/src/hooks/useGetTierPlan.ts +115 -0
  62. package/src/hooks/useReclaim.ts +165 -0
  63. package/src/hooks/useSignAndExecuteTransaction.ts +57 -0
  64. package/src/hooks/useSignPersonalMessage.ts +28 -0
  65. package/src/hooks/useZingInfiniteQueries.ts +92 -0
  66. package/src/hooks/useZingMutation.ts +66 -0
  67. package/src/hooks/useZingQueries.ts +107 -0
  68. package/src/hooks/useZingQuery.ts +88 -0
  69. package/src/index.ts +15 -0
  70. package/src/lib/utils/colorful-logger.ts +27 -0
  71. package/src/lib/utils/const.ts +25 -0
  72. package/src/lib/utils/helpers.ts +78 -0
  73. package/src/lib/utils/index.ts +5 -0
  74. package/src/lib/utils/init-app-with-shadow.ts +42 -0
  75. package/src/lib/utils/quilt.ts +317 -0
  76. package/src/lib/utils/reclaim.ts +148 -0
  77. package/src/lib/utils/types.ts +14 -0
  78. package/src/mutations/index.ts +3 -0
  79. package/src/mutations/seal.ts +78 -0
  80. package/src/mutations/signer.ts +241 -0
  81. package/src/mutations/walrus.ts +862 -0
  82. package/src/stores/index.ts +3 -0
  83. package/src/stores/walletStore.ts +360 -0
  84. package/src/stores/walrusStore.ts +118 -0
  85. package/src/stores/zkloginStore.ts +53 -0
  86. package/src/types.ts +120 -0
  87. package/tsconfig.json +12 -0
@@ -0,0 +1,803 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ import * as object from "./deps/sui/object.js";
5
+ import * as object_table from "./deps/sui/object_table.js";
6
+ import * as table from "./deps/sui/table.js";
7
+ import { MoveStruct, normalizeMoveArguments } from "../utils/index.js";
8
+ import { bcs } from "@mysten/sui/bcs";
9
+ import type { RawTransactionArgument } from "../utils/index.js";
10
+ import type { Transaction } from "@mysten/sui/transactions";
11
+
12
+ const $moduleName = "@local-pkg/zing_identity::reclaim";
13
+ export const ReclaimManager = new MoveStruct({
14
+ name: `${$moduleName}::ReclaimManager`,
15
+ fields: {
16
+ id: object.UID,
17
+ witnesses: bcs.vector(bcs.vector(bcs.u8())),
18
+ witnesses_num_threshold: bcs.u8(),
19
+ commitments: object_table.ObjectTable,
20
+ identifier_hash_to_commitment: table.Table,
21
+ max_reveal_window: bcs.u64(),
22
+ },
23
+ });
24
+ export const ClaimInfo = new MoveStruct({
25
+ name: `${$moduleName}::ClaimInfo`,
26
+ fields: {
27
+ provider: bcs.string(),
28
+ parameters: bcs.string(),
29
+ context: bcs.string(),
30
+ },
31
+ });
32
+ export const ClaimData = new MoveStruct({
33
+ name: `${$moduleName}::ClaimData`,
34
+ fields: {
35
+ identifier: bcs.string(),
36
+ owner: bcs.string(),
37
+ epoch: bcs.string(),
38
+ timestamp_s: bcs.string(),
39
+ },
40
+ });
41
+ export const SignedClaim = new MoveStruct({
42
+ name: `${$moduleName}::SignedClaim`,
43
+ fields: {
44
+ claim: ClaimData,
45
+ signatures: bcs.vector(bcs.vector(bcs.u8())),
46
+ },
47
+ });
48
+ export const Proof = new MoveStruct({
49
+ name: `${$moduleName}::Proof`,
50
+ fields: {
51
+ id: object.UID,
52
+ claimed_at: bcs.u64(),
53
+ claim_info: ClaimInfo,
54
+ signed_claim: SignedClaim,
55
+ },
56
+ });
57
+ export const ProofCommitment = new MoveStruct({
58
+ name: `${$moduleName}::ProofCommitment`,
59
+ fields: {
60
+ id: object.UID,
61
+ commitment_hash: bcs.vector(bcs.u8()),
62
+ committer: bcs.Address,
63
+ commit_timestamp: bcs.u64(),
64
+ identifier_hash: bcs.vector(bcs.u8()),
65
+ },
66
+ });
67
+ export interface NewClaimInfoArguments {
68
+ provider: RawTransactionArgument<string>;
69
+ parameters: RawTransactionArgument<string>;
70
+ context: RawTransactionArgument<string>;
71
+ }
72
+ export interface NewClaimInfoOptions {
73
+ package?: string;
74
+ arguments:
75
+ | NewClaimInfoArguments
76
+ | [
77
+ provider: RawTransactionArgument<string>,
78
+ parameters: RawTransactionArgument<string>,
79
+ context: RawTransactionArgument<string>,
80
+ ];
81
+ }
82
+ export function newClaimInfo(options: NewClaimInfoOptions) {
83
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
84
+ const argumentsTypes = [
85
+ "0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
86
+ "0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
87
+ "0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
88
+ ] satisfies string[];
89
+ const parameterNames = ["provider", "parameters", "context"];
90
+ return (tx: Transaction) =>
91
+ tx.moveCall({
92
+ package: packageAddress,
93
+ module: "reclaim",
94
+ function: "new_claim_info",
95
+ arguments: normalizeMoveArguments(
96
+ options.arguments,
97
+ argumentsTypes,
98
+ parameterNames,
99
+ ),
100
+ });
101
+ }
102
+ export interface ProviderArguments {
103
+ claimInfo: RawTransactionArgument<string>;
104
+ }
105
+ export interface ProviderOptions {
106
+ package?: string;
107
+ arguments: ProviderArguments | [claimInfo: RawTransactionArgument<string>];
108
+ }
109
+ export function provider(options: ProviderOptions) {
110
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
111
+ const argumentsTypes = [
112
+ `${packageAddress}::reclaim::ClaimInfo`,
113
+ ] satisfies string[];
114
+ const parameterNames = ["claimInfo"];
115
+ return (tx: Transaction) =>
116
+ tx.moveCall({
117
+ package: packageAddress,
118
+ module: "reclaim",
119
+ function: "provider",
120
+ arguments: normalizeMoveArguments(
121
+ options.arguments,
122
+ argumentsTypes,
123
+ parameterNames,
124
+ ),
125
+ });
126
+ }
127
+ export interface ParametersArguments {
128
+ claimInfo: RawTransactionArgument<string>;
129
+ }
130
+ export interface ParametersOptions {
131
+ package?: string;
132
+ arguments: ParametersArguments | [claimInfo: RawTransactionArgument<string>];
133
+ }
134
+ export function parameters(options: ParametersOptions) {
135
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
136
+ const argumentsTypes = [
137
+ `${packageAddress}::reclaim::ClaimInfo`,
138
+ ] satisfies string[];
139
+ const parameterNames = ["claimInfo"];
140
+ return (tx: Transaction) =>
141
+ tx.moveCall({
142
+ package: packageAddress,
143
+ module: "reclaim",
144
+ function: "parameters",
145
+ arguments: normalizeMoveArguments(
146
+ options.arguments,
147
+ argumentsTypes,
148
+ parameterNames,
149
+ ),
150
+ });
151
+ }
152
+ export interface ContextArguments {
153
+ claimInfo: RawTransactionArgument<string>;
154
+ }
155
+ export interface ContextOptions {
156
+ package?: string;
157
+ arguments: ContextArguments | [claimInfo: RawTransactionArgument<string>];
158
+ }
159
+ export function context(options: ContextOptions) {
160
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
161
+ const argumentsTypes = [
162
+ `${packageAddress}::reclaim::ClaimInfo`,
163
+ ] satisfies string[];
164
+ const parameterNames = ["claimInfo"];
165
+ return (tx: Transaction) =>
166
+ tx.moveCall({
167
+ package: packageAddress,
168
+ module: "reclaim",
169
+ function: "context",
170
+ arguments: normalizeMoveArguments(
171
+ options.arguments,
172
+ argumentsTypes,
173
+ parameterNames,
174
+ ),
175
+ });
176
+ }
177
+ export interface IdentifierArguments {
178
+ claimData: RawTransactionArgument<string>;
179
+ }
180
+ export interface IdentifierOptions {
181
+ package?: string;
182
+ arguments: IdentifierArguments | [claimData: RawTransactionArgument<string>];
183
+ }
184
+ export function identifier(options: IdentifierOptions) {
185
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
186
+ const argumentsTypes = [
187
+ `${packageAddress}::reclaim::ClaimData`,
188
+ ] satisfies string[];
189
+ const parameterNames = ["claimData"];
190
+ return (tx: Transaction) =>
191
+ tx.moveCall({
192
+ package: packageAddress,
193
+ module: "reclaim",
194
+ function: "identifier",
195
+ arguments: normalizeMoveArguments(
196
+ options.arguments,
197
+ argumentsTypes,
198
+ parameterNames,
199
+ ),
200
+ });
201
+ }
202
+ export interface OwnerArguments {
203
+ claimData: RawTransactionArgument<string>;
204
+ }
205
+ export interface OwnerOptions {
206
+ package?: string;
207
+ arguments: OwnerArguments | [claimData: RawTransactionArgument<string>];
208
+ }
209
+ export function owner(options: OwnerOptions) {
210
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
211
+ const argumentsTypes = [
212
+ `${packageAddress}::reclaim::ClaimData`,
213
+ ] satisfies string[];
214
+ const parameterNames = ["claimData"];
215
+ return (tx: Transaction) =>
216
+ tx.moveCall({
217
+ package: packageAddress,
218
+ module: "reclaim",
219
+ function: "owner",
220
+ arguments: normalizeMoveArguments(
221
+ options.arguments,
222
+ argumentsTypes,
223
+ parameterNames,
224
+ ),
225
+ });
226
+ }
227
+ export interface EpochArguments {
228
+ claimData: RawTransactionArgument<string>;
229
+ }
230
+ export interface EpochOptions {
231
+ package?: string;
232
+ arguments: EpochArguments | [claimData: RawTransactionArgument<string>];
233
+ }
234
+ export function epoch(options: EpochOptions) {
235
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
236
+ const argumentsTypes = [
237
+ `${packageAddress}::reclaim::ClaimData`,
238
+ ] satisfies string[];
239
+ const parameterNames = ["claimData"];
240
+ return (tx: Transaction) =>
241
+ tx.moveCall({
242
+ package: packageAddress,
243
+ module: "reclaim",
244
+ function: "epoch",
245
+ arguments: normalizeMoveArguments(
246
+ options.arguments,
247
+ argumentsTypes,
248
+ parameterNames,
249
+ ),
250
+ });
251
+ }
252
+ export interface TimestampSArguments {
253
+ claimData: RawTransactionArgument<string>;
254
+ }
255
+ export interface TimestampSOptions {
256
+ package?: string;
257
+ arguments: TimestampSArguments | [claimData: RawTransactionArgument<string>];
258
+ }
259
+ export function timestampS(options: TimestampSOptions) {
260
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
261
+ const argumentsTypes = [
262
+ `${packageAddress}::reclaim::ClaimData`,
263
+ ] satisfies string[];
264
+ const parameterNames = ["claimData"];
265
+ return (tx: Transaction) =>
266
+ tx.moveCall({
267
+ package: packageAddress,
268
+ module: "reclaim",
269
+ function: "timestamp_s",
270
+ arguments: normalizeMoveArguments(
271
+ options.arguments,
272
+ argumentsTypes,
273
+ parameterNames,
274
+ ),
275
+ });
276
+ }
277
+ export interface NewClaimDataArguments {
278
+ identifier: RawTransactionArgument<string>;
279
+ owner: RawTransactionArgument<string>;
280
+ epoch: RawTransactionArgument<string>;
281
+ timestampS: RawTransactionArgument<number | bigint>;
282
+ }
283
+ export interface NewClaimDataOptions {
284
+ package?: string;
285
+ arguments:
286
+ | NewClaimDataArguments
287
+ | [
288
+ identifier: RawTransactionArgument<string>,
289
+ owner: RawTransactionArgument<string>,
290
+ epoch: RawTransactionArgument<string>,
291
+ timestampS: RawTransactionArgument<number | bigint>,
292
+ ];
293
+ }
294
+ export function newClaimData(options: NewClaimDataOptions) {
295
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
296
+ const argumentsTypes = [
297
+ "0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
298
+ "0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
299
+ "0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
300
+ "u64",
301
+ ] satisfies string[];
302
+ const parameterNames = ["identifier", "owner", "epoch", "timestampS"];
303
+ return (tx: Transaction) =>
304
+ tx.moveCall({
305
+ package: packageAddress,
306
+ module: "reclaim",
307
+ function: "new_claim_data",
308
+ arguments: normalizeMoveArguments(
309
+ options.arguments,
310
+ argumentsTypes,
311
+ parameterNames,
312
+ ),
313
+ });
314
+ }
315
+ export interface ClaimDataArguments {
316
+ signedClaim: RawTransactionArgument<string>;
317
+ }
318
+ export interface ClaimDataOptions {
319
+ package?: string;
320
+ arguments: ClaimDataArguments | [signedClaim: RawTransactionArgument<string>];
321
+ }
322
+ export function claimData(options: ClaimDataOptions) {
323
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
324
+ const argumentsTypes = [
325
+ `${packageAddress}::reclaim::SignedClaim`,
326
+ ] satisfies string[];
327
+ const parameterNames = ["signedClaim"];
328
+ return (tx: Transaction) =>
329
+ tx.moveCall({
330
+ package: packageAddress,
331
+ module: "reclaim",
332
+ function: "claim_data",
333
+ arguments: normalizeMoveArguments(
334
+ options.arguments,
335
+ argumentsTypes,
336
+ parameterNames,
337
+ ),
338
+ });
339
+ }
340
+ export interface SignaturesArguments {
341
+ signedClaim: RawTransactionArgument<string>;
342
+ }
343
+ export interface SignaturesOptions {
344
+ package?: string;
345
+ arguments:
346
+ | SignaturesArguments
347
+ | [signedClaim: RawTransactionArgument<string>];
348
+ }
349
+ export function signatures(options: SignaturesOptions) {
350
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
351
+ const argumentsTypes = [
352
+ `${packageAddress}::reclaim::SignedClaim`,
353
+ ] satisfies string[];
354
+ const parameterNames = ["signedClaim"];
355
+ return (tx: Transaction) =>
356
+ tx.moveCall({
357
+ package: packageAddress,
358
+ module: "reclaim",
359
+ function: "signatures",
360
+ arguments: normalizeMoveArguments(
361
+ options.arguments,
362
+ argumentsTypes,
363
+ parameterNames,
364
+ ),
365
+ });
366
+ }
367
+ export interface NewSignedClaimArguments {
368
+ claim: RawTransactionArgument<string>;
369
+ signatures: RawTransactionArgument<number[][]>;
370
+ }
371
+ export interface NewSignedClaimOptions {
372
+ package?: string;
373
+ arguments:
374
+ | NewSignedClaimArguments
375
+ | [
376
+ claim: RawTransactionArgument<string>,
377
+ signatures: RawTransactionArgument<number[][]>,
378
+ ];
379
+ }
380
+ export function newSignedClaim(options: NewSignedClaimOptions) {
381
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
382
+ const argumentsTypes = [
383
+ `${packageAddress}::reclaim::ClaimData`,
384
+ "vector<vector<u8>>",
385
+ ] satisfies string[];
386
+ const parameterNames = ["claim", "signatures"];
387
+ return (tx: Transaction) =>
388
+ tx.moveCall({
389
+ package: packageAddress,
390
+ module: "reclaim",
391
+ function: "new_signed_claim",
392
+ arguments: normalizeMoveArguments(
393
+ options.arguments,
394
+ argumentsTypes,
395
+ parameterNames,
396
+ ),
397
+ });
398
+ }
399
+ export interface ProofClaimedAtArguments {
400
+ proof: RawTransactionArgument<string>;
401
+ }
402
+ export interface ProofClaimedAtOptions {
403
+ package?: string;
404
+ arguments: ProofClaimedAtArguments | [proof: RawTransactionArgument<string>];
405
+ typeArguments: [string];
406
+ }
407
+ export function proofClaimedAt(options: ProofClaimedAtOptions) {
408
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
409
+ const argumentsTypes = [
410
+ `${packageAddress}::reclaim::Proof<${options.typeArguments[0]}>`,
411
+ ] satisfies string[];
412
+ const parameterNames = ["proof"];
413
+ return (tx: Transaction) =>
414
+ tx.moveCall({
415
+ package: packageAddress,
416
+ module: "reclaim",
417
+ function: "proof_claimed_at",
418
+ arguments: normalizeMoveArguments(
419
+ options.arguments,
420
+ argumentsTypes,
421
+ parameterNames,
422
+ ),
423
+ typeArguments: options.typeArguments,
424
+ });
425
+ }
426
+ export interface ProofClaimInfoArguments {
427
+ proof: RawTransactionArgument<string>;
428
+ }
429
+ export interface ProofClaimInfoOptions {
430
+ package?: string;
431
+ arguments: ProofClaimInfoArguments | [proof: RawTransactionArgument<string>];
432
+ typeArguments: [string];
433
+ }
434
+ export function proofClaimInfo(options: ProofClaimInfoOptions) {
435
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
436
+ const argumentsTypes = [
437
+ `${packageAddress}::reclaim::Proof<${options.typeArguments[0]}>`,
438
+ ] satisfies string[];
439
+ const parameterNames = ["proof"];
440
+ return (tx: Transaction) =>
441
+ tx.moveCall({
442
+ package: packageAddress,
443
+ module: "reclaim",
444
+ function: "proof_claim_info",
445
+ arguments: normalizeMoveArguments(
446
+ options.arguments,
447
+ argumentsTypes,
448
+ parameterNames,
449
+ ),
450
+ typeArguments: options.typeArguments,
451
+ });
452
+ }
453
+ export interface ProofSignedClaimArguments {
454
+ proof: RawTransactionArgument<string>;
455
+ }
456
+ export interface ProofSignedClaimOptions {
457
+ package?: string;
458
+ arguments:
459
+ | ProofSignedClaimArguments
460
+ | [proof: RawTransactionArgument<string>];
461
+ typeArguments: [string];
462
+ }
463
+ export function proofSignedClaim(options: ProofSignedClaimOptions) {
464
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
465
+ const argumentsTypes = [
466
+ `${packageAddress}::reclaim::Proof<${options.typeArguments[0]}>`,
467
+ ] satisfies string[];
468
+ const parameterNames = ["proof"];
469
+ return (tx: Transaction) =>
470
+ tx.moveCall({
471
+ package: packageAddress,
472
+ module: "reclaim",
473
+ function: "proof_signed_claim",
474
+ arguments: normalizeMoveArguments(
475
+ options.arguments,
476
+ argumentsTypes,
477
+ parameterNames,
478
+ ),
479
+ typeArguments: options.typeArguments,
480
+ });
481
+ }
482
+ export interface UpdateWitnessesArguments {
483
+ self: RawTransactionArgument<string>;
484
+ Cap: RawTransactionArgument<string>;
485
+ witnesses: RawTransactionArgument<number[][]>;
486
+ }
487
+ export interface UpdateWitnessesOptions {
488
+ package?: string;
489
+ arguments:
490
+ | UpdateWitnessesArguments
491
+ | [
492
+ self: RawTransactionArgument<string>,
493
+ Cap: RawTransactionArgument<string>,
494
+ witnesses: RawTransactionArgument<number[][]>,
495
+ ];
496
+ typeArguments: [string];
497
+ }
498
+ export function updateWitnesses(options: UpdateWitnessesOptions) {
499
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
500
+ const argumentsTypes = [
501
+ `${packageAddress}::reclaim::ReclaimManager<${options.typeArguments[0]}>`,
502
+ `${packageAddress}::admin::AdminCap`,
503
+ "vector<vector<u8>>",
504
+ ] satisfies string[];
505
+ const parameterNames = ["self", "Cap", "witnesses"];
506
+ return (tx: Transaction) =>
507
+ tx.moveCall({
508
+ package: packageAddress,
509
+ module: "reclaim",
510
+ function: "update_witnesses",
511
+ arguments: normalizeMoveArguments(
512
+ options.arguments,
513
+ argumentsTypes,
514
+ parameterNames,
515
+ ),
516
+ typeArguments: options.typeArguments,
517
+ });
518
+ }
519
+ export interface UpdateWitnessesNumThresholdArguments {
520
+ self: RawTransactionArgument<string>;
521
+ Cap: RawTransactionArgument<string>;
522
+ witnessesNumThreshold: RawTransactionArgument<number>;
523
+ }
524
+ export interface UpdateWitnessesNumThresholdOptions {
525
+ package?: string;
526
+ arguments:
527
+ | UpdateWitnessesNumThresholdArguments
528
+ | [
529
+ self: RawTransactionArgument<string>,
530
+ Cap: RawTransactionArgument<string>,
531
+ witnessesNumThreshold: RawTransactionArgument<number>,
532
+ ];
533
+ typeArguments: [string];
534
+ }
535
+ export function updateWitnessesNumThreshold(
536
+ options: UpdateWitnessesNumThresholdOptions,
537
+ ) {
538
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
539
+ const argumentsTypes = [
540
+ `${packageAddress}::reclaim::ReclaimManager<${options.typeArguments[0]}>`,
541
+ `${packageAddress}::admin::AdminCap`,
542
+ "u8",
543
+ ] satisfies string[];
544
+ const parameterNames = ["self", "Cap", "witnessesNumThreshold"];
545
+ return (tx: Transaction) =>
546
+ tx.moveCall({
547
+ package: packageAddress,
548
+ module: "reclaim",
549
+ function: "update_witnesses_num_threshold",
550
+ arguments: normalizeMoveArguments(
551
+ options.arguments,
552
+ argumentsTypes,
553
+ parameterNames,
554
+ ),
555
+ typeArguments: options.typeArguments,
556
+ });
557
+ }
558
+ export interface UpdateMaxRevealWindowArguments {
559
+ self: RawTransactionArgument<string>;
560
+ Cap: RawTransactionArgument<string>;
561
+ maxRevealWindow: RawTransactionArgument<number | bigint>;
562
+ }
563
+ export interface UpdateMaxRevealWindowOptions {
564
+ package?: string;
565
+ arguments:
566
+ | UpdateMaxRevealWindowArguments
567
+ | [
568
+ self: RawTransactionArgument<string>,
569
+ Cap: RawTransactionArgument<string>,
570
+ maxRevealWindow: RawTransactionArgument<number | bigint>,
571
+ ];
572
+ typeArguments: [string];
573
+ }
574
+ export function updateMaxRevealWindow(options: UpdateMaxRevealWindowOptions) {
575
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
576
+ const argumentsTypes = [
577
+ `${packageAddress}::reclaim::ReclaimManager<${options.typeArguments[0]}>`,
578
+ `${packageAddress}::admin::AdminCap`,
579
+ "u64",
580
+ ] satisfies string[];
581
+ const parameterNames = ["self", "Cap", "maxRevealWindow"];
582
+ return (tx: Transaction) =>
583
+ tx.moveCall({
584
+ package: packageAddress,
585
+ module: "reclaim",
586
+ function: "update_max_reveal_window",
587
+ arguments: normalizeMoveArguments(
588
+ options.arguments,
589
+ argumentsTypes,
590
+ parameterNames,
591
+ ),
592
+ typeArguments: options.typeArguments,
593
+ });
594
+ }
595
+ export interface CleanupExpiredCommitmentsArguments {
596
+ self: RawTransactionArgument<string>;
597
+ Cap: RawTransactionArgument<string>;
598
+ commitmentIds: RawTransactionArgument<string[]>;
599
+ }
600
+ export interface CleanupExpiredCommitmentsOptions {
601
+ package?: string;
602
+ arguments:
603
+ | CleanupExpiredCommitmentsArguments
604
+ | [
605
+ self: RawTransactionArgument<string>,
606
+ Cap: RawTransactionArgument<string>,
607
+ commitmentIds: RawTransactionArgument<string[]>,
608
+ ];
609
+ typeArguments: [string];
610
+ }
611
+ export function cleanupExpiredCommitments(
612
+ options: CleanupExpiredCommitmentsOptions,
613
+ ) {
614
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
615
+ const argumentsTypes = [
616
+ `${packageAddress}::reclaim::ReclaimManager<${options.typeArguments[0]}>`,
617
+ `${packageAddress}::admin::AdminCap`,
618
+ "vector<0x0000000000000000000000000000000000000000000000000000000000000002::object::ID>",
619
+ "0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
620
+ ] satisfies string[];
621
+ const parameterNames = ["self", "Cap", "commitmentIds"];
622
+ return (tx: Transaction) =>
623
+ tx.moveCall({
624
+ package: packageAddress,
625
+ module: "reclaim",
626
+ function: "cleanup_expired_commitments",
627
+ arguments: normalizeMoveArguments(
628
+ options.arguments,
629
+ argumentsTypes,
630
+ parameterNames,
631
+ ),
632
+ typeArguments: options.typeArguments,
633
+ });
634
+ }
635
+ export interface BurnProofArguments {
636
+ proof: RawTransactionArgument<string>;
637
+ }
638
+ export interface BurnProofOptions {
639
+ package?: string;
640
+ arguments: BurnProofArguments | [proof: RawTransactionArgument<string>];
641
+ typeArguments: [string];
642
+ }
643
+ export function burnProof(options: BurnProofOptions) {
644
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
645
+ const argumentsTypes = [
646
+ `${packageAddress}::reclaim::Proof<${options.typeArguments[0]}>`,
647
+ ] satisfies string[];
648
+ const parameterNames = ["proof"];
649
+ return (tx: Transaction) =>
650
+ tx.moveCall({
651
+ package: packageAddress,
652
+ module: "reclaim",
653
+ function: "burn_proof",
654
+ arguments: normalizeMoveArguments(
655
+ options.arguments,
656
+ argumentsTypes,
657
+ parameterNames,
658
+ ),
659
+ typeArguments: options.typeArguments,
660
+ });
661
+ }
662
+ export interface CommitProofArguments {
663
+ self: RawTransactionArgument<string>;
664
+ config: RawTransactionArgument<string>;
665
+ commitmentHash: RawTransactionArgument<number[]>;
666
+ identifierHash: RawTransactionArgument<number[]>;
667
+ }
668
+ export interface CommitProofOptions {
669
+ package?: string;
670
+ arguments:
671
+ | CommitProofArguments
672
+ | [
673
+ self: RawTransactionArgument<string>,
674
+ config: RawTransactionArgument<string>,
675
+ commitmentHash: RawTransactionArgument<number[]>,
676
+ identifierHash: RawTransactionArgument<number[]>,
677
+ ];
678
+ typeArguments: [string];
679
+ }
680
+ export function commitProof(options: CommitProofOptions) {
681
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
682
+ const argumentsTypes = [
683
+ `${packageAddress}::reclaim::ReclaimManager<${options.typeArguments[0]}>`,
684
+ `${packageAddress}::config::Config`,
685
+ "vector<u8>",
686
+ "vector<u8>",
687
+ "0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
688
+ ] satisfies string[];
689
+ const parameterNames = ["self", "config", "commitmentHash", "identifierHash"];
690
+ return (tx: Transaction) =>
691
+ tx.moveCall({
692
+ package: packageAddress,
693
+ module: "reclaim",
694
+ function: "commit_proof",
695
+ arguments: normalizeMoveArguments(
696
+ options.arguments,
697
+ argumentsTypes,
698
+ parameterNames,
699
+ ),
700
+ typeArguments: options.typeArguments,
701
+ });
702
+ }
703
+ export interface RevealAndVerifyProofArguments {
704
+ self: RawTransactionArgument<string>;
705
+ config: RawTransactionArgument<string>;
706
+ commitmentId: RawTransactionArgument<string>;
707
+ provider: RawTransactionArgument<string>;
708
+ parameters: RawTransactionArgument<string>;
709
+ context: RawTransactionArgument<string>;
710
+ identifier: RawTransactionArgument<string>;
711
+ owner: RawTransactionArgument<string>;
712
+ epoch: RawTransactionArgument<string>;
713
+ timestampS: RawTransactionArgument<number | bigint>;
714
+ signatures: RawTransactionArgument<number[][]>;
715
+ nonce: RawTransactionArgument<number[]>;
716
+ }
717
+ export interface RevealAndVerifyProofOptions {
718
+ package?: string;
719
+ arguments:
720
+ | RevealAndVerifyProofArguments
721
+ | [
722
+ self: RawTransactionArgument<string>,
723
+ config: RawTransactionArgument<string>,
724
+ commitmentId: RawTransactionArgument<string>,
725
+ provider: RawTransactionArgument<string>,
726
+ parameters: RawTransactionArgument<string>,
727
+ context: RawTransactionArgument<string>,
728
+ identifier: RawTransactionArgument<string>,
729
+ owner: RawTransactionArgument<string>,
730
+ epoch: RawTransactionArgument<string>,
731
+ timestampS: RawTransactionArgument<number | bigint>,
732
+ signatures: RawTransactionArgument<number[][]>,
733
+ nonce: RawTransactionArgument<number[]>,
734
+ ];
735
+ typeArguments: [string];
736
+ }
737
+ export function revealAndVerifyProof(options: RevealAndVerifyProofOptions) {
738
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
739
+ const argumentsTypes = [
740
+ `${packageAddress}::reclaim::ReclaimManager<${options.typeArguments[0]}>`,
741
+ `${packageAddress}::config::Config`,
742
+ "0x0000000000000000000000000000000000000000000000000000000000000002::object::ID",
743
+ "0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
744
+ "0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
745
+ "0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
746
+ "0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
747
+ "0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
748
+ "0x0000000000000000000000000000000000000000000000000000000000000001::ascii::String",
749
+ "u64",
750
+ "vector<vector<u8>>",
751
+ "vector<u8>",
752
+ "0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
753
+ ] satisfies string[];
754
+ const parameterNames = [
755
+ "self",
756
+ "config",
757
+ "commitmentId",
758
+ "provider",
759
+ "parameters",
760
+ "context",
761
+ "identifier",
762
+ "owner",
763
+ "epoch",
764
+ "timestampS",
765
+ "signatures",
766
+ "nonce",
767
+ ];
768
+ return (tx: Transaction) =>
769
+ tx.moveCall({
770
+ package: packageAddress,
771
+ module: "reclaim",
772
+ function: "reveal_and_verify_proof",
773
+ arguments: normalizeMoveArguments(
774
+ options.arguments,
775
+ argumentsTypes,
776
+ parameterNames,
777
+ ),
778
+ typeArguments: options.typeArguments,
779
+ });
780
+ }
781
+ export interface BytesToHexArguments {
782
+ bytes: RawTransactionArgument<number[]>;
783
+ }
784
+ export interface BytesToHexOptions {
785
+ package?: string;
786
+ arguments: BytesToHexArguments | [bytes: RawTransactionArgument<number[]>];
787
+ }
788
+ export function bytesToHex(options: BytesToHexOptions) {
789
+ const packageAddress = options.package ?? "@local-pkg/zing_identity";
790
+ const argumentsTypes = ["vector<u8>"] satisfies string[];
791
+ const parameterNames = ["bytes"];
792
+ return (tx: Transaction) =>
793
+ tx.moveCall({
794
+ package: packageAddress,
795
+ module: "reclaim",
796
+ function: "bytes_to_hex",
797
+ arguments: normalizeMoveArguments(
798
+ options.arguments,
799
+ argumentsTypes,
800
+ parameterNames,
801
+ ),
802
+ });
803
+ }