@overcast-xyz/solana-program 0.1.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,4388 @@
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/overcast_core.json`.
6
+ */
7
+ export type OvercastCore = {
8
+ address: "BCsqhc8nSrNFX6d1Uu6gJJ3SPbmXtA8UoWAg3RdifJhj";
9
+ metadata: {
10
+ name: "overcastCore";
11
+ version: "0.1.0";
12
+ spec: "0.1.0";
13
+ description: "Created with Anchor";
14
+ };
15
+ instructions: [
16
+ {
17
+ name: "acceptOffer";
18
+ discriminator: [227, 82, 234, 131, 1, 18, 48, 2];
19
+ accounts: [
20
+ {
21
+ name: "signer";
22
+ writable: true;
23
+ signer: true;
24
+ },
25
+ {
26
+ name: "maker";
27
+ docs: [
28
+ "of the accounts struct to keep `try_accounts` under the 4 KB stack frame)."
29
+ ];
30
+ },
31
+ {
32
+ name: "taker";
33
+ docs: [
34
+ "of the accounts struct to keep `try_accounts` under the 4 KB stack frame)."
35
+ ];
36
+ },
37
+ {
38
+ name: "protocolState";
39
+ pda: {
40
+ seeds: [
41
+ {
42
+ kind: "const";
43
+ value: [
44
+ 112,
45
+ 114,
46
+ 111,
47
+ 116,
48
+ 111,
49
+ 99,
50
+ 111,
51
+ 108,
52
+ 45,
53
+ 115,
54
+ 116,
55
+ 97,
56
+ 116,
57
+ 101
58
+ ];
59
+ }
60
+ ];
61
+ };
62
+ },
63
+ {
64
+ name: "premiumAsset";
65
+ docs: [
66
+ "Constrained to `settlement_offer.option_details.premium_asset` in the",
67
+ "handler (moved out of the accounts struct to keep `try_accounts` under",
68
+ "the 4 KB stack frame). The `token::mint` constraints below still bind the",
69
+ "premium token accounts to whatever mint is passed here."
70
+ ];
71
+ },
72
+ {
73
+ name: "collateralAsset";
74
+ docs: [
75
+ "Constrained to `settlement_offer.option_details.collateral_asset` in the",
76
+ "handler (moved out to keep `try_accounts` under the 4 KB stack frame)."
77
+ ];
78
+ },
79
+ {
80
+ name: "makerTokenAccount";
81
+ docs: [
82
+ "This is the token account that receives the premium",
83
+ "TODO: perhaps we want to have a premium-receiver as a field in the CollateralOffer"
84
+ ];
85
+ writable: true;
86
+ },
87
+ {
88
+ name: "offerPremiumEscrow";
89
+ writable: true;
90
+ pda: {
91
+ seeds: [
92
+ {
93
+ kind: "const";
94
+ value: [
95
+ 111,
96
+ 102,
97
+ 102,
98
+ 101,
99
+ 114,
100
+ 45,
101
+ 101,
102
+ 115,
103
+ 99,
104
+ 114,
105
+ 111,
106
+ 119
107
+ ];
108
+ },
109
+ {
110
+ kind: "account";
111
+ path: "settlementOffer";
112
+ }
113
+ ];
114
+ };
115
+ },
116
+ {
117
+ name: "offerCollateralEscrow";
118
+ writable: true;
119
+ pda: {
120
+ seeds: [
121
+ {
122
+ kind: "const";
123
+ value: [
124
+ 111,
125
+ 102,
126
+ 102,
127
+ 101,
128
+ 114,
129
+ 45,
130
+ 101,
131
+ 115,
132
+ 99,
133
+ 114,
134
+ 111,
135
+ 119
136
+ ];
137
+ },
138
+ {
139
+ kind: "account";
140
+ path: "collateralOffer";
141
+ }
142
+ ];
143
+ };
144
+ },
145
+ {
146
+ name: "settlementOffer";
147
+ pda: {
148
+ seeds: [
149
+ {
150
+ kind: "const";
151
+ value: [111, 102, 102, 101, 114];
152
+ },
153
+ {
154
+ kind: "account";
155
+ path: "settlementOffer";
156
+ }
157
+ ];
158
+ };
159
+ },
160
+ {
161
+ name: "collateralOffer";
162
+ pda: {
163
+ seeds: [
164
+ {
165
+ kind: "const";
166
+ value: [111, 102, 102, 101, 114];
167
+ },
168
+ {
169
+ kind: "account";
170
+ path: "collateralOffer";
171
+ }
172
+ ];
173
+ };
174
+ },
175
+ {
176
+ name: "option";
177
+ writable: true;
178
+ pda: {
179
+ seeds: [
180
+ {
181
+ kind: "const";
182
+ value: [111, 112, 116, 105, 111, 110];
183
+ },
184
+ {
185
+ kind: "account";
186
+ path: "collateralOffer";
187
+ },
188
+ {
189
+ kind: "account";
190
+ path: "settlementOffer";
191
+ }
192
+ ];
193
+ };
194
+ },
195
+ {
196
+ name: "optionCollateralEscrow";
197
+ writable: true;
198
+ pda: {
199
+ seeds: [
200
+ {
201
+ kind: "const";
202
+ value: [
203
+ 111,
204
+ 112,
205
+ 116,
206
+ 105,
207
+ 111,
208
+ 110,
209
+ 45,
210
+ 99,
211
+ 111,
212
+ 108,
213
+ 108,
214
+ 97,
215
+ 116,
216
+ 101,
217
+ 114,
218
+ 97,
219
+ 108,
220
+ 45,
221
+ 101,
222
+ 115,
223
+ 99,
224
+ 114,
225
+ 111,
226
+ 119
227
+ ];
228
+ },
229
+ {
230
+ kind: "account";
231
+ path: "collateralOffer";
232
+ },
233
+ {
234
+ kind: "account";
235
+ path: "settlementOffer";
236
+ }
237
+ ];
238
+ };
239
+ },
240
+ {
241
+ name: "mintExerciseClaim";
242
+ writable: true;
243
+ pda: {
244
+ seeds: [
245
+ {
246
+ kind: "const";
247
+ value: [
248
+ 109,
249
+ 105,
250
+ 110,
251
+ 116,
252
+ 45,
253
+ 101,
254
+ 120,
255
+ 101,
256
+ 114,
257
+ 99,
258
+ 105,
259
+ 115,
260
+ 101
261
+ ];
262
+ },
263
+ {
264
+ kind: "account";
265
+ path: "collateralOffer";
266
+ },
267
+ {
268
+ kind: "account";
269
+ path: "settlementOffer";
270
+ }
271
+ ];
272
+ };
273
+ },
274
+ {
275
+ name: "exerciseClaimTokenAccount";
276
+ writable: true;
277
+ pda: {
278
+ seeds: [
279
+ {
280
+ kind: "account";
281
+ path: "taker";
282
+ },
283
+ {
284
+ kind: "account";
285
+ path: "claimTokenProgram";
286
+ },
287
+ {
288
+ kind: "account";
289
+ path: "mintExerciseClaim";
290
+ }
291
+ ];
292
+ program: {
293
+ kind: "const";
294
+ value: [
295
+ 140,
296
+ 151,
297
+ 37,
298
+ 143,
299
+ 78,
300
+ 36,
301
+ 137,
302
+ 241,
303
+ 187,
304
+ 61,
305
+ 16,
306
+ 41,
307
+ 20,
308
+ 142,
309
+ 13,
310
+ 131,
311
+ 11,
312
+ 90,
313
+ 19,
314
+ 153,
315
+ 218,
316
+ 255,
317
+ 16,
318
+ 132,
319
+ 4,
320
+ 142,
321
+ 123,
322
+ 216,
323
+ 219,
324
+ 233,
325
+ 248,
326
+ 89
327
+ ];
328
+ };
329
+ };
330
+ },
331
+ {
332
+ name: "mintCollateralReturnClaim";
333
+ writable: true;
334
+ pda: {
335
+ seeds: [
336
+ {
337
+ kind: "const";
338
+ value: [
339
+ 109,
340
+ 105,
341
+ 110,
342
+ 116,
343
+ 45,
344
+ 99,
345
+ 111,
346
+ 108,
347
+ 108,
348
+ 97,
349
+ 116,
350
+ 101,
351
+ 114,
352
+ 97,
353
+ 108,
354
+ 45,
355
+ 114,
356
+ 101,
357
+ 116,
358
+ 117,
359
+ 114,
360
+ 110
361
+ ];
362
+ },
363
+ {
364
+ kind: "account";
365
+ path: "collateralOffer";
366
+ },
367
+ {
368
+ kind: "account";
369
+ path: "settlementOffer";
370
+ }
371
+ ];
372
+ };
373
+ },
374
+ {
375
+ name: "collateralReturnClaimTokenAccount";
376
+ writable: true;
377
+ pda: {
378
+ seeds: [
379
+ {
380
+ kind: "account";
381
+ path: "maker";
382
+ },
383
+ {
384
+ kind: "account";
385
+ path: "claimTokenProgram";
386
+ },
387
+ {
388
+ kind: "account";
389
+ path: "mintCollateralReturnClaim";
390
+ }
391
+ ];
392
+ program: {
393
+ kind: "const";
394
+ value: [
395
+ 140,
396
+ 151,
397
+ 37,
398
+ 143,
399
+ 78,
400
+ 36,
401
+ 137,
402
+ 241,
403
+ 187,
404
+ 61,
405
+ 16,
406
+ 41,
407
+ 20,
408
+ 142,
409
+ 13,
410
+ 131,
411
+ 11,
412
+ 90,
413
+ 19,
414
+ 153,
415
+ 218,
416
+ 255,
417
+ 16,
418
+ 132,
419
+ 4,
420
+ 142,
421
+ 123,
422
+ 216,
423
+ 219,
424
+ 233,
425
+ 248,
426
+ 89
427
+ ];
428
+ };
429
+ };
430
+ },
431
+ {
432
+ name: "premiumTokenProgram";
433
+ docs: [
434
+ "Program owning the premium asset (`maker_token_account`,",
435
+ "`offer_premium_escrow`). May be legacy Token or Token-2022."
436
+ ];
437
+ },
438
+ {
439
+ name: "collateralTokenProgram";
440
+ docs: [
441
+ "Program owning the collateral asset (`offer_collateral_escrow`,",
442
+ "`option_collateral_escrow`). May be legacy Token or Token-2022."
443
+ ];
444
+ },
445
+ {
446
+ name: "claimTokenProgram";
447
+ docs: [
448
+ "Program owning the protocol's exercise / collateral-return claim mints.",
449
+ "These use the permanent-delegate extension, so this must be Token-2022."
450
+ ];
451
+ address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
452
+ },
453
+ {
454
+ name: "settlementConfig";
455
+ docs: [
456
+ "Settlement layer config PDA — option commits to this address; the",
457
+ "settlement program is recovered from its owner field.",
458
+ "in the handler (moved out to keep `try_accounts` under the 4 KB stack",
459
+ "frame); otherwise deserialized only by the settlement layer itself."
460
+ ];
461
+ },
462
+ {
463
+ name: "settlementProgram";
464
+ docs: [
465
+ "Settlement layer program. Ownership of `settlement_config` is checked",
466
+ "inside `invoke_can_match`; executability is enforced by the runtime."
467
+ ];
468
+ },
469
+ {
470
+ name: "hookConfig";
471
+ docs: ["Hook config - ProtocolState determines the hook config;"];
472
+ optional: true;
473
+ },
474
+ {
475
+ name: "hookConfigPremiumAta";
476
+ docs: ["The accounts that receives the hook fee - if present"];
477
+ writable: true;
478
+ optional: true;
479
+ pda: {
480
+ seeds: [
481
+ {
482
+ kind: "account";
483
+ path: "hookConfig";
484
+ },
485
+ {
486
+ kind: "account";
487
+ path: "premiumTokenProgram";
488
+ },
489
+ {
490
+ kind: "account";
491
+ path: "premiumAsset";
492
+ }
493
+ ];
494
+ program: {
495
+ kind: "const";
496
+ value: [
497
+ 140,
498
+ 151,
499
+ 37,
500
+ 143,
501
+ 78,
502
+ 36,
503
+ 137,
504
+ 241,
505
+ 187,
506
+ 61,
507
+ 16,
508
+ 41,
509
+ 20,
510
+ 142,
511
+ 13,
512
+ 131,
513
+ 11,
514
+ 90,
515
+ 19,
516
+ 153,
517
+ 218,
518
+ 255,
519
+ 16,
520
+ 132,
521
+ 4,
522
+ 142,
523
+ 123,
524
+ 216,
525
+ 219,
526
+ 233,
527
+ 248,
528
+ 89
529
+ ];
530
+ };
531
+ };
532
+ },
533
+ {
534
+ name: "hookProgram";
535
+ docs: [
536
+ "Hook program. Ownership of `hook_config` is checked",
537
+ "inside `invoke_on_create_option`; executability is enforced by the runtime."
538
+ ];
539
+ optional: true;
540
+ },
541
+ {
542
+ name: "associatedTokenProgram";
543
+ address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
544
+ },
545
+ {
546
+ name: "systemProgram";
547
+ address: "11111111111111111111111111111111";
548
+ }
549
+ ];
550
+ args: [
551
+ {
552
+ name: "metadata";
553
+ type: "bytes";
554
+ }
555
+ ];
556
+ },
557
+ {
558
+ name: "borrowCollateral";
559
+ discriminator: [103, 23, 222, 26, 69, 125, 77, 46];
560
+ accounts: [
561
+ {
562
+ name: "taker";
563
+ docs: [
564
+ "The option's original taker. Borrow is scoped to this account: they",
565
+ "signed up for the exercise obligation at match time, so they're the one",
566
+ "entitled to take custody of collateral during the option's life."
567
+ ];
568
+ writable: true;
569
+ signer: true;
570
+ },
571
+ {
572
+ name: "protocolState";
573
+ pda: {
574
+ seeds: [
575
+ {
576
+ kind: "const";
577
+ value: [
578
+ 112,
579
+ 114,
580
+ 111,
581
+ 116,
582
+ 111,
583
+ 99,
584
+ 111,
585
+ 108,
586
+ 45,
587
+ 115,
588
+ 116,
589
+ 97,
590
+ 116,
591
+ 101
592
+ ];
593
+ }
594
+ ];
595
+ };
596
+ },
597
+ {
598
+ name: "option";
599
+ writable: true;
600
+ pda: {
601
+ seeds: [
602
+ {
603
+ kind: "const";
604
+ value: [111, 112, 116, 105, 111, 110];
605
+ },
606
+ {
607
+ kind: "account";
608
+ path: "option.collateral_offer";
609
+ account: "marketOptionAccount";
610
+ },
611
+ {
612
+ kind: "account";
613
+ path: "option.settlement_offer";
614
+ account: "marketOptionAccount";
615
+ }
616
+ ];
617
+ };
618
+ },
619
+ {
620
+ name: "collateralAsset";
621
+ },
622
+ {
623
+ name: "collateralReceiverTokenAccount";
624
+ writable: true;
625
+ },
626
+ {
627
+ name: "optionCollateralEscrow";
628
+ writable: true;
629
+ pda: {
630
+ seeds: [
631
+ {
632
+ kind: "const";
633
+ value: [
634
+ 111,
635
+ 112,
636
+ 116,
637
+ 105,
638
+ 111,
639
+ 110,
640
+ 45,
641
+ 99,
642
+ 111,
643
+ 108,
644
+ 108,
645
+ 97,
646
+ 116,
647
+ 101,
648
+ 114,
649
+ 97,
650
+ 108,
651
+ 45,
652
+ 101,
653
+ 115,
654
+ 99,
655
+ 114,
656
+ 111,
657
+ 119
658
+ ];
659
+ },
660
+ {
661
+ kind: "account";
662
+ path: "option.collateral_offer";
663
+ account: "marketOptionAccount";
664
+ },
665
+ {
666
+ kind: "account";
667
+ path: "option.settlement_offer";
668
+ account: "marketOptionAccount";
669
+ }
670
+ ];
671
+ };
672
+ },
673
+ {
674
+ name: "collateralTokenProgram";
675
+ docs: [
676
+ "Program owning the collateral asset. May be legacy Token or Token-2022."
677
+ ];
678
+ },
679
+ {
680
+ name: "settlementConfig";
681
+ docs: [
682
+ "Settlement layer config PDA committed to by the option. Address must",
683
+ "match `option.details.settlement_layer`; owner identifies the layer",
684
+ "program (checked inside `invoke_can_borrow`)."
685
+ ];
686
+ },
687
+ {
688
+ name: "settlementProgram";
689
+ docs: [
690
+ "Settlement layer program. Ownership of `settlement_config` is checked",
691
+ "inside `invoke_can_borrow`; executability is enforced by the runtime."
692
+ ];
693
+ }
694
+ ];
695
+ args: [
696
+ {
697
+ name: "amount";
698
+ type: "u64";
699
+ },
700
+ {
701
+ name: "metadata";
702
+ type: "bytes";
703
+ }
704
+ ];
705
+ },
706
+ {
707
+ name: "burnExerciseClaims";
708
+ discriminator: [38, 249, 9, 88, 98, 190, 8, 1];
709
+ accounts: [
710
+ {
711
+ name: "protocolState";
712
+ pda: {
713
+ seeds: [
714
+ {
715
+ kind: "const";
716
+ value: [
717
+ 112,
718
+ 114,
719
+ 111,
720
+ 116,
721
+ 111,
722
+ 99,
723
+ 111,
724
+ 108,
725
+ 45,
726
+ 115,
727
+ 116,
728
+ 97,
729
+ 116,
730
+ 101
731
+ ];
732
+ }
733
+ ];
734
+ };
735
+ },
736
+ {
737
+ name: "option";
738
+ },
739
+ {
740
+ name: "claimTokenProgram";
741
+ docs: [
742
+ "Program owning the protocol's exercise / collateral-return claim mints.",
743
+ "These use the permanent-delegate extension, so this must be Token-2022."
744
+ ];
745
+ address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
746
+ },
747
+ {
748
+ name: "exerciseClaimTokenAccount";
749
+ writable: true;
750
+ },
751
+ {
752
+ name: "mintExerciseClaim";
753
+ writable: true;
754
+ pda: {
755
+ seeds: [
756
+ {
757
+ kind: "const";
758
+ value: [
759
+ 109,
760
+ 105,
761
+ 110,
762
+ 116,
763
+ 45,
764
+ 101,
765
+ 120,
766
+ 101,
767
+ 114,
768
+ 99,
769
+ 105,
770
+ 115,
771
+ 101
772
+ ];
773
+ },
774
+ {
775
+ kind: "account";
776
+ path: "option.collateral_offer";
777
+ account: "marketOptionAccount";
778
+ },
779
+ {
780
+ kind: "account";
781
+ path: "option.settlement_offer";
782
+ account: "marketOptionAccount";
783
+ }
784
+ ];
785
+ };
786
+ }
787
+ ];
788
+ args: [];
789
+ },
790
+ {
791
+ name: "closeOffer";
792
+ discriminator: [191, 72, 67, 35, 239, 209, 97, 132];
793
+ accounts: [
794
+ {
795
+ name: "signer";
796
+ docs: [
797
+ "The executor. For direct calls this must equal `creator`.",
798
+ "For operation calls this is the operator submitting on the creators behalf."
799
+ ];
800
+ writable: true;
801
+ signer: true;
802
+ },
803
+ {
804
+ name: "creator";
805
+ docs: [
806
+ "collateral refund into their deposit PDA. For direct calls: must be a",
807
+ "transaction signer (`creator.is_signer` enforced in the handler). For",
808
+ "operation calls: verified via the ed25519 operation signature."
809
+ ];
810
+ writable: true;
811
+ },
812
+ {
813
+ name: "accountCreator";
814
+ docs: [
815
+ "rent and the escrow token account's lamports on close. Constrained to",
816
+ "`offer.creator` — the `signer` at offer creation (the maker on direct",
817
+ "calls, the operator on operation calls)."
818
+ ];
819
+ writable: true;
820
+ relations: ["offer"];
821
+ },
822
+ {
823
+ name: "depositAsset";
824
+ docs: [
825
+ "This is either the collateral or the premium asset that was deposited in order to create the offer.",
826
+ "For offers created in a OptionSide::Maker, this is equal to the collateral asset.",
827
+ "For OptionSide::Taker, this is equal to the premium asset.",
828
+ "",
829
+ "Bound to the stored offer's side asset here — before `creator_deposit`,",
830
+ "whose PDA seed folds in this mint — so a wrong deposit asset surfaces as",
831
+ "`AssetMismatch` rather than the seed constraint on `creator_deposit`."
832
+ ];
833
+ },
834
+ {
835
+ name: "protocolState";
836
+ pda: {
837
+ seeds: [
838
+ {
839
+ kind: "const";
840
+ value: [
841
+ 112,
842
+ 114,
843
+ 111,
844
+ 116,
845
+ 111,
846
+ 99,
847
+ 111,
848
+ 108,
849
+ 45,
850
+ 115,
851
+ 116,
852
+ 97,
853
+ 116,
854
+ 101
855
+ ];
856
+ }
857
+ ];
858
+ };
859
+ },
860
+ {
861
+ name: "creatorDeposit";
862
+ writable: true;
863
+ pda: {
864
+ seeds: [
865
+ {
866
+ kind: "const";
867
+ value: [
868
+ 112,
869
+ 114,
870
+ 111,
871
+ 116,
872
+ 111,
873
+ 99,
874
+ 111,
875
+ 108,
876
+ 45,
877
+ 101,
878
+ 115,
879
+ 99,
880
+ 114,
881
+ 111,
882
+ 119
883
+ ];
884
+ },
885
+ {
886
+ kind: "account";
887
+ path: "creator";
888
+ },
889
+ {
890
+ kind: "account";
891
+ path: "depositAsset";
892
+ }
893
+ ];
894
+ };
895
+ },
896
+ {
897
+ name: "offer";
898
+ writable: true;
899
+ },
900
+ {
901
+ name: "escrow";
902
+ writable: true;
903
+ pda: {
904
+ seeds: [
905
+ {
906
+ kind: "const";
907
+ value: [
908
+ 111,
909
+ 102,
910
+ 102,
911
+ 101,
912
+ 114,
913
+ 45,
914
+ 101,
915
+ 115,
916
+ 99,
917
+ 114,
918
+ 111,
919
+ 119
920
+ ];
921
+ },
922
+ {
923
+ kind: "account";
924
+ path: "offer";
925
+ }
926
+ ];
927
+ };
928
+ },
929
+ {
930
+ name: "tokenProgram";
931
+ },
932
+ {
933
+ name: "systemProgram";
934
+ address: "11111111111111111111111111111111";
935
+ },
936
+ {
937
+ name: "instructionsSysvar";
938
+ docs: [
939
+ "read when verifying a delegated maker signature via `operation`."
940
+ ];
941
+ optional: true;
942
+ address: "Sysvar1nstructions1111111111111111111111111";
943
+ },
944
+ {
945
+ name: "usedOperation";
946
+ docs: ["for the operation path."];
947
+ writable: true;
948
+ optional: true;
949
+ },
950
+ {
951
+ name: "signingKeyDelegation";
952
+ docs: [
953
+ "Record proving the maker authorized `operation.signing_key`; the",
954
+ "(owner, signing_key) binding is checked in `authorize_operation`."
955
+ ];
956
+ optional: true;
957
+ }
958
+ ];
959
+ args: [
960
+ {
961
+ name: "operation";
962
+ type: {
963
+ option: {
964
+ defined: {
965
+ name: "operationParams";
966
+ };
967
+ };
968
+ };
969
+ }
970
+ ];
971
+ },
972
+ {
973
+ name: "closeOptionAccounts";
974
+ discriminator: [3, 180, 173, 88, 130, 134, 240, 237];
975
+ accounts: [
976
+ {
977
+ name: "protocolState";
978
+ pda: {
979
+ seeds: [
980
+ {
981
+ kind: "const";
982
+ value: [
983
+ 112,
984
+ 114,
985
+ 111,
986
+ 116,
987
+ 111,
988
+ 99,
989
+ 111,
990
+ 108,
991
+ 45,
992
+ 115,
993
+ 116,
994
+ 97,
995
+ 116,
996
+ 101
997
+ ];
998
+ }
999
+ ];
1000
+ };
1001
+ },
1002
+ {
1003
+ name: "option";
1004
+ writable: true;
1005
+ },
1006
+ {
1007
+ name: "optionCreator";
1008
+ docs: [
1009
+ "rents routed here in the handler); pinned to the recorded `option.creator`",
1010
+ "who funded them, so only that account can receive the refund."
1011
+ ];
1012
+ writable: true;
1013
+ },
1014
+ {
1015
+ name: "settlementOffer";
1016
+ writable: true;
1017
+ },
1018
+ {
1019
+ name: "settlementOfferCreator";
1020
+ docs: [
1021
+ "lamports; pinned to the recorded `settlement_offer.creator` who funded",
1022
+ "them, so only that account can receive the refund."
1023
+ ];
1024
+ writable: true;
1025
+ },
1026
+ {
1027
+ name: "offerPremiumEscrow";
1028
+ writable: true;
1029
+ pda: {
1030
+ seeds: [
1031
+ {
1032
+ kind: "const";
1033
+ value: [
1034
+ 111,
1035
+ 102,
1036
+ 102,
1037
+ 101,
1038
+ 114,
1039
+ 45,
1040
+ 101,
1041
+ 115,
1042
+ 99,
1043
+ 114,
1044
+ 111,
1045
+ 119
1046
+ ];
1047
+ },
1048
+ {
1049
+ kind: "account";
1050
+ path: "settlementOffer";
1051
+ }
1052
+ ];
1053
+ };
1054
+ },
1055
+ {
1056
+ name: "collateralOffer";
1057
+ writable: true;
1058
+ },
1059
+ {
1060
+ name: "collateralOfferCreator";
1061
+ docs: [
1062
+ "lamports; pinned to the recorded `collateral_offer.creator` who funded",
1063
+ "them, so only that account can receive the refund."
1064
+ ];
1065
+ writable: true;
1066
+ },
1067
+ {
1068
+ name: "offerCollateralEscrow";
1069
+ writable: true;
1070
+ pda: {
1071
+ seeds: [
1072
+ {
1073
+ kind: "const";
1074
+ value: [
1075
+ 111,
1076
+ 102,
1077
+ 102,
1078
+ 101,
1079
+ 114,
1080
+ 45,
1081
+ 101,
1082
+ 115,
1083
+ 99,
1084
+ 114,
1085
+ 111,
1086
+ 119
1087
+ ];
1088
+ },
1089
+ {
1090
+ kind: "account";
1091
+ path: "collateralOffer";
1092
+ }
1093
+ ];
1094
+ };
1095
+ },
1096
+ {
1097
+ name: "mintExerciseClaim";
1098
+ writable: true;
1099
+ pda: {
1100
+ seeds: [
1101
+ {
1102
+ kind: "const";
1103
+ value: [
1104
+ 109,
1105
+ 105,
1106
+ 110,
1107
+ 116,
1108
+ 45,
1109
+ 101,
1110
+ 120,
1111
+ 101,
1112
+ 114,
1113
+ 99,
1114
+ 105,
1115
+ 115,
1116
+ 101
1117
+ ];
1118
+ },
1119
+ {
1120
+ kind: "account";
1121
+ path: "collateralOffer";
1122
+ },
1123
+ {
1124
+ kind: "account";
1125
+ path: "settlementOffer";
1126
+ }
1127
+ ];
1128
+ };
1129
+ },
1130
+ {
1131
+ name: "mintCollateralReturnClaim";
1132
+ writable: true;
1133
+ pda: {
1134
+ seeds: [
1135
+ {
1136
+ kind: "const";
1137
+ value: [
1138
+ 109,
1139
+ 105,
1140
+ 110,
1141
+ 116,
1142
+ 45,
1143
+ 99,
1144
+ 111,
1145
+ 108,
1146
+ 108,
1147
+ 97,
1148
+ 116,
1149
+ 101,
1150
+ 114,
1151
+ 97,
1152
+ 108,
1153
+ 45,
1154
+ 114,
1155
+ 101,
1156
+ 116,
1157
+ 117,
1158
+ 114,
1159
+ 110
1160
+ ];
1161
+ },
1162
+ {
1163
+ kind: "account";
1164
+ path: "collateralOffer";
1165
+ },
1166
+ {
1167
+ kind: "account";
1168
+ path: "settlementOffer";
1169
+ }
1170
+ ];
1171
+ };
1172
+ },
1173
+ {
1174
+ name: "optionCollateralEscrow";
1175
+ writable: true;
1176
+ pda: {
1177
+ seeds: [
1178
+ {
1179
+ kind: "const";
1180
+ value: [
1181
+ 111,
1182
+ 112,
1183
+ 116,
1184
+ 105,
1185
+ 111,
1186
+ 110,
1187
+ 45,
1188
+ 99,
1189
+ 111,
1190
+ 108,
1191
+ 108,
1192
+ 97,
1193
+ 116,
1194
+ 101,
1195
+ 114,
1196
+ 97,
1197
+ 108,
1198
+ 45,
1199
+ 101,
1200
+ 115,
1201
+ 99,
1202
+ 114,
1203
+ 111,
1204
+ 119
1205
+ ];
1206
+ },
1207
+ {
1208
+ kind: "account";
1209
+ path: "option.collateral_offer";
1210
+ account: "marketOptionAccount";
1211
+ },
1212
+ {
1213
+ kind: "account";
1214
+ path: "option.settlement_offer";
1215
+ account: "marketOptionAccount";
1216
+ }
1217
+ ];
1218
+ };
1219
+ },
1220
+ {
1221
+ name: "optionSettlementEscrow";
1222
+ writable: true;
1223
+ optional: true;
1224
+ pda: {
1225
+ seeds: [
1226
+ {
1227
+ kind: "const";
1228
+ value: [
1229
+ 111,
1230
+ 112,
1231
+ 116,
1232
+ 105,
1233
+ 111,
1234
+ 110,
1235
+ 45,
1236
+ 115,
1237
+ 101,
1238
+ 116,
1239
+ 116,
1240
+ 108,
1241
+ 101,
1242
+ 109,
1243
+ 101,
1244
+ 110,
1245
+ 116,
1246
+ 45,
1247
+ 101,
1248
+ 115,
1249
+ 99,
1250
+ 114,
1251
+ 111,
1252
+ 119
1253
+ ];
1254
+ },
1255
+ {
1256
+ kind: "account";
1257
+ path: "option.collateral_offer";
1258
+ account: "marketOptionAccount";
1259
+ },
1260
+ {
1261
+ kind: "account";
1262
+ path: "option.settlement_offer";
1263
+ account: "marketOptionAccount";
1264
+ }
1265
+ ];
1266
+ };
1267
+ },
1268
+ {
1269
+ name: "premiumTokenProgram";
1270
+ docs: [
1271
+ "Program owning the premium asset (`maker_token_account`,",
1272
+ "`offer_premium_escrow`). May be legacy Token or Token-2022."
1273
+ ];
1274
+ },
1275
+ {
1276
+ name: "collateralTokenProgram";
1277
+ docs: [
1278
+ "Program owning the collateral asset (`offer_collateral_escrow`,",
1279
+ "`option_collateral_escrow`). May be legacy Token or Token-2022."
1280
+ ];
1281
+ },
1282
+ {
1283
+ name: "settlementTokenProgram";
1284
+ docs: [
1285
+ "Program owning the settlement asset (`option_settlement_escrow`). May be",
1286
+ "legacy Token or Token-2022."
1287
+ ];
1288
+ },
1289
+ {
1290
+ name: "claimTokenProgram";
1291
+ docs: [
1292
+ "Program owning the protocol's exercise / collateral-return claim mints.",
1293
+ "These use the permanent-delegate extension, so this must be Token-2022."
1294
+ ];
1295
+ address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
1296
+ }
1297
+ ];
1298
+ args: [];
1299
+ },
1300
+ {
1301
+ name: "closeUsedOperation";
1302
+ discriminator: [28, 254, 128, 247, 133, 110, 119, 9];
1303
+ accounts: [
1304
+ {
1305
+ name: "payer";
1306
+ docs: [
1307
+ "record (the operator on delegated calls). Not a signer — cleanup is",
1308
+ "permissionless, but the `address` constraint forces the rent back to the",
1309
+ "original payer so a third party can't redirect it."
1310
+ ];
1311
+ writable: true;
1312
+ },
1313
+ {
1314
+ name: "operationSigner";
1315
+ docs: [
1316
+ "by; used only for seed derivation. Bound to the real PDA by the",
1317
+ "`seeds`/`bump` below, so a wrong value fails address derivation."
1318
+ ];
1319
+ },
1320
+ {
1321
+ name: "usedOperation";
1322
+ writable: true;
1323
+ pda: {
1324
+ seeds: [
1325
+ {
1326
+ kind: "const";
1327
+ value: [
1328
+ 117,
1329
+ 115,
1330
+ 101,
1331
+ 100,
1332
+ 45,
1333
+ 111,
1334
+ 112,
1335
+ 101,
1336
+ 114,
1337
+ 97,
1338
+ 116,
1339
+ 105,
1340
+ 111,
1341
+ 110
1342
+ ];
1343
+ },
1344
+ {
1345
+ kind: "account";
1346
+ path: "operationSigner";
1347
+ },
1348
+ {
1349
+ kind: "arg";
1350
+ path: "nonce";
1351
+ }
1352
+ ];
1353
+ };
1354
+ },
1355
+ {
1356
+ name: "systemProgram";
1357
+ address: "11111111111111111111111111111111";
1358
+ }
1359
+ ];
1360
+ args: [
1361
+ {
1362
+ name: "nonce";
1363
+ type: {
1364
+ array: ["u8", 32];
1365
+ };
1366
+ }
1367
+ ];
1368
+ },
1369
+ {
1370
+ name: "deposit";
1371
+ discriminator: [242, 35, 198, 137, 82, 225, 242, 182];
1372
+ accounts: [
1373
+ {
1374
+ name: "signer";
1375
+ writable: true;
1376
+ signer: true;
1377
+ },
1378
+ {
1379
+ name: "depositor";
1380
+ docs: [
1381
+ "In most cases this will be the signer itself, but perhaps the signer wants to perform",
1382
+ "an authorized action for someone else."
1383
+ ];
1384
+ },
1385
+ {
1386
+ name: "inputTokenAuthority";
1387
+ docs: [
1388
+ "The authority (owner / delegate) of the input token account. Must sign so",
1389
+ "the SPL `transfer_checked` CPI below is authorized. In most cases this is",
1390
+ "the same as `signer`, but it may be a different party signing to authorize",
1391
+ "moving their own tokens."
1392
+ ];
1393
+ signer: true;
1394
+ },
1395
+ {
1396
+ name: "mint";
1397
+ },
1398
+ {
1399
+ name: "protocolState";
1400
+ pda: {
1401
+ seeds: [
1402
+ {
1403
+ kind: "const";
1404
+ value: [
1405
+ 112,
1406
+ 114,
1407
+ 111,
1408
+ 116,
1409
+ 111,
1410
+ 99,
1411
+ 111,
1412
+ 108,
1413
+ 45,
1414
+ 115,
1415
+ 116,
1416
+ 97,
1417
+ 116,
1418
+ 101
1419
+ ];
1420
+ }
1421
+ ];
1422
+ };
1423
+ },
1424
+ {
1425
+ name: "tokenProgram";
1426
+ },
1427
+ {
1428
+ name: "inputTokenAccount";
1429
+ writable: true;
1430
+ },
1431
+ {
1432
+ name: "userTokenAccount";
1433
+ writable: true;
1434
+ pda: {
1435
+ seeds: [
1436
+ {
1437
+ kind: "const";
1438
+ value: [
1439
+ 112,
1440
+ 114,
1441
+ 111,
1442
+ 116,
1443
+ 111,
1444
+ 99,
1445
+ 111,
1446
+ 108,
1447
+ 45,
1448
+ 101,
1449
+ 115,
1450
+ 99,
1451
+ 114,
1452
+ 111,
1453
+ 119
1454
+ ];
1455
+ },
1456
+ {
1457
+ kind: "account";
1458
+ path: "depositor";
1459
+ },
1460
+ {
1461
+ kind: "account";
1462
+ path: "mint";
1463
+ }
1464
+ ];
1465
+ };
1466
+ },
1467
+ {
1468
+ name: "systemProgram";
1469
+ address: "11111111111111111111111111111111";
1470
+ }
1471
+ ];
1472
+ args: [
1473
+ {
1474
+ name: "amount";
1475
+ type: "u64";
1476
+ }
1477
+ ];
1478
+ },
1479
+ {
1480
+ name: "exerciseOption";
1481
+ discriminator: [231, 98, 131, 183, 245, 93, 122, 48];
1482
+ accounts: [
1483
+ {
1484
+ name: "signer";
1485
+ docs: [
1486
+ "The executor. For direct calls this must equal `taker` (same pubkey).",
1487
+ "For intent calls this is the operator submitting on the taker's behalf."
1488
+ ];
1489
+ writable: true;
1490
+ signer: true;
1491
+ },
1492
+ {
1493
+ name: "taker";
1494
+ docs: [
1495
+ "For direct calls: must be a transaction signer (taker.is_signer enforced in handler).",
1496
+ "For intent calls: verified via the ed25519 intent signature."
1497
+ ];
1498
+ },
1499
+ {
1500
+ name: "protocolState";
1501
+ pda: {
1502
+ seeds: [
1503
+ {
1504
+ kind: "const";
1505
+ value: [
1506
+ 112,
1507
+ 114,
1508
+ 111,
1509
+ 116,
1510
+ 111,
1511
+ 99,
1512
+ 111,
1513
+ 108,
1514
+ 45,
1515
+ 115,
1516
+ 116,
1517
+ 97,
1518
+ 116,
1519
+ 101
1520
+ ];
1521
+ }
1522
+ ];
1523
+ };
1524
+ },
1525
+ {
1526
+ name: "option";
1527
+ writable: true;
1528
+ pda: {
1529
+ seeds: [
1530
+ {
1531
+ kind: "const";
1532
+ value: [111, 112, 116, 105, 111, 110];
1533
+ },
1534
+ {
1535
+ kind: "account";
1536
+ path: "option.collateral_offer";
1537
+ account: "marketOptionAccount";
1538
+ },
1539
+ {
1540
+ kind: "account";
1541
+ path: "option.settlement_offer";
1542
+ account: "marketOptionAccount";
1543
+ }
1544
+ ];
1545
+ };
1546
+ },
1547
+ {
1548
+ name: "mintExerciseClaim";
1549
+ writable: true;
1550
+ pda: {
1551
+ seeds: [
1552
+ {
1553
+ kind: "const";
1554
+ value: [
1555
+ 109,
1556
+ 105,
1557
+ 110,
1558
+ 116,
1559
+ 45,
1560
+ 101,
1561
+ 120,
1562
+ 101,
1563
+ 114,
1564
+ 99,
1565
+ 105,
1566
+ 115,
1567
+ 101
1568
+ ];
1569
+ },
1570
+ {
1571
+ kind: "account";
1572
+ path: "option.collateral_offer";
1573
+ account: "marketOptionAccount";
1574
+ },
1575
+ {
1576
+ kind: "account";
1577
+ path: "option.settlement_offer";
1578
+ account: "marketOptionAccount";
1579
+ }
1580
+ ];
1581
+ };
1582
+ },
1583
+ {
1584
+ name: "exerciseClaimTokenAccount";
1585
+ writable: true;
1586
+ },
1587
+ {
1588
+ name: "collateralAsset";
1589
+ },
1590
+ {
1591
+ name: "collateralReceiverTokenAccount";
1592
+ writable: true;
1593
+ },
1594
+ {
1595
+ name: "optionCollateralEscrow";
1596
+ writable: true;
1597
+ pda: {
1598
+ seeds: [
1599
+ {
1600
+ kind: "const";
1601
+ value: [
1602
+ 111,
1603
+ 112,
1604
+ 116,
1605
+ 105,
1606
+ 111,
1607
+ 110,
1608
+ 45,
1609
+ 99,
1610
+ 111,
1611
+ 108,
1612
+ 108,
1613
+ 97,
1614
+ 116,
1615
+ 101,
1616
+ 114,
1617
+ 97,
1618
+ 108,
1619
+ 45,
1620
+ 101,
1621
+ 115,
1622
+ 99,
1623
+ 114,
1624
+ 111,
1625
+ 119
1626
+ ];
1627
+ },
1628
+ {
1629
+ kind: "account";
1630
+ path: "option.collateral_offer";
1631
+ account: "marketOptionAccount";
1632
+ },
1633
+ {
1634
+ kind: "account";
1635
+ path: "option.settlement_offer";
1636
+ account: "marketOptionAccount";
1637
+ }
1638
+ ];
1639
+ };
1640
+ },
1641
+ {
1642
+ name: "settlementAsset";
1643
+ },
1644
+ {
1645
+ name: "takerSettlementDeposit";
1646
+ docs: [
1647
+ "Taker's protocol deposit for the settlement asset. Settlement is always",
1648
+ "routed through the protocol vault so that intent-based calls (where the",
1649
+ "taker is not a transaction signer) work without any additional signer."
1650
+ ];
1651
+ writable: true;
1652
+ pda: {
1653
+ seeds: [
1654
+ {
1655
+ kind: "const";
1656
+ value: [
1657
+ 112,
1658
+ 114,
1659
+ 111,
1660
+ 116,
1661
+ 111,
1662
+ 99,
1663
+ 111,
1664
+ 108,
1665
+ 45,
1666
+ 101,
1667
+ 115,
1668
+ 99,
1669
+ 114,
1670
+ 111,
1671
+ 119
1672
+ ];
1673
+ },
1674
+ {
1675
+ kind: "account";
1676
+ path: "taker";
1677
+ },
1678
+ {
1679
+ kind: "account";
1680
+ path: "settlementAsset";
1681
+ }
1682
+ ];
1683
+ };
1684
+ },
1685
+ {
1686
+ name: "optionSettlementEscrow";
1687
+ writable: true;
1688
+ pda: {
1689
+ seeds: [
1690
+ {
1691
+ kind: "const";
1692
+ value: [
1693
+ 111,
1694
+ 112,
1695
+ 116,
1696
+ 105,
1697
+ 111,
1698
+ 110,
1699
+ 45,
1700
+ 115,
1701
+ 101,
1702
+ 116,
1703
+ 116,
1704
+ 108,
1705
+ 101,
1706
+ 109,
1707
+ 101,
1708
+ 110,
1709
+ 116,
1710
+ 45,
1711
+ 101,
1712
+ 115,
1713
+ 99,
1714
+ 114,
1715
+ 111,
1716
+ 119
1717
+ ];
1718
+ },
1719
+ {
1720
+ kind: "account";
1721
+ path: "option.collateral_offer";
1722
+ account: "marketOptionAccount";
1723
+ },
1724
+ {
1725
+ kind: "account";
1726
+ path: "option.settlement_offer";
1727
+ account: "marketOptionAccount";
1728
+ }
1729
+ ];
1730
+ };
1731
+ },
1732
+ {
1733
+ name: "settlementTokenProgram";
1734
+ docs: [
1735
+ "Program owning the settlement asset (`taker_settlement_deposit`,",
1736
+ "`option_settlement_escrow`). May be legacy Token or Token-2022."
1737
+ ];
1738
+ },
1739
+ {
1740
+ name: "collateralTokenProgram";
1741
+ docs: [
1742
+ "Program owning the collateral asset (`collateral_receiver_token_account`,",
1743
+ "`option_collateral_escrow`). May be legacy Token or Token-2022."
1744
+ ];
1745
+ },
1746
+ {
1747
+ name: "claimTokenProgram";
1748
+ docs: [
1749
+ "Program owning the protocol's exercise / collateral-return claim mints.",
1750
+ "These use the permanent-delegate extension, so this must be Token-2022."
1751
+ ];
1752
+ address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
1753
+ },
1754
+ {
1755
+ name: "settlementConfig";
1756
+ docs: [
1757
+ "Settlement layer config PDA committed to by the option. Its address must",
1758
+ "match `option.details.settlement_layer`; its owner identifies the layer",
1759
+ "program (checked inside `invoke_can_exercise`)."
1760
+ ];
1761
+ },
1762
+ {
1763
+ name: "settlementProgram";
1764
+ docs: [
1765
+ "Settlement layer program. Ownership of `settlement_config` is checked",
1766
+ "inside `invoke_can_exercise`; executability is enforced by the runtime."
1767
+ ];
1768
+ },
1769
+ {
1770
+ name: "usedOperation";
1771
+ docs: ["for the operation path."];
1772
+ writable: true;
1773
+ optional: true;
1774
+ },
1775
+ {
1776
+ name: "instructionsSysvar";
1777
+ docs: ["read when verifying an operation signature."];
1778
+ optional: true;
1779
+ address: "Sysvar1nstructions1111111111111111111111111";
1780
+ },
1781
+ {
1782
+ name: "signingKeyDelegation";
1783
+ docs: [
1784
+ "Record proving the taker authorized `operation.signing_key`; the",
1785
+ "(owner, signing_key) binding is checked in `authorize_operation`."
1786
+ ];
1787
+ optional: true;
1788
+ },
1789
+ {
1790
+ name: "systemProgram";
1791
+ address: "11111111111111111111111111111111";
1792
+ }
1793
+ ];
1794
+ args: [
1795
+ {
1796
+ name: "amount";
1797
+ type: "u64";
1798
+ },
1799
+ {
1800
+ name: "metadata";
1801
+ type: "bytes";
1802
+ },
1803
+ {
1804
+ name: "operation";
1805
+ type: {
1806
+ option: {
1807
+ defined: {
1808
+ name: "operationParams";
1809
+ };
1810
+ };
1811
+ };
1812
+ }
1813
+ ];
1814
+ },
1815
+ {
1816
+ name: "initialize";
1817
+ discriminator: [175, 175, 109, 31, 13, 152, 155, 237];
1818
+ accounts: [
1819
+ {
1820
+ name: "signer";
1821
+ writable: true;
1822
+ signer: true;
1823
+ },
1824
+ {
1825
+ name: "protocolState";
1826
+ writable: true;
1827
+ pda: {
1828
+ seeds: [
1829
+ {
1830
+ kind: "const";
1831
+ value: [
1832
+ 112,
1833
+ 114,
1834
+ 111,
1835
+ 116,
1836
+ 111,
1837
+ 99,
1838
+ 111,
1839
+ 108,
1840
+ 45,
1841
+ 115,
1842
+ 116,
1843
+ 97,
1844
+ 116,
1845
+ 101
1846
+ ];
1847
+ }
1848
+ ];
1849
+ };
1850
+ },
1851
+ {
1852
+ name: "systemProgram";
1853
+ address: "11111111111111111111111111111111";
1854
+ }
1855
+ ];
1856
+ args: [
1857
+ {
1858
+ name: "domain";
1859
+ type: "u32";
1860
+ }
1861
+ ];
1862
+ },
1863
+ {
1864
+ name: "makeOffer";
1865
+ discriminator: [214, 98, 97, 35, 59, 12, 44, 178];
1866
+ accounts: [
1867
+ {
1868
+ name: "signer";
1869
+ docs: [
1870
+ "The executor. For direct calls this must equal `offer.creator`.",
1871
+ "For operation calls this is the operator submitting on the creators's behalf."
1872
+ ];
1873
+ writable: true;
1874
+ signer: true;
1875
+ },
1876
+ {
1877
+ name: "depositAsset";
1878
+ docs: [
1879
+ "This is either the collateral or the premium asset that will be deposited in order to create the offer.",
1880
+ "For offers created in a OptionSide::Maker, this is equal to the collateral asset.",
1881
+ "For OptionSide::Taker, this is equal to the premium asset.",
1882
+ "",
1883
+ "Bound to the side's asset here — before `creator_deposit`, whose PDA seed",
1884
+ "folds in this mint — so a wrong deposit asset surfaces as `AssetMismatch`",
1885
+ "rather than the seed constraint on `creator_deposit`."
1886
+ ];
1887
+ },
1888
+ {
1889
+ name: "protocolState";
1890
+ pda: {
1891
+ seeds: [
1892
+ {
1893
+ kind: "const";
1894
+ value: [
1895
+ 112,
1896
+ 114,
1897
+ 111,
1898
+ 116,
1899
+ 111,
1900
+ 99,
1901
+ 111,
1902
+ 108,
1903
+ 45,
1904
+ 115,
1905
+ 116,
1906
+ 97,
1907
+ 116,
1908
+ 101
1909
+ ];
1910
+ }
1911
+ ];
1912
+ };
1913
+ },
1914
+ {
1915
+ name: "creatorDeposit";
1916
+ writable: true;
1917
+ pda: {
1918
+ seeds: [
1919
+ {
1920
+ kind: "const";
1921
+ value: [
1922
+ 112,
1923
+ 114,
1924
+ 111,
1925
+ 116,
1926
+ 111,
1927
+ 99,
1928
+ 111,
1929
+ 108,
1930
+ 45,
1931
+ 101,
1932
+ 115,
1933
+ 99,
1934
+ 114,
1935
+ 111,
1936
+ 119
1937
+ ];
1938
+ },
1939
+ {
1940
+ kind: "arg";
1941
+ path: "input.creator";
1942
+ },
1943
+ {
1944
+ kind: "account";
1945
+ path: "depositAsset";
1946
+ }
1947
+ ];
1948
+ };
1949
+ },
1950
+ {
1951
+ name: "offer";
1952
+ writable: true;
1953
+ pda: {
1954
+ seeds: [
1955
+ {
1956
+ kind: "const";
1957
+ value: [111, 102, 102, 101, 114];
1958
+ },
1959
+ {
1960
+ kind: "arg";
1961
+ path: "input";
1962
+ }
1963
+ ];
1964
+ };
1965
+ },
1966
+ {
1967
+ name: "escrow";
1968
+ writable: true;
1969
+ pda: {
1970
+ seeds: [
1971
+ {
1972
+ kind: "const";
1973
+ value: [
1974
+ 111,
1975
+ 102,
1976
+ 102,
1977
+ 101,
1978
+ 114,
1979
+ 45,
1980
+ 101,
1981
+ 115,
1982
+ 99,
1983
+ 114,
1984
+ 111,
1985
+ 119
1986
+ ];
1987
+ },
1988
+ {
1989
+ kind: "arg";
1990
+ path: "input";
1991
+ }
1992
+ ];
1993
+ };
1994
+ },
1995
+ {
1996
+ name: "tokenProgram";
1997
+ },
1998
+ {
1999
+ name: "systemProgram";
2000
+ address: "11111111111111111111111111111111";
2001
+ },
2002
+ {
2003
+ name: "instructionsSysvar";
2004
+ docs: [
2005
+ "read when verifying a delegated maker signature via `operation`."
2006
+ ];
2007
+ optional: true;
2008
+ address: "Sysvar1nstructions1111111111111111111111111";
2009
+ },
2010
+ {
2011
+ name: "usedOperation";
2012
+ writable: true;
2013
+ optional: true;
2014
+ },
2015
+ {
2016
+ name: "signingKeyDelegation";
2017
+ docs: [
2018
+ "Record proving the maker authorized `operation.signing_key`; the",
2019
+ "(owner, signing_key) binding is checked in `authorize_operation`."
2020
+ ];
2021
+ optional: true;
2022
+ }
2023
+ ];
2024
+ args: [
2025
+ {
2026
+ name: "offer";
2027
+ type: {
2028
+ defined: {
2029
+ name: "offer";
2030
+ };
2031
+ };
2032
+ },
2033
+ {
2034
+ name: "operation";
2035
+ type: {
2036
+ option: {
2037
+ defined: {
2038
+ name: "operationParams";
2039
+ };
2040
+ };
2041
+ };
2042
+ }
2043
+ ];
2044
+ },
2045
+ {
2046
+ name: "redeemOption";
2047
+ discriminator: [126, 75, 240, 90, 90, 157, 26, 201];
2048
+ accounts: [
2049
+ {
2050
+ name: "signer";
2051
+ docs: [
2052
+ "The executor. For direct calls this must equal `maker` (same pubkey).",
2053
+ "For operation calls this is the operator submitting on the maker's behalf."
2054
+ ];
2055
+ writable: true;
2056
+ signer: true;
2057
+ },
2058
+ {
2059
+ name: "maker";
2060
+ docs: [
2061
+ "payouts (constrained to their ATAs below).",
2062
+ "For direct calls: must be a transaction signer (maker.is_signer enforced in handler).",
2063
+ "For operation calls: verified via the ed25519 operation signature."
2064
+ ];
2065
+ },
2066
+ {
2067
+ name: "protocolState";
2068
+ pda: {
2069
+ seeds: [
2070
+ {
2071
+ kind: "const";
2072
+ value: [
2073
+ 112,
2074
+ 114,
2075
+ 111,
2076
+ 116,
2077
+ 111,
2078
+ 99,
2079
+ 111,
2080
+ 108,
2081
+ 45,
2082
+ 115,
2083
+ 116,
2084
+ 97,
2085
+ 116,
2086
+ 101
2087
+ ];
2088
+ }
2089
+ ];
2090
+ };
2091
+ },
2092
+ {
2093
+ name: "option";
2094
+ writable: true;
2095
+ pda: {
2096
+ seeds: [
2097
+ {
2098
+ kind: "const";
2099
+ value: [111, 112, 116, 105, 111, 110];
2100
+ },
2101
+ {
2102
+ kind: "account";
2103
+ path: "option.collateral_offer";
2104
+ account: "marketOptionAccount";
2105
+ },
2106
+ {
2107
+ kind: "account";
2108
+ path: "option.settlement_offer";
2109
+ account: "marketOptionAccount";
2110
+ }
2111
+ ];
2112
+ };
2113
+ },
2114
+ {
2115
+ name: "mintCollateralReturnClaim";
2116
+ writable: true;
2117
+ pda: {
2118
+ seeds: [
2119
+ {
2120
+ kind: "const";
2121
+ value: [
2122
+ 109,
2123
+ 105,
2124
+ 110,
2125
+ 116,
2126
+ 45,
2127
+ 99,
2128
+ 111,
2129
+ 108,
2130
+ 108,
2131
+ 97,
2132
+ 116,
2133
+ 101,
2134
+ 114,
2135
+ 97,
2136
+ 108,
2137
+ 45,
2138
+ 114,
2139
+ 101,
2140
+ 116,
2141
+ 117,
2142
+ 114,
2143
+ 110
2144
+ ];
2145
+ },
2146
+ {
2147
+ kind: "account";
2148
+ path: "option.collateral_offer";
2149
+ account: "marketOptionAccount";
2150
+ },
2151
+ {
2152
+ kind: "account";
2153
+ path: "option.settlement_offer";
2154
+ account: "marketOptionAccount";
2155
+ }
2156
+ ];
2157
+ };
2158
+ },
2159
+ {
2160
+ name: "mintExerciseClaim";
2161
+ pda: {
2162
+ seeds: [
2163
+ {
2164
+ kind: "const";
2165
+ value: [
2166
+ 109,
2167
+ 105,
2168
+ 110,
2169
+ 116,
2170
+ 45,
2171
+ 101,
2172
+ 120,
2173
+ 101,
2174
+ 114,
2175
+ 99,
2176
+ 105,
2177
+ 115,
2178
+ 101
2179
+ ];
2180
+ },
2181
+ {
2182
+ kind: "account";
2183
+ path: "option.collateral_offer";
2184
+ account: "marketOptionAccount";
2185
+ },
2186
+ {
2187
+ kind: "account";
2188
+ path: "option.settlement_offer";
2189
+ account: "marketOptionAccount";
2190
+ }
2191
+ ];
2192
+ };
2193
+ },
2194
+ {
2195
+ name: "collateralReturnClaimTokenAccount";
2196
+ writable: true;
2197
+ },
2198
+ {
2199
+ name: "collateralAsset";
2200
+ },
2201
+ {
2202
+ name: "collateralReceiverTokenAccount";
2203
+ writable: true;
2204
+ pda: {
2205
+ seeds: [
2206
+ {
2207
+ kind: "account";
2208
+ path: "maker";
2209
+ },
2210
+ {
2211
+ kind: "account";
2212
+ path: "collateralTokenProgram";
2213
+ },
2214
+ {
2215
+ kind: "account";
2216
+ path: "collateralAsset";
2217
+ }
2218
+ ];
2219
+ program: {
2220
+ kind: "const";
2221
+ value: [
2222
+ 140,
2223
+ 151,
2224
+ 37,
2225
+ 143,
2226
+ 78,
2227
+ 36,
2228
+ 137,
2229
+ 241,
2230
+ 187,
2231
+ 61,
2232
+ 16,
2233
+ 41,
2234
+ 20,
2235
+ 142,
2236
+ 13,
2237
+ 131,
2238
+ 11,
2239
+ 90,
2240
+ 19,
2241
+ 153,
2242
+ 218,
2243
+ 255,
2244
+ 16,
2245
+ 132,
2246
+ 4,
2247
+ 142,
2248
+ 123,
2249
+ 216,
2250
+ 219,
2251
+ 233,
2252
+ 248,
2253
+ 89
2254
+ ];
2255
+ };
2256
+ };
2257
+ },
2258
+ {
2259
+ name: "optionCollateralEscrow";
2260
+ writable: true;
2261
+ pda: {
2262
+ seeds: [
2263
+ {
2264
+ kind: "const";
2265
+ value: [
2266
+ 111,
2267
+ 112,
2268
+ 116,
2269
+ 105,
2270
+ 111,
2271
+ 110,
2272
+ 45,
2273
+ 99,
2274
+ 111,
2275
+ 108,
2276
+ 108,
2277
+ 97,
2278
+ 116,
2279
+ 101,
2280
+ 114,
2281
+ 97,
2282
+ 108,
2283
+ 45,
2284
+ 101,
2285
+ 115,
2286
+ 99,
2287
+ 114,
2288
+ 111,
2289
+ 119
2290
+ ];
2291
+ },
2292
+ {
2293
+ kind: "account";
2294
+ path: "option.collateral_offer";
2295
+ account: "marketOptionAccount";
2296
+ },
2297
+ {
2298
+ kind: "account";
2299
+ path: "option.settlement_offer";
2300
+ account: "marketOptionAccount";
2301
+ }
2302
+ ];
2303
+ };
2304
+ },
2305
+ {
2306
+ name: "settlementAsset";
2307
+ },
2308
+ {
2309
+ name: "optionSettlementEscrow";
2310
+ writable: true;
2311
+ optional: true;
2312
+ pda: {
2313
+ seeds: [
2314
+ {
2315
+ kind: "const";
2316
+ value: [
2317
+ 111,
2318
+ 112,
2319
+ 116,
2320
+ 105,
2321
+ 111,
2322
+ 110,
2323
+ 45,
2324
+ 115,
2325
+ 101,
2326
+ 116,
2327
+ 116,
2328
+ 108,
2329
+ 101,
2330
+ 109,
2331
+ 101,
2332
+ 110,
2333
+ 116,
2334
+ 45,
2335
+ 101,
2336
+ 115,
2337
+ 99,
2338
+ 114,
2339
+ 111,
2340
+ 119
2341
+ ];
2342
+ },
2343
+ {
2344
+ kind: "account";
2345
+ path: "option.collateral_offer";
2346
+ account: "marketOptionAccount";
2347
+ },
2348
+ {
2349
+ kind: "account";
2350
+ path: "option.settlement_offer";
2351
+ account: "marketOptionAccount";
2352
+ }
2353
+ ];
2354
+ };
2355
+ },
2356
+ {
2357
+ name: "settlementReceiverTokenAccount";
2358
+ writable: true;
2359
+ optional: true;
2360
+ pda: {
2361
+ seeds: [
2362
+ {
2363
+ kind: "account";
2364
+ path: "maker";
2365
+ },
2366
+ {
2367
+ kind: "account";
2368
+ path: "settlementTokenProgram";
2369
+ },
2370
+ {
2371
+ kind: "account";
2372
+ path: "settlementAsset";
2373
+ }
2374
+ ];
2375
+ program: {
2376
+ kind: "const";
2377
+ value: [
2378
+ 140,
2379
+ 151,
2380
+ 37,
2381
+ 143,
2382
+ 78,
2383
+ 36,
2384
+ 137,
2385
+ 241,
2386
+ 187,
2387
+ 61,
2388
+ 16,
2389
+ 41,
2390
+ 20,
2391
+ 142,
2392
+ 13,
2393
+ 131,
2394
+ 11,
2395
+ 90,
2396
+ 19,
2397
+ 153,
2398
+ 218,
2399
+ 255,
2400
+ 16,
2401
+ 132,
2402
+ 4,
2403
+ 142,
2404
+ 123,
2405
+ 216,
2406
+ 219,
2407
+ 233,
2408
+ 248,
2409
+ 89
2410
+ ];
2411
+ };
2412
+ };
2413
+ },
2414
+ {
2415
+ name: "settlementTokenProgram";
2416
+ docs: [
2417
+ "Program owning the settlement asset (`settlement_receiver_token_account`,",
2418
+ "`option_settlement_escrow`). May be legacy Token or Token-2022."
2419
+ ];
2420
+ },
2421
+ {
2422
+ name: "collateralTokenProgram";
2423
+ docs: [
2424
+ "Program owning the collateral asset (`collateral_receiver_token_account`,",
2425
+ "`option_collateral_escrow`). May be legacy Token or Token-2022."
2426
+ ];
2427
+ },
2428
+ {
2429
+ name: "claimTokenProgram";
2430
+ docs: [
2431
+ "Program owning the protocol's exercise / collateral-return claim mints.",
2432
+ "These use the permanent-delegate extension, so this must be Token-2022."
2433
+ ];
2434
+ address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
2435
+ },
2436
+ {
2437
+ name: "settlementConfig";
2438
+ docs: [
2439
+ "Settlement layer config PDA committed to by the option. Its address must",
2440
+ "match `option.details.settlement_layer`; its owner identifies the layer",
2441
+ "program (checked inside `invoke_can_redeem`)."
2442
+ ];
2443
+ },
2444
+ {
2445
+ name: "settlementProgram";
2446
+ docs: [
2447
+ "Settlement layer program. Ownership of `settlement_config` is checked",
2448
+ "inside `invoke_can_redeem`; executability is enforced by the runtime."
2449
+ ];
2450
+ },
2451
+ {
2452
+ name: "usedOperation";
2453
+ docs: ["for the operation path."];
2454
+ writable: true;
2455
+ optional: true;
2456
+ },
2457
+ {
2458
+ name: "instructionsSysvar";
2459
+ docs: ["read when verifying an operation signature."];
2460
+ optional: true;
2461
+ address: "Sysvar1nstructions1111111111111111111111111";
2462
+ },
2463
+ {
2464
+ name: "signingKeyDelegation";
2465
+ docs: [
2466
+ "Record proving the maker authorized `operation.signing_key`; the",
2467
+ "(owner, signing_key) binding is checked in `authorize_operation`."
2468
+ ];
2469
+ optional: true;
2470
+ },
2471
+ {
2472
+ name: "systemProgram";
2473
+ address: "11111111111111111111111111111111";
2474
+ }
2475
+ ];
2476
+ args: [
2477
+ {
2478
+ name: "amount";
2479
+ type: "u64";
2480
+ },
2481
+ {
2482
+ name: "metadata";
2483
+ type: "bytes";
2484
+ },
2485
+ {
2486
+ name: "operation";
2487
+ type: {
2488
+ option: {
2489
+ defined: {
2490
+ name: "operationParams";
2491
+ };
2492
+ };
2493
+ };
2494
+ }
2495
+ ];
2496
+ },
2497
+ {
2498
+ name: "removeSigningKey";
2499
+ discriminator: [172, 35, 218, 37, 72, 53, 72, 102];
2500
+ accounts: [
2501
+ {
2502
+ name: "owner";
2503
+ writable: true;
2504
+ signer: true;
2505
+ },
2506
+ {
2507
+ name: "signingKeyDelegation";
2508
+ writable: true;
2509
+ pda: {
2510
+ seeds: [
2511
+ {
2512
+ kind: "const";
2513
+ value: [115, 105, 103, 110, 105, 110, 103, 45, 107, 101, 121];
2514
+ },
2515
+ {
2516
+ kind: "account";
2517
+ path: "owner";
2518
+ },
2519
+ {
2520
+ kind: "arg";
2521
+ path: "key";
2522
+ }
2523
+ ];
2524
+ };
2525
+ },
2526
+ {
2527
+ name: "systemProgram";
2528
+ address: "11111111111111111111111111111111";
2529
+ }
2530
+ ];
2531
+ args: [
2532
+ {
2533
+ name: "key";
2534
+ type: "pubkey";
2535
+ }
2536
+ ];
2537
+ },
2538
+ {
2539
+ name: "repayCollateral";
2540
+ discriminator: [16, 155, 206, 217, 229, 41, 207, 137];
2541
+ accounts: [
2542
+ {
2543
+ name: "signer";
2544
+ writable: true;
2545
+ signer: true;
2546
+ },
2547
+ {
2548
+ name: "option";
2549
+ writable: true;
2550
+ pda: {
2551
+ seeds: [
2552
+ {
2553
+ kind: "const";
2554
+ value: [111, 112, 116, 105, 111, 110];
2555
+ },
2556
+ {
2557
+ kind: "account";
2558
+ path: "option.collateral_offer";
2559
+ account: "marketOptionAccount";
2560
+ },
2561
+ {
2562
+ kind: "account";
2563
+ path: "option.settlement_offer";
2564
+ account: "marketOptionAccount";
2565
+ }
2566
+ ];
2567
+ };
2568
+ },
2569
+ {
2570
+ name: "collateralAsset";
2571
+ },
2572
+ {
2573
+ name: "signerCollateralTokenAccount";
2574
+ writable: true;
2575
+ },
2576
+ {
2577
+ name: "optionCollateralEscrow";
2578
+ writable: true;
2579
+ pda: {
2580
+ seeds: [
2581
+ {
2582
+ kind: "const";
2583
+ value: [
2584
+ 111,
2585
+ 112,
2586
+ 116,
2587
+ 105,
2588
+ 111,
2589
+ 110,
2590
+ 45,
2591
+ 99,
2592
+ 111,
2593
+ 108,
2594
+ 108,
2595
+ 97,
2596
+ 116,
2597
+ 101,
2598
+ 114,
2599
+ 97,
2600
+ 108,
2601
+ 45,
2602
+ 101,
2603
+ 115,
2604
+ 99,
2605
+ 114,
2606
+ 111,
2607
+ 119
2608
+ ];
2609
+ },
2610
+ {
2611
+ kind: "account";
2612
+ path: "option.collateral_offer";
2613
+ account: "marketOptionAccount";
2614
+ },
2615
+ {
2616
+ kind: "account";
2617
+ path: "option.settlement_offer";
2618
+ account: "marketOptionAccount";
2619
+ }
2620
+ ];
2621
+ };
2622
+ },
2623
+ {
2624
+ name: "collateralTokenProgram";
2625
+ docs: [
2626
+ "Program owning the collateral asset. May be legacy Token or Token-2022."
2627
+ ];
2628
+ }
2629
+ ];
2630
+ args: [
2631
+ {
2632
+ name: "amount";
2633
+ type: "u64";
2634
+ }
2635
+ ];
2636
+ },
2637
+ {
2638
+ name: "setConfig";
2639
+ discriminator: [108, 158, 154, 175, 212, 98, 52, 66];
2640
+ accounts: [
2641
+ {
2642
+ name: "signer";
2643
+ writable: true;
2644
+ signer: true;
2645
+ },
2646
+ {
2647
+ name: "protocolState";
2648
+ writable: true;
2649
+ pda: {
2650
+ seeds: [
2651
+ {
2652
+ kind: "const";
2653
+ value: [
2654
+ 112,
2655
+ 114,
2656
+ 111,
2657
+ 116,
2658
+ 111,
2659
+ 99,
2660
+ 111,
2661
+ 108,
2662
+ 45,
2663
+ 115,
2664
+ 116,
2665
+ 97,
2666
+ 116,
2667
+ 101
2668
+ ];
2669
+ }
2670
+ ];
2671
+ };
2672
+ },
2673
+ {
2674
+ name: "systemProgram";
2675
+ address: "11111111111111111111111111111111";
2676
+ }
2677
+ ];
2678
+ args: [
2679
+ {
2680
+ name: "config";
2681
+ type: {
2682
+ defined: {
2683
+ name: "protocolConfig";
2684
+ };
2685
+ };
2686
+ }
2687
+ ];
2688
+ },
2689
+ {
2690
+ name: "setPaused";
2691
+ docs: [
2692
+ "Emergency pause tripped by the `pause_authority` hot wallet. Pause-only;",
2693
+ "governance resumes via `set_config`."
2694
+ ];
2695
+ discriminator: [91, 60, 125, 192, 176, 225, 166, 218];
2696
+ accounts: [
2697
+ {
2698
+ name: "signer";
2699
+ signer: true;
2700
+ },
2701
+ {
2702
+ name: "protocolState";
2703
+ writable: true;
2704
+ pda: {
2705
+ seeds: [
2706
+ {
2707
+ kind: "const";
2708
+ value: [
2709
+ 112,
2710
+ 114,
2711
+ 111,
2712
+ 116,
2713
+ 111,
2714
+ 99,
2715
+ 111,
2716
+ 108,
2717
+ 45,
2718
+ 115,
2719
+ 116,
2720
+ 97,
2721
+ 116,
2722
+ 101
2723
+ ];
2724
+ }
2725
+ ];
2726
+ };
2727
+ }
2728
+ ];
2729
+ args: [];
2730
+ },
2731
+ {
2732
+ name: "setSigningKey";
2733
+ discriminator: [131, 231, 152, 76, 182, 145, 86, 167];
2734
+ accounts: [
2735
+ {
2736
+ name: "owner";
2737
+ writable: true;
2738
+ signer: true;
2739
+ },
2740
+ {
2741
+ name: "signingKeyDelegation";
2742
+ writable: true;
2743
+ pda: {
2744
+ seeds: [
2745
+ {
2746
+ kind: "const";
2747
+ value: [115, 105, 103, 110, 105, 110, 103, 45, 107, 101, 121];
2748
+ },
2749
+ {
2750
+ kind: "account";
2751
+ path: "owner";
2752
+ },
2753
+ {
2754
+ kind: "arg";
2755
+ path: "key";
2756
+ }
2757
+ ];
2758
+ };
2759
+ },
2760
+ {
2761
+ name: "systemProgram";
2762
+ address: "11111111111111111111111111111111";
2763
+ }
2764
+ ];
2765
+ args: [
2766
+ {
2767
+ name: "key";
2768
+ type: "pubkey";
2769
+ },
2770
+ {
2771
+ name: "permissions";
2772
+ type: "u16";
2773
+ }
2774
+ ];
2775
+ },
2776
+ {
2777
+ name: "withdraw";
2778
+ discriminator: [183, 18, 70, 156, 148, 109, 161, 34];
2779
+ accounts: [
2780
+ {
2781
+ name: "signer";
2782
+ writable: true;
2783
+ signer: true;
2784
+ },
2785
+ {
2786
+ name: "withdrawer";
2787
+ docs: [
2788
+ "In most cases this will be the signer itself, but perhaps the signer wants to perform",
2789
+ "an authorized action for someone else."
2790
+ ];
2791
+ },
2792
+ {
2793
+ name: "mint";
2794
+ },
2795
+ {
2796
+ name: "protocolState";
2797
+ pda: {
2798
+ seeds: [
2799
+ {
2800
+ kind: "const";
2801
+ value: [
2802
+ 112,
2803
+ 114,
2804
+ 111,
2805
+ 116,
2806
+ 111,
2807
+ 99,
2808
+ 111,
2809
+ 108,
2810
+ 45,
2811
+ 115,
2812
+ 116,
2813
+ 97,
2814
+ 116,
2815
+ 101
2816
+ ];
2817
+ }
2818
+ ];
2819
+ };
2820
+ },
2821
+ {
2822
+ name: "tokenProgram";
2823
+ },
2824
+ {
2825
+ name: "withdrawTokenAccount";
2826
+ docs: [
2827
+ "Note: We don't check the authority, because this is the person that owns the token account.",
2828
+ "In most cases this will be the signer as well, but perhaps the signer wants to withdraw into someone elses token account."
2829
+ ];
2830
+ writable: true;
2831
+ },
2832
+ {
2833
+ name: "userTokenAccount";
2834
+ writable: true;
2835
+ pda: {
2836
+ seeds: [
2837
+ {
2838
+ kind: "const";
2839
+ value: [
2840
+ 112,
2841
+ 114,
2842
+ 111,
2843
+ 116,
2844
+ 111,
2845
+ 99,
2846
+ 111,
2847
+ 108,
2848
+ 45,
2849
+ 101,
2850
+ 115,
2851
+ 99,
2852
+ 114,
2853
+ 111,
2854
+ 119
2855
+ ];
2856
+ },
2857
+ {
2858
+ kind: "account";
2859
+ path: "withdrawer";
2860
+ },
2861
+ {
2862
+ kind: "account";
2863
+ path: "mint";
2864
+ }
2865
+ ];
2866
+ };
2867
+ },
2868
+ {
2869
+ name: "systemProgram";
2870
+ address: "11111111111111111111111111111111";
2871
+ }
2872
+ ];
2873
+ args: [
2874
+ {
2875
+ name: "amount";
2876
+ type: "u64";
2877
+ }
2878
+ ];
2879
+ }
2880
+ ];
2881
+ accounts: [
2882
+ {
2883
+ name: "marketOptionAccount";
2884
+ discriminator: [119, 139, 98, 86, 201, 27, 32, 29];
2885
+ },
2886
+ {
2887
+ name: "offerAccount";
2888
+ discriminator: [152, 98, 9, 183, 115, 190, 31, 201];
2889
+ },
2890
+ {
2891
+ name: "protocolState";
2892
+ discriminator: [33, 51, 173, 134, 35, 140, 195, 248];
2893
+ },
2894
+ {
2895
+ name: "signingKeyDelegation";
2896
+ discriminator: [31, 227, 117, 158, 94, 41, 126, 174];
2897
+ },
2898
+ {
2899
+ name: "usedOperation";
2900
+ discriminator: [192, 128, 47, 4, 60, 41, 154, 63];
2901
+ }
2902
+ ];
2903
+ events: [
2904
+ {
2905
+ name: "authorizedKeyRemoved";
2906
+ discriminator: [137, 121, 156, 85, 215, 5, 150, 144];
2907
+ },
2908
+ {
2909
+ name: "authorizedKeySet";
2910
+ discriminator: [31, 246, 68, 222, 235, 126, 218, 38];
2911
+ },
2912
+ {
2913
+ name: "deposited";
2914
+ discriminator: [111, 141, 26, 45, 161, 35, 100, 57];
2915
+ },
2916
+ {
2917
+ name: "exerciseClaimsBurned";
2918
+ discriminator: [17, 129, 23, 207, 24, 121, 135, 59];
2919
+ },
2920
+ {
2921
+ name: "feePaid";
2922
+ discriminator: [159, 12, 52, 212, 249, 36, 24, 18];
2923
+ },
2924
+ {
2925
+ name: "marketOptionCreated";
2926
+ discriminator: [85, 107, 191, 13, 129, 207, 48, 52];
2927
+ },
2928
+ {
2929
+ name: "offerClosed";
2930
+ discriminator: [237, 38, 102, 204, 165, 180, 177, 164];
2931
+ },
2932
+ {
2933
+ name: "offerCreated";
2934
+ discriminator: [31, 236, 215, 144, 75, 45, 157, 87];
2935
+ },
2936
+ {
2937
+ name: "operationClosed";
2938
+ discriminator: [57, 9, 212, 71, 193, 186, 8, 193];
2939
+ },
2940
+ {
2941
+ name: "operationConsumed";
2942
+ discriminator: [100, 222, 158, 34, 16, 21, 251, 231];
2943
+ },
2944
+ {
2945
+ name: "optionAccountsClosed";
2946
+ discriminator: [121, 144, 104, 91, 84, 11, 9, 186];
2947
+ },
2948
+ {
2949
+ name: "optionBorrowed";
2950
+ discriminator: [172, 74, 229, 43, 98, 15, 255, 21];
2951
+ },
2952
+ {
2953
+ name: "optionExercised";
2954
+ discriminator: [34, 100, 89, 14, 247, 159, 22, 97];
2955
+ },
2956
+ {
2957
+ name: "optionRedeemed";
2958
+ discriminator: [226, 88, 209, 42, 6, 96, 225, 41];
2959
+ },
2960
+ {
2961
+ name: "optionRepaid";
2962
+ discriminator: [252, 43, 133, 174, 54, 11, 167, 206];
2963
+ },
2964
+ {
2965
+ name: "protocolConfigUpdated";
2966
+ discriminator: [20, 99, 32, 237, 111, 86, 195, 199];
2967
+ },
2968
+ {
2969
+ name: "protocolInitialized";
2970
+ discriminator: [173, 122, 168, 254, 9, 118, 76, 132];
2971
+ },
2972
+ {
2973
+ name: "protocolPaused";
2974
+ discriminator: [35, 111, 245, 138, 237, 199, 79, 223];
2975
+ },
2976
+ {
2977
+ name: "withdrawn";
2978
+ discriminator: [20, 89, 223, 198, 194, 124, 219, 13];
2979
+ }
2980
+ ];
2981
+ errors: [
2982
+ {
2983
+ code: 6000;
2984
+ name: "customError";
2985
+ msg: "Custom error message";
2986
+ },
2987
+ {
2988
+ code: 6001;
2989
+ name: "assetMismatch";
2990
+ msg: "Provided mint does not match the offer's asset";
2991
+ },
2992
+ {
2993
+ code: 6002;
2994
+ name: "optionAlreadyExpired";
2995
+ msg: "Option expiry must be in the future";
2996
+ },
2997
+ {
2998
+ code: 6003;
2999
+ name: "invalidTimeRange";
3000
+ msg: "Option start_timestamp must be strictly less than end_timestamp";
3001
+ },
3002
+ {
3003
+ code: 6004;
3004
+ name: "unauthorized";
3005
+ msg: "Signer is not authorized to perform this action";
3006
+ },
3007
+ {
3008
+ code: 6005;
3009
+ name: "settlementAmountZero";
3010
+ msg: "Settlement amount must be greater than zero";
3011
+ },
3012
+ {
3013
+ code: 6006;
3014
+ name: "collateralAmountZero";
3015
+ msg: "Collateral amount must be greater than zero";
3016
+ },
3017
+ {
3018
+ code: 6007;
3019
+ name: "offerMismatch";
3020
+ msg: "Collateral- and SettlementOffer option_details mismatch";
3021
+ },
3022
+ {
3023
+ code: 6008;
3024
+ name: "settlementLayerMismatch";
3025
+ msg: "Settlement config does not match the option's bound settlement layer";
3026
+ },
3027
+ {
3028
+ code: 6009;
3029
+ name: "settlementProgramMismatch";
3030
+ msg: "Settlement config is not owned by the provided settlement program";
3031
+ },
3032
+ {
3033
+ code: 6010;
3034
+ name: "settlementReturnDataMissing";
3035
+ msg: "Settlement layer did not set return data";
3036
+ },
3037
+ {
3038
+ code: 6011;
3039
+ name: "settlementReturnDataMismatch";
3040
+ msg: "Settlement return data came from an unexpected program";
3041
+ },
3042
+ {
3043
+ code: 6012;
3044
+ name: "settlementReturnDataMalformed";
3045
+ msg: "Settlement return data could not be deserialized as ExerciseResolution";
3046
+ },
3047
+ {
3048
+ code: 6013;
3049
+ name: "hookConfigMismatch";
3050
+ msg: "Hook does not match the configured hook in ProtocolState";
3051
+ },
3052
+ {
3053
+ code: 6014;
3054
+ name: "hookProgramMismatch";
3055
+ msg: "Hook config is not owned by the provided hook program";
3056
+ },
3057
+ {
3058
+ code: 6015;
3059
+ name: "hookReturnDataMissing";
3060
+ msg: "Hook did not set return data";
3061
+ },
3062
+ {
3063
+ code: 6016;
3064
+ name: "hookReturnDataMismatch";
3065
+ msg: "Hook return data came from an unexpected program";
3066
+ },
3067
+ {
3068
+ code: 6017;
3069
+ name: "hookReturnDataMalformed";
3070
+ msg: "Hook return data could not be deserialized as FeeResolution";
3071
+ },
3072
+ {
3073
+ code: 6018;
3074
+ name: "missingHookAccounts";
3075
+ msg: "ProtocolState configures an option-creation hook but the hook accounts were not provided";
3076
+ },
3077
+ {
3078
+ code: 6019;
3079
+ name: "invalidExerciseWindow";
3080
+ msg: "Exercise is outside the option's valid exercise window";
3081
+ },
3082
+ {
3083
+ code: 6020;
3084
+ name: "exerciseExceedsCollateralAmount";
3085
+ msg: "Exercise amount exceeds the available collateral amount";
3086
+ },
3087
+ {
3088
+ code: 6021;
3089
+ name: "mathOverflow";
3090
+ msg: "Arithmetic operation overflowed";
3091
+ },
3092
+ {
3093
+ code: 6022;
3094
+ name: "resolutionAmountMismatch";
3095
+ msg: "Settlement resolution collateral_to_taker exceeds the exercised amount";
3096
+ },
3097
+ {
3098
+ code: 6023;
3099
+ name: "invalidRedeemWindow";
3100
+ },
3101
+ {
3102
+ code: 6024;
3103
+ name: "redeemExceedsCollateralAmount";
3104
+ },
3105
+ {
3106
+ code: 6025;
3107
+ name: "missingSettlementEscrow";
3108
+ msg: "Settlement is owed but the settlement escrow account was not provided";
3109
+ },
3110
+ {
3111
+ code: 6026;
3112
+ name: "redeemAmountZero";
3113
+ msg: "Redeem amount must be greater than zero";
3114
+ },
3115
+ {
3116
+ code: 6027;
3117
+ name: "redeemExceedsClaimSupply";
3118
+ msg: "Redeem amount exceeds the outstanding collateral-return claim supply";
3119
+ },
3120
+ {
3121
+ code: 6028;
3122
+ name: "noClaimsOutstanding";
3123
+ msg: "No collateral-return claims are outstanding";
3124
+ },
3125
+ {
3126
+ code: 6029;
3127
+ name: "domainInvalid";
3128
+ msg: "Offer domain doesn't match the local domain";
3129
+ },
3130
+ {
3131
+ code: 6030;
3132
+ name: "missingSettlementReceiver";
3133
+ msg: "Settlement is owed but the settlement receiver token account was not provided";
3134
+ },
3135
+ {
3136
+ code: 6031;
3137
+ name: "offerAlreadyExpired";
3138
+ msg: "Offer expiry must be in the future";
3139
+ },
3140
+ {
3141
+ code: 6032;
3142
+ name: "offerExpiryTooLong";
3143
+ msg: "Offer expiry must be less than end_timestamp";
3144
+ },
3145
+ {
3146
+ code: 6033;
3147
+ name: "invalidSignature";
3148
+ msg: "Offer signature is missing or does not verify against the maker/taker";
3149
+ },
3150
+ {
3151
+ code: 6034;
3152
+ name: "borrowOutsideWindow";
3153
+ msg: "Borrow is outside the option's valid borrow window";
3154
+ },
3155
+ {
3156
+ code: 6035;
3157
+ name: "borrowAmountZero";
3158
+ msg: "Borrow amount must be greater than zero";
3159
+ },
3160
+ {
3161
+ code: 6036;
3162
+ name: "borrowNotPossible";
3163
+ msg: "Option was created with borrow_allowed = false; borrow disallowed at the option level";
3164
+ },
3165
+ {
3166
+ code: 6037;
3167
+ name: "repayAmountZero";
3168
+ msg: "Repay amount must be greater than zero";
3169
+ },
3170
+ {
3171
+ code: 6038;
3172
+ name: "repayExceedsBorrowed";
3173
+ msg: "Repay amount exceeds the outstanding borrowed collateral";
3174
+ },
3175
+ {
3176
+ code: 6039;
3177
+ name: "redeemBlockedByOutstandingBorrow";
3178
+ msg: "Redeem is blocked while collateral is still borrowed";
3179
+ },
3180
+ {
3181
+ code: 6040;
3182
+ name: "exerciseBlockedByOutstandingBorrow";
3183
+ msg: "Exercise is blocked while collateral is still borrowed";
3184
+ },
3185
+ {
3186
+ code: 6041;
3187
+ name: "operationExpired";
3188
+ msg: "Operation has expired";
3189
+ },
3190
+ {
3191
+ code: 6042;
3192
+ name: "operationNotYetExpired";
3193
+ msg: "Operation expiry has not yet passed; cannot reclaim rent";
3194
+ },
3195
+ {
3196
+ code: 6043;
3197
+ name: "operationAlreadyUsed";
3198
+ msg: "Operation nonce has already been consumed";
3199
+ },
3200
+ {
3201
+ code: 6044;
3202
+ name: "operationParamsMismatch";
3203
+ msg: "Operation params and used_operation account must both be provided or both omitted";
3204
+ },
3205
+ {
3206
+ code: 6045;
3207
+ name: "signingKeyNotFound";
3208
+ msg: "Signing key is not authorized for this owner";
3209
+ },
3210
+ {
3211
+ code: 6046;
3212
+ name: "invalidBurnWindow";
3213
+ msg: "Exercise claims can only be burned when the option is expired";
3214
+ }
3215
+ ];
3216
+ types: [
3217
+ {
3218
+ name: "authorizedKeyRemoved";
3219
+ type: {
3220
+ kind: "struct";
3221
+ fields: [
3222
+ {
3223
+ name: "owner";
3224
+ type: "pubkey";
3225
+ },
3226
+ {
3227
+ name: "authorizedKey";
3228
+ type: "pubkey";
3229
+ }
3230
+ ];
3231
+ };
3232
+ },
3233
+ {
3234
+ name: "authorizedKeySet";
3235
+ type: {
3236
+ kind: "struct";
3237
+ fields: [
3238
+ {
3239
+ name: "owner";
3240
+ type: "pubkey";
3241
+ },
3242
+ {
3243
+ name: "authorizedKey";
3244
+ type: "pubkey";
3245
+ },
3246
+ {
3247
+ name: "permissions";
3248
+ type: "u16";
3249
+ }
3250
+ ];
3251
+ };
3252
+ },
3253
+ {
3254
+ name: "deposited";
3255
+ type: {
3256
+ kind: "struct";
3257
+ fields: [
3258
+ {
3259
+ name: "accountHolder";
3260
+ type: "pubkey";
3261
+ },
3262
+ {
3263
+ name: "funder";
3264
+ type: "pubkey";
3265
+ },
3266
+ {
3267
+ name: "mint";
3268
+ type: "pubkey";
3269
+ },
3270
+ {
3271
+ name: "amount";
3272
+ type: "u64";
3273
+ },
3274
+ {
3275
+ name: "fromTokenAccount";
3276
+ type: "pubkey";
3277
+ },
3278
+ {
3279
+ name: "escrowTokenAccount";
3280
+ type: "pubkey";
3281
+ }
3282
+ ];
3283
+ };
3284
+ },
3285
+ {
3286
+ name: "exerciseClaimsBurned";
3287
+ docs: [
3288
+ "Emitted when an option's leftover exercise claims are burned after its",
3289
+ "exercise window has closed (see `burn_exercise_claims`). Burning zeroes the",
3290
+ "claim balance so the mint and its accounts can later be closed in",
3291
+ "`close_option_accounts`."
3292
+ ];
3293
+ type: {
3294
+ kind: "struct";
3295
+ fields: [
3296
+ {
3297
+ name: "optionId";
3298
+ type: "pubkey";
3299
+ },
3300
+ {
3301
+ name: "optionAccount";
3302
+ type: "pubkey";
3303
+ },
3304
+ {
3305
+ name: "mintExerciseClaim";
3306
+ docs: ["The exercise-claim mint whose supply was reduced."];
3307
+ type: "pubkey";
3308
+ },
3309
+ {
3310
+ name: "exerciseClaimTokenAccount";
3311
+ docs: ["The token account the claims were burned from."];
3312
+ type: "pubkey";
3313
+ },
3314
+ {
3315
+ name: "amountBurned";
3316
+ docs: ["Claims burned this call."];
3317
+ type: "u64";
3318
+ }
3319
+ ];
3320
+ };
3321
+ },
3322
+ {
3323
+ name: "feePaid";
3324
+ type: {
3325
+ kind: "struct";
3326
+ fields: [
3327
+ {
3328
+ name: "hookProgram";
3329
+ docs: ["The fee program"];
3330
+ type: "pubkey";
3331
+ },
3332
+ {
3333
+ name: "hookConfig";
3334
+ docs: ["The option-creation hook config that levied the fee."];
3335
+ type: "pubkey";
3336
+ },
3337
+ {
3338
+ name: "optionId";
3339
+ docs: [
3340
+ "The matched option PDA address the fee was charged against."
3341
+ ];
3342
+ type: "pubkey";
3343
+ },
3344
+ {
3345
+ name: "optionAccount";
3346
+ type: "pubkey";
3347
+ },
3348
+ {
3349
+ name: "asset";
3350
+ docs: ["Premium asset mint the fee was paid in."];
3351
+ type: "pubkey";
3352
+ },
3353
+ {
3354
+ name: "amount";
3355
+ docs: [
3356
+ "Fee amount deducted from the premium and paid to the hook."
3357
+ ];
3358
+ type: "u64";
3359
+ },
3360
+ {
3361
+ name: "recipientTokenAccount";
3362
+ docs: ["The hook's premium ATA the fee was routed to."];
3363
+ type: "pubkey";
3364
+ }
3365
+ ];
3366
+ };
3367
+ },
3368
+ {
3369
+ name: "marketOption";
3370
+ docs: [
3371
+ "A live option, as passed to a settlement layer / hook. Mirrors",
3372
+ "`overcast_core::state::MarketOption` byte-for-byte."
3373
+ ];
3374
+ type: {
3375
+ kind: "struct";
3376
+ fields: [
3377
+ {
3378
+ name: "details";
3379
+ type: {
3380
+ defined: {
3381
+ name: "optionDetails";
3382
+ };
3383
+ };
3384
+ },
3385
+ {
3386
+ name: "taker";
3387
+ type: "pubkey";
3388
+ },
3389
+ {
3390
+ name: "maker";
3391
+ type: "pubkey";
3392
+ },
3393
+ {
3394
+ name: "settlementOffer";
3395
+ type: "pubkey";
3396
+ },
3397
+ {
3398
+ name: "collateralOffer";
3399
+ type: "pubkey";
3400
+ },
3401
+ {
3402
+ name: "borrowedCollateral";
3403
+ docs: [
3404
+ "Collateral currently out on loan via `borrow_collateral` and not yet",
3405
+ "returned via `repay_collateral`."
3406
+ ];
3407
+ type: "u64";
3408
+ }
3409
+ ];
3410
+ };
3411
+ },
3412
+ {
3413
+ name: "marketOptionAccount";
3414
+ type: {
3415
+ kind: "struct";
3416
+ fields: [
3417
+ {
3418
+ name: "inner";
3419
+ docs: ["The shared `overcast_base` value layout for this account."];
3420
+ type: {
3421
+ defined: {
3422
+ name: "marketOption";
3423
+ };
3424
+ };
3425
+ },
3426
+ {
3427
+ name: "accountCreator";
3428
+ docs: [
3429
+ "The account that funded this account's rent — and the rent of any",
3430
+ "token accounts (escrows, claim mints, claim ATAs) created in the",
3431
+ "same instruction. Set to the creating instruction's `signer`: the",
3432
+ "maker/taker on direct calls, or the operator on delegated",
3433
+ "(operation) calls. Rent is returned here when the account is closed."
3434
+ ];
3435
+ type: "pubkey";
3436
+ }
3437
+ ];
3438
+ };
3439
+ },
3440
+ {
3441
+ name: "marketOptionCreated";
3442
+ type: {
3443
+ kind: "struct";
3444
+ fields: [
3445
+ {
3446
+ name: "submitter";
3447
+ type: "pubkey";
3448
+ },
3449
+ {
3450
+ name: "optionId";
3451
+ docs: ["The matched option id."];
3452
+ type: "pubkey";
3453
+ },
3454
+ {
3455
+ name: "optionAccount";
3456
+ type: "pubkey";
3457
+ },
3458
+ {
3459
+ name: "collateralOfferId";
3460
+ type: "pubkey";
3461
+ },
3462
+ {
3463
+ name: "settlementOfferId";
3464
+ type: "pubkey";
3465
+ },
3466
+ {
3467
+ name: "maker";
3468
+ type: "pubkey";
3469
+ },
3470
+ {
3471
+ name: "taker";
3472
+ type: "pubkey";
3473
+ },
3474
+ {
3475
+ name: "collateralEscrowTokenAccount";
3476
+ type: "pubkey";
3477
+ },
3478
+ {
3479
+ name: "mintExerciseClaim";
3480
+ docs: [
3481
+ "Claim mints created for the option, useful for indexing later",
3482
+ "exercise / redeem activity."
3483
+ ];
3484
+ type: "pubkey";
3485
+ },
3486
+ {
3487
+ name: "mintCollateralReturnClaim";
3488
+ type: "pubkey";
3489
+ },
3490
+ {
3491
+ name: "details";
3492
+ type: {
3493
+ defined: {
3494
+ name: "optionDetails";
3495
+ };
3496
+ };
3497
+ }
3498
+ ];
3499
+ };
3500
+ },
3501
+ {
3502
+ name: "offer";
3503
+ docs: [
3504
+ "A maker's standing offer to write an option: locks collateral, keyed by its",
3505
+ "content-addressed id. Core owns the on-chain account representation (a thin",
3506
+ "`#[account]` wrapper); this is the shared value layout."
3507
+ ];
3508
+ type: {
3509
+ kind: "struct";
3510
+ fields: [
3511
+ {
3512
+ name: "salt";
3513
+ type: "pubkey";
3514
+ },
3515
+ {
3516
+ name: "creator";
3517
+ type: "pubkey";
3518
+ },
3519
+ {
3520
+ name: "optionDetails";
3521
+ type: {
3522
+ defined: {
3523
+ name: "optionDetails";
3524
+ };
3525
+ };
3526
+ },
3527
+ {
3528
+ name: "expiry";
3529
+ docs: ["Timestamp when this offer expires."];
3530
+ type: "i64";
3531
+ },
3532
+ {
3533
+ name: "side";
3534
+ docs: ["What side the offer is"];
3535
+ type: {
3536
+ defined: {
3537
+ name: "optionSide";
3538
+ };
3539
+ };
3540
+ }
3541
+ ];
3542
+ };
3543
+ },
3544
+ {
3545
+ name: "offerAccount";
3546
+ type: {
3547
+ kind: "struct";
3548
+ fields: [
3549
+ {
3550
+ name: "inner";
3551
+ docs: ["The shared `overcast_base` value layout for this account."];
3552
+ type: {
3553
+ defined: {
3554
+ name: "offer";
3555
+ };
3556
+ };
3557
+ },
3558
+ {
3559
+ name: "accountCreator";
3560
+ docs: [
3561
+ "The account that funded this account's rent — and the rent of any",
3562
+ "token accounts (escrows, claim mints, claim ATAs) created in the",
3563
+ "same instruction. Set to the creating instruction's `signer`: the",
3564
+ "maker/taker on direct calls, or the operator on delegated",
3565
+ "(operation) calls. Rent is returned here when the account is closed."
3566
+ ];
3567
+ type: "pubkey";
3568
+ }
3569
+ ];
3570
+ };
3571
+ },
3572
+ {
3573
+ name: "offerClosed";
3574
+ type: {
3575
+ kind: "struct";
3576
+ fields: [
3577
+ {
3578
+ name: "submitter";
3579
+ type: "pubkey";
3580
+ },
3581
+ {
3582
+ name: "offerId";
3583
+ type: "pubkey";
3584
+ },
3585
+ {
3586
+ name: "offerAccount";
3587
+ type: "pubkey";
3588
+ },
3589
+ {
3590
+ name: "creator";
3591
+ docs: ["The offer creator, this is either the taker or the maker"];
3592
+ type: "pubkey";
3593
+ },
3594
+ {
3595
+ name: "depositAsset";
3596
+ docs: [
3597
+ "This is either the premium that has been refunded or the collateral that has been refunded."
3598
+ ];
3599
+ type: "pubkey";
3600
+ },
3601
+ {
3602
+ name: "refundedAmount";
3603
+ type: "u64";
3604
+ }
3605
+ ];
3606
+ };
3607
+ },
3608
+ {
3609
+ name: "offerCreated";
3610
+ type: {
3611
+ kind: "struct";
3612
+ fields: [
3613
+ {
3614
+ name: "submitter";
3615
+ docs: [
3616
+ "The account that submitted the tx. Equals `taker` for a direct call;",
3617
+ "differs for a delegated (operation) call. See `OperationConsumed` in the",
3618
+ "same transaction for the delegation detail."
3619
+ ];
3620
+ type: "pubkey";
3621
+ },
3622
+ {
3623
+ name: "offerId";
3624
+ docs: [
3625
+ "Content-addressed offer id (cross-referenced by `MarketOption`)."
3626
+ ];
3627
+ type: "pubkey";
3628
+ },
3629
+ {
3630
+ name: "offerAccount";
3631
+ docs: ["The settlement offer PDA address."];
3632
+ type: "pubkey";
3633
+ },
3634
+ {
3635
+ name: "creator";
3636
+ docs: ["The offer creator, this is either the taker or the maker"];
3637
+ type: "pubkey";
3638
+ },
3639
+ {
3640
+ name: "details";
3641
+ type: {
3642
+ defined: {
3643
+ name: "optionDetails";
3644
+ };
3645
+ };
3646
+ },
3647
+ {
3648
+ name: "salt";
3649
+ docs: [
3650
+ "Emitted so an indexer can reproduce `offer_id` via `HashId` — both are",
3651
+ "part of the offer's hash preimage (see `serialization.rs`)."
3652
+ ];
3653
+ type: "pubkey";
3654
+ },
3655
+ {
3656
+ name: "expiry";
3657
+ type: "i64";
3658
+ },
3659
+ {
3660
+ name: "side";
3661
+ docs: ["The side of the offer"];
3662
+ type: {
3663
+ defined: {
3664
+ name: "optionSide";
3665
+ };
3666
+ };
3667
+ }
3668
+ ];
3669
+ };
3670
+ },
3671
+ {
3672
+ name: "operationClosed";
3673
+ docs: [
3674
+ "A `UsedOperation` replay-protection PDA was closed and its rent reclaimed.",
3675
+ "Only possible after the operation's `expiry`, by the original `owner`."
3676
+ ];
3677
+ type: {
3678
+ kind: "struct";
3679
+ fields: [
3680
+ {
3681
+ name: "owner";
3682
+ docs: ["The principal the spent nonce belonged to."];
3683
+ type: "pubkey";
3684
+ },
3685
+ {
3686
+ name: "salt";
3687
+ docs: ["The replay nonce whose record was reclaimed."];
3688
+ type: {
3689
+ array: ["u8", 32];
3690
+ };
3691
+ },
3692
+ {
3693
+ name: "usedOperation";
3694
+ docs: ["The replay-protection PDA that was closed."];
3695
+ type: "pubkey";
3696
+ }
3697
+ ];
3698
+ };
3699
+ },
3700
+ {
3701
+ name: "operationConsumed";
3702
+ docs: [
3703
+ "A delegated operation's ed25519 signature was verified and its replay nonce",
3704
+ "consumed (the `UsedOperation` PDA was created). Emitted from the shared",
3705
+ "`consume_operation` choke point, so every delegated action logs uniformly,",
3706
+ "independent of which instruction triggered it. The paired domain event (e.g.",
3707
+ "`CollateralOfferCreated`) is in the same transaction."
3708
+ ];
3709
+ type: {
3710
+ kind: "struct";
3711
+ fields: [
3712
+ {
3713
+ name: "owner";
3714
+ docs: ["The principal who delegated, the offer's maker / taker."];
3715
+ type: "pubkey";
3716
+ },
3717
+ {
3718
+ name: "authorizedKey";
3719
+ docs: ["The delegate key that produced the signature."];
3720
+ type: "pubkey";
3721
+ },
3722
+ {
3723
+ name: "action";
3724
+ docs: ["The action performed"];
3725
+ type: "u8";
3726
+ },
3727
+ {
3728
+ name: "salt";
3729
+ docs: ["Replay nonce that is now spent for `owner`."];
3730
+ type: {
3731
+ array: ["u8", 32];
3732
+ };
3733
+ },
3734
+ {
3735
+ name: "expiry";
3736
+ docs: [
3737
+ "Unix timestamp after which the operation was no longer valid."
3738
+ ];
3739
+ type: "i64";
3740
+ },
3741
+ {
3742
+ name: "usedOperation";
3743
+ docs: ["The replay-protection PDA that was created."];
3744
+ type: "pubkey";
3745
+ }
3746
+ ];
3747
+ };
3748
+ },
3749
+ {
3750
+ name: "operationParams";
3751
+ docs: [
3752
+ "Metadata attached to any off-chain signed action: the envelope the signer",
3753
+ "commits to alongside the action payload.",
3754
+ "",
3755
+ "On Solana this is passed as instruction data next to the action's own",
3756
+ "arguments; `signing_key` must be authorized by the acting party in",
3757
+ "overcast-core's signing-key registry."
3758
+ ];
3759
+ type: {
3760
+ kind: "struct";
3761
+ fields: [
3762
+ {
3763
+ name: "expiry";
3764
+ docs: [
3765
+ "Unix timestamp after which the operation is no longer valid."
3766
+ ];
3767
+ type: "i64";
3768
+ },
3769
+ {
3770
+ name: "nonce";
3771
+ docs: [
3772
+ "Random 32-byte value that makes each operation unique for replay protection."
3773
+ ];
3774
+ type: {
3775
+ array: ["u8", 32];
3776
+ };
3777
+ },
3778
+ {
3779
+ name: "signature";
3780
+ docs: ["Ed25519 signature over [`digest`]."];
3781
+ type: {
3782
+ array: ["u8", 64];
3783
+ };
3784
+ },
3785
+ {
3786
+ name: "signingKey";
3787
+ docs: ["The ed25519 key that produced `signature`."];
3788
+ type: "pubkey";
3789
+ }
3790
+ ];
3791
+ };
3792
+ },
3793
+ {
3794
+ name: "optionAccountsClosed";
3795
+ docs: [
3796
+ "Emitted once an option is fully wound down and its dangling accounts are",
3797
+ "closed (see `close_option_accounts`): the offer and option PDAs, their",
3798
+ "escrows, and the claim mints. Rent is refunded to the accounts that funded",
3799
+ "each piece."
3800
+ ];
3801
+ type: {
3802
+ kind: "struct";
3803
+ fields: [
3804
+ {
3805
+ name: "optionId";
3806
+ type: "pubkey";
3807
+ },
3808
+ {
3809
+ name: "optionAccount";
3810
+ type: "pubkey";
3811
+ },
3812
+ {
3813
+ name: "collateralOfferId";
3814
+ type: "pubkey";
3815
+ },
3816
+ {
3817
+ name: "settlementOfferId";
3818
+ type: "pubkey";
3819
+ },
3820
+ {
3821
+ name: "optionCreator";
3822
+ docs: [
3823
+ "Received the option PDA, claim-mint, and option-escrow rents."
3824
+ ];
3825
+ type: "pubkey";
3826
+ },
3827
+ {
3828
+ name: "settlementOfferCreator";
3829
+ docs: [
3830
+ "Received the settlement offer PDA and premium-escrow rents."
3831
+ ];
3832
+ type: "pubkey";
3833
+ },
3834
+ {
3835
+ name: "collateralOfferCreator";
3836
+ docs: [
3837
+ "Received the collateral offer PDA and collateral-escrow rents."
3838
+ ];
3839
+ type: "pubkey";
3840
+ }
3841
+ ];
3842
+ };
3843
+ },
3844
+ {
3845
+ name: "optionBorrowed";
3846
+ type: {
3847
+ kind: "struct";
3848
+ fields: [
3849
+ {
3850
+ name: "optionId";
3851
+ type: "pubkey";
3852
+ },
3853
+ {
3854
+ name: "optionAccount";
3855
+ type: "pubkey";
3856
+ },
3857
+ {
3858
+ name: "taker";
3859
+ type: "pubkey";
3860
+ },
3861
+ {
3862
+ name: "asset";
3863
+ docs: [
3864
+ "Collateral moved out of the option's collateral escrow to the taker."
3865
+ ];
3866
+ type: "pubkey";
3867
+ },
3868
+ {
3869
+ name: "amount";
3870
+ type: "u64";
3871
+ },
3872
+ {
3873
+ name: "outstandingBorrow";
3874
+ docs: [
3875
+ "Running total of borrowed (but not yet repaid) collateral after this call."
3876
+ ];
3877
+ type: "u64";
3878
+ }
3879
+ ];
3880
+ };
3881
+ },
3882
+ {
3883
+ name: "optionDetails";
3884
+ docs: [
3885
+ "The economic terms of an option, as seen by a settlement layer / hook.",
3886
+ "",
3887
+ "Mirrors `overcast_core::state::OptionDetails` byte-for-byte — core owns the",
3888
+ "on-chain account representation, this is the shared interface view."
3889
+ ];
3890
+ type: {
3891
+ kind: "struct";
3892
+ fields: [
3893
+ {
3894
+ name: "domain";
3895
+ type: "u32";
3896
+ },
3897
+ {
3898
+ name: "startTimestamp";
3899
+ type: "i64";
3900
+ },
3901
+ {
3902
+ name: "endTimestamp";
3903
+ type: "i64";
3904
+ },
3905
+ {
3906
+ name: "premiumAsset";
3907
+ type: "pubkey";
3908
+ },
3909
+ {
3910
+ name: "premiumAmount";
3911
+ type: "u64";
3912
+ },
3913
+ {
3914
+ name: "collateralAsset";
3915
+ type: "pubkey";
3916
+ },
3917
+ {
3918
+ name: "collateralAmount";
3919
+ type: "u64";
3920
+ },
3921
+ {
3922
+ name: "settlementAsset";
3923
+ type: "pubkey";
3924
+ },
3925
+ {
3926
+ name: "settlementAmount";
3927
+ type: "u64";
3928
+ },
3929
+ {
3930
+ name: "settlementLayer";
3931
+ type: "pubkey";
3932
+ },
3933
+ {
3934
+ name: "borrowAllowed";
3935
+ docs: [
3936
+ "Opt-in flag: if false, `borrow_collateral` is hard-rejected by core",
3937
+ "regardless of what the settlement layer says. If true, the layer is",
3938
+ "CPI'd and can still refuse."
3939
+ ];
3940
+ type: "bool";
3941
+ }
3942
+ ];
3943
+ };
3944
+ },
3945
+ {
3946
+ name: "optionExercised";
3947
+ type: {
3948
+ kind: "struct";
3949
+ fields: [
3950
+ {
3951
+ name: "submitter";
3952
+ type: "pubkey";
3953
+ },
3954
+ {
3955
+ name: "optionId";
3956
+ type: "pubkey";
3957
+ },
3958
+ {
3959
+ name: "optionAccount";
3960
+ type: "pubkey";
3961
+ },
3962
+ {
3963
+ name: "taker";
3964
+ type: "pubkey";
3965
+ },
3966
+ {
3967
+ name: "claimsBurned";
3968
+ docs: ["Exercise claims burned this call."];
3969
+ type: "u64";
3970
+ },
3971
+ {
3972
+ name: "settlementAsset";
3973
+ docs: [
3974
+ "Settlement the taker deposited into the option's settlement escrow."
3975
+ ];
3976
+ type: "pubkey";
3977
+ },
3978
+ {
3979
+ name: "settlementDeposited";
3980
+ type: "u64";
3981
+ },
3982
+ {
3983
+ name: "collateralAsset";
3984
+ docs: [
3985
+ "Collateral released to the taker this call (cash/cashless leftover)."
3986
+ ];
3987
+ type: "pubkey";
3988
+ },
3989
+ {
3990
+ name: "collateralToTaker";
3991
+ type: "u64";
3992
+ },
3993
+ {
3994
+ name: "totalBurnedClaims";
3995
+ docs: ["Running total of exercise claims burned after this call."];
3996
+ type: "u64";
3997
+ }
3998
+ ];
3999
+ };
4000
+ },
4001
+ {
4002
+ name: "optionRedeemed";
4003
+ type: {
4004
+ kind: "struct";
4005
+ fields: [
4006
+ {
4007
+ name: "submitter";
4008
+ type: "pubkey";
4009
+ },
4010
+ {
4011
+ name: "optionId";
4012
+ type: "pubkey";
4013
+ },
4014
+ {
4015
+ name: "optionAccount";
4016
+ type: "pubkey";
4017
+ },
4018
+ {
4019
+ name: "maker";
4020
+ type: "pubkey";
4021
+ },
4022
+ {
4023
+ name: "claimsBurned";
4024
+ docs: ["Collateral-return claims burned this call."];
4025
+ type: "u64";
4026
+ },
4027
+ {
4028
+ name: "collateralAsset";
4029
+ type: "pubkey";
4030
+ },
4031
+ {
4032
+ name: "collateralPayout";
4033
+ type: "u64";
4034
+ },
4035
+ {
4036
+ name: "settlementAsset";
4037
+ type: "pubkey";
4038
+ },
4039
+ {
4040
+ name: "settlementPayout";
4041
+ type: "u64";
4042
+ },
4043
+ {
4044
+ name: "totalBurnedClaims";
4045
+ docs: [
4046
+ "Running total of collateral-return claims burned (total redeemed)."
4047
+ ];
4048
+ type: "u64";
4049
+ }
4050
+ ];
4051
+ };
4052
+ },
4053
+ {
4054
+ name: "optionRepaid";
4055
+ type: {
4056
+ kind: "struct";
4057
+ fields: [
4058
+ {
4059
+ name: "optionId";
4060
+ type: "pubkey";
4061
+ },
4062
+ {
4063
+ name: "optionAccount";
4064
+ type: "pubkey";
4065
+ },
4066
+ {
4067
+ name: "repayer";
4068
+ docs: [
4069
+ "Whoever paid the collateral back — may be the taker or any third party."
4070
+ ];
4071
+ type: "pubkey";
4072
+ },
4073
+ {
4074
+ name: "asset";
4075
+ docs: ["Collateral moved into the option's collateral escrow."];
4076
+ type: "pubkey";
4077
+ },
4078
+ {
4079
+ name: "amount";
4080
+ type: "u64";
4081
+ },
4082
+ {
4083
+ name: "outstandingBorrow";
4084
+ docs: [
4085
+ "Running total of borrowed (but not yet repaid) collateral after this call."
4086
+ ];
4087
+ type: "u64";
4088
+ }
4089
+ ];
4090
+ };
4091
+ },
4092
+ {
4093
+ name: "optionSide";
4094
+ type: {
4095
+ kind: "enum";
4096
+ variants: [
4097
+ {
4098
+ name: "taker";
4099
+ },
4100
+ {
4101
+ name: "maker";
4102
+ }
4103
+ ];
4104
+ };
4105
+ },
4106
+ {
4107
+ name: "permissions";
4108
+ type: {
4109
+ kind: "struct";
4110
+ fields: ["u16"];
4111
+ };
4112
+ },
4113
+ {
4114
+ name: "protocolConfig";
4115
+ docs: [
4116
+ "The mutable subset of `ProtocolState` that governance can change after",
4117
+ "genesis. `domain` and `bump` are deliberately excluded — they are set once in",
4118
+ "`initialize` and immutable thereafter. Used as the argument type for both",
4119
+ "`initialize` (defaults) and `set_config`, so callers can never pass a `bump`",
4120
+ "or `domain` that the handler would have to silently ignore."
4121
+ ];
4122
+ type: {
4123
+ kind: "struct";
4124
+ fields: [
4125
+ {
4126
+ name: "authority";
4127
+ type: "pubkey";
4128
+ },
4129
+ {
4130
+ name: "pauseAuthority";
4131
+ type: "pubkey";
4132
+ },
4133
+ {
4134
+ name: "optionCreationHook";
4135
+ type: {
4136
+ option: "pubkey";
4137
+ };
4138
+ },
4139
+ {
4140
+ name: "optionCreationPaused";
4141
+ type: "bool";
4142
+ },
4143
+ {
4144
+ name: "protocolPaused";
4145
+ type: "bool";
4146
+ }
4147
+ ];
4148
+ };
4149
+ },
4150
+ {
4151
+ name: "protocolConfigUpdated";
4152
+ type: {
4153
+ kind: "struct";
4154
+ fields: [
4155
+ {
4156
+ name: "updatedBy";
4157
+ type: "pubkey";
4158
+ },
4159
+ {
4160
+ name: "authority";
4161
+ type: "pubkey";
4162
+ },
4163
+ {
4164
+ name: "pauseAuthority";
4165
+ type: "pubkey";
4166
+ },
4167
+ {
4168
+ name: "optionCreationHook";
4169
+ type: {
4170
+ option: "pubkey";
4171
+ };
4172
+ },
4173
+ {
4174
+ name: "protocolPaused";
4175
+ type: "bool";
4176
+ },
4177
+ {
4178
+ name: "optionCreationPaused";
4179
+ type: "bool";
4180
+ }
4181
+ ];
4182
+ };
4183
+ },
4184
+ {
4185
+ name: "protocolInitialized";
4186
+ docs: [
4187
+ "On-chain events emitted via `emit!` (program-log events).",
4188
+ "",
4189
+ "`emit!` writes each event as base64-encoded, Borsh-serialized data to the",
4190
+ "program log, prefixed with an event discriminator. An off-chain indexer can",
4191
+ "decode it from the IDL. Note that program logs are subject to Solana's log",
4192
+ "size limits, so large events can be truncated.",
4193
+ "",
4194
+ "Offers and options are content-addressed: their `*_id` fields are the 32-byte",
4195
+ "SHA-256 hash of the serialized offer (see `HashId` in `state.rs`) and match",
4196
+ "the values stored in `MarketOption.collateral_offer` / `settlement_offer`.",
4197
+ "The `offer` / `option` fields are the actual PDA addresses an indexer sees on",
4198
+ "chain. Both are emitted so consumers can cross-reference either way.",
4199
+ "There are 5 event categories:",
4200
+ "- Config Changes",
4201
+ "- AuthorizedSigning",
4202
+ "- Asset Deposit/Withdrawal",
4203
+ "- Option Creation",
4204
+ "- Option Interaction",
4205
+ "",
4206
+ 'Genesis "birth" record for `ProtocolState`. Carries the full initial config.'
4207
+ ];
4208
+ type: {
4209
+ kind: "struct";
4210
+ fields: [
4211
+ {
4212
+ name: "authority";
4213
+ type: "pubkey";
4214
+ },
4215
+ {
4216
+ name: "pauseAuthority";
4217
+ type: "pubkey";
4218
+ },
4219
+ {
4220
+ name: "optionCreationHook";
4221
+ type: {
4222
+ option: "pubkey";
4223
+ };
4224
+ },
4225
+ {
4226
+ name: "optionCreationPaused";
4227
+ type: "bool";
4228
+ },
4229
+ {
4230
+ name: "protocolPaused";
4231
+ type: "bool";
4232
+ },
4233
+ {
4234
+ name: "domain";
4235
+ type: "u32";
4236
+ }
4237
+ ];
4238
+ };
4239
+ },
4240
+ {
4241
+ name: "protocolPaused";
4242
+ docs: [
4243
+ "Emitted when the `pause_authority` (a hot wallet, not governance) triggers the",
4244
+ "protocol pause."
4245
+ ];
4246
+ type: {
4247
+ kind: "struct";
4248
+ fields: [
4249
+ {
4250
+ name: "pausedBy";
4251
+ type: "pubkey";
4252
+ }
4253
+ ];
4254
+ };
4255
+ },
4256
+ {
4257
+ name: "protocolState";
4258
+ type: {
4259
+ kind: "struct";
4260
+ fields: [
4261
+ {
4262
+ name: "config";
4263
+ type: {
4264
+ defined: {
4265
+ name: "protocolConfig";
4266
+ };
4267
+ };
4268
+ },
4269
+ {
4270
+ name: "domain";
4271
+ type: "u32";
4272
+ },
4273
+ {
4274
+ name: "bump";
4275
+ type: "u8";
4276
+ }
4277
+ ];
4278
+ };
4279
+ },
4280
+ {
4281
+ name: "signingKeyDelegation";
4282
+ docs: [
4283
+ "Delegation granting `signing_key` authority to sign operations on `owner`'s behalf,",
4284
+ "scoped to the actions allowed by `permissions`.",
4285
+ "Seeded by `[SIGNING_KEY_SEED, owner, signing_key]`.",
4286
+ "Created by `add_signing_key`, closed by `remove_signing_key`."
4287
+ ];
4288
+ type: {
4289
+ kind: "struct";
4290
+ fields: [
4291
+ {
4292
+ name: "bump";
4293
+ type: "u8";
4294
+ },
4295
+ {
4296
+ name: "owner";
4297
+ type: "pubkey";
4298
+ },
4299
+ {
4300
+ name: "signingKey";
4301
+ type: "pubkey";
4302
+ },
4303
+ {
4304
+ name: "permissions";
4305
+ type: {
4306
+ defined: {
4307
+ name: "permissions";
4308
+ };
4309
+ };
4310
+ }
4311
+ ];
4312
+ };
4313
+ },
4314
+ {
4315
+ name: "usedOperation";
4316
+ docs: [
4317
+ "On-chain record that a (signer, nonce) pair has been consumed.",
4318
+ "Seeded by `[USED_OPERATION_SEED, signer, nonce]`.",
4319
+ "After `expiry` the `payer` (who funded the rent — the operator on delegated",
4320
+ "calls) can close this via `close_used_operation` to reclaim that rent."
4321
+ ];
4322
+ type: {
4323
+ kind: "struct";
4324
+ fields: [
4325
+ {
4326
+ name: "signer";
4327
+ docs: [
4328
+ "The account this operation acts on behalf of (offer maker / option taker).",
4329
+ "Part of the PDA seeds, so the replay guard is scoped per signer."
4330
+ ];
4331
+ type: "pubkey";
4332
+ },
4333
+ {
4334
+ name: "payer";
4335
+ docs: [
4336
+ "The account that funded this record's rent — the transaction `signer`",
4337
+ "(the operator on delegated calls). Rent is refunded here on close."
4338
+ ];
4339
+ type: "pubkey";
4340
+ },
4341
+ {
4342
+ name: "expiry";
4343
+ type: "i64";
4344
+ },
4345
+ {
4346
+ name: "bump";
4347
+ type: "u8";
4348
+ }
4349
+ ];
4350
+ };
4351
+ },
4352
+ {
4353
+ name: "withdrawn";
4354
+ type: {
4355
+ kind: "struct";
4356
+ fields: [
4357
+ {
4358
+ name: "accountHolder";
4359
+ type: "pubkey";
4360
+ },
4361
+ {
4362
+ name: "mint";
4363
+ type: "pubkey";
4364
+ },
4365
+ {
4366
+ name: "amount";
4367
+ type: "u64";
4368
+ },
4369
+ {
4370
+ name: "escrowTokenAccount";
4371
+ type: "pubkey";
4372
+ },
4373
+ {
4374
+ name: "toTokenAccount";
4375
+ type: "pubkey";
4376
+ }
4377
+ ];
4378
+ };
4379
+ }
4380
+ ];
4381
+ constants: [
4382
+ {
4383
+ name: "protocolStateSeed";
4384
+ type: "bytes";
4385
+ value: "[112, 114, 111, 116, 111, 99, 111, 108, 45, 115, 116, 97, 116, 101]";
4386
+ }
4387
+ ];
4388
+ };