@aintivirus-ai/mixer-sdk 1.0.0 → 1.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.
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,621 @@
1
+ /**
2
+ * Program IDL in camelCase format in order to be used in JS/TS.
3
+ *
4
+ * Note that this is only a type helper and is not the actual IDL. The original
5
+ * IDL can be found at `target/idl/aintivirus_mixer.json`.
6
+ */
7
+ export type AintivirusMixer = {
8
+ "address": "CGZ8t3ZgSnEkN5zbVsAJ21d5bu9vrsBvBh7xxnZZcrVu";
9
+ "metadata": {
10
+ "name": "aintivirusMixer";
11
+ "version": "0.1.0";
12
+ "spec": "0.1.0";
13
+ "description": "Created with Anchor";
14
+ };
15
+ "instructions": [
16
+ {
17
+ "name": "depositState";
18
+ "docs": [
19
+ "State-only deposit function (called by factory/vault)",
20
+ "Only manages merkle tree state, no fund transfers"
21
+ ];
22
+ "discriminator": [
23
+ 216,
24
+ 87,
25
+ 194,
26
+ 14,
27
+ 24,
28
+ 111,
29
+ 64,
30
+ 12
31
+ ];
32
+ "accounts": [
33
+ {
34
+ "name": "mixerConfig";
35
+ },
36
+ {
37
+ "name": "vault";
38
+ "writable": true;
39
+ "signer": true;
40
+ },
41
+ {
42
+ "name": "payer";
43
+ "writable": true;
44
+ "signer": true;
45
+ },
46
+ {
47
+ "name": "commitmentChecker";
48
+ "writable": true;
49
+ "pda": {
50
+ "seeds": [
51
+ {
52
+ "kind": "const";
53
+ "value": [
54
+ 99,
55
+ 111,
56
+ 109,
57
+ 109,
58
+ 105,
59
+ 116,
60
+ 109,
61
+ 101,
62
+ 110,
63
+ 116
64
+ ];
65
+ },
66
+ {
67
+ "kind": "arg";
68
+ "path": "commitment";
69
+ }
70
+ ];
71
+ };
72
+ },
73
+ {
74
+ "name": "merkleTree";
75
+ "writable": true;
76
+ "pda": {
77
+ "seeds": [
78
+ {
79
+ "kind": "const";
80
+ "value": [
81
+ 109,
82
+ 101,
83
+ 114,
84
+ 107,
85
+ 108,
86
+ 101,
87
+ 95,
88
+ 116,
89
+ 114,
90
+ 101,
91
+ 101
92
+ ];
93
+ },
94
+ {
95
+ "kind": "account";
96
+ "path": "mixerConfig";
97
+ }
98
+ ];
99
+ };
100
+ },
101
+ {
102
+ "name": "systemProgram";
103
+ "address": "11111111111111111111111111111111";
104
+ }
105
+ ];
106
+ "args": [
107
+ {
108
+ "name": "commitment";
109
+ "type": {
110
+ "array": [
111
+ "u8",
112
+ 32
113
+ ];
114
+ };
115
+ }
116
+ ];
117
+ },
118
+ {
119
+ "name": "getLastRoot";
120
+ "docs": [
121
+ "Get the last root from merkle tree"
122
+ ];
123
+ "discriminator": [
124
+ 136,
125
+ 48,
126
+ 63,
127
+ 201,
128
+ 37,
129
+ 13,
130
+ 204,
131
+ 43
132
+ ];
133
+ "accounts": [
134
+ {
135
+ "name": "merkleTree";
136
+ }
137
+ ];
138
+ "args": [];
139
+ "returns": {
140
+ "array": [
141
+ "u8",
142
+ 32
143
+ ];
144
+ };
145
+ },
146
+ {
147
+ "name": "initialize";
148
+ "docs": [
149
+ "Initialize a new mixer instance with fixed mode and amount",
150
+ "Called by factory when deploying a new mixer pool"
151
+ ];
152
+ "discriminator": [
153
+ 175,
154
+ 175,
155
+ 109,
156
+ 31,
157
+ 13,
158
+ 152,
159
+ 155,
160
+ 237
161
+ ];
162
+ "accounts": [
163
+ {
164
+ "name": "mixerConfig";
165
+ "writable": true;
166
+ },
167
+ {
168
+ "name": "payer";
169
+ "writable": true;
170
+ "signer": true;
171
+ },
172
+ {
173
+ "name": "vault";
174
+ "writable": true;
175
+ "signer": true;
176
+ },
177
+ {
178
+ "name": "systemProgram";
179
+ "address": "11111111111111111111111111111111";
180
+ }
181
+ ];
182
+ "args": [
183
+ {
184
+ "name": "mode";
185
+ "type": "u8";
186
+ },
187
+ {
188
+ "name": "amount";
189
+ "type": "u64";
190
+ }
191
+ ];
192
+ },
193
+ {
194
+ "name": "initializeMerkleTree";
195
+ "docs": [
196
+ "Initialize the merkle tree for this mixer instance"
197
+ ];
198
+ "discriminator": [
199
+ 67,
200
+ 143,
201
+ 80,
202
+ 157,
203
+ 177,
204
+ 227,
205
+ 11,
206
+ 238
207
+ ];
208
+ "accounts": [
209
+ {
210
+ "name": "vault";
211
+ "writable": true;
212
+ "signer": true;
213
+ },
214
+ {
215
+ "name": "systemProgram";
216
+ "address": "11111111111111111111111111111111";
217
+ },
218
+ {
219
+ "name": "merkleTree";
220
+ "writable": true;
221
+ "pda": {
222
+ "seeds": [
223
+ {
224
+ "kind": "const";
225
+ "value": [
226
+ 109,
227
+ 101,
228
+ 114,
229
+ 107,
230
+ 108,
231
+ 101,
232
+ 95,
233
+ 116,
234
+ 114,
235
+ 101,
236
+ 101
237
+ ];
238
+ },
239
+ {
240
+ "kind": "account";
241
+ "path": "mixerConfig";
242
+ }
243
+ ];
244
+ };
245
+ },
246
+ {
247
+ "name": "payer";
248
+ "writable": true;
249
+ "signer": true;
250
+ },
251
+ {
252
+ "name": "mixerConfig";
253
+ "writable": true;
254
+ }
255
+ ];
256
+ "args": [
257
+ {
258
+ "name": "levels";
259
+ "type": "u8";
260
+ }
261
+ ];
262
+ },
263
+ {
264
+ "name": "validateWithdraw";
265
+ "docs": [
266
+ "State-only withdraw validation function (called by factory/vault)",
267
+ "Validates proof and returns recipient address, no fund transfers"
268
+ ];
269
+ "discriminator": [
270
+ 173,
271
+ 112,
272
+ 85,
273
+ 194,
274
+ 234,
275
+ 32,
276
+ 99,
277
+ 53
278
+ ];
279
+ "accounts": [
280
+ {
281
+ "name": "mixerConfig";
282
+ },
283
+ {
284
+ "name": "vault";
285
+ "writable": true;
286
+ "signer": true;
287
+ },
288
+ {
289
+ "name": "payer";
290
+ "writable": true;
291
+ "signer": true;
292
+ },
293
+ {
294
+ "name": "recipient";
295
+ },
296
+ {
297
+ "name": "nullifierHashChecker";
298
+ "writable": true;
299
+ "pda": {
300
+ "seeds": [
301
+ {
302
+ "kind": "const";
303
+ "value": [
304
+ 110,
305
+ 117,
306
+ 108,
307
+ 108,
308
+ 105,
309
+ 102,
310
+ 105,
311
+ 101,
312
+ 114,
313
+ 95,
314
+ 104,
315
+ 97,
316
+ 115,
317
+ 104
318
+ ];
319
+ },
320
+ {
321
+ "kind": "arg";
322
+ "path": "nullifierHashPrecomputed";
323
+ }
324
+ ];
325
+ };
326
+ },
327
+ {
328
+ "name": "merkleTree";
329
+ "writable": true;
330
+ "pda": {
331
+ "seeds": [
332
+ {
333
+ "kind": "const";
334
+ "value": [
335
+ 109,
336
+ 101,
337
+ 114,
338
+ 107,
339
+ 108,
340
+ 101,
341
+ 95,
342
+ 116,
343
+ 114,
344
+ 101,
345
+ 101
346
+ ];
347
+ },
348
+ {
349
+ "kind": "account";
350
+ "path": "mixerConfig";
351
+ }
352
+ ];
353
+ };
354
+ },
355
+ {
356
+ "name": "systemProgram";
357
+ "address": "11111111111111111111111111111111";
358
+ }
359
+ ];
360
+ "args": [
361
+ {
362
+ "name": "instructionData";
363
+ "type": "bytes";
364
+ },
365
+ {
366
+ "name": "nullifierHashPrecomputed";
367
+ "type": {
368
+ "array": [
369
+ "u8",
370
+ 32
371
+ ];
372
+ };
373
+ }
374
+ ];
375
+ "returns": "pubkey";
376
+ }
377
+ ];
378
+ "accounts": [
379
+ {
380
+ "name": "commitmentAndNullifierHashExist";
381
+ "discriminator": [
382
+ 41,
383
+ 117,
384
+ 172,
385
+ 132,
386
+ 137,
387
+ 159,
388
+ 136,
389
+ 150
390
+ ];
391
+ },
392
+ {
393
+ "name": "merkleTreeWithHistory";
394
+ "discriminator": [
395
+ 116,
396
+ 166,
397
+ 248,
398
+ 38,
399
+ 103,
400
+ 144,
401
+ 29,
402
+ 71
403
+ ];
404
+ },
405
+ {
406
+ "name": "mixerConfig";
407
+ "discriminator": [
408
+ 249,
409
+ 68,
410
+ 151,
411
+ 145,
412
+ 180,
413
+ 148,
414
+ 212,
415
+ 172
416
+ ];
417
+ }
418
+ ];
419
+ "errors": [
420
+ {
421
+ "code": 6000;
422
+ "name": "invalidMinimumDepositAmount";
423
+ "msg": "Invalid deposit amount. Deposit amount under the mininum allowed";
424
+ },
425
+ {
426
+ "code": 6001;
427
+ "name": "needMaintainerRole";
428
+ "msg": "Need Maintainer Role for this action";
429
+ },
430
+ {
431
+ "code": 6002;
432
+ "name": "verificationFailed";
433
+ "msg": "Proof verification failed";
434
+ },
435
+ {
436
+ "code": 6003;
437
+ "name": "invalidProof";
438
+ "msg": "Invalid proof";
439
+ },
440
+ {
441
+ "code": 6004;
442
+ "name": "invalidMode";
443
+ "msg": "Invalid mixing mode";
444
+ },
445
+ {
446
+ "code": 6005;
447
+ "name": "failedToParsePublicInputs";
448
+ "msg": "Failed to parse public inputs";
449
+ },
450
+ {
451
+ "code": 6006;
452
+ "name": "invalidEscrowVault";
453
+ "msg": "Invalid escrow vault account";
454
+ },
455
+ {
456
+ "code": 6007;
457
+ "name": "invalidLevels";
458
+ "msg": "Levels should be greater than 0 and less than 32";
459
+ },
460
+ {
461
+ "code": 6008;
462
+ "name": "treeFull";
463
+ "msg": "Merkle tree is full. No more leaves can be added";
464
+ },
465
+ {
466
+ "code": 6009;
467
+ "name": "rootNotFound";
468
+ "msg": "Root not found";
469
+ },
470
+ {
471
+ "code": 6010;
472
+ "name": "arithmeticError";
473
+ "msg": "Arithmetic addition error";
474
+ },
475
+ {
476
+ "code": 6011;
477
+ "name": "nullifierHashNotMatched";
478
+ "msg": "Nullifier hash not matched";
479
+ },
480
+ {
481
+ "code": 6012;
482
+ "name": "rootNotMatched";
483
+ "msg": "Root is not matched";
484
+ },
485
+ {
486
+ "code": 6013;
487
+ "name": "missingAccount";
488
+ "msg": "Missing Account";
489
+ },
490
+ {
491
+ "code": 6014;
492
+ "name": "noRewardsToClaim";
493
+ "msg": "No rewards to claim";
494
+ },
495
+ {
496
+ "code": 6015;
497
+ "name": "stakeSeasonNotStarted";
498
+ "msg": "Stake season has not started yet";
499
+ },
500
+ {
501
+ "code": 6016;
502
+ "name": "currentSeasonActive";
503
+ "msg": "Current season is still active";
504
+ },
505
+ {
506
+ "code": 6017;
507
+ "name": "currentStakeSeasonExpired";
508
+ "msg": "Current stake season has expired";
509
+ },
510
+ {
511
+ "code": 6018;
512
+ "name": "noStakedBalance";
513
+ "msg": "No staked balance to unstake";
514
+ },
515
+ {
516
+ "code": 6019;
517
+ "name": "userAlreadyStaked";
518
+ "msg": "User already staked";
519
+ },
520
+ {
521
+ "code": 6020;
522
+ "name": "cannotClaimForOlderSeason";
523
+ "msg": "Cannot claim rewards for an older season";
524
+ },
525
+ {
526
+ "code": 6021;
527
+ "name": "invalidSeasonDataProvided";
528
+ "msg": "Invalid season data provided";
529
+ }
530
+ ];
531
+ "types": [
532
+ {
533
+ "name": "commitmentAndNullifierHashExist";
534
+ "type": {
535
+ "kind": "struct";
536
+ "fields": [
537
+ {
538
+ "name": "exist";
539
+ "type": "bool";
540
+ }
541
+ ];
542
+ };
543
+ },
544
+ {
545
+ "name": "merkleTreeWithHistory";
546
+ "type": {
547
+ "kind": "struct";
548
+ "fields": [
549
+ {
550
+ "name": "mixerConfig";
551
+ "type": "pubkey";
552
+ },
553
+ {
554
+ "name": "vault";
555
+ "type": "pubkey";
556
+ },
557
+ {
558
+ "name": "levels";
559
+ "type": "u8";
560
+ },
561
+ {
562
+ "name": "currentRootIndex";
563
+ "type": "u8";
564
+ },
565
+ {
566
+ "name": "nextIndex";
567
+ "type": "u32";
568
+ },
569
+ {
570
+ "name": "filledSubtrees";
571
+ "type": {
572
+ "array": [
573
+ {
574
+ "array": [
575
+ "u8",
576
+ 32
577
+ ];
578
+ },
579
+ 24
580
+ ];
581
+ };
582
+ },
583
+ {
584
+ "name": "roots";
585
+ "type": {
586
+ "array": [
587
+ {
588
+ "array": [
589
+ "u8",
590
+ 32
591
+ ];
592
+ },
593
+ 30
594
+ ];
595
+ };
596
+ }
597
+ ];
598
+ };
599
+ },
600
+ {
601
+ "name": "mixerConfig";
602
+ "type": {
603
+ "kind": "struct";
604
+ "fields": [
605
+ {
606
+ "name": "vault";
607
+ "type": "pubkey";
608
+ },
609
+ {
610
+ "name": "mode";
611
+ "type": "u8";
612
+ },
613
+ {
614
+ "name": "amount";
615
+ "type": "u64";
616
+ }
617
+ ];
618
+ };
619
+ }
620
+ ];
621
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });