@jpool/bond-sdk 0.11.0-next.3 → 0.11.0-next.6

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
@@ -260,6 +260,50 @@ type Jbond = {
260
260
  }
261
261
  ];
262
262
  },
263
+ {
264
+ "name": "bondLockFunds";
265
+ "docs": [
266
+ "Locks funds for the upcoming epoch.",
267
+ "Moves collateral from available to locked state which cannot be withdrawn.",
268
+ "# Errors",
269
+ "Fails if the validator is not active, or if there are insufficient available funds."
270
+ ];
271
+ "discriminator": [
272
+ 117,
273
+ 166,
274
+ 195,
275
+ 99,
276
+ 103,
277
+ 45,
278
+ 195,
279
+ 2
280
+ ];
281
+ "accounts": [
282
+ {
283
+ "name": "bondState";
284
+ "writable": true;
285
+ },
286
+ {
287
+ "name": "validatorBond";
288
+ "writable": true;
289
+ },
290
+ {
291
+ "name": "bondTokenAccount";
292
+ "optional": true;
293
+ },
294
+ {
295
+ "name": "payer";
296
+ "writable": true;
297
+ "signer": true;
298
+ }
299
+ ];
300
+ "args": [
301
+ {
302
+ "name": "amount";
303
+ "type": "u64";
304
+ }
305
+ ];
306
+ },
263
307
  {
264
308
  "name": "bondRegister";
265
309
  "docs": [
@@ -372,6 +416,42 @@ type Jbond = {
372
416
  }
373
417
  ];
374
418
  },
419
+ {
420
+ "name": "bondReleaseFunds";
421
+ "docs": [
422
+ "Releases locked funds after an epoch ends.",
423
+ "Moves collateral from locked back to available state, allowing withdrawals.",
424
+ "# Errors",
425
+ "Fails if the validator is not active, or if there are insufficient locked funds."
426
+ ];
427
+ "discriminator": [
428
+ 184,
429
+ 224,
430
+ 14,
431
+ 24,
432
+ 76,
433
+ 14,
434
+ 226,
435
+ 190
436
+ ];
437
+ "accounts": [
438
+ {
439
+ "name": "validatorBond";
440
+ "writable": true;
441
+ },
442
+ {
443
+ "name": "payer";
444
+ "writable": true;
445
+ "signer": true;
446
+ }
447
+ ];
448
+ "args": [
449
+ {
450
+ "name": "amount";
451
+ "type": "u64";
452
+ }
453
+ ];
454
+ },
375
455
  {
376
456
  "name": "bondSetWithdrawAuthority";
377
457
  "docs": [
@@ -551,6 +631,31 @@ type Jbond = {
551
631
  }
552
632
  ];
553
633
  },
634
+ {
635
+ "name": "bondUpdate";
636
+ "discriminator": [
637
+ 237,
638
+ 102,
639
+ 183,
640
+ 192,
641
+ 94,
642
+ 83,
643
+ 52,
644
+ 82
645
+ ];
646
+ "accounts": [
647
+ {
648
+ "name": "validatorBond";
649
+ "writable": true;
650
+ },
651
+ {
652
+ "name": "payer";
653
+ "writable": true;
654
+ "signer": true;
655
+ }
656
+ ];
657
+ "args": [];
658
+ },
554
659
  {
555
660
  "name": "bondWithdraw";
556
661
  "docs": [
@@ -1151,6 +1256,11 @@ type Jbond = {
1151
1256
  "code": 6023;
1152
1257
  "name": "bondNotEnabled";
1153
1258
  "msg": "Bond is not enabled";
1259
+ },
1260
+ {
1261
+ "code": 6024;
1262
+ "name": "invalidEpoch";
1263
+ "msg": "Invalid epoch for this operation";
1154
1264
  }
1155
1265
  ];
1156
1266
  "types": [
@@ -1582,6 +1692,27 @@ type Jbond = {
1582
1692
  "Bump for the PDA"
1583
1693
  ];
1584
1694
  "type": "u8";
1695
+ },
1696
+ {
1697
+ "name": "nextEpochLocked";
1698
+ "docs": [
1699
+ "Amount of collateral locked for the next epoch"
1700
+ ];
1701
+ "type": "u64";
1702
+ },
1703
+ {
1704
+ "name": "currentEpochLocked";
1705
+ "docs": [
1706
+ "Amount of collateral locked for the current epoch"
1707
+ ];
1708
+ "type": "u64";
1709
+ },
1710
+ {
1711
+ "name": "lastUpdateEpoch";
1712
+ "docs": [
1713
+ "The last epoch when the bond was updated"
1714
+ ];
1715
+ "type": "u64";
1585
1716
  }
1586
1717
  ];
1587
1718
  };
@@ -1686,6 +1817,19 @@ type ClaimProps = {
1686
1817
  reserve?: PublicKey;
1687
1818
  authority?: PublicKey;
1688
1819
  };
1820
+ type BondLockFunds = {
1821
+ bondType: BondType;
1822
+ name: string;
1823
+ amount: number;
1824
+ voteAccount: PublicKey;
1825
+ collateralType?: CollateralType;
1826
+ };
1827
+ type BondReleaseFunds = {
1828
+ bondType: BondType;
1829
+ name: string;
1830
+ amount: number;
1831
+ voteAccount: PublicKey;
1832
+ };
1689
1833
  type ClaimAllProps = {
1690
1834
  bondType: BondType;
1691
1835
  name: string;
@@ -1936,6 +2080,14 @@ declare class JBondClient {
1936
2080
  * Build start crowdfunding session instruction
1937
2081
  */
1938
2082
  getBondSessionStartIx(props: BondStartProps): Promise<TransactionInstruction>;
2083
+ /**
2084
+ * Build lock funds instruction
2085
+ */
2086
+ getLockFundsIx(props: BondLockFunds): Promise<TransactionInstruction>;
2087
+ /**
2088
+ * Build release funds instruction
2089
+ */
2090
+ getReleaseFundsIx(props: BondReleaseFunds): Promise<TransactionInstruction>;
1939
2091
  /**
1940
2092
  * Get all bond states with total collected collateral
1941
2093
  */
@@ -2063,6 +2215,9 @@ declare class JBondClient {
2063
2215
  withdrawalAuthority: PublicKey | null;
2064
2216
  createdAt: bn_js;
2065
2217
  bump: number;
2218
+ nextEpochLocked: bn_js;
2219
+ currentEpochLocked: bn_js;
2220
+ lastUpdateEpoch: bn_js;
2066
2221
  publicKey: PublicKey;
2067
2222
  }>;
2068
2223
  /**
@@ -2090,7 +2245,7 @@ declare class JBondClient {
2090
2245
  /**
2091
2246
  * Get all validator bonds for a given bond state
2092
2247
  */
2093
- private getBondValidatorStates;
2248
+ private getValidatorBondsForState;
2094
2249
  /**
2095
2250
  * Get session status for bond state
2096
2251
  */
@@ -2107,4 +2262,4 @@ declare const CROWDFUNDING_BOND_SEED = "crowdfunding";
2107
2262
  */
2108
2263
  declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
2109
2264
 
2110
- export { BOND_STATE_SEED, type BondConfigureProps, type BondFinishProps, type BondInitializeProps, 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 };
2265
+ 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 };
package/dist/index.d.ts CHANGED
@@ -260,6 +260,50 @@ type Jbond = {
260
260
  }
261
261
  ];
262
262
  },
263
+ {
264
+ "name": "bondLockFunds";
265
+ "docs": [
266
+ "Locks funds for the upcoming epoch.",
267
+ "Moves collateral from available to locked state which cannot be withdrawn.",
268
+ "# Errors",
269
+ "Fails if the validator is not active, or if there are insufficient available funds."
270
+ ];
271
+ "discriminator": [
272
+ 117,
273
+ 166,
274
+ 195,
275
+ 99,
276
+ 103,
277
+ 45,
278
+ 195,
279
+ 2
280
+ ];
281
+ "accounts": [
282
+ {
283
+ "name": "bondState";
284
+ "writable": true;
285
+ },
286
+ {
287
+ "name": "validatorBond";
288
+ "writable": true;
289
+ },
290
+ {
291
+ "name": "bondTokenAccount";
292
+ "optional": true;
293
+ },
294
+ {
295
+ "name": "payer";
296
+ "writable": true;
297
+ "signer": true;
298
+ }
299
+ ];
300
+ "args": [
301
+ {
302
+ "name": "amount";
303
+ "type": "u64";
304
+ }
305
+ ];
306
+ },
263
307
  {
264
308
  "name": "bondRegister";
265
309
  "docs": [
@@ -372,6 +416,42 @@ type Jbond = {
372
416
  }
373
417
  ];
374
418
  },
419
+ {
420
+ "name": "bondReleaseFunds";
421
+ "docs": [
422
+ "Releases locked funds after an epoch ends.",
423
+ "Moves collateral from locked back to available state, allowing withdrawals.",
424
+ "# Errors",
425
+ "Fails if the validator is not active, or if there are insufficient locked funds."
426
+ ];
427
+ "discriminator": [
428
+ 184,
429
+ 224,
430
+ 14,
431
+ 24,
432
+ 76,
433
+ 14,
434
+ 226,
435
+ 190
436
+ ];
437
+ "accounts": [
438
+ {
439
+ "name": "validatorBond";
440
+ "writable": true;
441
+ },
442
+ {
443
+ "name": "payer";
444
+ "writable": true;
445
+ "signer": true;
446
+ }
447
+ ];
448
+ "args": [
449
+ {
450
+ "name": "amount";
451
+ "type": "u64";
452
+ }
453
+ ];
454
+ },
375
455
  {
376
456
  "name": "bondSetWithdrawAuthority";
377
457
  "docs": [
@@ -551,6 +631,31 @@ type Jbond = {
551
631
  }
552
632
  ];
553
633
  },
634
+ {
635
+ "name": "bondUpdate";
636
+ "discriminator": [
637
+ 237,
638
+ 102,
639
+ 183,
640
+ 192,
641
+ 94,
642
+ 83,
643
+ 52,
644
+ 82
645
+ ];
646
+ "accounts": [
647
+ {
648
+ "name": "validatorBond";
649
+ "writable": true;
650
+ },
651
+ {
652
+ "name": "payer";
653
+ "writable": true;
654
+ "signer": true;
655
+ }
656
+ ];
657
+ "args": [];
658
+ },
554
659
  {
555
660
  "name": "bondWithdraw";
556
661
  "docs": [
@@ -1151,6 +1256,11 @@ type Jbond = {
1151
1256
  "code": 6023;
1152
1257
  "name": "bondNotEnabled";
1153
1258
  "msg": "Bond is not enabled";
1259
+ },
1260
+ {
1261
+ "code": 6024;
1262
+ "name": "invalidEpoch";
1263
+ "msg": "Invalid epoch for this operation";
1154
1264
  }
1155
1265
  ];
1156
1266
  "types": [
@@ -1582,6 +1692,27 @@ type Jbond = {
1582
1692
  "Bump for the PDA"
1583
1693
  ];
1584
1694
  "type": "u8";
1695
+ },
1696
+ {
1697
+ "name": "nextEpochLocked";
1698
+ "docs": [
1699
+ "Amount of collateral locked for the next epoch"
1700
+ ];
1701
+ "type": "u64";
1702
+ },
1703
+ {
1704
+ "name": "currentEpochLocked";
1705
+ "docs": [
1706
+ "Amount of collateral locked for the current epoch"
1707
+ ];
1708
+ "type": "u64";
1709
+ },
1710
+ {
1711
+ "name": "lastUpdateEpoch";
1712
+ "docs": [
1713
+ "The last epoch when the bond was updated"
1714
+ ];
1715
+ "type": "u64";
1585
1716
  }
1586
1717
  ];
1587
1718
  };
@@ -1686,6 +1817,19 @@ type ClaimProps = {
1686
1817
  reserve?: PublicKey;
1687
1818
  authority?: PublicKey;
1688
1819
  };
1820
+ type BondLockFunds = {
1821
+ bondType: BondType;
1822
+ name: string;
1823
+ amount: number;
1824
+ voteAccount: PublicKey;
1825
+ collateralType?: CollateralType;
1826
+ };
1827
+ type BondReleaseFunds = {
1828
+ bondType: BondType;
1829
+ name: string;
1830
+ amount: number;
1831
+ voteAccount: PublicKey;
1832
+ };
1689
1833
  type ClaimAllProps = {
1690
1834
  bondType: BondType;
1691
1835
  name: string;
@@ -1936,6 +2080,14 @@ declare class JBondClient {
1936
2080
  * Build start crowdfunding session instruction
1937
2081
  */
1938
2082
  getBondSessionStartIx(props: BondStartProps): Promise<TransactionInstruction>;
2083
+ /**
2084
+ * Build lock funds instruction
2085
+ */
2086
+ getLockFundsIx(props: BondLockFunds): Promise<TransactionInstruction>;
2087
+ /**
2088
+ * Build release funds instruction
2089
+ */
2090
+ getReleaseFundsIx(props: BondReleaseFunds): Promise<TransactionInstruction>;
1939
2091
  /**
1940
2092
  * Get all bond states with total collected collateral
1941
2093
  */
@@ -2063,6 +2215,9 @@ declare class JBondClient {
2063
2215
  withdrawalAuthority: PublicKey | null;
2064
2216
  createdAt: bn_js;
2065
2217
  bump: number;
2218
+ nextEpochLocked: bn_js;
2219
+ currentEpochLocked: bn_js;
2220
+ lastUpdateEpoch: bn_js;
2066
2221
  publicKey: PublicKey;
2067
2222
  }>;
2068
2223
  /**
@@ -2090,7 +2245,7 @@ declare class JBondClient {
2090
2245
  /**
2091
2246
  * Get all validator bonds for a given bond state
2092
2247
  */
2093
- private getBondValidatorStates;
2248
+ private getValidatorBondsForState;
2094
2249
  /**
2095
2250
  * Get session status for bond state
2096
2251
  */
@@ -2107,4 +2262,4 @@ declare const CROWDFUNDING_BOND_SEED = "crowdfunding";
2107
2262
  */
2108
2263
  declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
2109
2264
 
2110
- export { BOND_STATE_SEED, type BondConfigureProps, type BondFinishProps, type BondInitializeProps, 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 };
2265
+ 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 };