@bondedhq/solana 0.0.0-stage → 0.1.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.
package/dist/idls.js ADDED
@@ -0,0 +1,2414 @@
1
+ export const bondedRegistryIdl = {
2
+ address: "7hfPMrd4A264TfgTivV1QLmps9N5ZCf4r64csh8hfuYy",
3
+ metadata: {
4
+ name: "bonded_registry",
5
+ version: "0.1.0",
6
+ spec: "0.1.0",
7
+ description: "Bonded agent registry: agent records and attester-signed safety scores",
8
+ },
9
+ instructions: [
10
+ {
11
+ name: "initialize",
12
+ docs: ["One-time setup: the admin and the attester whose signatures are accepted."],
13
+ discriminator: [175, 175, 109, 31, 13, 152, 155, 237],
14
+ accounts: [
15
+ {
16
+ name: "config",
17
+ writable: true,
18
+ pda: {
19
+ seeds: [
20
+ {
21
+ kind: "const",
22
+ value: [99, 111, 110, 102, 105, 103],
23
+ },
24
+ ],
25
+ },
26
+ },
27
+ {
28
+ name: "admin",
29
+ writable: true,
30
+ signer: true,
31
+ },
32
+ {
33
+ name: "program",
34
+ docs: [
35
+ "This program, so its upgrade authority can be checked: only the deployer may configure it.",
36
+ ],
37
+ address: "7hfPMrd4A264TfgTivV1QLmps9N5ZCf4r64csh8hfuYy",
38
+ },
39
+ {
40
+ name: "program_data",
41
+ },
42
+ {
43
+ name: "system_program",
44
+ address: "11111111111111111111111111111111",
45
+ },
46
+ ],
47
+ args: [
48
+ {
49
+ name: "attester",
50
+ type: "pubkey",
51
+ },
52
+ ],
53
+ },
54
+ {
55
+ name: "post_score",
56
+ docs: [
57
+ "Post a score. The previous instruction in the transaction must be an Ed25519 signature",
58
+ "check by the attester over `attestation_message(program id, attestation)`. Anyone can",
59
+ "relay it. Versions must strictly increase, so an old score can't replace a newer one.",
60
+ ],
61
+ discriminator: [127, 223, 222, 154, 161, 111, 88, 150],
62
+ accounts: [
63
+ {
64
+ name: "config",
65
+ pda: {
66
+ seeds: [
67
+ {
68
+ kind: "const",
69
+ value: [99, 111, 110, 102, 105, 103],
70
+ },
71
+ ],
72
+ },
73
+ },
74
+ {
75
+ name: "agent",
76
+ writable: true,
77
+ pda: {
78
+ seeds: [
79
+ {
80
+ kind: "const",
81
+ value: [97, 103, 101, 110, 116],
82
+ },
83
+ {
84
+ kind: "account",
85
+ path: "agent.agent_id",
86
+ account: "Agent",
87
+ },
88
+ ],
89
+ },
90
+ },
91
+ {
92
+ name: "instructions",
93
+ address: "Sysvar1nstructions1111111111111111111111111",
94
+ },
95
+ ],
96
+ args: [
97
+ {
98
+ name: "attestation",
99
+ type: {
100
+ defined: {
101
+ name: "Attestation",
102
+ },
103
+ },
104
+ },
105
+ ],
106
+ },
107
+ {
108
+ name: "register",
109
+ docs: ["Register a new agent. The signer becomes its owner (the operator)."],
110
+ discriminator: [211, 124, 67, 15, 211, 194, 178, 240],
111
+ accounts: [
112
+ {
113
+ name: "config",
114
+ writable: true,
115
+ pda: {
116
+ seeds: [
117
+ {
118
+ kind: "const",
119
+ value: [99, 111, 110, 102, 105, 103],
120
+ },
121
+ ],
122
+ },
123
+ },
124
+ {
125
+ name: "agent",
126
+ writable: true,
127
+ },
128
+ {
129
+ name: "owner",
130
+ writable: true,
131
+ signer: true,
132
+ },
133
+ {
134
+ name: "system_program",
135
+ address: "11111111111111111111111111111111",
136
+ },
137
+ ],
138
+ args: [
139
+ {
140
+ name: "uri",
141
+ type: "string",
142
+ },
143
+ ],
144
+ },
145
+ {
146
+ name: "set_attester",
147
+ discriminator: [56, 199, 234, 175, 198, 241, 83, 29],
148
+ accounts: [
149
+ {
150
+ name: "config",
151
+ writable: true,
152
+ pda: {
153
+ seeds: [
154
+ {
155
+ kind: "const",
156
+ value: [99, 111, 110, 102, 105, 103],
157
+ },
158
+ ],
159
+ },
160
+ },
161
+ {
162
+ name: "admin",
163
+ signer: true,
164
+ relations: ["config"],
165
+ },
166
+ ],
167
+ args: [
168
+ {
169
+ name: "attester",
170
+ type: "pubkey",
171
+ },
172
+ ],
173
+ },
174
+ ],
175
+ accounts: [
176
+ {
177
+ name: "Agent",
178
+ discriminator: [47, 166, 112, 147, 155, 197, 86, 7],
179
+ },
180
+ {
181
+ name: "Config",
182
+ discriminator: [155, 12, 170, 224, 30, 250, 204, 130],
183
+ },
184
+ ],
185
+ events: [
186
+ {
187
+ name: "AttesterSet",
188
+ discriminator: [114, 47, 165, 188, 253, 188, 170, 124],
189
+ },
190
+ {
191
+ name: "Registered",
192
+ discriminator: [11, 222, 10, 72, 160, 110, 165, 227],
193
+ },
194
+ {
195
+ name: "ScorePosted",
196
+ discriminator: [173, 57, 108, 20, 7, 200, 83, 59],
197
+ },
198
+ ],
199
+ errors: [
200
+ {
201
+ code: 6000,
202
+ name: "UriTooLong",
203
+ msg: "agent URI is too long",
204
+ },
205
+ {
206
+ code: 6001,
207
+ name: "NotDeployer",
208
+ msg: "only the program's upgrade authority can initialize it",
209
+ },
210
+ {
211
+ code: 6002,
212
+ name: "WrongAgent",
213
+ msg: "the attestation is for a different agent",
214
+ },
215
+ {
216
+ code: 6003,
217
+ name: "InvalidScore",
218
+ msg: "score must be 0 to 100",
219
+ },
220
+ {
221
+ code: 6004,
222
+ name: "Expired",
223
+ msg: "the attestation has expired",
224
+ },
225
+ {
226
+ code: 6005,
227
+ name: "IssuedInFuture",
228
+ msg: "the attestation is issued in the future",
229
+ },
230
+ {
231
+ code: 6006,
232
+ name: "StaleScore",
233
+ msg: "a newer score is already posted",
234
+ },
235
+ {
236
+ code: 6007,
237
+ name: "Overflow",
238
+ msg: "arithmetic overflow",
239
+ },
240
+ ],
241
+ types: [
242
+ {
243
+ name: "Agent",
244
+ type: {
245
+ kind: "struct",
246
+ fields: [
247
+ {
248
+ name: "agent_id",
249
+ type: "u64",
250
+ },
251
+ {
252
+ name: "owner",
253
+ type: "pubkey",
254
+ },
255
+ {
256
+ name: "uri",
257
+ type: "string",
258
+ },
259
+ {
260
+ name: "score",
261
+ type: {
262
+ option: {
263
+ defined: {
264
+ name: "Attestation",
265
+ },
266
+ },
267
+ },
268
+ },
269
+ {
270
+ name: "bump",
271
+ type: "u8",
272
+ },
273
+ ],
274
+ },
275
+ },
276
+ {
277
+ name: "Attestation",
278
+ docs: ["Same fields as the EVM `BondedTypes.Attestation`."],
279
+ type: {
280
+ kind: "struct",
281
+ fields: [
282
+ {
283
+ name: "agent_id",
284
+ type: "u64",
285
+ },
286
+ {
287
+ name: "score",
288
+ type: "u16",
289
+ },
290
+ {
291
+ name: "expected_loss_bps",
292
+ type: "u32",
293
+ },
294
+ {
295
+ name: "report_hash",
296
+ type: {
297
+ array: ["u8", 32],
298
+ },
299
+ },
300
+ {
301
+ name: "mandate_hash",
302
+ type: {
303
+ array: ["u8", 32],
304
+ },
305
+ },
306
+ {
307
+ name: "code_hash",
308
+ type: {
309
+ array: ["u8", 32],
310
+ },
311
+ },
312
+ {
313
+ name: "tee_measurement",
314
+ type: {
315
+ array: ["u8", 32],
316
+ },
317
+ },
318
+ {
319
+ name: "model_family",
320
+ type: "u8",
321
+ },
322
+ {
323
+ name: "issued_at",
324
+ type: "i64",
325
+ },
326
+ {
327
+ name: "expires_at",
328
+ type: "i64",
329
+ },
330
+ ],
331
+ },
332
+ },
333
+ {
334
+ name: "AttesterSet",
335
+ type: {
336
+ kind: "struct",
337
+ fields: [
338
+ {
339
+ name: "attester",
340
+ type: "pubkey",
341
+ },
342
+ ],
343
+ },
344
+ },
345
+ {
346
+ name: "Config",
347
+ type: {
348
+ kind: "struct",
349
+ fields: [
350
+ {
351
+ name: "admin",
352
+ type: "pubkey",
353
+ },
354
+ {
355
+ name: "attester",
356
+ type: "pubkey",
357
+ },
358
+ {
359
+ name: "agent_count",
360
+ type: "u64",
361
+ },
362
+ {
363
+ name: "bump",
364
+ type: "u8",
365
+ },
366
+ ],
367
+ },
368
+ },
369
+ {
370
+ name: "Registered",
371
+ type: {
372
+ kind: "struct",
373
+ fields: [
374
+ {
375
+ name: "agent_id",
376
+ type: "u64",
377
+ },
378
+ {
379
+ name: "owner",
380
+ type: "pubkey",
381
+ },
382
+ ],
383
+ },
384
+ },
385
+ {
386
+ name: "ScorePosted",
387
+ type: {
388
+ kind: "struct",
389
+ fields: [
390
+ {
391
+ name: "agent_id",
392
+ type: "u64",
393
+ },
394
+ {
395
+ name: "score",
396
+ type: "u16",
397
+ },
398
+ {
399
+ name: "report_hash",
400
+ type: {
401
+ array: ["u8", 32],
402
+ },
403
+ },
404
+ {
405
+ name: "issued_at",
406
+ type: "i64",
407
+ },
408
+ ],
409
+ },
410
+ },
411
+ ],
412
+ };
413
+ export const bondedVaultIdl = {
414
+ address: "8hNVDFF7aU2BJa4avnv2X7ziYEmguCaCHTZYBKo2CzFx",
415
+ metadata: {
416
+ name: "bonded_vault",
417
+ version: "0.1.0",
418
+ spec: "0.1.0",
419
+ description: "Bonded mandate vault: agent actions checked against a mandate, breach log and freeze",
420
+ },
421
+ instructions: [
422
+ {
423
+ name: "create_vault",
424
+ docs: ["Create a vault for one agent. The signer is the guardian."],
425
+ discriminator: [29, 237, 247, 208, 193, 82, 54, 135],
426
+ accounts: [
427
+ {
428
+ name: "vault",
429
+ writable: true,
430
+ pda: {
431
+ seeds: [
432
+ {
433
+ kind: "const",
434
+ value: [118, 97, 117, 108, 116],
435
+ },
436
+ {
437
+ kind: "account",
438
+ path: "guardian",
439
+ },
440
+ {
441
+ kind: "arg",
442
+ path: "params.agent_id",
443
+ },
444
+ ],
445
+ },
446
+ },
447
+ {
448
+ name: "base_account",
449
+ writable: true,
450
+ pda: {
451
+ seeds: [
452
+ {
453
+ kind: "const",
454
+ value: [98, 97, 115, 101],
455
+ },
456
+ {
457
+ kind: "account",
458
+ path: "vault",
459
+ },
460
+ ],
461
+ },
462
+ },
463
+ {
464
+ name: "base_mint",
465
+ },
466
+ {
467
+ name: "guardian",
468
+ writable: true,
469
+ signer: true,
470
+ },
471
+ {
472
+ name: "token_program",
473
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
474
+ },
475
+ {
476
+ name: "system_program",
477
+ address: "11111111111111111111111111111111",
478
+ },
479
+ ],
480
+ args: [
481
+ {
482
+ name: "params",
483
+ type: {
484
+ defined: {
485
+ name: "VaultParams",
486
+ },
487
+ },
488
+ },
489
+ ],
490
+ },
491
+ {
492
+ name: "deposit",
493
+ docs: ["Anyone can add base asset to the vault."],
494
+ discriminator: [242, 35, 198, 137, 82, 225, 242, 182],
495
+ accounts: [
496
+ {
497
+ name: "vault",
498
+ },
499
+ {
500
+ name: "base_account",
501
+ writable: true,
502
+ relations: ["vault"],
503
+ },
504
+ {
505
+ name: "base_mint",
506
+ relations: ["vault"],
507
+ },
508
+ {
509
+ name: "from",
510
+ writable: true,
511
+ },
512
+ {
513
+ name: "depositor",
514
+ signer: true,
515
+ },
516
+ {
517
+ name: "token_program",
518
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
519
+ },
520
+ ],
521
+ args: [
522
+ {
523
+ name: "amount",
524
+ type: "u64",
525
+ },
526
+ ],
527
+ },
528
+ {
529
+ name: "execute",
530
+ docs: [
531
+ "The agent's only way to act: call `target_program` with `data`, the vault signing. The",
532
+ "accounts for the call are the remaining accounts, in order.",
533
+ ],
534
+ discriminator: [130, 221, 242, 154, 13, 193, 189, 29],
535
+ accounts: [
536
+ {
537
+ name: "vault",
538
+ writable: true,
539
+ },
540
+ {
541
+ name: "agent",
542
+ signer: true,
543
+ relations: ["vault"],
544
+ },
545
+ {
546
+ name: "base_account",
547
+ writable: true,
548
+ relations: ["vault"],
549
+ },
550
+ {
551
+ name: "target_program",
552
+ },
553
+ ],
554
+ args: [
555
+ {
556
+ name: "data",
557
+ type: "bytes",
558
+ },
559
+ ],
560
+ },
561
+ {
562
+ name: "freeze",
563
+ discriminator: [255, 91, 207, 84, 251, 194, 254, 63],
564
+ accounts: [
565
+ {
566
+ name: "vault",
567
+ writable: true,
568
+ },
569
+ {
570
+ name: "guardian",
571
+ signer: true,
572
+ relations: ["vault"],
573
+ },
574
+ ],
575
+ args: [],
576
+ },
577
+ {
578
+ name: "initialize",
579
+ docs: [
580
+ "One-time setup. `cover_authority` is the cover program's claims signer, the only key",
581
+ "that can mark breaches as paid.",
582
+ ],
583
+ discriminator: [175, 175, 109, 31, 13, 152, 155, 237],
584
+ accounts: [
585
+ {
586
+ name: "config",
587
+ writable: true,
588
+ pda: {
589
+ seeds: [
590
+ {
591
+ kind: "const",
592
+ value: [99, 111, 110, 102, 105, 103],
593
+ },
594
+ ],
595
+ },
596
+ },
597
+ {
598
+ name: "admin",
599
+ writable: true,
600
+ signer: true,
601
+ },
602
+ {
603
+ name: "program",
604
+ docs: [
605
+ "This program, so its upgrade authority can be checked: only the deployer may configure it.",
606
+ ],
607
+ address: "8hNVDFF7aU2BJa4avnv2X7ziYEmguCaCHTZYBKo2CzFx",
608
+ },
609
+ {
610
+ name: "program_data",
611
+ },
612
+ {
613
+ name: "system_program",
614
+ address: "11111111111111111111111111111111",
615
+ },
616
+ ],
617
+ args: [
618
+ {
619
+ name: "cover_authority",
620
+ type: "pubkey",
621
+ },
622
+ ],
623
+ },
624
+ {
625
+ name: "mark_claimed",
626
+ docs: ["Called by the cover program when it pays a claim, so a breach is paid once."],
627
+ discriminator: [41, 26, 180, 23, 91, 147, 3, 115],
628
+ accounts: [
629
+ {
630
+ name: "config",
631
+ pda: {
632
+ seeds: [
633
+ {
634
+ kind: "const",
635
+ value: [99, 111, 110, 102, 105, 103],
636
+ },
637
+ ],
638
+ },
639
+ },
640
+ {
641
+ name: "vault",
642
+ writable: true,
643
+ },
644
+ {
645
+ name: "cover_authority",
646
+ signer: true,
647
+ relations: ["config"],
648
+ },
649
+ ],
650
+ args: [
651
+ {
652
+ name: "breach_ids",
653
+ type: "bytes",
654
+ },
655
+ ],
656
+ },
657
+ {
658
+ name: "rotate_agent",
659
+ docs: ["Replace the agent's key, e.g. after a compromise."],
660
+ discriminator: [182, 91, 147, 107, 155, 47, 150, 176],
661
+ accounts: [
662
+ {
663
+ name: "vault",
664
+ writable: true,
665
+ },
666
+ {
667
+ name: "guardian",
668
+ signer: true,
669
+ relations: ["vault"],
670
+ },
671
+ ],
672
+ args: [
673
+ {
674
+ name: "new_agent",
675
+ type: "pubkey",
676
+ },
677
+ ],
678
+ },
679
+ {
680
+ name: "unfreeze",
681
+ discriminator: [133, 160, 68, 253, 80, 232, 218, 247],
682
+ accounts: [
683
+ {
684
+ name: "vault",
685
+ writable: true,
686
+ },
687
+ {
688
+ name: "guardian",
689
+ signer: true,
690
+ relations: ["vault"],
691
+ },
692
+ ],
693
+ args: [],
694
+ },
695
+ {
696
+ name: "withdraw",
697
+ docs: ["The guardian takes base asset out, frozen or not."],
698
+ discriminator: [183, 18, 70, 156, 148, 109, 161, 34],
699
+ accounts: [
700
+ {
701
+ name: "vault",
702
+ },
703
+ {
704
+ name: "base_account",
705
+ writable: true,
706
+ relations: ["vault"],
707
+ },
708
+ {
709
+ name: "base_mint",
710
+ relations: ["vault"],
711
+ },
712
+ {
713
+ name: "to",
714
+ writable: true,
715
+ },
716
+ {
717
+ name: "guardian",
718
+ signer: true,
719
+ relations: ["vault"],
720
+ },
721
+ {
722
+ name: "token_program",
723
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
724
+ },
725
+ ],
726
+ args: [
727
+ {
728
+ name: "amount",
729
+ type: "u64",
730
+ },
731
+ ],
732
+ },
733
+ ],
734
+ accounts: [
735
+ {
736
+ name: "Config",
737
+ discriminator: [155, 12, 170, 224, 30, 250, 204, 130],
738
+ },
739
+ {
740
+ name: "Vault",
741
+ discriminator: [211, 8, 232, 43, 2, 152, 117, 119],
742
+ },
743
+ ],
744
+ events: [
745
+ {
746
+ name: "AgentRotated",
747
+ discriminator: [128, 98, 178, 231, 254, 100, 152, 242],
748
+ },
749
+ {
750
+ name: "BreachClaimed",
751
+ discriminator: [35, 235, 191, 83, 36, 123, 68, 17],
752
+ },
753
+ {
754
+ name: "BreachRecorded",
755
+ discriminator: [54, 28, 158, 47, 103, 87, 147, 217],
756
+ },
757
+ {
758
+ name: "Frozen",
759
+ discriminator: [115, 77, 189, 83, 81, 71, 245, 232],
760
+ },
761
+ {
762
+ name: "Unfrozen",
763
+ discriminator: [222, 72, 230, 135, 198, 225, 71, 65],
764
+ },
765
+ {
766
+ name: "VaultCreated",
767
+ discriminator: [117, 25, 120, 254, 75, 236, 78, 115],
768
+ },
769
+ ],
770
+ errors: [
771
+ {
772
+ code: 6000,
773
+ name: "Frozen",
774
+ msg: "the vault is frozen",
775
+ },
776
+ {
777
+ code: 6001,
778
+ name: "NotDeployer",
779
+ msg: "only the program's upgrade authority can initialize it",
780
+ },
781
+ {
782
+ code: 6002,
783
+ name: "NotAgent",
784
+ msg: "only the vault's agent can execute",
785
+ },
786
+ {
787
+ code: 6003,
788
+ name: "BreachLogFull",
789
+ msg: "the breach log is full",
790
+ },
791
+ {
792
+ code: 6004,
793
+ name: "TooManyPrograms",
794
+ msg: "too many allowed programs",
795
+ },
796
+ {
797
+ code: 6005,
798
+ name: "SelfCall",
799
+ msg: "the vault cannot call itself",
800
+ },
801
+ {
802
+ code: 6006,
803
+ name: "UnknownBreach",
804
+ msg: "no breach with that id",
805
+ },
806
+ {
807
+ code: 6007,
808
+ name: "AlreadyClaimed",
809
+ msg: "breach already claimed",
810
+ },
811
+ {
812
+ code: 6008,
813
+ name: "NotCoverAuthority",
814
+ msg: "only the cover program can mark breaches claimed",
815
+ },
816
+ ],
817
+ types: [
818
+ {
819
+ name: "AgentRotated",
820
+ type: {
821
+ kind: "struct",
822
+ fields: [
823
+ {
824
+ name: "vault",
825
+ type: "pubkey",
826
+ },
827
+ {
828
+ name: "previous",
829
+ type: "pubkey",
830
+ },
831
+ {
832
+ name: "new_agent",
833
+ type: "pubkey",
834
+ },
835
+ ],
836
+ },
837
+ },
838
+ {
839
+ name: "Breach",
840
+ type: {
841
+ kind: "struct",
842
+ fields: [
843
+ {
844
+ name: "breach_type",
845
+ type: {
846
+ defined: {
847
+ name: "BreachType",
848
+ },
849
+ },
850
+ },
851
+ {
852
+ name: "blocked",
853
+ docs: ["Enforce mode stopped the action; nothing was lost."],
854
+ type: "bool",
855
+ },
856
+ {
857
+ name: "claimed",
858
+ docs: ["Set by the cover program once paid."],
859
+ type: "bool",
860
+ },
861
+ {
862
+ name: "target",
863
+ type: "pubkey",
864
+ },
865
+ {
866
+ name: "timestamp",
867
+ type: "i64",
868
+ },
869
+ {
870
+ name: "loss",
871
+ docs: ["Base-asset units that left the vault in this call."],
872
+ type: "u64",
873
+ },
874
+ ],
875
+ },
876
+ },
877
+ {
878
+ name: "BreachClaimed",
879
+ type: {
880
+ kind: "struct",
881
+ fields: [
882
+ {
883
+ name: "vault",
884
+ type: "pubkey",
885
+ },
886
+ {
887
+ name: "breach_id",
888
+ type: "u8",
889
+ },
890
+ ],
891
+ },
892
+ },
893
+ {
894
+ name: "BreachRecorded",
895
+ type: {
896
+ kind: "struct",
897
+ fields: [
898
+ {
899
+ name: "breach_id",
900
+ type: "u8",
901
+ },
902
+ {
903
+ name: "breach_type",
904
+ type: {
905
+ defined: {
906
+ name: "BreachType",
907
+ },
908
+ },
909
+ },
910
+ {
911
+ name: "target",
912
+ type: "pubkey",
913
+ },
914
+ {
915
+ name: "loss",
916
+ type: "u64",
917
+ },
918
+ {
919
+ name: "blocked",
920
+ type: "bool",
921
+ },
922
+ ],
923
+ },
924
+ },
925
+ {
926
+ name: "BreachType",
927
+ type: {
928
+ kind: "enum",
929
+ variants: [
930
+ {
931
+ name: "UnauthorizedTarget",
932
+ },
933
+ {
934
+ name: "UnauthorizedApproval",
935
+ },
936
+ {
937
+ name: "UnauthorizedTransfer",
938
+ },
939
+ {
940
+ name: "Limit",
941
+ },
942
+ ],
943
+ },
944
+ },
945
+ {
946
+ name: "Config",
947
+ type: {
948
+ kind: "struct",
949
+ fields: [
950
+ {
951
+ name: "admin",
952
+ type: "pubkey",
953
+ },
954
+ {
955
+ name: "cover_authority",
956
+ type: "pubkey",
957
+ },
958
+ {
959
+ name: "bump",
960
+ type: "u8",
961
+ },
962
+ ],
963
+ },
964
+ },
965
+ {
966
+ name: "Frozen",
967
+ type: {
968
+ kind: "struct",
969
+ fields: [
970
+ {
971
+ name: "vault",
972
+ type: "pubkey",
973
+ },
974
+ ],
975
+ },
976
+ },
977
+ {
978
+ name: "Unfrozen",
979
+ type: {
980
+ kind: "struct",
981
+ fields: [
982
+ {
983
+ name: "vault",
984
+ type: "pubkey",
985
+ },
986
+ ],
987
+ },
988
+ },
989
+ {
990
+ name: "Vault",
991
+ type: {
992
+ kind: "struct",
993
+ fields: [
994
+ {
995
+ name: "guardian",
996
+ type: "pubkey",
997
+ },
998
+ {
999
+ name: "agent",
1000
+ type: "pubkey",
1001
+ },
1002
+ {
1003
+ name: "agent_id",
1004
+ type: "u64",
1005
+ },
1006
+ {
1007
+ name: "mandate_hash",
1008
+ type: {
1009
+ array: ["u8", 32],
1010
+ },
1011
+ },
1012
+ {
1013
+ name: "enforce",
1014
+ type: "bool",
1015
+ },
1016
+ {
1017
+ name: "freeze_on_breach",
1018
+ type: "bool",
1019
+ },
1020
+ {
1021
+ name: "base_mint",
1022
+ type: "pubkey",
1023
+ },
1024
+ {
1025
+ name: "base_account",
1026
+ type: "pubkey",
1027
+ },
1028
+ {
1029
+ name: "allowed_programs",
1030
+ type: {
1031
+ vec: "pubkey",
1032
+ },
1033
+ },
1034
+ {
1035
+ name: "max_outflow_per_call",
1036
+ type: "u64",
1037
+ },
1038
+ {
1039
+ name: "frozen",
1040
+ type: "bool",
1041
+ },
1042
+ {
1043
+ name: "breaches",
1044
+ type: {
1045
+ vec: {
1046
+ defined: {
1047
+ name: "Breach",
1048
+ },
1049
+ },
1050
+ },
1051
+ },
1052
+ {
1053
+ name: "bump",
1054
+ type: "u8",
1055
+ },
1056
+ ],
1057
+ },
1058
+ },
1059
+ {
1060
+ name: "VaultCreated",
1061
+ type: {
1062
+ kind: "struct",
1063
+ fields: [
1064
+ {
1065
+ name: "vault",
1066
+ type: "pubkey",
1067
+ },
1068
+ {
1069
+ name: "agent_id",
1070
+ type: "u64",
1071
+ },
1072
+ {
1073
+ name: "guardian",
1074
+ type: "pubkey",
1075
+ },
1076
+ {
1077
+ name: "agent",
1078
+ type: "pubkey",
1079
+ },
1080
+ {
1081
+ name: "mandate_hash",
1082
+ type: {
1083
+ array: ["u8", 32],
1084
+ },
1085
+ },
1086
+ ],
1087
+ },
1088
+ },
1089
+ {
1090
+ name: "VaultParams",
1091
+ type: {
1092
+ kind: "struct",
1093
+ fields: [
1094
+ {
1095
+ name: "agent_id",
1096
+ type: "u64",
1097
+ },
1098
+ {
1099
+ name: "agent",
1100
+ type: "pubkey",
1101
+ },
1102
+ {
1103
+ name: "mandate_hash",
1104
+ type: {
1105
+ array: ["u8", 32],
1106
+ },
1107
+ },
1108
+ {
1109
+ name: "enforce",
1110
+ type: "bool",
1111
+ },
1112
+ {
1113
+ name: "freeze_on_breach",
1114
+ type: "bool",
1115
+ },
1116
+ {
1117
+ name: "allowed_programs",
1118
+ type: {
1119
+ vec: "pubkey",
1120
+ },
1121
+ },
1122
+ {
1123
+ name: "max_outflow_per_call",
1124
+ type: "u64",
1125
+ },
1126
+ ],
1127
+ },
1128
+ },
1129
+ ],
1130
+ };
1131
+ export const bondedCoverIdl = {
1132
+ address: "Dcrwfd272QQxXS4oEmHPSQdGWRZ2BMRSMb3Vi7jj6Y1X",
1133
+ metadata: {
1134
+ name: "bonded_cover",
1135
+ version: "0.1.0",
1136
+ spec: "0.1.0",
1137
+ description: "Bonded cover: underwriting pool, operator bonds, signed quotes and parametric claims",
1138
+ },
1139
+ instructions: [
1140
+ {
1141
+ name: "buy_cover",
1142
+ docs: [
1143
+ "Bind cover with a quote the attester signed. The previous instruction must be an Ed25519",
1144
+ "check by the attester over `quote_message(program id, quote)`. Only the vault's guardian,",
1145
+ "who must also own the agent, can bind it. The premium for the whole term is paid now.",
1146
+ ],
1147
+ discriminator: [43, 59, 234, 123, 199, 21, 0, 167],
1148
+ accounts: [
1149
+ {
1150
+ name: "config",
1151
+ writable: true,
1152
+ pda: {
1153
+ seeds: [
1154
+ {
1155
+ kind: "const",
1156
+ value: [99, 111, 110, 102, 105, 103],
1157
+ },
1158
+ ],
1159
+ },
1160
+ },
1161
+ {
1162
+ name: "vault",
1163
+ },
1164
+ {
1165
+ name: "agent",
1166
+ pda: {
1167
+ seeds: [
1168
+ {
1169
+ kind: "const",
1170
+ value: [97, 103, 101, 110, 116],
1171
+ },
1172
+ {
1173
+ kind: "arg",
1174
+ path: "quote.agent_id",
1175
+ },
1176
+ ],
1177
+ program: {
1178
+ kind: "const",
1179
+ value: [
1180
+ 99, 144, 193, 173, 160, 230, 139, 74, 29, 219, 164, 181, 185, 133, 37, 250, 2, 217,
1181
+ 163, 5, 181, 176, 195, 215, 178, 230, 160, 46, 174, 36, 154, 94,
1182
+ ],
1183
+ },
1184
+ },
1185
+ },
1186
+ {
1187
+ name: "bond",
1188
+ pda: {
1189
+ seeds: [
1190
+ {
1191
+ kind: "const",
1192
+ value: [98, 111, 110, 100],
1193
+ },
1194
+ {
1195
+ kind: "arg",
1196
+ path: "quote.agent_id",
1197
+ },
1198
+ ],
1199
+ },
1200
+ },
1201
+ {
1202
+ name: "policy",
1203
+ writable: true,
1204
+ pda: {
1205
+ seeds: [
1206
+ {
1207
+ kind: "const",
1208
+ value: [112, 111, 108, 105, 99, 121],
1209
+ },
1210
+ {
1211
+ kind: "account",
1212
+ path: "config.next_policy_id",
1213
+ account: "Config",
1214
+ },
1215
+ ],
1216
+ },
1217
+ },
1218
+ {
1219
+ name: "quote_record",
1220
+ docs: ["Exists once a quote is used, so the same quote can't bind cover twice."],
1221
+ writable: true,
1222
+ pda: {
1223
+ seeds: [
1224
+ {
1225
+ kind: "const",
1226
+ value: [113, 117, 111, 116, 101],
1227
+ },
1228
+ {
1229
+ kind: "arg",
1230
+ path: "quote.vault",
1231
+ },
1232
+ {
1233
+ kind: "arg",
1234
+ path: "quote.nonce",
1235
+ },
1236
+ ],
1237
+ },
1238
+ },
1239
+ {
1240
+ name: "pool_vault",
1241
+ writable: true,
1242
+ pda: {
1243
+ seeds: [
1244
+ {
1245
+ kind: "const",
1246
+ value: [112, 111, 111, 108, 95, 118, 97, 117, 108, 116],
1247
+ },
1248
+ ],
1249
+ },
1250
+ },
1251
+ {
1252
+ name: "base_mint",
1253
+ relations: ["config"],
1254
+ },
1255
+ {
1256
+ name: "premium_from",
1257
+ writable: true,
1258
+ },
1259
+ {
1260
+ name: "guardian",
1261
+ writable: true,
1262
+ signer: true,
1263
+ relations: ["vault"],
1264
+ },
1265
+ {
1266
+ name: "instructions",
1267
+ address: "Sysvar1nstructions1111111111111111111111111",
1268
+ },
1269
+ {
1270
+ name: "token_program",
1271
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
1272
+ },
1273
+ {
1274
+ name: "system_program",
1275
+ address: "11111111111111111111111111111111",
1276
+ },
1277
+ ],
1278
+ args: [
1279
+ {
1280
+ name: "quote",
1281
+ type: {
1282
+ defined: {
1283
+ name: "Quote",
1284
+ },
1285
+ },
1286
+ },
1287
+ ],
1288
+ },
1289
+ {
1290
+ name: "deposit",
1291
+ docs: ["Underwriters deposit base asset for pool shares."],
1292
+ discriminator: [242, 35, 198, 137, 82, 225, 242, 182],
1293
+ accounts: [
1294
+ {
1295
+ name: "config",
1296
+ pda: {
1297
+ seeds: [
1298
+ {
1299
+ kind: "const",
1300
+ value: [99, 111, 110, 102, 105, 103],
1301
+ },
1302
+ ],
1303
+ },
1304
+ },
1305
+ {
1306
+ name: "pool_vault",
1307
+ writable: true,
1308
+ pda: {
1309
+ seeds: [
1310
+ {
1311
+ kind: "const",
1312
+ value: [112, 111, 111, 108, 95, 118, 97, 117, 108, 116],
1313
+ },
1314
+ ],
1315
+ },
1316
+ },
1317
+ {
1318
+ name: "share_mint",
1319
+ writable: true,
1320
+ pda: {
1321
+ seeds: [
1322
+ {
1323
+ kind: "const",
1324
+ value: [115, 104, 97, 114, 101, 115],
1325
+ },
1326
+ ],
1327
+ },
1328
+ },
1329
+ {
1330
+ name: "base_mint",
1331
+ relations: ["config"],
1332
+ },
1333
+ {
1334
+ name: "from",
1335
+ writable: true,
1336
+ },
1337
+ {
1338
+ name: "shares_to",
1339
+ writable: true,
1340
+ },
1341
+ {
1342
+ name: "owner",
1343
+ signer: true,
1344
+ },
1345
+ {
1346
+ name: "token_program",
1347
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
1348
+ },
1349
+ ],
1350
+ args: [
1351
+ {
1352
+ name: "amount",
1353
+ type: "u64",
1354
+ },
1355
+ ],
1356
+ },
1357
+ {
1358
+ name: "expire",
1359
+ docs: [
1360
+ "After the term, anyone can close a policy to release the capacity it held. Breaches in",
1361
+ "the term stay claimable until the claim window closes.",
1362
+ ],
1363
+ discriminator: [243, 83, 205, 58, 57, 201, 247, 146],
1364
+ accounts: [
1365
+ {
1366
+ name: "config",
1367
+ writable: true,
1368
+ pda: {
1369
+ seeds: [
1370
+ {
1371
+ kind: "const",
1372
+ value: [99, 111, 110, 102, 105, 103],
1373
+ },
1374
+ ],
1375
+ },
1376
+ },
1377
+ {
1378
+ name: "policy",
1379
+ writable: true,
1380
+ pda: {
1381
+ seeds: [
1382
+ {
1383
+ kind: "const",
1384
+ value: [112, 111, 108, 105, 99, 121],
1385
+ },
1386
+ {
1387
+ kind: "account",
1388
+ path: "policy.policy_id",
1389
+ account: "Policy",
1390
+ },
1391
+ ],
1392
+ },
1393
+ },
1394
+ ],
1395
+ args: [],
1396
+ },
1397
+ {
1398
+ name: "file_claim",
1399
+ docs: [
1400
+ "Anyone can file a claim for unpaid breaches of a covered vault. The contract checks every",
1401
+ "breach against the vault's own log and pays: bond first, then pool, into the vault.",
1402
+ ],
1403
+ discriminator: [187, 254, 40, 13, 146, 223, 230, 97],
1404
+ accounts: [
1405
+ {
1406
+ name: "config",
1407
+ writable: true,
1408
+ pda: {
1409
+ seeds: [
1410
+ {
1411
+ kind: "const",
1412
+ value: [99, 111, 110, 102, 105, 103],
1413
+ },
1414
+ ],
1415
+ },
1416
+ },
1417
+ {
1418
+ name: "policy",
1419
+ writable: true,
1420
+ pda: {
1421
+ seeds: [
1422
+ {
1423
+ kind: "const",
1424
+ value: [112, 111, 108, 105, 99, 121],
1425
+ },
1426
+ {
1427
+ kind: "account",
1428
+ path: "policy.policy_id",
1429
+ account: "Policy",
1430
+ },
1431
+ ],
1432
+ },
1433
+ },
1434
+ {
1435
+ name: "vault",
1436
+ writable: true,
1437
+ },
1438
+ {
1439
+ name: "vault_base",
1440
+ writable: true,
1441
+ },
1442
+ {
1443
+ name: "bond",
1444
+ writable: true,
1445
+ pda: {
1446
+ seeds: [
1447
+ {
1448
+ kind: "const",
1449
+ value: [98, 111, 110, 100],
1450
+ },
1451
+ {
1452
+ kind: "account",
1453
+ path: "policy.agent_id",
1454
+ account: "Policy",
1455
+ },
1456
+ ],
1457
+ },
1458
+ },
1459
+ {
1460
+ name: "bond_vault",
1461
+ writable: true,
1462
+ pda: {
1463
+ seeds: [
1464
+ {
1465
+ kind: "const",
1466
+ value: [98, 111, 110, 100, 95, 118, 97, 117, 108, 116],
1467
+ },
1468
+ {
1469
+ kind: "account",
1470
+ path: "policy.agent_id",
1471
+ account: "Policy",
1472
+ },
1473
+ ],
1474
+ },
1475
+ },
1476
+ {
1477
+ name: "pool_vault",
1478
+ writable: true,
1479
+ pda: {
1480
+ seeds: [
1481
+ {
1482
+ kind: "const",
1483
+ value: [112, 111, 111, 108, 95, 118, 97, 117, 108, 116],
1484
+ },
1485
+ ],
1486
+ },
1487
+ },
1488
+ {
1489
+ name: "base_mint",
1490
+ relations: ["config"],
1491
+ },
1492
+ {
1493
+ name: "claims_authority",
1494
+ pda: {
1495
+ seeds: [
1496
+ {
1497
+ kind: "const",
1498
+ value: [99, 108, 97, 105, 109, 115],
1499
+ },
1500
+ ],
1501
+ },
1502
+ },
1503
+ {
1504
+ name: "vault_config",
1505
+ },
1506
+ {
1507
+ name: "vault_program",
1508
+ address: "8hNVDFF7aU2BJa4avnv2X7ziYEmguCaCHTZYBKo2CzFx",
1509
+ },
1510
+ {
1511
+ name: "token_program",
1512
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
1513
+ },
1514
+ ],
1515
+ args: [
1516
+ {
1517
+ name: "breach_ids",
1518
+ type: "bytes",
1519
+ },
1520
+ ],
1521
+ },
1522
+ {
1523
+ name: "initialize",
1524
+ docs: [
1525
+ "One-time setup: the pool's token account and share mint, and the attester whose quotes",
1526
+ "are accepted.",
1527
+ ],
1528
+ discriminator: [175, 175, 109, 31, 13, 152, 155, 237],
1529
+ accounts: [
1530
+ {
1531
+ name: "config",
1532
+ writable: true,
1533
+ pda: {
1534
+ seeds: [
1535
+ {
1536
+ kind: "const",
1537
+ value: [99, 111, 110, 102, 105, 103],
1538
+ },
1539
+ ],
1540
+ },
1541
+ },
1542
+ {
1543
+ name: "pool_vault",
1544
+ writable: true,
1545
+ pda: {
1546
+ seeds: [
1547
+ {
1548
+ kind: "const",
1549
+ value: [112, 111, 111, 108, 95, 118, 97, 117, 108, 116],
1550
+ },
1551
+ ],
1552
+ },
1553
+ },
1554
+ {
1555
+ name: "share_mint",
1556
+ writable: true,
1557
+ pda: {
1558
+ seeds: [
1559
+ {
1560
+ kind: "const",
1561
+ value: [115, 104, 97, 114, 101, 115],
1562
+ },
1563
+ ],
1564
+ },
1565
+ },
1566
+ {
1567
+ name: "base_mint",
1568
+ },
1569
+ {
1570
+ name: "admin",
1571
+ writable: true,
1572
+ signer: true,
1573
+ },
1574
+ {
1575
+ name: "program",
1576
+ docs: [
1577
+ "This program, so its upgrade authority can be checked: only the deployer may configure it.",
1578
+ ],
1579
+ address: "Dcrwfd272QQxXS4oEmHPSQdGWRZ2BMRSMb3Vi7jj6Y1X",
1580
+ },
1581
+ {
1582
+ name: "program_data",
1583
+ },
1584
+ {
1585
+ name: "token_program",
1586
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
1587
+ },
1588
+ {
1589
+ name: "system_program",
1590
+ address: "11111111111111111111111111111111",
1591
+ },
1592
+ ],
1593
+ args: [
1594
+ {
1595
+ name: "attester",
1596
+ type: "pubkey",
1597
+ },
1598
+ ],
1599
+ },
1600
+ {
1601
+ name: "stake",
1602
+ docs: ["Stake a first-loss bond for an agent. Only the agent's registry owner can."],
1603
+ discriminator: [206, 176, 202, 18, 200, 209, 179, 108],
1604
+ accounts: [
1605
+ {
1606
+ name: "config",
1607
+ pda: {
1608
+ seeds: [
1609
+ {
1610
+ kind: "const",
1611
+ value: [99, 111, 110, 102, 105, 103],
1612
+ },
1613
+ ],
1614
+ },
1615
+ },
1616
+ {
1617
+ name: "agent",
1618
+ pda: {
1619
+ seeds: [
1620
+ {
1621
+ kind: "const",
1622
+ value: [97, 103, 101, 110, 116],
1623
+ },
1624
+ {
1625
+ kind: "arg",
1626
+ path: "agent_id",
1627
+ },
1628
+ ],
1629
+ program: {
1630
+ kind: "const",
1631
+ value: [
1632
+ 99, 144, 193, 173, 160, 230, 139, 74, 29, 219, 164, 181, 185, 133, 37, 250, 2, 217,
1633
+ 163, 5, 181, 176, 195, 215, 178, 230, 160, 46, 174, 36, 154, 94,
1634
+ ],
1635
+ },
1636
+ },
1637
+ },
1638
+ {
1639
+ name: "bond",
1640
+ writable: true,
1641
+ pda: {
1642
+ seeds: [
1643
+ {
1644
+ kind: "const",
1645
+ value: [98, 111, 110, 100],
1646
+ },
1647
+ {
1648
+ kind: "arg",
1649
+ path: "agent_id",
1650
+ },
1651
+ ],
1652
+ },
1653
+ },
1654
+ {
1655
+ name: "bond_vault",
1656
+ writable: true,
1657
+ pda: {
1658
+ seeds: [
1659
+ {
1660
+ kind: "const",
1661
+ value: [98, 111, 110, 100, 95, 118, 97, 117, 108, 116],
1662
+ },
1663
+ {
1664
+ kind: "arg",
1665
+ path: "agent_id",
1666
+ },
1667
+ ],
1668
+ },
1669
+ },
1670
+ {
1671
+ name: "base_mint",
1672
+ relations: ["config"],
1673
+ },
1674
+ {
1675
+ name: "from",
1676
+ writable: true,
1677
+ },
1678
+ {
1679
+ name: "operator",
1680
+ writable: true,
1681
+ signer: true,
1682
+ },
1683
+ {
1684
+ name: "token_program",
1685
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
1686
+ },
1687
+ {
1688
+ name: "system_program",
1689
+ address: "11111111111111111111111111111111",
1690
+ },
1691
+ ],
1692
+ args: [
1693
+ {
1694
+ name: "agent_id",
1695
+ type: "u64",
1696
+ },
1697
+ {
1698
+ name: "amount",
1699
+ type: "u64",
1700
+ },
1701
+ ],
1702
+ },
1703
+ {
1704
+ name: "withdraw",
1705
+ docs: ["Redeem shares for base asset, only from capital not backing active cover."],
1706
+ discriminator: [183, 18, 70, 156, 148, 109, 161, 34],
1707
+ accounts: [
1708
+ {
1709
+ name: "config",
1710
+ pda: {
1711
+ seeds: [
1712
+ {
1713
+ kind: "const",
1714
+ value: [99, 111, 110, 102, 105, 103],
1715
+ },
1716
+ ],
1717
+ },
1718
+ },
1719
+ {
1720
+ name: "pool_vault",
1721
+ writable: true,
1722
+ pda: {
1723
+ seeds: [
1724
+ {
1725
+ kind: "const",
1726
+ value: [112, 111, 111, 108, 95, 118, 97, 117, 108, 116],
1727
+ },
1728
+ ],
1729
+ },
1730
+ },
1731
+ {
1732
+ name: "share_mint",
1733
+ writable: true,
1734
+ pda: {
1735
+ seeds: [
1736
+ {
1737
+ kind: "const",
1738
+ value: [115, 104, 97, 114, 101, 115],
1739
+ },
1740
+ ],
1741
+ },
1742
+ },
1743
+ {
1744
+ name: "base_mint",
1745
+ relations: ["config"],
1746
+ },
1747
+ {
1748
+ name: "shares_from",
1749
+ writable: true,
1750
+ },
1751
+ {
1752
+ name: "to",
1753
+ writable: true,
1754
+ },
1755
+ {
1756
+ name: "owner",
1757
+ signer: true,
1758
+ },
1759
+ {
1760
+ name: "token_program",
1761
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
1762
+ },
1763
+ ],
1764
+ args: [
1765
+ {
1766
+ name: "shares",
1767
+ type: "u64",
1768
+ },
1769
+ ],
1770
+ },
1771
+ ],
1772
+ accounts: [
1773
+ {
1774
+ name: "Bond",
1775
+ discriminator: [224, 128, 48, 251, 182, 246, 111, 196],
1776
+ },
1777
+ {
1778
+ name: "Config",
1779
+ discriminator: [155, 12, 170, 224, 30, 250, 204, 130],
1780
+ },
1781
+ {
1782
+ name: "Policy",
1783
+ discriminator: [222, 135, 7, 163, 235, 177, 33, 68],
1784
+ },
1785
+ {
1786
+ name: "QuoteRecord",
1787
+ discriminator: [35, 26, 2, 134, 242, 21, 161, 78],
1788
+ },
1789
+ ],
1790
+ events: [
1791
+ {
1792
+ name: "ClaimPaid",
1793
+ discriminator: [212, 155, 88, 118, 128, 99, 132, 42],
1794
+ },
1795
+ {
1796
+ name: "CoverBound",
1797
+ discriminator: [181, 23, 122, 221, 87, 92, 154, 37],
1798
+ },
1799
+ {
1800
+ name: "Staked",
1801
+ discriminator: [11, 146, 45, 205, 230, 58, 213, 240],
1802
+ },
1803
+ ],
1804
+ errors: [
1805
+ {
1806
+ code: 6000,
1807
+ name: "ZeroAmount",
1808
+ msg: "amount must be more than zero",
1809
+ },
1810
+ {
1811
+ code: 6001,
1812
+ name: "NotDeployer",
1813
+ msg: "only the program's upgrade authority can initialize it",
1814
+ },
1815
+ {
1816
+ code: 6002,
1817
+ name: "Overflow",
1818
+ msg: "arithmetic overflow",
1819
+ },
1820
+ {
1821
+ code: 6003,
1822
+ name: "CapitalLocked",
1823
+ msg: "withdrawal would take capital that backs active cover",
1824
+ },
1825
+ {
1826
+ code: 6004,
1827
+ name: "WrongAgent",
1828
+ msg: "the agent record is for a different agent",
1829
+ },
1830
+ {
1831
+ code: 6005,
1832
+ name: "NotAgentOwner",
1833
+ msg: "only the agent's registry owner can do this",
1834
+ },
1835
+ {
1836
+ code: 6006,
1837
+ name: "NotGuardian",
1838
+ msg: "only the vault's guardian can bind cover",
1839
+ },
1840
+ {
1841
+ code: 6007,
1842
+ name: "QuoteExpired",
1843
+ msg: "the quote has expired",
1844
+ },
1845
+ {
1846
+ code: 6008,
1847
+ name: "QuoteMismatch",
1848
+ msg: "the quote doesn't match this vault",
1849
+ },
1850
+ {
1851
+ code: 6009,
1852
+ name: "VaultMustFreeze",
1853
+ msg: "the vault must freeze on a breach",
1854
+ },
1855
+ {
1856
+ code: 6010,
1857
+ name: "Uninsurable",
1858
+ msg: "the score is too low to insure",
1859
+ },
1860
+ {
1861
+ code: 6011,
1862
+ name: "InsufficientBond",
1863
+ msg: "the operator bond is too small",
1864
+ },
1865
+ {
1866
+ code: 6012,
1867
+ name: "CapacityExceeded",
1868
+ msg: "the pool can't back this much cover",
1869
+ },
1870
+ {
1871
+ code: 6013,
1872
+ name: "NoBreaches",
1873
+ msg: "no breaches given",
1874
+ },
1875
+ {
1876
+ code: 6014,
1877
+ name: "PolicyInactive",
1878
+ msg: "the policy is not active",
1879
+ },
1880
+ {
1881
+ code: 6015,
1882
+ name: "ClaimWindowClosed",
1883
+ msg: "the claim window has closed",
1884
+ },
1885
+ {
1886
+ code: 6016,
1887
+ name: "WrongVault",
1888
+ msg: "the vault is not the insured vault",
1889
+ },
1890
+ {
1891
+ code: 6017,
1892
+ name: "DuplicateBreach",
1893
+ msg: "a breach is listed twice",
1894
+ },
1895
+ {
1896
+ code: 6018,
1897
+ name: "UnknownBreach",
1898
+ msg: "no breach with that id",
1899
+ },
1900
+ {
1901
+ code: 6019,
1902
+ name: "AlreadyClaimed",
1903
+ msg: "breach already claimed",
1904
+ },
1905
+ {
1906
+ code: 6020,
1907
+ name: "NothingLost",
1908
+ msg: "nothing was lost",
1909
+ },
1910
+ {
1911
+ code: 6021,
1912
+ name: "NotCovered",
1913
+ msg: "the breach is outside the policy term",
1914
+ },
1915
+ {
1916
+ code: 6022,
1917
+ name: "PoolShort",
1918
+ msg: "the pool can't pay its share",
1919
+ },
1920
+ {
1921
+ code: 6023,
1922
+ name: "StillOpen",
1923
+ msg: "the claim window is still open",
1924
+ },
1925
+ ],
1926
+ types: [
1927
+ {
1928
+ name: "Agent",
1929
+ type: {
1930
+ kind: "struct",
1931
+ fields: [
1932
+ {
1933
+ name: "agent_id",
1934
+ type: "u64",
1935
+ },
1936
+ {
1937
+ name: "owner",
1938
+ type: "pubkey",
1939
+ },
1940
+ {
1941
+ name: "uri",
1942
+ type: "string",
1943
+ },
1944
+ {
1945
+ name: "score",
1946
+ type: {
1947
+ option: {
1948
+ defined: {
1949
+ name: "Attestation",
1950
+ },
1951
+ },
1952
+ },
1953
+ },
1954
+ {
1955
+ name: "bump",
1956
+ type: "u8",
1957
+ },
1958
+ ],
1959
+ },
1960
+ },
1961
+ {
1962
+ name: "Attestation",
1963
+ docs: ["Same fields as the EVM `BondedTypes.Attestation`."],
1964
+ type: {
1965
+ kind: "struct",
1966
+ fields: [
1967
+ {
1968
+ name: "agent_id",
1969
+ type: "u64",
1970
+ },
1971
+ {
1972
+ name: "score",
1973
+ type: "u16",
1974
+ },
1975
+ {
1976
+ name: "expected_loss_bps",
1977
+ type: "u32",
1978
+ },
1979
+ {
1980
+ name: "report_hash",
1981
+ type: {
1982
+ array: ["u8", 32],
1983
+ },
1984
+ },
1985
+ {
1986
+ name: "mandate_hash",
1987
+ type: {
1988
+ array: ["u8", 32],
1989
+ },
1990
+ },
1991
+ {
1992
+ name: "code_hash",
1993
+ type: {
1994
+ array: ["u8", 32],
1995
+ },
1996
+ },
1997
+ {
1998
+ name: "tee_measurement",
1999
+ type: {
2000
+ array: ["u8", 32],
2001
+ },
2002
+ },
2003
+ {
2004
+ name: "model_family",
2005
+ type: "u8",
2006
+ },
2007
+ {
2008
+ name: "issued_at",
2009
+ type: "i64",
2010
+ },
2011
+ {
2012
+ name: "expires_at",
2013
+ type: "i64",
2014
+ },
2015
+ ],
2016
+ },
2017
+ },
2018
+ {
2019
+ name: "Bond",
2020
+ type: {
2021
+ kind: "struct",
2022
+ fields: [
2023
+ {
2024
+ name: "agent_id",
2025
+ type: "u64",
2026
+ },
2027
+ {
2028
+ name: "amount",
2029
+ type: "u64",
2030
+ },
2031
+ {
2032
+ name: "bump",
2033
+ type: "u8",
2034
+ },
2035
+ ],
2036
+ },
2037
+ },
2038
+ {
2039
+ name: "Breach",
2040
+ type: {
2041
+ kind: "struct",
2042
+ fields: [
2043
+ {
2044
+ name: "breach_type",
2045
+ type: {
2046
+ defined: {
2047
+ name: "BreachType",
2048
+ },
2049
+ },
2050
+ },
2051
+ {
2052
+ name: "blocked",
2053
+ docs: ["Enforce mode stopped the action; nothing was lost."],
2054
+ type: "bool",
2055
+ },
2056
+ {
2057
+ name: "claimed",
2058
+ docs: ["Set by the cover program once paid."],
2059
+ type: "bool",
2060
+ },
2061
+ {
2062
+ name: "target",
2063
+ type: "pubkey",
2064
+ },
2065
+ {
2066
+ name: "timestamp",
2067
+ type: "i64",
2068
+ },
2069
+ {
2070
+ name: "loss",
2071
+ docs: ["Base-asset units that left the vault in this call."],
2072
+ type: "u64",
2073
+ },
2074
+ ],
2075
+ },
2076
+ },
2077
+ {
2078
+ name: "BreachType",
2079
+ type: {
2080
+ kind: "enum",
2081
+ variants: [
2082
+ {
2083
+ name: "UnauthorizedTarget",
2084
+ },
2085
+ {
2086
+ name: "UnauthorizedApproval",
2087
+ },
2088
+ {
2089
+ name: "UnauthorizedTransfer",
2090
+ },
2091
+ {
2092
+ name: "Limit",
2093
+ },
2094
+ ],
2095
+ },
2096
+ },
2097
+ {
2098
+ name: "ClaimPaid",
2099
+ type: {
2100
+ kind: "struct",
2101
+ fields: [
2102
+ {
2103
+ name: "policy_id",
2104
+ type: "u64",
2105
+ },
2106
+ {
2107
+ name: "vault",
2108
+ type: "pubkey",
2109
+ },
2110
+ {
2111
+ name: "loss",
2112
+ type: "u64",
2113
+ },
2114
+ {
2115
+ name: "payout",
2116
+ type: "u64",
2117
+ },
2118
+ {
2119
+ name: "from_bond",
2120
+ type: "u64",
2121
+ },
2122
+ {
2123
+ name: "from_pool",
2124
+ type: "u64",
2125
+ },
2126
+ {
2127
+ name: "breach_ids",
2128
+ type: "bytes",
2129
+ },
2130
+ ],
2131
+ },
2132
+ },
2133
+ {
2134
+ name: "Config",
2135
+ type: {
2136
+ kind: "struct",
2137
+ fields: [
2138
+ {
2139
+ name: "admin",
2140
+ type: "pubkey",
2141
+ },
2142
+ {
2143
+ name: "attester",
2144
+ type: "pubkey",
2145
+ },
2146
+ {
2147
+ name: "base_mint",
2148
+ type: "pubkey",
2149
+ },
2150
+ {
2151
+ name: "deductible_bps",
2152
+ type: "u16",
2153
+ },
2154
+ {
2155
+ name: "claim_window",
2156
+ type: "i64",
2157
+ },
2158
+ {
2159
+ name: "policy_term",
2160
+ type: "i64",
2161
+ },
2162
+ {
2163
+ name: "max_leverage_bps",
2164
+ type: "u32",
2165
+ },
2166
+ {
2167
+ name: "total_active_cover",
2168
+ type: "u64",
2169
+ },
2170
+ {
2171
+ name: "next_policy_id",
2172
+ type: "u64",
2173
+ },
2174
+ {
2175
+ name: "bump",
2176
+ type: "u8",
2177
+ },
2178
+ ],
2179
+ },
2180
+ },
2181
+ {
2182
+ name: "CoverBound",
2183
+ type: {
2184
+ kind: "struct",
2185
+ fields: [
2186
+ {
2187
+ name: "policy_id",
2188
+ type: "u64",
2189
+ },
2190
+ {
2191
+ name: "vault",
2192
+ type: "pubkey",
2193
+ },
2194
+ {
2195
+ name: "agent_id",
2196
+ type: "u64",
2197
+ },
2198
+ {
2199
+ name: "cover_amount",
2200
+ type: "u64",
2201
+ },
2202
+ {
2203
+ name: "premium",
2204
+ type: "u64",
2205
+ },
2206
+ {
2207
+ name: "ends_at",
2208
+ type: "i64",
2209
+ },
2210
+ ],
2211
+ },
2212
+ },
2213
+ {
2214
+ name: "Policy",
2215
+ type: {
2216
+ kind: "struct",
2217
+ fields: [
2218
+ {
2219
+ name: "policy_id",
2220
+ type: "u64",
2221
+ },
2222
+ {
2223
+ name: "agent_id",
2224
+ type: "u64",
2225
+ },
2226
+ {
2227
+ name: "vault",
2228
+ type: "pubkey",
2229
+ },
2230
+ {
2231
+ name: "cover_amount",
2232
+ type: "u64",
2233
+ },
2234
+ {
2235
+ name: "remaining_cover",
2236
+ type: "u64",
2237
+ },
2238
+ {
2239
+ name: "premium_rate_bps",
2240
+ type: "u32",
2241
+ },
2242
+ {
2243
+ name: "score",
2244
+ type: "u16",
2245
+ },
2246
+ {
2247
+ name: "started_at",
2248
+ type: "i64",
2249
+ },
2250
+ {
2251
+ name: "ends_at",
2252
+ type: "i64",
2253
+ },
2254
+ {
2255
+ name: "active",
2256
+ type: "bool",
2257
+ },
2258
+ {
2259
+ name: "bump",
2260
+ type: "u8",
2261
+ },
2262
+ ],
2263
+ },
2264
+ },
2265
+ {
2266
+ name: "Quote",
2267
+ docs: ["Same fields as the EVM `BondedTypes.Quote` that matter on Solana."],
2268
+ type: {
2269
+ kind: "struct",
2270
+ fields: [
2271
+ {
2272
+ name: "agent_id",
2273
+ type: "u64",
2274
+ },
2275
+ {
2276
+ name: "vault",
2277
+ type: "pubkey",
2278
+ },
2279
+ {
2280
+ name: "cover_amount",
2281
+ type: "u64",
2282
+ },
2283
+ {
2284
+ name: "premium_rate_bps",
2285
+ docs: ["Annual premium, basis points of cover."],
2286
+ type: "u32",
2287
+ },
2288
+ {
2289
+ name: "score",
2290
+ type: "u16",
2291
+ },
2292
+ {
2293
+ name: "min_bond",
2294
+ type: "u64",
2295
+ },
2296
+ {
2297
+ name: "mandate_hash",
2298
+ type: {
2299
+ array: ["u8", 32],
2300
+ },
2301
+ },
2302
+ {
2303
+ name: "expires_at",
2304
+ type: "i64",
2305
+ },
2306
+ {
2307
+ name: "nonce",
2308
+ docs: ["Chosen by the attester; each (vault, nonce) can be used once."],
2309
+ type: "u64",
2310
+ },
2311
+ ],
2312
+ },
2313
+ },
2314
+ {
2315
+ name: "QuoteRecord",
2316
+ type: {
2317
+ kind: "struct",
2318
+ fields: [
2319
+ {
2320
+ name: "used",
2321
+ type: "bool",
2322
+ },
2323
+ ],
2324
+ },
2325
+ },
2326
+ {
2327
+ name: "Staked",
2328
+ type: {
2329
+ kind: "struct",
2330
+ fields: [
2331
+ {
2332
+ name: "agent_id",
2333
+ type: "u64",
2334
+ },
2335
+ {
2336
+ name: "amount",
2337
+ type: "u64",
2338
+ },
2339
+ ],
2340
+ },
2341
+ },
2342
+ {
2343
+ name: "Vault",
2344
+ type: {
2345
+ kind: "struct",
2346
+ fields: [
2347
+ {
2348
+ name: "guardian",
2349
+ type: "pubkey",
2350
+ },
2351
+ {
2352
+ name: "agent",
2353
+ type: "pubkey",
2354
+ },
2355
+ {
2356
+ name: "agent_id",
2357
+ type: "u64",
2358
+ },
2359
+ {
2360
+ name: "mandate_hash",
2361
+ type: {
2362
+ array: ["u8", 32],
2363
+ },
2364
+ },
2365
+ {
2366
+ name: "enforce",
2367
+ type: "bool",
2368
+ },
2369
+ {
2370
+ name: "freeze_on_breach",
2371
+ type: "bool",
2372
+ },
2373
+ {
2374
+ name: "base_mint",
2375
+ type: "pubkey",
2376
+ },
2377
+ {
2378
+ name: "base_account",
2379
+ type: "pubkey",
2380
+ },
2381
+ {
2382
+ name: "allowed_programs",
2383
+ type: {
2384
+ vec: "pubkey",
2385
+ },
2386
+ },
2387
+ {
2388
+ name: "max_outflow_per_call",
2389
+ type: "u64",
2390
+ },
2391
+ {
2392
+ name: "frozen",
2393
+ type: "bool",
2394
+ },
2395
+ {
2396
+ name: "breaches",
2397
+ type: {
2398
+ vec: {
2399
+ defined: {
2400
+ name: "Breach",
2401
+ },
2402
+ },
2403
+ },
2404
+ },
2405
+ {
2406
+ name: "bump",
2407
+ type: "u8",
2408
+ },
2409
+ ],
2410
+ },
2411
+ },
2412
+ ],
2413
+ };
2414
+ //# sourceMappingURL=idls.js.map