@jpool/bond-sdk 0.0.1-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,707 @@
1
+ {
2
+ "address": "4a3YovKEfm4jWhczCzJciHXL1xVkXWfGQjRCaMft7M4G",
3
+ "metadata": {
4
+ "name": "jbond",
5
+ "version": "0.1.0",
6
+ "spec": "0.1.0",
7
+ "description": "Validator compensation program for boosting APR"
8
+ },
9
+ "instructions": [
10
+ {
11
+ "name": "bond_init",
12
+ "docs": [
13
+ "Register validator and fund initial collateral"
14
+ ],
15
+ "discriminator": [
16
+ 220,
17
+ 108,
18
+ 156,
19
+ 81,
20
+ 16,
21
+ 185,
22
+ 144,
23
+ 157
24
+ ],
25
+ "accounts": [
26
+ {
27
+ "name": "global_state",
28
+ "writable": true,
29
+ "pda": {
30
+ "seeds": [
31
+ {
32
+ "kind": "const",
33
+ "value": [
34
+ 103,
35
+ 108,
36
+ 111,
37
+ 98,
38
+ 97,
39
+ 108,
40
+ 95,
41
+ 115,
42
+ 116,
43
+ 97,
44
+ 116,
45
+ 101
46
+ ]
47
+ }
48
+ ]
49
+ }
50
+ },
51
+ {
52
+ "name": "validator_bond_account",
53
+ "writable": true,
54
+ "pda": {
55
+ "seeds": [
56
+ {
57
+ "kind": "const",
58
+ "value": [
59
+ 118,
60
+ 97,
61
+ 108,
62
+ 105,
63
+ 100,
64
+ 97,
65
+ 116,
66
+ 111,
67
+ 114,
68
+ 95,
69
+ 98,
70
+ 111,
71
+ 110,
72
+ 100
73
+ ]
74
+ },
75
+ {
76
+ "kind": "account",
77
+ "path": "vote_account"
78
+ }
79
+ ]
80
+ }
81
+ },
82
+ {
83
+ "name": "identity"
84
+ },
85
+ {
86
+ "name": "vote_account"
87
+ },
88
+ {
89
+ "name": "creator",
90
+ "docs": [
91
+ "The account creating the bond (pays for account creation and initial collateral)"
92
+ ],
93
+ "writable": true,
94
+ "signer": true
95
+ },
96
+ {
97
+ "name": "system_program",
98
+ "address": "11111111111111111111111111111111"
99
+ }
100
+ ],
101
+ "args": [
102
+ {
103
+ "name": "initial_collateral",
104
+ "type": "u64"
105
+ },
106
+ {
107
+ "name": "withdrawal_authority",
108
+ "type": {
109
+ "option": "pubkey"
110
+ }
111
+ }
112
+ ]
113
+ },
114
+ {
115
+ "name": "bond_top_up",
116
+ "docs": [
117
+ "Top up collateral for existing validator"
118
+ ],
119
+ "discriminator": [
120
+ 132,
121
+ 225,
122
+ 254,
123
+ 187,
124
+ 152,
125
+ 162,
126
+ 176,
127
+ 66
128
+ ],
129
+ "accounts": [
130
+ {
131
+ "name": "validator_bond_account",
132
+ "writable": true,
133
+ "pda": {
134
+ "seeds": [
135
+ {
136
+ "kind": "const",
137
+ "value": [
138
+ 118,
139
+ 97,
140
+ 108,
141
+ 105,
142
+ 100,
143
+ 97,
144
+ 116,
145
+ 111,
146
+ 114,
147
+ 95,
148
+ 98,
149
+ 111,
150
+ 110,
151
+ 100
152
+ ]
153
+ },
154
+ {
155
+ "kind": "account",
156
+ "path": "validator_bond_account.vote_account",
157
+ "account": "ValidatorBondAccount"
158
+ }
159
+ ]
160
+ }
161
+ },
162
+ {
163
+ "name": "depositor",
164
+ "writable": true,
165
+ "signer": true
166
+ },
167
+ {
168
+ "name": "system_program",
169
+ "address": "11111111111111111111111111111111"
170
+ }
171
+ ],
172
+ "args": [
173
+ {
174
+ "name": "amount",
175
+ "type": "u64"
176
+ }
177
+ ]
178
+ },
179
+ {
180
+ "name": "bond_withdraw",
181
+ "discriminator": [
182
+ 99,
183
+ 64,
184
+ 127,
185
+ 178,
186
+ 53,
187
+ 117,
188
+ 70,
189
+ 204
190
+ ],
191
+ "accounts": [
192
+ {
193
+ "name": "validator_bond_account",
194
+ "writable": true,
195
+ "pda": {
196
+ "seeds": [
197
+ {
198
+ "kind": "const",
199
+ "value": [
200
+ 118,
201
+ 97,
202
+ 108,
203
+ 105,
204
+ 100,
205
+ 97,
206
+ 116,
207
+ 111,
208
+ 114,
209
+ 95,
210
+ 98,
211
+ 111,
212
+ 110,
213
+ 100
214
+ ]
215
+ },
216
+ {
217
+ "kind": "account",
218
+ "path": "validator_bond_account.vote_account",
219
+ "account": "ValidatorBondAccount"
220
+ }
221
+ ]
222
+ }
223
+ },
224
+ {
225
+ "name": "withdrawal_authority",
226
+ "writable": true,
227
+ "signer": true
228
+ },
229
+ {
230
+ "name": "destination",
231
+ "writable": true
232
+ },
233
+ {
234
+ "name": "system_program",
235
+ "address": "11111111111111111111111111111111"
236
+ }
237
+ ],
238
+ "args": [
239
+ {
240
+ "name": "amount",
241
+ "type": "u64"
242
+ }
243
+ ]
244
+ },
245
+ {
246
+ "name": "initialize",
247
+ "docs": [
248
+ "Initialize the global state and reserve vault"
249
+ ],
250
+ "discriminator": [
251
+ 175,
252
+ 175,
253
+ 109,
254
+ 31,
255
+ 13,
256
+ 152,
257
+ 155,
258
+ 237
259
+ ],
260
+ "accounts": [
261
+ {
262
+ "name": "global_state",
263
+ "writable": true,
264
+ "pda": {
265
+ "seeds": [
266
+ {
267
+ "kind": "const",
268
+ "value": [
269
+ 103,
270
+ 108,
271
+ 111,
272
+ 98,
273
+ 97,
274
+ 108,
275
+ 95,
276
+ 115,
277
+ 116,
278
+ 97,
279
+ 116,
280
+ 101
281
+ ]
282
+ }
283
+ ]
284
+ }
285
+ },
286
+ {
287
+ "name": "authority",
288
+ "writable": true,
289
+ "signer": true
290
+ },
291
+ {
292
+ "name": "reserve"
293
+ },
294
+ {
295
+ "name": "system_program",
296
+ "address": "11111111111111111111111111111111"
297
+ }
298
+ ],
299
+ "args": []
300
+ },
301
+ {
302
+ "name": "withdraw_compensation",
303
+ "docs": [
304
+ "Withdraw compensation from validator to reserve (oracle only)"
305
+ ],
306
+ "discriminator": [
307
+ 10,
308
+ 228,
309
+ 22,
310
+ 213,
311
+ 205,
312
+ 117,
313
+ 181,
314
+ 75
315
+ ],
316
+ "accounts": [
317
+ {
318
+ "name": "global_state",
319
+ "writable": true,
320
+ "pda": {
321
+ "seeds": [
322
+ {
323
+ "kind": "const",
324
+ "value": [
325
+ 103,
326
+ 108,
327
+ 111,
328
+ 98,
329
+ 97,
330
+ 108,
331
+ 95,
332
+ 115,
333
+ 116,
334
+ 97,
335
+ 116,
336
+ 101
337
+ ]
338
+ }
339
+ ]
340
+ }
341
+ },
342
+ {
343
+ "name": "validator_bond_account",
344
+ "writable": true,
345
+ "pda": {
346
+ "seeds": [
347
+ {
348
+ "kind": "const",
349
+ "value": [
350
+ 118,
351
+ 97,
352
+ 108,
353
+ 105,
354
+ 100,
355
+ 97,
356
+ 116,
357
+ 111,
358
+ 114,
359
+ 95,
360
+ 98,
361
+ 111,
362
+ 110,
363
+ 100
364
+ ]
365
+ },
366
+ {
367
+ "kind": "account",
368
+ "path": "validator_bond_account.vote_account",
369
+ "account": "ValidatorBondAccount"
370
+ }
371
+ ]
372
+ }
373
+ },
374
+ {
375
+ "name": "reserve",
376
+ "writable": true
377
+ },
378
+ {
379
+ "name": "authority",
380
+ "docs": [
381
+ "Authority that can trigger claims"
382
+ ],
383
+ "signer": true
384
+ },
385
+ {
386
+ "name": "system_program",
387
+ "address": "11111111111111111111111111111111"
388
+ }
389
+ ],
390
+ "args": [
391
+ {
392
+ "name": "amount",
393
+ "type": "u64"
394
+ }
395
+ ]
396
+ }
397
+ ],
398
+ "accounts": [
399
+ {
400
+ "name": "GlobalState",
401
+ "discriminator": [
402
+ 163,
403
+ 46,
404
+ 74,
405
+ 168,
406
+ 216,
407
+ 123,
408
+ 133,
409
+ 98
410
+ ]
411
+ },
412
+ {
413
+ "name": "ValidatorBondAccount",
414
+ "discriminator": [
415
+ 25,
416
+ 67,
417
+ 241,
418
+ 227,
419
+ 226,
420
+ 104,
421
+ 108,
422
+ 73
423
+ ]
424
+ }
425
+ ],
426
+ "events": [
427
+ {
428
+ "name": "CollateralToppedUp",
429
+ "discriminator": [
430
+ 189,
431
+ 137,
432
+ 204,
433
+ 58,
434
+ 135,
435
+ 182,
436
+ 19,
437
+ 176
438
+ ]
439
+ },
440
+ {
441
+ "name": "CollateralWithdrawn",
442
+ "discriminator": [
443
+ 51,
444
+ 224,
445
+ 133,
446
+ 106,
447
+ 74,
448
+ 173,
449
+ 72,
450
+ 82
451
+ ]
452
+ },
453
+ {
454
+ "name": "CompensationClaimed",
455
+ "discriminator": [
456
+ 36,
457
+ 159,
458
+ 41,
459
+ 178,
460
+ 104,
461
+ 135,
462
+ 220,
463
+ 32
464
+ ]
465
+ },
466
+ {
467
+ "name": "ValidatorRegistered",
468
+ "discriminator": [
469
+ 20,
470
+ 20,
471
+ 190,
472
+ 191,
473
+ 53,
474
+ 174,
475
+ 95,
476
+ 72
477
+ ]
478
+ }
479
+ ],
480
+ "errors": [
481
+ {
482
+ "code": 6000,
483
+ "name": "InvalidVoteAccount",
484
+ "msg": "Invalid vote account"
485
+ },
486
+ {
487
+ "code": 6001,
488
+ "name": "IdentityMismatch",
489
+ "msg": "Identity does not match vote account"
490
+ },
491
+ {
492
+ "code": 6002,
493
+ "name": "InsufficientCollateral",
494
+ "msg": "Insufficient collateral amount"
495
+ },
496
+ {
497
+ "code": 6003,
498
+ "name": "TargetAprTooLow",
499
+ "msg": "Target APR is below minimum threshold"
500
+ },
501
+ {
502
+ "code": 6004,
503
+ "name": "MathOverflow",
504
+ "msg": "Math overflow"
505
+ },
506
+ {
507
+ "code": 6005,
508
+ "name": "InvalidAmount",
509
+ "msg": "Invalid amount"
510
+ },
511
+ {
512
+ "code": 6006,
513
+ "name": "ValidatorNotActive",
514
+ "msg": "Validator boost account is not active"
515
+ },
516
+ {
517
+ "code": 6007,
518
+ "name": "ValidatorAlreadyRegistered",
519
+ "msg": "Validator already registered"
520
+ },
521
+ {
522
+ "code": 6008,
523
+ "name": "Unauthorized",
524
+ "msg": "Unauthorized"
525
+ }
526
+ ],
527
+ "types": [
528
+ {
529
+ "name": "CollateralToppedUp",
530
+ "type": {
531
+ "kind": "struct",
532
+ "fields": [
533
+ {
534
+ "name": "validator",
535
+ "type": "pubkey"
536
+ },
537
+ {
538
+ "name": "amount",
539
+ "type": "u64"
540
+ },
541
+ {
542
+ "name": "new_total",
543
+ "type": "u64"
544
+ },
545
+ {
546
+ "name": "timestamp",
547
+ "type": "i64"
548
+ }
549
+ ]
550
+ }
551
+ },
552
+ {
553
+ "name": "CollateralWithdrawn",
554
+ "type": {
555
+ "kind": "struct",
556
+ "fields": [
557
+ {
558
+ "name": "validator",
559
+ "type": "pubkey"
560
+ },
561
+ {
562
+ "name": "amount",
563
+ "type": "u64"
564
+ },
565
+ {
566
+ "name": "remaining_collateral",
567
+ "type": "u64"
568
+ },
569
+ {
570
+ "name": "timestamp",
571
+ "type": "i64"
572
+ }
573
+ ]
574
+ }
575
+ },
576
+ {
577
+ "name": "CompensationClaimed",
578
+ "type": {
579
+ "kind": "struct",
580
+ "fields": [
581
+ {
582
+ "name": "validator",
583
+ "type": "pubkey"
584
+ },
585
+ {
586
+ "name": "amount",
587
+ "type": "u64"
588
+ },
589
+ {
590
+ "name": "remaining_collateral",
591
+ "type": "u64"
592
+ },
593
+ {
594
+ "name": "total_withdrawn",
595
+ "type": "u64"
596
+ },
597
+ {
598
+ "name": "epoch",
599
+ "type": "u64"
600
+ },
601
+ {
602
+ "name": "timestamp",
603
+ "type": "i64"
604
+ }
605
+ ]
606
+ }
607
+ },
608
+ {
609
+ "name": "GlobalState",
610
+ "type": {
611
+ "kind": "struct",
612
+ "fields": [
613
+ {
614
+ "name": "authority",
615
+ "type": "pubkey"
616
+ },
617
+ {
618
+ "name": "reserve",
619
+ "type": "pubkey"
620
+ },
621
+ {
622
+ "name": "total_validators",
623
+ "type": "u32"
624
+ },
625
+ {
626
+ "name": "total_withdrawn",
627
+ "type": "u64"
628
+ },
629
+ {
630
+ "name": "bump",
631
+ "type": "u8"
632
+ }
633
+ ]
634
+ }
635
+ },
636
+ {
637
+ "name": "ValidatorBondAccount",
638
+ "type": {
639
+ "kind": "struct",
640
+ "fields": [
641
+ {
642
+ "name": "identity",
643
+ "type": "pubkey"
644
+ },
645
+ {
646
+ "name": "vote_account",
647
+ "type": "pubkey"
648
+ },
649
+ {
650
+ "name": "creator",
651
+ "type": "pubkey"
652
+ },
653
+ {
654
+ "name": "withdrawal_authority",
655
+ "type": {
656
+ "option": "pubkey"
657
+ }
658
+ },
659
+ {
660
+ "name": "total_withdrawn",
661
+ "type": "u64"
662
+ },
663
+ {
664
+ "name": "last_withdrawal_epoch",
665
+ "type": "u64"
666
+ },
667
+ {
668
+ "name": "is_active",
669
+ "type": "bool"
670
+ },
671
+ {
672
+ "name": "created_at",
673
+ "type": "i64"
674
+ },
675
+ {
676
+ "name": "bump",
677
+ "type": "u8"
678
+ }
679
+ ]
680
+ }
681
+ },
682
+ {
683
+ "name": "ValidatorRegistered",
684
+ "type": {
685
+ "kind": "struct",
686
+ "fields": [
687
+ {
688
+ "name": "validator",
689
+ "type": "pubkey"
690
+ },
691
+ {
692
+ "name": "vote_account",
693
+ "type": "pubkey"
694
+ },
695
+ {
696
+ "name": "collateral_amount",
697
+ "type": "u64"
698
+ },
699
+ {
700
+ "name": "timestamp",
701
+ "type": "i64"
702
+ }
703
+ ]
704
+ }
705
+ }
706
+ ]
707
+ }
package/src/index.ts ADDED
@@ -0,0 +1,8 @@
1
+ export * from './client'
2
+ export * from './common'
3
+ export * from './config'
4
+ export * from './types'
5
+
6
+ export type { Config } from './types'
7
+ // Re-export types from IDL
8
+ export type { Jbond } from './types/jbond'