@jpool/bond-sdk 0.9.0-next.11 → 0.9.0-next.12
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 +112 -27
- package/dist/index.d.ts +112 -27
- package/dist/index.js +118 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +118 -27
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4803,7 +4803,7 @@ var HistoryManager = class {
|
|
|
4803
4803
|
|
|
4804
4804
|
// src/idl/jbond.json
|
|
4805
4805
|
var jbond_default = {
|
|
4806
|
-
address: "
|
|
4806
|
+
address: "93BH9J99hQS3YinydR6SVjHuAEECoA9kR1BHwnXeDzQe",
|
|
4807
4807
|
metadata: {
|
|
4808
4808
|
name: "jbond",
|
|
4809
4809
|
version: "0.2.1",
|
|
@@ -4959,6 +4959,68 @@ var jbond_default = {
|
|
|
4959
4959
|
}
|
|
4960
4960
|
]
|
|
4961
4961
|
},
|
|
4962
|
+
{
|
|
4963
|
+
name: "bond_disable",
|
|
4964
|
+
docs: [
|
|
4965
|
+
"Disables a validator's bond, preventing it from participating further."
|
|
4966
|
+
],
|
|
4967
|
+
discriminator: [
|
|
4968
|
+
159,
|
|
4969
|
+
156,
|
|
4970
|
+
97,
|
|
4971
|
+
253,
|
|
4972
|
+
70,
|
|
4973
|
+
122,
|
|
4974
|
+
117,
|
|
4975
|
+
129
|
|
4976
|
+
],
|
|
4977
|
+
accounts: [
|
|
4978
|
+
{
|
|
4979
|
+
name: "bond_state",
|
|
4980
|
+
writable: true
|
|
4981
|
+
},
|
|
4982
|
+
{
|
|
4983
|
+
name: "authority",
|
|
4984
|
+
writable: true,
|
|
4985
|
+
signer: true,
|
|
4986
|
+
relations: [
|
|
4987
|
+
"bond_state"
|
|
4988
|
+
]
|
|
4989
|
+
}
|
|
4990
|
+
],
|
|
4991
|
+
args: []
|
|
4992
|
+
},
|
|
4993
|
+
{
|
|
4994
|
+
name: "bond_enable",
|
|
4995
|
+
docs: [
|
|
4996
|
+
"Enables a previously disabled validator's bond."
|
|
4997
|
+
],
|
|
4998
|
+
discriminator: [
|
|
4999
|
+
133,
|
|
5000
|
+
48,
|
|
5001
|
+
84,
|
|
5002
|
+
9,
|
|
5003
|
+
117,
|
|
5004
|
+
131,
|
|
5005
|
+
164,
|
|
5006
|
+
128
|
|
5007
|
+
],
|
|
5008
|
+
accounts: [
|
|
5009
|
+
{
|
|
5010
|
+
name: "bond_state",
|
|
5011
|
+
writable: true
|
|
5012
|
+
},
|
|
5013
|
+
{
|
|
5014
|
+
name: "authority",
|
|
5015
|
+
writable: true,
|
|
5016
|
+
signer: true,
|
|
5017
|
+
relations: [
|
|
5018
|
+
"bond_state"
|
|
5019
|
+
]
|
|
5020
|
+
}
|
|
5021
|
+
],
|
|
5022
|
+
args: []
|
|
5023
|
+
},
|
|
4962
5024
|
{
|
|
4963
5025
|
name: "bond_initialize",
|
|
4964
5026
|
docs: [
|
|
@@ -5866,6 +5928,16 @@ var jbond_default = {
|
|
|
5866
5928
|
code: 6021,
|
|
5867
5929
|
name: "InvalidArgument",
|
|
5868
5930
|
msg: "Invalid argument provided"
|
|
5931
|
+
},
|
|
5932
|
+
{
|
|
5933
|
+
code: 6022,
|
|
5934
|
+
name: "BondNotDisabled",
|
|
5935
|
+
msg: "Bond is not disabled"
|
|
5936
|
+
},
|
|
5937
|
+
{
|
|
5938
|
+
code: 6023,
|
|
5939
|
+
name: "BondNotEnabled",
|
|
5940
|
+
msg: "Bond is not enabled"
|
|
5869
5941
|
}
|
|
5870
5942
|
],
|
|
5871
5943
|
types: [
|
|
@@ -6044,6 +6116,14 @@ var jbond_default = {
|
|
|
6044
6116
|
],
|
|
6045
6117
|
type: "i64"
|
|
6046
6118
|
},
|
|
6119
|
+
{
|
|
6120
|
+
name: "status",
|
|
6121
|
+
type: {
|
|
6122
|
+
defined: {
|
|
6123
|
+
name: "BondStatus"
|
|
6124
|
+
}
|
|
6125
|
+
}
|
|
6126
|
+
},
|
|
6047
6127
|
{
|
|
6048
6128
|
name: "bump",
|
|
6049
6129
|
docs: [
|
|
@@ -6054,6 +6134,20 @@ var jbond_default = {
|
|
|
6054
6134
|
]
|
|
6055
6135
|
}
|
|
6056
6136
|
},
|
|
6137
|
+
{
|
|
6138
|
+
name: "BondStatus",
|
|
6139
|
+
type: {
|
|
6140
|
+
kind: "enum",
|
|
6141
|
+
variants: [
|
|
6142
|
+
{
|
|
6143
|
+
name: "Active"
|
|
6144
|
+
},
|
|
6145
|
+
{
|
|
6146
|
+
name: "Disabled"
|
|
6147
|
+
}
|
|
6148
|
+
]
|
|
6149
|
+
}
|
|
6150
|
+
},
|
|
6057
6151
|
{
|
|
6058
6152
|
name: "BondType",
|
|
6059
6153
|
docs: [
|
|
@@ -6189,15 +6283,6 @@ var jbond_default = {
|
|
|
6189
6283
|
type: {
|
|
6190
6284
|
kind: "struct",
|
|
6191
6285
|
fields: [
|
|
6192
|
-
{
|
|
6193
|
-
name: "bonds",
|
|
6194
|
-
docs: [
|
|
6195
|
-
"List of all registered bonds"
|
|
6196
|
-
],
|
|
6197
|
-
type: {
|
|
6198
|
-
vec: "pubkey"
|
|
6199
|
-
}
|
|
6200
|
-
},
|
|
6201
6286
|
{
|
|
6202
6287
|
name: "authority",
|
|
6203
6288
|
docs: [
|
|
@@ -6221,7 +6306,7 @@ var jbond_default = {
|
|
|
6221
6306
|
kind: "struct",
|
|
6222
6307
|
fields: [
|
|
6223
6308
|
{
|
|
6224
|
-
name: "
|
|
6309
|
+
name: "state",
|
|
6225
6310
|
type: "pubkey"
|
|
6226
6311
|
},
|
|
6227
6312
|
{
|
|
@@ -6242,26 +6327,10 @@ var jbond_default = {
|
|
|
6242
6327
|
option: "pubkey"
|
|
6243
6328
|
}
|
|
6244
6329
|
},
|
|
6245
|
-
{
|
|
6246
|
-
name: "total_compensation_amount",
|
|
6247
|
-
type: "u64"
|
|
6248
|
-
},
|
|
6249
|
-
{
|
|
6250
|
-
name: "last_compensation_amount",
|
|
6251
|
-
type: "u64"
|
|
6252
|
-
},
|
|
6253
|
-
{
|
|
6254
|
-
name: "last_compensation_epoch",
|
|
6255
|
-
type: "u64"
|
|
6256
|
-
},
|
|
6257
6330
|
{
|
|
6258
6331
|
name: "created_at",
|
|
6259
6332
|
type: "i64"
|
|
6260
6333
|
},
|
|
6261
|
-
{
|
|
6262
|
-
name: "is_active",
|
|
6263
|
-
type: "bool"
|
|
6264
|
-
},
|
|
6265
6334
|
{
|
|
6266
6335
|
name: "bump",
|
|
6267
6336
|
type: "u8"
|
|
@@ -6533,6 +6602,14 @@ var JBondClient = class _JBondClient {
|
|
|
6533
6602
|
const ix = await this.buildBondFinishIx(props);
|
|
6534
6603
|
return this.provider.sendAndConfirm?.(new Transaction().add(ix));
|
|
6535
6604
|
}
|
|
6605
|
+
async bondEnable(props) {
|
|
6606
|
+
const ix = await this.buildBondEnableIx(props);
|
|
6607
|
+
return this.provider.sendAndConfirm?.(new Transaction().add(ix));
|
|
6608
|
+
}
|
|
6609
|
+
async bondDisable(props) {
|
|
6610
|
+
const ix = await this.buildBondDisableIx(props);
|
|
6611
|
+
return this.provider.sendAndConfirm?.(new Transaction().add(ix));
|
|
6612
|
+
}
|
|
6536
6613
|
async buildBondGlobalStateInitializeIx(props) {
|
|
6537
6614
|
const [globalState] = this.pda.globalState();
|
|
6538
6615
|
const authority = props.authority ?? this.provider.wallet?.publicKey;
|
|
@@ -6793,6 +6870,20 @@ var JBondClient = class _JBondClient {
|
|
|
6793
6870
|
authority: this.program.provider.wallet?.publicKey
|
|
6794
6871
|
}).instruction();
|
|
6795
6872
|
}
|
|
6873
|
+
async buildBondEnableIx(props) {
|
|
6874
|
+
const [bondState] = this.pda.bondState(props.bondType, props.name);
|
|
6875
|
+
return this.program.methods.bondEnable().accountsPartial({
|
|
6876
|
+
bondState,
|
|
6877
|
+
authority: this.program.provider.wallet?.publicKey
|
|
6878
|
+
}).instruction();
|
|
6879
|
+
}
|
|
6880
|
+
async buildBondDisableIx(props) {
|
|
6881
|
+
const [bondState] = this.pda.bondState(props.bondType, props.name);
|
|
6882
|
+
return this.program.methods.bondDisable().accountsPartial({
|
|
6883
|
+
bondState,
|
|
6884
|
+
authority: this.program.provider.wallet?.publicKey
|
|
6885
|
+
}).instruction();
|
|
6886
|
+
}
|
|
6796
6887
|
/**
|
|
6797
6888
|
* Fetch global state or throw if not found
|
|
6798
6889
|
*/
|