@jpool/bond-sdk 0.10.6 → 0.11.0-next.12

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
@@ -11,28 +11,28 @@ import { PublicKey, PublicKeyInitData, Cluster, Transaction, VersionedTransactio
11
11
  * IDL can be found at `target/idl/jbond.json`.
12
12
  */
13
13
  type Jbond = {
14
- address: 'BondQ7KqZreTcW2UbeTNDcLCJQ3aXAtLn2Fm6ftaJDU';
15
- metadata: {
16
- name: 'jbond';
17
- version: '0.2.1';
18
- spec: '0.1.0';
19
- description: 'Jpool Bond Program';
14
+ "address": "Fo17edWRJewZNTRibgx9iTfjywCW6dzS81VwBLmPFVq1";
15
+ "metadata": {
16
+ "name": "jbond";
17
+ "version": "0.2.1";
18
+ "spec": "0.1.0";
19
+ "description": "Jpool Bond Program";
20
20
  };
21
- instructions: [
22
- {
23
- name: 'bondClaim';
24
- docs: [
25
- 'Claims compensation for a validator.',
26
- 'Transfers funds from the validator\'s bond account to reserve.',
27
- '',
28
- '# Arguments',
29
- '* `amount` - Amount of compensation to claim (must be positive).',
30
- '',
31
- '# Errors',
32
- 'Fails if the authority is invalid, if the validator is not active,',
33
- 'if the amount is zero, or if there are insufficient funds.'
34
- ];
35
- discriminator: [
21
+ "instructions": [
22
+ {
23
+ "name": "bondClaim";
24
+ "docs": [
25
+ "Claims compensation for a validator.",
26
+ "Transfers funds from the validator's bond account to reserve.",
27
+ "",
28
+ "# Arguments",
29
+ "* `amount` - Amount of compensation to claim (must be positive).",
30
+ "",
31
+ "# Errors",
32
+ "Fails if the authority is invalid, if the validator is not active,",
33
+ "if the amount is zero, or if there are insufficient funds."
34
+ ];
35
+ "discriminator": [
36
36
  151,
37
37
  92,
38
38
  10,
@@ -42,19 +42,19 @@ type Jbond = {
42
42
  188,
43
43
  129
44
44
  ];
45
- accounts: [
45
+ "accounts": [
46
46
  {
47
- name: 'bondState';
48
- writable: true;
47
+ "name": "bondState";
48
+ "writable": true;
49
49
  },
50
50
  {
51
- name: 'validatorBond';
52
- writable: true;
53
- pda: {
54
- seeds: [
51
+ "name": "validatorBond";
52
+ "writable": true;
53
+ "pda": {
54
+ "seeds": [
55
55
  {
56
- kind: 'const';
57
- value: [
56
+ "kind": "const";
57
+ "value": [
58
58
  118,
59
59
  97,
60
60
  108,
@@ -72,68 +72,68 @@ type Jbond = {
72
72
  ];
73
73
  },
74
74
  {
75
- kind: 'account';
76
- path: 'bondState';
75
+ "kind": "account";
76
+ "path": "bondState";
77
77
  },
78
78
  {
79
- kind: 'account';
80
- path: 'validator_bond.vote_account';
81
- account: 'validatorBond';
79
+ "kind": "account";
80
+ "path": "validator_bond.vote_account";
81
+ "account": "validatorBond";
82
82
  }
83
83
  ];
84
84
  };
85
85
  },
86
86
  {
87
- name: 'reserve';
88
- writable: true;
87
+ "name": "reserve";
88
+ "writable": true;
89
89
  },
90
90
  {
91
- name: 'authority';
92
- signer: true;
91
+ "name": "authority";
92
+ "signer": true;
93
93
  },
94
94
  {
95
- name: 'bondTokenAccount';
96
- writable: true;
97
- optional: true;
95
+ "name": "bondTokenAccount";
96
+ "writable": true;
97
+ "optional": true;
98
98
  },
99
99
  {
100
- name: 'reserveTokenAccount';
101
- writable: true;
102
- optional: true;
100
+ "name": "reserveTokenAccount";
101
+ "writable": true;
102
+ "optional": true;
103
103
  },
104
104
  {
105
- name: 'stakeAccount';
106
- writable: true;
107
- optional: true;
105
+ "name": "stakeAccount";
106
+ "writable": true;
107
+ "optional": true;
108
108
  },
109
109
  {
110
- name: 'systemProgram';
111
- address: '11111111111111111111111111111111';
110
+ "name": "systemProgram";
111
+ "address": "11111111111111111111111111111111";
112
112
  },
113
113
  {
114
- name: 'tokenProgram';
115
- optional: true;
116
- address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
114
+ "name": "tokenProgram";
115
+ "optional": true;
116
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
117
117
  },
118
118
  {
119
- name: 'stakeProgram';
120
- optional: true;
119
+ "name": "stakeProgram";
120
+ "optional": true;
121
121
  }
122
122
  ];
123
- args: [
123
+ "args": [
124
124
  {
125
- name: 'amount';
126
- type: 'u64';
125
+ "name": "amount";
126
+ "type": "u64";
127
127
  }
128
128
  ];
129
129
  },
130
130
  {
131
- name: 'bondConfigure';
132
- docs: [
133
- 'Updates bond configuration, including authority and reserve fields.',
134
- 'Allows changing the bond\'s authority and updating the reserve account.'
131
+ "name": "bondConfigure";
132
+ "docs": [
133
+ "Updates bond configuration, including authority and reserve fields.",
134
+ "Allows changing the bond's authority and updating the reserve account."
135
135
  ];
136
- discriminator: [
136
+ "discriminator": [
137
137
  61,
138
138
  42,
139
139
  106,
@@ -143,41 +143,41 @@ type Jbond = {
143
143
  65,
144
144
  20
145
145
  ];
146
- accounts: [
146
+ "accounts": [
147
147
  {
148
- name: 'bondState';
149
- writable: true;
148
+ "name": "bondState";
149
+ "writable": true;
150
150
  },
151
151
  {
152
- name: 'authority';
153
- signer: true;
154
- relations: [
155
- 'bondState'
152
+ "name": "authority";
153
+ "signer": true;
154
+ "relations": [
155
+ "bondState"
156
156
  ];
157
157
  }
158
158
  ];
159
- args: [
159
+ "args": [
160
160
  {
161
- name: 'data';
162
- type: {
163
- defined: {
164
- name: 'bondConfigureData';
161
+ "name": "data";
162
+ "type": {
163
+ "defined": {
164
+ "name": "bondConfigureData";
165
165
  };
166
166
  };
167
167
  }
168
168
  ];
169
169
  },
170
170
  {
171
- name: 'bondInitialize';
172
- docs: [
173
- 'Initializes state for the bond.',
174
- 'Sets the authority and reserve account for managing validator bonds.',
175
- '',
176
- '# Errors',
177
- 'Fails if the global state account is already initialized or if the payer lacks',
178
- 'sufficient funds.'
171
+ "name": "bondInitialize";
172
+ "docs": [
173
+ "Initializes state for the bond.",
174
+ "Sets the authority and reserve account for managing validator bonds.",
175
+ "",
176
+ "# Errors",
177
+ "Fails if the global state account is already initialized or if the payer lacks",
178
+ "sufficient funds."
179
179
  ];
180
- discriminator: [
180
+ "discriminator": [
181
181
  230,
182
182
  3,
183
183
  121,
@@ -187,15 +187,15 @@ type Jbond = {
187
187
  175,
188
188
  210
189
189
  ];
190
- accounts: [
190
+ "accounts": [
191
191
  {
192
- name: 'bondState';
193
- writable: true;
194
- pda: {
195
- seeds: [
192
+ "name": "bondState";
193
+ "writable": true;
194
+ "pda": {
195
+ "seeds": [
196
196
  {
197
- kind: 'const';
198
- value: [
197
+ "kind": "const";
198
+ "value": [
199
199
  98,
200
200
  111,
201
201
  110,
@@ -209,72 +209,116 @@ type Jbond = {
209
209
  ];
210
210
  },
211
211
  {
212
- kind: 'arg';
213
- path: 'data.bond_type';
212
+ "kind": "arg";
213
+ "path": "data.bond_type";
214
214
  },
215
215
  {
216
- kind: 'arg';
217
- path: 'data.name';
216
+ "kind": "arg";
217
+ "path": "data.name";
218
218
  }
219
219
  ];
220
220
  };
221
221
  },
222
222
  {
223
- name: 'authority';
224
- writable: true;
225
- signer: true;
223
+ "name": "authority";
224
+ "writable": true;
225
+ "signer": true;
226
226
  },
227
227
  {
228
- name: 'reserve';
228
+ "name": "reserve";
229
229
  },
230
230
  {
231
- name: 'associatedTokenProgram';
232
- address: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
231
+ "name": "associatedTokenProgram";
232
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
233
233
  },
234
234
  {
235
- name: 'systemProgram';
236
- address: '11111111111111111111111111111111';
235
+ "name": "systemProgram";
236
+ "address": "11111111111111111111111111111111";
237
237
  },
238
238
  {
239
- name: 'tokenProgram';
240
- address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
239
+ "name": "tokenProgram";
240
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
241
241
  },
242
242
  {
243
- name: 'reserveTokenAccount';
244
- writable: true;
245
- optional: true;
243
+ "name": "reserveTokenAccount";
244
+ "writable": true;
245
+ "optional": true;
246
246
  },
247
247
  {
248
- name: 'mint';
249
- optional: true;
248
+ "name": "mint";
249
+ "optional": true;
250
250
  }
251
251
  ];
252
- args: [
252
+ "args": [
253
253
  {
254
- name: 'data';
255
- type: {
256
- defined: {
257
- name: 'bondInitializeData';
254
+ "name": "data";
255
+ "type": {
256
+ "defined": {
257
+ "name": "bondInitializeData";
258
258
  };
259
259
  };
260
260
  }
261
261
  ];
262
262
  },
263
263
  {
264
- name: 'bondRegister';
265
- docs: [
266
- 'Registers a new validator with the bond.',
267
- 'Sets up the validator\'s bond account and deposits initial collateral.',
268
- '',
269
- '# Arguments',
270
- '* `initial_collateral` - Amount of collateral to lock (must be positive).',
271
- '* `withdrawal_authority` - Optional key that can withdraw collateral later.',
272
- '',
273
- '# Errors',
274
- 'Fails if the validator is already registered, if the vote account is invalid,',
275
- 'or if the initial collateral transfer fails.'
276
- ];
277
- discriminator: [
264
+ "name": "bondLockFunds";
265
+ "docs": [
266
+ "Locks funds for both the current and upcoming epoch.",
267
+ "Moves collateral from available to locked state, making it unavailable for withdrawal for the current and next epoch.",
268
+ "# Errors",
269
+ "Fails if the validator is not active, or if there are insufficient available funds."
270
+ ];
271
+ "discriminator": [
272
+ 117,
273
+ 166,
274
+ 195,
275
+ 99,
276
+ 103,
277
+ 45,
278
+ 195,
279
+ 2
280
+ ];
281
+ "accounts": [
282
+ {
283
+ "name": "bondState";
284
+ "writable": true;
285
+ },
286
+ {
287
+ "name": "validatorBond";
288
+ "writable": true;
289
+ },
290
+ {
291
+ "name": "bondTokenAccount";
292
+ "optional": true;
293
+ },
294
+ {
295
+ "name": "payer";
296
+ "writable": true;
297
+ "signer": true;
298
+ }
299
+ ];
300
+ "args": [
301
+ {
302
+ "name": "amount";
303
+ "type": "u64";
304
+ }
305
+ ];
306
+ },
307
+ {
308
+ "name": "bondRegister";
309
+ "docs": [
310
+ "Registers a new validator with the bond.",
311
+ "Sets up the validator's bond account and deposits initial collateral.",
312
+ "",
313
+ "# Arguments",
314
+ "* `initial_collateral` - Amount of collateral to lock (must be positive).",
315
+ "* `withdrawal_authority` - Optional key that can withdraw collateral later.",
316
+ "",
317
+ "# Errors",
318
+ "Fails if the validator is already registered, if the vote account is invalid,",
319
+ "or if the initial collateral transfer fails."
320
+ ];
321
+ "discriminator": [
278
322
  117,
279
323
  127,
280
324
  78,
@@ -284,19 +328,19 @@ type Jbond = {
284
328
  163,
285
329
  83
286
330
  ];
287
- accounts: [
331
+ "accounts": [
288
332
  {
289
- name: 'bondState';
290
- writable: true;
333
+ "name": "bondState";
334
+ "writable": true;
291
335
  },
292
336
  {
293
- name: 'validatorBond';
294
- writable: true;
295
- pda: {
296
- seeds: [
337
+ "name": "validatorBond";
338
+ "writable": true;
339
+ "pda": {
340
+ "seeds": [
297
341
  {
298
- kind: 'const';
299
- value: [
342
+ "kind": "const";
343
+ "value": [
300
344
  118,
301
345
  97,
302
346
  108,
@@ -314,78 +358,114 @@ type Jbond = {
314
358
  ];
315
359
  },
316
360
  {
317
- kind: 'account';
318
- path: 'bondState';
361
+ "kind": "account";
362
+ "path": "bondState";
319
363
  },
320
364
  {
321
- kind: 'account';
322
- path: 'voteAccount';
365
+ "kind": "account";
366
+ "path": "voteAccount";
323
367
  }
324
368
  ];
325
369
  };
326
370
  },
327
371
  {
328
- name: 'identity';
372
+ "name": "identity";
329
373
  },
330
374
  {
331
- name: 'voteAccount';
375
+ "name": "voteAccount";
332
376
  },
333
377
  {
334
- name: 'creator';
335
- writable: true;
336
- signer: true;
378
+ "name": "creator";
379
+ "writable": true;
380
+ "signer": true;
337
381
  },
338
382
  {
339
- name: 'systemProgram';
340
- address: '11111111111111111111111111111111';
383
+ "name": "systemProgram";
384
+ "address": "11111111111111111111111111111111";
341
385
  },
342
386
  {
343
- name: 'tokenProgram';
344
- address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
387
+ "name": "tokenProgram";
388
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
345
389
  },
346
390
  {
347
- name: 'associatedTokenProgram';
348
- address: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
391
+ "name": "associatedTokenProgram";
392
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
349
393
  },
350
394
  {
351
- name: 'bondTokenAccount';
352
- writable: true;
353
- optional: true;
395
+ "name": "bondTokenAccount";
396
+ "writable": true;
397
+ "optional": true;
354
398
  },
355
399
  {
356
- name: 'mint';
357
- optional: true;
400
+ "name": "mint";
401
+ "optional": true;
358
402
  }
359
403
  ];
360
- args: [
404
+ "args": [
361
405
  {
362
- name: 'bondType';
363
- type: {
364
- defined: {
365
- name: 'bondType';
406
+ "name": "bondType";
407
+ "type": {
408
+ "defined": {
409
+ "name": "bondType";
366
410
  };
367
411
  };
368
412
  },
369
413
  {
370
- name: 'bondName';
371
- type: 'string';
414
+ "name": "bondName";
415
+ "type": "string";
416
+ }
417
+ ];
418
+ },
419
+ {
420
+ "name": "bondReleaseFunds";
421
+ "docs": [
422
+ "Releases locked funds after an epoch ends.",
423
+ "Moves collateral from locked back to available state, allowing withdrawals.",
424
+ "# Errors",
425
+ "Fails if the validator is not active, or if there are insufficient locked funds."
426
+ ];
427
+ "discriminator": [
428
+ 184,
429
+ 224,
430
+ 14,
431
+ 24,
432
+ 76,
433
+ 14,
434
+ 226,
435
+ 190
436
+ ];
437
+ "accounts": [
438
+ {
439
+ "name": "validatorBond";
440
+ "writable": true;
441
+ },
442
+ {
443
+ "name": "payer";
444
+ "writable": true;
445
+ "signer": true;
446
+ }
447
+ ];
448
+ "args": [
449
+ {
450
+ "name": "amount";
451
+ "type": "u64";
372
452
  }
373
453
  ];
374
454
  },
375
455
  {
376
- name: 'bondSetWithdrawAuthority';
377
- docs: [
378
- 'Sets a new withdrawal authority for a validator\'s bond account.',
379
- 'Allows changing who can withdraw collateral in the future.',
380
- '',
381
- '# Arguments',
382
- '* `new_withdraw_authority` - Optional new withdrawal authority key (None to restrict to',
383
- 'identity).',
384
- '',
385
- '# Errors',
386
- 'Fails if the signer is not authorized to change the withdrawal authority.'
387
- ];
388
- discriminator: [
456
+ "name": "bondSetWithdrawAuthority";
457
+ "docs": [
458
+ "Sets a new withdrawal authority for a validator's bond account.",
459
+ "Allows changing who can withdraw collateral in the future.",
460
+ "",
461
+ "# Arguments",
462
+ "* `new_withdraw_authority` - Optional new withdrawal authority key (None to restrict to",
463
+ "identity).",
464
+ "",
465
+ "# Errors",
466
+ "Fails if the signer is not authorized to change the withdrawal authority."
467
+ ];
468
+ "discriminator": [
389
469
  212,
390
470
  162,
391
471
  53,
@@ -395,18 +475,18 @@ type Jbond = {
395
475
  61,
396
476
  166
397
477
  ];
398
- accounts: [
478
+ "accounts": [
399
479
  {
400
- name: 'bondState';
480
+ "name": "bondState";
401
481
  },
402
482
  {
403
- name: 'validatorBond';
404
- writable: true;
405
- pda: {
406
- seeds: [
483
+ "name": "validatorBond";
484
+ "writable": true;
485
+ "pda": {
486
+ "seeds": [
407
487
  {
408
- kind: 'const';
409
- value: [
488
+ "kind": "const";
489
+ "value": [
410
490
  118,
411
491
  97,
412
492
  108,
@@ -424,42 +504,42 @@ type Jbond = {
424
504
  ];
425
505
  },
426
506
  {
427
- kind: 'account';
428
- path: 'bondState';
507
+ "kind": "account";
508
+ "path": "bondState";
429
509
  },
430
510
  {
431
- kind: 'account';
432
- path: 'validator_bond.vote_account';
433
- account: 'validatorBond';
511
+ "kind": "account";
512
+ "path": "validator_bond.vote_account";
513
+ "account": "validatorBond";
434
514
  }
435
515
  ];
436
516
  };
437
517
  },
438
518
  {
439
- name: 'identity';
440
- signer: true;
519
+ "name": "identity";
520
+ "signer": true;
441
521
  },
442
522
  {
443
- name: 'newWithdrawAuthority';
444
- optional: true;
523
+ "name": "newWithdrawAuthority";
524
+ "optional": true;
445
525
  }
446
526
  ];
447
- args: [];
527
+ "args": [];
448
528
  },
449
529
  {
450
- name: 'bondTopUp';
451
- docs: [
452
- 'Adds additional collateral to an existing validator\'s bond.',
453
- 'Increases the collateral balance, enhancing the validator\'s stake.',
454
- '',
455
- '# Arguments',
456
- '* `amount` - Amount to add.',
457
- '',
458
- '# Errors',
459
- 'Fails if the validator is not active, if the amount is zero,',
460
- 'or if the transfer of funds fails.'
461
- ];
462
- discriminator: [
530
+ "name": "bondTopUp";
531
+ "docs": [
532
+ "Adds additional collateral to an existing validator's bond.",
533
+ "Increases the collateral balance, enhancing the validator's stake.",
534
+ "",
535
+ "# Arguments",
536
+ "* `amount` - Amount to add.",
537
+ "",
538
+ "# Errors",
539
+ "Fails if the validator is not active, if the amount is zero,",
540
+ "or if the transfer of funds fails."
541
+ ];
542
+ "discriminator": [
463
543
  132,
464
544
  225,
465
545
  254,
@@ -469,19 +549,19 @@ type Jbond = {
469
549
  176,
470
550
  66
471
551
  ];
472
- accounts: [
552
+ "accounts": [
473
553
  {
474
- name: 'bondState';
475
- writable: true;
554
+ "name": "bondState";
555
+ "writable": true;
476
556
  },
477
557
  {
478
- name: 'validatorBond';
479
- writable: true;
480
- pda: {
481
- seeds: [
558
+ "name": "validatorBond";
559
+ "writable": true;
560
+ "pda": {
561
+ "seeds": [
482
562
  {
483
- kind: 'const';
484
- value: [
563
+ "kind": "const";
564
+ "value": [
485
565
  118,
486
566
  97,
487
567
  108,
@@ -499,73 +579,109 @@ type Jbond = {
499
579
  ];
500
580
  },
501
581
  {
502
- kind: 'account';
503
- path: 'bondState';
582
+ "kind": "account";
583
+ "path": "bondState";
504
584
  },
505
585
  {
506
- kind: 'account';
507
- path: 'validator_bond.vote_account';
508
- account: 'validatorBond';
586
+ "kind": "account";
587
+ "path": "validator_bond.vote_account";
588
+ "account": "validatorBond";
509
589
  }
510
590
  ];
511
591
  };
512
592
  },
513
593
  {
514
- name: 'payer';
515
- writable: true;
516
- signer: true;
594
+ "name": "payer";
595
+ "writable": true;
596
+ "signer": true;
517
597
  },
518
598
  {
519
- name: 'payerTokenAccount';
520
- writable: true;
521
- optional: true;
599
+ "name": "payerTokenAccount";
600
+ "writable": true;
601
+ "optional": true;
522
602
  },
523
603
  {
524
- name: 'bondTokenAccount';
525
- writable: true;
526
- optional: true;
604
+ "name": "bondTokenAccount";
605
+ "writable": true;
606
+ "optional": true;
527
607
  },
528
608
  {
529
- name: 'stakeAccount';
530
- writable: true;
531
- optional: true;
609
+ "name": "stakeAccount";
610
+ "writable": true;
611
+ "optional": true;
532
612
  },
533
613
  {
534
- name: 'systemProgram';
535
- address: '11111111111111111111111111111111';
614
+ "name": "systemProgram";
615
+ "address": "11111111111111111111111111111111";
536
616
  },
537
617
  {
538
- name: 'tokenProgram';
539
- optional: true;
540
- address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
618
+ "name": "tokenProgram";
619
+ "optional": true;
620
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
541
621
  },
542
622
  {
543
- name: 'stakeProgram';
544
- optional: true;
623
+ "name": "stakeProgram";
624
+ "optional": true;
545
625
  }
546
626
  ];
547
- args: [
627
+ "args": [
548
628
  {
549
- name: 'amount';
550
- type: 'u64';
629
+ "name": "amount";
630
+ "type": "u64";
551
631
  }
552
632
  ];
553
633
  },
554
634
  {
555
- name: 'bondWithdraw';
556
- docs: [
557
- 'Withdraws collateral from a validator\'s bond.',
558
- 'Decreases the collateral balance, allowing the validator to reclaim funds.',
559
- '',
560
- '# Arguments',
561
- '* `amount` - Amount to withdraw (must not exceed available balance).',
562
- '',
563
- '# Errors',
564
- 'Fails if the validator is not active, if the amount is zero,',
565
- 'if the withdrawal authority is invalid, or if the withdrawal would',
566
- 'leave insufficient collateral.'
567
- ];
568
- discriminator: [
635
+ "name": "bondUpdate";
636
+ "docs": [
637
+ "Transitions locked funds between epochs for a validator bond.",
638
+ "",
639
+ "This function should be called at epoch boundaries to update the bond's",
640
+ "`last_update_epoch` and move the `next_epoch_locked` amount into",
641
+ "`current_epoch_locked`. It ensures that the update only occurs once per epoch.",
642
+ "",
643
+ "# Errors",
644
+ "Returns [`BondError::InvalidEpoch`] if called more than once in the same epoch,",
645
+ "or if the system clock cannot be accessed."
646
+ ];
647
+ "discriminator": [
648
+ 237,
649
+ 102,
650
+ 183,
651
+ 192,
652
+ 94,
653
+ 83,
654
+ 52,
655
+ 82
656
+ ];
657
+ "accounts": [
658
+ {
659
+ "name": "validatorBond";
660
+ "writable": true;
661
+ },
662
+ {
663
+ "name": "payer";
664
+ "writable": true;
665
+ "signer": true;
666
+ }
667
+ ];
668
+ "args": [];
669
+ },
670
+ {
671
+ "name": "bondWithdraw";
672
+ "docs": [
673
+ "Withdraws collateral from a validator's bond.",
674
+ "Decreases the collateral balance, allowing the validator to reclaim funds.",
675
+ "",
676
+ "# Arguments",
677
+ "* `amount` - Amount to withdraw (must not exceed available balance).",
678
+ "",
679
+ "# Errors",
680
+ "Fails if the validator is not active, if the amount is zero,",
681
+ "if the withdrawal authority is invalid, or if the withdrawal would",
682
+ "leave insufficient collateral."
683
+ ];
684
+ "discriminator": [
569
685
  99,
570
686
  64,
571
687
  127,
@@ -575,19 +691,19 @@ type Jbond = {
575
691
  70,
576
692
  204
577
693
  ];
578
- accounts: [
694
+ "accounts": [
579
695
  {
580
- name: 'bondState';
581
- writable: true;
696
+ "name": "bondState";
697
+ "writable": true;
582
698
  },
583
699
  {
584
- name: 'validatorBond';
585
- writable: true;
586
- pda: {
587
- seeds: [
700
+ "name": "validatorBond";
701
+ "writable": true;
702
+ "pda": {
703
+ "seeds": [
588
704
  {
589
- kind: 'const';
590
- value: [
705
+ "kind": "const";
706
+ "value": [
591
707
  118,
592
708
  97,
593
709
  108,
@@ -605,65 +721,65 @@ type Jbond = {
605
721
  ];
606
722
  },
607
723
  {
608
- kind: 'account';
609
- path: 'bondState';
724
+ "kind": "account";
725
+ "path": "bondState";
610
726
  },
611
727
  {
612
- kind: 'account';
613
- path: 'validator_bond.vote_account';
614
- account: 'validatorBond';
728
+ "kind": "account";
729
+ "path": "validator_bond.vote_account";
730
+ "account": "validatorBond";
615
731
  }
616
732
  ];
617
733
  };
618
734
  },
619
735
  {
620
- name: 'withdrawalAuthority';
621
- writable: true;
622
- signer: true;
736
+ "name": "withdrawalAuthority";
737
+ "writable": true;
738
+ "signer": true;
623
739
  },
624
740
  {
625
- name: 'destination';
626
- writable: true;
741
+ "name": "destination";
742
+ "writable": true;
627
743
  },
628
744
  {
629
- name: 'destinationTokenAccount';
630
- writable: true;
631
- optional: true;
745
+ "name": "destinationTokenAccount";
746
+ "writable": true;
747
+ "optional": true;
632
748
  },
633
749
  {
634
- name: 'bondTokenAccount';
635
- writable: true;
636
- optional: true;
750
+ "name": "bondTokenAccount";
751
+ "writable": true;
752
+ "optional": true;
637
753
  },
638
754
  {
639
- name: 'stakeAccount';
640
- writable: true;
641
- optional: true;
755
+ "name": "stakeAccount";
756
+ "writable": true;
757
+ "optional": true;
642
758
  },
643
759
  {
644
- name: 'systemProgram';
645
- address: '11111111111111111111111111111111';
760
+ "name": "systemProgram";
761
+ "address": "11111111111111111111111111111111";
646
762
  },
647
763
  {
648
- name: 'tokenProgram';
649
- optional: true;
650
- address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
764
+ "name": "tokenProgram";
765
+ "optional": true;
766
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
651
767
  },
652
768
  {
653
- name: 'stakeProgram';
654
- optional: true;
769
+ "name": "stakeProgram";
770
+ "optional": true;
655
771
  }
656
772
  ];
657
- args: [
773
+ "args": [
658
774
  {
659
- name: 'amount';
660
- type: 'u64';
775
+ "name": "amount";
776
+ "type": "u64";
661
777
  }
662
778
  ];
663
779
  },
664
780
  {
665
- name: 'globalConfigure';
666
- discriminator: [
781
+ "name": "globalConfigure";
782
+ "discriminator": [
667
783
  67,
668
784
  142,
669
785
  164,
@@ -673,15 +789,15 @@ type Jbond = {
673
789
  144,
674
790
  187
675
791
  ];
676
- accounts: [
792
+ "accounts": [
677
793
  {
678
- name: 'globalState';
679
- writable: true;
680
- pda: {
681
- seeds: [
794
+ "name": "globalState";
795
+ "writable": true;
796
+ "pda": {
797
+ "seeds": [
682
798
  {
683
- kind: 'const';
684
- value: [
799
+ "kind": "const";
800
+ "value": [
685
801
  103,
686
802
  108,
687
803
  111,
@@ -700,27 +816,27 @@ type Jbond = {
700
816
  };
701
817
  },
702
818
  {
703
- name: 'authority';
704
- signer: true;
705
- relations: [
706
- 'globalState'
819
+ "name": "authority";
820
+ "signer": true;
821
+ "relations": [
822
+ "globalState"
707
823
  ];
708
824
  }
709
825
  ];
710
- args: [
826
+ "args": [
711
827
  {
712
- name: 'data';
713
- type: {
714
- defined: {
715
- name: 'globalConfigureData';
828
+ "name": "data";
829
+ "type": {
830
+ "defined": {
831
+ "name": "globalConfigureData";
716
832
  };
717
833
  };
718
834
  }
719
835
  ];
720
836
  },
721
837
  {
722
- name: 'globalInitialize';
723
- discriminator: [
838
+ "name": "globalInitialize";
839
+ "discriminator": [
724
840
  30,
725
841
  79,
726
842
  193,
@@ -730,15 +846,15 @@ type Jbond = {
730
846
  223,
731
847
  196
732
848
  ];
733
- accounts: [
849
+ "accounts": [
734
850
  {
735
- name: 'globalState';
736
- writable: true;
737
- pda: {
738
- seeds: [
851
+ "name": "globalState";
852
+ "writable": true;
853
+ "pda": {
854
+ "seeds": [
739
855
  {
740
- kind: 'const';
741
- value: [
856
+ "kind": "const";
857
+ "value": [
742
858
  103,
743
859
  108,
744
860
  111,
@@ -757,97 +873,23 @@ type Jbond = {
757
873
  };
758
874
  },
759
875
  {
760
- name: 'authority';
761
- writable: true;
762
- signer: true;
763
- },
764
- {
765
- name: 'systemProgram';
766
- address: '11111111111111111111111111111111';
767
- }
768
- ];
769
- args: [];
770
- },
771
- {
772
- name: 'migrateBond';
773
- docs: [
774
- 'Migrates validator bond data from legacy structure to new structure.'
775
- ];
776
- discriminator: [
777
- 107,
778
- 119,
779
- 59,
780
- 110,
781
- 76,
782
- 18,
783
- 37,
784
- 163
785
- ];
786
- accounts: [
787
- {
788
- name: 'bondState';
789
- writable: true;
790
- },
791
- {
792
- name: 'legacyValidatorBond';
793
- writable: true;
794
- },
795
- {
796
- name: 'legacyVoteAccount';
797
- },
798
- {
799
- name: 'validatorBond';
800
- writable: true;
801
- pda: {
802
- seeds: [
803
- {
804
- kind: 'const';
805
- value: [
806
- 118,
807
- 97,
808
- 108,
809
- 105,
810
- 100,
811
- 97,
812
- 116,
813
- 111,
814
- 114,
815
- 95,
816
- 98,
817
- 111,
818
- 110,
819
- 100
820
- ];
821
- },
822
- {
823
- kind: 'account';
824
- path: 'bondState';
825
- },
826
- {
827
- kind: 'account';
828
- path: 'legacyVoteAccount';
829
- }
830
- ];
831
- };
832
- },
833
- {
834
- name: 'creator';
835
- writable: true;
836
- signer: true;
876
+ "name": "authority";
877
+ "writable": true;
878
+ "signer": true;
837
879
  },
838
880
  {
839
- name: 'systemProgram';
840
- address: '11111111111111111111111111111111';
881
+ "name": "systemProgram";
882
+ "address": "11111111111111111111111111111111";
841
883
  }
842
884
  ];
843
- args: [];
885
+ "args": [];
844
886
  },
845
887
  {
846
- name: 'sessionFinish';
847
- docs: [
848
- 'Finishes a bond, preventing further deposits and withdrawals.'
888
+ "name": "sessionFinish";
889
+ "docs": [
890
+ "Finishes a bond, preventing further deposits and withdrawals."
849
891
  ];
850
- discriminator: [
892
+ "discriminator": [
851
893
  230,
852
894
  209,
853
895
  54,
@@ -857,28 +899,28 @@ type Jbond = {
857
899
  137,
858
900
  113
859
901
  ];
860
- accounts: [
902
+ "accounts": [
861
903
  {
862
- name: 'bondState';
863
- writable: true;
904
+ "name": "bondState";
905
+ "writable": true;
864
906
  },
865
907
  {
866
- name: 'authority';
867
- writable: true;
868
- signer: true;
869
- relations: [
870
- 'bondState'
908
+ "name": "authority";
909
+ "writable": true;
910
+ "signer": true;
911
+ "relations": [
912
+ "bondState"
871
913
  ];
872
914
  }
873
915
  ];
874
- args: [];
916
+ "args": [];
875
917
  },
876
918
  {
877
- name: 'sessionStart';
878
- docs: [
879
- 'Starts a paused bond, allowing deposits and withdrawals to resume.'
919
+ "name": "sessionStart";
920
+ "docs": [
921
+ "Starts a paused bond, allowing deposits and withdrawals to resume."
880
922
  ];
881
- discriminator: [
923
+ "discriminator": [
882
924
  132,
883
925
  93,
884
926
  83,
@@ -888,32 +930,67 @@ type Jbond = {
888
930
  58,
889
931
  92
890
932
  ];
891
- accounts: [
933
+ "accounts": [
892
934
  {
893
- name: 'bondState';
894
- writable: true;
935
+ "name": "bondState";
936
+ "writable": true;
895
937
  },
896
938
  {
897
- name: 'authority';
898
- writable: true;
899
- signer: true;
900
- relations: [
901
- 'bondState'
939
+ "name": "authority";
940
+ "writable": true;
941
+ "signer": true;
942
+ "relations": [
943
+ "bondState"
902
944
  ];
903
945
  }
904
946
  ];
905
- args: [
947
+ "args": [
906
948
  {
907
- name: 'durationSecs';
908
- type: 'u64';
949
+ "name": "durationSecs";
950
+ "type": "u64";
951
+ }
952
+ ];
953
+ },
954
+ {
955
+ "name": "testSetLastUpdateEpoch";
956
+ "docs": [
957
+ "NOTE!: This instruction is for testing purposes only.",
958
+ "It allows direct manipulation of the validator bond's last epoch update.",
959
+ "This should not be used in production environments."
960
+ ];
961
+ "discriminator": [
962
+ 215,
963
+ 125,
964
+ 32,
965
+ 8,
966
+ 43,
967
+ 106,
968
+ 194,
969
+ 221
970
+ ];
971
+ "accounts": [
972
+ {
973
+ "name": "validatorBond";
974
+ "writable": true;
975
+ },
976
+ {
977
+ "name": "payer";
978
+ "writable": true;
979
+ "signer": true;
980
+ }
981
+ ];
982
+ "args": [
983
+ {
984
+ "name": "epoch";
985
+ "type": "u64";
909
986
  }
910
987
  ];
911
988
  }
912
989
  ];
913
- accounts: [
990
+ "accounts": [
914
991
  {
915
- name: 'bondState';
916
- discriminator: [
992
+ "name": "bondState";
993
+ "discriminator": [
917
994
  251,
918
995
  95,
919
996
  76,
@@ -925,8 +1002,8 @@ type Jbond = {
925
1002
  ];
926
1003
  },
927
1004
  {
928
- name: 'globalState';
929
- discriminator: [
1005
+ "name": "globalState";
1006
+ "discriminator": [
930
1007
  163,
931
1008
  46,
932
1009
  74,
@@ -938,8 +1015,8 @@ type Jbond = {
938
1015
  ];
939
1016
  },
940
1017
  {
941
- name: 'validatorBond';
942
- discriminator: [
1018
+ "name": "validatorBond";
1019
+ "discriminator": [
943
1020
  82,
944
1021
  127,
945
1022
  243,
@@ -951,10 +1028,10 @@ type Jbond = {
951
1028
  ];
952
1029
  }
953
1030
  ];
954
- events: [
1031
+ "events": [
955
1032
  {
956
- name: 'bondFinished';
957
- discriminator: [
1033
+ "name": "bondFinished";
1034
+ "discriminator": [
958
1035
  223,
959
1036
  254,
960
1037
  3,
@@ -966,8 +1043,8 @@ type Jbond = {
966
1043
  ];
967
1044
  },
968
1045
  {
969
- name: 'bondStarted';
970
- discriminator: [
1046
+ "name": "bondStarted";
1047
+ "discriminator": [
971
1048
  235,
972
1049
  69,
973
1050
  80,
@@ -979,8 +1056,8 @@ type Jbond = {
979
1056
  ];
980
1057
  },
981
1058
  {
982
- name: 'collateralToppedUp';
983
- discriminator: [
1059
+ "name": "collateralToppedUp";
1060
+ "discriminator": [
984
1061
  189,
985
1062
  137,
986
1063
  204,
@@ -992,8 +1069,8 @@ type Jbond = {
992
1069
  ];
993
1070
  },
994
1071
  {
995
- name: 'collateralWithdrawn';
996
- discriminator: [
1072
+ "name": "collateralWithdrawn";
1073
+ "discriminator": [
997
1074
  51,
998
1075
  224,
999
1076
  133,
@@ -1005,8 +1082,8 @@ type Jbond = {
1005
1082
  ];
1006
1083
  },
1007
1084
  {
1008
- name: 'compensationClaimed';
1009
- discriminator: [
1085
+ "name": "compensationClaimed";
1086
+ "discriminator": [
1010
1087
  36,
1011
1088
  159,
1012
1089
  41,
@@ -1018,8 +1095,8 @@ type Jbond = {
1018
1095
  ];
1019
1096
  },
1020
1097
  {
1021
- name: 'validatorRegistered';
1022
- discriminator: [
1098
+ "name": "validatorRegistered";
1099
+ "discriminator": [
1023
1100
  20,
1024
1101
  20,
1025
1102
  190,
@@ -1031,208 +1108,213 @@ type Jbond = {
1031
1108
  ];
1032
1109
  }
1033
1110
  ];
1034
- errors: [
1111
+ "errors": [
1035
1112
  {
1036
- code: 6000;
1037
- name: 'invalidVoteAccount';
1038
- msg: 'Invalid vote account';
1113
+ "code": 6000;
1114
+ "name": "invalidVoteAccount";
1115
+ "msg": "Invalid vote account";
1039
1116
  },
1040
1117
  {
1041
- code: 6001;
1042
- name: 'identityMismatch';
1043
- msg: 'Identity does not match vote account';
1118
+ "code": 6001;
1119
+ "name": "identityMismatch";
1120
+ "msg": "Identity does not match vote account";
1044
1121
  },
1045
1122
  {
1046
- code: 6002;
1047
- name: 'insufficientCollateral';
1048
- msg: 'Insufficient collateral amount';
1123
+ "code": 6002;
1124
+ "name": "insufficientCollateral";
1125
+ "msg": "Insufficient collateral amount";
1049
1126
  },
1050
1127
  {
1051
- code: 6003;
1052
- name: 'targetAprTooLow';
1053
- msg: 'Target APR is below minimum threshold';
1128
+ "code": 6003;
1129
+ "name": "targetAprTooLow";
1130
+ "msg": "Target APR is below minimum threshold";
1054
1131
  },
1055
1132
  {
1056
- code: 6004;
1057
- name: 'mathOverflow';
1058
- msg: 'Math overflow';
1133
+ "code": 6004;
1134
+ "name": "mathOverflow";
1135
+ "msg": "Math overflow";
1059
1136
  },
1060
1137
  {
1061
- code: 6005;
1062
- name: 'invalidAmount';
1063
- msg: 'Invalid amount';
1138
+ "code": 6005;
1139
+ "name": "invalidAmount";
1140
+ "msg": "Invalid amount";
1064
1141
  },
1065
1142
  {
1066
- code: 6006;
1067
- name: 'validatorNotActive';
1068
- msg: 'Validator bond account is not active';
1143
+ "code": 6006;
1144
+ "name": "validatorNotActive";
1145
+ "msg": "Validator bond account is not active";
1069
1146
  },
1070
1147
  {
1071
- code: 6007;
1072
- name: 'validatorAlreadyRegistered';
1073
- msg: 'Validator already registered';
1148
+ "code": 6007;
1149
+ "name": "validatorAlreadyRegistered";
1150
+ "msg": "Validator already registered";
1074
1151
  },
1075
1152
  {
1076
- code: 6008;
1077
- name: 'unauthorized';
1078
- msg: 'unauthorized';
1153
+ "code": 6008;
1154
+ "name": "unauthorized";
1155
+ "msg": "unauthorized";
1079
1156
  },
1080
1157
  {
1081
- code: 6009;
1082
- name: 'withdrawalLockedNearEpochEnd';
1083
- msg: 'Withdrawals are locked near the end of the epoch.';
1158
+ "code": 6009;
1159
+ "name": "withdrawalLockedNearEpochEnd";
1160
+ "msg": "Withdrawals are locked near the end of the epoch.";
1084
1161
  },
1085
1162
  {
1086
- code: 6010;
1087
- name: 'missingTokenAccounts';
1088
- msg: 'Missing token accounts for token collateral type';
1163
+ "code": 6010;
1164
+ "name": "missingTokenAccounts";
1165
+ "msg": "Missing token accounts for token collateral type";
1089
1166
  },
1090
1167
  {
1091
- code: 6011;
1092
- name: 'missingTokenProgram';
1093
- msg: 'Token program is required for token collateral type';
1168
+ "code": 6011;
1169
+ "name": "missingTokenProgram";
1170
+ "msg": "Token program is required for token collateral type";
1094
1171
  },
1095
1172
  {
1096
- code: 6012;
1097
- name: 'invalidMint';
1098
- msg: 'Invalid mint for token collateral type';
1173
+ "code": 6012;
1174
+ "name": "invalidMint";
1175
+ "msg": "Invalid mint for token collateral type";
1099
1176
  },
1100
1177
  {
1101
- code: 6013;
1102
- name: 'missingStakeAccount';
1103
- msg: 'Stake account is required for stake account collateral type';
1178
+ "code": 6013;
1179
+ "name": "missingStakeAccount";
1180
+ "msg": "Stake account is required for stake account collateral type";
1104
1181
  },
1105
1182
  {
1106
- code: 6014;
1107
- name: 'missingStakeProgram';
1108
- msg: 'Stake program is required for stake account collateral type';
1183
+ "code": 6014;
1184
+ "name": "missingStakeProgram";
1185
+ "msg": "Stake program is required for stake account collateral type";
1109
1186
  },
1110
1187
  {
1111
- code: 6015;
1112
- name: 'bondFinished';
1113
- msg: 'Bond is finished (deposits/withdrawals disabled)';
1188
+ "code": 6015;
1189
+ "name": "bondFinished";
1190
+ "msg": "Bond is finished (deposits/withdrawals disabled)";
1114
1191
  },
1115
1192
  {
1116
- code: 6016;
1117
- name: 'bondNotFinished';
1118
- msg: 'Bond is not finished';
1193
+ "code": 6016;
1194
+ "name": "bondNotFinished";
1195
+ "msg": "Bond is not finished";
1119
1196
  },
1120
1197
  {
1121
- code: 6017;
1122
- name: 'unsupportedCollateralType';
1123
- msg: 'Unsupported collateral type';
1198
+ "code": 6017;
1199
+ "name": "unsupportedCollateralType";
1200
+ "msg": "Unsupported collateral type";
1124
1201
  },
1125
1202
  {
1126
- code: 6018;
1127
- name: 'overflow';
1128
- msg: 'Math operation overflowed';
1203
+ "code": 6018;
1204
+ "name": "overflow";
1205
+ "msg": "Math operation overflowed";
1129
1206
  },
1130
1207
  {
1131
- code: 6019;
1132
- name: 'incorrectBondType';
1133
- msg: 'Incorrect bond type for this operation';
1208
+ "code": 6019;
1209
+ "name": "incorrectBondType";
1210
+ "msg": "Incorrect bond type for this operation";
1134
1211
  },
1135
1212
  {
1136
- code: 6020;
1137
- name: 'bondNotFinishable';
1138
- msg: 'This bond type can\'t be finished';
1213
+ "code": 6020;
1214
+ "name": "bondNotFinishable";
1215
+ "msg": "This bond type can't be finished";
1139
1216
  },
1140
1217
  {
1141
- code: 6021;
1142
- name: 'invalidArgument';
1143
- msg: 'Invalid argument provided';
1218
+ "code": 6021;
1219
+ "name": "invalidArgument";
1220
+ "msg": "Invalid argument provided";
1144
1221
  },
1145
1222
  {
1146
- code: 6022;
1147
- name: 'bondNotDisabled';
1148
- msg: 'Bond is not disabled';
1223
+ "code": 6022;
1224
+ "name": "bondNotDisabled";
1225
+ "msg": "Bond is not disabled";
1149
1226
  },
1150
1227
  {
1151
- code: 6023;
1152
- name: 'bondNotEnabled';
1153
- msg: 'Bond is not enabled';
1228
+ "code": 6023;
1229
+ "name": "bondNotEnabled";
1230
+ "msg": "Bond is not enabled";
1231
+ },
1232
+ {
1233
+ "code": 6024;
1234
+ "name": "invalidEpoch";
1235
+ "msg": "Invalid epoch for this operation";
1154
1236
  }
1155
1237
  ];
1156
- types: [
1238
+ "types": [
1157
1239
  {
1158
- name: 'bondConfigureData';
1159
- type: {
1160
- kind: 'struct';
1161
- fields: [
1240
+ "name": "bondConfigureData";
1241
+ "type": {
1242
+ "kind": "struct";
1243
+ "fields": [
1162
1244
  {
1163
- name: 'status';
1164
- type: {
1165
- option: {
1166
- defined: {
1167
- name: 'bondStatus';
1245
+ "name": "status";
1246
+ "type": {
1247
+ "option": {
1248
+ "defined": {
1249
+ "name": "bondStatus";
1168
1250
  };
1169
1251
  };
1170
1252
  };
1171
1253
  },
1172
1254
  {
1173
- name: 'newReserve';
1174
- type: {
1175
- option: 'pubkey';
1255
+ "name": "newReserve";
1256
+ "type": {
1257
+ "option": "pubkey";
1176
1258
  };
1177
1259
  },
1178
1260
  {
1179
- name: 'newAuthority';
1180
- type: {
1181
- option: 'pubkey';
1261
+ "name": "newAuthority";
1262
+ "type": {
1263
+ "option": "pubkey";
1182
1264
  };
1183
1265
  }
1184
1266
  ];
1185
1267
  };
1186
1268
  },
1187
1269
  {
1188
- name: 'bondFinished';
1189
- type: {
1190
- kind: 'struct';
1191
- fields: [
1270
+ "name": "bondFinished";
1271
+ "type": {
1272
+ "kind": "struct";
1273
+ "fields": [
1192
1274
  {
1193
- name: 'bond';
1194
- type: 'pubkey';
1275
+ "name": "bond";
1276
+ "type": "pubkey";
1195
1277
  },
1196
1278
  {
1197
- name: 'authority';
1198
- type: 'pubkey';
1279
+ "name": "authority";
1280
+ "type": "pubkey";
1199
1281
  },
1200
1282
  {
1201
- name: 'timestamp';
1202
- type: 'i64';
1283
+ "name": "timestamp";
1284
+ "type": "i64";
1203
1285
  }
1204
1286
  ];
1205
1287
  };
1206
1288
  },
1207
1289
  {
1208
- name: 'bondInitializeData';
1209
- docs: [
1210
- 'Data required to initialize a performance bond'
1290
+ "name": "bondInitializeData";
1291
+ "docs": [
1292
+ "Data required to initialize a performance bond"
1211
1293
  ];
1212
- type: {
1213
- kind: 'struct';
1214
- fields: [
1294
+ "type": {
1295
+ "kind": "struct";
1296
+ "fields": [
1215
1297
  {
1216
- name: 'name';
1217
- type: 'string';
1298
+ "name": "name";
1299
+ "type": "string";
1218
1300
  },
1219
1301
  {
1220
- name: 'bondType';
1221
- type: {
1222
- defined: {
1223
- name: 'bondType';
1302
+ "name": "bondType";
1303
+ "type": {
1304
+ "defined": {
1305
+ "name": "bondType";
1224
1306
  };
1225
1307
  };
1226
1308
  },
1227
1309
  {
1228
- name: 'reserve';
1229
- type: 'pubkey';
1310
+ "name": "reserve";
1311
+ "type": "pubkey";
1230
1312
  },
1231
1313
  {
1232
- name: 'collateralType';
1233
- type: {
1234
- defined: {
1235
- name: 'collateralType';
1314
+ "name": "collateralType";
1315
+ "type": {
1316
+ "defined": {
1317
+ "name": "collateralType";
1236
1318
  };
1237
1319
  };
1238
1320
  }
@@ -1240,359 +1322,402 @@ type Jbond = {
1240
1322
  };
1241
1323
  },
1242
1324
  {
1243
- name: 'bondStarted';
1244
- type: {
1245
- kind: 'struct';
1246
- fields: [
1325
+ "name": "bondStarted";
1326
+ "type": {
1327
+ "kind": "struct";
1328
+ "fields": [
1247
1329
  {
1248
- name: 'bond';
1249
- type: 'pubkey';
1330
+ "name": "bond";
1331
+ "type": "pubkey";
1250
1332
  },
1251
1333
  {
1252
- name: 'authority';
1253
- type: 'pubkey';
1334
+ "name": "authority";
1335
+ "type": "pubkey";
1254
1336
  },
1255
1337
  {
1256
- name: 'timestamp';
1257
- type: 'i64';
1338
+ "name": "timestamp";
1339
+ "type": "i64";
1258
1340
  }
1259
1341
  ];
1260
1342
  };
1261
1343
  },
1262
1344
  {
1263
- name: 'bondState';
1264
- type: {
1265
- kind: 'struct';
1266
- fields: [
1345
+ "name": "bondState";
1346
+ "type": {
1347
+ "kind": "struct";
1348
+ "fields": [
1267
1349
  {
1268
- name: 'name';
1269
- type: 'string';
1350
+ "name": "name";
1351
+ "type": "string";
1270
1352
  },
1271
1353
  {
1272
- name: 'bondType';
1273
- docs: [
1274
- 'The type of bond (e.g., Standard, Crowdfunding)'
1354
+ "name": "bondType";
1355
+ "docs": [
1356
+ "The type of bond (e.g., Standard, Crowdfunding)"
1275
1357
  ];
1276
- type: {
1277
- defined: {
1278
- name: 'bondType';
1358
+ "type": {
1359
+ "defined": {
1360
+ "name": "bondType";
1279
1361
  };
1280
1362
  };
1281
1363
  },
1282
1364
  {
1283
- name: 'collateralType';
1284
- docs: [
1285
- 'The type of collateral accepted for this bond'
1365
+ "name": "collateralType";
1366
+ "docs": [
1367
+ "The type of collateral accepted for this bond"
1286
1368
  ];
1287
- type: {
1288
- defined: {
1289
- name: 'collateralType';
1369
+ "type": {
1370
+ "defined": {
1371
+ "name": "collateralType";
1290
1372
  };
1291
1373
  };
1292
1374
  },
1293
1375
  {
1294
- name: 'reserve';
1295
- docs: [
1296
- 'Reserve account where collateral is held'
1376
+ "name": "reserve";
1377
+ "docs": [
1378
+ "Reserve account where collateral is held"
1297
1379
  ];
1298
- type: 'pubkey';
1380
+ "type": "pubkey";
1299
1381
  },
1300
1382
  {
1301
- name: 'authority';
1302
- docs: [
1303
- 'Authority allowed to manage the bond configuration'
1383
+ "name": "authority";
1384
+ "docs": [
1385
+ "Authority allowed to manage the bond configuration"
1304
1386
  ];
1305
- type: 'pubkey';
1387
+ "type": "pubkey";
1306
1388
  },
1307
1389
  {
1308
- name: 'sessionId';
1309
- docs: [
1310
- 'Unique identifier for the bonding session'
1390
+ "name": "sessionId";
1391
+ "docs": [
1392
+ "Unique identifier for the bonding session"
1311
1393
  ];
1312
- type: 'u32';
1394
+ "type": "u32";
1313
1395
  },
1314
1396
  {
1315
- name: 'totalMembers';
1316
- docs: [
1317
- 'Total number of users who have participated in the bond'
1397
+ "name": "totalMembers";
1398
+ "docs": [
1399
+ "Total number of users who have participated in the bond"
1318
1400
  ];
1319
- type: 'u16';
1401
+ "type": "u16";
1320
1402
  },
1321
1403
  {
1322
- name: 'totalCompensationAmount';
1323
- docs: [
1324
- 'Total compensation amount paid out'
1404
+ "name": "totalCompensationAmount";
1405
+ "docs": [
1406
+ "Total compensation amount paid out"
1325
1407
  ];
1326
- type: 'u64';
1408
+ "type": "u64";
1327
1409
  },
1328
1410
  {
1329
- name: 'sessionStartTs';
1330
- docs: [
1331
- 'Start timestamp of the current session (unix seconds). 0 — not set.'
1411
+ "name": "sessionStartTs";
1412
+ "docs": [
1413
+ "Start timestamp of the current session (unix seconds). 0 — not set."
1332
1414
  ];
1333
- type: 'i64';
1415
+ "type": "i64";
1334
1416
  },
1335
1417
  {
1336
- name: 'sessionFinishTs';
1337
- docs: [
1338
- 'Finish timestamp of the current session (unix seconds). 0 — not set.'
1418
+ "name": "sessionFinishTs";
1419
+ "docs": [
1420
+ "Finish timestamp of the current session (unix seconds). 0 — not set."
1339
1421
  ];
1340
- type: 'i64';
1422
+ "type": "i64";
1341
1423
  },
1342
1424
  {
1343
- name: 'status';
1344
- docs: [
1345
- 'Current status of the bond'
1425
+ "name": "status";
1426
+ "docs": [
1427
+ "Current status of the bond"
1346
1428
  ];
1347
- type: {
1348
- defined: {
1349
- name: 'bondStatus';
1429
+ "type": {
1430
+ "defined": {
1431
+ "name": "bondStatus";
1350
1432
  };
1351
1433
  };
1352
1434
  },
1353
1435
  {
1354
- name: 'bump';
1355
- docs: [
1356
- 'Bump for the PDA'
1436
+ "name": "bump";
1437
+ "docs": [
1438
+ "Bump for the PDA"
1357
1439
  ];
1358
- type: 'u8';
1440
+ "type": "u8";
1359
1441
  }
1360
1442
  ];
1361
1443
  };
1362
1444
  },
1363
1445
  {
1364
- name: 'bondStatus';
1365
- type: {
1366
- kind: 'enum';
1367
- variants: [
1446
+ "name": "bondStatus";
1447
+ "type": {
1448
+ "kind": "enum";
1449
+ "variants": [
1368
1450
  {
1369
- name: 'active';
1451
+ "name": "active";
1370
1452
  },
1371
1453
  {
1372
- name: 'disabled';
1454
+ "name": "disabled";
1373
1455
  }
1374
1456
  ];
1375
1457
  };
1376
1458
  },
1377
1459
  {
1378
- name: 'bondType';
1379
- docs: [
1380
- 'Types of bonds supported by the program'
1460
+ "name": "bondType";
1461
+ "docs": [
1462
+ "Types of bonds supported by the program"
1381
1463
  ];
1382
- type: {
1383
- kind: 'enum';
1384
- variants: [
1464
+ "type": {
1465
+ "kind": "enum";
1466
+ "variants": [
1385
1467
  {
1386
- name: 'standard';
1468
+ "name": "standard";
1387
1469
  },
1388
1470
  {
1389
- name: 'crowdfunding';
1471
+ "name": "crowdfunding";
1390
1472
  }
1391
1473
  ];
1392
1474
  };
1393
1475
  },
1394
1476
  {
1395
- name: 'collateralToppedUp';
1396
- type: {
1397
- kind: 'struct';
1398
- fields: [
1477
+ "name": "collateralToppedUp";
1478
+ "type": {
1479
+ "kind": "struct";
1480
+ "fields": [
1399
1481
  {
1400
- name: 'validator';
1401
- type: 'pubkey';
1482
+ "name": "validator";
1483
+ "type": "pubkey";
1402
1484
  },
1403
1485
  {
1404
- name: 'amount';
1405
- type: 'u64';
1486
+ "name": "amount";
1487
+ "type": "u64";
1406
1488
  },
1407
1489
  {
1408
- name: 'postBalance';
1409
- type: 'u64';
1490
+ "name": "postBalance";
1491
+ "type": "u64";
1410
1492
  },
1411
1493
  {
1412
- name: 'timestamp';
1413
- type: 'i64';
1494
+ "name": "timestamp";
1495
+ "type": "i64";
1414
1496
  }
1415
1497
  ];
1416
1498
  };
1417
1499
  },
1418
1500
  {
1419
- name: 'collateralType';
1420
- docs: [
1421
- 'Types of collateral that can be used for bond deposit'
1501
+ "name": "collateralType";
1502
+ "docs": [
1503
+ "Types of collateral that can be used for bond deposit"
1422
1504
  ];
1423
- type: {
1424
- kind: 'enum';
1425
- variants: [
1505
+ "type": {
1506
+ "kind": "enum";
1507
+ "variants": [
1426
1508
  {
1427
- name: 'native';
1509
+ "name": "native";
1428
1510
  },
1429
1511
  {
1430
- name: 'stakeAccount';
1512
+ "name": "stakeAccount";
1431
1513
  },
1432
1514
  {
1433
- name: 'token';
1434
- fields: [
1435
- 'pubkey'
1515
+ "name": "token";
1516
+ "fields": [
1517
+ "pubkey"
1436
1518
  ];
1437
1519
  }
1438
1520
  ];
1439
1521
  };
1440
1522
  },
1441
1523
  {
1442
- name: 'collateralWithdrawn';
1443
- type: {
1444
- kind: 'struct';
1445
- fields: [
1524
+ "name": "collateralWithdrawn";
1525
+ "type": {
1526
+ "kind": "struct";
1527
+ "fields": [
1446
1528
  {
1447
- name: 'validator';
1448
- type: 'pubkey';
1529
+ "name": "validator";
1530
+ "type": "pubkey";
1449
1531
  },
1450
1532
  {
1451
- name: 'amount';
1452
- type: 'u64';
1533
+ "name": "amount";
1534
+ "type": "u64";
1453
1535
  },
1454
1536
  {
1455
- name: 'postBalance';
1456
- type: 'u64';
1537
+ "name": "postBalance";
1538
+ "type": "u64";
1457
1539
  },
1458
1540
  {
1459
- name: 'timestamp';
1460
- type: 'i64';
1541
+ "name": "timestamp";
1542
+ "type": "i64";
1461
1543
  }
1462
1544
  ];
1463
1545
  };
1464
1546
  },
1465
1547
  {
1466
- name: 'compensationClaimed';
1467
- type: {
1468
- kind: 'struct';
1469
- fields: [
1548
+ "name": "compensationClaimed";
1549
+ "type": {
1550
+ "kind": "struct";
1551
+ "fields": [
1470
1552
  {
1471
- name: 'validator';
1472
- type: 'pubkey';
1553
+ "name": "validator";
1554
+ "type": "pubkey";
1473
1555
  },
1474
1556
  {
1475
- name: 'amount';
1476
- type: 'u64';
1557
+ "name": "amount";
1558
+ "type": "u64";
1477
1559
  },
1478
1560
  {
1479
- name: 'postBalance';
1480
- type: 'u64';
1561
+ "name": "postBalance";
1562
+ "type": "u64";
1481
1563
  },
1482
1564
  {
1483
- name: 'epoch';
1484
- type: 'u64';
1565
+ "name": "epoch";
1566
+ "type": "u64";
1485
1567
  },
1486
1568
  {
1487
- name: 'timestamp';
1488
- type: 'i64';
1569
+ "name": "timestamp";
1570
+ "type": "i64";
1489
1571
  }
1490
1572
  ];
1491
1573
  };
1492
1574
  },
1493
1575
  {
1494
- name: 'globalConfigureData';
1495
- type: {
1496
- kind: 'struct';
1497
- fields: [
1576
+ "name": "globalConfigureData";
1577
+ "type": {
1578
+ "kind": "struct";
1579
+ "fields": [
1498
1580
  {
1499
- name: 'newAuthority';
1500
- type: {
1501
- option: 'pubkey';
1581
+ "name": "newAuthority";
1582
+ "type": {
1583
+ "option": "pubkey";
1502
1584
  };
1503
1585
  }
1504
1586
  ];
1505
1587
  };
1506
1588
  },
1507
1589
  {
1508
- name: 'globalState';
1509
- type: {
1510
- kind: 'struct';
1511
- fields: [
1590
+ "name": "globalState";
1591
+ "type": {
1592
+ "kind": "struct";
1593
+ "fields": [
1512
1594
  {
1513
- name: 'authority';
1514
- docs: [
1515
- 'The authority allowed to manage the program'
1595
+ "name": "authority";
1596
+ "docs": [
1597
+ "The authority allowed to manage the program"
1516
1598
  ];
1517
- type: 'pubkey';
1599
+ "type": "pubkey";
1518
1600
  },
1519
1601
  {
1520
- name: 'bump';
1521
- docs: [
1522
- 'Bump for the PDA'
1602
+ "name": "bump";
1603
+ "docs": [
1604
+ "Bump for the PDA"
1523
1605
  ];
1524
- type: 'u8';
1606
+ "type": "u8";
1525
1607
  }
1526
1608
  ];
1527
1609
  };
1528
1610
  },
1529
1611
  {
1530
- name: 'validatorBond';
1531
- type: {
1532
- kind: 'struct';
1533
- fields: [
1612
+ "name": "validatorBond";
1613
+ "type": {
1614
+ "kind": "struct";
1615
+ "fields": [
1534
1616
  {
1535
- name: 'state';
1536
- type: 'pubkey';
1617
+ "name": "state";
1618
+ "docs": [
1619
+ "The bond state address"
1620
+ ];
1621
+ "type": "pubkey";
1537
1622
  },
1538
1623
  {
1539
- name: 'identity';
1540
- type: 'pubkey';
1624
+ "name": "identity";
1625
+ "docs": [
1626
+ "Validator identity pubkey"
1627
+ ];
1628
+ "type": "pubkey";
1541
1629
  },
1542
1630
  {
1543
- name: 'voteAccount';
1544
- type: 'pubkey';
1631
+ "name": "voteAccount";
1632
+ "docs": [
1633
+ "Validator vote account pubkey"
1634
+ ];
1635
+ "type": "pubkey";
1545
1636
  },
1546
1637
  {
1547
- name: 'creator';
1548
- type: 'pubkey';
1638
+ "name": "creator";
1639
+ "docs": [
1640
+ "The bond creator pubkey"
1641
+ ];
1642
+ "type": "pubkey";
1549
1643
  },
1550
1644
  {
1551
- name: 'withdrawalAuthority';
1552
- type: {
1553
- option: 'pubkey';
1645
+ "name": "withdrawalAuthority";
1646
+ "docs": [
1647
+ "Optional withdrawal authority pubkey (if set, can withdraw on behalf of the validator,",
1648
+ "otherwise only identity can withdraw)"
1649
+ ];
1650
+ "type": {
1651
+ "option": "pubkey";
1554
1652
  };
1555
1653
  },
1556
1654
  {
1557
- name: 'createdAt';
1558
- type: 'i64';
1655
+ "name": "createdAt";
1656
+ "docs": [
1657
+ "Bond creation timestamp"
1658
+ ];
1659
+ "type": "i64";
1660
+ },
1661
+ {
1662
+ "name": "bump";
1663
+ "docs": [
1664
+ "Bump for the PDA"
1665
+ ];
1666
+ "type": "u8";
1559
1667
  },
1560
1668
  {
1561
- name: 'bump';
1562
- type: 'u8';
1669
+ "name": "nextEpochLocked";
1670
+ "docs": [
1671
+ "Amount of collateral locked for the next epoch"
1672
+ ];
1673
+ "type": "u64";
1674
+ },
1675
+ {
1676
+ "name": "currentEpochLocked";
1677
+ "docs": [
1678
+ "Amount of collateral locked for the current epoch"
1679
+ ];
1680
+ "type": "u64";
1681
+ },
1682
+ {
1683
+ "name": "lastUpdateEpoch";
1684
+ "docs": [
1685
+ "The last epoch when the bond was updated"
1686
+ ];
1687
+ "type": "u64";
1563
1688
  }
1564
1689
  ];
1565
1690
  };
1566
1691
  },
1567
1692
  {
1568
- name: 'validatorRegistered';
1569
- type: {
1570
- kind: 'struct';
1571
- fields: [
1693
+ "name": "validatorRegistered";
1694
+ "type": {
1695
+ "kind": "struct";
1696
+ "fields": [
1572
1697
  {
1573
- name: 'identity';
1574
- type: 'pubkey';
1698
+ "name": "identity";
1699
+ "type": "pubkey";
1575
1700
  },
1576
1701
  {
1577
- name: 'voteAccount';
1578
- type: 'pubkey';
1702
+ "name": "voteAccount";
1703
+ "type": "pubkey";
1579
1704
  },
1580
1705
  {
1581
- name: 'timestamp';
1582
- type: 'i64';
1706
+ "name": "timestamp";
1707
+ "type": "i64";
1583
1708
  }
1584
1709
  ];
1585
1710
  };
1586
1711
  }
1587
1712
  ];
1588
- constants: [
1713
+ "constants": [
1589
1714
  {
1590
- name: 'epochLockedSlotTail';
1591
- docs: [
1592
- 'Epoch slot index at the end of an epoch after which withdrawals are locked'
1715
+ "name": "epochLockedSlotTail";
1716
+ "docs": [
1717
+ "Epoch slot index at the end of an epoch after which withdrawals are locked"
1593
1718
  ];
1594
- type: 'u64';
1595
- value: '420000';
1719
+ "type": "u64";
1720
+ "value": "420000";
1596
1721
  }
1597
1722
  ];
1598
1723
  };
@@ -1664,6 +1789,28 @@ type ClaimProps = {
1664
1789
  reserve?: PublicKey;
1665
1790
  authority?: PublicKey;
1666
1791
  };
1792
+ type BondLockFunds = {
1793
+ bondType: BondType;
1794
+ name: string;
1795
+ amount: number;
1796
+ withdrawAuthority: PublicKey;
1797
+ voteAccount: PublicKey;
1798
+ collateralType?: CollateralType;
1799
+ };
1800
+ type BondReleaseFunds = {
1801
+ bondType: BondType;
1802
+ name: string;
1803
+ amount: number;
1804
+ withdrawAuthority: PublicKey;
1805
+ voteAccount: PublicKey;
1806
+ };
1807
+ type ClaimAllProps = {
1808
+ bondType: BondType;
1809
+ name: string;
1810
+ collateralType?: CollateralType;
1811
+ reserve?: PublicKey;
1812
+ authority?: PublicKey;
1813
+ };
1667
1814
  type GetHistoryProps = {
1668
1815
  voteAccount: PublicKey;
1669
1816
  options?: {
@@ -1757,7 +1904,7 @@ declare class NodeWallet implements Wallet {
1757
1904
  /**
1758
1905
  * Enum for different client environments.
1759
1906
  */
1760
- declare enum BondClientEnv {
1907
+ declare enum JBondClientEnv {
1761
1908
  DEV = "dev",
1762
1909
  STAGE = "stage",
1763
1910
  PROD = "prod"
@@ -1765,23 +1912,27 @@ declare enum BondClientEnv {
1765
1912
  /**
1766
1913
  * Options for configuring the JBondClient.
1767
1914
  */
1768
- type ClientOptions = {
1915
+ type JBondClientOptions = {
1769
1916
  debug?: boolean;
1770
1917
  } & Record<string, any>;
1771
1918
  declare class JBondClient {
1772
1919
  readonly provider: Provider;
1773
- readonly options: ClientOptions;
1920
+ readonly options: JBondClientOptions;
1774
1921
  readonly program: Program<Jbond>;
1775
- constructor(provider: Provider, options?: ClientOptions);
1922
+ constructor(provider: Provider, options?: JBondClientOptions);
1776
1923
  get history(): HistoryManager;
1924
+ /**
1925
+ * Creates a local instance of `JBondClient` for development and testing.
1926
+ */
1927
+ static local(options?: JBondClientOptions): JBondClient;
1777
1928
  /**
1778
1929
  * Creates an instance of `JBondClient` using a provided connection and wallet.
1779
1930
  */
1780
- static fromWallet(connection: Connection, wallet?: Wallet, options?: ClientOptions): JBondClient;
1931
+ static fromWallet(connection: Connection, wallet?: Wallet, options?: JBondClientOptions): JBondClient;
1781
1932
  /**
1782
1933
  * Creates an instance of `JBondClient` using the provided connection and keypair.
1783
1934
  */
1784
- static fromKeypair(connection: Connection, keypair: Keypair, options?: ClientOptions): JBondClient;
1935
+ static fromKeypair(connection: Connection, keypair: Keypair, options?: JBondClientOptions): JBondClient;
1785
1936
  /**
1786
1937
  * Get the current program ID.
1787
1938
  */
@@ -1793,11 +1944,11 @@ declare class JBondClient {
1793
1944
  /**
1794
1945
  * Set the environment.
1795
1946
  */
1796
- env(env: BondClientEnv): this;
1947
+ env(env: JBondClientEnv): this;
1797
1948
  /**
1798
1949
  * Configure a specific option.
1799
1950
  */
1800
- configure<K extends keyof ClientOptions>(key: K, val: ClientOptions[K]): this;
1951
+ configure<K extends keyof JBondClientOptions>(key: K, val: JBondClientOptions[K]): this;
1801
1952
  /**
1802
1953
  * Debug logging
1803
1954
  * @param args
@@ -1832,7 +1983,7 @@ declare class JBondClient {
1832
1983
  */
1833
1984
  withdrawCollateral(props: WithdrawCollateralProps): Promise<string | undefined>;
1834
1985
  /**
1835
- * Claim compensation
1986
+ * Claim compensation for a validator
1836
1987
  */
1837
1988
  claimCompensation(props: ClaimProps): Promise<string | undefined>;
1838
1989
  /**
@@ -1887,6 +2038,10 @@ declare class JBondClient {
1887
2038
  * Build claim instruction
1888
2039
  */
1889
2040
  getClaimIx(props: ClaimProps): Promise<TransactionInstruction>;
2041
+ /**
2042
+ * Build claim all compensations instructions
2043
+ */
2044
+ getClaimAllCompensationsIxs(props: ClaimAllProps): Promise<TransactionInstruction[]>;
1890
2045
  /**
1891
2046
  * Build set withdraw authority instruction
1892
2047
  */
@@ -1899,6 +2054,42 @@ declare class JBondClient {
1899
2054
  * Build start crowdfunding session instruction
1900
2055
  */
1901
2056
  getBondSessionStartIx(props: BondStartProps): Promise<TransactionInstruction>;
2057
+ lockFunds(props: BondLockFunds): Promise<string | undefined>;
2058
+ releaseFunds(props: BondReleaseFunds): Promise<string | undefined>;
2059
+ /**
2060
+ * Update epoch locks
2061
+ */
2062
+ updateEpochLocks(props: {
2063
+ bondType: BondType;
2064
+ bondName: string;
2065
+ voteAccount: PublicKeyInitData;
2066
+ }): Promise<string | undefined>;
2067
+ /**
2068
+ * Build update epoch locks instruction
2069
+ */
2070
+ getUpdateEpochLocksIx(props: {
2071
+ bondType: BondType;
2072
+ bondName: string;
2073
+ voteAccount: PublicKeyInitData;
2074
+ }): Promise<TransactionInstruction>;
2075
+ getTestSetLastUpdateEpochIx(props: {
2076
+ bondType: BondType;
2077
+ bondName: string;
2078
+ voteAccount: PublicKeyInitData;
2079
+ epoch: number;
2080
+ }): Promise<TransactionInstruction>;
2081
+ /**
2082
+ * Build lock funds instruction
2083
+ */
2084
+ getLockFundsIx(props: BondLockFunds): Promise<TransactionInstruction>;
2085
+ /**
2086
+ * Build release funds instruction
2087
+ */
2088
+ getReleaseFundsIx(props: BondReleaseFunds): Promise<TransactionInstruction>;
2089
+ /**
2090
+ * Get available collateral for withdrawal (taking into account locked funds)
2091
+ */
2092
+ getAvailableCollateral(bondType: BondType, bondName: string, voteAccount: PublicKeyInitData): Promise<number>;
1902
2093
  /**
1903
2094
  * Get all bond states with total collected collateral
1904
2095
  */
@@ -1952,7 +2143,7 @@ declare class JBondClient {
1952
2143
  bump: number;
1953
2144
  };
1954
2145
  stateStats: {
1955
- totalCollected: unknown;
2146
+ totalCollected: number;
1956
2147
  status: SessionStatus;
1957
2148
  };
1958
2149
  }[]>;
@@ -2026,26 +2217,37 @@ declare class JBondClient {
2026
2217
  withdrawalAuthority: PublicKey | null;
2027
2218
  createdAt: bn_js;
2028
2219
  bump: number;
2220
+ nextEpochLocked: bn_js;
2221
+ currentEpochLocked: bn_js;
2222
+ lastUpdateEpoch: bn_js;
2029
2223
  publicKey: PublicKey;
2030
2224
  }>;
2031
2225
  /**
2032
2226
  * Get validator bond account balance (in SOL)
2033
2227
  */
2034
2228
  getValidatorBondBalance(bondType: BondType, bondName: string, vote: PublicKeyInitData): Promise<number>;
2229
+ getBondStateValidatorBondBalances(bondType: BondType, bondName: string): Promise<{
2230
+ voteAccount: PublicKey;
2231
+ balance: number;
2232
+ }[]>;
2035
2233
  /**
2036
2234
  * Get total collected collateral for a bond state
2037
2235
  */
2038
- getBondStateTotalCollected(bondType: BondType, bondName: string, votes: PublicKeyInitData[]): Promise<unknown>;
2236
+ getBondStateTotalCollected(bondType: BondType, bondName: string): Promise<number>;
2039
2237
  /**
2040
2238
  * Get bond state stats
2041
2239
  * @param state
2042
2240
  * @private
2043
2241
  */
2044
2242
  private getBondStateStats;
2243
+ /**
2244
+ * Get validator bond rent exempt amount
2245
+ */
2246
+ private validatorBondRentExempt;
2045
2247
  /**
2046
2248
  * Get all validator bonds for a given bond state
2047
2249
  */
2048
- private getBondValidatorStates;
2250
+ private getValidatorBondsForState;
2049
2251
  /**
2050
2252
  * Get session status for bond state
2051
2253
  */
@@ -2062,4 +2264,4 @@ declare const CROWDFUNDING_BOND_SEED = "crowdfunding";
2062
2264
  */
2063
2265
  declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
2064
2266
 
2065
- export { BOND_STATE_SEED, BondClientEnv, type BondConfigureProps, type BondFinishProps, type BondInitializeProps, type BondStartProps, type BondState, type BondStateStats, type BondStateStatus, BondTransactionType, BondType, CROWDFUNDING_BOND_SEED, type ClaimProps, type ClientOptions, type CollateralType, ENV_PROGRAM_ID, type EpochHistoryItem, GLOBAL_STATE_SEED, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalConfigureProps, type GlobalInitializeProps, type GlobalState, JBondClient, type Jbond, NodeWallet, type RegisterValidatorProps, STANDARD_BOND_SEED, SessionStatus, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, VALIDATOR_BOND_SEED, type ValidatorBond, type WithdrawCollateralProps };
2267
+ export { BOND_STATE_SEED, type BondConfigureProps, type BondFinishProps, type BondInitializeProps, type BondLockFunds, type BondReleaseFunds, type BondStartProps, type BondState, type BondStateStats, type BondStateStatus, BondTransactionType, BondType, CROWDFUNDING_BOND_SEED, type ClaimAllProps, type ClaimProps, type CollateralType, ENV_PROGRAM_ID, type EpochHistoryItem, GLOBAL_STATE_SEED, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalConfigureProps, type GlobalInitializeProps, type GlobalState, JBondClient, JBondClientEnv, type JBondClientOptions, type Jbond, NodeWallet, type RegisterValidatorProps, STANDARD_BOND_SEED, SessionStatus, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, VALIDATOR_BOND_SEED, type ValidatorBond, type WithdrawCollateralProps };