@jpool/bond-sdk 0.11.0-next.9 → 0.11.1
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 +501 -194
- package/dist/index.d.ts +501 -194
- package/dist/index.js +537 -208
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +534 -207
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -11,10 +11,10 @@ import { PublicKey, PublicKeyInitData, Cluster, Transaction, VersionedTransactio
|
|
|
11
11
|
* IDL can be found at `target/idl/jbond.json`.
|
|
12
12
|
*/
|
|
13
13
|
type Jbond = {
|
|
14
|
-
"address": "
|
|
14
|
+
"address": "BondQ7KqZreTcW2UbeTNDcLCJQ3aXAtLn2Fm6ftaJDU";
|
|
15
15
|
"metadata": {
|
|
16
16
|
"name": "jbond";
|
|
17
|
-
"version": "0.2.
|
|
17
|
+
"version": "0.2.5";
|
|
18
18
|
"spec": "0.1.0";
|
|
19
19
|
"description": "Jpool Bond Program";
|
|
20
20
|
};
|
|
@@ -90,6 +90,9 @@ type Jbond = {
|
|
|
90
90
|
{
|
|
91
91
|
"name": "authority";
|
|
92
92
|
"signer": true;
|
|
93
|
+
"relations": [
|
|
94
|
+
"bondState"
|
|
95
|
+
];
|
|
93
96
|
},
|
|
94
97
|
{
|
|
95
98
|
"name": "bondTokenAccount";
|
|
@@ -263,10 +266,12 @@ type Jbond = {
|
|
|
263
266
|
{
|
|
264
267
|
"name": "bondLockFunds";
|
|
265
268
|
"docs": [
|
|
266
|
-
"Locks funds
|
|
267
|
-
"
|
|
269
|
+
"Locks funds immediately, making them unavailable for withdrawal.",
|
|
270
|
+
"The locked amount takes effect immediately in the current epoch.",
|
|
271
|
+
"",
|
|
268
272
|
"# Errors",
|
|
269
|
-
"Fails if the
|
|
273
|
+
"Fails if the bond type is not lockable, if the amount is zero,",
|
|
274
|
+
"or if there are insufficient available funds."
|
|
270
275
|
];
|
|
271
276
|
"discriminator": [
|
|
272
277
|
117,
|
|
@@ -286,6 +291,38 @@ type Jbond = {
|
|
|
286
291
|
{
|
|
287
292
|
"name": "validatorBond";
|
|
288
293
|
"writable": true;
|
|
294
|
+
"pda": {
|
|
295
|
+
"seeds": [
|
|
296
|
+
{
|
|
297
|
+
"kind": "const";
|
|
298
|
+
"value": [
|
|
299
|
+
118,
|
|
300
|
+
97,
|
|
301
|
+
108,
|
|
302
|
+
105,
|
|
303
|
+
100,
|
|
304
|
+
97,
|
|
305
|
+
116,
|
|
306
|
+
111,
|
|
307
|
+
114,
|
|
308
|
+
95,
|
|
309
|
+
98,
|
|
310
|
+
111,
|
|
311
|
+
110,
|
|
312
|
+
100
|
|
313
|
+
];
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"kind": "account";
|
|
317
|
+
"path": "bondState";
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"kind": "account";
|
|
321
|
+
"path": "validator_bond.vote_account";
|
|
322
|
+
"account": "validatorBond";
|
|
323
|
+
}
|
|
324
|
+
];
|
|
325
|
+
};
|
|
289
326
|
},
|
|
290
327
|
{
|
|
291
328
|
"name": "bondTokenAccount";
|
|
@@ -332,6 +369,33 @@ type Jbond = {
|
|
|
332
369
|
{
|
|
333
370
|
"name": "bondState";
|
|
334
371
|
"writable": true;
|
|
372
|
+
"pda": {
|
|
373
|
+
"seeds": [
|
|
374
|
+
{
|
|
375
|
+
"kind": "const";
|
|
376
|
+
"value": [
|
|
377
|
+
98,
|
|
378
|
+
111,
|
|
379
|
+
110,
|
|
380
|
+
100,
|
|
381
|
+
95,
|
|
382
|
+
115,
|
|
383
|
+
116,
|
|
384
|
+
97,
|
|
385
|
+
116,
|
|
386
|
+
101
|
|
387
|
+
];
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"kind": "arg";
|
|
391
|
+
"path": "bondType";
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"kind": "arg";
|
|
395
|
+
"path": "bondName";
|
|
396
|
+
}
|
|
397
|
+
];
|
|
398
|
+
};
|
|
335
399
|
},
|
|
336
400
|
{
|
|
337
401
|
"name": "validatorBond";
|
|
@@ -419,10 +483,13 @@ type Jbond = {
|
|
|
419
483
|
{
|
|
420
484
|
"name": "bondReleaseFunds";
|
|
421
485
|
"docs": [
|
|
422
|
-
"
|
|
423
|
-
"
|
|
486
|
+
"Queues funds for unlock in the next epoch.",
|
|
487
|
+
"The unlock is delayed by one epoch for security - funds remain locked",
|
|
488
|
+
"in the current epoch but will be available after epoch transition.",
|
|
489
|
+
"",
|
|
424
490
|
"# Errors",
|
|
425
|
-
"Fails if the
|
|
491
|
+
"Fails if the bond type is not lockable, if the amount is zero,",
|
|
492
|
+
"or if the amount exceeds currently locked funds."
|
|
426
493
|
];
|
|
427
494
|
"discriminator": [
|
|
428
495
|
184,
|
|
@@ -435,9 +502,45 @@ type Jbond = {
|
|
|
435
502
|
190
|
|
436
503
|
];
|
|
437
504
|
"accounts": [
|
|
505
|
+
{
|
|
506
|
+
"name": "bondState";
|
|
507
|
+
"writable": true;
|
|
508
|
+
},
|
|
438
509
|
{
|
|
439
510
|
"name": "validatorBond";
|
|
440
511
|
"writable": true;
|
|
512
|
+
"pda": {
|
|
513
|
+
"seeds": [
|
|
514
|
+
{
|
|
515
|
+
"kind": "const";
|
|
516
|
+
"value": [
|
|
517
|
+
118,
|
|
518
|
+
97,
|
|
519
|
+
108,
|
|
520
|
+
105,
|
|
521
|
+
100,
|
|
522
|
+
97,
|
|
523
|
+
116,
|
|
524
|
+
111,
|
|
525
|
+
114,
|
|
526
|
+
95,
|
|
527
|
+
98,
|
|
528
|
+
111,
|
|
529
|
+
110,
|
|
530
|
+
100
|
|
531
|
+
];
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"kind": "account";
|
|
535
|
+
"path": "bondState";
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
"kind": "account";
|
|
539
|
+
"path": "validator_bond.vote_account";
|
|
540
|
+
"account": "validatorBond";
|
|
541
|
+
}
|
|
542
|
+
];
|
|
543
|
+
};
|
|
441
544
|
},
|
|
442
545
|
{
|
|
443
546
|
"name": "payer";
|
|
@@ -452,6 +555,37 @@ type Jbond = {
|
|
|
452
555
|
}
|
|
453
556
|
];
|
|
454
557
|
},
|
|
558
|
+
{
|
|
559
|
+
"name": "bondRemove";
|
|
560
|
+
"docs": [
|
|
561
|
+
"Removes bond state"
|
|
562
|
+
];
|
|
563
|
+
"discriminator": [
|
|
564
|
+
121,
|
|
565
|
+
112,
|
|
566
|
+
246,
|
|
567
|
+
177,
|
|
568
|
+
181,
|
|
569
|
+
8,
|
|
570
|
+
18,
|
|
571
|
+
220
|
|
572
|
+
];
|
|
573
|
+
"accounts": [
|
|
574
|
+
{
|
|
575
|
+
"name": "bondState";
|
|
576
|
+
"writable": true;
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
"name": "authority";
|
|
580
|
+
"writable": true;
|
|
581
|
+
"signer": true;
|
|
582
|
+
"relations": [
|
|
583
|
+
"bondState"
|
|
584
|
+
];
|
|
585
|
+
}
|
|
586
|
+
];
|
|
587
|
+
"args": [];
|
|
588
|
+
},
|
|
455
589
|
{
|
|
456
590
|
"name": "bondSetWithdrawAuthority";
|
|
457
591
|
"docs": [
|
|
@@ -634,15 +768,12 @@ type Jbond = {
|
|
|
634
768
|
{
|
|
635
769
|
"name": "bondUpdate";
|
|
636
770
|
"docs": [
|
|
637
|
-
"
|
|
771
|
+
"Applies any pending unlocks from previous epochs.",
|
|
638
772
|
"",
|
|
639
|
-
"This
|
|
640
|
-
"
|
|
641
|
-
"
|
|
642
|
-
""
|
|
643
|
-
"# Errors",
|
|
644
|
-
"Returns [`BondError::InvalidEpoch`] if called more than once in the same epoch,",
|
|
645
|
-
"or if the system clock cannot be accessed."
|
|
773
|
+
"This instruction is optional - all other operations now automatically",
|
|
774
|
+
"sync the epoch state. It is kept for backwards compatibility and can",
|
|
775
|
+
"be used to explicitly trigger epoch synchronization without performing",
|
|
776
|
+
"another operation."
|
|
646
777
|
];
|
|
647
778
|
"discriminator": [
|
|
648
779
|
237,
|
|
@@ -661,7 +792,6 @@ type Jbond = {
|
|
|
661
792
|
},
|
|
662
793
|
{
|
|
663
794
|
"name": "payer";
|
|
664
|
-
"writable": true;
|
|
665
795
|
"signer": true;
|
|
666
796
|
}
|
|
667
797
|
];
|
|
@@ -884,80 +1014,6 @@ type Jbond = {
|
|
|
884
1014
|
];
|
|
885
1015
|
"args": [];
|
|
886
1016
|
},
|
|
887
|
-
{
|
|
888
|
-
"name": "migrateBond";
|
|
889
|
-
"docs": [
|
|
890
|
-
"Migrates validator bond data from legacy structure to new structure."
|
|
891
|
-
];
|
|
892
|
-
"discriminator": [
|
|
893
|
-
107,
|
|
894
|
-
119,
|
|
895
|
-
59,
|
|
896
|
-
110,
|
|
897
|
-
76,
|
|
898
|
-
18,
|
|
899
|
-
37,
|
|
900
|
-
163
|
|
901
|
-
];
|
|
902
|
-
"accounts": [
|
|
903
|
-
{
|
|
904
|
-
"name": "bondState";
|
|
905
|
-
"writable": true;
|
|
906
|
-
},
|
|
907
|
-
{
|
|
908
|
-
"name": "legacyValidatorBond";
|
|
909
|
-
"writable": true;
|
|
910
|
-
},
|
|
911
|
-
{
|
|
912
|
-
"name": "legacyVoteAccount";
|
|
913
|
-
},
|
|
914
|
-
{
|
|
915
|
-
"name": "validatorBond";
|
|
916
|
-
"writable": true;
|
|
917
|
-
"pda": {
|
|
918
|
-
"seeds": [
|
|
919
|
-
{
|
|
920
|
-
"kind": "const";
|
|
921
|
-
"value": [
|
|
922
|
-
118,
|
|
923
|
-
97,
|
|
924
|
-
108,
|
|
925
|
-
105,
|
|
926
|
-
100,
|
|
927
|
-
97,
|
|
928
|
-
116,
|
|
929
|
-
111,
|
|
930
|
-
114,
|
|
931
|
-
95,
|
|
932
|
-
98,
|
|
933
|
-
111,
|
|
934
|
-
110,
|
|
935
|
-
100
|
|
936
|
-
];
|
|
937
|
-
},
|
|
938
|
-
{
|
|
939
|
-
"kind": "account";
|
|
940
|
-
"path": "bondState";
|
|
941
|
-
},
|
|
942
|
-
{
|
|
943
|
-
"kind": "account";
|
|
944
|
-
"path": "legacyVoteAccount";
|
|
945
|
-
}
|
|
946
|
-
];
|
|
947
|
-
};
|
|
948
|
-
},
|
|
949
|
-
{
|
|
950
|
-
"name": "creator";
|
|
951
|
-
"writable": true;
|
|
952
|
-
"signer": true;
|
|
953
|
-
},
|
|
954
|
-
{
|
|
955
|
-
"name": "systemProgram";
|
|
956
|
-
"address": "11111111111111111111111111111111";
|
|
957
|
-
}
|
|
958
|
-
];
|
|
959
|
-
"args": [];
|
|
960
|
-
},
|
|
961
1017
|
{
|
|
962
1018
|
"name": "sessionFinish";
|
|
963
1019
|
"docs": [
|
|
@@ -1068,6 +1124,19 @@ type Jbond = {
|
|
|
1068
1124
|
}
|
|
1069
1125
|
];
|
|
1070
1126
|
"events": [
|
|
1127
|
+
{
|
|
1128
|
+
"name": "bondConfigured";
|
|
1129
|
+
"discriminator": [
|
|
1130
|
+
141,
|
|
1131
|
+
252,
|
|
1132
|
+
43,
|
|
1133
|
+
54,
|
|
1134
|
+
45,
|
|
1135
|
+
157,
|
|
1136
|
+
81,
|
|
1137
|
+
14
|
|
1138
|
+
];
|
|
1139
|
+
},
|
|
1071
1140
|
{
|
|
1072
1141
|
"name": "bondFinished";
|
|
1073
1142
|
"discriminator": [
|
|
@@ -1081,6 +1150,32 @@ type Jbond = {
|
|
|
1081
1150
|
191
|
|
1082
1151
|
];
|
|
1083
1152
|
},
|
|
1153
|
+
{
|
|
1154
|
+
"name": "bondInitialized";
|
|
1155
|
+
"discriminator": [
|
|
1156
|
+
73,
|
|
1157
|
+
68,
|
|
1158
|
+
161,
|
|
1159
|
+
2,
|
|
1160
|
+
214,
|
|
1161
|
+
12,
|
|
1162
|
+
169,
|
|
1163
|
+
53
|
|
1164
|
+
];
|
|
1165
|
+
},
|
|
1166
|
+
{
|
|
1167
|
+
"name": "bondRemoved";
|
|
1168
|
+
"discriminator": [
|
|
1169
|
+
177,
|
|
1170
|
+
200,
|
|
1171
|
+
116,
|
|
1172
|
+
123,
|
|
1173
|
+
1,
|
|
1174
|
+
244,
|
|
1175
|
+
161,
|
|
1176
|
+
240
|
|
1177
|
+
];
|
|
1178
|
+
},
|
|
1084
1179
|
{
|
|
1085
1180
|
"name": "bondStarted";
|
|
1086
1181
|
"discriminator": [
|
|
@@ -1095,16 +1190,16 @@ type Jbond = {
|
|
|
1095
1190
|
];
|
|
1096
1191
|
},
|
|
1097
1192
|
{
|
|
1098
|
-
"name": "
|
|
1193
|
+
"name": "collateralDeposited";
|
|
1099
1194
|
"discriminator": [
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1195
|
+
244,
|
|
1196
|
+
62,
|
|
1197
|
+
77,
|
|
1198
|
+
11,
|
|
1104
1199
|
135,
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1200
|
+
112,
|
|
1201
|
+
61,
|
|
1202
|
+
96
|
|
1108
1203
|
];
|
|
1109
1204
|
},
|
|
1110
1205
|
{
|
|
@@ -1120,6 +1215,19 @@ type Jbond = {
|
|
|
1120
1215
|
82
|
|
1121
1216
|
];
|
|
1122
1217
|
},
|
|
1218
|
+
{
|
|
1219
|
+
"name": "compensationBurned";
|
|
1220
|
+
"discriminator": [
|
|
1221
|
+
177,
|
|
1222
|
+
198,
|
|
1223
|
+
90,
|
|
1224
|
+
188,
|
|
1225
|
+
47,
|
|
1226
|
+
95,
|
|
1227
|
+
20,
|
|
1228
|
+
174
|
|
1229
|
+
];
|
|
1230
|
+
},
|
|
1123
1231
|
{
|
|
1124
1232
|
"name": "compensationClaimed";
|
|
1125
1233
|
"discriminator": [
|
|
@@ -1133,6 +1241,32 @@ type Jbond = {
|
|
|
1133
1241
|
32
|
|
1134
1242
|
];
|
|
1135
1243
|
},
|
|
1244
|
+
{
|
|
1245
|
+
"name": "fundsLocked";
|
|
1246
|
+
"discriminator": [
|
|
1247
|
+
227,
|
|
1248
|
+
93,
|
|
1249
|
+
162,
|
|
1250
|
+
69,
|
|
1251
|
+
181,
|
|
1252
|
+
4,
|
|
1253
|
+
71,
|
|
1254
|
+
157
|
|
1255
|
+
];
|
|
1256
|
+
},
|
|
1257
|
+
{
|
|
1258
|
+
"name": "fundsUnlocked";
|
|
1259
|
+
"discriminator": [
|
|
1260
|
+
11,
|
|
1261
|
+
240,
|
|
1262
|
+
184,
|
|
1263
|
+
107,
|
|
1264
|
+
86,
|
|
1265
|
+
187,
|
|
1266
|
+
196,
|
|
1267
|
+
128
|
|
1268
|
+
];
|
|
1269
|
+
},
|
|
1136
1270
|
{
|
|
1137
1271
|
"name": "validatorRegistered";
|
|
1138
1272
|
"discriminator": [
|
|
@@ -1145,33 +1279,46 @@ type Jbond = {
|
|
|
1145
1279
|
95,
|
|
1146
1280
|
72
|
|
1147
1281
|
];
|
|
1282
|
+
},
|
|
1283
|
+
{
|
|
1284
|
+
"name": "withdrawAuthorityChanged";
|
|
1285
|
+
"discriminator": [
|
|
1286
|
+
91,
|
|
1287
|
+
149,
|
|
1288
|
+
224,
|
|
1289
|
+
49,
|
|
1290
|
+
187,
|
|
1291
|
+
48,
|
|
1292
|
+
190,
|
|
1293
|
+
100
|
|
1294
|
+
];
|
|
1148
1295
|
}
|
|
1149
1296
|
];
|
|
1150
1297
|
"errors": [
|
|
1151
1298
|
{
|
|
1152
1299
|
"code": 6000;
|
|
1153
|
-
"name": "
|
|
1154
|
-
"msg": "
|
|
1300
|
+
"name": "forbidden";
|
|
1301
|
+
"msg": "forbidden";
|
|
1155
1302
|
},
|
|
1156
1303
|
{
|
|
1157
1304
|
"code": 6001;
|
|
1158
|
-
"name": "
|
|
1159
|
-
"msg": "
|
|
1305
|
+
"name": "unauthorized";
|
|
1306
|
+
"msg": "unauthorized";
|
|
1160
1307
|
},
|
|
1161
1308
|
{
|
|
1162
1309
|
"code": 6002;
|
|
1163
|
-
"name": "
|
|
1164
|
-
"msg": "
|
|
1310
|
+
"name": "invalidVoteAccount";
|
|
1311
|
+
"msg": "Invalid vote account";
|
|
1165
1312
|
},
|
|
1166
1313
|
{
|
|
1167
1314
|
"code": 6003;
|
|
1168
|
-
"name": "
|
|
1169
|
-
"msg": "
|
|
1315
|
+
"name": "identityMismatch";
|
|
1316
|
+
"msg": "Vote account identity mismatch";
|
|
1170
1317
|
},
|
|
1171
1318
|
{
|
|
1172
1319
|
"code": 6004;
|
|
1173
|
-
"name": "
|
|
1174
|
-
"msg": "
|
|
1320
|
+
"name": "invalidMint";
|
|
1321
|
+
"msg": "Invalid mint address";
|
|
1175
1322
|
},
|
|
1176
1323
|
{
|
|
1177
1324
|
"code": 6005;
|
|
@@ -1180,98 +1327,53 @@ type Jbond = {
|
|
|
1180
1327
|
},
|
|
1181
1328
|
{
|
|
1182
1329
|
"code": 6006;
|
|
1183
|
-
"name": "
|
|
1184
|
-
"msg": "
|
|
1330
|
+
"name": "invalidArgument";
|
|
1331
|
+
"msg": "Invalid argument";
|
|
1185
1332
|
},
|
|
1186
1333
|
{
|
|
1187
1334
|
"code": 6007;
|
|
1188
|
-
"name": "
|
|
1189
|
-
"msg": "
|
|
1335
|
+
"name": "insufficientBalance";
|
|
1336
|
+
"msg": "Insufficient balance";
|
|
1190
1337
|
},
|
|
1191
1338
|
{
|
|
1192
1339
|
"code": 6008;
|
|
1193
|
-
"name": "
|
|
1194
|
-
"msg": "
|
|
1340
|
+
"name": "mathOverflow";
|
|
1341
|
+
"msg": "Math overflow";
|
|
1195
1342
|
},
|
|
1196
1343
|
{
|
|
1197
1344
|
"code": 6009;
|
|
1198
|
-
"name": "
|
|
1199
|
-
"msg": "
|
|
1345
|
+
"name": "overflow";
|
|
1346
|
+
"msg": "Arithmetic overflow";
|
|
1200
1347
|
},
|
|
1201
1348
|
{
|
|
1202
1349
|
"code": 6010;
|
|
1203
|
-
"name": "
|
|
1204
|
-
"msg": "
|
|
1350
|
+
"name": "bondNotRemovable";
|
|
1351
|
+
"msg": "Bond cannot be removed";
|
|
1205
1352
|
},
|
|
1206
1353
|
{
|
|
1207
1354
|
"code": 6011;
|
|
1208
|
-
"name": "
|
|
1209
|
-
"msg": "
|
|
1355
|
+
"name": "missingTokenAccounts";
|
|
1356
|
+
"msg": "Missing token accounts";
|
|
1210
1357
|
},
|
|
1211
1358
|
{
|
|
1212
1359
|
"code": 6012;
|
|
1213
|
-
"name": "
|
|
1214
|
-
"msg": "
|
|
1360
|
+
"name": "missingTokenProgram";
|
|
1361
|
+
"msg": "Missing token program";
|
|
1215
1362
|
},
|
|
1216
1363
|
{
|
|
1217
1364
|
"code": 6013;
|
|
1218
1365
|
"name": "missingStakeAccount";
|
|
1219
|
-
"msg": "
|
|
1366
|
+
"msg": "Missing stake account";
|
|
1220
1367
|
},
|
|
1221
1368
|
{
|
|
1222
1369
|
"code": 6014;
|
|
1223
1370
|
"name": "missingStakeProgram";
|
|
1224
|
-
"msg": "
|
|
1371
|
+
"msg": "Missing stake program";
|
|
1225
1372
|
},
|
|
1226
1373
|
{
|
|
1227
1374
|
"code": 6015;
|
|
1228
|
-
"name": "bondFinished";
|
|
1229
|
-
"msg": "Bond is finished (deposits/withdrawals disabled)";
|
|
1230
|
-
},
|
|
1231
|
-
{
|
|
1232
|
-
"code": 6016;
|
|
1233
|
-
"name": "bondNotFinished";
|
|
1234
|
-
"msg": "Bond is not finished";
|
|
1235
|
-
},
|
|
1236
|
-
{
|
|
1237
|
-
"code": 6017;
|
|
1238
1375
|
"name": "unsupportedCollateralType";
|
|
1239
1376
|
"msg": "Unsupported collateral type";
|
|
1240
|
-
},
|
|
1241
|
-
{
|
|
1242
|
-
"code": 6018;
|
|
1243
|
-
"name": "overflow";
|
|
1244
|
-
"msg": "Math operation overflowed";
|
|
1245
|
-
},
|
|
1246
|
-
{
|
|
1247
|
-
"code": 6019;
|
|
1248
|
-
"name": "incorrectBondType";
|
|
1249
|
-
"msg": "Incorrect bond type for this operation";
|
|
1250
|
-
},
|
|
1251
|
-
{
|
|
1252
|
-
"code": 6020;
|
|
1253
|
-
"name": "bondNotFinishable";
|
|
1254
|
-
"msg": "This bond type can't be finished";
|
|
1255
|
-
},
|
|
1256
|
-
{
|
|
1257
|
-
"code": 6021;
|
|
1258
|
-
"name": "invalidArgument";
|
|
1259
|
-
"msg": "Invalid argument provided";
|
|
1260
|
-
},
|
|
1261
|
-
{
|
|
1262
|
-
"code": 6022;
|
|
1263
|
-
"name": "bondNotDisabled";
|
|
1264
|
-
"msg": "Bond is not disabled";
|
|
1265
|
-
},
|
|
1266
|
-
{
|
|
1267
|
-
"code": 6023;
|
|
1268
|
-
"name": "bondNotEnabled";
|
|
1269
|
-
"msg": "Bond is not enabled";
|
|
1270
|
-
},
|
|
1271
|
-
{
|
|
1272
|
-
"code": 6024;
|
|
1273
|
-
"name": "invalidEpoch";
|
|
1274
|
-
"msg": "Invalid epoch for this operation";
|
|
1275
1377
|
}
|
|
1276
1378
|
];
|
|
1277
1379
|
"types": [
|
|
@@ -1305,6 +1407,26 @@ type Jbond = {
|
|
|
1305
1407
|
];
|
|
1306
1408
|
};
|
|
1307
1409
|
},
|
|
1410
|
+
{
|
|
1411
|
+
"name": "bondConfigured";
|
|
1412
|
+
"type": {
|
|
1413
|
+
"kind": "struct";
|
|
1414
|
+
"fields": [
|
|
1415
|
+
{
|
|
1416
|
+
"name": "bond";
|
|
1417
|
+
"type": "pubkey";
|
|
1418
|
+
},
|
|
1419
|
+
{
|
|
1420
|
+
"name": "authority";
|
|
1421
|
+
"type": "pubkey";
|
|
1422
|
+
},
|
|
1423
|
+
{
|
|
1424
|
+
"name": "timestamp";
|
|
1425
|
+
"type": "i64";
|
|
1426
|
+
}
|
|
1427
|
+
];
|
|
1428
|
+
};
|
|
1429
|
+
},
|
|
1308
1430
|
{
|
|
1309
1431
|
"name": "bondFinished";
|
|
1310
1432
|
"type": {
|
|
@@ -1360,6 +1482,46 @@ type Jbond = {
|
|
|
1360
1482
|
];
|
|
1361
1483
|
};
|
|
1362
1484
|
},
|
|
1485
|
+
{
|
|
1486
|
+
"name": "bondInitialized";
|
|
1487
|
+
"type": {
|
|
1488
|
+
"kind": "struct";
|
|
1489
|
+
"fields": [
|
|
1490
|
+
{
|
|
1491
|
+
"name": "bond";
|
|
1492
|
+
"type": "pubkey";
|
|
1493
|
+
},
|
|
1494
|
+
{
|
|
1495
|
+
"name": "authority";
|
|
1496
|
+
"type": "pubkey";
|
|
1497
|
+
},
|
|
1498
|
+
{
|
|
1499
|
+
"name": "timestamp";
|
|
1500
|
+
"type": "i64";
|
|
1501
|
+
}
|
|
1502
|
+
];
|
|
1503
|
+
};
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
"name": "bondRemoved";
|
|
1507
|
+
"type": {
|
|
1508
|
+
"kind": "struct";
|
|
1509
|
+
"fields": [
|
|
1510
|
+
{
|
|
1511
|
+
"name": "bond";
|
|
1512
|
+
"type": "pubkey";
|
|
1513
|
+
},
|
|
1514
|
+
{
|
|
1515
|
+
"name": "authority";
|
|
1516
|
+
"type": "pubkey";
|
|
1517
|
+
},
|
|
1518
|
+
{
|
|
1519
|
+
"name": "timestamp";
|
|
1520
|
+
"type": "i64";
|
|
1521
|
+
}
|
|
1522
|
+
];
|
|
1523
|
+
};
|
|
1524
|
+
},
|
|
1363
1525
|
{
|
|
1364
1526
|
"name": "bondStarted";
|
|
1365
1527
|
"type": {
|
|
@@ -1513,7 +1675,7 @@ type Jbond = {
|
|
|
1513
1675
|
};
|
|
1514
1676
|
},
|
|
1515
1677
|
{
|
|
1516
|
-
"name": "
|
|
1678
|
+
"name": "collateralDeposited";
|
|
1517
1679
|
"type": {
|
|
1518
1680
|
"kind": "struct";
|
|
1519
1681
|
"fields": [
|
|
@@ -1583,6 +1745,34 @@ type Jbond = {
|
|
|
1583
1745
|
];
|
|
1584
1746
|
};
|
|
1585
1747
|
},
|
|
1748
|
+
{
|
|
1749
|
+
"name": "compensationBurned";
|
|
1750
|
+
"type": {
|
|
1751
|
+
"kind": "struct";
|
|
1752
|
+
"fields": [
|
|
1753
|
+
{
|
|
1754
|
+
"name": "validator";
|
|
1755
|
+
"type": "pubkey";
|
|
1756
|
+
},
|
|
1757
|
+
{
|
|
1758
|
+
"name": "amount";
|
|
1759
|
+
"type": "u64";
|
|
1760
|
+
},
|
|
1761
|
+
{
|
|
1762
|
+
"name": "postBalance";
|
|
1763
|
+
"type": "u64";
|
|
1764
|
+
},
|
|
1765
|
+
{
|
|
1766
|
+
"name": "epoch";
|
|
1767
|
+
"type": "u64";
|
|
1768
|
+
},
|
|
1769
|
+
{
|
|
1770
|
+
"name": "timestamp";
|
|
1771
|
+
"type": "i64";
|
|
1772
|
+
}
|
|
1773
|
+
];
|
|
1774
|
+
};
|
|
1775
|
+
},
|
|
1586
1776
|
{
|
|
1587
1777
|
"name": "compensationClaimed";
|
|
1588
1778
|
"type": {
|
|
@@ -1611,6 +1801,54 @@ type Jbond = {
|
|
|
1611
1801
|
];
|
|
1612
1802
|
};
|
|
1613
1803
|
},
|
|
1804
|
+
{
|
|
1805
|
+
"name": "fundsLocked";
|
|
1806
|
+
"type": {
|
|
1807
|
+
"kind": "struct";
|
|
1808
|
+
"fields": [
|
|
1809
|
+
{
|
|
1810
|
+
"name": "validator";
|
|
1811
|
+
"type": "pubkey";
|
|
1812
|
+
},
|
|
1813
|
+
{
|
|
1814
|
+
"name": "amount";
|
|
1815
|
+
"type": "u64";
|
|
1816
|
+
},
|
|
1817
|
+
{
|
|
1818
|
+
"name": "totalLocked";
|
|
1819
|
+
"type": "u64";
|
|
1820
|
+
},
|
|
1821
|
+
{
|
|
1822
|
+
"name": "epoch";
|
|
1823
|
+
"type": "u64";
|
|
1824
|
+
}
|
|
1825
|
+
];
|
|
1826
|
+
};
|
|
1827
|
+
},
|
|
1828
|
+
{
|
|
1829
|
+
"name": "fundsUnlocked";
|
|
1830
|
+
"type": {
|
|
1831
|
+
"kind": "struct";
|
|
1832
|
+
"fields": [
|
|
1833
|
+
{
|
|
1834
|
+
"name": "validator";
|
|
1835
|
+
"type": "pubkey";
|
|
1836
|
+
},
|
|
1837
|
+
{
|
|
1838
|
+
"name": "amount";
|
|
1839
|
+
"type": "u64";
|
|
1840
|
+
},
|
|
1841
|
+
{
|
|
1842
|
+
"name": "pendingUnlock";
|
|
1843
|
+
"type": "u64";
|
|
1844
|
+
},
|
|
1845
|
+
{
|
|
1846
|
+
"name": "epoch";
|
|
1847
|
+
"type": "u64";
|
|
1848
|
+
}
|
|
1849
|
+
];
|
|
1850
|
+
};
|
|
1851
|
+
},
|
|
1614
1852
|
{
|
|
1615
1853
|
"name": "globalConfigureData";
|
|
1616
1854
|
"type": {
|
|
@@ -1705,23 +1943,23 @@ type Jbond = {
|
|
|
1705
1943
|
"type": "u8";
|
|
1706
1944
|
},
|
|
1707
1945
|
{
|
|
1708
|
-
"name": "
|
|
1946
|
+
"name": "locked";
|
|
1709
1947
|
"docs": [
|
|
1710
|
-
"Amount of collateral locked for
|
|
1948
|
+
"Amount of collateral currently locked (unavailable for withdrawal)"
|
|
1711
1949
|
];
|
|
1712
1950
|
"type": "u64";
|
|
1713
1951
|
},
|
|
1714
1952
|
{
|
|
1715
|
-
"name": "
|
|
1953
|
+
"name": "pendingUnlock";
|
|
1716
1954
|
"docs": [
|
|
1717
|
-
"
|
|
1955
|
+
"Pending unlock amount (will reduce `locked` next epoch)"
|
|
1718
1956
|
];
|
|
1719
1957
|
"type": "u64";
|
|
1720
1958
|
},
|
|
1721
1959
|
{
|
|
1722
|
-
"name": "
|
|
1960
|
+
"name": "pendingUnlockEpoch";
|
|
1723
1961
|
"docs": [
|
|
1724
|
-
"
|
|
1962
|
+
"Epoch when pending_unlock was queued"
|
|
1725
1963
|
];
|
|
1726
1964
|
"type": "u64";
|
|
1727
1965
|
}
|
|
@@ -1734,7 +1972,7 @@ type Jbond = {
|
|
|
1734
1972
|
"kind": "struct";
|
|
1735
1973
|
"fields": [
|
|
1736
1974
|
{
|
|
1737
|
-
"name": "
|
|
1975
|
+
"name": "validator";
|
|
1738
1976
|
"type": "pubkey";
|
|
1739
1977
|
},
|
|
1740
1978
|
{
|
|
@@ -1747,6 +1985,30 @@ type Jbond = {
|
|
|
1747
1985
|
}
|
|
1748
1986
|
];
|
|
1749
1987
|
};
|
|
1988
|
+
},
|
|
1989
|
+
{
|
|
1990
|
+
"name": "withdrawAuthorityChanged";
|
|
1991
|
+
"type": {
|
|
1992
|
+
"kind": "struct";
|
|
1993
|
+
"fields": [
|
|
1994
|
+
{
|
|
1995
|
+
"name": "validator";
|
|
1996
|
+
"type": "pubkey";
|
|
1997
|
+
},
|
|
1998
|
+
{
|
|
1999
|
+
"name": "oldAuthority";
|
|
2000
|
+
"type": {
|
|
2001
|
+
"option": "pubkey";
|
|
2002
|
+
};
|
|
2003
|
+
},
|
|
2004
|
+
{
|
|
2005
|
+
"name": "newAuthority";
|
|
2006
|
+
"type": {
|
|
2007
|
+
"option": "pubkey";
|
|
2008
|
+
};
|
|
2009
|
+
}
|
|
2010
|
+
];
|
|
2011
|
+
};
|
|
1750
2012
|
}
|
|
1751
2013
|
];
|
|
1752
2014
|
"constants": [
|
|
@@ -1761,6 +2023,14 @@ type Jbond = {
|
|
|
1761
2023
|
];
|
|
1762
2024
|
};
|
|
1763
2025
|
|
|
2026
|
+
/**
|
|
2027
|
+
* Enum for different client environments.
|
|
2028
|
+
*/
|
|
2029
|
+
declare enum JBondClientEnv {
|
|
2030
|
+
DEV = "dev",
|
|
2031
|
+
STAGE = "stage",
|
|
2032
|
+
PROD = "prod"
|
|
2033
|
+
}
|
|
1764
2034
|
type GlobalState = IdlAccounts<Jbond>['globalState'];
|
|
1765
2035
|
type BondState = IdlAccounts<Jbond>['bondState'];
|
|
1766
2036
|
type ValidatorBond = IdlAccounts<Jbond>['validatorBond'];
|
|
@@ -1904,6 +2174,11 @@ type BondFinishProps = {
|
|
|
1904
2174
|
bondType: BondType;
|
|
1905
2175
|
name: string;
|
|
1906
2176
|
};
|
|
2177
|
+
type BondRemoveProps = {
|
|
2178
|
+
bondType: BondType;
|
|
2179
|
+
name: string;
|
|
2180
|
+
authority?: PublicKey;
|
|
2181
|
+
};
|
|
1907
2182
|
|
|
1908
2183
|
type GetHistoryOpts = {
|
|
1909
2184
|
cluster?: Cluster;
|
|
@@ -1916,7 +2191,7 @@ declare class HistoryManager {
|
|
|
1916
2191
|
private discCache;
|
|
1917
2192
|
constructor(client: JBondClient);
|
|
1918
2193
|
get program(): _coral_xyz_anchor.Program<Jbond>;
|
|
1919
|
-
get programId():
|
|
2194
|
+
get programId(): PublicKey;
|
|
1920
2195
|
get connection(): _solana_web3_js.Connection;
|
|
1921
2196
|
debug(...args: any[]): void;
|
|
1922
2197
|
getHistory(bondType: BondType, bondName: string, vote: PublicKeyInitData, opts?: GetHistoryOpts): Promise<TransactionHistoryItem[]>;
|
|
@@ -1940,14 +2215,6 @@ declare class NodeWallet implements Wallet {
|
|
|
1940
2215
|
get publicKey(): PublicKey;
|
|
1941
2216
|
}
|
|
1942
2217
|
|
|
1943
|
-
/**
|
|
1944
|
-
* Enum for different client environments.
|
|
1945
|
-
*/
|
|
1946
|
-
declare enum JBondClientEnv {
|
|
1947
|
-
DEV = "dev",
|
|
1948
|
-
STAGE = "stage",
|
|
1949
|
-
PROD = "prod"
|
|
1950
|
-
}
|
|
1951
2218
|
/**
|
|
1952
2219
|
* Options for configuring the JBondClient.
|
|
1953
2220
|
*/
|
|
@@ -1957,7 +2224,7 @@ type JBondClientOptions = {
|
|
|
1957
2224
|
declare class JBondClient {
|
|
1958
2225
|
readonly provider: Provider;
|
|
1959
2226
|
readonly options: JBondClientOptions;
|
|
1960
|
-
|
|
2227
|
+
private _program;
|
|
1961
2228
|
constructor(provider: Provider, options?: JBondClientOptions);
|
|
1962
2229
|
get history(): HistoryManager;
|
|
1963
2230
|
/**
|
|
@@ -1972,10 +2239,14 @@ declare class JBondClient {
|
|
|
1972
2239
|
* Creates an instance of `JBondClient` using the provided connection and keypair.
|
|
1973
2240
|
*/
|
|
1974
2241
|
static fromKeypair(connection: Connection, keypair: Keypair, options?: JBondClientOptions): JBondClient;
|
|
2242
|
+
/**
|
|
2243
|
+
* Get or create the program instance
|
|
2244
|
+
*/
|
|
2245
|
+
get program(): Program<Jbond>;
|
|
1975
2246
|
/**
|
|
1976
2247
|
* Get the current program ID.
|
|
1977
2248
|
*/
|
|
1978
|
-
get programId():
|
|
2249
|
+
get programId(): PublicKey;
|
|
1979
2250
|
/**
|
|
1980
2251
|
* Get the current connection.
|
|
1981
2252
|
*/
|
|
@@ -2045,6 +2316,7 @@ declare class JBondClient {
|
|
|
2045
2316
|
* Finish crowdfunding bond session
|
|
2046
2317
|
*/
|
|
2047
2318
|
bondFinish(props: BondFinishProps): Promise<string | undefined>;
|
|
2319
|
+
bondRemove(props: BondRemoveProps): Promise<string | undefined>;
|
|
2048
2320
|
/**
|
|
2049
2321
|
* Build global state initialize instruction
|
|
2050
2322
|
*/
|
|
@@ -2095,6 +2367,41 @@ declare class JBondClient {
|
|
|
2095
2367
|
getBondSessionStartIx(props: BondStartProps): Promise<TransactionInstruction>;
|
|
2096
2368
|
lockFunds(props: BondLockFunds): Promise<string | undefined>;
|
|
2097
2369
|
releaseFunds(props: BondReleaseFunds): Promise<string | undefined>;
|
|
2370
|
+
/**
|
|
2371
|
+
* Update epoch locks
|
|
2372
|
+
*/
|
|
2373
|
+
updateEpochLocks(props: {
|
|
2374
|
+
bondType: BondType;
|
|
2375
|
+
bondName: string;
|
|
2376
|
+
voteAccount: PublicKeyInitData;
|
|
2377
|
+
payer: PublicKey;
|
|
2378
|
+
}): Promise<string | undefined>;
|
|
2379
|
+
/**
|
|
2380
|
+
* Build update epoch locks instruction
|
|
2381
|
+
*/
|
|
2382
|
+
getUpdateEpochLocksIx(props: {
|
|
2383
|
+
bondType: BondType;
|
|
2384
|
+
bondName: string;
|
|
2385
|
+
voteAccount: PublicKeyInitData;
|
|
2386
|
+
payer: PublicKey;
|
|
2387
|
+
}): Promise<TransactionInstruction>;
|
|
2388
|
+
/**
|
|
2389
|
+
* Build bond remove instruction
|
|
2390
|
+
*/
|
|
2391
|
+
getBondRemoveIx(props: BondRemoveProps): Promise<TransactionInstruction>;
|
|
2392
|
+
/**
|
|
2393
|
+
* Build test set last update epoch instruction
|
|
2394
|
+
* NOTE!: This instruction is for testing purposes only.
|
|
2395
|
+
* It allows direct manipulation of the validator bond's last epoch update.
|
|
2396
|
+
* This should not be used in production environments.
|
|
2397
|
+
*/
|
|
2398
|
+
getTestSetLastUpdateEpochIx(props: {
|
|
2399
|
+
bondType: BondType;
|
|
2400
|
+
bondName: string;
|
|
2401
|
+
voteAccount: PublicKeyInitData;
|
|
2402
|
+
payer: PublicKey;
|
|
2403
|
+
epoch: number;
|
|
2404
|
+
}): Promise<any>;
|
|
2098
2405
|
/**
|
|
2099
2406
|
* Build lock funds instruction
|
|
2100
2407
|
*/
|
|
@@ -2234,9 +2541,9 @@ declare class JBondClient {
|
|
|
2234
2541
|
withdrawalAuthority: PublicKey | null;
|
|
2235
2542
|
createdAt: bn_js;
|
|
2236
2543
|
bump: number;
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2544
|
+
locked: bn_js;
|
|
2545
|
+
pendingUnlock: bn_js;
|
|
2546
|
+
pendingUnlockEpoch: bn_js;
|
|
2240
2547
|
publicKey: PublicKey;
|
|
2241
2548
|
}>;
|
|
2242
2549
|
/**
|
|
@@ -2279,6 +2586,6 @@ declare const CROWDFUNDING_BOND_SEED = "crowdfunding";
|
|
|
2279
2586
|
/**
|
|
2280
2587
|
* Program IDs for different environments
|
|
2281
2588
|
*/
|
|
2282
|
-
declare const ENV_PROGRAM_ID: Record<
|
|
2589
|
+
declare const ENV_PROGRAM_ID: Record<JBondClientEnv, string>;
|
|
2283
2590
|
|
|
2284
|
-
export { BOND_STATE_SEED, type BondConfigureProps, type BondFinishProps, type BondInitializeProps, type BondLockFunds, type BondReleaseFunds, type BondStartProps, type BondState, type BondStateStats, type BondStateStatus, BondTransactionType, BondType, CROWDFUNDING_BOND_SEED, type ClaimAllProps, type ClaimProps, type CollateralType, ENV_PROGRAM_ID, type EpochHistoryItem, GLOBAL_STATE_SEED, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalConfigureProps, type GlobalInitializeProps, type GlobalState, JBondClient, JBondClientEnv, type JBondClientOptions, type Jbond, NodeWallet, type RegisterValidatorProps, STANDARD_BOND_SEED, SessionStatus, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, VALIDATOR_BOND_SEED, type ValidatorBond, type WithdrawCollateralProps };
|
|
2591
|
+
export { BOND_STATE_SEED, type BondConfigureProps, type BondFinishProps, type BondInitializeProps, type BondLockFunds, type BondReleaseFunds, type BondRemoveProps, type BondStartProps, type BondState, type BondStateStats, type BondStateStatus, BondTransactionType, BondType, CROWDFUNDING_BOND_SEED, type ClaimAllProps, type ClaimProps, type CollateralType, ENV_PROGRAM_ID, type EpochHistoryItem, GLOBAL_STATE_SEED, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalConfigureProps, type GlobalInitializeProps, type GlobalState, JBondClient, JBondClientEnv, type JBondClientOptions, type Jbond, NodeWallet, type RegisterValidatorProps, STANDARD_BOND_SEED, SessionStatus, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, VALIDATOR_BOND_SEED, type ValidatorBond, type WithdrawCollateralProps };
|