@zebec-network/zebec-vault-sdk 1.1.0 → 3.0.0

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,1690 @@
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/zebec_instant_card.json`.
6
+ */
7
+ export type ZebecInstantCard = {
8
+ address: "zicGngoCtNKYSnLQhdiaAJdmZHN6SmM7CANsBomV4SY";
9
+ metadata: {
10
+ name: "zebecInstantCard";
11
+ version: "0.1.0";
12
+ spec: "0.1.0";
13
+ description: "Created with Anchor";
14
+ };
15
+ instructions: [
16
+ {
17
+ name: "createSilverCard";
18
+ discriminator: [120, 211, 168, 234, 194, 201, 101, 167];
19
+ accounts: [
20
+ {
21
+ name: "user";
22
+ writable: true;
23
+ signer: true;
24
+ },
25
+ {
26
+ name: "feePayer";
27
+ writable: true;
28
+ signer: true;
29
+ },
30
+ {
31
+ name: "usdcToken";
32
+ },
33
+ {
34
+ name: "userAta";
35
+ writable: true;
36
+ pda: {
37
+ seeds: [
38
+ {
39
+ kind: "account";
40
+ path: "user";
41
+ },
42
+ {
43
+ kind: "const";
44
+ value: [
45
+ 6,
46
+ 221,
47
+ 246,
48
+ 225,
49
+ 215,
50
+ 101,
51
+ 161,
52
+ 147,
53
+ 217,
54
+ 203,
55
+ 225,
56
+ 70,
57
+ 206,
58
+ 235,
59
+ 121,
60
+ 172,
61
+ 28,
62
+ 180,
63
+ 133,
64
+ 237,
65
+ 95,
66
+ 91,
67
+ 55,
68
+ 145,
69
+ 58,
70
+ 140,
71
+ 245,
72
+ 133,
73
+ 126,
74
+ 255,
75
+ 0,
76
+ 169
77
+ ];
78
+ },
79
+ {
80
+ kind: "account";
81
+ path: "usdcToken";
82
+ }
83
+ ];
84
+ program: {
85
+ kind: "const";
86
+ value: [
87
+ 140,
88
+ 151,
89
+ 37,
90
+ 143,
91
+ 78,
92
+ 36,
93
+ 137,
94
+ 241,
95
+ 187,
96
+ 61,
97
+ 16,
98
+ 41,
99
+ 20,
100
+ 142,
101
+ 13,
102
+ 131,
103
+ 11,
104
+ 90,
105
+ 19,
106
+ 153,
107
+ 218,
108
+ 255,
109
+ 16,
110
+ 132,
111
+ 4,
112
+ 142,
113
+ 123,
114
+ 216,
115
+ 219,
116
+ 233,
117
+ 248,
118
+ 89
119
+ ];
120
+ };
121
+ };
122
+ },
123
+ {
124
+ name: "cardPurchasePda";
125
+ writable: true;
126
+ pda: {
127
+ seeds: [
128
+ {
129
+ kind: "const";
130
+ value: [117, 115, 101, 114, 95, 99, 97, 114, 100, 95, 112, 117, 114, 99, 104, 97, 115, 101];
131
+ },
132
+ {
133
+ kind: "account";
134
+ path: "user";
135
+ },
136
+ {
137
+ kind: "arg";
138
+ path: "params.index";
139
+ }
140
+ ];
141
+ };
142
+ },
143
+ {
144
+ name: "cardPda";
145
+ writable: true;
146
+ pda: {
147
+ seeds: [
148
+ {
149
+ kind: "const";
150
+ value: [99, 97, 114, 100, 95, 99, 111, 110, 102, 105, 103];
151
+ }
152
+ ];
153
+ };
154
+ },
155
+ {
156
+ name: "cardVault";
157
+ writable: true;
158
+ },
159
+ {
160
+ name: "cardVaultAta";
161
+ writable: true;
162
+ },
163
+ {
164
+ name: "revenueVault";
165
+ writable: true;
166
+ },
167
+ {
168
+ name: "revenueVaultAta";
169
+ writable: true;
170
+ },
171
+ {
172
+ name: "userPurchaseRecordPda";
173
+ writable: true;
174
+ pda: {
175
+ seeds: [
176
+ {
177
+ kind: "const";
178
+ value: [117, 115, 101, 114, 95, 112, 117, 114, 99, 104, 97, 115, 101, 95, 114, 101, 99, 111, 114, 100];
179
+ },
180
+ {
181
+ kind: "account";
182
+ path: "user";
183
+ }
184
+ ];
185
+ };
186
+ },
187
+ {
188
+ name: "feeMapPda";
189
+ writable: true;
190
+ pda: {
191
+ seeds: [
192
+ {
193
+ kind: "const";
194
+ value: [116, 111, 107, 101, 110, 95, 102, 101, 101, 95, 109, 97, 112];
195
+ }
196
+ ];
197
+ };
198
+ },
199
+ {
200
+ name: "tokenProgram";
201
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
202
+ },
203
+ {
204
+ name: "systemProgram";
205
+ address: "11111111111111111111111111111111";
206
+ }
207
+ ];
208
+ args: [
209
+ {
210
+ name: "params";
211
+ type: {
212
+ defined: {
213
+ name: "createSilverCardParams";
214
+ };
215
+ };
216
+ }
217
+ ];
218
+ },
219
+ {
220
+ name: "deleteCustomFees";
221
+ discriminator: [86, 194, 127, 189, 66, 97, 134, 230];
222
+ accounts: [
223
+ {
224
+ name: "zicOwner";
225
+ writable: true;
226
+ signer: true;
227
+ },
228
+ {
229
+ name: "feeMapPda";
230
+ writable: true;
231
+ pda: {
232
+ seeds: [
233
+ {
234
+ kind: "const";
235
+ value: [116, 111, 107, 101, 110, 95, 102, 101, 101, 95, 109, 97, 112];
236
+ }
237
+ ];
238
+ };
239
+ },
240
+ {
241
+ name: "cardPda";
242
+ writable: true;
243
+ pda: {
244
+ seeds: [
245
+ {
246
+ kind: "const";
247
+ value: [99, 97, 114, 100, 95, 99, 111, 110, 102, 105, 103];
248
+ }
249
+ ];
250
+ };
251
+ },
252
+ {
253
+ name: "systemProgram";
254
+ address: "11111111111111111111111111111111";
255
+ }
256
+ ];
257
+ args: [
258
+ {
259
+ name: "params";
260
+ type: {
261
+ vec: "pubkey";
262
+ };
263
+ }
264
+ ];
265
+ },
266
+ {
267
+ name: "initCardConfigs";
268
+ discriminator: [34, 81, 224, 7, 116, 120, 93, 93];
269
+ accounts: [
270
+ {
271
+ name: "zicOwner";
272
+ writable: true;
273
+ signer: true;
274
+ },
275
+ {
276
+ name: "cardPda";
277
+ writable: true;
278
+ pda: {
279
+ seeds: [
280
+ {
281
+ kind: "const";
282
+ value: [99, 97, 114, 100, 95, 99, 111, 110, 102, 105, 103];
283
+ }
284
+ ];
285
+ };
286
+ },
287
+ {
288
+ name: "usdcToken";
289
+ },
290
+ {
291
+ name: "tokenProgram";
292
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
293
+ },
294
+ {
295
+ name: "associatedTokenProgram";
296
+ address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
297
+ },
298
+ {
299
+ name: "systemProgram";
300
+ address: "11111111111111111111111111111111";
301
+ }
302
+ ];
303
+ args: [
304
+ {
305
+ name: "params";
306
+ type: {
307
+ defined: {
308
+ name: "initCardConfigParams";
309
+ };
310
+ };
311
+ }
312
+ ];
313
+ },
314
+ {
315
+ name: "loadCarbonCard";
316
+ discriminator: [99, 135, 172, 23, 62, 117, 126, 83];
317
+ accounts: [
318
+ {
319
+ name: "user";
320
+ writable: true;
321
+ signer: true;
322
+ },
323
+ {
324
+ name: "feePayer";
325
+ writable: true;
326
+ signer: true;
327
+ },
328
+ {
329
+ name: "usdcToken";
330
+ },
331
+ {
332
+ name: "userAta";
333
+ writable: true;
334
+ pda: {
335
+ seeds: [
336
+ {
337
+ kind: "account";
338
+ path: "user";
339
+ },
340
+ {
341
+ kind: "const";
342
+ value: [
343
+ 6,
344
+ 221,
345
+ 246,
346
+ 225,
347
+ 215,
348
+ 101,
349
+ 161,
350
+ 147,
351
+ 217,
352
+ 203,
353
+ 225,
354
+ 70,
355
+ 206,
356
+ 235,
357
+ 121,
358
+ 172,
359
+ 28,
360
+ 180,
361
+ 133,
362
+ 237,
363
+ 95,
364
+ 91,
365
+ 55,
366
+ 145,
367
+ 58,
368
+ 140,
369
+ 245,
370
+ 133,
371
+ 126,
372
+ 255,
373
+ 0,
374
+ 169
375
+ ];
376
+ },
377
+ {
378
+ kind: "account";
379
+ path: "usdcToken";
380
+ }
381
+ ];
382
+ program: {
383
+ kind: "const";
384
+ value: [
385
+ 140,
386
+ 151,
387
+ 37,
388
+ 143,
389
+ 78,
390
+ 36,
391
+ 137,
392
+ 241,
393
+ 187,
394
+ 61,
395
+ 16,
396
+ 41,
397
+ 20,
398
+ 142,
399
+ 13,
400
+ 131,
401
+ 11,
402
+ 90,
403
+ 19,
404
+ 153,
405
+ 218,
406
+ 255,
407
+ 16,
408
+ 132,
409
+ 4,
410
+ 142,
411
+ 123,
412
+ 216,
413
+ 219,
414
+ 233,
415
+ 248,
416
+ 89
417
+ ];
418
+ };
419
+ };
420
+ },
421
+ {
422
+ name: "cardPurchasePda";
423
+ writable: true;
424
+ pda: {
425
+ seeds: [
426
+ {
427
+ kind: "const";
428
+ value: [117, 115, 101, 114, 95, 99, 97, 114, 100, 95, 112, 117, 114, 99, 104, 97, 115, 101];
429
+ },
430
+ {
431
+ kind: "account";
432
+ path: "user";
433
+ },
434
+ {
435
+ kind: "arg";
436
+ path: "params.index";
437
+ }
438
+ ];
439
+ };
440
+ },
441
+ {
442
+ name: "cardPda";
443
+ writable: true;
444
+ pda: {
445
+ seeds: [
446
+ {
447
+ kind: "const";
448
+ value: [99, 97, 114, 100, 95, 99, 111, 110, 102, 105, 103];
449
+ }
450
+ ];
451
+ };
452
+ },
453
+ {
454
+ name: "cardVault";
455
+ writable: true;
456
+ },
457
+ {
458
+ name: "cardVaultAta";
459
+ writable: true;
460
+ },
461
+ {
462
+ name: "revenueVault";
463
+ writable: true;
464
+ },
465
+ {
466
+ name: "revenueVaultAta";
467
+ writable: true;
468
+ },
469
+ {
470
+ name: "userPurchaseRecordPda";
471
+ writable: true;
472
+ pda: {
473
+ seeds: [
474
+ {
475
+ kind: "const";
476
+ value: [117, 115, 101, 114, 95, 112, 117, 114, 99, 104, 97, 115, 101, 95, 114, 101, 99, 111, 114, 100];
477
+ },
478
+ {
479
+ kind: "account";
480
+ path: "user";
481
+ }
482
+ ];
483
+ };
484
+ },
485
+ {
486
+ name: "feeMapPda";
487
+ writable: true;
488
+ pda: {
489
+ seeds: [
490
+ {
491
+ kind: "const";
492
+ value: [116, 111, 107, 101, 110, 95, 102, 101, 101, 95, 109, 97, 112];
493
+ }
494
+ ];
495
+ };
496
+ },
497
+ {
498
+ name: "tokenProgram";
499
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
500
+ },
501
+ {
502
+ name: "systemProgram";
503
+ address: "11111111111111111111111111111111";
504
+ }
505
+ ];
506
+ args: [
507
+ {
508
+ name: "params";
509
+ type: {
510
+ defined: {
511
+ name: "loadCarbonCardParams";
512
+ };
513
+ };
514
+ }
515
+ ];
516
+ },
517
+ {
518
+ name: "setCardConfigs";
519
+ discriminator: [249, 192, 181, 54, 181, 252, 103, 66];
520
+ accounts: [
521
+ {
522
+ name: "zicOwner";
523
+ writable: true;
524
+ signer: true;
525
+ },
526
+ {
527
+ name: "cardPda";
528
+ writable: true;
529
+ pda: {
530
+ seeds: [
531
+ {
532
+ kind: "const";
533
+ value: [99, 97, 114, 100, 95, 99, 111, 110, 102, 105, 103];
534
+ }
535
+ ];
536
+ };
537
+ }
538
+ ];
539
+ args: [
540
+ {
541
+ name: "params";
542
+ type: {
543
+ defined: {
544
+ name: "setCardConfigParams";
545
+ };
546
+ };
547
+ }
548
+ ];
549
+ },
550
+ {
551
+ name: "setCustomFees";
552
+ discriminator: [114, 185, 193, 242, 211, 79, 131, 180];
553
+ accounts: [
554
+ {
555
+ name: "zicOwner";
556
+ writable: true;
557
+ signer: true;
558
+ },
559
+ {
560
+ name: "feeMapPda";
561
+ writable: true;
562
+ pda: {
563
+ seeds: [
564
+ {
565
+ kind: "const";
566
+ value: [116, 111, 107, 101, 110, 95, 102, 101, 101, 95, 109, 97, 112];
567
+ }
568
+ ];
569
+ };
570
+ },
571
+ {
572
+ name: "cardPda";
573
+ writable: true;
574
+ pda: {
575
+ seeds: [
576
+ {
577
+ kind: "const";
578
+ value: [99, 97, 114, 100, 95, 99, 111, 110, 102, 105, 103];
579
+ }
580
+ ];
581
+ };
582
+ },
583
+ {
584
+ name: "systemProgram";
585
+ address: "11111111111111111111111111111111";
586
+ }
587
+ ];
588
+ args: [
589
+ {
590
+ name: "params";
591
+ type: {
592
+ vec: {
593
+ defined: {
594
+ name: "fees";
595
+ };
596
+ };
597
+ };
598
+ }
599
+ ];
600
+ },
601
+ {
602
+ name: "swapAndCreateSilverCard";
603
+ discriminator: [184, 230, 149, 121, 67, 64, 110, 17];
604
+ accounts: [
605
+ {
606
+ name: "user";
607
+ writable: true;
608
+ signer: true;
609
+ },
610
+ {
611
+ name: "feePayer";
612
+ writable: true;
613
+ signer: true;
614
+ },
615
+ {
616
+ name: "usdcToken";
617
+ },
618
+ {
619
+ name: "sourceToken";
620
+ },
621
+ {
622
+ name: "userAta";
623
+ writable: true;
624
+ pda: {
625
+ seeds: [
626
+ {
627
+ kind: "account";
628
+ path: "user";
629
+ },
630
+ {
631
+ kind: "const";
632
+ value: [
633
+ 6,
634
+ 221,
635
+ 246,
636
+ 225,
637
+ 215,
638
+ 101,
639
+ 161,
640
+ 147,
641
+ 217,
642
+ 203,
643
+ 225,
644
+ 70,
645
+ 206,
646
+ 235,
647
+ 121,
648
+ 172,
649
+ 28,
650
+ 180,
651
+ 133,
652
+ 237,
653
+ 95,
654
+ 91,
655
+ 55,
656
+ 145,
657
+ 58,
658
+ 140,
659
+ 245,
660
+ 133,
661
+ 126,
662
+ 255,
663
+ 0,
664
+ 169
665
+ ];
666
+ },
667
+ {
668
+ kind: "account";
669
+ path: "usdcToken";
670
+ }
671
+ ];
672
+ program: {
673
+ kind: "const";
674
+ value: [
675
+ 140,
676
+ 151,
677
+ 37,
678
+ 143,
679
+ 78,
680
+ 36,
681
+ 137,
682
+ 241,
683
+ 187,
684
+ 61,
685
+ 16,
686
+ 41,
687
+ 20,
688
+ 142,
689
+ 13,
690
+ 131,
691
+ 11,
692
+ 90,
693
+ 19,
694
+ 153,
695
+ 218,
696
+ 255,
697
+ 16,
698
+ 132,
699
+ 4,
700
+ 142,
701
+ 123,
702
+ 216,
703
+ 219,
704
+ 233,
705
+ 248,
706
+ 89
707
+ ];
708
+ };
709
+ };
710
+ },
711
+ {
712
+ name: "cardPurchasePda";
713
+ writable: true;
714
+ pda: {
715
+ seeds: [
716
+ {
717
+ kind: "const";
718
+ value: [117, 115, 101, 114, 95, 99, 97, 114, 100, 95, 112, 117, 114, 99, 104, 97, 115, 101];
719
+ },
720
+ {
721
+ kind: "account";
722
+ path: "user";
723
+ },
724
+ {
725
+ kind: "arg";
726
+ path: "params.index";
727
+ }
728
+ ];
729
+ };
730
+ },
731
+ {
732
+ name: "cardPda";
733
+ writable: true;
734
+ pda: {
735
+ seeds: [
736
+ {
737
+ kind: "const";
738
+ value: [99, 97, 114, 100, 95, 99, 111, 110, 102, 105, 103];
739
+ }
740
+ ];
741
+ };
742
+ },
743
+ {
744
+ name: "cardVault";
745
+ writable: true;
746
+ },
747
+ {
748
+ name: "cardVaultAta";
749
+ writable: true;
750
+ },
751
+ {
752
+ name: "revenueVault";
753
+ writable: true;
754
+ },
755
+ {
756
+ name: "revenueVaultAta";
757
+ writable: true;
758
+ },
759
+ {
760
+ name: "userPurchaseRecordPda";
761
+ writable: true;
762
+ pda: {
763
+ seeds: [
764
+ {
765
+ kind: "const";
766
+ value: [117, 115, 101, 114, 95, 112, 117, 114, 99, 104, 97, 115, 101, 95, 114, 101, 99, 111, 114, 100];
767
+ },
768
+ {
769
+ kind: "account";
770
+ path: "user";
771
+ }
772
+ ];
773
+ };
774
+ },
775
+ {
776
+ name: "feeMapPda";
777
+ writable: true;
778
+ pda: {
779
+ seeds: [
780
+ {
781
+ kind: "const";
782
+ value: [116, 111, 107, 101, 110, 95, 102, 101, 101, 95, 109, 97, 112];
783
+ }
784
+ ];
785
+ };
786
+ },
787
+ {
788
+ name: "jupiterProgram";
789
+ address: "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4";
790
+ },
791
+ {
792
+ name: "tokenProgram";
793
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
794
+ },
795
+ {
796
+ name: "systemProgram";
797
+ address: "11111111111111111111111111111111";
798
+ }
799
+ ];
800
+ args: [
801
+ {
802
+ name: "params";
803
+ type: {
804
+ defined: {
805
+ name: "swapAndCreateSilverCardParams";
806
+ };
807
+ };
808
+ }
809
+ ];
810
+ },
811
+ {
812
+ name: "swapAndLoadCarbonCard";
813
+ discriminator: [12, 233, 45, 8, 218, 53, 233, 246];
814
+ accounts: [
815
+ {
816
+ name: "user";
817
+ writable: true;
818
+ signer: true;
819
+ },
820
+ {
821
+ name: "feePayer";
822
+ writable: true;
823
+ signer: true;
824
+ },
825
+ {
826
+ name: "usdcToken";
827
+ },
828
+ {
829
+ name: "sourceToken";
830
+ },
831
+ {
832
+ name: "userAta";
833
+ writable: true;
834
+ pda: {
835
+ seeds: [
836
+ {
837
+ kind: "account";
838
+ path: "user";
839
+ },
840
+ {
841
+ kind: "const";
842
+ value: [
843
+ 6,
844
+ 221,
845
+ 246,
846
+ 225,
847
+ 215,
848
+ 101,
849
+ 161,
850
+ 147,
851
+ 217,
852
+ 203,
853
+ 225,
854
+ 70,
855
+ 206,
856
+ 235,
857
+ 121,
858
+ 172,
859
+ 28,
860
+ 180,
861
+ 133,
862
+ 237,
863
+ 95,
864
+ 91,
865
+ 55,
866
+ 145,
867
+ 58,
868
+ 140,
869
+ 245,
870
+ 133,
871
+ 126,
872
+ 255,
873
+ 0,
874
+ 169
875
+ ];
876
+ },
877
+ {
878
+ kind: "account";
879
+ path: "usdcToken";
880
+ }
881
+ ];
882
+ program: {
883
+ kind: "const";
884
+ value: [
885
+ 140,
886
+ 151,
887
+ 37,
888
+ 143,
889
+ 78,
890
+ 36,
891
+ 137,
892
+ 241,
893
+ 187,
894
+ 61,
895
+ 16,
896
+ 41,
897
+ 20,
898
+ 142,
899
+ 13,
900
+ 131,
901
+ 11,
902
+ 90,
903
+ 19,
904
+ 153,
905
+ 218,
906
+ 255,
907
+ 16,
908
+ 132,
909
+ 4,
910
+ 142,
911
+ 123,
912
+ 216,
913
+ 219,
914
+ 233,
915
+ 248,
916
+ 89
917
+ ];
918
+ };
919
+ };
920
+ },
921
+ {
922
+ name: "cardPurchasePda";
923
+ writable: true;
924
+ pda: {
925
+ seeds: [
926
+ {
927
+ kind: "const";
928
+ value: [117, 115, 101, 114, 95, 99, 97, 114, 100, 95, 112, 117, 114, 99, 104, 97, 115, 101];
929
+ },
930
+ {
931
+ kind: "account";
932
+ path: "user";
933
+ },
934
+ {
935
+ kind: "arg";
936
+ path: "params.index";
937
+ }
938
+ ];
939
+ };
940
+ },
941
+ {
942
+ name: "cardPda";
943
+ writable: true;
944
+ pda: {
945
+ seeds: [
946
+ {
947
+ kind: "const";
948
+ value: [99, 97, 114, 100, 95, 99, 111, 110, 102, 105, 103];
949
+ }
950
+ ];
951
+ };
952
+ },
953
+ {
954
+ name: "cardVault";
955
+ writable: true;
956
+ },
957
+ {
958
+ name: "cardVaultAta";
959
+ writable: true;
960
+ },
961
+ {
962
+ name: "revenueVault";
963
+ writable: true;
964
+ },
965
+ {
966
+ name: "revenueVaultAta";
967
+ writable: true;
968
+ },
969
+ {
970
+ name: "userPurchaseRecordPda";
971
+ writable: true;
972
+ pda: {
973
+ seeds: [
974
+ {
975
+ kind: "const";
976
+ value: [117, 115, 101, 114, 95, 112, 117, 114, 99, 104, 97, 115, 101, 95, 114, 101, 99, 111, 114, 100];
977
+ },
978
+ {
979
+ kind: "account";
980
+ path: "user";
981
+ }
982
+ ];
983
+ };
984
+ },
985
+ {
986
+ name: "feeMapPda";
987
+ writable: true;
988
+ pda: {
989
+ seeds: [
990
+ {
991
+ kind: "const";
992
+ value: [116, 111, 107, 101, 110, 95, 102, 101, 101, 95, 109, 97, 112];
993
+ }
994
+ ];
995
+ };
996
+ },
997
+ {
998
+ name: "tokenProgram";
999
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
1000
+ },
1001
+ {
1002
+ name: "jupiterProgram";
1003
+ address: "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4";
1004
+ },
1005
+ {
1006
+ name: "systemProgram";
1007
+ address: "11111111111111111111111111111111";
1008
+ }
1009
+ ];
1010
+ args: [
1011
+ {
1012
+ name: "params";
1013
+ type: {
1014
+ defined: {
1015
+ name: "swapAndLoadCarbonCardParams";
1016
+ };
1017
+ };
1018
+ }
1019
+ ];
1020
+ }
1021
+ ];
1022
+ accounts: [
1023
+ {
1024
+ name: "card";
1025
+ discriminator: [166, 250, 46, 230, 152, 63, 140, 182];
1026
+ },
1027
+ {
1028
+ name: "cardPurchase";
1029
+ discriminator: [43, 122, 86, 196, 77, 183, 171, 199];
1030
+ },
1031
+ {
1032
+ name: "customFeeMap";
1033
+ discriminator: [127, 235, 106, 68, 238, 133, 121, 187];
1034
+ },
1035
+ {
1036
+ name: "userPurchaseRecord";
1037
+ discriminator: [138, 76, 228, 151, 27, 43, 51, 179];
1038
+ }
1039
+ ];
1040
+ events: [
1041
+ {
1042
+ name: "carbonCardLoaded";
1043
+ discriminator: [204, 240, 252, 53, 207, 246, 65, 159];
1044
+ },
1045
+ {
1046
+ name: "silverCardCreated";
1047
+ discriminator: [198, 72, 11, 217, 220, 239, 215, 156];
1048
+ }
1049
+ ];
1050
+ errors: [
1051
+ {
1052
+ code: 6000;
1053
+ name: "invalidIndex";
1054
+ msg: "The provided index is invalid.";
1055
+ },
1056
+ {
1057
+ code: 6001;
1058
+ name: "invalidMint";
1059
+ msg: "The provided token is invalid.";
1060
+ },
1061
+ {
1062
+ code: 6002;
1063
+ name: "invalidOwner";
1064
+ msg: "The provided owner is invalid.";
1065
+ },
1066
+ {
1067
+ code: 6003;
1068
+ name: "invalidUser";
1069
+ msg: "The provided user is invalid.";
1070
+ },
1071
+ {
1072
+ code: 6004;
1073
+ name: "invalidAmount";
1074
+ msg: "The amount entered is invalid.";
1075
+ },
1076
+ {
1077
+ code: 6005;
1078
+ name: "notEnoughBalance";
1079
+ msg: "You do not have enough balance.";
1080
+ },
1081
+ {
1082
+ code: 6006;
1083
+ name: "amountNotWithinCardBuyRange";
1084
+ msg: "Amount falls off the min-max card buy range.";
1085
+ },
1086
+ {
1087
+ code: 6007;
1088
+ name: "dailyBuyLimitExceeded";
1089
+ msg: "BuyCard Limit Exceeded for the day.";
1090
+ },
1091
+ {
1092
+ code: 6008;
1093
+ name: "votingCapExceeded";
1094
+ msg: "Voting amount has exceeded the cap.";
1095
+ },
1096
+ {
1097
+ code: 6009;
1098
+ name: "alreadyVoted";
1099
+ msg: "Voter has already voted.";
1100
+ },
1101
+ {
1102
+ code: 6010;
1103
+ name: "alreadyWithdrawn";
1104
+ msg: "Voter has already withdrawn.";
1105
+ },
1106
+ {
1107
+ code: 6011;
1108
+ name: "invalidTime";
1109
+ msg: "Invalid time";
1110
+ },
1111
+ {
1112
+ code: 6012;
1113
+ name: "feeTierNotFound";
1114
+ msg: "Fee tier not found.";
1115
+ },
1116
+ {
1117
+ code: 6013;
1118
+ name: "customFeeNotFound";
1119
+ msg: "Custom fee not found.";
1120
+ },
1121
+ {
1122
+ code: 6014;
1123
+ name: "invalidTimestamp";
1124
+ msg: "Invalid timestamp.";
1125
+ },
1126
+ {
1127
+ code: 6015;
1128
+ name: "faultySwappedAmount";
1129
+ msg: "Faulty swapped amount.";
1130
+ }
1131
+ ];
1132
+ types: [
1133
+ {
1134
+ name: "carbonCardLoaded";
1135
+ type: {
1136
+ kind: "struct";
1137
+ fields: [
1138
+ {
1139
+ name: "index";
1140
+ type: "u64";
1141
+ },
1142
+ {
1143
+ name: "from";
1144
+ type: "pubkey";
1145
+ },
1146
+ {
1147
+ name: "sourceToken";
1148
+ type: "pubkey";
1149
+ },
1150
+ {
1151
+ name: "amount";
1152
+ type: "u64";
1153
+ },
1154
+ {
1155
+ name: "tokenFeeAmount";
1156
+ type: "u64";
1157
+ },
1158
+ {
1159
+ name: "carbonFeeAmount";
1160
+ type: "u64";
1161
+ },
1162
+ {
1163
+ name: "currency";
1164
+ type: "string";
1165
+ },
1166
+ {
1167
+ name: "emailHash";
1168
+ type: {
1169
+ array: ["u8", 32];
1170
+ };
1171
+ },
1172
+ {
1173
+ name: "reloadCardId";
1174
+ type: "string";
1175
+ }
1176
+ ];
1177
+ };
1178
+ },
1179
+ {
1180
+ name: "card";
1181
+ type: {
1182
+ kind: "struct";
1183
+ fields: [
1184
+ {
1185
+ name: "index";
1186
+ type: "u64";
1187
+ },
1188
+ {
1189
+ name: "zicOwner";
1190
+ type: "pubkey";
1191
+ },
1192
+ {
1193
+ name: "nativeFee";
1194
+ type: "u64";
1195
+ },
1196
+ {
1197
+ name: "nonNativeFee";
1198
+ type: "u64";
1199
+ },
1200
+ {
1201
+ name: "revenueFee";
1202
+ type: "u64";
1203
+ },
1204
+ {
1205
+ name: "carbonFee";
1206
+ type: "u64";
1207
+ },
1208
+ {
1209
+ name: "usdcMint";
1210
+ type: "pubkey";
1211
+ },
1212
+ {
1213
+ name: "revenueVault";
1214
+ type: "pubkey";
1215
+ },
1216
+ {
1217
+ name: "commissionVault";
1218
+ type: "pubkey";
1219
+ },
1220
+ {
1221
+ name: "cardVault";
1222
+ type: "pubkey";
1223
+ },
1224
+ {
1225
+ name: "totalBought";
1226
+ type: "u64";
1227
+ },
1228
+ {
1229
+ name: "dailyCardBuyLimit";
1230
+ type: "u64";
1231
+ },
1232
+ {
1233
+ name: "providerConfig";
1234
+ type: {
1235
+ defined: {
1236
+ name: "providerConfig";
1237
+ };
1238
+ };
1239
+ }
1240
+ ];
1241
+ };
1242
+ },
1243
+ {
1244
+ name: "cardPurchase";
1245
+ type: {
1246
+ kind: "struct";
1247
+ fields: [
1248
+ {
1249
+ name: "index";
1250
+ type: "u64";
1251
+ },
1252
+ {
1253
+ name: "buyerAddress";
1254
+ type: "pubkey";
1255
+ },
1256
+ {
1257
+ name: "amount";
1258
+ type: "u64";
1259
+ },
1260
+ {
1261
+ name: "purchaseAt";
1262
+ type: "i64";
1263
+ }
1264
+ ];
1265
+ };
1266
+ },
1267
+ {
1268
+ name: "createSilverCardParams";
1269
+ type: {
1270
+ kind: "struct";
1271
+ fields: [
1272
+ {
1273
+ name: "index";
1274
+ type: "u64";
1275
+ },
1276
+ {
1277
+ name: "amount";
1278
+ type: "u64";
1279
+ },
1280
+ {
1281
+ name: "currency";
1282
+ type: "string";
1283
+ },
1284
+ {
1285
+ name: "emailHash";
1286
+ type: {
1287
+ array: ["u8", 32];
1288
+ };
1289
+ }
1290
+ ];
1291
+ };
1292
+ },
1293
+ {
1294
+ name: "customFeeMap";
1295
+ type: {
1296
+ kind: "struct";
1297
+ fields: [
1298
+ {
1299
+ name: "feeMap";
1300
+ type: {
1301
+ vec: {
1302
+ defined: {
1303
+ name: "fees";
1304
+ };
1305
+ };
1306
+ };
1307
+ }
1308
+ ];
1309
+ };
1310
+ },
1311
+ {
1312
+ name: "feeMap";
1313
+ type: {
1314
+ kind: "struct";
1315
+ fields: [
1316
+ {
1317
+ name: "tiers";
1318
+ type: {
1319
+ vec: {
1320
+ defined: {
1321
+ name: "feeTier";
1322
+ };
1323
+ };
1324
+ };
1325
+ }
1326
+ ];
1327
+ };
1328
+ },
1329
+ {
1330
+ name: "feeTier";
1331
+ type: {
1332
+ kind: "struct";
1333
+ fields: [
1334
+ {
1335
+ name: "minAmount";
1336
+ type: "u64";
1337
+ },
1338
+ {
1339
+ name: "maxAmount";
1340
+ type: "u64";
1341
+ },
1342
+ {
1343
+ name: "fee";
1344
+ type: "u64";
1345
+ }
1346
+ ];
1347
+ };
1348
+ },
1349
+ {
1350
+ name: "fees";
1351
+ type: {
1352
+ kind: "struct";
1353
+ fields: [
1354
+ {
1355
+ name: "tokenAddress";
1356
+ type: "pubkey";
1357
+ },
1358
+ {
1359
+ name: "fee";
1360
+ type: "u64";
1361
+ }
1362
+ ];
1363
+ };
1364
+ },
1365
+ {
1366
+ name: "initCardConfigParams";
1367
+ type: {
1368
+ kind: "struct";
1369
+ fields: [
1370
+ {
1371
+ name: "nativeFee";
1372
+ type: "u64";
1373
+ },
1374
+ {
1375
+ name: "nonNativeFee";
1376
+ type: "u64";
1377
+ },
1378
+ {
1379
+ name: "revenueFee";
1380
+ type: "u64";
1381
+ },
1382
+ {
1383
+ name: "carbonFee";
1384
+ type: "u64";
1385
+ },
1386
+ {
1387
+ name: "cardVault";
1388
+ type: "pubkey";
1389
+ },
1390
+ {
1391
+ name: "revenueVault";
1392
+ type: "pubkey";
1393
+ },
1394
+ {
1395
+ name: "commissionVault";
1396
+ type: "pubkey";
1397
+ },
1398
+ {
1399
+ name: "minCardAmount";
1400
+ type: "u64";
1401
+ },
1402
+ {
1403
+ name: "maxCardAmount";
1404
+ type: "u64";
1405
+ },
1406
+ {
1407
+ name: "dailyCardBuyLimit";
1408
+ type: "u64";
1409
+ },
1410
+ {
1411
+ name: "feeTier";
1412
+ type: {
1413
+ vec: {
1414
+ defined: {
1415
+ name: "feeTier";
1416
+ };
1417
+ };
1418
+ };
1419
+ }
1420
+ ];
1421
+ };
1422
+ },
1423
+ {
1424
+ name: "loadCarbonCardParams";
1425
+ type: {
1426
+ kind: "struct";
1427
+ fields: [
1428
+ {
1429
+ name: "index";
1430
+ type: "u64";
1431
+ },
1432
+ {
1433
+ name: "amount";
1434
+ type: "u64";
1435
+ },
1436
+ {
1437
+ name: "currency";
1438
+ type: "string";
1439
+ },
1440
+ {
1441
+ name: "emailHash";
1442
+ type: {
1443
+ array: ["u8", 32];
1444
+ };
1445
+ },
1446
+ {
1447
+ name: "reloadCardId";
1448
+ type: "string";
1449
+ }
1450
+ ];
1451
+ };
1452
+ },
1453
+ {
1454
+ name: "providerConfig";
1455
+ type: {
1456
+ kind: "struct";
1457
+ fields: [
1458
+ {
1459
+ name: "minCardAmount";
1460
+ type: "u64";
1461
+ },
1462
+ {
1463
+ name: "maxCardAmount";
1464
+ type: "u64";
1465
+ },
1466
+ {
1467
+ name: "feeTiers";
1468
+ type: {
1469
+ defined: {
1470
+ name: "feeMap";
1471
+ };
1472
+ };
1473
+ }
1474
+ ];
1475
+ };
1476
+ },
1477
+ {
1478
+ name: "setCardConfigParams";
1479
+ type: {
1480
+ kind: "struct";
1481
+ fields: [
1482
+ {
1483
+ name: "nativeFee";
1484
+ type: "u64";
1485
+ },
1486
+ {
1487
+ name: "nonNativeFee";
1488
+ type: "u64";
1489
+ },
1490
+ {
1491
+ name: "revenueFee";
1492
+ type: "u64";
1493
+ },
1494
+ {
1495
+ name: "carbonFee";
1496
+ type: "u64";
1497
+ },
1498
+ {
1499
+ name: "cardVault";
1500
+ type: "pubkey";
1501
+ },
1502
+ {
1503
+ name: "revenueVault";
1504
+ type: "pubkey";
1505
+ },
1506
+ {
1507
+ name: "commissionVault";
1508
+ type: "pubkey";
1509
+ },
1510
+ {
1511
+ name: "zicOwner";
1512
+ type: "pubkey";
1513
+ },
1514
+ {
1515
+ name: "minCardAmount";
1516
+ type: "u64";
1517
+ },
1518
+ {
1519
+ name: "maxCardAmount";
1520
+ type: "u64";
1521
+ },
1522
+ {
1523
+ name: "dailyCardBuyLimit";
1524
+ type: "u64";
1525
+ },
1526
+ {
1527
+ name: "feeTier";
1528
+ type: {
1529
+ vec: {
1530
+ defined: {
1531
+ name: "feeTier";
1532
+ };
1533
+ };
1534
+ };
1535
+ }
1536
+ ];
1537
+ };
1538
+ },
1539
+ {
1540
+ name: "silverCardCreated";
1541
+ type: {
1542
+ kind: "struct";
1543
+ fields: [
1544
+ {
1545
+ name: "index";
1546
+ type: "u64";
1547
+ },
1548
+ {
1549
+ name: "from";
1550
+ type: "pubkey";
1551
+ },
1552
+ {
1553
+ name: "sourceToken";
1554
+ type: "pubkey";
1555
+ },
1556
+ {
1557
+ name: "amount";
1558
+ type: "u64";
1559
+ },
1560
+ {
1561
+ name: "tokenFeeAmount";
1562
+ type: "u64";
1563
+ },
1564
+ {
1565
+ name: "revenueAmount";
1566
+ type: "u64";
1567
+ },
1568
+ {
1569
+ name: "currency";
1570
+ type: "string";
1571
+ },
1572
+ {
1573
+ name: "emailHash";
1574
+ type: {
1575
+ array: ["u8", 32];
1576
+ };
1577
+ },
1578
+ {
1579
+ name: "swappedAmount";
1580
+ docs: ["Amount of USDC received from swap (if swap was performed)"];
1581
+ type: "u64";
1582
+ }
1583
+ ];
1584
+ };
1585
+ },
1586
+ {
1587
+ name: "swapAndCreateSilverCardParams";
1588
+ type: {
1589
+ kind: "struct";
1590
+ fields: [
1591
+ {
1592
+ name: "index";
1593
+ type: "u64";
1594
+ },
1595
+ {
1596
+ name: "currency";
1597
+ type: "string";
1598
+ },
1599
+ {
1600
+ name: "emailHash";
1601
+ type: {
1602
+ array: ["u8", 32];
1603
+ };
1604
+ },
1605
+ {
1606
+ name: "swapData";
1607
+ type: "bytes";
1608
+ }
1609
+ ];
1610
+ };
1611
+ },
1612
+ {
1613
+ name: "swapAndLoadCarbonCardParams";
1614
+ type: {
1615
+ kind: "struct";
1616
+ fields: [
1617
+ {
1618
+ name: "index";
1619
+ type: "u64";
1620
+ },
1621
+ {
1622
+ name: "currency";
1623
+ type: "string";
1624
+ },
1625
+ {
1626
+ name: "emailHash";
1627
+ type: {
1628
+ array: ["u8", 32];
1629
+ };
1630
+ },
1631
+ {
1632
+ name: "swapData";
1633
+ type: "bytes";
1634
+ },
1635
+ {
1636
+ name: "reloadCardId";
1637
+ type: "string";
1638
+ }
1639
+ ];
1640
+ };
1641
+ },
1642
+ {
1643
+ name: "userPurchaseRecord";
1644
+ type: {
1645
+ kind: "struct";
1646
+ fields: [
1647
+ {
1648
+ name: "userAddress";
1649
+ type: "pubkey";
1650
+ },
1651
+ {
1652
+ name: "totalBoughtPerDay";
1653
+ type: "u64";
1654
+ },
1655
+ {
1656
+ name: "dateTimeInUnix";
1657
+ type: "u64";
1658
+ }
1659
+ ];
1660
+ };
1661
+ }
1662
+ ];
1663
+ constants: [
1664
+ {
1665
+ name: "seed";
1666
+ type: "string";
1667
+ value: '"anchor"';
1668
+ },
1669
+ {
1670
+ name: "seedCardConfig";
1671
+ type: "string";
1672
+ value: '"card_config"';
1673
+ },
1674
+ {
1675
+ name: "seedTokenFeeMap";
1676
+ type: "string";
1677
+ value: '"token_fee_map"';
1678
+ },
1679
+ {
1680
+ name: "seedUserCardPurchase";
1681
+ type: "string";
1682
+ value: '"user_card_purchase"';
1683
+ },
1684
+ {
1685
+ name: "seedUserPurchaseRecord";
1686
+ type: "string";
1687
+ value: '"user_purchase_record"';
1688
+ }
1689
+ ];
1690
+ };