minara 0.4.1 → 0.4.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/commands/account.js +23 -2
- package/dist/commands/perps.js +3 -2
- package/package.json +1 -1
package/dist/commands/account.js
CHANGED
|
@@ -3,10 +3,21 @@ import chalk from 'chalk';
|
|
|
3
3
|
import { getCurrentUser } from '../api/auth.js';
|
|
4
4
|
import { requireAuth } from '../config.js';
|
|
5
5
|
import { spinner, unwrapApi, wrapAction } from '../utils.js';
|
|
6
|
+
// Wallets to show by default (user-facing addresses)
|
|
7
|
+
const DEFAULT_WALLETS = new Set([
|
|
8
|
+
'abstraction-evm',
|
|
9
|
+
'abstraction-solana',
|
|
10
|
+
'perpetual-evm',
|
|
11
|
+
]);
|
|
12
|
+
// Descriptions for specific wallet types
|
|
13
|
+
const WALLET_DESCRIPTIONS = {
|
|
14
|
+
'perpetual-evm': 'Only supports USDC deposits on Arbitrum',
|
|
15
|
+
};
|
|
6
16
|
export const accountCommand = new Command('account')
|
|
7
17
|
.alias('me')
|
|
8
18
|
.description('View your Minara account info')
|
|
9
|
-
.
|
|
19
|
+
.option('--show-all', 'Show all wallets including internal addresses')
|
|
20
|
+
.action(wrapAction(async (opts) => {
|
|
10
21
|
const creds = requireAuth();
|
|
11
22
|
const spin = spinner('Fetching account info…');
|
|
12
23
|
const res = await getCurrentUser(creds.accessToken);
|
|
@@ -26,8 +37,18 @@ export const accountCommand = new Command('account')
|
|
|
26
37
|
console.log(` Invite Code : ${u.invitationCode}`);
|
|
27
38
|
if (u.wallets && Object.keys(u.wallets).length > 0) {
|
|
28
39
|
console.log(` Wallets:`);
|
|
40
|
+
const showAll = opts.showAll === true;
|
|
29
41
|
for (const [type, addr] of Object.entries(u.wallets)) {
|
|
30
|
-
|
|
42
|
+
// Filter wallets: only show default wallets unless --show-all is used
|
|
43
|
+
if (showAll || DEFAULT_WALLETS.has(type)) {
|
|
44
|
+
const description = WALLET_DESCRIPTIONS[type];
|
|
45
|
+
if (description) {
|
|
46
|
+
console.log(` ${chalk.dim(type)} : ${addr} ${chalk.dim(`(${description})`)}`);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
console.log(` ${chalk.dim(type)} : ${addr}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
31
52
|
}
|
|
32
53
|
}
|
|
33
54
|
if (u.accounts && Object.keys(u.accounts).length > 0) {
|
package/dist/commands/perps.js
CHANGED
|
@@ -466,6 +466,7 @@ const orderCmd = new Command('order')
|
|
|
466
466
|
.option('-z, --size <size>', 'Position size in contracts')
|
|
467
467
|
.option('-r, --reduce-only', 'Reduce-only order')
|
|
468
468
|
.option('-g, --grouping <grouping>', 'TP/SL grouping: na, normalTpsl, positionTpsl', 'na')
|
|
469
|
+
.option('--tpsl <type>', 'Trigger type for market orders: tp (take profit) or sl (stop loss)', 'tp')
|
|
469
470
|
.action(wrapAction(async (opts) => {
|
|
470
471
|
const creds = requireAuth();
|
|
471
472
|
const resolved = await resolveWallet(creds.accessToken, opts.wallet, 'Place order on which wallet?');
|
|
@@ -680,7 +681,7 @@ const orderCmd = new Command('order')
|
|
|
680
681
|
r: reduceOnly,
|
|
681
682
|
t: orderType === 'limit'
|
|
682
683
|
? { limit: { tif: 'Gtc' } }
|
|
683
|
-
: { trigger: { triggerPx: String(marketPx ?? limitPx), tpsl: 'tp', isMarket: true } },
|
|
684
|
+
: { trigger: { triggerPx: String(marketPx ?? limitPx), tpsl: opts.tpsl ?? 'tp', isMarket: true } },
|
|
684
685
|
};
|
|
685
686
|
const priceLabel = orderType === 'market' ? `Market (~$${marketPx ?? limitPx})` : `$${limitPx}`;
|
|
686
687
|
const levLabel = currentLev ? `${currentLev.value}x (${currentLev.type})` : '—';
|
|
@@ -689,7 +690,7 @@ const orderCmd = new Command('order')
|
|
|
689
690
|
console.log(` Asset : ${chalk.bold(order.a)}`);
|
|
690
691
|
console.log(` Side : ${formatOrderSide(order.b ? 'buy' : 'sell')}`);
|
|
691
692
|
console.log(` Leverage : ${chalk.cyan(levLabel)}`);
|
|
692
|
-
console.log(` Type : ${orderType === 'market' ?
|
|
693
|
+
console.log(` Type : ${orderType === 'market' ? `Market (${opts.tpsl === 'sl' ? 'Stop Loss' : 'Take Profit'})` : 'Limit (GTC)'}`);
|
|
693
694
|
console.log(` Price : ${chalk.yellow(priceLabel)}`);
|
|
694
695
|
console.log(` Size : ${chalk.bold(order.s)}`);
|
|
695
696
|
console.log(` Reduce Only : ${order.r ? chalk.yellow('Yes') : 'No'}`);
|