minara 0.4.2 → 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/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) {
|