@jpool/bond-sdk 0.11.0-next.17 → 0.11.0-next.19
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 +42 -1
- package/dist/index.d.ts +42 -1
- package/dist/index.js +51 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +51 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4546,15 +4546,14 @@ var require_bn = __commonJS({
|
|
|
4546
4546
|
|
|
4547
4547
|
// src/client.ts
|
|
4548
4548
|
var import_bn = __toESM(require_bn());
|
|
4549
|
-
|
|
4550
|
-
// src/constants.ts
|
|
4551
4549
|
var GLOBAL_STATE_SEED = "global_state";
|
|
4552
4550
|
var BOND_STATE_SEED = "bond_state";
|
|
4553
4551
|
var VALIDATOR_BOND_SEED = "validator_bond";
|
|
4554
4552
|
var STANDARD_BOND_SEED = "standard";
|
|
4555
4553
|
var CROWDFUNDING_BOND_SEED = "crowdfunding";
|
|
4556
4554
|
var ENV_PROGRAM_ID = {
|
|
4557
|
-
|
|
4555
|
+
["dev" /* DEV */]: new PublicKey("Fo17edWRJewZNTRibgx9iTfjywCW6dzS81VwBLmPFVq1"),
|
|
4556
|
+
["prod" /* PROD */]: new PublicKey("BondQ7KqZreTcW2UbeTNDcLCJQ3aXAtLn2Fm6ftaJDU")
|
|
4558
4557
|
};
|
|
4559
4558
|
|
|
4560
4559
|
// src/types/index.ts
|
|
@@ -5244,6 +5243,37 @@ var jbond_default = {
|
|
|
5244
5243
|
}
|
|
5245
5244
|
]
|
|
5246
5245
|
},
|
|
5246
|
+
{
|
|
5247
|
+
name: "bond_remove",
|
|
5248
|
+
docs: [
|
|
5249
|
+
"Removes bond state"
|
|
5250
|
+
],
|
|
5251
|
+
discriminator: [
|
|
5252
|
+
121,
|
|
5253
|
+
112,
|
|
5254
|
+
246,
|
|
5255
|
+
177,
|
|
5256
|
+
181,
|
|
5257
|
+
8,
|
|
5258
|
+
18,
|
|
5259
|
+
220
|
|
5260
|
+
],
|
|
5261
|
+
accounts: [
|
|
5262
|
+
{
|
|
5263
|
+
name: "bond_state",
|
|
5264
|
+
writable: true
|
|
5265
|
+
},
|
|
5266
|
+
{
|
|
5267
|
+
name: "authority",
|
|
5268
|
+
writable: true,
|
|
5269
|
+
signer: true,
|
|
5270
|
+
relations: [
|
|
5271
|
+
"bond_state"
|
|
5272
|
+
]
|
|
5273
|
+
}
|
|
5274
|
+
],
|
|
5275
|
+
args: []
|
|
5276
|
+
},
|
|
5247
5277
|
{
|
|
5248
5278
|
name: "bond_set_withdraw_authority",
|
|
5249
5279
|
docs: [
|
|
@@ -6682,7 +6712,11 @@ var JBondClient = class _JBondClient {
|
|
|
6682
6712
|
* Set the environment.
|
|
6683
6713
|
*/
|
|
6684
6714
|
env(env) {
|
|
6685
|
-
|
|
6715
|
+
const envProgramId = ENV_PROGRAM_ID[env];
|
|
6716
|
+
if (!envProgramId) {
|
|
6717
|
+
throw new Error(`Invalid environment: ${env}`);
|
|
6718
|
+
}
|
|
6719
|
+
return this.configure("programId", envProgramId);
|
|
6686
6720
|
}
|
|
6687
6721
|
/**
|
|
6688
6722
|
* Configure a specific option.
|
|
@@ -6799,6 +6833,10 @@ var JBondClient = class _JBondClient {
|
|
|
6799
6833
|
const ix = await this.getBondSessionFinishIx(props);
|
|
6800
6834
|
return this.provider.sendAndConfirm?.(new Transaction().add(ix));
|
|
6801
6835
|
}
|
|
6836
|
+
async bondRemove(props) {
|
|
6837
|
+
const ix = await this.getBondRemoveIx(props);
|
|
6838
|
+
return this.provider.sendAndConfirm?.(new Transaction().add(ix));
|
|
6839
|
+
}
|
|
6802
6840
|
/**
|
|
6803
6841
|
* Build global state initialize instruction
|
|
6804
6842
|
*/
|
|
@@ -7100,6 +7138,15 @@ var JBondClient = class _JBondClient {
|
|
|
7100
7138
|
const [validatorBond, _] = this.pda.validatorBond(bondType, bondName, voteAccount);
|
|
7101
7139
|
return this.program.methods.bondUpdate().accountsPartial({ validatorBond, payer }).instruction();
|
|
7102
7140
|
}
|
|
7141
|
+
/**
|
|
7142
|
+
* Build bond remove instruction
|
|
7143
|
+
*/
|
|
7144
|
+
async getBondRemoveIx(props) {
|
|
7145
|
+
const { bondType, name } = props;
|
|
7146
|
+
const [bondState] = this.pda.bondState(bondType, name);
|
|
7147
|
+
const authority = props.authority ?? this.provider.wallet?.publicKey;
|
|
7148
|
+
return this.program.methods.bondRemove().accountsPartial({ bondState, authority }).instruction();
|
|
7149
|
+
}
|
|
7103
7150
|
/**
|
|
7104
7151
|
* Build test set last update epoch instruction
|
|
7105
7152
|
* NOTE!: This instruction is for testing purposes only.
|