@jpool/bond-sdk 0.11.0-next.15 → 0.11.0-next.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +76 -8
- package/dist/index.d.ts +76 -8
- package/dist/index.js +81 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +81 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4554,7 +4554,7 @@ var VALIDATOR_BOND_SEED = "validator_bond";
|
|
|
4554
4554
|
var STANDARD_BOND_SEED = "standard";
|
|
4555
4555
|
var CROWDFUNDING_BOND_SEED = "crowdfunding";
|
|
4556
4556
|
var ENV_PROGRAM_ID = {
|
|
4557
|
-
//
|
|
4557
|
+
// [JBondClientEnv.DEV]: new PublicKey('...'),
|
|
4558
4558
|
};
|
|
4559
4559
|
|
|
4560
4560
|
// src/types/index.ts
|
|
@@ -4988,8 +4988,8 @@ var jbond_default = {
|
|
|
4988
4988
|
name: "bond_lock_funds",
|
|
4989
4989
|
docs: [
|
|
4990
4990
|
"Locks funds for both the current and upcoming epoch.",
|
|
4991
|
-
"Moves collateral from available to locked state, making it unavailable for withdrawal for
|
|
4992
|
-
"# Errors",
|
|
4991
|
+
"Moves collateral from available to locked state, making it unavailable for withdrawal for",
|
|
4992
|
+
"the current and next epoch. # Errors",
|
|
4993
4993
|
"Fails if the validator is not active, or if there are insufficient available funds."
|
|
4994
4994
|
],
|
|
4995
4995
|
discriminator: [
|
|
@@ -5009,7 +5009,39 @@ var jbond_default = {
|
|
|
5009
5009
|
},
|
|
5010
5010
|
{
|
|
5011
5011
|
name: "validator_bond",
|
|
5012
|
-
writable: true
|
|
5012
|
+
writable: true,
|
|
5013
|
+
pda: {
|
|
5014
|
+
seeds: [
|
|
5015
|
+
{
|
|
5016
|
+
kind: "const",
|
|
5017
|
+
value: [
|
|
5018
|
+
118,
|
|
5019
|
+
97,
|
|
5020
|
+
108,
|
|
5021
|
+
105,
|
|
5022
|
+
100,
|
|
5023
|
+
97,
|
|
5024
|
+
116,
|
|
5025
|
+
111,
|
|
5026
|
+
114,
|
|
5027
|
+
95,
|
|
5028
|
+
98,
|
|
5029
|
+
111,
|
|
5030
|
+
110,
|
|
5031
|
+
100
|
|
5032
|
+
]
|
|
5033
|
+
},
|
|
5034
|
+
{
|
|
5035
|
+
kind: "account",
|
|
5036
|
+
path: "bond_state"
|
|
5037
|
+
},
|
|
5038
|
+
{
|
|
5039
|
+
kind: "account",
|
|
5040
|
+
path: "validator_bond.vote_account",
|
|
5041
|
+
account: "ValidatorBond"
|
|
5042
|
+
}
|
|
5043
|
+
]
|
|
5044
|
+
}
|
|
5013
5045
|
},
|
|
5014
5046
|
{
|
|
5015
5047
|
name: "bond_token_account",
|
|
@@ -5160,9 +5192,45 @@ var jbond_default = {
|
|
|
5160
5192
|
],
|
|
5161
5193
|
accounts: [
|
|
5162
5194
|
{
|
|
5163
|
-
name: "
|
|
5195
|
+
name: "bond_state",
|
|
5164
5196
|
writable: true
|
|
5165
5197
|
},
|
|
5198
|
+
{
|
|
5199
|
+
name: "validator_bond",
|
|
5200
|
+
writable: true,
|
|
5201
|
+
pda: {
|
|
5202
|
+
seeds: [
|
|
5203
|
+
{
|
|
5204
|
+
kind: "const",
|
|
5205
|
+
value: [
|
|
5206
|
+
118,
|
|
5207
|
+
97,
|
|
5208
|
+
108,
|
|
5209
|
+
105,
|
|
5210
|
+
100,
|
|
5211
|
+
97,
|
|
5212
|
+
116,
|
|
5213
|
+
111,
|
|
5214
|
+
114,
|
|
5215
|
+
95,
|
|
5216
|
+
98,
|
|
5217
|
+
111,
|
|
5218
|
+
110,
|
|
5219
|
+
100
|
|
5220
|
+
]
|
|
5221
|
+
},
|
|
5222
|
+
{
|
|
5223
|
+
kind: "account",
|
|
5224
|
+
path: "bond_state"
|
|
5225
|
+
},
|
|
5226
|
+
{
|
|
5227
|
+
kind: "account",
|
|
5228
|
+
path: "validator_bond.vote_account",
|
|
5229
|
+
account: "ValidatorBond"
|
|
5230
|
+
}
|
|
5231
|
+
]
|
|
5232
|
+
}
|
|
5233
|
+
},
|
|
5166
5234
|
{
|
|
5167
5235
|
name: "payer",
|
|
5168
5236
|
writable: true,
|
|
@@ -5362,7 +5430,7 @@ var jbond_default = {
|
|
|
5362
5430
|
"",
|
|
5363
5431
|
"This function should be called at epoch boundaries to update the bond's",
|
|
5364
5432
|
"`last_update_epoch` and move the `next_epoch_locked` amount into",
|
|
5365
|
-
"`
|
|
5433
|
+
"`locked`. It ensures that the update only occurs once per epoch.",
|
|
5366
5434
|
"",
|
|
5367
5435
|
"# Errors",
|
|
5368
5436
|
"Returns [`BondError::InvalidEpoch`] if called more than once in the same epoch,",
|
|
@@ -6390,16 +6458,16 @@ var jbond_default = {
|
|
|
6390
6458
|
type: "u8"
|
|
6391
6459
|
},
|
|
6392
6460
|
{
|
|
6393
|
-
name: "
|
|
6461
|
+
name: "locked",
|
|
6394
6462
|
docs: [
|
|
6395
|
-
"Amount of collateral locked
|
|
6463
|
+
"Amount of collateral currently locked"
|
|
6396
6464
|
],
|
|
6397
6465
|
type: "u64"
|
|
6398
6466
|
},
|
|
6399
6467
|
{
|
|
6400
|
-
name: "
|
|
6468
|
+
name: "next_epoch_locked",
|
|
6401
6469
|
docs: [
|
|
6402
|
-
"Amount of collateral locked for the
|
|
6470
|
+
"Amount of collateral locked for the next epoch"
|
|
6403
6471
|
],
|
|
6404
6472
|
type: "u64"
|
|
6405
6473
|
},
|
|
@@ -7076,8 +7144,10 @@ var JBondClient = class _JBondClient {
|
|
|
7076
7144
|
*/
|
|
7077
7145
|
async getReleaseFundsIx(props) {
|
|
7078
7146
|
const { bondType, name, voteAccount, amount, withdrawAuthority } = props;
|
|
7147
|
+
const [bondState] = this.pda.bondState(bondType, name);
|
|
7079
7148
|
const [validatorBond] = this.pda.validatorBond(bondType, name, voteAccount);
|
|
7080
7149
|
const accounts = {
|
|
7150
|
+
bondState,
|
|
7081
7151
|
validatorBond,
|
|
7082
7152
|
payer: withdrawAuthority
|
|
7083
7153
|
};
|
|
@@ -7088,7 +7158,7 @@ var JBondClient = class _JBondClient {
|
|
|
7088
7158
|
*/
|
|
7089
7159
|
async getAvailableCollateral(bondType, bondName, voteAccount) {
|
|
7090
7160
|
const validatorBond = await this.getValidatorBond(bondType, bondName, voteAccount);
|
|
7091
|
-
return await this.getValidatorBondBalance(bondType, bondName, voteAccount) - validatorBond.
|
|
7161
|
+
return await this.getValidatorBondBalance(bondType, bondName, voteAccount) - validatorBond.locked.toNumber();
|
|
7092
7162
|
}
|
|
7093
7163
|
/**
|
|
7094
7164
|
* Get all bond states with total collected collateral
|