@jpool/bond-sdk 0.8.0-next.3 → 0.8.0-next.4

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/index.d.mts CHANGED
@@ -9,28 +9,28 @@ import { BN, AnchorProvider, Program } from '@coral-xyz/anchor';
9
9
  * IDL can be found at `target/idl/jbond.json`.
10
10
  */
11
11
  type Jbond = {
12
- "address": "BondQ7KqZreTcW2UbeTNDcLCJQ3aXAtLn2Fm6ftaJDU";
13
- "metadata": {
14
- "name": "jbond";
15
- "version": "0.2.1";
16
- "spec": "0.1.0";
17
- "description": "Jpool Bond Program";
12
+ address: 'BondQ7KqZreTcW2UbeTNDcLCJQ3aXAtLn2Fm6ftaJDU';
13
+ metadata: {
14
+ name: 'jbond';
15
+ version: '0.2.1';
16
+ spec: '0.1.0';
17
+ description: 'Jpool Bond Program';
18
18
  };
19
- "instructions": [
19
+ instructions: [
20
20
  {
21
- "name": "claim";
22
- "docs": [
23
- "Claims compensation for a validator.",
24
- "Transfers funds from the validator's bond account to reserve.",
25
- "",
26
- "# Arguments",
27
- "* `amount` - Amount of compensation to claim (must be positive).",
28
- "",
29
- "# Errors",
30
- "Fails if the authority is invalid, if the validator is not active,",
31
- "if the amount is zero, or if there are insufficient funds."
21
+ name: 'claim';
22
+ docs: [
23
+ 'Claims compensation for a validator.',
24
+ 'Transfers funds from the validator\'s bond account to reserve.',
25
+ '',
26
+ '# Arguments',
27
+ '* `amount` - Amount of compensation to claim (must be positive).',
28
+ '',
29
+ '# Errors',
30
+ 'Fails if the authority is invalid, if the validator is not active,',
31
+ 'if the amount is zero, or if there are insufficient funds.'
32
32
  ];
33
- "discriminator": [
33
+ discriminator: [
34
34
  62,
35
35
  198,
36
36
  214,
@@ -40,15 +40,15 @@ type Jbond = {
40
40
  108,
41
41
  210
42
42
  ];
43
- "accounts": [
43
+ accounts: [
44
44
  {
45
- "name": "globalState";
46
- "writable": true;
47
- "pda": {
48
- "seeds": [
45
+ name: 'globalState';
46
+ writable: true;
47
+ pda: {
48
+ seeds: [
49
49
  {
50
- "kind": "const";
51
- "value": [
50
+ kind: 'const';
51
+ value: [
52
52
  103,
53
53
  108,
54
54
  111,
@@ -67,13 +67,13 @@ type Jbond = {
67
67
  };
68
68
  },
69
69
  {
70
- "name": "validatorBond";
71
- "writable": true;
72
- "pda": {
73
- "seeds": [
70
+ name: 'validatorBond';
71
+ writable: true;
72
+ pda: {
73
+ seeds: [
74
74
  {
75
- "kind": "const";
76
- "value": [
75
+ kind: 'const';
76
+ value: [
77
77
  118,
78
78
  97,
79
79
  108,
@@ -91,49 +91,49 @@ type Jbond = {
91
91
  ];
92
92
  },
93
93
  {
94
- "kind": "account";
95
- "path": "validator_bond.vote_account";
96
- "account": "validatorBond";
94
+ kind: 'account';
95
+ path: 'validator_bond.vote_account';
96
+ account: 'validatorBond';
97
97
  }
98
98
  ];
99
99
  };
100
100
  },
101
101
  {
102
- "name": "reserve";
103
- "writable": true;
102
+ name: 'reserve';
103
+ writable: true;
104
104
  },
105
105
  {
106
- "name": "authority";
107
- "docs": [
108
- "Authority that can trigger claims"
106
+ name: 'authority';
107
+ docs: [
108
+ 'Authority that can trigger claims'
109
109
  ];
110
- "signer": true;
110
+ signer: true;
111
111
  },
112
112
  {
113
- "name": "systemProgram";
114
- "address": "11111111111111111111111111111111";
113
+ name: 'systemProgram';
114
+ address: '11111111111111111111111111111111';
115
115
  }
116
116
  ];
117
- "args": [
117
+ args: [
118
118
  {
119
- "name": "amount";
120
- "type": "u64";
119
+ name: 'amount';
120
+ type: 'u64';
121
121
  }
122
122
  ];
123
123
  },
124
124
  {
125
- "name": "configure";
126
- "docs": [
127
- "Updates the global program configuration, including authority and reserve fields.",
128
- "Allows changing the program's authority and updating the reserve account.",
129
- "",
130
- "# Arguments",
131
- "* `data` - Configuration data containing optional new authority and reserve keys.",
132
- "",
133
- "# Errors",
134
- "Fails if the signer is not authorized to update the global configuration."
125
+ name: 'configure';
126
+ docs: [
127
+ 'Updates the global program configuration, including authority and reserve fields.',
128
+ 'Allows changing the program\'s authority and updating the reserve account.',
129
+ '',
130
+ '# Arguments',
131
+ '* `data` - Configuration data containing optional new authority and reserve keys.',
132
+ '',
133
+ '# Errors',
134
+ 'Fails if the signer is not authorized to update the global configuration.'
135
135
  ];
136
- "discriminator": [
136
+ discriminator: [
137
137
  245,
138
138
  7,
139
139
  108,
@@ -143,15 +143,15 @@ type Jbond = {
143
143
  54,
144
144
  217
145
145
  ];
146
- "accounts": [
146
+ accounts: [
147
147
  {
148
- "name": "globalState";
149
- "writable": true;
150
- "pda": {
151
- "seeds": [
148
+ name: 'globalState';
149
+ writable: true;
150
+ pda: {
151
+ seeds: [
152
152
  {
153
- "kind": "const";
154
- "value": [
153
+ kind: 'const';
154
+ value: [
155
155
  103,
156
156
  108,
157
157
  111,
@@ -170,35 +170,35 @@ type Jbond = {
170
170
  };
171
171
  },
172
172
  {
173
- "name": "authority";
174
- "signer": true;
175
- "relations": [
176
- "globalState"
173
+ name: 'authority';
174
+ signer: true;
175
+ relations: [
176
+ 'globalState'
177
177
  ];
178
178
  }
179
179
  ];
180
- "args": [
180
+ args: [
181
181
  {
182
- "name": "data";
183
- "type": {
184
- "defined": {
185
- "name": "configureData";
182
+ name: 'data';
183
+ type: {
184
+ defined: {
185
+ name: 'configureData';
186
186
  };
187
187
  };
188
188
  }
189
189
  ];
190
190
  },
191
191
  {
192
- "name": "initialize";
193
- "docs": [
194
- "Initializes the global state for the bonding program.",
195
- "Sets the authority and reserve account for managing validator bonds.",
196
- "",
197
- "# Errors",
198
- "Fails if the global state account is already initialized or if the payer lacks",
199
- "sufficient funds."
192
+ name: 'initialize';
193
+ docs: [
194
+ 'Initializes the global state for the bonding program.',
195
+ 'Sets the authority and reserve account for managing validator bonds.',
196
+ '',
197
+ '# Errors',
198
+ 'Fails if the global state account is already initialized or if the payer lacks',
199
+ 'sufficient funds.'
200
200
  ];
201
- "discriminator": [
201
+ discriminator: [
202
202
  175,
203
203
  175,
204
204
  109,
@@ -208,15 +208,15 @@ type Jbond = {
208
208
  155,
209
209
  237
210
210
  ];
211
- "accounts": [
211
+ accounts: [
212
212
  {
213
- "name": "globalState";
214
- "writable": true;
215
- "pda": {
216
- "seeds": [
213
+ name: 'globalState';
214
+ writable: true;
215
+ pda: {
216
+ seeds: [
217
217
  {
218
- "kind": "const";
219
- "value": [
218
+ kind: 'const';
219
+ value: [
220
220
  103,
221
221
  108,
222
222
  111,
@@ -235,35 +235,35 @@ type Jbond = {
235
235
  };
236
236
  },
237
237
  {
238
- "name": "authority";
239
- "writable": true;
240
- "signer": true;
238
+ name: 'authority';
239
+ writable: true;
240
+ signer: true;
241
241
  },
242
242
  {
243
- "name": "reserve";
243
+ name: 'reserve';
244
244
  },
245
245
  {
246
- "name": "systemProgram";
247
- "address": "11111111111111111111111111111111";
246
+ name: 'systemProgram';
247
+ address: '11111111111111111111111111111111';
248
248
  }
249
249
  ];
250
- "args": [];
250
+ args: [];
251
251
  },
252
252
  {
253
- "name": "register";
254
- "docs": [
255
- "Registers a new validator with the bonding program.",
256
- "Sets up the validator's bond account and deposits initial collateral.",
257
- "",
258
- "# Arguments",
259
- "* `initial_collateral` - Amount of collateral to lock (must be positive).",
260
- "* `withdrawal_authority` - Optional key that can withdraw collateral later.",
261
- "",
262
- "# Errors",
263
- "Fails if the validator is already registered, if the vote account is invalid,",
264
- "or if the initial collateral transfer fails."
253
+ name: 'register';
254
+ docs: [
255
+ 'Registers a new validator with the bonding program.',
256
+ 'Sets up the validator\'s bond account and deposits initial collateral.',
257
+ '',
258
+ '# Arguments',
259
+ '* `initial_collateral` - Amount of collateral to lock (must be positive).',
260
+ '* `withdrawal_authority` - Optional key that can withdraw collateral later.',
261
+ '',
262
+ '# Errors',
263
+ 'Fails if the validator is already registered, if the vote account is invalid,',
264
+ 'or if the initial collateral transfer fails.'
265
265
  ];
266
- "discriminator": [
266
+ discriminator: [
267
267
  211,
268
268
  124,
269
269
  67,
@@ -273,15 +273,15 @@ type Jbond = {
273
273
  178,
274
274
  240
275
275
  ];
276
- "accounts": [
276
+ accounts: [
277
277
  {
278
- "name": "globalState";
279
- "writable": true;
280
- "pda": {
281
- "seeds": [
278
+ name: 'globalState';
279
+ writable: true;
280
+ pda: {
281
+ seeds: [
282
282
  {
283
- "kind": "const";
284
- "value": [
283
+ kind: 'const';
284
+ value: [
285
285
  103,
286
286
  108,
287
287
  111,
@@ -300,13 +300,13 @@ type Jbond = {
300
300
  };
301
301
  },
302
302
  {
303
- "name": "validatorBond";
304
- "writable": true;
305
- "pda": {
306
- "seeds": [
303
+ name: 'validatorBond';
304
+ writable: true;
305
+ pda: {
306
+ seeds: [
307
307
  {
308
- "kind": "const";
309
- "value": [
308
+ kind: 'const';
309
+ value: [
310
310
  118,
311
311
  97,
312
312
  108,
@@ -324,52 +324,52 @@ type Jbond = {
324
324
  ];
325
325
  },
326
326
  {
327
- "kind": "account";
328
- "path": "voteAccount";
327
+ kind: 'account';
328
+ path: 'voteAccount';
329
329
  }
330
330
  ];
331
331
  };
332
332
  },
333
333
  {
334
- "name": "identity";
334
+ name: 'identity';
335
335
  },
336
336
  {
337
- "name": "voteAccount";
337
+ name: 'voteAccount';
338
338
  },
339
339
  {
340
- "name": "creator";
341
- "docs": [
342
- "The account creating the bond (pays for account creation and initial collateral)"
340
+ name: 'creator';
341
+ docs: [
342
+ 'The account creating the bond (pays for account creation and initial collateral)'
343
343
  ];
344
- "writable": true;
345
- "signer": true;
344
+ writable: true;
345
+ signer: true;
346
346
  },
347
347
  {
348
- "name": "systemProgram";
349
- "address": "11111111111111111111111111111111";
348
+ name: 'systemProgram';
349
+ address: '11111111111111111111111111111111';
350
350
  }
351
351
  ];
352
- "args": [
352
+ args: [
353
353
  {
354
- "name": "initialCollateral";
355
- "type": "u64";
354
+ name: 'initialCollateral';
355
+ type: 'u64';
356
356
  }
357
357
  ];
358
358
  },
359
359
  {
360
- "name": "setWithdrawAuthority";
361
- "docs": [
362
- "Sets a new withdrawal authority for a validator's bond account.",
363
- "Allows changing who can withdraw collateral in the future.",
364
- "",
365
- "# Arguments",
366
- "* `new_withdraw_authority` - Optional new withdrawal authority key (None to restrict to",
367
- "identity).",
368
- "",
369
- "# Errors",
370
- "Fails if the signer is not authorized to change the withdrawal authority."
360
+ name: 'setWithdrawAuthority';
361
+ docs: [
362
+ 'Sets a new withdrawal authority for a validator\'s bond account.',
363
+ 'Allows changing who can withdraw collateral in the future.',
364
+ '',
365
+ '# Arguments',
366
+ '* `new_withdraw_authority` - Optional new withdrawal authority key (None to restrict to',
367
+ 'identity).',
368
+ '',
369
+ '# Errors',
370
+ 'Fails if the signer is not authorized to change the withdrawal authority.'
371
371
  ];
372
- "discriminator": [
372
+ discriminator: [
373
373
  199,
374
374
  146,
375
375
  140,
@@ -379,15 +379,15 @@ type Jbond = {
379
379
  8,
380
380
  222
381
381
  ];
382
- "accounts": [
382
+ accounts: [
383
383
  {
384
- "name": "validatorBond";
385
- "writable": true;
386
- "pda": {
387
- "seeds": [
384
+ name: 'validatorBond';
385
+ writable: true;
386
+ pda: {
387
+ seeds: [
388
388
  {
389
- "kind": "const";
390
- "value": [
389
+ kind: 'const';
390
+ value: [
391
391
  118,
392
392
  97,
393
393
  108,
@@ -405,38 +405,38 @@ type Jbond = {
405
405
  ];
406
406
  },
407
407
  {
408
- "kind": "account";
409
- "path": "validator_bond.vote_account";
410
- "account": "validatorBond";
408
+ kind: 'account';
409
+ path: 'validator_bond.vote_account';
410
+ account: 'validatorBond';
411
411
  }
412
412
  ];
413
413
  };
414
414
  },
415
415
  {
416
- "name": "identity";
417
- "signer": true;
416
+ name: 'identity';
417
+ signer: true;
418
418
  },
419
419
  {
420
- "name": "newWithdrawAuthority";
421
- "optional": true;
420
+ name: 'newWithdrawAuthority';
421
+ optional: true;
422
422
  }
423
423
  ];
424
- "args": [];
424
+ args: [];
425
425
  },
426
426
  {
427
- "name": "topUp";
428
- "docs": [
429
- "Adds additional collateral to an existing validator's bond.",
430
- "Increases the collateral balance, enhancing the validator's stake.",
431
- "",
432
- "# Arguments",
433
- "* `amount` - Amount to add.",
434
- "",
435
- "# Errors",
436
- "Fails if the validator is not active, if the amount is zero,",
437
- "or if the transfer of funds fails."
427
+ name: 'topUp';
428
+ docs: [
429
+ 'Adds additional collateral to an existing validator\'s bond.',
430
+ 'Increases the collateral balance, enhancing the validator\'s stake.',
431
+ '',
432
+ '# Arguments',
433
+ '* `amount` - Amount to add.',
434
+ '',
435
+ '# Errors',
436
+ 'Fails if the validator is not active, if the amount is zero,',
437
+ 'or if the transfer of funds fails.'
438
438
  ];
439
- "discriminator": [
439
+ discriminator: [
440
440
  236,
441
441
  225,
442
442
  96,
@@ -446,15 +446,15 @@ type Jbond = {
446
446
  77,
447
447
  208
448
448
  ];
449
- "accounts": [
449
+ accounts: [
450
450
  {
451
- "name": "validatorBond";
452
- "writable": true;
453
- "pda": {
454
- "seeds": [
451
+ name: 'validatorBond';
452
+ writable: true;
453
+ pda: {
454
+ seeds: [
455
455
  {
456
- "kind": "const";
457
- "value": [
456
+ kind: 'const';
457
+ value: [
458
458
  118,
459
459
  97,
460
460
  108,
@@ -472,45 +472,45 @@ type Jbond = {
472
472
  ];
473
473
  },
474
474
  {
475
- "kind": "account";
476
- "path": "validator_bond.vote_account";
477
- "account": "validatorBond";
475
+ kind: 'account';
476
+ path: 'validator_bond.vote_account';
477
+ account: 'validatorBond';
478
478
  }
479
479
  ];
480
480
  };
481
481
  },
482
482
  {
483
- "name": "payer";
484
- "writable": true;
485
- "signer": true;
483
+ name: 'payer';
484
+ writable: true;
485
+ signer: true;
486
486
  },
487
487
  {
488
- "name": "systemProgram";
489
- "address": "11111111111111111111111111111111";
488
+ name: 'systemProgram';
489
+ address: '11111111111111111111111111111111';
490
490
  }
491
491
  ];
492
- "args": [
492
+ args: [
493
493
  {
494
- "name": "amount";
495
- "type": "u64";
494
+ name: 'amount';
495
+ type: 'u64';
496
496
  }
497
497
  ];
498
498
  },
499
499
  {
500
- "name": "withdraw";
501
- "docs": [
502
- "Withdraws collateral from a validator's bond.",
503
- "Decreases the collateral balance, allowing the validator to reclaim funds.",
504
- "",
505
- "# Arguments",
506
- "* `amount` - Amount to withdraw (must not exceed available balance).",
507
- "",
508
- "# Errors",
509
- "Fails if the validator is not active, if the amount is zero,",
510
- "if the withdrawal authority is invalid, or if the withdrawal would",
511
- "leave insufficient collateral."
500
+ name: 'withdraw';
501
+ docs: [
502
+ 'Withdraws collateral from a validator\'s bond.',
503
+ 'Decreases the collateral balance, allowing the validator to reclaim funds.',
504
+ '',
505
+ '# Arguments',
506
+ '* `amount` - Amount to withdraw (must not exceed available balance).',
507
+ '',
508
+ '# Errors',
509
+ 'Fails if the validator is not active, if the amount is zero,',
510
+ 'if the withdrawal authority is invalid, or if the withdrawal would',
511
+ 'leave insufficient collateral.'
512
512
  ];
513
- "discriminator": [
513
+ discriminator: [
514
514
  183,
515
515
  18,
516
516
  70,
@@ -520,15 +520,15 @@ type Jbond = {
520
520
  161,
521
521
  34
522
522
  ];
523
- "accounts": [
523
+ accounts: [
524
524
  {
525
- "name": "validatorBond";
526
- "writable": true;
527
- "pda": {
528
- "seeds": [
525
+ name: 'validatorBond';
526
+ writable: true;
527
+ pda: {
528
+ seeds: [
529
529
  {
530
- "kind": "const";
531
- "value": [
530
+ kind: 'const';
531
+ value: [
532
532
  118,
533
533
  97,
534
534
  108,
@@ -546,43 +546,43 @@ type Jbond = {
546
546
  ];
547
547
  },
548
548
  {
549
- "kind": "account";
550
- "path": "validator_bond.vote_account";
551
- "account": "validatorBond";
549
+ kind: 'account';
550
+ path: 'validator_bond.vote_account';
551
+ account: 'validatorBond';
552
552
  }
553
553
  ];
554
554
  };
555
555
  },
556
556
  {
557
- "name": "withdrawalAuthority";
558
- "writable": true;
559
- "signer": true;
557
+ name: 'withdrawalAuthority';
558
+ writable: true;
559
+ signer: true;
560
560
  },
561
561
  {
562
- "name": "destination";
563
- "writable": true;
562
+ name: 'destination';
563
+ writable: true;
564
564
  },
565
565
  {
566
- "name": "epochSchedule";
567
- "address": "SysvarEpochSchedu1e111111111111111111111111";
566
+ name: 'epochSchedule';
567
+ address: 'SysvarEpochSchedu1e111111111111111111111111';
568
568
  },
569
569
  {
570
- "name": "systemProgram";
571
- "address": "11111111111111111111111111111111";
570
+ name: 'systemProgram';
571
+ address: '11111111111111111111111111111111';
572
572
  }
573
573
  ];
574
- "args": [
574
+ args: [
575
575
  {
576
- "name": "amount";
577
- "type": "u64";
576
+ name: 'amount';
577
+ type: 'u64';
578
578
  }
579
579
  ];
580
580
  }
581
581
  ];
582
- "accounts": [
582
+ accounts: [
583
583
  {
584
- "name": "globalState";
585
- "discriminator": [
584
+ name: 'globalState';
585
+ discriminator: [
586
586
  163,
587
587
  46,
588
588
  74,
@@ -594,8 +594,8 @@ type Jbond = {
594
594
  ];
595
595
  },
596
596
  {
597
- "name": "validatorBond";
598
- "discriminator": [
597
+ name: 'validatorBond';
598
+ discriminator: [
599
599
  82,
600
600
  127,
601
601
  243,
@@ -607,10 +607,10 @@ type Jbond = {
607
607
  ];
608
608
  }
609
609
  ];
610
- "events": [
610
+ events: [
611
611
  {
612
- "name": "collateralToppedUp";
613
- "discriminator": [
612
+ name: 'collateralToppedUp';
613
+ discriminator: [
614
614
  189,
615
615
  137,
616
616
  204,
@@ -622,8 +622,8 @@ type Jbond = {
622
622
  ];
623
623
  },
624
624
  {
625
- "name": "collateralWithdrawn";
626
- "discriminator": [
625
+ name: 'collateralWithdrawn';
626
+ discriminator: [
627
627
  51,
628
628
  224,
629
629
  133,
@@ -635,8 +635,8 @@ type Jbond = {
635
635
  ];
636
636
  },
637
637
  {
638
- "name": "compensationClaimed";
639
- "discriminator": [
638
+ name: 'compensationClaimed';
639
+ discriminator: [
640
640
  36,
641
641
  159,
642
642
  41,
@@ -648,8 +648,8 @@ type Jbond = {
648
648
  ];
649
649
  },
650
650
  {
651
- "name": "validatorRegistered";
652
- "discriminator": [
651
+ name: 'validatorRegistered';
652
+ discriminator: [
653
653
  20,
654
654
  20,
655
655
  190,
@@ -661,298 +661,298 @@ type Jbond = {
661
661
  ];
662
662
  }
663
663
  ];
664
- "errors": [
664
+ errors: [
665
665
  {
666
- "code": 6000;
667
- "name": "invalidVoteAccount";
668
- "msg": "Invalid vote account";
666
+ code: 6000;
667
+ name: 'invalidVoteAccount';
668
+ msg: 'Invalid vote account';
669
669
  },
670
670
  {
671
- "code": 6001;
672
- "name": "identityMismatch";
673
- "msg": "Identity does not match vote account";
671
+ code: 6001;
672
+ name: 'identityMismatch';
673
+ msg: 'Identity does not match vote account';
674
674
  },
675
675
  {
676
- "code": 6002;
677
- "name": "insufficientCollateral";
678
- "msg": "Insufficient collateral amount";
676
+ code: 6002;
677
+ name: 'insufficientCollateral';
678
+ msg: 'Insufficient collateral amount';
679
679
  },
680
680
  {
681
- "code": 6003;
682
- "name": "targetAprTooLow";
683
- "msg": "Target APR is below minimum threshold";
681
+ code: 6003;
682
+ name: 'targetAprTooLow';
683
+ msg: 'Target APR is below minimum threshold';
684
684
  },
685
685
  {
686
- "code": 6004;
687
- "name": "mathOverflow";
688
- "msg": "Math overflow";
686
+ code: 6004;
687
+ name: 'mathOverflow';
688
+ msg: 'Math overflow';
689
689
  },
690
690
  {
691
- "code": 6005;
692
- "name": "invalidAmount";
693
- "msg": "Invalid amount";
691
+ code: 6005;
692
+ name: 'invalidAmount';
693
+ msg: 'Invalid amount';
694
694
  },
695
695
  {
696
- "code": 6006;
697
- "name": "validatorNotActive";
698
- "msg": "Validator bond account is not active";
696
+ code: 6006;
697
+ name: 'validatorNotActive';
698
+ msg: 'Validator bond account is not active';
699
699
  },
700
700
  {
701
- "code": 6007;
702
- "name": "validatorAlreadyRegistered";
703
- "msg": "Validator already registered";
701
+ code: 6007;
702
+ name: 'validatorAlreadyRegistered';
703
+ msg: 'Validator already registered';
704
704
  },
705
705
  {
706
- "code": 6008;
707
- "name": "unauthorized";
708
- "msg": "unauthorized";
706
+ code: 6008;
707
+ name: 'unauthorized';
708
+ msg: 'unauthorized';
709
709
  },
710
710
  {
711
- "code": 6009;
712
- "name": "withdrawalLockedNearEpochEnd";
713
- "msg": "Withdrawals are locked near the end of the epoch.";
711
+ code: 6009;
712
+ name: 'withdrawalLockedNearEpochEnd';
713
+ msg: 'Withdrawals are locked near the end of the epoch.';
714
714
  }
715
715
  ];
716
- "types": [
716
+ types: [
717
717
  {
718
- "name": "collateralToppedUp";
719
- "type": {
720
- "kind": "struct";
721
- "fields": [
718
+ name: 'collateralToppedUp';
719
+ type: {
720
+ kind: 'struct';
721
+ fields: [
722
722
  {
723
- "name": "validator";
724
- "type": "pubkey";
723
+ name: 'validator';
724
+ type: 'pubkey';
725
725
  },
726
726
  {
727
- "name": "amount";
728
- "type": "u64";
727
+ name: 'amount';
728
+ type: 'u64';
729
729
  },
730
730
  {
731
- "name": "postBalance";
732
- "type": "u64";
731
+ name: 'postBalance';
732
+ type: 'u64';
733
733
  },
734
734
  {
735
- "name": "timestamp";
736
- "type": "i64";
735
+ name: 'timestamp';
736
+ type: 'i64';
737
737
  }
738
738
  ];
739
739
  };
740
740
  },
741
741
  {
742
- "name": "collateralWithdrawn";
743
- "type": {
744
- "kind": "struct";
745
- "fields": [
742
+ name: 'collateralWithdrawn';
743
+ type: {
744
+ kind: 'struct';
745
+ fields: [
746
746
  {
747
- "name": "validator";
748
- "type": "pubkey";
747
+ name: 'validator';
748
+ type: 'pubkey';
749
749
  },
750
750
  {
751
- "name": "amount";
752
- "type": "u64";
751
+ name: 'amount';
752
+ type: 'u64';
753
753
  },
754
754
  {
755
- "name": "postBalance";
756
- "type": "u64";
755
+ name: 'postBalance';
756
+ type: 'u64';
757
757
  },
758
758
  {
759
- "name": "timestamp";
760
- "type": "i64";
759
+ name: 'timestamp';
760
+ type: 'i64';
761
761
  }
762
762
  ];
763
763
  };
764
764
  },
765
765
  {
766
- "name": "compensationClaimed";
767
- "type": {
768
- "kind": "struct";
769
- "fields": [
766
+ name: 'compensationClaimed';
767
+ type: {
768
+ kind: 'struct';
769
+ fields: [
770
770
  {
771
- "name": "validator";
772
- "type": "pubkey";
771
+ name: 'validator';
772
+ type: 'pubkey';
773
773
  },
774
774
  {
775
- "name": "amount";
776
- "type": "u64";
775
+ name: 'amount';
776
+ type: 'u64';
777
777
  },
778
778
  {
779
- "name": "postBalance";
780
- "type": "u64";
779
+ name: 'postBalance';
780
+ type: 'u64';
781
781
  },
782
782
  {
783
- "name": "epoch";
784
- "type": "u64";
783
+ name: 'epoch';
784
+ type: 'u64';
785
785
  },
786
786
  {
787
- "name": "timestamp";
788
- "type": "i64";
787
+ name: 'timestamp';
788
+ type: 'i64';
789
789
  }
790
790
  ];
791
791
  };
792
792
  },
793
793
  {
794
- "name": "configureData";
795
- "type": {
796
- "kind": "struct";
797
- "fields": [
794
+ name: 'configureData';
795
+ type: {
796
+ kind: 'struct';
797
+ fields: [
798
798
  {
799
- "name": "newAuthority";
800
- "type": {
801
- "option": "pubkey";
799
+ name: 'newAuthority';
800
+ type: {
801
+ option: 'pubkey';
802
802
  };
803
803
  },
804
804
  {
805
- "name": "newReserve";
806
- "type": {
807
- "option": "pubkey";
805
+ name: 'newReserve';
806
+ type: {
807
+ option: 'pubkey';
808
808
  };
809
809
  }
810
810
  ];
811
811
  };
812
812
  },
813
813
  {
814
- "name": "globalState";
815
- "type": {
816
- "kind": "struct";
817
- "fields": [
814
+ name: 'globalState';
815
+ type: {
816
+ kind: 'struct';
817
+ fields: [
818
818
  {
819
- "name": "authority";
820
- "docs": [
821
- "The authority allowed to manage the program"
819
+ name: 'authority';
820
+ docs: [
821
+ 'The authority allowed to manage the program'
822
822
  ];
823
- "type": "pubkey";
823
+ type: 'pubkey';
824
824
  },
825
825
  {
826
- "name": "reserve";
827
- "docs": [
828
- "The reserve vault holding SOL for bonding and compensation"
826
+ name: 'reserve';
827
+ docs: [
828
+ 'The reserve vault holding SOL for bonding and compensation'
829
829
  ];
830
- "type": "pubkey";
830
+ type: 'pubkey';
831
831
  },
832
832
  {
833
- "name": "totalValidators";
834
- "docs": [
835
- "Total number of registered validators"
833
+ name: 'totalValidators';
834
+ docs: [
835
+ 'Total number of registered validators'
836
836
  ];
837
- "type": "u16";
837
+ type: 'u16';
838
838
  },
839
839
  {
840
- "name": "totalCompensationAmount";
841
- "docs": [
842
- "Total compensation amount paid out"
840
+ name: 'totalCompensationAmount';
841
+ docs: [
842
+ 'Total compensation amount paid out'
843
843
  ];
844
- "type": "u64";
844
+ type: 'u64';
845
845
  },
846
846
  {
847
- "name": "bump";
848
- "docs": [
849
- "Bump for the PDA"
847
+ name: 'bump';
848
+ docs: [
849
+ 'Bump for the PDA'
850
850
  ];
851
- "type": "u8";
851
+ type: 'u8';
852
852
  }
853
853
  ];
854
854
  };
855
855
  },
856
856
  {
857
- "name": "validatorBond";
858
- "type": {
859
- "kind": "struct";
860
- "fields": [
857
+ name: 'validatorBond';
858
+ type: {
859
+ kind: 'struct';
860
+ fields: [
861
861
  {
862
- "name": "identity";
863
- "docs": [
864
- "The validator identity pubkey"
862
+ name: 'identity';
863
+ docs: [
864
+ 'The validator identity pubkey'
865
865
  ];
866
- "type": "pubkey";
866
+ type: 'pubkey';
867
867
  },
868
868
  {
869
- "name": "voteAccount";
870
- "docs": [
871
- "The validator vote account pubkey"
869
+ name: 'voteAccount';
870
+ docs: [
871
+ 'The validator vote account pubkey'
872
872
  ];
873
- "type": "pubkey";
873
+ type: 'pubkey';
874
874
  },
875
875
  {
876
- "name": "creator";
877
- "docs": [
878
- "Creator of the validator bond account"
876
+ name: 'creator';
877
+ docs: [
878
+ 'Creator of the validator bond account'
879
879
  ];
880
- "type": "pubkey";
880
+ type: 'pubkey';
881
881
  },
882
882
  {
883
- "name": "withdrawalAuthority";
884
- "docs": [
885
- "Authority allowed to withdraw funds (if None, only identity can withdraw)"
883
+ name: 'withdrawalAuthority';
884
+ docs: [
885
+ 'Authority allowed to withdraw funds (if None, only identity can withdraw)'
886
886
  ];
887
- "type": {
888
- "option": "pubkey";
887
+ type: {
888
+ option: 'pubkey';
889
889
  };
890
890
  },
891
891
  {
892
- "name": "totalCompensationAmount";
893
- "docs": [
894
- "Total compensation claimed for the validator"
892
+ name: 'totalCompensationAmount';
893
+ docs: [
894
+ 'Total compensation claimed for the validator'
895
895
  ];
896
- "type": "u64";
896
+ type: 'u64';
897
897
  },
898
898
  {
899
- "name": "lastCompensationAmount";
900
- "docs": [
901
- "Last compensation amount claimed"
899
+ name: 'lastCompensationAmount';
900
+ docs: [
901
+ 'Last compensation amount claimed'
902
902
  ];
903
- "type": "u64";
903
+ type: 'u64';
904
904
  },
905
905
  {
906
- "name": "lastCompensationEpoch";
907
- "docs": [
908
- "Last epoch when compensation was claimed"
906
+ name: 'lastCompensationEpoch';
907
+ docs: [
908
+ 'Last epoch when compensation was claimed'
909
909
  ];
910
- "type": "u64";
910
+ type: 'u64';
911
911
  },
912
912
  {
913
- "name": "createdAt";
914
- "docs": [
915
- "Timestamp when the bond account was created"
913
+ name: 'createdAt';
914
+ docs: [
915
+ 'Timestamp when the bond account was created'
916
916
  ];
917
- "type": "i64";
917
+ type: 'i64';
918
918
  },
919
919
  {
920
- "name": "isActive";
921
- "docs": [
922
- "Whether the validator is currently active"
920
+ name: 'isActive';
921
+ docs: [
922
+ 'Whether the validator is currently active'
923
923
  ];
924
- "type": "bool";
924
+ type: 'bool';
925
925
  },
926
926
  {
927
- "name": "bump";
928
- "docs": [
929
- "Bump for the PDA"
927
+ name: 'bump';
928
+ docs: [
929
+ 'Bump for the PDA'
930
930
  ];
931
- "type": "u8";
931
+ type: 'u8';
932
932
  }
933
933
  ];
934
934
  };
935
935
  },
936
936
  {
937
- "name": "validatorRegistered";
938
- "type": {
939
- "kind": "struct";
940
- "fields": [
937
+ name: 'validatorRegistered';
938
+ type: {
939
+ kind: 'struct';
940
+ fields: [
941
941
  {
942
- "name": "identity";
943
- "type": "pubkey";
942
+ name: 'identity';
943
+ type: 'pubkey';
944
944
  },
945
945
  {
946
- "name": "voteAccount";
947
- "type": "pubkey";
946
+ name: 'voteAccount';
947
+ type: 'pubkey';
948
948
  },
949
949
  {
950
- "name": "initialCollateral";
951
- "type": "u64";
950
+ name: 'initialCollateral';
951
+ type: 'u64';
952
952
  },
953
953
  {
954
- "name": "timestamp";
955
- "type": "i64";
954
+ name: 'timestamp';
955
+ type: 'i64';
956
956
  }
957
957
  ];
958
958
  };
@@ -960,14 +960,23 @@ type Jbond = {
960
960
  ];
961
961
  };
962
962
 
963
+ type GlobalState = {
964
+ authority: PublicKey;
965
+ reserve: PublicKey;
966
+ totalValidators: number;
967
+ totalCompensationAmount: BN;
968
+ bump: number;
969
+ };
963
970
  type ValidatorBond = {
964
971
  identity: PublicKey;
965
972
  voteAccount: PublicKey;
966
- withdrawalAuthority?: string;
967
- totalWithdrawn: number;
968
- lastWithdrawalEpoch: number;
973
+ creator: PublicKey;
974
+ withdrawalAuthority: PublicKey | null;
975
+ totalCompensationAmount: BN;
976
+ lastCompensationAmount: BN;
977
+ lastCompensationEpoch: BN;
969
978
  isActive: boolean;
970
- createdAt: number;
979
+ createdAt: BN;
971
980
  bump: number;
972
981
  };
973
982
  type InitializeProps = {
@@ -1019,13 +1028,6 @@ type SetWithdrawAuthorityProps = {
1019
1028
  newWithdrawAuthority?: PublicKey | null;
1020
1029
  identity?: PublicKey;
1021
1030
  };
1022
- type GlobalState = {
1023
- authority: PublicKey;
1024
- totalValidators: number;
1025
- totalCollateral: BN;
1026
- totalWithdrawn: BN;
1027
- bump: number;
1028
- };
1029
1031
  type EpochHistoryItem = {
1030
1032
  epoch: number;
1031
1033
  deposits: number;
@@ -1186,29 +1188,12 @@ declare class JBondClient {
1186
1188
  /**
1187
1189
  * Fetch global state or throw if not found
1188
1190
  */
1189
- getGlobalState(): Promise<{
1190
- authority: PublicKey;
1191
- reserve: PublicKey;
1192
- totalValidators: number;
1193
- totalCompensationAmount: BN;
1194
- bump: number;
1195
- }>;
1191
+ getGlobalState(): Promise<GlobalState>;
1196
1192
  /**
1197
1193
  * Fetch validator bond data or null if not found
1198
1194
  * @param vote
1199
1195
  */
1200
- getValidatorBond(vote: PublicKeyInitData): Promise<{
1201
- identity: PublicKey;
1202
- voteAccount: PublicKey;
1203
- creator: PublicKey;
1204
- withdrawalAuthority: PublicKey | null;
1205
- totalCompensationAmount: BN;
1206
- lastCompensationAmount: BN;
1207
- lastCompensationEpoch: BN;
1208
- createdAt: BN;
1209
- isActive: boolean;
1210
- bump: number;
1211
- } | null>;
1196
+ getValidatorBond(vote: PublicKeyInitData): Promise<ValidatorBond | null>;
1212
1197
  /**
1213
1198
  * Get validator bond account balance (in SOL)
1214
1199
  * @param vote - Vote account public key