@jpool/bond-sdk 0.8.0-next.1 → 0.8.0-next.3

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
@@ -12,7 +12,7 @@ type Jbond = {
12
12
  "address": "BondQ7KqZreTcW2UbeTNDcLCJQ3aXAtLn2Fm6ftaJDU";
13
13
  "metadata": {
14
14
  "name": "jbond";
15
- "version": "0.2.0";
15
+ "version": "0.2.1";
16
16
  "spec": "0.1.0";
17
17
  "description": "Jpool Bond Program";
18
18
  };
@@ -121,6 +121,73 @@ type Jbond = {
121
121
  }
122
122
  ];
123
123
  },
124
+ {
125
+ "name": "configure";
126
+ "docs": [
127
+ "Updates the global program configuration, including authority and reserve fields.",
128
+ "Allows changing the program's authority and updating the reserve account.",
129
+ "",
130
+ "# Arguments",
131
+ "* `data` - Configuration data containing optional new authority and reserve keys.",
132
+ "",
133
+ "# Errors",
134
+ "Fails if the signer is not authorized to update the global configuration."
135
+ ];
136
+ "discriminator": [
137
+ 245,
138
+ 7,
139
+ 108,
140
+ 117,
141
+ 95,
142
+ 196,
143
+ 54,
144
+ 217
145
+ ];
146
+ "accounts": [
147
+ {
148
+ "name": "globalState";
149
+ "writable": true;
150
+ "pda": {
151
+ "seeds": [
152
+ {
153
+ "kind": "const";
154
+ "value": [
155
+ 103,
156
+ 108,
157
+ 111,
158
+ 98,
159
+ 97,
160
+ 108,
161
+ 95,
162
+ 115,
163
+ 116,
164
+ 97,
165
+ 116,
166
+ 101
167
+ ];
168
+ }
169
+ ];
170
+ };
171
+ },
172
+ {
173
+ "name": "authority";
174
+ "signer": true;
175
+ "relations": [
176
+ "globalState"
177
+ ];
178
+ }
179
+ ];
180
+ "args": [
181
+ {
182
+ "name": "data";
183
+ "type": {
184
+ "defined": {
185
+ "name": "configureData";
186
+ };
187
+ };
188
+ }
189
+ ];
190
+ },
124
191
  {
125
192
  "name": "initialize";
126
193
  "docs": [
@@ -289,67 +356,6 @@ type Jbond = {
289
356
  }
290
357
  ];
291
358
  },
292
- {
293
- "name": "setAuthority";
294
- "docs": [
295
- "Sets a new withdrawal authority for a validator's bond account.",
296
- "Allows changing who can withdraw collateral in the future.",
297
- "",
298
- "# Arguments",
299
- "* `new_authority` - Optional new authority key (None to restrict to identity).",
300
- "",
301
- "# Errors",
302
- "Fails if the signer is not authorized to change the authority."
303
- ];
304
- "discriminator": [
305
- 133,
306
- 250,
307
- 37,
308
- 21,
309
- 110,
310
- 163,
311
- 26,
312
- 121
313
- ];
314
- "accounts": [
315
- {
316
- "name": "globalState";
317
- "writable": true;
318
- "pda": {
319
- "seeds": [
320
- {
321
- "kind": "const";
322
- "value": [
323
- 103,
324
- 108,
325
- 111,
326
- 98,
327
- 97,
328
- 108,
329
- 95,
330
- 115,
331
- 116,
332
- 97,
333
- 116,
334
- 101
335
- ];
336
- }
337
- ];
338
- };
339
- },
340
- {
341
- "name": "authority";
342
- "signer": true;
343
- "relations": [
344
- "globalState"
345
- ];
346
- },
347
- {
348
- "name": "newAuthority";
349
- }
350
- ];
351
- "args": [];
352
- },
353
359
  {
354
360
  "name": "setWithdrawAuthority";
355
361
  "docs": [
@@ -357,7 +363,8 @@ type Jbond = {
357
363
  "Allows changing who can withdraw collateral in the future.",
358
364
  "",
359
365
  "# Arguments",
360
- "* `new_withdraw_authority` - Optional new withdrawal authority key (None to restrict to identity).",
366
+ "* `new_withdraw_authority` - Optional new withdrawal authority key (None to restrict to",
367
+ "identity).",
361
368
  "",
362
369
  "# Errors",
363
370
  "Fails if the signer is not authorized to change the withdrawal authority."
@@ -783,6 +790,26 @@ type Jbond = {
783
790
  ];
784
791
  };
785
792
  },
793
+ {
794
+ "name": "configureData";
795
+ "type": {
796
+ "kind": "struct";
797
+ "fields": [
798
+ {
799
+ "name": "newAuthority";
800
+ "type": {
801
+ "option": "pubkey";
802
+ };
803
+ },
804
+ {
805
+ "name": "newReserve";
806
+ "type": {
807
+ "option": "pubkey";
808
+ };
809
+ }
810
+ ];
811
+ };
812
+ },
786
813
  {
787
814
  "name": "globalState";
788
815
  "type": {
@@ -982,9 +1009,10 @@ type GetHistoryGroupedProps = {
982
1009
  voteAccount: PublicKey;
983
1010
  epochsCount?: number;
984
1011
  };
985
- type SetAuthorityProps = {
986
- newAuthority: PublicKey;
1012
+ type ConfigureProps = {
987
1013
  authority?: PublicKey;
1014
+ newAuthority?: PublicKey;
1015
+ newReserve?: PublicKey;
988
1016
  };
989
1017
  type SetWithdrawAuthorityProps = {
990
1018
  voteAccount: PublicKey;
@@ -1077,7 +1105,7 @@ declare class JBondClient {
1077
1105
  /**
1078
1106
  * Configure a specific option.
1079
1107
  */
1080
- configure<K extends keyof ClientOptions>(key: K, val: ClientOptions[K]): this;
1108
+ configureEnv<K extends keyof ClientOptions>(key: K, val: ClientOptions[K]): this;
1081
1109
  /**
1082
1110
  * Program Derived Addresses (PDAs)
1083
1111
  */
@@ -1114,11 +1142,12 @@ declare class JBondClient {
1114
1142
  */
1115
1143
  claimCompensation(props: ClaimProps): Promise<string>;
1116
1144
  /**
1117
- * Set a new authority for the program
1145
+ * Update global configuration for the program
1118
1146
  * Default authority is the provider's wallet
1147
+ * Only the current authority can call this
1119
1148
  * @return Transaction signature
1120
1149
  */
1121
- setAuthority(props: SetAuthorityProps): Promise<string>;
1150
+ configure(props: ConfigureProps): Promise<string>;
1122
1151
  /**
1123
1152
  * Set withdrawal authority for validator bond
1124
1153
  * Only the validator identity can call this
@@ -1147,9 +1176,9 @@ declare class JBondClient {
1147
1176
  */
1148
1177
  buildClaimInstruction(props: ClaimProps): Promise<_solana_web3_js.TransactionInstruction>;
1149
1178
  /**
1150
- * Build set authority instruction
1179
+ * Build configure instruction
1151
1180
  */
1152
- buildSetAuthorityInstruction(props: SetAuthorityProps): Promise<_solana_web3_js.TransactionInstruction>;
1181
+ buildConfigureInstruction(props: ConfigureProps): Promise<_solana_web3_js.TransactionInstruction>;
1153
1182
  /**
1154
1183
  * Build set withdraw authority instruction
1155
1184
  */
@@ -1221,4 +1250,4 @@ declare class JBondClient {
1221
1250
  */
1222
1251
  declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
1223
1252
 
1224
- export { BondClientEnv, BondTransactionType, type ClaimProps, type ClientOptions, ENV_PROGRAM_ID, type EpochHistoryItem, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalState, type InitializeProps, JBondClient, type Jbond, NodeWallet, type RegisterValidatorProps, type SetAuthorityProps, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, type ValidatorBond, type WithdrawCollateralProps };
1253
+ export { BondClientEnv, BondTransactionType, type ClaimProps, type ClientOptions, type ConfigureProps, ENV_PROGRAM_ID, type EpochHistoryItem, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalState, type InitializeProps, JBondClient, type Jbond, NodeWallet, type RegisterValidatorProps, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, type ValidatorBond, type WithdrawCollateralProps };
package/dist/index.d.ts CHANGED
@@ -12,7 +12,7 @@ type Jbond = {
12
12
  "address": "BondQ7KqZreTcW2UbeTNDcLCJQ3aXAtLn2Fm6ftaJDU";
13
13
  "metadata": {
14
14
  "name": "jbond";
15
- "version": "0.2.0";
15
+ "version": "0.2.1";
16
16
  "spec": "0.1.0";
17
17
  "description": "Jpool Bond Program";
18
18
  };
@@ -121,6 +121,73 @@ type Jbond = {
121
121
  }
122
122
  ];
123
123
  },
124
+ {
125
+ "name": "configure";
126
+ "docs": [
127
+ "Updates the global program configuration, including authority and reserve fields.",
128
+ "Allows changing the program's authority and updating the reserve account.",
129
+ "",
130
+ "# Arguments",
131
+ "* `data` - Configuration data containing optional new authority and reserve keys.",
132
+ "",
133
+ "# Errors",
134
+ "Fails if the signer is not authorized to update the global configuration."
135
+ ];
136
+ "discriminator": [
137
+ 245,
138
+ 7,
139
+ 108,
140
+ 117,
141
+ 95,
142
+ 196,
143
+ 54,
144
+ 217
145
+ ];
146
+ "accounts": [
147
+ {
148
+ "name": "globalState";
149
+ "writable": true;
150
+ "pda": {
151
+ "seeds": [
152
+ {
153
+ "kind": "const";
154
+ "value": [
155
+ 103,
156
+ 108,
157
+ 111,
158
+ 98,
159
+ 97,
160
+ 108,
161
+ 95,
162
+ 115,
163
+ 116,
164
+ 97,
165
+ 116,
166
+ 101
167
+ ];
168
+ }
169
+ ];
170
+ };
171
+ },
172
+ {
173
+ "name": "authority";
174
+ "signer": true;
175
+ "relations": [
176
+ "globalState"
177
+ ];
178
+ }
179
+ ];
180
+ "args": [
181
+ {
182
+ "name": "data";
183
+ "type": {
184
+ "defined": {
185
+ "name": "configureData";
186
+ };
187
+ };
188
+ }
189
+ ];
190
+ },
124
191
  {
125
192
  "name": "initialize";
126
193
  "docs": [
@@ -289,67 +356,6 @@ type Jbond = {
289
356
  }
290
357
  ];
291
358
  },
292
- {
293
- "name": "setAuthority";
294
- "docs": [
295
- "Sets a new withdrawal authority for a validator's bond account.",
296
- "Allows changing who can withdraw collateral in the future.",
297
- "",
298
- "# Arguments",
299
- "* `new_authority` - Optional new authority key (None to restrict to identity).",
300
- "",
301
- "# Errors",
302
- "Fails if the signer is not authorized to change the authority."
303
- ];
304
- "discriminator": [
305
- 133,
306
- 250,
307
- 37,
308
- 21,
309
- 110,
310
- 163,
311
- 26,
312
- 121
313
- ];
314
- "accounts": [
315
- {
316
- "name": "globalState";
317
- "writable": true;
318
- "pda": {
319
- "seeds": [
320
- {
321
- "kind": "const";
322
- "value": [
323
- 103,
324
- 108,
325
- 111,
326
- 98,
327
- 97,
328
- 108,
329
- 95,
330
- 115,
331
- 116,
332
- 97,
333
- 116,
334
- 101
335
- ];
336
- }
337
- ];
338
- };
339
- },
340
- {
341
- "name": "authority";
342
- "signer": true;
343
- "relations": [
344
- "globalState"
345
- ];
346
- },
347
- {
348
- "name": "newAuthority";
349
- }
350
- ];
351
- "args": [];
352
- },
353
359
  {
354
360
  "name": "setWithdrawAuthority";
355
361
  "docs": [
@@ -357,7 +363,8 @@ type Jbond = {
357
363
  "Allows changing who can withdraw collateral in the future.",
358
364
  "",
359
365
  "# Arguments",
360
- "* `new_withdraw_authority` - Optional new withdrawal authority key (None to restrict to identity).",
366
+ "* `new_withdraw_authority` - Optional new withdrawal authority key (None to restrict to",
367
+ "identity).",
361
368
  "",
362
369
  "# Errors",
363
370
  "Fails if the signer is not authorized to change the withdrawal authority."
@@ -783,6 +790,26 @@ type Jbond = {
783
790
  ];
784
791
  };
785
792
  },
793
+ {
794
+ "name": "configureData";
795
+ "type": {
796
+ "kind": "struct";
797
+ "fields": [
798
+ {
799
+ "name": "newAuthority";
800
+ "type": {
801
+ "option": "pubkey";
802
+ };
803
+ },
804
+ {
805
+ "name": "newReserve";
806
+ "type": {
807
+ "option": "pubkey";
808
+ };
809
+ }
810
+ ];
811
+ };
812
+ },
786
813
  {
787
814
  "name": "globalState";
788
815
  "type": {
@@ -982,9 +1009,10 @@ type GetHistoryGroupedProps = {
982
1009
  voteAccount: PublicKey;
983
1010
  epochsCount?: number;
984
1011
  };
985
- type SetAuthorityProps = {
986
- newAuthority: PublicKey;
1012
+ type ConfigureProps = {
987
1013
  authority?: PublicKey;
1014
+ newAuthority?: PublicKey;
1015
+ newReserve?: PublicKey;
988
1016
  };
989
1017
  type SetWithdrawAuthorityProps = {
990
1018
  voteAccount: PublicKey;
@@ -1077,7 +1105,7 @@ declare class JBondClient {
1077
1105
  /**
1078
1106
  * Configure a specific option.
1079
1107
  */
1080
- configure<K extends keyof ClientOptions>(key: K, val: ClientOptions[K]): this;
1108
+ configureEnv<K extends keyof ClientOptions>(key: K, val: ClientOptions[K]): this;
1081
1109
  /**
1082
1110
  * Program Derived Addresses (PDAs)
1083
1111
  */
@@ -1114,11 +1142,12 @@ declare class JBondClient {
1114
1142
  */
1115
1143
  claimCompensation(props: ClaimProps): Promise<string>;
1116
1144
  /**
1117
- * Set a new authority for the program
1145
+ * Update global configuration for the program
1118
1146
  * Default authority is the provider's wallet
1147
+ * Only the current authority can call this
1119
1148
  * @return Transaction signature
1120
1149
  */
1121
- setAuthority(props: SetAuthorityProps): Promise<string>;
1150
+ configure(props: ConfigureProps): Promise<string>;
1122
1151
  /**
1123
1152
  * Set withdrawal authority for validator bond
1124
1153
  * Only the validator identity can call this
@@ -1147,9 +1176,9 @@ declare class JBondClient {
1147
1176
  */
1148
1177
  buildClaimInstruction(props: ClaimProps): Promise<_solana_web3_js.TransactionInstruction>;
1149
1178
  /**
1150
- * Build set authority instruction
1179
+ * Build configure instruction
1151
1180
  */
1152
- buildSetAuthorityInstruction(props: SetAuthorityProps): Promise<_solana_web3_js.TransactionInstruction>;
1181
+ buildConfigureInstruction(props: ConfigureProps): Promise<_solana_web3_js.TransactionInstruction>;
1153
1182
  /**
1154
1183
  * Build set withdraw authority instruction
1155
1184
  */
@@ -1221,4 +1250,4 @@ declare class JBondClient {
1221
1250
  */
1222
1251
  declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
1223
1252
 
1224
- export { BondClientEnv, BondTransactionType, type ClaimProps, type ClientOptions, ENV_PROGRAM_ID, type EpochHistoryItem, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalState, type InitializeProps, JBondClient, type Jbond, NodeWallet, type RegisterValidatorProps, type SetAuthorityProps, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, type ValidatorBond, type WithdrawCollateralProps };
1253
+ export { BondClientEnv, BondTransactionType, type ClaimProps, type ClientOptions, type ConfigureProps, ENV_PROGRAM_ID, type EpochHistoryItem, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalState, type InitializeProps, JBondClient, type Jbond, NodeWallet, type RegisterValidatorProps, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, type ValidatorBond, type WithdrawCollateralProps };