degate-cli 1.0.3 → 1.0.4

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 (2) hide show
  1. package/cli.js +6 -7
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -431,15 +431,14 @@ async function signAndSubmitIntent(client, tryResp, mnemonic, das) {
431
431
  // 余额不足时后端返回 result: null,给出明确提示
432
432
  if (tryResp.is_balance_enough === false || tryResp.is_gas_pay_token_enough === false) {
433
433
  const needed = tryResp.gas_pay_token_needed;
434
- const avail = tryResp.gas_pay_token_avail;
435
434
  const needAmt = needed?.amount ? (parseInt(needed.amount) / 1e9).toFixed(6) : '?';
436
- const availAmt = avail?.amount ? (parseInt(avail.amount) / 1e9).toFixed(6) : '0';
437
435
  const tokenSymbol = needed?.token === 'So11111111111111111111111111111111111111112' ? 'SOL' : (needed?.token || 'gas token');
438
- throw new Error(
439
- `余额不足\n` +
440
- ` ${tryResp.is_balance_enough === false ? '❌ USDC 余额不足' : ''}\n` +
441
- ` ${tryResp.is_gas_pay_token_enough === false ? `❌ Gas 不足: 需要 ${needAmt} ${tokenSymbol},账户有 ${availAmt} ${tokenSymbol}` : ''}`
442
- );
436
+ const lines = ['余额不足:'];
437
+ if (tryResp.is_balance_enough === false) lines.push(' ❌ USDC 余额不足(请先充值 USDC 到 DeGate 账户)');
438
+ if (tryResp.is_gas_pay_token_enough === false) {
439
+ lines.push(` Gas 不足: 需要 ${needAmt} ${tokenSymbol}(请充值 ${tokenSymbol} Solana DA 地址)`);
440
+ }
441
+ throw new Error(lines.join('\n'));
443
442
  }
444
443
  throw new Error('compact_try_create 未返回 result');
445
444
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "degate-cli",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "DeGate Turbo Range CLI - deposit/withdraw LP positions across Solana & EVM chains",
5
5
  "main": "cli.js",
6
6
  "bin": {