@jpool/bond-sdk 0.9.0-next.16 → 0.9.0-next.17

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
@@ -31,28 +31,28 @@ declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
31
31
  * IDL can be found at `target/idl/jbond.json`.
32
32
  */
33
33
  type Jbond = {
34
- "address": "93BH9J99hQS3YinydR6SVjHuAEECoA9kR1BHwnXeDzQe";
35
- "metadata": {
36
- "name": "jbond";
37
- "version": "0.2.1";
38
- "spec": "0.1.0";
39
- "description": "Jpool Bond Program";
34
+ address: '93BH9J99hQS3YinydR6SVjHuAEECoA9kR1BHwnXeDzQe';
35
+ metadata: {
36
+ name: 'jbond';
37
+ version: '0.2.1';
38
+ spec: '0.1.0';
39
+ description: 'Jpool Bond Program';
40
40
  };
41
- "instructions": [
41
+ instructions: [
42
42
  {
43
- "name": "bondClaim";
44
- "docs": [
45
- "Claims compensation for a validator.",
46
- "Transfers funds from the validator's bond account to reserve.",
47
- "",
48
- "# Arguments",
49
- "* `amount` - Amount of compensation to claim (must be positive).",
50
- "",
51
- "# Errors",
52
- "Fails if the authority is invalid, if the validator is not active,",
53
- "if the amount is zero, or if there are insufficient funds."
43
+ name: 'bondClaim';
44
+ docs: [
45
+ 'Claims compensation for a validator.',
46
+ 'Transfers funds from the validator\'s bond account to reserve.',
47
+ '',
48
+ '# Arguments',
49
+ '* `amount` - Amount of compensation to claim (must be positive).',
50
+ '',
51
+ '# Errors',
52
+ 'Fails if the authority is invalid, if the validator is not active,',
53
+ 'if the amount is zero, or if there are insufficient funds.'
54
54
  ];
55
- "discriminator": [
55
+ discriminator: [
56
56
  151,
57
57
  92,
58
58
  10,
@@ -62,19 +62,19 @@ type Jbond = {
62
62
  188,
63
63
  129
64
64
  ];
65
- "accounts": [
65
+ accounts: [
66
66
  {
67
- "name": "bondState";
68
- "writable": true;
67
+ name: 'bondState';
68
+ writable: true;
69
69
  },
70
70
  {
71
- "name": "validatorBond";
72
- "writable": true;
73
- "pda": {
74
- "seeds": [
71
+ name: 'validatorBond';
72
+ writable: true;
73
+ pda: {
74
+ seeds: [
75
75
  {
76
- "kind": "const";
77
- "value": [
76
+ kind: 'const';
77
+ value: [
78
78
  118,
79
79
  97,
80
80
  108,
@@ -92,68 +92,68 @@ type Jbond = {
92
92
  ];
93
93
  },
94
94
  {
95
- "kind": "account";
96
- "path": "bondState";
95
+ kind: 'account';
96
+ path: 'bondState';
97
97
  },
98
98
  {
99
- "kind": "account";
100
- "path": "validator_bond.vote_account";
101
- "account": "validatorBond";
99
+ kind: 'account';
100
+ path: 'validator_bond.vote_account';
101
+ account: 'validatorBond';
102
102
  }
103
103
  ];
104
104
  };
105
105
  },
106
106
  {
107
- "name": "reserve";
108
- "writable": true;
107
+ name: 'reserve';
108
+ writable: true;
109
109
  },
110
110
  {
111
- "name": "authority";
112
- "signer": true;
111
+ name: 'authority';
112
+ signer: true;
113
113
  },
114
114
  {
115
- "name": "bondTokenAccount";
116
- "writable": true;
117
- "optional": true;
115
+ name: 'bondTokenAccount';
116
+ writable: true;
117
+ optional: true;
118
118
  },
119
119
  {
120
- "name": "reserveTokenAccount";
121
- "writable": true;
122
- "optional": true;
120
+ name: 'reserveTokenAccount';
121
+ writable: true;
122
+ optional: true;
123
123
  },
124
124
  {
125
- "name": "stakeAccount";
126
- "writable": true;
127
- "optional": true;
125
+ name: 'stakeAccount';
126
+ writable: true;
127
+ optional: true;
128
128
  },
129
129
  {
130
- "name": "systemProgram";
131
- "address": "11111111111111111111111111111111";
130
+ name: 'systemProgram';
131
+ address: '11111111111111111111111111111111';
132
132
  },
133
133
  {
134
- "name": "tokenProgram";
135
- "optional": true;
136
- "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
134
+ name: 'tokenProgram';
135
+ optional: true;
136
+ address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
137
137
  },
138
138
  {
139
- "name": "stakeProgram";
140
- "optional": true;
139
+ name: 'stakeProgram';
140
+ optional: true;
141
141
  }
142
142
  ];
143
- "args": [
143
+ args: [
144
144
  {
145
- "name": "amount";
146
- "type": "u64";
145
+ name: 'amount';
146
+ type: 'u64';
147
147
  }
148
148
  ];
149
149
  },
150
150
  {
151
- "name": "bondConfigure";
152
- "docs": [
153
- "Updates bond configuration, including authority and reserve fields.",
154
- "Allows changing the bond's authority and updating the reserve account."
151
+ name: 'bondConfigure';
152
+ docs: [
153
+ 'Updates bond configuration, including authority and reserve fields.',
154
+ 'Allows changing the bond\'s authority and updating the reserve account.'
155
155
  ];
156
- "discriminator": [
156
+ discriminator: [
157
157
  61,
158
158
  42,
159
159
  106,
@@ -163,36 +163,36 @@ type Jbond = {
163
163
  65,
164
164
  20
165
165
  ];
166
- "accounts": [
166
+ accounts: [
167
167
  {
168
- "name": "bondState";
169
- "writable": true;
168
+ name: 'bondState';
169
+ writable: true;
170
170
  },
171
171
  {
172
- "name": "authority";
173
- "signer": true;
174
- "relations": [
175
- "bondState"
172
+ name: 'authority';
173
+ signer: true;
174
+ relations: [
175
+ 'bondState'
176
176
  ];
177
177
  }
178
178
  ];
179
- "args": [
179
+ args: [
180
180
  {
181
- "name": "data";
182
- "type": {
183
- "defined": {
184
- "name": "bondConfigureData";
181
+ name: 'data';
182
+ type: {
183
+ defined: {
184
+ name: 'bondConfigureData';
185
185
  };
186
186
  };
187
187
  }
188
188
  ];
189
189
  },
190
190
  {
191
- "name": "bondDisable";
192
- "docs": [
193
- "Disables a validator's bond, preventing it from participating further."
191
+ name: 'bondDisable';
192
+ docs: [
193
+ 'Disables a validator\'s bond, preventing it from participating further.'
194
194
  ];
195
- "discriminator": [
195
+ discriminator: [
196
196
  159,
197
197
  156,
198
198
  97,
@@ -202,28 +202,28 @@ type Jbond = {
202
202
  117,
203
203
  129
204
204
  ];
205
- "accounts": [
205
+ accounts: [
206
206
  {
207
- "name": "bondState";
208
- "writable": true;
207
+ name: 'bondState';
208
+ writable: true;
209
209
  },
210
210
  {
211
- "name": "authority";
212
- "writable": true;
213
- "signer": true;
214
- "relations": [
215
- "bondState"
211
+ name: 'authority';
212
+ writable: true;
213
+ signer: true;
214
+ relations: [
215
+ 'bondState'
216
216
  ];
217
217
  }
218
218
  ];
219
- "args": [];
219
+ args: [];
220
220
  },
221
221
  {
222
- "name": "bondEnable";
223
- "docs": [
224
- "Enables a previously disabled validator's bond."
222
+ name: 'bondEnable';
223
+ docs: [
224
+ 'Enables a previously disabled validator\'s bond.'
225
225
  ];
226
- "discriminator": [
226
+ discriminator: [
227
227
  133,
228
228
  48,
229
229
  84,
@@ -233,33 +233,33 @@ type Jbond = {
233
233
  164,
234
234
  128
235
235
  ];
236
- "accounts": [
236
+ accounts: [
237
237
  {
238
- "name": "bondState";
239
- "writable": true;
238
+ name: 'bondState';
239
+ writable: true;
240
240
  },
241
241
  {
242
- "name": "authority";
243
- "writable": true;
244
- "signer": true;
245
- "relations": [
246
- "bondState"
242
+ name: 'authority';
243
+ writable: true;
244
+ signer: true;
245
+ relations: [
246
+ 'bondState'
247
247
  ];
248
248
  }
249
249
  ];
250
- "args": [];
250
+ args: [];
251
251
  },
252
252
  {
253
- "name": "bondInitialize";
254
- "docs": [
255
- "Initializes state for the bond.",
256
- "Sets the authority and reserve account for managing validator bonds.",
257
- "",
258
- "# Errors",
259
- "Fails if the global state account is already initialized or if the payer lacks",
260
- "sufficient funds."
253
+ name: 'bondInitialize';
254
+ docs: [
255
+ 'Initializes state for the bond.',
256
+ 'Sets the authority and reserve account for managing validator bonds.',
257
+ '',
258
+ '# Errors',
259
+ 'Fails if the global state account is already initialized or if the payer lacks',
260
+ 'sufficient funds.'
261
261
  ];
262
- "discriminator": [
262
+ discriminator: [
263
263
  230,
264
264
  3,
265
265
  121,
@@ -269,19 +269,18 @@ type Jbond = {
269
269
  175,
270
270
  210
271
271
  ];
272
- "accounts": [
272
+ accounts: [
273
273
  {
274
- "name": "globalState";
275
- "writable": true;
274
+ name: 'globalState';
276
275
  },
277
276
  {
278
- "name": "bondState";
279
- "writable": true;
280
- "pda": {
281
- "seeds": [
277
+ name: 'bondState';
278
+ writable: true;
279
+ pda: {
280
+ seeds: [
282
281
  {
283
- "kind": "const";
284
- "value": [
282
+ kind: 'const';
283
+ value: [
285
284
  98,
286
285
  111,
287
286
  110,
@@ -295,72 +294,75 @@ type Jbond = {
295
294
  ];
296
295
  },
297
296
  {
298
- "kind": "arg";
299
- "path": "data.bond_type";
297
+ kind: 'arg';
298
+ path: 'data.bond_type';
300
299
  },
301
300
  {
302
- "kind": "arg";
303
- "path": "data.name";
301
+ kind: 'arg';
302
+ path: 'data.name';
304
303
  }
305
304
  ];
306
305
  };
307
306
  },
308
307
  {
309
- "name": "authority";
310
- "writable": true;
311
- "signer": true;
308
+ name: 'authority';
309
+ writable: true;
310
+ signer: true;
311
+ relations: [
312
+ 'globalState'
313
+ ];
312
314
  },
313
315
  {
314
- "name": "reserve";
316
+ name: 'reserve';
315
317
  },
316
318
  {
317
- "name": "associatedTokenProgram";
318
- "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
319
+ name: 'associatedTokenProgram';
320
+ address: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
319
321
  },
320
322
  {
321
- "name": "systemProgram";
322
- "address": "11111111111111111111111111111111";
323
+ name: 'systemProgram';
324
+ address: '11111111111111111111111111111111';
323
325
  },
324
326
  {
325
- "name": "tokenProgram";
326
- "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
327
+ name: 'tokenProgram';
328
+ address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
327
329
  },
328
330
  {
329
- "name": "reserveTokenAccount";
330
- "writable": true;
331
- "optional": true;
331
+ name: 'reserveTokenAccount';
332
+ writable: true;
333
+ optional: true;
332
334
  },
333
335
  {
334
- "name": "mint";
335
- "optional": true;
336
+ name: 'mint';
337
+ optional: true;
336
338
  }
337
339
  ];
338
- "args": [
340
+ args: [
339
341
  {
340
- "name": "data";
341
- "type": {
342
- "defined": {
343
- "name": "bondInitializeData";
342
+ name: 'data';
343
+ type: {
344
+ defined: {
345
+ name: 'bondInitializeData';
344
346
  };
345
347
  };
346
348
  }
347
349
  ];
348
350
  },
349
351
  {
350
- "name": "bondRegister";
351
- "docs": [
352
- "Registers a new validator with the bond.",
353
- "Sets up the validator's bond account and deposits initial collateral.",
354
- "",
355
- "# Arguments",
356
- "* `initial_collateral` - Amount of collateral to lock (must be positive).",
357
- "* `withdrawal_authority` - Optional key that can withdraw collateral later.",
358
- "",
359
- "# Errors",
360
- "Fails if the validator is already registered, if the vote account is invalid,",
361
- "or if the initial collateral transfer fails."
352
+ name: 'bondRegister';
353
+ docs: [
354
+ 'Registers a new validator with the bond.',
355
+ 'Sets up the validator\'s bond account and deposits initial collateral.',
356
+ '',
357
+ '# Arguments',
358
+ '* `initial_collateral` - Amount of collateral to lock (must be positive).',
359
+ '* `withdrawal_authority` - Optional key that can withdraw collateral later.',
360
+ '',
361
+ '# Errors',
362
+ 'Fails if the validator is already registered, if the vote account is invalid,',
363
+ 'or if the initial collateral transfer fails.'
362
364
  ];
363
- "discriminator": [
365
+ discriminator: [
364
366
  117,
365
367
  127,
366
368
  78,
@@ -370,19 +372,19 @@ type Jbond = {
370
372
  163,
371
373
  83
372
374
  ];
373
- "accounts": [
375
+ accounts: [
374
376
  {
375
- "name": "bondState";
376
- "writable": true;
377
+ name: 'bondState';
378
+ writable: true;
377
379
  },
378
380
  {
379
- "name": "validatorBond";
380
- "writable": true;
381
- "pda": {
382
- "seeds": [
381
+ name: 'validatorBond';
382
+ writable: true;
383
+ pda: {
384
+ seeds: [
383
385
  {
384
- "kind": "const";
385
- "value": [
386
+ kind: 'const';
387
+ value: [
386
388
  118,
387
389
  97,
388
390
  108,
@@ -400,78 +402,78 @@ type Jbond = {
400
402
  ];
401
403
  },
402
404
  {
403
- "kind": "account";
404
- "path": "bondState";
405
+ kind: 'account';
406
+ path: 'bondState';
405
407
  },
406
408
  {
407
- "kind": "account";
408
- "path": "voteAccount";
409
+ kind: 'account';
410
+ path: 'voteAccount';
409
411
  }
410
412
  ];
411
413
  };
412
414
  },
413
415
  {
414
- "name": "identity";
416
+ name: 'identity';
415
417
  },
416
418
  {
417
- "name": "voteAccount";
419
+ name: 'voteAccount';
418
420
  },
419
421
  {
420
- "name": "creator";
421
- "writable": true;
422
- "signer": true;
422
+ name: 'creator';
423
+ writable: true;
424
+ signer: true;
423
425
  },
424
426
  {
425
- "name": "systemProgram";
426
- "address": "11111111111111111111111111111111";
427
+ name: 'systemProgram';
428
+ address: '11111111111111111111111111111111';
427
429
  },
428
430
  {
429
- "name": "tokenProgram";
430
- "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
431
+ name: 'tokenProgram';
432
+ address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
431
433
  },
432
434
  {
433
- "name": "associatedTokenProgram";
434
- "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
435
+ name: 'associatedTokenProgram';
436
+ address: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
435
437
  },
436
438
  {
437
- "name": "bondTokenAccount";
438
- "writable": true;
439
- "optional": true;
439
+ name: 'bondTokenAccount';
440
+ writable: true;
441
+ optional: true;
440
442
  },
441
443
  {
442
- "name": "mint";
443
- "optional": true;
444
+ name: 'mint';
445
+ optional: true;
444
446
  }
445
447
  ];
446
- "args": [
448
+ args: [
447
449
  {
448
- "name": "bondType";
449
- "type": {
450
- "defined": {
451
- "name": "bondType";
450
+ name: 'bondType';
451
+ type: {
452
+ defined: {
453
+ name: 'bondType';
452
454
  };
453
455
  };
454
456
  },
455
457
  {
456
- "name": "bondName";
457
- "type": "string";
458
+ name: 'bondName';
459
+ type: 'string';
458
460
  }
459
461
  ];
460
462
  },
461
463
  {
462
- "name": "bondSetWithdrawAuthority";
463
- "docs": [
464
- "Sets a new withdrawal authority for a validator's bond account.",
465
- "Allows changing who can withdraw collateral in the future.",
466
- "",
467
- "# Arguments",
468
- "* `new_withdraw_authority` - Optional new withdrawal authority key (None to restrict to",
469
- "identity).",
470
- "",
471
- "# Errors",
472
- "Fails if the signer is not authorized to change the withdrawal authority."
464
+ name: 'bondSetWithdrawAuthority';
465
+ docs: [
466
+ 'Sets a new withdrawal authority for a validator\'s bond account.',
467
+ 'Allows changing who can withdraw collateral in the future.',
468
+ '',
469
+ '# Arguments',
470
+ '* `new_withdraw_authority` - Optional new withdrawal authority key (None to restrict to',
471
+ 'identity).',
472
+ '',
473
+ '# Errors',
474
+ 'Fails if the signer is not authorized to change the withdrawal authority.'
473
475
  ];
474
- "discriminator": [
476
+ discriminator: [
475
477
  212,
476
478
  162,
477
479
  53,
@@ -481,18 +483,18 @@ type Jbond = {
481
483
  61,
482
484
  166
483
485
  ];
484
- "accounts": [
486
+ accounts: [
485
487
  {
486
- "name": "bondState";
488
+ name: 'bondState';
487
489
  },
488
490
  {
489
- "name": "validatorBond";
490
- "writable": true;
491
- "pda": {
492
- "seeds": [
491
+ name: 'validatorBond';
492
+ writable: true;
493
+ pda: {
494
+ seeds: [
493
495
  {
494
- "kind": "const";
495
- "value": [
496
+ kind: 'const';
497
+ value: [
496
498
  118,
497
499
  97,
498
500
  108,
@@ -510,42 +512,42 @@ type Jbond = {
510
512
  ];
511
513
  },
512
514
  {
513
- "kind": "account";
514
- "path": "bondState";
515
+ kind: 'account';
516
+ path: 'bondState';
515
517
  },
516
518
  {
517
- "kind": "account";
518
- "path": "validator_bond.vote_account";
519
- "account": "validatorBond";
519
+ kind: 'account';
520
+ path: 'validator_bond.vote_account';
521
+ account: 'validatorBond';
520
522
  }
521
523
  ];
522
524
  };
523
525
  },
524
526
  {
525
- "name": "identity";
526
- "signer": true;
527
+ name: 'identity';
528
+ signer: true;
527
529
  },
528
530
  {
529
- "name": "newWithdrawAuthority";
530
- "optional": true;
531
+ name: 'newWithdrawAuthority';
532
+ optional: true;
531
533
  }
532
534
  ];
533
- "args": [];
535
+ args: [];
534
536
  },
535
537
  {
536
- "name": "bondTopUp";
537
- "docs": [
538
- "Adds additional collateral to an existing validator's bond.",
539
- "Increases the collateral balance, enhancing the validator's stake.",
540
- "",
541
- "# Arguments",
542
- "* `amount` - Amount to add.",
543
- "",
544
- "# Errors",
545
- "Fails if the validator is not active, if the amount is zero,",
546
- "or if the transfer of funds fails."
538
+ name: 'bondTopUp';
539
+ docs: [
540
+ 'Adds additional collateral to an existing validator\'s bond.',
541
+ 'Increases the collateral balance, enhancing the validator\'s stake.',
542
+ '',
543
+ '# Arguments',
544
+ '* `amount` - Amount to add.',
545
+ '',
546
+ '# Errors',
547
+ 'Fails if the validator is not active, if the amount is zero,',
548
+ 'or if the transfer of funds fails.'
547
549
  ];
548
- "discriminator": [
550
+ discriminator: [
549
551
  132,
550
552
  225,
551
553
  254,
@@ -555,19 +557,19 @@ type Jbond = {
555
557
  176,
556
558
  66
557
559
  ];
558
- "accounts": [
560
+ accounts: [
559
561
  {
560
- "name": "bondState";
561
- "writable": true;
562
+ name: 'bondState';
563
+ writable: true;
562
564
  },
563
565
  {
564
- "name": "validatorBond";
565
- "writable": true;
566
- "pda": {
567
- "seeds": [
566
+ name: 'validatorBond';
567
+ writable: true;
568
+ pda: {
569
+ seeds: [
568
570
  {
569
- "kind": "const";
570
- "value": [
571
+ kind: 'const';
572
+ value: [
571
573
  118,
572
574
  97,
573
575
  108,
@@ -585,73 +587,73 @@ type Jbond = {
585
587
  ];
586
588
  },
587
589
  {
588
- "kind": "account";
589
- "path": "bondState";
590
+ kind: 'account';
591
+ path: 'bondState';
590
592
  },
591
593
  {
592
- "kind": "account";
593
- "path": "validator_bond.vote_account";
594
- "account": "validatorBond";
594
+ kind: 'account';
595
+ path: 'validator_bond.vote_account';
596
+ account: 'validatorBond';
595
597
  }
596
598
  ];
597
599
  };
598
600
  },
599
601
  {
600
- "name": "payer";
601
- "writable": true;
602
- "signer": true;
602
+ name: 'payer';
603
+ writable: true;
604
+ signer: true;
603
605
  },
604
606
  {
605
- "name": "payerTokenAccount";
606
- "writable": true;
607
- "optional": true;
607
+ name: 'payerTokenAccount';
608
+ writable: true;
609
+ optional: true;
608
610
  },
609
611
  {
610
- "name": "bondTokenAccount";
611
- "writable": true;
612
- "optional": true;
612
+ name: 'bondTokenAccount';
613
+ writable: true;
614
+ optional: true;
613
615
  },
614
616
  {
615
- "name": "stakeAccount";
616
- "writable": true;
617
- "optional": true;
617
+ name: 'stakeAccount';
618
+ writable: true;
619
+ optional: true;
618
620
  },
619
621
  {
620
- "name": "systemProgram";
621
- "address": "11111111111111111111111111111111";
622
+ name: 'systemProgram';
623
+ address: '11111111111111111111111111111111';
622
624
  },
623
625
  {
624
- "name": "tokenProgram";
625
- "optional": true;
626
- "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
626
+ name: 'tokenProgram';
627
+ optional: true;
628
+ address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
627
629
  },
628
630
  {
629
- "name": "stakeProgram";
630
- "optional": true;
631
+ name: 'stakeProgram';
632
+ optional: true;
631
633
  }
632
634
  ];
633
- "args": [
635
+ args: [
634
636
  {
635
- "name": "amount";
636
- "type": "u64";
637
+ name: 'amount';
638
+ type: 'u64';
637
639
  }
638
640
  ];
639
641
  },
640
642
  {
641
- "name": "bondWithdraw";
642
- "docs": [
643
- "Withdraws collateral from a validator's bond.",
644
- "Decreases the collateral balance, allowing the validator to reclaim funds.",
645
- "",
646
- "# Arguments",
647
- "* `amount` - Amount to withdraw (must not exceed available balance).",
648
- "",
649
- "# Errors",
650
- "Fails if the validator is not active, if the amount is zero,",
651
- "if the withdrawal authority is invalid, or if the withdrawal would",
652
- "leave insufficient collateral."
643
+ name: 'bondWithdraw';
644
+ docs: [
645
+ 'Withdraws collateral from a validator\'s bond.',
646
+ 'Decreases the collateral balance, allowing the validator to reclaim funds.',
647
+ '',
648
+ '# Arguments',
649
+ '* `amount` - Amount to withdraw (must not exceed available balance).',
650
+ '',
651
+ '# Errors',
652
+ 'Fails if the validator is not active, if the amount is zero,',
653
+ 'if the withdrawal authority is invalid, or if the withdrawal would',
654
+ 'leave insufficient collateral.'
653
655
  ];
654
- "discriminator": [
656
+ discriminator: [
655
657
  99,
656
658
  64,
657
659
  127,
@@ -661,19 +663,19 @@ type Jbond = {
661
663
  70,
662
664
  204
663
665
  ];
664
- "accounts": [
666
+ accounts: [
665
667
  {
666
- "name": "bondState";
667
- "writable": true;
668
+ name: 'bondState';
669
+ writable: true;
668
670
  },
669
671
  {
670
- "name": "validatorBond";
671
- "writable": true;
672
- "pda": {
673
- "seeds": [
672
+ name: 'validatorBond';
673
+ writable: true;
674
+ pda: {
675
+ seeds: [
674
676
  {
675
- "kind": "const";
676
- "value": [
677
+ kind: 'const';
678
+ value: [
677
679
  118,
678
680
  97,
679
681
  108,
@@ -691,65 +693,65 @@ type Jbond = {
691
693
  ];
692
694
  },
693
695
  {
694
- "kind": "account";
695
- "path": "bondState";
696
+ kind: 'account';
697
+ path: 'bondState';
696
698
  },
697
699
  {
698
- "kind": "account";
699
- "path": "validator_bond.vote_account";
700
- "account": "validatorBond";
700
+ kind: 'account';
701
+ path: 'validator_bond.vote_account';
702
+ account: 'validatorBond';
701
703
  }
702
704
  ];
703
705
  };
704
706
  },
705
707
  {
706
- "name": "withdrawalAuthority";
707
- "writable": true;
708
- "signer": true;
708
+ name: 'withdrawalAuthority';
709
+ writable: true;
710
+ signer: true;
709
711
  },
710
712
  {
711
- "name": "destination";
712
- "writable": true;
713
+ name: 'destination';
714
+ writable: true;
713
715
  },
714
716
  {
715
- "name": "destinationTokenAccount";
716
- "writable": true;
717
- "optional": true;
717
+ name: 'destinationTokenAccount';
718
+ writable: true;
719
+ optional: true;
718
720
  },
719
721
  {
720
- "name": "bondTokenAccount";
721
- "writable": true;
722
- "optional": true;
722
+ name: 'bondTokenAccount';
723
+ writable: true;
724
+ optional: true;
723
725
  },
724
726
  {
725
- "name": "stakeAccount";
726
- "writable": true;
727
- "optional": true;
727
+ name: 'stakeAccount';
728
+ writable: true;
729
+ optional: true;
728
730
  },
729
731
  {
730
- "name": "systemProgram";
731
- "address": "11111111111111111111111111111111";
732
+ name: 'systemProgram';
733
+ address: '11111111111111111111111111111111';
732
734
  },
733
735
  {
734
- "name": "tokenProgram";
735
- "optional": true;
736
- "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
736
+ name: 'tokenProgram';
737
+ optional: true;
738
+ address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
737
739
  },
738
740
  {
739
- "name": "stakeProgram";
740
- "optional": true;
741
+ name: 'stakeProgram';
742
+ optional: true;
741
743
  }
742
744
  ];
743
- "args": [
745
+ args: [
744
746
  {
745
- "name": "amount";
746
- "type": "u64";
747
+ name: 'amount';
748
+ type: 'u64';
747
749
  }
748
750
  ];
749
751
  },
750
752
  {
751
- "name": "globalConfigure";
752
- "discriminator": [
753
+ name: 'globalConfigure';
754
+ discriminator: [
753
755
  67,
754
756
  142,
755
757
  164,
@@ -759,15 +761,15 @@ type Jbond = {
759
761
  144,
760
762
  187
761
763
  ];
762
- "accounts": [
764
+ accounts: [
763
765
  {
764
- "name": "globalState";
765
- "writable": true;
766
- "pda": {
767
- "seeds": [
766
+ name: 'globalState';
767
+ writable: true;
768
+ pda: {
769
+ seeds: [
768
770
  {
769
- "kind": "const";
770
- "value": [
771
+ kind: 'const';
772
+ value: [
771
773
  103,
772
774
  108,
773
775
  111,
@@ -786,30 +788,30 @@ type Jbond = {
786
788
  };
787
789
  },
788
790
  {
789
- "name": "authority";
790
- "signer": true;
791
- "relations": [
792
- "globalState"
791
+ name: 'authority';
792
+ signer: true;
793
+ relations: [
794
+ 'globalState'
793
795
  ];
794
796
  }
795
797
  ];
796
- "args": [
798
+ args: [
797
799
  {
798
- "name": "data";
799
- "type": {
800
- "defined": {
801
- "name": "globalConfigureData";
800
+ name: 'data';
801
+ type: {
802
+ defined: {
803
+ name: 'globalConfigureData';
802
804
  };
803
805
  };
804
806
  }
805
807
  ];
806
808
  },
807
809
  {
808
- "name": "globalInitialize";
809
- "docs": [
810
- "----------------------------- Global Instructions ----------------------------"
810
+ name: 'globalInitialize';
811
+ docs: [
812
+ '----------------------------- Global Instructions ----------------------------'
811
813
  ];
812
- "discriminator": [
814
+ discriminator: [
813
815
  30,
814
816
  79,
815
817
  193,
@@ -819,15 +821,15 @@ type Jbond = {
819
821
  223,
820
822
  196
821
823
  ];
822
- "accounts": [
824
+ accounts: [
823
825
  {
824
- "name": "globalState";
825
- "writable": true;
826
- "pda": {
827
- "seeds": [
826
+ name: 'globalState';
827
+ writable: true;
828
+ pda: {
829
+ seeds: [
828
830
  {
829
- "kind": "const";
830
- "value": [
831
+ kind: 'const';
832
+ value: [
831
833
  103,
832
834
  108,
833
835
  111,
@@ -846,23 +848,23 @@ type Jbond = {
846
848
  };
847
849
  },
848
850
  {
849
- "name": "authority";
850
- "writable": true;
851
- "signer": true;
851
+ name: 'authority';
852
+ writable: true;
853
+ signer: true;
852
854
  },
853
855
  {
854
- "name": "systemProgram";
855
- "address": "11111111111111111111111111111111";
856
+ name: 'systemProgram';
857
+ address: '11111111111111111111111111111111';
856
858
  }
857
859
  ];
858
- "args": [];
860
+ args: [];
859
861
  },
860
862
  {
861
- "name": "sessionFinish";
862
- "docs": [
863
- "Finishes a bond, preventing further deposits and withdrawals."
863
+ name: 'sessionFinish';
864
+ docs: [
865
+ 'Finishes a bond, preventing further deposits and withdrawals.'
864
866
  ];
865
- "discriminator": [
867
+ discriminator: [
866
868
  230,
867
869
  209,
868
870
  54,
@@ -872,28 +874,28 @@ type Jbond = {
872
874
  137,
873
875
  113
874
876
  ];
875
- "accounts": [
877
+ accounts: [
876
878
  {
877
- "name": "bondState";
878
- "writable": true;
879
+ name: 'bondState';
880
+ writable: true;
879
881
  },
880
882
  {
881
- "name": "authority";
882
- "writable": true;
883
- "signer": true;
884
- "relations": [
885
- "bondState"
883
+ name: 'authority';
884
+ writable: true;
885
+ signer: true;
886
+ relations: [
887
+ 'bondState'
886
888
  ];
887
889
  }
888
890
  ];
889
- "args": [];
891
+ args: [];
890
892
  },
891
893
  {
892
- "name": "sessionStart";
893
- "docs": [
894
- "Starts a paused bond, allowing deposits and withdrawals to resume."
894
+ name: 'sessionStart';
895
+ docs: [
896
+ 'Starts a paused bond, allowing deposits and withdrawals to resume.'
895
897
  ];
896
- "discriminator": [
898
+ discriminator: [
897
899
  132,
898
900
  93,
899
901
  83,
@@ -903,32 +905,32 @@ type Jbond = {
903
905
  58,
904
906
  92
905
907
  ];
906
- "accounts": [
908
+ accounts: [
907
909
  {
908
- "name": "bondState";
909
- "writable": true;
910
+ name: 'bondState';
911
+ writable: true;
910
912
  },
911
913
  {
912
- "name": "authority";
913
- "writable": true;
914
- "signer": true;
915
- "relations": [
916
- "bondState"
914
+ name: 'authority';
915
+ writable: true;
916
+ signer: true;
917
+ relations: [
918
+ 'bondState'
917
919
  ];
918
920
  }
919
921
  ];
920
- "args": [
922
+ args: [
921
923
  {
922
- "name": "durationSecs";
923
- "type": "u64";
924
+ name: 'durationSecs';
925
+ type: 'u64';
924
926
  }
925
927
  ];
926
928
  }
927
929
  ];
928
- "accounts": [
930
+ accounts: [
929
931
  {
930
- "name": "bondState";
931
- "discriminator": [
932
+ name: 'bondState';
933
+ discriminator: [
932
934
  251,
933
935
  95,
934
936
  76,
@@ -940,8 +942,8 @@ type Jbond = {
940
942
  ];
941
943
  },
942
944
  {
943
- "name": "globalState";
944
- "discriminator": [
945
+ name: 'globalState';
946
+ discriminator: [
945
947
  163,
946
948
  46,
947
949
  74,
@@ -953,8 +955,8 @@ type Jbond = {
953
955
  ];
954
956
  },
955
957
  {
956
- "name": "validatorBond";
957
- "discriminator": [
958
+ name: 'validatorBond';
959
+ discriminator: [
958
960
  82,
959
961
  127,
960
962
  243,
@@ -966,10 +968,10 @@ type Jbond = {
966
968
  ];
967
969
  }
968
970
  ];
969
- "events": [
971
+ events: [
970
972
  {
971
- "name": "bondFinished";
972
- "discriminator": [
973
+ name: 'bondFinished';
974
+ discriminator: [
973
975
  223,
974
976
  254,
975
977
  3,
@@ -981,8 +983,8 @@ type Jbond = {
981
983
  ];
982
984
  },
983
985
  {
984
- "name": "bondStarted";
985
- "discriminator": [
986
+ name: 'bondStarted';
987
+ discriminator: [
986
988
  235,
987
989
  69,
988
990
  80,
@@ -994,8 +996,8 @@ type Jbond = {
994
996
  ];
995
997
  },
996
998
  {
997
- "name": "collateralToppedUp";
998
- "discriminator": [
999
+ name: 'collateralToppedUp';
1000
+ discriminator: [
999
1001
  189,
1000
1002
  137,
1001
1003
  204,
@@ -1007,8 +1009,8 @@ type Jbond = {
1007
1009
  ];
1008
1010
  },
1009
1011
  {
1010
- "name": "collateralWithdrawn";
1011
- "discriminator": [
1012
+ name: 'collateralWithdrawn';
1013
+ discriminator: [
1012
1014
  51,
1013
1015
  224,
1014
1016
  133,
@@ -1020,8 +1022,8 @@ type Jbond = {
1020
1022
  ];
1021
1023
  },
1022
1024
  {
1023
- "name": "compensationClaimed";
1024
- "discriminator": [
1025
+ name: 'compensationClaimed';
1026
+ discriminator: [
1025
1027
  36,
1026
1028
  159,
1027
1029
  41,
@@ -1033,8 +1035,8 @@ type Jbond = {
1033
1035
  ];
1034
1036
  },
1035
1037
  {
1036
- "name": "validatorRegistered";
1037
- "discriminator": [
1038
+ name: 'validatorRegistered';
1039
+ discriminator: [
1038
1040
  20,
1039
1041
  20,
1040
1042
  190,
@@ -1046,198 +1048,198 @@ type Jbond = {
1046
1048
  ];
1047
1049
  }
1048
1050
  ];
1049
- "errors": [
1051
+ errors: [
1050
1052
  {
1051
- "code": 6000;
1052
- "name": "invalidVoteAccount";
1053
- "msg": "Invalid vote account";
1053
+ code: 6000;
1054
+ name: 'invalidVoteAccount';
1055
+ msg: 'Invalid vote account';
1054
1056
  },
1055
1057
  {
1056
- "code": 6001;
1057
- "name": "identityMismatch";
1058
- "msg": "Identity does not match vote account";
1058
+ code: 6001;
1059
+ name: 'identityMismatch';
1060
+ msg: 'Identity does not match vote account';
1059
1061
  },
1060
1062
  {
1061
- "code": 6002;
1062
- "name": "insufficientCollateral";
1063
- "msg": "Insufficient collateral amount";
1063
+ code: 6002;
1064
+ name: 'insufficientCollateral';
1065
+ msg: 'Insufficient collateral amount';
1064
1066
  },
1065
1067
  {
1066
- "code": 6003;
1067
- "name": "targetAprTooLow";
1068
- "msg": "Target APR is below minimum threshold";
1068
+ code: 6003;
1069
+ name: 'targetAprTooLow';
1070
+ msg: 'Target APR is below minimum threshold';
1069
1071
  },
1070
1072
  {
1071
- "code": 6004;
1072
- "name": "mathOverflow";
1073
- "msg": "Math overflow";
1073
+ code: 6004;
1074
+ name: 'mathOverflow';
1075
+ msg: 'Math overflow';
1074
1076
  },
1075
1077
  {
1076
- "code": 6005;
1077
- "name": "invalidAmount";
1078
- "msg": "Invalid amount";
1078
+ code: 6005;
1079
+ name: 'invalidAmount';
1080
+ msg: 'Invalid amount';
1079
1081
  },
1080
1082
  {
1081
- "code": 6006;
1082
- "name": "validatorNotActive";
1083
- "msg": "Validator bond account is not active";
1083
+ code: 6006;
1084
+ name: 'validatorNotActive';
1085
+ msg: 'Validator bond account is not active';
1084
1086
  },
1085
1087
  {
1086
- "code": 6007;
1087
- "name": "validatorAlreadyRegistered";
1088
- "msg": "Validator already registered";
1088
+ code: 6007;
1089
+ name: 'validatorAlreadyRegistered';
1090
+ msg: 'Validator already registered';
1089
1091
  },
1090
1092
  {
1091
- "code": 6008;
1092
- "name": "unauthorized";
1093
- "msg": "unauthorized";
1093
+ code: 6008;
1094
+ name: 'unauthorized';
1095
+ msg: 'unauthorized';
1094
1096
  },
1095
1097
  {
1096
- "code": 6009;
1097
- "name": "withdrawalLockedNearEpochEnd";
1098
- "msg": "Withdrawals are locked near the end of the epoch.";
1098
+ code: 6009;
1099
+ name: 'withdrawalLockedNearEpochEnd';
1100
+ msg: 'Withdrawals are locked near the end of the epoch.';
1099
1101
  },
1100
1102
  {
1101
- "code": 6010;
1102
- "name": "missingTokenAccounts";
1103
- "msg": "Missing token accounts for token collateral type";
1103
+ code: 6010;
1104
+ name: 'missingTokenAccounts';
1105
+ msg: 'Missing token accounts for token collateral type';
1104
1106
  },
1105
1107
  {
1106
- "code": 6011;
1107
- "name": "missingTokenProgram";
1108
- "msg": "Token program is required for token collateral type";
1108
+ code: 6011;
1109
+ name: 'missingTokenProgram';
1110
+ msg: 'Token program is required for token collateral type';
1109
1111
  },
1110
1112
  {
1111
- "code": 6012;
1112
- "name": "invalidMint";
1113
- "msg": "Invalid mint for token collateral type";
1113
+ code: 6012;
1114
+ name: 'invalidMint';
1115
+ msg: 'Invalid mint for token collateral type';
1114
1116
  },
1115
1117
  {
1116
- "code": 6013;
1117
- "name": "missingStakeAccount";
1118
- "msg": "Stake account is required for stake account collateral type";
1118
+ code: 6013;
1119
+ name: 'missingStakeAccount';
1120
+ msg: 'Stake account is required for stake account collateral type';
1119
1121
  },
1120
1122
  {
1121
- "code": 6014;
1122
- "name": "missingStakeProgram";
1123
- "msg": "Stake program is required for stake account collateral type";
1123
+ code: 6014;
1124
+ name: 'missingStakeProgram';
1125
+ msg: 'Stake program is required for stake account collateral type';
1124
1126
  },
1125
1127
  {
1126
- "code": 6015;
1127
- "name": "bondFinished";
1128
- "msg": "Bond is finished (deposits/withdrawals disabled)";
1128
+ code: 6015;
1129
+ name: 'bondFinished';
1130
+ msg: 'Bond is finished (deposits/withdrawals disabled)';
1129
1131
  },
1130
1132
  {
1131
- "code": 6016;
1132
- "name": "bondNotFinished";
1133
- "msg": "Bond is not finished";
1133
+ code: 6016;
1134
+ name: 'bondNotFinished';
1135
+ msg: 'Bond is not finished';
1134
1136
  },
1135
1137
  {
1136
- "code": 6017;
1137
- "name": "unsupportedCollateralType";
1138
- "msg": "Unsupported collateral type";
1138
+ code: 6017;
1139
+ name: 'unsupportedCollateralType';
1140
+ msg: 'Unsupported collateral type';
1139
1141
  },
1140
1142
  {
1141
- "code": 6018;
1142
- "name": "overflow";
1143
- "msg": "Math operation overflowed";
1143
+ code: 6018;
1144
+ name: 'overflow';
1145
+ msg: 'Math operation overflowed';
1144
1146
  },
1145
1147
  {
1146
- "code": 6019;
1147
- "name": "incorrectBondType";
1148
- "msg": "Incorrect bond type for this operation";
1148
+ code: 6019;
1149
+ name: 'incorrectBondType';
1150
+ msg: 'Incorrect bond type for this operation';
1149
1151
  },
1150
1152
  {
1151
- "code": 6020;
1152
- "name": "bondNotFinishable";
1153
- "msg": "This bond type can't be finished";
1153
+ code: 6020;
1154
+ name: 'bondNotFinishable';
1155
+ msg: 'This bond type can\'t be finished';
1154
1156
  },
1155
1157
  {
1156
- "code": 6021;
1157
- "name": "invalidArgument";
1158
- "msg": "Invalid argument provided";
1158
+ code: 6021;
1159
+ name: 'invalidArgument';
1160
+ msg: 'Invalid argument provided';
1159
1161
  },
1160
1162
  {
1161
- "code": 6022;
1162
- "name": "bondNotDisabled";
1163
- "msg": "Bond is not disabled";
1163
+ code: 6022;
1164
+ name: 'bondNotDisabled';
1165
+ msg: 'Bond is not disabled';
1164
1166
  },
1165
1167
  {
1166
- "code": 6023;
1167
- "name": "bondNotEnabled";
1168
- "msg": "Bond is not enabled";
1168
+ code: 6023;
1169
+ name: 'bondNotEnabled';
1170
+ msg: 'Bond is not enabled';
1169
1171
  }
1170
1172
  ];
1171
- "types": [
1173
+ types: [
1172
1174
  {
1173
- "name": "bondConfigureData";
1174
- "type": {
1175
- "kind": "struct";
1176
- "fields": [
1175
+ name: 'bondConfigureData';
1176
+ type: {
1177
+ kind: 'struct';
1178
+ fields: [
1177
1179
  {
1178
- "name": "newReserve";
1179
- "type": {
1180
- "option": "pubkey";
1180
+ name: 'newReserve';
1181
+ type: {
1182
+ option: 'pubkey';
1181
1183
  };
1182
1184
  },
1183
1185
  {
1184
- "name": "newAuthority";
1185
- "type": {
1186
- "option": "pubkey";
1186
+ name: 'newAuthority';
1187
+ type: {
1188
+ option: 'pubkey';
1187
1189
  };
1188
1190
  }
1189
1191
  ];
1190
1192
  };
1191
1193
  },
1192
1194
  {
1193
- "name": "bondFinished";
1194
- "type": {
1195
- "kind": "struct";
1196
- "fields": [
1195
+ name: 'bondFinished';
1196
+ type: {
1197
+ kind: 'struct';
1198
+ fields: [
1197
1199
  {
1198
- "name": "bond";
1199
- "type": "pubkey";
1200
+ name: 'bond';
1201
+ type: 'pubkey';
1200
1202
  },
1201
1203
  {
1202
- "name": "authority";
1203
- "type": "pubkey";
1204
+ name: 'authority';
1205
+ type: 'pubkey';
1204
1206
  },
1205
1207
  {
1206
- "name": "timestamp";
1207
- "type": "i64";
1208
+ name: 'timestamp';
1209
+ type: 'i64';
1208
1210
  }
1209
1211
  ];
1210
1212
  };
1211
1213
  },
1212
1214
  {
1213
- "name": "bondInitializeData";
1214
- "docs": [
1215
- "Data required to initialize a performance bond"
1215
+ name: 'bondInitializeData';
1216
+ docs: [
1217
+ 'Data required to initialize a performance bond'
1216
1218
  ];
1217
- "type": {
1218
- "kind": "struct";
1219
- "fields": [
1219
+ type: {
1220
+ kind: 'struct';
1221
+ fields: [
1220
1222
  {
1221
- "name": "name";
1222
- "type": "string";
1223
+ name: 'name';
1224
+ type: 'string';
1223
1225
  },
1224
1226
  {
1225
- "name": "bondType";
1226
- "type": {
1227
- "defined": {
1228
- "name": "bondType";
1227
+ name: 'bondType';
1228
+ type: {
1229
+ defined: {
1230
+ name: 'bondType';
1229
1231
  };
1230
1232
  };
1231
1233
  },
1232
1234
  {
1233
- "name": "reserve";
1234
- "type": "pubkey";
1235
+ name: 'reserve';
1236
+ type: 'pubkey';
1235
1237
  },
1236
1238
  {
1237
- "name": "collateralType";
1238
- "type": {
1239
- "defined": {
1240
- "name": "collateralType";
1239
+ name: 'collateralType';
1240
+ type: {
1241
+ defined: {
1242
+ name: 'collateralType';
1241
1243
  };
1242
1244
  };
1243
1245
  }
@@ -1245,356 +1247,356 @@ type Jbond = {
1245
1247
  };
1246
1248
  },
1247
1249
  {
1248
- "name": "bondStarted";
1249
- "type": {
1250
- "kind": "struct";
1251
- "fields": [
1250
+ name: 'bondStarted';
1251
+ type: {
1252
+ kind: 'struct';
1253
+ fields: [
1252
1254
  {
1253
- "name": "bond";
1254
- "type": "pubkey";
1255
+ name: 'bond';
1256
+ type: 'pubkey';
1255
1257
  },
1256
1258
  {
1257
- "name": "authority";
1258
- "type": "pubkey";
1259
+ name: 'authority';
1260
+ type: 'pubkey';
1259
1261
  },
1260
1262
  {
1261
- "name": "timestamp";
1262
- "type": "i64";
1263
+ name: 'timestamp';
1264
+ type: 'i64';
1263
1265
  }
1264
1266
  ];
1265
1267
  };
1266
1268
  },
1267
1269
  {
1268
- "name": "bondState";
1269
- "type": {
1270
- "kind": "struct";
1271
- "fields": [
1270
+ name: 'bondState';
1271
+ type: {
1272
+ kind: 'struct';
1273
+ fields: [
1272
1274
  {
1273
- "name": "name";
1274
- "type": "string";
1275
+ name: 'name';
1276
+ type: 'string';
1275
1277
  },
1276
1278
  {
1277
- "name": "bondType";
1278
- "docs": [
1279
- "The type of bond (e.g., Performance, Crowdfunding)"
1279
+ name: 'bondType';
1280
+ docs: [
1281
+ 'The type of bond (e.g., Performance, Crowdfunding)'
1280
1282
  ];
1281
- "type": {
1282
- "defined": {
1283
- "name": "bondType";
1283
+ type: {
1284
+ defined: {
1285
+ name: 'bondType';
1284
1286
  };
1285
1287
  };
1286
1288
  },
1287
1289
  {
1288
- "name": "collateralType";
1289
- "docs": [
1290
- "The type of collateral accepted for this bond"
1290
+ name: 'collateralType';
1291
+ docs: [
1292
+ 'The type of collateral accepted for this bond'
1291
1293
  ];
1292
- "type": {
1293
- "defined": {
1294
- "name": "collateralType";
1294
+ type: {
1295
+ defined: {
1296
+ name: 'collateralType';
1295
1297
  };
1296
1298
  };
1297
1299
  },
1298
1300
  {
1299
- "name": "reserve";
1300
- "docs": [
1301
- "Reserve account where collateral is held"
1301
+ name: 'reserve';
1302
+ docs: [
1303
+ 'Reserve account where collateral is held'
1302
1304
  ];
1303
- "type": "pubkey";
1305
+ type: 'pubkey';
1304
1306
  },
1305
1307
  {
1306
- "name": "authority";
1307
- "docs": [
1308
- "Authority allowed to manage the bond configuration"
1308
+ name: 'authority';
1309
+ docs: [
1310
+ 'Authority allowed to manage the bond configuration'
1309
1311
  ];
1310
- "type": "pubkey";
1312
+ type: 'pubkey';
1311
1313
  },
1312
1314
  {
1313
- "name": "sessionId";
1314
- "docs": [
1315
- "Unique identifier for the bonding session"
1315
+ name: 'sessionId';
1316
+ docs: [
1317
+ 'Unique identifier for the bonding session'
1316
1318
  ];
1317
- "type": "u32";
1319
+ type: 'u32';
1318
1320
  },
1319
1321
  {
1320
- "name": "totalMembers";
1321
- "docs": [
1322
- "Total number of users who have participated in the bond"
1322
+ name: 'totalMembers';
1323
+ docs: [
1324
+ 'Total number of users who have participated in the bond'
1323
1325
  ];
1324
- "type": "u16";
1326
+ type: 'u16';
1325
1327
  },
1326
1328
  {
1327
- "name": "totalCompensationAmount";
1328
- "docs": [
1329
- "Total compensation amount paid out"
1329
+ name: 'totalCompensationAmount';
1330
+ docs: [
1331
+ 'Total compensation amount paid out'
1330
1332
  ];
1331
- "type": "u64";
1333
+ type: 'u64';
1332
1334
  },
1333
1335
  {
1334
- "name": "sessionStartTs";
1335
- "docs": [
1336
- "Start timestamp of the current session (unix seconds). 0 — not set."
1336
+ name: 'sessionStartTs';
1337
+ docs: [
1338
+ 'Start timestamp of the current session (unix seconds). 0 — not set.'
1337
1339
  ];
1338
- "type": "i64";
1340
+ type: 'i64';
1339
1341
  },
1340
1342
  {
1341
- "name": "sessionFinishTs";
1342
- "docs": [
1343
- "Finish timestamp of the current session (unix seconds). 0 — not set."
1343
+ name: 'sessionFinishTs';
1344
+ docs: [
1345
+ 'Finish timestamp of the current session (unix seconds). 0 — not set.'
1344
1346
  ];
1345
- "type": "i64";
1347
+ type: 'i64';
1346
1348
  },
1347
1349
  {
1348
- "name": "status";
1349
- "type": {
1350
- "defined": {
1351
- "name": "bondStatus";
1350
+ name: 'status';
1351
+ type: {
1352
+ defined: {
1353
+ name: 'bondStatus';
1352
1354
  };
1353
1355
  };
1354
1356
  },
1355
1357
  {
1356
- "name": "bump";
1357
- "docs": [
1358
- "Bump for the PDA"
1358
+ name: 'bump';
1359
+ docs: [
1360
+ 'Bump for the PDA'
1359
1361
  ];
1360
- "type": "u8";
1362
+ type: 'u8';
1361
1363
  }
1362
1364
  ];
1363
1365
  };
1364
1366
  },
1365
1367
  {
1366
- "name": "bondStatus";
1367
- "type": {
1368
- "kind": "enum";
1369
- "variants": [
1368
+ name: 'bondStatus';
1369
+ type: {
1370
+ kind: 'enum';
1371
+ variants: [
1370
1372
  {
1371
- "name": "active";
1373
+ name: 'active';
1372
1374
  },
1373
1375
  {
1374
- "name": "disabled";
1376
+ name: 'disabled';
1375
1377
  }
1376
1378
  ];
1377
1379
  };
1378
1380
  },
1379
1381
  {
1380
- "name": "bondType";
1381
- "docs": [
1382
- "Types of bonds supported by the program"
1382
+ name: 'bondType';
1383
+ docs: [
1384
+ 'Types of bonds supported by the program'
1383
1385
  ];
1384
- "type": {
1385
- "kind": "enum";
1386
- "variants": [
1386
+ type: {
1387
+ kind: 'enum';
1388
+ variants: [
1387
1389
  {
1388
- "name": "performance";
1390
+ name: 'performance';
1389
1391
  },
1390
1392
  {
1391
- "name": "crowdfunding";
1393
+ name: 'crowdfunding';
1392
1394
  }
1393
1395
  ];
1394
1396
  };
1395
1397
  },
1396
1398
  {
1397
- "name": "collateralToppedUp";
1398
- "type": {
1399
- "kind": "struct";
1400
- "fields": [
1399
+ name: 'collateralToppedUp';
1400
+ type: {
1401
+ kind: 'struct';
1402
+ fields: [
1401
1403
  {
1402
- "name": "validator";
1403
- "type": "pubkey";
1404
+ name: 'validator';
1405
+ type: 'pubkey';
1404
1406
  },
1405
1407
  {
1406
- "name": "amount";
1407
- "type": "u64";
1408
+ name: 'amount';
1409
+ type: 'u64';
1408
1410
  },
1409
1411
  {
1410
- "name": "postBalance";
1411
- "type": "u64";
1412
+ name: 'postBalance';
1413
+ type: 'u64';
1412
1414
  },
1413
1415
  {
1414
- "name": "timestamp";
1415
- "type": "i64";
1416
+ name: 'timestamp';
1417
+ type: 'i64';
1416
1418
  }
1417
1419
  ];
1418
1420
  };
1419
1421
  },
1420
1422
  {
1421
- "name": "collateralType";
1422
- "docs": [
1423
- "Types of collateral that can be used for bond deposit"
1423
+ name: 'collateralType';
1424
+ docs: [
1425
+ 'Types of collateral that can be used for bond deposit'
1424
1426
  ];
1425
- "type": {
1426
- "kind": "enum";
1427
- "variants": [
1427
+ type: {
1428
+ kind: 'enum';
1429
+ variants: [
1428
1430
  {
1429
- "name": "native";
1431
+ name: 'native';
1430
1432
  },
1431
1433
  {
1432
- "name": "stakeAccount";
1434
+ name: 'stakeAccount';
1433
1435
  },
1434
1436
  {
1435
- "name": "token";
1436
- "fields": [
1437
- "pubkey"
1437
+ name: 'token';
1438
+ fields: [
1439
+ 'pubkey'
1438
1440
  ];
1439
1441
  }
1440
1442
  ];
1441
1443
  };
1442
1444
  },
1443
1445
  {
1444
- "name": "collateralWithdrawn";
1445
- "type": {
1446
- "kind": "struct";
1447
- "fields": [
1446
+ name: 'collateralWithdrawn';
1447
+ type: {
1448
+ kind: 'struct';
1449
+ fields: [
1448
1450
  {
1449
- "name": "validator";
1450
- "type": "pubkey";
1451
+ name: 'validator';
1452
+ type: 'pubkey';
1451
1453
  },
1452
1454
  {
1453
- "name": "amount";
1454
- "type": "u64";
1455
+ name: 'amount';
1456
+ type: 'u64';
1455
1457
  },
1456
1458
  {
1457
- "name": "postBalance";
1458
- "type": "u64";
1459
+ name: 'postBalance';
1460
+ type: 'u64';
1459
1461
  },
1460
1462
  {
1461
- "name": "timestamp";
1462
- "type": "i64";
1463
+ name: 'timestamp';
1464
+ type: 'i64';
1463
1465
  }
1464
1466
  ];
1465
1467
  };
1466
1468
  },
1467
1469
  {
1468
- "name": "compensationClaimed";
1469
- "type": {
1470
- "kind": "struct";
1471
- "fields": [
1470
+ name: 'compensationClaimed';
1471
+ type: {
1472
+ kind: 'struct';
1473
+ fields: [
1472
1474
  {
1473
- "name": "validator";
1474
- "type": "pubkey";
1475
+ name: 'validator';
1476
+ type: 'pubkey';
1475
1477
  },
1476
1478
  {
1477
- "name": "amount";
1478
- "type": "u64";
1479
+ name: 'amount';
1480
+ type: 'u64';
1479
1481
  },
1480
1482
  {
1481
- "name": "postBalance";
1482
- "type": "u64";
1483
+ name: 'postBalance';
1484
+ type: 'u64';
1483
1485
  },
1484
1486
  {
1485
- "name": "epoch";
1486
- "type": "u64";
1487
+ name: 'epoch';
1488
+ type: 'u64';
1487
1489
  },
1488
1490
  {
1489
- "name": "timestamp";
1490
- "type": "i64";
1491
+ name: 'timestamp';
1492
+ type: 'i64';
1491
1493
  }
1492
1494
  ];
1493
1495
  };
1494
1496
  },
1495
1497
  {
1496
- "name": "globalConfigureData";
1497
- "type": {
1498
- "kind": "struct";
1499
- "fields": [
1498
+ name: 'globalConfigureData';
1499
+ type: {
1500
+ kind: 'struct';
1501
+ fields: [
1500
1502
  {
1501
- "name": "newAuthority";
1502
- "type": {
1503
- "option": "pubkey";
1503
+ name: 'newAuthority';
1504
+ type: {
1505
+ option: 'pubkey';
1504
1506
  };
1505
1507
  }
1506
1508
  ];
1507
1509
  };
1508
1510
  },
1509
1511
  {
1510
- "name": "globalState";
1511
- "type": {
1512
- "kind": "struct";
1513
- "fields": [
1512
+ name: 'globalState';
1513
+ type: {
1514
+ kind: 'struct';
1515
+ fields: [
1514
1516
  {
1515
- "name": "authority";
1516
- "docs": [
1517
- "The authority allowed to manage the program"
1517
+ name: 'authority';
1518
+ docs: [
1519
+ 'The authority allowed to manage the program'
1518
1520
  ];
1519
- "type": "pubkey";
1521
+ type: 'pubkey';
1520
1522
  },
1521
1523
  {
1522
- "name": "bump";
1523
- "docs": [
1524
- "Bump for the PDA"
1524
+ name: 'bump';
1525
+ docs: [
1526
+ 'Bump for the PDA'
1525
1527
  ];
1526
- "type": "u8";
1528
+ type: 'u8';
1527
1529
  }
1528
1530
  ];
1529
1531
  };
1530
1532
  },
1531
1533
  {
1532
- "name": "validatorBond";
1533
- "type": {
1534
- "kind": "struct";
1535
- "fields": [
1534
+ name: 'validatorBond';
1535
+ type: {
1536
+ kind: 'struct';
1537
+ fields: [
1536
1538
  {
1537
- "name": "state";
1538
- "type": "pubkey";
1539
+ name: 'state';
1540
+ type: 'pubkey';
1539
1541
  },
1540
1542
  {
1541
- "name": "identity";
1542
- "type": "pubkey";
1543
+ name: 'identity';
1544
+ type: 'pubkey';
1543
1545
  },
1544
1546
  {
1545
- "name": "voteAccount";
1546
- "type": "pubkey";
1547
+ name: 'voteAccount';
1548
+ type: 'pubkey';
1547
1549
  },
1548
1550
  {
1549
- "name": "creator";
1550
- "type": "pubkey";
1551
+ name: 'creator';
1552
+ type: 'pubkey';
1551
1553
  },
1552
1554
  {
1553
- "name": "withdrawalAuthority";
1554
- "type": {
1555
- "option": "pubkey";
1555
+ name: 'withdrawalAuthority';
1556
+ type: {
1557
+ option: 'pubkey';
1556
1558
  };
1557
1559
  },
1558
1560
  {
1559
- "name": "createdAt";
1560
- "type": "i64";
1561
+ name: 'createdAt';
1562
+ type: 'i64';
1561
1563
  },
1562
1564
  {
1563
- "name": "bump";
1564
- "type": "u8";
1565
+ name: 'bump';
1566
+ type: 'u8';
1565
1567
  }
1566
1568
  ];
1567
1569
  };
1568
1570
  },
1569
1571
  {
1570
- "name": "validatorRegistered";
1571
- "type": {
1572
- "kind": "struct";
1573
- "fields": [
1572
+ name: 'validatorRegistered';
1573
+ type: {
1574
+ kind: 'struct';
1575
+ fields: [
1574
1576
  {
1575
- "name": "identity";
1576
- "type": "pubkey";
1577
+ name: 'identity';
1578
+ type: 'pubkey';
1577
1579
  },
1578
1580
  {
1579
- "name": "voteAccount";
1580
- "type": "pubkey";
1581
+ name: 'voteAccount';
1582
+ type: 'pubkey';
1581
1583
  },
1582
1584
  {
1583
- "name": "timestamp";
1584
- "type": "i64";
1585
+ name: 'timestamp';
1586
+ type: 'i64';
1585
1587
  }
1586
1588
  ];
1587
1589
  };
1588
1590
  }
1589
1591
  ];
1590
- "constants": [
1592
+ constants: [
1591
1593
  {
1592
- "name": "epochLockedSlotTail";
1593
- "docs": [
1594
- "Epoch slot index at the end of an epoch after which withdrawals are locked"
1594
+ name: 'epochLockedSlotTail';
1595
+ docs: [
1596
+ 'Epoch slot index at the end of an epoch after which withdrawals are locked'
1595
1597
  ];
1596
- "type": "u64";
1597
- "value": "420000";
1598
+ type: 'u64';
1599
+ value: '420000';
1598
1600
  }
1599
1601
  ];
1600
1602
  };
@@ -1911,6 +1913,7 @@ declare class JBondClient {
1911
1913
  * Fetch bond state with stats
1912
1914
  * @param bondType - Type of the bond
1913
1915
  * @param bondName - Name of the bond
1916
+ * @param withStats
1914
1917
  */
1915
1918
  getBondState(bondType: BondType, bondName: string, withStats?: boolean): Promise<[BondState, BondStateStats | null]>;
1916
1919
  /**
@@ -1921,13 +1924,12 @@ declare class JBondClient {
1921
1924
  * Get session status for bond state
1922
1925
  */
1923
1926
  private getBondStateSessionStatus;
1924
- /** Get all validator bonds for a given bond state */
1927
+ /**
1928
+ * Get all validator bonds for a given bond state
1929
+ */
1925
1930
  private getValidatorBondsByState;
1926
1931
  /**
1927
1932
  * Fetch validator bond data or null if not found
1928
- * @param bondType
1929
- * @param bondName
1930
- * @param vote
1931
1933
  */
1932
1934
  getValidatorBond(bondType: BondType, bondName: string, vote: PublicKeyInitData): Promise<ValidatorBond | null>;
1933
1935
  /**
@@ -1942,7 +1944,15 @@ declare class JBondClient {
1942
1944
  * @return Balance in lamports
1943
1945
  */
1944
1946
  getValidatorBondBalance(bondType: BondType, bondName: string, vote: PublicKeyInitData): Promise<number>;
1947
+ /**
1948
+ * Get total collected collateral for a bond state
1949
+ */
1945
1950
  getBondStateTotalCollected(bondType: BondType, bondName: string, votes: PublicKeyInitData[]): Promise<number>;
1951
+ /**
1952
+ * Get bond state stats
1953
+ * @param state
1954
+ * @private
1955
+ */
1946
1956
  private getBondStateStats;
1947
1957
  /**
1948
1958
  * Load stake pool account and cache it if not already cached