@jpool/bond-sdk 0.8.0-next.0 → 0.8.0-next.2

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
@@ -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": [
@@ -286,72 +353,72 @@ type Jbond = {
286
353
  {
287
354
  "name": "initialCollateral";
288
355
  "type": "u64";
289
- },
290
- {
291
- "name": "withdrawalAuthority";
292
- "type": {
293
- "option": "pubkey";
294
- };
295
356
  }
296
357
  ];
297
358
  },
298
359
  {
299
- "name": "setAuthority";
360
+ "name": "setWithdrawAuthority";
300
361
  "docs": [
301
362
  "Sets a new withdrawal authority for a validator's bond account.",
302
363
  "Allows changing who can withdraw collateral in the future.",
303
364
  "",
304
365
  "# Arguments",
305
- "* `new_authority` - Optional new authority key (None to restrict to identity).",
366
+ "* `new_withdraw_authority` - Optional new withdrawal authority key (None to restrict to",
367
+ "identity).",
306
368
  "",
307
369
  "# Errors",
308
- "Fails if the signer is not authorized to change the authority."
370
+ "Fails if the signer is not authorized to change the withdrawal authority."
309
371
  ];
310
372
  "discriminator": [
311
- 133,
312
- 250,
313
- 37,
314
- 21,
315
- 110,
316
- 163,
317
- 26,
318
- 121
373
+ 199,
374
+ 146,
375
+ 140,
376
+ 67,
377
+ 1,
378
+ 90,
379
+ 8,
380
+ 222
319
381
  ];
320
382
  "accounts": [
321
383
  {
322
- "name": "globalState";
384
+ "name": "validatorBond";
323
385
  "writable": true;
324
386
  "pda": {
325
387
  "seeds": [
326
388
  {
327
389
  "kind": "const";
328
390
  "value": [
329
- 103,
330
- 108,
331
- 111,
332
- 98,
391
+ 118,
333
392
  97,
334
393
  108,
335
- 95,
336
- 115,
337
- 116,
394
+ 105,
395
+ 100,
338
396
  97,
339
397
  116,
340
- 101
398
+ 111,
399
+ 114,
400
+ 95,
401
+ 98,
402
+ 111,
403
+ 110,
404
+ 100
341
405
  ];
406
+ },
407
+ {
408
+ "kind": "account";
409
+ "path": "validator_bond.vote_account";
410
+ "account": "validatorBond";
342
411
  }
343
412
  ];
344
413
  };
345
414
  },
346
415
  {
347
- "name": "authority";
416
+ "name": "identity";
348
417
  "signer": true;
349
- "relations": [
350
- "globalState"
351
- ];
352
418
  },
353
419
  {
354
- "name": "newAuthority";
420
+ "name": "newWithdrawAuthority";
421
+ "optional": true;
355
422
  }
356
423
  ];
357
424
  "args": [];
@@ -628,7 +695,7 @@ type Jbond = {
628
695
  {
629
696
  "code": 6006;
630
697
  "name": "validatorNotActive";
631
- "msg": "Validator boost account is not active";
698
+ "msg": "Validator bond account is not active";
632
699
  },
633
700
  {
634
701
  "code": 6007;
@@ -723,6 +790,26 @@ type Jbond = {
723
790
  ];
724
791
  };
725
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
+ },
726
813
  {
727
814
  "name": "globalState";
728
815
  "type": {
@@ -891,7 +978,6 @@ type RegisterValidatorProps = {
891
978
  identity: PublicKey;
892
979
  voteAccount: PublicKey;
893
980
  initialCollateral: number;
894
- withdrawalAuthority?: PublicKey;
895
981
  creator?: PublicKey;
896
982
  };
897
983
  type TopUpCollateralProps = {
@@ -923,9 +1009,15 @@ type GetHistoryGroupedProps = {
923
1009
  voteAccount: PublicKey;
924
1010
  epochsCount?: number;
925
1011
  };
926
- type SetAuthorityProps = {
927
- newAuthority: PublicKey;
1012
+ type ConfigureProps = {
928
1013
  authority?: PublicKey;
1014
+ newAuthority?: PublicKey;
1015
+ newReserve?: PublicKey;
1016
+ };
1017
+ type SetWithdrawAuthorityProps = {
1018
+ voteAccount: PublicKey;
1019
+ newWithdrawAuthority?: PublicKey | null;
1020
+ identity?: PublicKey;
929
1021
  };
930
1022
  type GlobalState = {
931
1023
  authority: PublicKey;
@@ -1013,7 +1105,7 @@ declare class JBondClient {
1013
1105
  /**
1014
1106
  * Configure a specific option.
1015
1107
  */
1016
- configure<K extends keyof ClientOptions>(key: K, val: ClientOptions[K]): this;
1108
+ configureEnv<K extends keyof ClientOptions>(key: K, val: ClientOptions[K]): this;
1017
1109
  /**
1018
1110
  * Program Derived Addresses (PDAs)
1019
1111
  */
@@ -1050,11 +1142,19 @@ declare class JBondClient {
1050
1142
  */
1051
1143
  claimCompensation(props: ClaimProps): Promise<string>;
1052
1144
  /**
1053
- * Set a new authority for the program
1145
+ * Update global configuration for the program
1054
1146
  * Default authority is the provider's wallet
1147
+ * Only the current authority can call this
1055
1148
  * @return Transaction signature
1056
1149
  */
1057
- setAuthority(props: SetAuthorityProps): Promise<string>;
1150
+ configure(props: ConfigureProps): Promise<string>;
1151
+ /**
1152
+ * Set withdrawal authority for validator bond
1153
+ * Only the validator identity can call this
1154
+ * Default identity is the provider's wallet
1155
+ * @return Transaction signature
1156
+ */
1157
+ setWithdrawAuthority(props: SetWithdrawAuthorityProps): Promise<string>;
1058
1158
  /**
1059
1159
  * Build initialize instruction
1060
1160
  */
@@ -1076,9 +1176,13 @@ declare class JBondClient {
1076
1176
  */
1077
1177
  buildClaimInstruction(props: ClaimProps): Promise<_solana_web3_js.TransactionInstruction>;
1078
1178
  /**
1079
- * Build set authority instruction
1179
+ * Build configure instruction
1180
+ */
1181
+ buildConfigureInstruction(props: ConfigureProps): Promise<_solana_web3_js.TransactionInstruction>;
1182
+ /**
1183
+ * Build set withdraw authority instruction
1080
1184
  */
1081
- buildSetAuthorityInstruction(props: SetAuthorityProps): Promise<_solana_web3_js.TransactionInstruction>;
1185
+ buildSetWithdrawAuthorityInstruction(props: SetWithdrawAuthorityProps): Promise<_solana_web3_js.TransactionInstruction>;
1082
1186
  /**
1083
1187
  * Fetch global state or throw if not found
1084
1188
  */
@@ -1146,4 +1250,4 @@ declare class JBondClient {
1146
1250
  */
1147
1251
  declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
1148
1252
 
1149
- 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 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
@@ -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": [
@@ -286,72 +353,72 @@ type Jbond = {
286
353
  {
287
354
  "name": "initialCollateral";
288
355
  "type": "u64";
289
- },
290
- {
291
- "name": "withdrawalAuthority";
292
- "type": {
293
- "option": "pubkey";
294
- };
295
356
  }
296
357
  ];
297
358
  },
298
359
  {
299
- "name": "setAuthority";
360
+ "name": "setWithdrawAuthority";
300
361
  "docs": [
301
362
  "Sets a new withdrawal authority for a validator's bond account.",
302
363
  "Allows changing who can withdraw collateral in the future.",
303
364
  "",
304
365
  "# Arguments",
305
- "* `new_authority` - Optional new authority key (None to restrict to identity).",
366
+ "* `new_withdraw_authority` - Optional new withdrawal authority key (None to restrict to",
367
+ "identity).",
306
368
  "",
307
369
  "# Errors",
308
- "Fails if the signer is not authorized to change the authority."
370
+ "Fails if the signer is not authorized to change the withdrawal authority."
309
371
  ];
310
372
  "discriminator": [
311
- 133,
312
- 250,
313
- 37,
314
- 21,
315
- 110,
316
- 163,
317
- 26,
318
- 121
373
+ 199,
374
+ 146,
375
+ 140,
376
+ 67,
377
+ 1,
378
+ 90,
379
+ 8,
380
+ 222
319
381
  ];
320
382
  "accounts": [
321
383
  {
322
- "name": "globalState";
384
+ "name": "validatorBond";
323
385
  "writable": true;
324
386
  "pda": {
325
387
  "seeds": [
326
388
  {
327
389
  "kind": "const";
328
390
  "value": [
329
- 103,
330
- 108,
331
- 111,
332
- 98,
391
+ 118,
333
392
  97,
334
393
  108,
335
- 95,
336
- 115,
337
- 116,
394
+ 105,
395
+ 100,
338
396
  97,
339
397
  116,
340
- 101
398
+ 111,
399
+ 114,
400
+ 95,
401
+ 98,
402
+ 111,
403
+ 110,
404
+ 100
341
405
  ];
406
+ },
407
+ {
408
+ "kind": "account";
409
+ "path": "validator_bond.vote_account";
410
+ "account": "validatorBond";
342
411
  }
343
412
  ];
344
413
  };
345
414
  },
346
415
  {
347
- "name": "authority";
416
+ "name": "identity";
348
417
  "signer": true;
349
- "relations": [
350
- "globalState"
351
- ];
352
418
  },
353
419
  {
354
- "name": "newAuthority";
420
+ "name": "newWithdrawAuthority";
421
+ "optional": true;
355
422
  }
356
423
  ];
357
424
  "args": [];
@@ -628,7 +695,7 @@ type Jbond = {
628
695
  {
629
696
  "code": 6006;
630
697
  "name": "validatorNotActive";
631
- "msg": "Validator boost account is not active";
698
+ "msg": "Validator bond account is not active";
632
699
  },
633
700
  {
634
701
  "code": 6007;
@@ -723,6 +790,26 @@ type Jbond = {
723
790
  ];
724
791
  };
725
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
+ },
726
813
  {
727
814
  "name": "globalState";
728
815
  "type": {
@@ -891,7 +978,6 @@ type RegisterValidatorProps = {
891
978
  identity: PublicKey;
892
979
  voteAccount: PublicKey;
893
980
  initialCollateral: number;
894
- withdrawalAuthority?: PublicKey;
895
981
  creator?: PublicKey;
896
982
  };
897
983
  type TopUpCollateralProps = {
@@ -923,9 +1009,15 @@ type GetHistoryGroupedProps = {
923
1009
  voteAccount: PublicKey;
924
1010
  epochsCount?: number;
925
1011
  };
926
- type SetAuthorityProps = {
927
- newAuthority: PublicKey;
1012
+ type ConfigureProps = {
928
1013
  authority?: PublicKey;
1014
+ newAuthority?: PublicKey;
1015
+ newReserve?: PublicKey;
1016
+ };
1017
+ type SetWithdrawAuthorityProps = {
1018
+ voteAccount: PublicKey;
1019
+ newWithdrawAuthority?: PublicKey | null;
1020
+ identity?: PublicKey;
929
1021
  };
930
1022
  type GlobalState = {
931
1023
  authority: PublicKey;
@@ -1013,7 +1105,7 @@ declare class JBondClient {
1013
1105
  /**
1014
1106
  * Configure a specific option.
1015
1107
  */
1016
- configure<K extends keyof ClientOptions>(key: K, val: ClientOptions[K]): this;
1108
+ configureEnv<K extends keyof ClientOptions>(key: K, val: ClientOptions[K]): this;
1017
1109
  /**
1018
1110
  * Program Derived Addresses (PDAs)
1019
1111
  */
@@ -1050,11 +1142,19 @@ declare class JBondClient {
1050
1142
  */
1051
1143
  claimCompensation(props: ClaimProps): Promise<string>;
1052
1144
  /**
1053
- * Set a new authority for the program
1145
+ * Update global configuration for the program
1054
1146
  * Default authority is the provider's wallet
1147
+ * Only the current authority can call this
1055
1148
  * @return Transaction signature
1056
1149
  */
1057
- setAuthority(props: SetAuthorityProps): Promise<string>;
1150
+ configure(props: ConfigureProps): Promise<string>;
1151
+ /**
1152
+ * Set withdrawal authority for validator bond
1153
+ * Only the validator identity can call this
1154
+ * Default identity is the provider's wallet
1155
+ * @return Transaction signature
1156
+ */
1157
+ setWithdrawAuthority(props: SetWithdrawAuthorityProps): Promise<string>;
1058
1158
  /**
1059
1159
  * Build initialize instruction
1060
1160
  */
@@ -1076,9 +1176,13 @@ declare class JBondClient {
1076
1176
  */
1077
1177
  buildClaimInstruction(props: ClaimProps): Promise<_solana_web3_js.TransactionInstruction>;
1078
1178
  /**
1079
- * Build set authority instruction
1179
+ * Build configure instruction
1180
+ */
1181
+ buildConfigureInstruction(props: ConfigureProps): Promise<_solana_web3_js.TransactionInstruction>;
1182
+ /**
1183
+ * Build set withdraw authority instruction
1080
1184
  */
1081
- buildSetAuthorityInstruction(props: SetAuthorityProps): Promise<_solana_web3_js.TransactionInstruction>;
1185
+ buildSetWithdrawAuthorityInstruction(props: SetWithdrawAuthorityProps): Promise<_solana_web3_js.TransactionInstruction>;
1082
1186
  /**
1083
1187
  * Fetch global state or throw if not found
1084
1188
  */
@@ -1146,4 +1250,4 @@ declare class JBondClient {
1146
1250
  */
1147
1251
  declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
1148
1252
 
1149
- 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 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 };