degate-cli 1.0.3 → 1.0.5
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/cli.js +6 -7
- 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
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
`
|
|
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
|
}
|