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