@jpool/bond-sdk 0.10.4 → 0.10.5

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
@@ -1,19 +1,8 @@
1
1
  import * as bn_js from 'bn.js';
2
- import { IdlTypes, IdlAccounts, Program, Provider } from '@coral-xyz/anchor';
3
- import { PublicKey, Connection, PublicKeyInitData, Transaction, VersionedTransaction, Keypair, TransactionInstruction } from '@solana/web3.js';
4
-
5
- declare const JPOOL_STAKE_POOL: PublicKey;
6
- declare enum Seeds {
7
- GlobalState = "global_state",
8
- BondState = "bond_state",
9
- ValidatorBond = "validator_bond",
10
- StandardBond = "standard",
11
- CrowdFundingBond = "crowdfunding"
12
- }
13
- /**
14
- * Program IDs for different environments
15
- */
16
- declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
2
+ import * as _coral_xyz_anchor from '@coral-xyz/anchor';
3
+ import { IdlTypes, IdlAccounts, Provider, Program } from '@coral-xyz/anchor';
4
+ import * as _solana_web3_js from '@solana/web3.js';
5
+ import { PublicKey, PublicKeyInitData, Cluster, Transaction, VersionedTransaction, Keypair, Connection, TransactionInstruction } from '@solana/web3.js';
17
6
 
18
7
  /**
19
8
  * Program IDL in camelCase format in order to be used in JS/TS.
@@ -22,28 +11,28 @@ declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
22
11
  * IDL can be found at `target/idl/jbond.json`.
23
12
  */
24
13
  type Jbond = {
25
- "address": "BondQ7KqZreTcW2UbeTNDcLCJQ3aXAtLn2Fm6ftaJDU";
26
- "metadata": {
27
- "name": "jbond";
28
- "version": "0.2.1";
29
- "spec": "0.1.0";
30
- "description": "Jpool Bond Program";
14
+ address: 'BondQ7KqZreTcW2UbeTNDcLCJQ3aXAtLn2Fm6ftaJDU';
15
+ metadata: {
16
+ name: 'jbond';
17
+ version: '0.2.1';
18
+ spec: '0.1.0';
19
+ description: 'Jpool Bond Program';
31
20
  };
32
- "instructions": [
21
+ instructions: [
33
22
  {
34
- "name": "bondClaim";
35
- "docs": [
36
- "Claims compensation for a validator.",
37
- "Transfers funds from the validator's bond account to reserve.",
38
- "",
39
- "# Arguments",
40
- "* `amount` - Amount of compensation to claim (must be positive).",
41
- "",
42
- "# Errors",
43
- "Fails if the authority is invalid, if the validator is not active,",
44
- "if the amount is zero, or if there are insufficient funds."
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.'
45
34
  ];
46
- "discriminator": [
35
+ discriminator: [
47
36
  151,
48
37
  92,
49
38
  10,
@@ -53,19 +42,19 @@ type Jbond = {
53
42
  188,
54
43
  129
55
44
  ];
56
- "accounts": [
45
+ accounts: [
57
46
  {
58
- "name": "bondState";
59
- "writable": true;
47
+ name: 'bondState';
48
+ writable: true;
60
49
  },
61
50
  {
62
- "name": "validatorBond";
63
- "writable": true;
64
- "pda": {
65
- "seeds": [
51
+ name: 'validatorBond';
52
+ writable: true;
53
+ pda: {
54
+ seeds: [
66
55
  {
67
- "kind": "const";
68
- "value": [
56
+ kind: 'const';
57
+ value: [
69
58
  118,
70
59
  97,
71
60
  108,
@@ -83,68 +72,68 @@ type Jbond = {
83
72
  ];
84
73
  },
85
74
  {
86
- "kind": "account";
87
- "path": "bondState";
75
+ kind: 'account';
76
+ path: 'bondState';
88
77
  },
89
78
  {
90
- "kind": "account";
91
- "path": "validator_bond.vote_account";
92
- "account": "validatorBond";
79
+ kind: 'account';
80
+ path: 'validator_bond.vote_account';
81
+ account: 'validatorBond';
93
82
  }
94
83
  ];
95
84
  };
96
85
  },
97
86
  {
98
- "name": "reserve";
99
- "writable": true;
87
+ name: 'reserve';
88
+ writable: true;
100
89
  },
101
90
  {
102
- "name": "authority";
103
- "signer": true;
91
+ name: 'authority';
92
+ signer: true;
104
93
  },
105
94
  {
106
- "name": "bondTokenAccount";
107
- "writable": true;
108
- "optional": true;
95
+ name: 'bondTokenAccount';
96
+ writable: true;
97
+ optional: true;
109
98
  },
110
99
  {
111
- "name": "reserveTokenAccount";
112
- "writable": true;
113
- "optional": true;
100
+ name: 'reserveTokenAccount';
101
+ writable: true;
102
+ optional: true;
114
103
  },
115
104
  {
116
- "name": "stakeAccount";
117
- "writable": true;
118
- "optional": true;
105
+ name: 'stakeAccount';
106
+ writable: true;
107
+ optional: true;
119
108
  },
120
109
  {
121
- "name": "systemProgram";
122
- "address": "11111111111111111111111111111111";
110
+ name: 'systemProgram';
111
+ address: '11111111111111111111111111111111';
123
112
  },
124
113
  {
125
- "name": "tokenProgram";
126
- "optional": true;
127
- "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
114
+ name: 'tokenProgram';
115
+ optional: true;
116
+ address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
128
117
  },
129
118
  {
130
- "name": "stakeProgram";
131
- "optional": true;
119
+ name: 'stakeProgram';
120
+ optional: true;
132
121
  }
133
122
  ];
134
- "args": [
123
+ args: [
135
124
  {
136
- "name": "amount";
137
- "type": "u64";
125
+ name: 'amount';
126
+ type: 'u64';
138
127
  }
139
128
  ];
140
129
  },
141
130
  {
142
- "name": "bondConfigure";
143
- "docs": [
144
- "Updates bond configuration, including authority and reserve fields.",
145
- "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.'
146
135
  ];
147
- "discriminator": [
136
+ discriminator: [
148
137
  61,
149
138
  42,
150
139
  106,
@@ -154,41 +143,41 @@ type Jbond = {
154
143
  65,
155
144
  20
156
145
  ];
157
- "accounts": [
146
+ accounts: [
158
147
  {
159
- "name": "bondState";
160
- "writable": true;
148
+ name: 'bondState';
149
+ writable: true;
161
150
  },
162
151
  {
163
- "name": "authority";
164
- "signer": true;
165
- "relations": [
166
- "bondState"
152
+ name: 'authority';
153
+ signer: true;
154
+ relations: [
155
+ 'bondState'
167
156
  ];
168
157
  }
169
158
  ];
170
- "args": [
159
+ args: [
171
160
  {
172
- "name": "data";
173
- "type": {
174
- "defined": {
175
- "name": "bondConfigureData";
161
+ name: 'data';
162
+ type: {
163
+ defined: {
164
+ name: 'bondConfigureData';
176
165
  };
177
166
  };
178
167
  }
179
168
  ];
180
169
  },
181
170
  {
182
- "name": "bondInitialize";
183
- "docs": [
184
- "Initializes state for the bond.",
185
- "Sets the authority and reserve account for managing validator bonds.",
186
- "",
187
- "# Errors",
188
- "Fails if the global state account is already initialized or if the payer lacks",
189
- "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.'
190
179
  ];
191
- "discriminator": [
180
+ discriminator: [
192
181
  230,
193
182
  3,
194
183
  121,
@@ -198,15 +187,15 @@ type Jbond = {
198
187
  175,
199
188
  210
200
189
  ];
201
- "accounts": [
190
+ accounts: [
202
191
  {
203
- "name": "bondState";
204
- "writable": true;
205
- "pda": {
206
- "seeds": [
192
+ name: 'bondState';
193
+ writable: true;
194
+ pda: {
195
+ seeds: [
207
196
  {
208
- "kind": "const";
209
- "value": [
197
+ kind: 'const';
198
+ value: [
210
199
  98,
211
200
  111,
212
201
  110,
@@ -220,72 +209,72 @@ type Jbond = {
220
209
  ];
221
210
  },
222
211
  {
223
- "kind": "arg";
224
- "path": "data.bond_type";
212
+ kind: 'arg';
213
+ path: 'data.bond_type';
225
214
  },
226
215
  {
227
- "kind": "arg";
228
- "path": "data.name";
216
+ kind: 'arg';
217
+ path: 'data.name';
229
218
  }
230
219
  ];
231
220
  };
232
221
  },
233
222
  {
234
- "name": "authority";
235
- "writable": true;
236
- "signer": true;
223
+ name: 'authority';
224
+ writable: true;
225
+ signer: true;
237
226
  },
238
227
  {
239
- "name": "reserve";
228
+ name: 'reserve';
240
229
  },
241
230
  {
242
- "name": "associatedTokenProgram";
243
- "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
231
+ name: 'associatedTokenProgram';
232
+ address: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
244
233
  },
245
234
  {
246
- "name": "systemProgram";
247
- "address": "11111111111111111111111111111111";
235
+ name: 'systemProgram';
236
+ address: '11111111111111111111111111111111';
248
237
  },
249
238
  {
250
- "name": "tokenProgram";
251
- "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
239
+ name: 'tokenProgram';
240
+ address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
252
241
  },
253
242
  {
254
- "name": "reserveTokenAccount";
255
- "writable": true;
256
- "optional": true;
243
+ name: 'reserveTokenAccount';
244
+ writable: true;
245
+ optional: true;
257
246
  },
258
247
  {
259
- "name": "mint";
260
- "optional": true;
248
+ name: 'mint';
249
+ optional: true;
261
250
  }
262
251
  ];
263
- "args": [
252
+ args: [
264
253
  {
265
- "name": "data";
266
- "type": {
267
- "defined": {
268
- "name": "bondInitializeData";
254
+ name: 'data';
255
+ type: {
256
+ defined: {
257
+ name: 'bondInitializeData';
269
258
  };
270
259
  };
271
260
  }
272
261
  ];
273
262
  },
274
263
  {
275
- "name": "bondRegister";
276
- "docs": [
277
- "Registers a new validator with the bond.",
278
- "Sets up the validator's bond account and deposits initial collateral.",
279
- "",
280
- "# Arguments",
281
- "* `initial_collateral` - Amount of collateral to lock (must be positive).",
282
- "* `withdrawal_authority` - Optional key that can withdraw collateral later.",
283
- "",
284
- "# Errors",
285
- "Fails if the validator is already registered, if the vote account is invalid,",
286
- "or if the initial collateral transfer fails."
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.'
287
276
  ];
288
- "discriminator": [
277
+ discriminator: [
289
278
  117,
290
279
  127,
291
280
  78,
@@ -295,19 +284,19 @@ type Jbond = {
295
284
  163,
296
285
  83
297
286
  ];
298
- "accounts": [
287
+ accounts: [
299
288
  {
300
- "name": "bondState";
301
- "writable": true;
289
+ name: 'bondState';
290
+ writable: true;
302
291
  },
303
292
  {
304
- "name": "validatorBond";
305
- "writable": true;
306
- "pda": {
307
- "seeds": [
293
+ name: 'validatorBond';
294
+ writable: true;
295
+ pda: {
296
+ seeds: [
308
297
  {
309
- "kind": "const";
310
- "value": [
298
+ kind: 'const';
299
+ value: [
311
300
  118,
312
301
  97,
313
302
  108,
@@ -325,78 +314,78 @@ type Jbond = {
325
314
  ];
326
315
  },
327
316
  {
328
- "kind": "account";
329
- "path": "bondState";
317
+ kind: 'account';
318
+ path: 'bondState';
330
319
  },
331
320
  {
332
- "kind": "account";
333
- "path": "voteAccount";
321
+ kind: 'account';
322
+ path: 'voteAccount';
334
323
  }
335
324
  ];
336
325
  };
337
326
  },
338
327
  {
339
- "name": "identity";
328
+ name: 'identity';
340
329
  },
341
330
  {
342
- "name": "voteAccount";
331
+ name: 'voteAccount';
343
332
  },
344
333
  {
345
- "name": "creator";
346
- "writable": true;
347
- "signer": true;
334
+ name: 'creator';
335
+ writable: true;
336
+ signer: true;
348
337
  },
349
338
  {
350
- "name": "systemProgram";
351
- "address": "11111111111111111111111111111111";
339
+ name: 'systemProgram';
340
+ address: '11111111111111111111111111111111';
352
341
  },
353
342
  {
354
- "name": "tokenProgram";
355
- "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
343
+ name: 'tokenProgram';
344
+ address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
356
345
  },
357
346
  {
358
- "name": "associatedTokenProgram";
359
- "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
347
+ name: 'associatedTokenProgram';
348
+ address: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
360
349
  },
361
350
  {
362
- "name": "bondTokenAccount";
363
- "writable": true;
364
- "optional": true;
351
+ name: 'bondTokenAccount';
352
+ writable: true;
353
+ optional: true;
365
354
  },
366
355
  {
367
- "name": "mint";
368
- "optional": true;
356
+ name: 'mint';
357
+ optional: true;
369
358
  }
370
359
  ];
371
- "args": [
360
+ args: [
372
361
  {
373
- "name": "bondType";
374
- "type": {
375
- "defined": {
376
- "name": "bondType";
362
+ name: 'bondType';
363
+ type: {
364
+ defined: {
365
+ name: 'bondType';
377
366
  };
378
367
  };
379
368
  },
380
369
  {
381
- "name": "bondName";
382
- "type": "string";
370
+ name: 'bondName';
371
+ type: 'string';
383
372
  }
384
373
  ];
385
374
  },
386
375
  {
387
- "name": "bondSetWithdrawAuthority";
388
- "docs": [
389
- "Sets a new withdrawal authority for a validator's bond account.",
390
- "Allows changing who can withdraw collateral in the future.",
391
- "",
392
- "# Arguments",
393
- "* `new_withdraw_authority` - Optional new withdrawal authority key (None to restrict to",
394
- "identity).",
395
- "",
396
- "# Errors",
397
- "Fails if the signer is not authorized to change the withdrawal authority."
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.'
398
387
  ];
399
- "discriminator": [
388
+ discriminator: [
400
389
  212,
401
390
  162,
402
391
  53,
@@ -406,18 +395,18 @@ type Jbond = {
406
395
  61,
407
396
  166
408
397
  ];
409
- "accounts": [
398
+ accounts: [
410
399
  {
411
- "name": "bondState";
400
+ name: 'bondState';
412
401
  },
413
402
  {
414
- "name": "validatorBond";
415
- "writable": true;
416
- "pda": {
417
- "seeds": [
403
+ name: 'validatorBond';
404
+ writable: true;
405
+ pda: {
406
+ seeds: [
418
407
  {
419
- "kind": "const";
420
- "value": [
408
+ kind: 'const';
409
+ value: [
421
410
  118,
422
411
  97,
423
412
  108,
@@ -435,42 +424,42 @@ type Jbond = {
435
424
  ];
436
425
  },
437
426
  {
438
- "kind": "account";
439
- "path": "bondState";
427
+ kind: 'account';
428
+ path: 'bondState';
440
429
  },
441
430
  {
442
- "kind": "account";
443
- "path": "validator_bond.vote_account";
444
- "account": "validatorBond";
431
+ kind: 'account';
432
+ path: 'validator_bond.vote_account';
433
+ account: 'validatorBond';
445
434
  }
446
435
  ];
447
436
  };
448
437
  },
449
438
  {
450
- "name": "identity";
451
- "signer": true;
439
+ name: 'identity';
440
+ signer: true;
452
441
  },
453
442
  {
454
- "name": "newWithdrawAuthority";
455
- "optional": true;
443
+ name: 'newWithdrawAuthority';
444
+ optional: true;
456
445
  }
457
446
  ];
458
- "args": [];
447
+ args: [];
459
448
  },
460
449
  {
461
- "name": "bondTopUp";
462
- "docs": [
463
- "Adds additional collateral to an existing validator's bond.",
464
- "Increases the collateral balance, enhancing the validator's stake.",
465
- "",
466
- "# Arguments",
467
- "* `amount` - Amount to add.",
468
- "",
469
- "# Errors",
470
- "Fails if the validator is not active, if the amount is zero,",
471
- "or if the transfer of funds fails."
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.'
472
461
  ];
473
- "discriminator": [
462
+ discriminator: [
474
463
  132,
475
464
  225,
476
465
  254,
@@ -480,19 +469,19 @@ type Jbond = {
480
469
  176,
481
470
  66
482
471
  ];
483
- "accounts": [
472
+ accounts: [
484
473
  {
485
- "name": "bondState";
486
- "writable": true;
474
+ name: 'bondState';
475
+ writable: true;
487
476
  },
488
477
  {
489
- "name": "validatorBond";
490
- "writable": true;
491
- "pda": {
492
- "seeds": [
478
+ name: 'validatorBond';
479
+ writable: true;
480
+ pda: {
481
+ seeds: [
493
482
  {
494
- "kind": "const";
495
- "value": [
483
+ kind: 'const';
484
+ value: [
496
485
  118,
497
486
  97,
498
487
  108,
@@ -510,73 +499,73 @@ type Jbond = {
510
499
  ];
511
500
  },
512
501
  {
513
- "kind": "account";
514
- "path": "bondState";
502
+ kind: 'account';
503
+ path: 'bondState';
515
504
  },
516
505
  {
517
- "kind": "account";
518
- "path": "validator_bond.vote_account";
519
- "account": "validatorBond";
506
+ kind: 'account';
507
+ path: 'validator_bond.vote_account';
508
+ account: 'validatorBond';
520
509
  }
521
510
  ];
522
511
  };
523
512
  },
524
513
  {
525
- "name": "payer";
526
- "writable": true;
527
- "signer": true;
514
+ name: 'payer';
515
+ writable: true;
516
+ signer: true;
528
517
  },
529
518
  {
530
- "name": "payerTokenAccount";
531
- "writable": true;
532
- "optional": true;
519
+ name: 'payerTokenAccount';
520
+ writable: true;
521
+ optional: true;
533
522
  },
534
523
  {
535
- "name": "bondTokenAccount";
536
- "writable": true;
537
- "optional": true;
524
+ name: 'bondTokenAccount';
525
+ writable: true;
526
+ optional: true;
538
527
  },
539
528
  {
540
- "name": "stakeAccount";
541
- "writable": true;
542
- "optional": true;
529
+ name: 'stakeAccount';
530
+ writable: true;
531
+ optional: true;
543
532
  },
544
533
  {
545
- "name": "systemProgram";
546
- "address": "11111111111111111111111111111111";
534
+ name: 'systemProgram';
535
+ address: '11111111111111111111111111111111';
547
536
  },
548
537
  {
549
- "name": "tokenProgram";
550
- "optional": true;
551
- "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
538
+ name: 'tokenProgram';
539
+ optional: true;
540
+ address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
552
541
  },
553
542
  {
554
- "name": "stakeProgram";
555
- "optional": true;
543
+ name: 'stakeProgram';
544
+ optional: true;
556
545
  }
557
546
  ];
558
- "args": [
547
+ args: [
559
548
  {
560
- "name": "amount";
561
- "type": "u64";
549
+ name: 'amount';
550
+ type: 'u64';
562
551
  }
563
552
  ];
564
553
  },
565
554
  {
566
- "name": "bondWithdraw";
567
- "docs": [
568
- "Withdraws collateral from a validator's bond.",
569
- "Decreases the collateral balance, allowing the validator to reclaim funds.",
570
- "",
571
- "# Arguments",
572
- "* `amount` - Amount to withdraw (must not exceed available balance).",
573
- "",
574
- "# Errors",
575
- "Fails if the validator is not active, if the amount is zero,",
576
- "if the withdrawal authority is invalid, or if the withdrawal would",
577
- "leave insufficient collateral."
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.'
578
567
  ];
579
- "discriminator": [
568
+ discriminator: [
580
569
  99,
581
570
  64,
582
571
  127,
@@ -586,19 +575,19 @@ type Jbond = {
586
575
  70,
587
576
  204
588
577
  ];
589
- "accounts": [
578
+ accounts: [
590
579
  {
591
- "name": "bondState";
592
- "writable": true;
580
+ name: 'bondState';
581
+ writable: true;
593
582
  },
594
583
  {
595
- "name": "validatorBond";
596
- "writable": true;
597
- "pda": {
598
- "seeds": [
584
+ name: 'validatorBond';
585
+ writable: true;
586
+ pda: {
587
+ seeds: [
599
588
  {
600
- "kind": "const";
601
- "value": [
589
+ kind: 'const';
590
+ value: [
602
591
  118,
603
592
  97,
604
593
  108,
@@ -616,65 +605,65 @@ type Jbond = {
616
605
  ];
617
606
  },
618
607
  {
619
- "kind": "account";
620
- "path": "bondState";
608
+ kind: 'account';
609
+ path: 'bondState';
621
610
  },
622
611
  {
623
- "kind": "account";
624
- "path": "validator_bond.vote_account";
625
- "account": "validatorBond";
612
+ kind: 'account';
613
+ path: 'validator_bond.vote_account';
614
+ account: 'validatorBond';
626
615
  }
627
616
  ];
628
617
  };
629
618
  },
630
619
  {
631
- "name": "withdrawalAuthority";
632
- "writable": true;
633
- "signer": true;
620
+ name: 'withdrawalAuthority';
621
+ writable: true;
622
+ signer: true;
634
623
  },
635
624
  {
636
- "name": "destination";
637
- "writable": true;
625
+ name: 'destination';
626
+ writable: true;
638
627
  },
639
628
  {
640
- "name": "destinationTokenAccount";
641
- "writable": true;
642
- "optional": true;
629
+ name: 'destinationTokenAccount';
630
+ writable: true;
631
+ optional: true;
643
632
  },
644
633
  {
645
- "name": "bondTokenAccount";
646
- "writable": true;
647
- "optional": true;
634
+ name: 'bondTokenAccount';
635
+ writable: true;
636
+ optional: true;
648
637
  },
649
638
  {
650
- "name": "stakeAccount";
651
- "writable": true;
652
- "optional": true;
639
+ name: 'stakeAccount';
640
+ writable: true;
641
+ optional: true;
653
642
  },
654
643
  {
655
- "name": "systemProgram";
656
- "address": "11111111111111111111111111111111";
644
+ name: 'systemProgram';
645
+ address: '11111111111111111111111111111111';
657
646
  },
658
647
  {
659
- "name": "tokenProgram";
660
- "optional": true;
661
- "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
648
+ name: 'tokenProgram';
649
+ optional: true;
650
+ address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
662
651
  },
663
652
  {
664
- "name": "stakeProgram";
665
- "optional": true;
653
+ name: 'stakeProgram';
654
+ optional: true;
666
655
  }
667
656
  ];
668
- "args": [
657
+ args: [
669
658
  {
670
- "name": "amount";
671
- "type": "u64";
659
+ name: 'amount';
660
+ type: 'u64';
672
661
  }
673
662
  ];
674
663
  },
675
664
  {
676
- "name": "globalConfigure";
677
- "discriminator": [
665
+ name: 'globalConfigure';
666
+ discriminator: [
678
667
  67,
679
668
  142,
680
669
  164,
@@ -684,15 +673,15 @@ type Jbond = {
684
673
  144,
685
674
  187
686
675
  ];
687
- "accounts": [
676
+ accounts: [
688
677
  {
689
- "name": "globalState";
690
- "writable": true;
691
- "pda": {
692
- "seeds": [
678
+ name: 'globalState';
679
+ writable: true;
680
+ pda: {
681
+ seeds: [
693
682
  {
694
- "kind": "const";
695
- "value": [
683
+ kind: 'const';
684
+ value: [
696
685
  103,
697
686
  108,
698
687
  111,
@@ -711,27 +700,27 @@ type Jbond = {
711
700
  };
712
701
  },
713
702
  {
714
- "name": "authority";
715
- "signer": true;
716
- "relations": [
717
- "globalState"
703
+ name: 'authority';
704
+ signer: true;
705
+ relations: [
706
+ 'globalState'
718
707
  ];
719
708
  }
720
709
  ];
721
- "args": [
710
+ args: [
722
711
  {
723
- "name": "data";
724
- "type": {
725
- "defined": {
726
- "name": "globalConfigureData";
712
+ name: 'data';
713
+ type: {
714
+ defined: {
715
+ name: 'globalConfigureData';
727
716
  };
728
717
  };
729
718
  }
730
719
  ];
731
720
  },
732
721
  {
733
- "name": "globalInitialize";
734
- "discriminator": [
722
+ name: 'globalInitialize';
723
+ discriminator: [
735
724
  30,
736
725
  79,
737
726
  193,
@@ -741,15 +730,15 @@ type Jbond = {
741
730
  223,
742
731
  196
743
732
  ];
744
- "accounts": [
733
+ accounts: [
745
734
  {
746
- "name": "globalState";
747
- "writable": true;
748
- "pda": {
749
- "seeds": [
735
+ name: 'globalState';
736
+ writable: true;
737
+ pda: {
738
+ seeds: [
750
739
  {
751
- "kind": "const";
752
- "value": [
740
+ kind: 'const';
741
+ value: [
753
742
  103,
754
743
  108,
755
744
  111,
@@ -768,23 +757,23 @@ type Jbond = {
768
757
  };
769
758
  },
770
759
  {
771
- "name": "authority";
772
- "writable": true;
773
- "signer": true;
760
+ name: 'authority';
761
+ writable: true;
762
+ signer: true;
774
763
  },
775
764
  {
776
- "name": "systemProgram";
777
- "address": "11111111111111111111111111111111";
765
+ name: 'systemProgram';
766
+ address: '11111111111111111111111111111111';
778
767
  }
779
768
  ];
780
- "args": [];
769
+ args: [];
781
770
  },
782
771
  {
783
- "name": "migrateBond";
784
- "docs": [
785
- "Migrates validator bond data from legacy structure to new structure."
772
+ name: 'migrateBond';
773
+ docs: [
774
+ 'Migrates validator bond data from legacy structure to new structure.'
786
775
  ];
787
- "discriminator": [
776
+ discriminator: [
788
777
  107,
789
778
  119,
790
779
  59,
@@ -794,26 +783,26 @@ type Jbond = {
794
783
  37,
795
784
  163
796
785
  ];
797
- "accounts": [
786
+ accounts: [
798
787
  {
799
- "name": "bondState";
800
- "writable": true;
788
+ name: 'bondState';
789
+ writable: true;
801
790
  },
802
791
  {
803
- "name": "legacyValidatorBond";
804
- "writable": true;
792
+ name: 'legacyValidatorBond';
793
+ writable: true;
805
794
  },
806
795
  {
807
- "name": "legacyVoteAccount";
796
+ name: 'legacyVoteAccount';
808
797
  },
809
798
  {
810
- "name": "validatorBond";
811
- "writable": true;
812
- "pda": {
813
- "seeds": [
799
+ name: 'validatorBond';
800
+ writable: true;
801
+ pda: {
802
+ seeds: [
814
803
  {
815
- "kind": "const";
816
- "value": [
804
+ kind: 'const';
805
+ value: [
817
806
  118,
818
807
  97,
819
808
  108,
@@ -831,34 +820,34 @@ type Jbond = {
831
820
  ];
832
821
  },
833
822
  {
834
- "kind": "account";
835
- "path": "bondState";
823
+ kind: 'account';
824
+ path: 'bondState';
836
825
  },
837
826
  {
838
- "kind": "account";
839
- "path": "legacyVoteAccount";
827
+ kind: 'account';
828
+ path: 'legacyVoteAccount';
840
829
  }
841
830
  ];
842
831
  };
843
832
  },
844
833
  {
845
- "name": "creator";
846
- "writable": true;
847
- "signer": true;
834
+ name: 'creator';
835
+ writable: true;
836
+ signer: true;
848
837
  },
849
838
  {
850
- "name": "systemProgram";
851
- "address": "11111111111111111111111111111111";
839
+ name: 'systemProgram';
840
+ address: '11111111111111111111111111111111';
852
841
  }
853
842
  ];
854
- "args": [];
843
+ args: [];
855
844
  },
856
845
  {
857
- "name": "sessionFinish";
858
- "docs": [
859
- "Finishes a bond, preventing further deposits and withdrawals."
846
+ name: 'sessionFinish';
847
+ docs: [
848
+ 'Finishes a bond, preventing further deposits and withdrawals.'
860
849
  ];
861
- "discriminator": [
850
+ discriminator: [
862
851
  230,
863
852
  209,
864
853
  54,
@@ -868,28 +857,28 @@ type Jbond = {
868
857
  137,
869
858
  113
870
859
  ];
871
- "accounts": [
860
+ accounts: [
872
861
  {
873
- "name": "bondState";
874
- "writable": true;
862
+ name: 'bondState';
863
+ writable: true;
875
864
  },
876
865
  {
877
- "name": "authority";
878
- "writable": true;
879
- "signer": true;
880
- "relations": [
881
- "bondState"
866
+ name: 'authority';
867
+ writable: true;
868
+ signer: true;
869
+ relations: [
870
+ 'bondState'
882
871
  ];
883
872
  }
884
873
  ];
885
- "args": [];
874
+ args: [];
886
875
  },
887
876
  {
888
- "name": "sessionStart";
889
- "docs": [
890
- "Starts a paused bond, allowing deposits and withdrawals to resume."
877
+ name: 'sessionStart';
878
+ docs: [
879
+ 'Starts a paused bond, allowing deposits and withdrawals to resume.'
891
880
  ];
892
- "discriminator": [
881
+ discriminator: [
893
882
  132,
894
883
  93,
895
884
  83,
@@ -899,32 +888,32 @@ type Jbond = {
899
888
  58,
900
889
  92
901
890
  ];
902
- "accounts": [
891
+ accounts: [
903
892
  {
904
- "name": "bondState";
905
- "writable": true;
893
+ name: 'bondState';
894
+ writable: true;
906
895
  },
907
896
  {
908
- "name": "authority";
909
- "writable": true;
910
- "signer": true;
911
- "relations": [
912
- "bondState"
897
+ name: 'authority';
898
+ writable: true;
899
+ signer: true;
900
+ relations: [
901
+ 'bondState'
913
902
  ];
914
903
  }
915
904
  ];
916
- "args": [
905
+ args: [
917
906
  {
918
- "name": "durationSecs";
919
- "type": "u64";
907
+ name: 'durationSecs';
908
+ type: 'u64';
920
909
  }
921
910
  ];
922
911
  }
923
912
  ];
924
- "accounts": [
913
+ accounts: [
925
914
  {
926
- "name": "bondState";
927
- "discriminator": [
915
+ name: 'bondState';
916
+ discriminator: [
928
917
  251,
929
918
  95,
930
919
  76,
@@ -936,8 +925,8 @@ type Jbond = {
936
925
  ];
937
926
  },
938
927
  {
939
- "name": "globalState";
940
- "discriminator": [
928
+ name: 'globalState';
929
+ discriminator: [
941
930
  163,
942
931
  46,
943
932
  74,
@@ -949,8 +938,8 @@ type Jbond = {
949
938
  ];
950
939
  },
951
940
  {
952
- "name": "validatorBond";
953
- "discriminator": [
941
+ name: 'validatorBond';
942
+ discriminator: [
954
943
  82,
955
944
  127,
956
945
  243,
@@ -962,10 +951,10 @@ type Jbond = {
962
951
  ];
963
952
  }
964
953
  ];
965
- "events": [
954
+ events: [
966
955
  {
967
- "name": "bondFinished";
968
- "discriminator": [
956
+ name: 'bondFinished';
957
+ discriminator: [
969
958
  223,
970
959
  254,
971
960
  3,
@@ -977,8 +966,8 @@ type Jbond = {
977
966
  ];
978
967
  },
979
968
  {
980
- "name": "bondStarted";
981
- "discriminator": [
969
+ name: 'bondStarted';
970
+ discriminator: [
982
971
  235,
983
972
  69,
984
973
  80,
@@ -990,8 +979,8 @@ type Jbond = {
990
979
  ];
991
980
  },
992
981
  {
993
- "name": "collateralToppedUp";
994
- "discriminator": [
982
+ name: 'collateralToppedUp';
983
+ discriminator: [
995
984
  189,
996
985
  137,
997
986
  204,
@@ -1003,8 +992,8 @@ type Jbond = {
1003
992
  ];
1004
993
  },
1005
994
  {
1006
- "name": "collateralWithdrawn";
1007
- "discriminator": [
995
+ name: 'collateralWithdrawn';
996
+ discriminator: [
1008
997
  51,
1009
998
  224,
1010
999
  133,
@@ -1016,8 +1005,8 @@ type Jbond = {
1016
1005
  ];
1017
1006
  },
1018
1007
  {
1019
- "name": "compensationClaimed";
1020
- "discriminator": [
1008
+ name: 'compensationClaimed';
1009
+ discriminator: [
1021
1010
  36,
1022
1011
  159,
1023
1012
  41,
@@ -1029,8 +1018,8 @@ type Jbond = {
1029
1018
  ];
1030
1019
  },
1031
1020
  {
1032
- "name": "validatorRegistered";
1033
- "discriminator": [
1021
+ name: 'validatorRegistered';
1022
+ discriminator: [
1034
1023
  20,
1035
1024
  20,
1036
1025
  190,
@@ -1042,208 +1031,208 @@ type Jbond = {
1042
1031
  ];
1043
1032
  }
1044
1033
  ];
1045
- "errors": [
1034
+ errors: [
1046
1035
  {
1047
- "code": 6000;
1048
- "name": "invalidVoteAccount";
1049
- "msg": "Invalid vote account";
1036
+ code: 6000;
1037
+ name: 'invalidVoteAccount';
1038
+ msg: 'Invalid vote account';
1050
1039
  },
1051
1040
  {
1052
- "code": 6001;
1053
- "name": "identityMismatch";
1054
- "msg": "Identity does not match vote account";
1041
+ code: 6001;
1042
+ name: 'identityMismatch';
1043
+ msg: 'Identity does not match vote account';
1055
1044
  },
1056
1045
  {
1057
- "code": 6002;
1058
- "name": "insufficientCollateral";
1059
- "msg": "Insufficient collateral amount";
1046
+ code: 6002;
1047
+ name: 'insufficientCollateral';
1048
+ msg: 'Insufficient collateral amount';
1060
1049
  },
1061
1050
  {
1062
- "code": 6003;
1063
- "name": "targetAprTooLow";
1064
- "msg": "Target APR is below minimum threshold";
1051
+ code: 6003;
1052
+ name: 'targetAprTooLow';
1053
+ msg: 'Target APR is below minimum threshold';
1065
1054
  },
1066
1055
  {
1067
- "code": 6004;
1068
- "name": "mathOverflow";
1069
- "msg": "Math overflow";
1056
+ code: 6004;
1057
+ name: 'mathOverflow';
1058
+ msg: 'Math overflow';
1070
1059
  },
1071
1060
  {
1072
- "code": 6005;
1073
- "name": "invalidAmount";
1074
- "msg": "Invalid amount";
1061
+ code: 6005;
1062
+ name: 'invalidAmount';
1063
+ msg: 'Invalid amount';
1075
1064
  },
1076
1065
  {
1077
- "code": 6006;
1078
- "name": "validatorNotActive";
1079
- "msg": "Validator bond account is not active";
1066
+ code: 6006;
1067
+ name: 'validatorNotActive';
1068
+ msg: 'Validator bond account is not active';
1080
1069
  },
1081
1070
  {
1082
- "code": 6007;
1083
- "name": "validatorAlreadyRegistered";
1084
- "msg": "Validator already registered";
1071
+ code: 6007;
1072
+ name: 'validatorAlreadyRegistered';
1073
+ msg: 'Validator already registered';
1085
1074
  },
1086
1075
  {
1087
- "code": 6008;
1088
- "name": "unauthorized";
1089
- "msg": "unauthorized";
1076
+ code: 6008;
1077
+ name: 'unauthorized';
1078
+ msg: 'unauthorized';
1090
1079
  },
1091
1080
  {
1092
- "code": 6009;
1093
- "name": "withdrawalLockedNearEpochEnd";
1094
- "msg": "Withdrawals are locked near the end of the epoch.";
1081
+ code: 6009;
1082
+ name: 'withdrawalLockedNearEpochEnd';
1083
+ msg: 'Withdrawals are locked near the end of the epoch.';
1095
1084
  },
1096
1085
  {
1097
- "code": 6010;
1098
- "name": "missingTokenAccounts";
1099
- "msg": "Missing token accounts for token collateral type";
1086
+ code: 6010;
1087
+ name: 'missingTokenAccounts';
1088
+ msg: 'Missing token accounts for token collateral type';
1100
1089
  },
1101
1090
  {
1102
- "code": 6011;
1103
- "name": "missingTokenProgram";
1104
- "msg": "Token program is required for token collateral type";
1091
+ code: 6011;
1092
+ name: 'missingTokenProgram';
1093
+ msg: 'Token program is required for token collateral type';
1105
1094
  },
1106
1095
  {
1107
- "code": 6012;
1108
- "name": "invalidMint";
1109
- "msg": "Invalid mint for token collateral type";
1096
+ code: 6012;
1097
+ name: 'invalidMint';
1098
+ msg: 'Invalid mint for token collateral type';
1110
1099
  },
1111
1100
  {
1112
- "code": 6013;
1113
- "name": "missingStakeAccount";
1114
- "msg": "Stake account is required for stake account collateral type";
1101
+ code: 6013;
1102
+ name: 'missingStakeAccount';
1103
+ msg: 'Stake account is required for stake account collateral type';
1115
1104
  },
1116
1105
  {
1117
- "code": 6014;
1118
- "name": "missingStakeProgram";
1119
- "msg": "Stake program is required for stake account collateral type";
1106
+ code: 6014;
1107
+ name: 'missingStakeProgram';
1108
+ msg: 'Stake program is required for stake account collateral type';
1120
1109
  },
1121
1110
  {
1122
- "code": 6015;
1123
- "name": "bondFinished";
1124
- "msg": "Bond is finished (deposits/withdrawals disabled)";
1111
+ code: 6015;
1112
+ name: 'bondFinished';
1113
+ msg: 'Bond is finished (deposits/withdrawals disabled)';
1125
1114
  },
1126
1115
  {
1127
- "code": 6016;
1128
- "name": "bondNotFinished";
1129
- "msg": "Bond is not finished";
1116
+ code: 6016;
1117
+ name: 'bondNotFinished';
1118
+ msg: 'Bond is not finished';
1130
1119
  },
1131
1120
  {
1132
- "code": 6017;
1133
- "name": "unsupportedCollateralType";
1134
- "msg": "Unsupported collateral type";
1121
+ code: 6017;
1122
+ name: 'unsupportedCollateralType';
1123
+ msg: 'Unsupported collateral type';
1135
1124
  },
1136
1125
  {
1137
- "code": 6018;
1138
- "name": "overflow";
1139
- "msg": "Math operation overflowed";
1126
+ code: 6018;
1127
+ name: 'overflow';
1128
+ msg: 'Math operation overflowed';
1140
1129
  },
1141
1130
  {
1142
- "code": 6019;
1143
- "name": "incorrectBondType";
1144
- "msg": "Incorrect bond type for this operation";
1131
+ code: 6019;
1132
+ name: 'incorrectBondType';
1133
+ msg: 'Incorrect bond type for this operation';
1145
1134
  },
1146
1135
  {
1147
- "code": 6020;
1148
- "name": "bondNotFinishable";
1149
- "msg": "This bond type can't be finished";
1136
+ code: 6020;
1137
+ name: 'bondNotFinishable';
1138
+ msg: 'This bond type can\'t be finished';
1150
1139
  },
1151
1140
  {
1152
- "code": 6021;
1153
- "name": "invalidArgument";
1154
- "msg": "Invalid argument provided";
1141
+ code: 6021;
1142
+ name: 'invalidArgument';
1143
+ msg: 'Invalid argument provided';
1155
1144
  },
1156
1145
  {
1157
- "code": 6022;
1158
- "name": "bondNotDisabled";
1159
- "msg": "Bond is not disabled";
1146
+ code: 6022;
1147
+ name: 'bondNotDisabled';
1148
+ msg: 'Bond is not disabled';
1160
1149
  },
1161
1150
  {
1162
- "code": 6023;
1163
- "name": "bondNotEnabled";
1164
- "msg": "Bond is not enabled";
1151
+ code: 6023;
1152
+ name: 'bondNotEnabled';
1153
+ msg: 'Bond is not enabled';
1165
1154
  }
1166
1155
  ];
1167
- "types": [
1156
+ types: [
1168
1157
  {
1169
- "name": "bondConfigureData";
1170
- "type": {
1171
- "kind": "struct";
1172
- "fields": [
1158
+ name: 'bondConfigureData';
1159
+ type: {
1160
+ kind: 'struct';
1161
+ fields: [
1173
1162
  {
1174
- "name": "status";
1175
- "type": {
1176
- "option": {
1177
- "defined": {
1178
- "name": "bondStatus";
1163
+ name: 'status';
1164
+ type: {
1165
+ option: {
1166
+ defined: {
1167
+ name: 'bondStatus';
1179
1168
  };
1180
1169
  };
1181
1170
  };
1182
1171
  },
1183
1172
  {
1184
- "name": "newReserve";
1185
- "type": {
1186
- "option": "pubkey";
1173
+ name: 'newReserve';
1174
+ type: {
1175
+ option: 'pubkey';
1187
1176
  };
1188
1177
  },
1189
1178
  {
1190
- "name": "newAuthority";
1191
- "type": {
1192
- "option": "pubkey";
1179
+ name: 'newAuthority';
1180
+ type: {
1181
+ option: 'pubkey';
1193
1182
  };
1194
1183
  }
1195
1184
  ];
1196
1185
  };
1197
1186
  },
1198
1187
  {
1199
- "name": "bondFinished";
1200
- "type": {
1201
- "kind": "struct";
1202
- "fields": [
1188
+ name: 'bondFinished';
1189
+ type: {
1190
+ kind: 'struct';
1191
+ fields: [
1203
1192
  {
1204
- "name": "bond";
1205
- "type": "pubkey";
1193
+ name: 'bond';
1194
+ type: 'pubkey';
1206
1195
  },
1207
1196
  {
1208
- "name": "authority";
1209
- "type": "pubkey";
1197
+ name: 'authority';
1198
+ type: 'pubkey';
1210
1199
  },
1211
1200
  {
1212
- "name": "timestamp";
1213
- "type": "i64";
1201
+ name: 'timestamp';
1202
+ type: 'i64';
1214
1203
  }
1215
1204
  ];
1216
1205
  };
1217
1206
  },
1218
1207
  {
1219
- "name": "bondInitializeData";
1220
- "docs": [
1221
- "Data required to initialize a performance bond"
1208
+ name: 'bondInitializeData';
1209
+ docs: [
1210
+ 'Data required to initialize a performance bond'
1222
1211
  ];
1223
- "type": {
1224
- "kind": "struct";
1225
- "fields": [
1212
+ type: {
1213
+ kind: 'struct';
1214
+ fields: [
1226
1215
  {
1227
- "name": "name";
1228
- "type": "string";
1216
+ name: 'name';
1217
+ type: 'string';
1229
1218
  },
1230
1219
  {
1231
- "name": "bondType";
1232
- "type": {
1233
- "defined": {
1234
- "name": "bondType";
1220
+ name: 'bondType';
1221
+ type: {
1222
+ defined: {
1223
+ name: 'bondType';
1235
1224
  };
1236
1225
  };
1237
1226
  },
1238
1227
  {
1239
- "name": "reserve";
1240
- "type": "pubkey";
1228
+ name: 'reserve';
1229
+ type: 'pubkey';
1241
1230
  },
1242
1231
  {
1243
- "name": "collateralType";
1244
- "type": {
1245
- "defined": {
1246
- "name": "collateralType";
1232
+ name: 'collateralType';
1233
+ type: {
1234
+ defined: {
1235
+ name: 'collateralType';
1247
1236
  };
1248
1237
  };
1249
1238
  }
@@ -1251,359 +1240,359 @@ type Jbond = {
1251
1240
  };
1252
1241
  },
1253
1242
  {
1254
- "name": "bondStarted";
1255
- "type": {
1256
- "kind": "struct";
1257
- "fields": [
1243
+ name: 'bondStarted';
1244
+ type: {
1245
+ kind: 'struct';
1246
+ fields: [
1258
1247
  {
1259
- "name": "bond";
1260
- "type": "pubkey";
1248
+ name: 'bond';
1249
+ type: 'pubkey';
1261
1250
  },
1262
1251
  {
1263
- "name": "authority";
1264
- "type": "pubkey";
1252
+ name: 'authority';
1253
+ type: 'pubkey';
1265
1254
  },
1266
1255
  {
1267
- "name": "timestamp";
1268
- "type": "i64";
1256
+ name: 'timestamp';
1257
+ type: 'i64';
1269
1258
  }
1270
1259
  ];
1271
1260
  };
1272
1261
  },
1273
1262
  {
1274
- "name": "bondState";
1275
- "type": {
1276
- "kind": "struct";
1277
- "fields": [
1263
+ name: 'bondState';
1264
+ type: {
1265
+ kind: 'struct';
1266
+ fields: [
1278
1267
  {
1279
- "name": "name";
1280
- "type": "string";
1268
+ name: 'name';
1269
+ type: 'string';
1281
1270
  },
1282
1271
  {
1283
- "name": "bondType";
1284
- "docs": [
1285
- "The type of bond (e.g., Standard, Crowdfunding)"
1272
+ name: 'bondType';
1273
+ docs: [
1274
+ 'The type of bond (e.g., Standard, Crowdfunding)'
1286
1275
  ];
1287
- "type": {
1288
- "defined": {
1289
- "name": "bondType";
1276
+ type: {
1277
+ defined: {
1278
+ name: 'bondType';
1290
1279
  };
1291
1280
  };
1292
1281
  },
1293
1282
  {
1294
- "name": "collateralType";
1295
- "docs": [
1296
- "The type of collateral accepted for this bond"
1283
+ name: 'collateralType';
1284
+ docs: [
1285
+ 'The type of collateral accepted for this bond'
1297
1286
  ];
1298
- "type": {
1299
- "defined": {
1300
- "name": "collateralType";
1287
+ type: {
1288
+ defined: {
1289
+ name: 'collateralType';
1301
1290
  };
1302
1291
  };
1303
1292
  },
1304
1293
  {
1305
- "name": "reserve";
1306
- "docs": [
1307
- "Reserve account where collateral is held"
1294
+ name: 'reserve';
1295
+ docs: [
1296
+ 'Reserve account where collateral is held'
1308
1297
  ];
1309
- "type": "pubkey";
1298
+ type: 'pubkey';
1310
1299
  },
1311
1300
  {
1312
- "name": "authority";
1313
- "docs": [
1314
- "Authority allowed to manage the bond configuration"
1301
+ name: 'authority';
1302
+ docs: [
1303
+ 'Authority allowed to manage the bond configuration'
1315
1304
  ];
1316
- "type": "pubkey";
1305
+ type: 'pubkey';
1317
1306
  },
1318
1307
  {
1319
- "name": "sessionId";
1320
- "docs": [
1321
- "Unique identifier for the bonding session"
1308
+ name: 'sessionId';
1309
+ docs: [
1310
+ 'Unique identifier for the bonding session'
1322
1311
  ];
1323
- "type": "u32";
1312
+ type: 'u32';
1324
1313
  },
1325
1314
  {
1326
- "name": "totalMembers";
1327
- "docs": [
1328
- "Total number of users who have participated in the bond"
1315
+ name: 'totalMembers';
1316
+ docs: [
1317
+ 'Total number of users who have participated in the bond'
1329
1318
  ];
1330
- "type": "u16";
1319
+ type: 'u16';
1331
1320
  },
1332
1321
  {
1333
- "name": "totalCompensationAmount";
1334
- "docs": [
1335
- "Total compensation amount paid out"
1322
+ name: 'totalCompensationAmount';
1323
+ docs: [
1324
+ 'Total compensation amount paid out'
1336
1325
  ];
1337
- "type": "u64";
1326
+ type: 'u64';
1338
1327
  },
1339
1328
  {
1340
- "name": "sessionStartTs";
1341
- "docs": [
1342
- "Start timestamp of the current session (unix seconds). 0 — not set."
1329
+ name: 'sessionStartTs';
1330
+ docs: [
1331
+ 'Start timestamp of the current session (unix seconds). 0 — not set.'
1343
1332
  ];
1344
- "type": "i64";
1333
+ type: 'i64';
1345
1334
  },
1346
1335
  {
1347
- "name": "sessionFinishTs";
1348
- "docs": [
1349
- "Finish timestamp of the current session (unix seconds). 0 — not set."
1336
+ name: 'sessionFinishTs';
1337
+ docs: [
1338
+ 'Finish timestamp of the current session (unix seconds). 0 — not set.'
1350
1339
  ];
1351
- "type": "i64";
1340
+ type: 'i64';
1352
1341
  },
1353
1342
  {
1354
- "name": "status";
1355
- "docs": [
1356
- "Current status of the bond"
1343
+ name: 'status';
1344
+ docs: [
1345
+ 'Current status of the bond'
1357
1346
  ];
1358
- "type": {
1359
- "defined": {
1360
- "name": "bondStatus";
1347
+ type: {
1348
+ defined: {
1349
+ name: 'bondStatus';
1361
1350
  };
1362
1351
  };
1363
1352
  },
1364
1353
  {
1365
- "name": "bump";
1366
- "docs": [
1367
- "Bump for the PDA"
1354
+ name: 'bump';
1355
+ docs: [
1356
+ 'Bump for the PDA'
1368
1357
  ];
1369
- "type": "u8";
1358
+ type: 'u8';
1370
1359
  }
1371
1360
  ];
1372
1361
  };
1373
1362
  },
1374
1363
  {
1375
- "name": "bondStatus";
1376
- "type": {
1377
- "kind": "enum";
1378
- "variants": [
1364
+ name: 'bondStatus';
1365
+ type: {
1366
+ kind: 'enum';
1367
+ variants: [
1379
1368
  {
1380
- "name": "active";
1369
+ name: 'active';
1381
1370
  },
1382
1371
  {
1383
- "name": "disabled";
1372
+ name: 'disabled';
1384
1373
  }
1385
1374
  ];
1386
1375
  };
1387
1376
  },
1388
1377
  {
1389
- "name": "bondType";
1390
- "docs": [
1391
- "Types of bonds supported by the program"
1378
+ name: 'bondType';
1379
+ docs: [
1380
+ 'Types of bonds supported by the program'
1392
1381
  ];
1393
- "type": {
1394
- "kind": "enum";
1395
- "variants": [
1382
+ type: {
1383
+ kind: 'enum';
1384
+ variants: [
1396
1385
  {
1397
- "name": "standard";
1386
+ name: 'standard';
1398
1387
  },
1399
1388
  {
1400
- "name": "crowdfunding";
1389
+ name: 'crowdfunding';
1401
1390
  }
1402
1391
  ];
1403
1392
  };
1404
1393
  },
1405
1394
  {
1406
- "name": "collateralToppedUp";
1407
- "type": {
1408
- "kind": "struct";
1409
- "fields": [
1395
+ name: 'collateralToppedUp';
1396
+ type: {
1397
+ kind: 'struct';
1398
+ fields: [
1410
1399
  {
1411
- "name": "validator";
1412
- "type": "pubkey";
1400
+ name: 'validator';
1401
+ type: 'pubkey';
1413
1402
  },
1414
1403
  {
1415
- "name": "amount";
1416
- "type": "u64";
1404
+ name: 'amount';
1405
+ type: 'u64';
1417
1406
  },
1418
1407
  {
1419
- "name": "postBalance";
1420
- "type": "u64";
1408
+ name: 'postBalance';
1409
+ type: 'u64';
1421
1410
  },
1422
1411
  {
1423
- "name": "timestamp";
1424
- "type": "i64";
1412
+ name: 'timestamp';
1413
+ type: 'i64';
1425
1414
  }
1426
1415
  ];
1427
1416
  };
1428
1417
  },
1429
1418
  {
1430
- "name": "collateralType";
1431
- "docs": [
1432
- "Types of collateral that can be used for bond deposit"
1419
+ name: 'collateralType';
1420
+ docs: [
1421
+ 'Types of collateral that can be used for bond deposit'
1433
1422
  ];
1434
- "type": {
1435
- "kind": "enum";
1436
- "variants": [
1423
+ type: {
1424
+ kind: 'enum';
1425
+ variants: [
1437
1426
  {
1438
- "name": "native";
1427
+ name: 'native';
1439
1428
  },
1440
1429
  {
1441
- "name": "stakeAccount";
1430
+ name: 'stakeAccount';
1442
1431
  },
1443
1432
  {
1444
- "name": "token";
1445
- "fields": [
1446
- "pubkey"
1433
+ name: 'token';
1434
+ fields: [
1435
+ 'pubkey'
1447
1436
  ];
1448
1437
  }
1449
1438
  ];
1450
1439
  };
1451
1440
  },
1452
1441
  {
1453
- "name": "collateralWithdrawn";
1454
- "type": {
1455
- "kind": "struct";
1456
- "fields": [
1442
+ name: 'collateralWithdrawn';
1443
+ type: {
1444
+ kind: 'struct';
1445
+ fields: [
1457
1446
  {
1458
- "name": "validator";
1459
- "type": "pubkey";
1447
+ name: 'validator';
1448
+ type: 'pubkey';
1460
1449
  },
1461
1450
  {
1462
- "name": "amount";
1463
- "type": "u64";
1451
+ name: 'amount';
1452
+ type: 'u64';
1464
1453
  },
1465
1454
  {
1466
- "name": "postBalance";
1467
- "type": "u64";
1455
+ name: 'postBalance';
1456
+ type: 'u64';
1468
1457
  },
1469
1458
  {
1470
- "name": "timestamp";
1471
- "type": "i64";
1459
+ name: 'timestamp';
1460
+ type: 'i64';
1472
1461
  }
1473
1462
  ];
1474
1463
  };
1475
1464
  },
1476
1465
  {
1477
- "name": "compensationClaimed";
1478
- "type": {
1479
- "kind": "struct";
1480
- "fields": [
1466
+ name: 'compensationClaimed';
1467
+ type: {
1468
+ kind: 'struct';
1469
+ fields: [
1481
1470
  {
1482
- "name": "validator";
1483
- "type": "pubkey";
1471
+ name: 'validator';
1472
+ type: 'pubkey';
1484
1473
  },
1485
1474
  {
1486
- "name": "amount";
1487
- "type": "u64";
1475
+ name: 'amount';
1476
+ type: 'u64';
1488
1477
  },
1489
1478
  {
1490
- "name": "postBalance";
1491
- "type": "u64";
1479
+ name: 'postBalance';
1480
+ type: 'u64';
1492
1481
  },
1493
1482
  {
1494
- "name": "epoch";
1495
- "type": "u64";
1483
+ name: 'epoch';
1484
+ type: 'u64';
1496
1485
  },
1497
1486
  {
1498
- "name": "timestamp";
1499
- "type": "i64";
1487
+ name: 'timestamp';
1488
+ type: 'i64';
1500
1489
  }
1501
1490
  ];
1502
1491
  };
1503
1492
  },
1504
1493
  {
1505
- "name": "globalConfigureData";
1506
- "type": {
1507
- "kind": "struct";
1508
- "fields": [
1494
+ name: 'globalConfigureData';
1495
+ type: {
1496
+ kind: 'struct';
1497
+ fields: [
1509
1498
  {
1510
- "name": "newAuthority";
1511
- "type": {
1512
- "option": "pubkey";
1499
+ name: 'newAuthority';
1500
+ type: {
1501
+ option: 'pubkey';
1513
1502
  };
1514
1503
  }
1515
1504
  ];
1516
1505
  };
1517
1506
  },
1518
1507
  {
1519
- "name": "globalState";
1520
- "type": {
1521
- "kind": "struct";
1522
- "fields": [
1508
+ name: 'globalState';
1509
+ type: {
1510
+ kind: 'struct';
1511
+ fields: [
1523
1512
  {
1524
- "name": "authority";
1525
- "docs": [
1526
- "The authority allowed to manage the program"
1513
+ name: 'authority';
1514
+ docs: [
1515
+ 'The authority allowed to manage the program'
1527
1516
  ];
1528
- "type": "pubkey";
1517
+ type: 'pubkey';
1529
1518
  },
1530
1519
  {
1531
- "name": "bump";
1532
- "docs": [
1533
- "Bump for the PDA"
1520
+ name: 'bump';
1521
+ docs: [
1522
+ 'Bump for the PDA'
1534
1523
  ];
1535
- "type": "u8";
1524
+ type: 'u8';
1536
1525
  }
1537
1526
  ];
1538
1527
  };
1539
1528
  },
1540
1529
  {
1541
- "name": "validatorBond";
1542
- "type": {
1543
- "kind": "struct";
1544
- "fields": [
1530
+ name: 'validatorBond';
1531
+ type: {
1532
+ kind: 'struct';
1533
+ fields: [
1545
1534
  {
1546
- "name": "state";
1547
- "type": "pubkey";
1535
+ name: 'state';
1536
+ type: 'pubkey';
1548
1537
  },
1549
1538
  {
1550
- "name": "identity";
1551
- "type": "pubkey";
1539
+ name: 'identity';
1540
+ type: 'pubkey';
1552
1541
  },
1553
1542
  {
1554
- "name": "voteAccount";
1555
- "type": "pubkey";
1543
+ name: 'voteAccount';
1544
+ type: 'pubkey';
1556
1545
  },
1557
1546
  {
1558
- "name": "creator";
1559
- "type": "pubkey";
1547
+ name: 'creator';
1548
+ type: 'pubkey';
1560
1549
  },
1561
1550
  {
1562
- "name": "withdrawalAuthority";
1563
- "type": {
1564
- "option": "pubkey";
1551
+ name: 'withdrawalAuthority';
1552
+ type: {
1553
+ option: 'pubkey';
1565
1554
  };
1566
1555
  },
1567
1556
  {
1568
- "name": "createdAt";
1569
- "type": "i64";
1557
+ name: 'createdAt';
1558
+ type: 'i64';
1570
1559
  },
1571
1560
  {
1572
- "name": "bump";
1573
- "type": "u8";
1561
+ name: 'bump';
1562
+ type: 'u8';
1574
1563
  }
1575
1564
  ];
1576
1565
  };
1577
1566
  },
1578
1567
  {
1579
- "name": "validatorRegistered";
1580
- "type": {
1581
- "kind": "struct";
1582
- "fields": [
1568
+ name: 'validatorRegistered';
1569
+ type: {
1570
+ kind: 'struct';
1571
+ fields: [
1583
1572
  {
1584
- "name": "identity";
1585
- "type": "pubkey";
1573
+ name: 'identity';
1574
+ type: 'pubkey';
1586
1575
  },
1587
1576
  {
1588
- "name": "voteAccount";
1589
- "type": "pubkey";
1577
+ name: 'voteAccount';
1578
+ type: 'pubkey';
1590
1579
  },
1591
1580
  {
1592
- "name": "timestamp";
1593
- "type": "i64";
1581
+ name: 'timestamp';
1582
+ type: 'i64';
1594
1583
  }
1595
1584
  ];
1596
1585
  };
1597
1586
  }
1598
1587
  ];
1599
- "constants": [
1588
+ constants: [
1600
1589
  {
1601
- "name": "epochLockedSlotTail";
1602
- "docs": [
1603
- "Epoch slot index at the end of an epoch after which withdrawals are locked"
1590
+ name: 'epochLockedSlotTail';
1591
+ docs: [
1592
+ 'Epoch slot index at the end of an epoch after which withdrawals are locked'
1604
1593
  ];
1605
- "type": "u64";
1606
- "value": "420000";
1594
+ type: 'u64';
1595
+ value: '420000';
1607
1596
  }
1608
1597
  ];
1609
1598
  };
@@ -1611,25 +1600,25 @@ type Jbond = {
1611
1600
  type GlobalState = IdlAccounts<Jbond>['globalState'];
1612
1601
  type BondState = IdlAccounts<Jbond>['bondState'];
1613
1602
  type ValidatorBond = IdlAccounts<Jbond>['validatorBond'];
1614
- type BondType = IdlTypes<Jbond>['bondType'];
1615
1603
  type CollateralType = IdlTypes<Jbond>['collateralType'];
1616
1604
  type BondStateStatus = IdlTypes<Jbond>['bondStatus'];
1605
+ declare enum SessionStatus {
1606
+ Live = 0,
1607
+ Finished = 1
1608
+ }
1609
+ declare enum BondType {
1610
+ Standard = "standard",
1611
+ Crowdfunding = "crowdfunding"
1612
+ }
1613
+ declare enum BondTransactionType {
1614
+ Deposit = "deposit",
1615
+ Withdrawal = "withdrawal",
1616
+ Compensation = "compensation"
1617
+ }
1617
1618
  type BondStateStats = {
1618
1619
  totalCollected: number;
1619
1620
  status: SessionStatus;
1620
1621
  };
1621
- declare const bondTypeToSeed: {
1622
- standard: Seeds;
1623
- crowdfunding: Seeds;
1624
- };
1625
- declare const BondTypeVariant: {
1626
- Standard: BondType;
1627
- Crowdfunding: BondType;
1628
- };
1629
- declare const BondStateStatusVariant: {
1630
- Active: BondStateStatus;
1631
- Disabled: BondStateStatus;
1632
- };
1633
1622
  type GlobalInitializeProps = {
1634
1623
  authority?: PublicKey;
1635
1624
  };
@@ -1646,19 +1635,22 @@ type RegisterValidatorProps = {
1646
1635
  identity: PublicKey;
1647
1636
  voteAccount: PublicKey;
1648
1637
  creator?: PublicKey;
1638
+ collateralType?: CollateralType;
1649
1639
  };
1650
1640
  type TopUpCollateralProps = {
1651
1641
  bondType: BondType;
1652
1642
  name: string;
1653
1643
  identity: PublicKey;
1654
1644
  voteAccount: PublicKey;
1655
- collateral: BondCollateral;
1645
+ amount: number;
1646
+ collateralType?: CollateralType;
1656
1647
  payer?: PublicKey;
1657
1648
  };
1658
1649
  type WithdrawCollateralProps = {
1659
1650
  bondType: BondType;
1660
1651
  name: string;
1661
- withdraw: BondCollateral;
1652
+ amount: number;
1653
+ collateralType?: CollateralType;
1662
1654
  voteAccount: PublicKey;
1663
1655
  destination?: PublicKey;
1664
1656
  withdrawalAuthority?: PublicKey;
@@ -1666,7 +1658,8 @@ type WithdrawCollateralProps = {
1666
1658
  type ClaimProps = {
1667
1659
  bondType: BondType;
1668
1660
  name: string;
1669
- claim: BondCollateral;
1661
+ amount: number;
1662
+ collateralType?: CollateralType;
1670
1663
  voteAccount: PublicKey;
1671
1664
  reserve?: PublicKey;
1672
1665
  authority?: PublicKey;
@@ -1687,7 +1680,7 @@ type BondConfigureProps = {
1687
1680
  bondType: BondType;
1688
1681
  name: string;
1689
1682
  authority?: PublicKey;
1690
- bondStateStatus?: BondStateStatus;
1683
+ status?: BondStateStatus;
1691
1684
  newAuthority?: PublicKey;
1692
1685
  newReserve?: PublicKey;
1693
1686
  };
@@ -1716,34 +1709,31 @@ type TransactionHistoryItem = {
1716
1709
  type: BondTransactionType;
1717
1710
  amount: number;
1718
1711
  };
1719
- declare enum BondTransactionType {
1720
- Deposit = "deposit",
1721
- Withdrawal = "withdrawal",
1722
- Compensation = "compensation"
1723
- }
1724
- type BondCollateral = {
1725
- amount?: number;
1726
- mint?: PublicKey;
1727
- stakeAccount?: PublicKey;
1712
+ type BondStartProps = {
1713
+ bondType: BondType;
1714
+ name: string;
1715
+ duration: number;
1716
+ };
1717
+ type BondFinishProps = {
1718
+ bondType: BondType;
1719
+ name: string;
1728
1720
  };
1729
- declare enum SessionStatus {
1730
- Live = 0,
1731
- Finished = 1
1732
- }
1733
1721
 
1734
1722
  type GetHistoryOpts = {
1735
- cluster?: 'mainnet-beta' | 'testnet' | 'devnet';
1723
+ cluster?: Cluster;
1736
1724
  limit?: number;
1737
1725
  before?: string;
1738
1726
  until?: string;
1739
1727
  };
1740
1728
  declare class HistoryManager {
1741
- private program;
1742
- private connection;
1743
- private readonly programId;
1729
+ readonly client: JBondClient;
1744
1730
  private discCache;
1745
- constructor(program: Program<Jbond>, connection: Connection, programId: PublicKey);
1746
- getHistory(bondType: BondType, vote: PublicKeyInitData, pdaDeriver: (bondType: BondType, vote: PublicKeyInitData) => [PublicKey, number], options?: GetHistoryOpts): Promise<TransactionHistoryItem[]>;
1731
+ constructor(client: JBondClient);
1732
+ get program(): _coral_xyz_anchor.Program<Jbond>;
1733
+ get programId(): any;
1734
+ get connection(): _solana_web3_js.Connection;
1735
+ debug(...args: any[]): void;
1736
+ getHistory(bondType: BondType, bondName: string, vote: PublicKeyInitData, opts?: GetHistoryOpts): Promise<TransactionHistoryItem[]>;
1747
1737
  private fetchSignaturesForAddress;
1748
1738
  private fetchParsedTransactions;
1749
1739
  private getInstructionDiscriminator;
@@ -1782,8 +1772,8 @@ declare class JBondClient {
1782
1772
  readonly provider: Provider;
1783
1773
  readonly options: ClientOptions;
1784
1774
  readonly program: Program<Jbond>;
1785
- readonly history: HistoryManager;
1786
1775
  constructor(provider: Provider, options?: ClientOptions);
1776
+ get history(): HistoryManager;
1787
1777
  /**
1788
1778
  * Creates an instance of `JBondClient` using a provided connection and wallet.
1789
1779
  */
@@ -1807,8 +1797,12 @@ declare class JBondClient {
1807
1797
  /**
1808
1798
  * Configure a specific option.
1809
1799
  */
1810
- configureEnv<K extends keyof ClientOptions>(key: K, val: ClientOptions[K]): this;
1811
- private getBondTypeSeed;
1800
+ configure<K extends keyof ClientOptions>(key: K, val: ClientOptions[K]): this;
1801
+ /**
1802
+ * Debug logging
1803
+ * @param args
1804
+ */
1805
+ debug(...args: any[]): void;
1812
1806
  /**
1813
1807
  * Program Derived Addresses (PDAs)
1814
1808
  */
@@ -1817,113 +1811,94 @@ declare class JBondClient {
1817
1811
  bondState: (bondType: BondType, bondName: string) => [PublicKey, number];
1818
1812
  validatorBond: (bondType: BondType, bondName: string, vote: PublicKeyInitData) => [PublicKey, number];
1819
1813
  };
1814
+ /**
1815
+ * Initialize global state
1816
+ */
1820
1817
  globalInitialize(props: GlobalInitializeProps): Promise<string | undefined>;
1821
1818
  /**
1822
1819
  * Initialize the program
1823
- * Default authority is the provider's wallet
1824
1820
  */
1825
1821
  bondInitialize(props: BondInitializeProps): Promise<string | undefined>;
1826
1822
  /**
1827
1823
  * Register a new validator
1828
- * Default creator is the provider's wallet
1829
1824
  */
1830
1825
  registerValidator(props: RegisterValidatorProps): Promise<string | undefined>;
1831
1826
  /**
1832
1827
  * Top up collateral
1833
- * Default payer is the provider's wallet
1834
1828
  */
1835
1829
  topUpCollateral(props: TopUpCollateralProps): Promise<string | undefined>;
1836
1830
  /**
1837
1831
  * Withdraw collateral
1838
- * Default withdrawal authority is the provider's wallet
1839
- * Default destination is the provider's wallet
1840
- * @return Transaction signature
1841
1832
  */
1842
1833
  withdrawCollateral(props: WithdrawCollateralProps): Promise<string | undefined>;
1843
1834
  /**
1844
1835
  * Claim compensation
1845
- * Default authority is the provider's wallet
1846
- * @return Transaction signature
1847
1836
  */
1848
1837
  claimCompensation(props: ClaimProps): Promise<string | undefined>;
1849
1838
  /**
1850
1839
  * Update global configuration for the program
1851
- * Default authority is the provider's wallet
1852
- * Only the current authority can call this
1853
- * @return Transaction signature
1854
1840
  */
1855
1841
  globalConfigure(props: GlobalConfigureProps): Promise<string | undefined>;
1856
1842
  /**
1857
1843
  * Update global configuration for the program
1858
- * Default authority is the provider's wallet
1859
- * Only the current authority can call this
1860
- * @return Transaction signature
1861
1844
  */
1862
1845
  bondConfigure(props: BondConfigureProps): Promise<string | undefined>;
1863
1846
  /**
1864
1847
  * Set withdrawal authority for validator bond
1865
- * Only the validator identity can call this
1866
- * Default identity is the provider's wallet
1867
- * @return Transaction signature
1868
1848
  */
1869
1849
  setWithdrawAuthority(props: SetWithdrawAuthorityProps): Promise<string | undefined>;
1870
- bondStart(props: {
1871
- bondType: BondType;
1872
- name: string;
1873
- duration_secs: number;
1874
- }): Promise<string | undefined>;
1875
- bondFinish(props: {
1876
- bondType: BondType;
1877
- name: string;
1878
- }): Promise<string | undefined>;
1879
- buildBondGlobalStateInitializeIx(props: GlobalInitializeProps): Promise<TransactionInstruction>;
1850
+ /**
1851
+ * Start crowdfunding bond session
1852
+ */
1853
+ bondStart(props: BondStartProps): Promise<string | undefined>;
1854
+ /**
1855
+ * Finish crowdfunding bond session
1856
+ */
1857
+ bondFinish(props: BondFinishProps): Promise<string | undefined>;
1858
+ /**
1859
+ * Build global state initialize instruction
1860
+ */
1861
+ getGlobalInitializeIx(props: GlobalInitializeProps): Promise<TransactionInstruction>;
1880
1862
  /**
1881
1863
  * Build configure instruction
1882
1864
  */
1883
- buildGlobalConfigureInstruction(props: GlobalConfigureProps): Promise<TransactionInstruction>;
1865
+ getGlobalConfigureIx(props: GlobalConfigureProps): Promise<TransactionInstruction>;
1884
1866
  /**
1885
- * Build initialize instruction
1867
+ * Build bond initialize instruction
1886
1868
  */
1887
- buildBondInitializeIx(props: BondInitializeProps): Promise<TransactionInstruction>;
1888
- buildConfigureIx(props: BondConfigureProps): Promise<TransactionInstruction>;
1889
- buildRegisterIx(props: RegisterValidatorProps): Promise<TransactionInstruction>;
1890
- buildTopUpIXs(props: TopUpCollateralProps): Promise<TransactionInstruction[]>;
1891
- buildWithdrawIx(props: WithdrawCollateralProps): Promise<TransactionInstruction>;
1892
- buildClaimIx(props: ClaimProps): Promise<TransactionInstruction>;
1893
- buildSetWithdrawAuthorityIx(props: SetWithdrawAuthorityProps): Promise<TransactionInstruction>;
1894
- buildBondFinishIx(props: {
1895
- bondType: BondType;
1896
- name: string;
1897
- }): Promise<TransactionInstruction>;
1898
- migrateBond(props: {
1899
- bondType: BondType;
1900
- name: string;
1901
- voteAccount: PublicKeyInitData;
1902
- }): Promise<string | undefined>;
1903
- buildBondMigrateIx(props: {
1904
- bondType: BondType;
1905
- name: string;
1906
- voteAccount: PublicKeyInitData;
1907
- }): Promise<TransactionInstruction>;
1908
- buildBondStartIx(props: {
1909
- bondType: BondType;
1910
- name: string;
1911
- duration_secs: number;
1912
- }): Promise<TransactionInstruction>;
1869
+ getBondInitializeIx(props: BondInitializeProps): Promise<TransactionInstruction>;
1913
1870
  /**
1914
- * Fetch global state or throw if not found
1871
+ * Build bond configure instruction
1915
1872
  */
1916
- getGlobalState(): Promise<GlobalState>;
1873
+ getBondConfigureIx(props: BondConfigureProps): Promise<TransactionInstruction>;
1917
1874
  /**
1918
- * Fetch bond state with stats
1919
- * @param bondType - Type of the bond
1920
- * @param bondName - Name of the bond
1921
- * @param withStats
1875
+ * Build register validator instruction
1922
1876
  */
1923
- getBondState(bondType: BondType, bondName: string, withStats?: boolean): Promise<{
1924
- bondState: BondState;
1925
- stateStats: BondStateStats | null;
1926
- }>;
1877
+ getRegisterValidatorIx(props: RegisterValidatorProps): Promise<TransactionInstruction>;
1878
+ /**
1879
+ * Build top up collateral instructions
1880
+ */
1881
+ getTopUpIxs(props: TopUpCollateralProps): Promise<TransactionInstruction[]>;
1882
+ /**
1883
+ * Build withdraw collateral instruction
1884
+ */
1885
+ getWithdrawIx(props: WithdrawCollateralProps): Promise<TransactionInstruction>;
1886
+ /**
1887
+ * Build claim instruction
1888
+ */
1889
+ getClaimIx(props: ClaimProps): Promise<TransactionInstruction>;
1890
+ /**
1891
+ * Build set withdraw authority instruction
1892
+ */
1893
+ getSetWithdrawAuthorityIx(props: SetWithdrawAuthorityProps): Promise<TransactionInstruction>;
1894
+ /**
1895
+ * Build finish crowdfunding session instruction
1896
+ */
1897
+ getBondSessionFinishIx(props: BondFinishProps): Promise<TransactionInstruction>;
1898
+ /**
1899
+ * Build start crowdfunding session instruction
1900
+ */
1901
+ getBondSessionStartIx(props: BondStartProps): Promise<TransactionInstruction>;
1927
1902
  /**
1928
1903
  * Get all bond states with total collected collateral
1929
1904
  */
@@ -1977,68 +1952,114 @@ declare class JBondClient {
1977
1952
  bump: number;
1978
1953
  };
1979
1954
  stateStats: {
1980
- totalCollected: number;
1955
+ totalCollected: unknown;
1981
1956
  status: SessionStatus;
1982
1957
  };
1983
1958
  }[]>;
1984
1959
  /**
1985
- * Get session status for bond state
1960
+ * Fetch global state or throw if not found
1986
1961
  */
1987
- private getBondStateSessionStatus;
1962
+ getGlobalState(): Promise<{
1963
+ authority: PublicKey;
1964
+ bump: number;
1965
+ publicKey: PublicKey;
1966
+ }>;
1988
1967
  /**
1989
- * Get all validator bonds for a given bond state
1968
+ * Fetch bond state with stats
1990
1969
  */
1991
- private getValidatorBondsByState;
1970
+ getBondState(bondType: BondType, bondName: string): Promise<{
1971
+ name: string;
1972
+ bondType: ({
1973
+ crowdfunding?: undefined;
1974
+ } & {
1975
+ standard: Record<string, never>;
1976
+ }) | ({
1977
+ standard?: undefined;
1978
+ } & {
1979
+ crowdfunding: Record<string, never>;
1980
+ });
1981
+ collateralType: ({
1982
+ native?: undefined;
1983
+ token?: undefined;
1984
+ } & {
1985
+ stakeAccount: Record<string, never>;
1986
+ }) | ({
1987
+ stakeAccount?: undefined;
1988
+ token?: undefined;
1989
+ } & {
1990
+ native: Record<string, never>;
1991
+ }) | ({
1992
+ stakeAccount?: undefined;
1993
+ native?: undefined;
1994
+ } & {
1995
+ token: {
1996
+ 0: PublicKey;
1997
+ };
1998
+ });
1999
+ reserve: PublicKey;
2000
+ authority: PublicKey;
2001
+ sessionId: number;
2002
+ totalMembers: number;
2003
+ totalCompensationAmount: bn_js;
2004
+ sessionStartTs: bn_js;
2005
+ sessionFinishTs: bn_js;
2006
+ status: ({
2007
+ disabled?: undefined;
2008
+ } & {
2009
+ active: Record<string, never>;
2010
+ }) | ({
2011
+ active?: undefined;
2012
+ } & {
2013
+ disabled: Record<string, never>;
2014
+ });
2015
+ bump: number;
2016
+ publicKey: PublicKey;
2017
+ }>;
1992
2018
  /**
1993
2019
  * Fetch validator bond data or null if not found
1994
2020
  */
1995
- getValidatorBond(bondType: BondType, bondName: string, vote: PublicKeyInitData): Promise<ValidatorBond | null>;
1996
- /**
1997
- * Get bond collateral type
1998
- */
1999
- getBondCollateralType(bondType: BondType, bondName: string): Promise<CollateralType>;
2021
+ getValidatorBond(bondType: BondType, bondName: string, vote: PublicKeyInitData): Promise<{
2022
+ state: PublicKey;
2023
+ identity: PublicKey;
2024
+ voteAccount: PublicKey;
2025
+ creator: PublicKey;
2026
+ withdrawalAuthority: PublicKey | null;
2027
+ createdAt: bn_js;
2028
+ bump: number;
2029
+ publicKey: PublicKey;
2030
+ }>;
2000
2031
  /**
2001
2032
  * Get validator bond account balance (in SOL)
2002
- * @param bondType - Type of the bond
2003
- * @param bondName - Name of the bond
2004
- * @param vote - Vote account public key
2005
- * @return Balance in lamports
2006
2033
  */
2007
2034
  getValidatorBondBalance(bondType: BondType, bondName: string, vote: PublicKeyInitData): Promise<number>;
2008
2035
  /**
2009
2036
  * Get total collected collateral for a bond state
2010
2037
  */
2011
- getBondStateTotalCollected(bondType: BondType, bondName: string, votes: PublicKeyInitData[]): Promise<number>;
2012
- /**
2013
- * Get transaction history for a specific validator bond account
2014
- */
2015
- getHistory(bondType: BondType, bondName: string, vote: PublicKey, options?: {
2016
- cluster?: 'mainnet-beta' | 'testnet' | 'devnet';
2017
- limit?: number;
2018
- before?: string;
2019
- until?: string;
2020
- }): Promise<TransactionHistoryItem[]>;
2021
- /**
2022
- * Get full transaction history by paginating through results
2023
- * @param bondType
2024
- * @param bondName
2025
- * @param voteAccount
2026
- * @param pageSize
2027
- */
2028
- getFullHistory(bondType: BondType, bondName: string, voteAccount: PublicKey, pageSize?: number): Promise<TransactionHistoryItem[]>;
2029
- /**
2030
- * Get instruction discriminator from IDL
2031
- * @param instructionName
2032
- * @private
2033
- */
2034
- private getInstructionDiscriminator;
2038
+ getBondStateTotalCollected(bondType: BondType, bondName: string, votes: PublicKeyInitData[]): Promise<unknown>;
2035
2039
  /**
2036
2040
  * Get bond state stats
2037
2041
  * @param state
2038
2042
  * @private
2039
2043
  */
2040
2044
  private getBondStateStats;
2041
- private lamports;
2045
+ /**
2046
+ * Get all validator bonds for a given bond state
2047
+ */
2048
+ private getBondValidatorStates;
2049
+ /**
2050
+ * Get session status for bond state
2051
+ */
2052
+ private getBondStateSessionStatus;
2042
2053
  }
2043
2054
 
2044
- export { BondClientEnv, type BondCollateral, type BondConfigureProps, type BondInitializeProps, type BondState, type BondStateStats, type BondStateStatus, BondStateStatusVariant, BondTransactionType, type BondType, BondTypeVariant, type ClaimProps, type ClientOptions, type CollateralType, ENV_PROGRAM_ID, type EpochHistoryItem, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalConfigureProps, type GlobalInitializeProps, type GlobalState, JBondClient, JPOOL_STAKE_POOL, type Jbond, NodeWallet, type RegisterValidatorProps, Seeds, SessionStatus, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, type ValidatorBond, type WithdrawCollateralProps, bondTypeToSeed };
2055
+ declare const GLOBAL_STATE_SEED = "global_state";
2056
+ declare const BOND_STATE_SEED = "bond_state";
2057
+ declare const VALIDATOR_BOND_SEED = "validator_bond";
2058
+ declare const STANDARD_BOND_SEED = "standard";
2059
+ declare const CROWDFUNDING_BOND_SEED = "crowdfunding";
2060
+ /**
2061
+ * Program IDs for different environments
2062
+ */
2063
+ declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
2064
+
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 };