@jpool/bond-sdk 0.9.0-next.11 → 0.9.0-next.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -31,7 +31,7 @@ declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
31
31
  * IDL can be found at `target/idl/jbond.json`.
32
32
  */
33
33
  type Jbond = {
34
- "address": "DBuUGWbLz8CkAMQiagMfrQzj8SSg1rHQJWrTSc97HWfR";
34
+ "address": "93BH9J99hQS3YinydR6SVjHuAEECoA9kR1BHwnXeDzQe";
35
35
  "metadata": {
36
36
  "name": "jbond";
37
37
  "version": "0.2.1";
@@ -187,6 +187,68 @@ type Jbond = {
187
187
  }
188
188
  ];
189
189
  },
190
+ {
191
+ "name": "bondDisable";
192
+ "docs": [
193
+ "Disables a validator's bond, preventing it from participating further."
194
+ ];
195
+ "discriminator": [
196
+ 159,
197
+ 156,
198
+ 97,
199
+ 253,
200
+ 70,
201
+ 122,
202
+ 117,
203
+ 129
204
+ ];
205
+ "accounts": [
206
+ {
207
+ "name": "bondState";
208
+ "writable": true;
209
+ },
210
+ {
211
+ "name": "authority";
212
+ "writable": true;
213
+ "signer": true;
214
+ "relations": [
215
+ "bondState"
216
+ ];
217
+ }
218
+ ];
219
+ "args": [];
220
+ },
221
+ {
222
+ "name": "bondEnable";
223
+ "docs": [
224
+ "Enables a previously disabled validator's bond."
225
+ ];
226
+ "discriminator": [
227
+ 133,
228
+ 48,
229
+ 84,
230
+ 9,
231
+ 117,
232
+ 131,
233
+ 164,
234
+ 128
235
+ ];
236
+ "accounts": [
237
+ {
238
+ "name": "bondState";
239
+ "writable": true;
240
+ },
241
+ {
242
+ "name": "authority";
243
+ "writable": true;
244
+ "signer": true;
245
+ "relations": [
246
+ "bondState"
247
+ ];
248
+ }
249
+ ];
250
+ "args": [];
251
+ },
190
252
  {
191
253
  "name": "bondInitialize";
192
254
  "docs": [
@@ -1094,6 +1156,16 @@ type Jbond = {
1094
1156
  "code": 6021;
1095
1157
  "name": "invalidArgument";
1096
1158
  "msg": "Invalid argument provided";
1159
+ },
1160
+ {
1161
+ "code": 6022;
1162
+ "name": "bondNotDisabled";
1163
+ "msg": "Bond is not disabled";
1164
+ },
1165
+ {
1166
+ "code": 6023;
1167
+ "name": "bondNotEnabled";
1168
+ "msg": "Bond is not enabled";
1097
1169
  }
1098
1170
  ];
1099
1171
  "types": [
@@ -1272,6 +1344,14 @@ type Jbond = {
1272
1344
  ];
1273
1345
  "type": "i64";
1274
1346
  },
1347
+ {
1348
+ "name": "status";
1349
+ "type": {
1350
+ "defined": {
1351
+ "name": "bondStatus";
1352
+ };
1353
+ };
1354
+ },
1275
1355
  {
1276
1356
  "name": "bump";
1277
1357
  "docs": [
@@ -1282,6 +1362,20 @@ type Jbond = {
1282
1362
  ];
1283
1363
  };
1284
1364
  },
1365
+ {
1366
+ "name": "bondStatus";
1367
+ "type": {
1368
+ "kind": "enum";
1369
+ "variants": [
1370
+ {
1371
+ "name": "active";
1372
+ },
1373
+ {
1374
+ "name": "disabled";
1375
+ }
1376
+ ];
1377
+ };
1378
+ },
1285
1379
  {
1286
1380
  "name": "bondType";
1287
1381
  "docs": [
@@ -1417,15 +1511,6 @@ type Jbond = {
1417
1511
  "type": {
1418
1512
  "kind": "struct";
1419
1513
  "fields": [
1420
- {
1421
- "name": "bonds";
1422
- "docs": [
1423
- "List of all registered bonds"
1424
- ];
1425
- "type": {
1426
- "vec": "pubkey";
1427
- };
1428
- },
1429
1514
  {
1430
1515
  "name": "authority";
1431
1516
  "docs": [
@@ -1449,7 +1534,7 @@ type Jbond = {
1449
1534
  "kind": "struct";
1450
1535
  "fields": [
1451
1536
  {
1452
- "name": "bond";
1537
+ "name": "state";
1453
1538
  "type": "pubkey";
1454
1539
  },
1455
1540
  {
@@ -1470,26 +1555,10 @@ type Jbond = {
1470
1555
  "option": "pubkey";
1471
1556
  };
1472
1557
  },
1473
- {
1474
- "name": "totalCompensationAmount";
1475
- "type": "u64";
1476
- },
1477
- {
1478
- "name": "lastCompensationAmount";
1479
- "type": "u64";
1480
- },
1481
- {
1482
- "name": "lastCompensationEpoch";
1483
- "type": "u64";
1484
- },
1485
1558
  {
1486
1559
  "name": "createdAt";
1487
1560
  "type": "i64";
1488
1561
  },
1489
- {
1490
- "name": "isActive";
1491
- "type": "bool";
1492
- },
1493
1562
  {
1494
1563
  "name": "bump";
1495
1564
  "type": "u8";
@@ -1794,6 +1863,14 @@ declare class JBondClient {
1794
1863
  bondType: BondType;
1795
1864
  name: string;
1796
1865
  }): Promise<string | undefined>;
1866
+ bondEnable(props: {
1867
+ bondType: BondType;
1868
+ name: string;
1869
+ }): Promise<string | undefined>;
1870
+ bondDisable(props: {
1871
+ bondType: BondType;
1872
+ name: string;
1873
+ }): Promise<string | undefined>;
1797
1874
  buildBondGlobalStateInitializeIx(props: GlobalInitializeProps): Promise<TransactionInstruction>;
1798
1875
  /**
1799
1876
  * Build configure instruction
@@ -1818,6 +1895,14 @@ declare class JBondClient {
1818
1895
  name: string;
1819
1896
  duration_secs: number;
1820
1897
  }): Promise<TransactionInstruction>;
1898
+ buildBondEnableIx(props: {
1899
+ bondType: BondType;
1900
+ name: string;
1901
+ }): Promise<TransactionInstruction>;
1902
+ buildBondDisableIx(props: {
1903
+ bondType: BondType;
1904
+ name: string;
1905
+ }): Promise<TransactionInstruction>;
1821
1906
  /**
1822
1907
  * Fetch global state or throw if not found
1823
1908
  */
@@ -1852,6 +1937,8 @@ declare class JBondClient {
1852
1937
  * @return Balance in lamports
1853
1938
  */
1854
1939
  getValidatorBondBalance(bondType: BondType, bondName: string, vote: PublicKeyInitData): Promise<number>;
1940
+ getBondStateTotalCollected(bondType: BondType, bondName: string, votes: PublicKeyInitData[]): Promise<number>;
1941
+ private getBondStateStats;
1855
1942
  /**
1856
1943
  * Load stake pool account and cache it if not already cached
1857
1944
  * @private
package/dist/index.d.ts CHANGED
@@ -31,7 +31,7 @@ declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
31
31
  * IDL can be found at `target/idl/jbond.json`.
32
32
  */
33
33
  type Jbond = {
34
- "address": "DBuUGWbLz8CkAMQiagMfrQzj8SSg1rHQJWrTSc97HWfR";
34
+ "address": "93BH9J99hQS3YinydR6SVjHuAEECoA9kR1BHwnXeDzQe";
35
35
  "metadata": {
36
36
  "name": "jbond";
37
37
  "version": "0.2.1";
@@ -187,6 +187,68 @@ type Jbond = {
187
187
  }
188
188
  ];
189
189
  },
190
+ {
191
+ "name": "bondDisable";
192
+ "docs": [
193
+ "Disables a validator's bond, preventing it from participating further."
194
+ ];
195
+ "discriminator": [
196
+ 159,
197
+ 156,
198
+ 97,
199
+ 253,
200
+ 70,
201
+ 122,
202
+ 117,
203
+ 129
204
+ ];
205
+ "accounts": [
206
+ {
207
+ "name": "bondState";
208
+ "writable": true;
209
+ },
210
+ {
211
+ "name": "authority";
212
+ "writable": true;
213
+ "signer": true;
214
+ "relations": [
215
+ "bondState"
216
+ ];
217
+ }
218
+ ];
219
+ "args": [];
220
+ },
221
+ {
222
+ "name": "bondEnable";
223
+ "docs": [
224
+ "Enables a previously disabled validator's bond."
225
+ ];
226
+ "discriminator": [
227
+ 133,
228
+ 48,
229
+ 84,
230
+ 9,
231
+ 117,
232
+ 131,
233
+ 164,
234
+ 128
235
+ ];
236
+ "accounts": [
237
+ {
238
+ "name": "bondState";
239
+ "writable": true;
240
+ },
241
+ {
242
+ "name": "authority";
243
+ "writable": true;
244
+ "signer": true;
245
+ "relations": [
246
+ "bondState"
247
+ ];
248
+ }
249
+ ];
250
+ "args": [];
251
+ },
190
252
  {
191
253
  "name": "bondInitialize";
192
254
  "docs": [
@@ -1094,6 +1156,16 @@ type Jbond = {
1094
1156
  "code": 6021;
1095
1157
  "name": "invalidArgument";
1096
1158
  "msg": "Invalid argument provided";
1159
+ },
1160
+ {
1161
+ "code": 6022;
1162
+ "name": "bondNotDisabled";
1163
+ "msg": "Bond is not disabled";
1164
+ },
1165
+ {
1166
+ "code": 6023;
1167
+ "name": "bondNotEnabled";
1168
+ "msg": "Bond is not enabled";
1097
1169
  }
1098
1170
  ];
1099
1171
  "types": [
@@ -1272,6 +1344,14 @@ type Jbond = {
1272
1344
  ];
1273
1345
  "type": "i64";
1274
1346
  },
1347
+ {
1348
+ "name": "status";
1349
+ "type": {
1350
+ "defined": {
1351
+ "name": "bondStatus";
1352
+ };
1353
+ };
1354
+ },
1275
1355
  {
1276
1356
  "name": "bump";
1277
1357
  "docs": [
@@ -1282,6 +1362,20 @@ type Jbond = {
1282
1362
  ];
1283
1363
  };
1284
1364
  },
1365
+ {
1366
+ "name": "bondStatus";
1367
+ "type": {
1368
+ "kind": "enum";
1369
+ "variants": [
1370
+ {
1371
+ "name": "active";
1372
+ },
1373
+ {
1374
+ "name": "disabled";
1375
+ }
1376
+ ];
1377
+ };
1378
+ },
1285
1379
  {
1286
1380
  "name": "bondType";
1287
1381
  "docs": [
@@ -1417,15 +1511,6 @@ type Jbond = {
1417
1511
  "type": {
1418
1512
  "kind": "struct";
1419
1513
  "fields": [
1420
- {
1421
- "name": "bonds";
1422
- "docs": [
1423
- "List of all registered bonds"
1424
- ];
1425
- "type": {
1426
- "vec": "pubkey";
1427
- };
1428
- },
1429
1514
  {
1430
1515
  "name": "authority";
1431
1516
  "docs": [
@@ -1449,7 +1534,7 @@ type Jbond = {
1449
1534
  "kind": "struct";
1450
1535
  "fields": [
1451
1536
  {
1452
- "name": "bond";
1537
+ "name": "state";
1453
1538
  "type": "pubkey";
1454
1539
  },
1455
1540
  {
@@ -1470,26 +1555,10 @@ type Jbond = {
1470
1555
  "option": "pubkey";
1471
1556
  };
1472
1557
  },
1473
- {
1474
- "name": "totalCompensationAmount";
1475
- "type": "u64";
1476
- },
1477
- {
1478
- "name": "lastCompensationAmount";
1479
- "type": "u64";
1480
- },
1481
- {
1482
- "name": "lastCompensationEpoch";
1483
- "type": "u64";
1484
- },
1485
1558
  {
1486
1559
  "name": "createdAt";
1487
1560
  "type": "i64";
1488
1561
  },
1489
- {
1490
- "name": "isActive";
1491
- "type": "bool";
1492
- },
1493
1562
  {
1494
1563
  "name": "bump";
1495
1564
  "type": "u8";
@@ -1794,6 +1863,14 @@ declare class JBondClient {
1794
1863
  bondType: BondType;
1795
1864
  name: string;
1796
1865
  }): Promise<string | undefined>;
1866
+ bondEnable(props: {
1867
+ bondType: BondType;
1868
+ name: string;
1869
+ }): Promise<string | undefined>;
1870
+ bondDisable(props: {
1871
+ bondType: BondType;
1872
+ name: string;
1873
+ }): Promise<string | undefined>;
1797
1874
  buildBondGlobalStateInitializeIx(props: GlobalInitializeProps): Promise<TransactionInstruction>;
1798
1875
  /**
1799
1876
  * Build configure instruction
@@ -1818,6 +1895,14 @@ declare class JBondClient {
1818
1895
  name: string;
1819
1896
  duration_secs: number;
1820
1897
  }): Promise<TransactionInstruction>;
1898
+ buildBondEnableIx(props: {
1899
+ bondType: BondType;
1900
+ name: string;
1901
+ }): Promise<TransactionInstruction>;
1902
+ buildBondDisableIx(props: {
1903
+ bondType: BondType;
1904
+ name: string;
1905
+ }): Promise<TransactionInstruction>;
1821
1906
  /**
1822
1907
  * Fetch global state or throw if not found
1823
1908
  */
@@ -1852,6 +1937,8 @@ declare class JBondClient {
1852
1937
  * @return Balance in lamports
1853
1938
  */
1854
1939
  getValidatorBondBalance(bondType: BondType, bondName: string, vote: PublicKeyInitData): Promise<number>;
1940
+ getBondStateTotalCollected(bondType: BondType, bondName: string, votes: PublicKeyInitData[]): Promise<number>;
1941
+ private getBondStateStats;
1855
1942
  /**
1856
1943
  * Load stake pool account and cache it if not already cached
1857
1944
  * @private