@jpool/bond-cli 1.2.0-next.0 → 1.2.0-next.1

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.
Files changed (3) hide show
  1. package/README.md +36 -7
  2. package/dist/cli.js +3 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -52,7 +52,7 @@ Example:
52
52
  Add additional collateral to an existing validator bond.
53
53
 
54
54
  ```bash
55
- pnpm jbond topup-collateral <vote-account> <amount> -k <path>
55
+ pnpm jbond topup <vote-account> <amount> -k <path>
56
56
 
57
57
  Arguments:
58
58
  vote-account Vote account public key
@@ -63,15 +63,15 @@ Options:
63
63
  -c, --cluster <CLUSTER_NAME> Solana cluster(devnet or mainnet-beta)
64
64
 
65
65
  Example:
66
- pnpm jbond topup-collateral 686JcEJ98r8fMtUiVuKiz4WRoBpJ2Sm9zMhdc2b6H4bu 50 -c mainnet-beta
66
+ pnpm jbond topup 686JcEJ98r8fMtUiVuKiz4WRoBpJ2Sm9zMhdc2b6H4bu 50 -c mainnet-beta
67
67
  ```
68
68
 
69
69
  ### Withdraw Collateral
70
70
 
71
- Withdraw collateral from validator bond account.
71
+ Withdraw collateral from a validator bond account to a specified destination address.
72
72
 
73
73
  ```bash
74
- pnpm jbond withdraw-collateral <vote-account> <destination> <amount> [options]
74
+ pnpm jbond withdraw <vote-account> <destination> <amount> [options]
75
75
 
76
76
  Arguments:
77
77
  vote-account Vote account public key
@@ -83,13 +83,42 @@ Options:
83
83
  -c, --cluster <CLUSTER_NAME> Solana cluster(devnet or mainnet-beta)
84
84
 
85
85
  Example:
86
- pnpm jbond withdraw-collateral 686JcEJ98r8fMtUiVuKiz4WRoBpJ2Sm9zMhdc2b6H4bu 3K2coMGaZhrSkyF52wUBUXBeRBRpGLnmB3znzLRKjgiP 25 -c mainnet-beta
86
+ pnpm jbond withdraw 686JcEJ98r8fMtUiVuKiz4WRoBpJ2Sm9zMhdc2b6H4bu 3K2coMGaZhrSkyF52wUBUXBeRBRpGLnmB3znzLRKjgiP 25 -c mainnet-beta
87
87
  ```
88
88
 
89
89
  **Requirements**:
90
90
 
91
91
  Only the validator identity or withdrawal authority can execute withdrawals. The validator bond account must have sufficient collateral
92
92
 
93
+ ### Set Withdrawal Authority
94
+
95
+ Set or update the withdrawal authority for a validator bond account. This allows delegating withdrawal permissions to another address.
96
+
97
+ ```bash
98
+ pnpm jbond set-withdraw-authority <vote-account> [options]
99
+
100
+ Arguments:
101
+ vote-account Vote account public key
102
+
103
+ Options:
104
+ -k, --keypair <path> Path to keypair file (default: ~/.config/solana/id.json)
105
+ -w, --new-authority <pubkey> New withdrawal authority (omit to remove authority)
106
+ -c, --cluster <CLUSTER_NAME> Solana cluster(devnet or mainnet-beta)
107
+
108
+ Examples:
109
+ # Set a withdrawal authority
110
+ pnpm jbond set-withdraw-authority 686JcEJ98r8fMtUiVuKiz4WRoBpJ2Sm9zMhdc2b6H4bu -w 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin -c mainnet-beta
111
+
112
+ # Remove withdrawal authority (revert to identity-only)
113
+ pnpm jbond set-withdraw-authority 686JcEJ98r8fMtUiVuKiz4WRoBpJ2Sm9zMhdc2b6H4bu -c mainnet-beta
114
+ ```
115
+
116
+ **Requirements**:
117
+
118
+ - Only the validator identity can set or update the withdrawal authority
119
+ - When a withdrawal authority is set, only that authority (or validator identity) can withdraw collateral
120
+ - Omitting the `--new-authority` option removes the withdrawal authority, reverting to identity-only withdrawals
121
+
93
122
  ### Claim Compensation
94
123
 
95
124
  Claim compensation from a validator's collateral to the reserve (authority only).
@@ -195,7 +224,7 @@ pnpm jbond register-validator GHRvDXj9BfACkJ9CoLWbpi2UkMVti9DwXJGsaFT9XDcD 100
195
224
  pnpm jbond validator-info GHRvDXj9BfACkJ9CoLWbpi2UkMVti9DwXJGsaFT9XDcD -c mainnet-beta
196
225
 
197
226
  # 4. Top up with additional 50 SOL
198
- pnpm jbond topup-collateral GHRvDXj9BfACkJ9CoLWbpi2UkMVti9DwXJGsaFT9XDcD 50 -c mainnet-beta
227
+ pnpm jbond topup GHRvDXj9BfACkJ9CoLWbpi2UkMVti9DwXJGsaFT9XDcD 50 -c mainnet-beta
199
228
  ```
200
229
 
201
230
  ### Authority Operations
@@ -231,4 +260,4 @@ Common errors and solutions:
231
260
  ### `Account already in use`
232
261
 
233
262
  - The validator is already registered
234
- - Use `topup-collateral` to add more funds instead
263
+ - Use `topup` to add more funds instead
package/dist/cli.js CHANGED
@@ -81,7 +81,7 @@ function resolveKeypair(path) {
81
81
  }
82
82
 
83
83
  // package.json
84
- var version = "1.1.0";
84
+ var version = "1.2.0-next.0";
85
85
 
86
86
  // src/cli.ts
87
87
  import_commander.program.name("jbond").description("CLI to interact with the JPool Bond program").version(process.env.VERSION ?? version).allowExcessArguments(false).option("-c, --cluster <CLUSTER>", "Solana cluster or RPC URL").option("-k, --keypair <KEYPAIR>", "Filepath to Solana keypair").hook("preAction", async (command) => {
@@ -167,7 +167,7 @@ import_commander.program.command("register-validator").description("Register val
167
167
  spinner.fail(import_chalk.default.red(`Failed to register validator: ${error}`));
168
168
  }
169
169
  });
170
- import_commander.program.command("topup-collateral").description("Top up collateral for existing validator").argument("<vote-account>", "Vote account public key").argument("<amount>", "Amount to top up in SOL").action(async (voteAccountStr, amount) => {
170
+ import_commander.program.command("topup").description("Top up collateral for validator bond account").argument("<vote-account>", "Vote account public key").argument("<amount>", "Amount to top up in SOL").action(async (voteAccountStr, amount) => {
171
171
  const spinner = (0, import_ora.default)("Topping up collateral...").start();
172
172
  const { client } = useContext();
173
173
  try {
@@ -185,7 +185,7 @@ import_commander.program.command("topup-collateral").description("Top up collate
185
185
  process.exit(1);
186
186
  }
187
187
  });
188
- import_commander.program.command("withdraw-collateral").description("Withdraw collateral from validator bond account").argument("<vote-account>", "Vote account public key").argument("<destination>", "Destination address for withdrawn funds").argument("<amount>", "Amount to withdraw in SOL").action(async (voteAccountStr, destinationStr, amount) => {
188
+ import_commander.program.command("withdraw").description("Withdraw collateral from validator bond account").argument("<vote-account>", "Vote account public key").argument("<destination>", "Destination address for withdrawn funds").argument("<amount>", "Amount to withdraw in SOL").action(async (voteAccountStr, destinationStr, amount) => {
189
189
  const spinner = (0, import_ora.default)("Withdrawing collateral...").start();
190
190
  const { client } = useContext();
191
191
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jpool/bond-cli",
3
- "version": "1.2.0-next.0",
3
+ "version": "1.2.0-next.1",
4
4
  "description": "JBond CLI for interacting with the Solana program",
5
5
  "main": "./dist/cli.js",
6
6
  "bin": {