fibx 0.4.2 → 0.5.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 (147) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +80 -30
  3. package/dist/commands/auth/import.d.ts.map +1 -1
  4. package/dist/commands/auth/import.js +15 -15
  5. package/dist/commands/auth/import.js.map +1 -1
  6. package/dist/commands/auth/login.d.ts.map +1 -1
  7. package/dist/commands/auth/login.js +9 -11
  8. package/dist/commands/auth/login.js.map +1 -1
  9. package/dist/commands/auth/logout.d.ts.map +1 -1
  10. package/dist/commands/auth/logout.js +3 -11
  11. package/dist/commands/auth/logout.js.map +1 -1
  12. package/dist/commands/auth/verify.d.ts.map +1 -1
  13. package/dist/commands/auth/verify.js +10 -9
  14. package/dist/commands/auth/verify.js.map +1 -1
  15. package/dist/commands/chain/transaction.d.ts.map +1 -1
  16. package/dist/commands/chain/transaction.js +13 -13
  17. package/dist/commands/chain/transaction.js.map +1 -1
  18. package/dist/commands/config/index.d.ts.map +1 -1
  19. package/dist/commands/config/index.js +40 -8
  20. package/dist/commands/config/index.js.map +1 -1
  21. package/dist/commands/defi/aave.d.ts +1 -0
  22. package/dist/commands/defi/aave.d.ts.map +1 -1
  23. package/dist/commands/defi/aave.js +105 -40
  24. package/dist/commands/defi/aave.js.map +1 -1
  25. package/dist/commands/portfolio/index.d.ts +3 -0
  26. package/dist/commands/portfolio/index.d.ts.map +1 -0
  27. package/dist/commands/portfolio/index.js +64 -0
  28. package/dist/commands/portfolio/index.js.map +1 -0
  29. package/dist/commands/trade/status.d.ts.map +1 -1
  30. package/dist/commands/trade/status.js +17 -19
  31. package/dist/commands/trade/status.js.map +1 -1
  32. package/dist/commands/trade/swap.d.ts +1 -0
  33. package/dist/commands/trade/swap.d.ts.map +1 -1
  34. package/dist/commands/trade/swap.js +156 -101
  35. package/dist/commands/trade/swap.js.map +1 -1
  36. package/dist/commands/wallet/address.d.ts.map +1 -1
  37. package/dist/commands/wallet/address.js +7 -9
  38. package/dist/commands/wallet/address.js.map +1 -1
  39. package/dist/commands/wallet/balance.d.ts.map +1 -1
  40. package/dist/commands/wallet/balance.js +42 -22
  41. package/dist/commands/wallet/balance.js.map +1 -1
  42. package/dist/commands/wallet/list.d.ts +1 -1
  43. package/dist/commands/wallet/list.d.ts.map +1 -1
  44. package/dist/commands/wallet/list.js +7 -16
  45. package/dist/commands/wallet/list.js.map +1 -1
  46. package/dist/commands/wallet/send.d.ts +5 -1
  47. package/dist/commands/wallet/send.d.ts.map +1 -1
  48. package/dist/commands/wallet/send.js +66 -24
  49. package/dist/commands/wallet/send.js.map +1 -1
  50. package/dist/index.js +185 -22
  51. package/dist/index.js.map +1 -1
  52. package/dist/lib/brand.d.ts +5 -0
  53. package/dist/lib/brand.d.ts.map +1 -0
  54. package/dist/lib/brand.js +15 -0
  55. package/dist/lib/brand.js.map +1 -0
  56. package/dist/lib/cli-helpers.d.ts +10 -0
  57. package/dist/lib/cli-helpers.d.ts.map +1 -0
  58. package/dist/lib/cli-helpers.js +20 -0
  59. package/dist/lib/cli-helpers.js.map +1 -0
  60. package/dist/lib/concurrency.d.ts +8 -0
  61. package/dist/lib/concurrency.d.ts.map +1 -0
  62. package/dist/lib/concurrency.js +26 -0
  63. package/dist/lib/concurrency.js.map +1 -0
  64. package/dist/lib/config.d.ts.map +1 -1
  65. package/dist/lib/config.js +1 -2
  66. package/dist/lib/config.js.map +1 -1
  67. package/dist/lib/errors.d.ts +1 -0
  68. package/dist/lib/errors.d.ts.map +1 -1
  69. package/dist/lib/errors.js +1 -0
  70. package/dist/lib/errors.js.map +1 -1
  71. package/dist/lib/format.d.ts +26 -3
  72. package/dist/lib/format.d.ts.map +1 -1
  73. package/dist/lib/format.js +131 -31
  74. package/dist/lib/format.js.map +1 -1
  75. package/dist/lib/parse-evm-error.d.ts +6 -0
  76. package/dist/lib/parse-evm-error.d.ts.map +1 -0
  77. package/dist/lib/parse-evm-error.js +48 -0
  78. package/dist/lib/parse-evm-error.js.map +1 -0
  79. package/dist/lib/parseAmount.d.ts.map +1 -1
  80. package/dist/lib/parseAmount.js +0 -1
  81. package/dist/lib/parseAmount.js.map +1 -1
  82. package/dist/lib/retry.d.ts +20 -0
  83. package/dist/lib/retry.d.ts.map +1 -0
  84. package/dist/lib/retry.js +36 -0
  85. package/dist/lib/retry.js.map +1 -0
  86. package/dist/mcp/handlers.d.ts +22 -1
  87. package/dist/mcp/handlers.d.ts.map +1 -1
  88. package/dist/mcp/handlers.js +105 -18
  89. package/dist/mcp/handlers.js.map +1 -1
  90. package/dist/mcp/server.d.ts.map +1 -1
  91. package/dist/mcp/server.js +4 -3
  92. package/dist/mcp/server.js.map +1 -1
  93. package/dist/mcp/tools.d.ts.map +1 -1
  94. package/dist/mcp/tools.js +27 -3
  95. package/dist/mcp/tools.js.map +1 -1
  96. package/dist/services/auth/session.d.ts.map +1 -1
  97. package/dist/services/auth/session.js +22 -1
  98. package/dist/services/auth/session.js.map +1 -1
  99. package/dist/services/chain/client.d.ts +9376 -241
  100. package/dist/services/chain/client.d.ts.map +1 -1
  101. package/dist/services/chain/client.js +0 -1
  102. package/dist/services/chain/client.js.map +1 -1
  103. package/dist/services/chain/constants.d.ts.map +1 -1
  104. package/dist/services/chain/constants.js +1 -2
  105. package/dist/services/chain/constants.js.map +1 -1
  106. package/dist/services/chain/erc20.d.ts +5 -183
  107. package/dist/services/chain/erc20.d.ts.map +1 -1
  108. package/dist/services/chain/erc20.js +15 -128
  109. package/dist/services/chain/erc20.js.map +1 -1
  110. package/dist/services/chain/nonceManager.d.ts.map +1 -1
  111. package/dist/services/chain/nonceManager.js +0 -3
  112. package/dist/services/chain/nonceManager.js.map +1 -1
  113. package/dist/services/config/config.d.ts +2 -0
  114. package/dist/services/config/config.d.ts.map +1 -1
  115. package/dist/services/config/config.js +9 -1
  116. package/dist/services/config/config.js.map +1 -1
  117. package/dist/services/defi/aave.d.ts +12 -10
  118. package/dist/services/defi/aave.d.ts.map +1 -1
  119. package/dist/services/defi/aave.js +83 -46
  120. package/dist/services/defi/aave.js.map +1 -1
  121. package/dist/services/defi/abi/aave.d.ts +99 -0
  122. package/dist/services/defi/abi/aave.d.ts.map +1 -1
  123. package/dist/services/defi/abi/aave.js +53 -0
  124. package/dist/services/defi/abi/aave.js.map +1 -1
  125. package/dist/services/defi/constants.d.ts +0 -4
  126. package/dist/services/defi/constants.d.ts.map +1 -1
  127. package/dist/services/defi/constants.js +1 -6
  128. package/dist/services/defi/constants.js.map +1 -1
  129. package/dist/services/fibrous/balances.d.ts.map +1 -1
  130. package/dist/services/fibrous/balances.js +12 -9
  131. package/dist/services/fibrous/balances.js.map +1 -1
  132. package/dist/services/fibrous/route.d.ts.map +1 -1
  133. package/dist/services/fibrous/route.js +17 -9
  134. package/dist/services/fibrous/route.js.map +1 -1
  135. package/dist/services/fibrous/tokens.d.ts +1 -0
  136. package/dist/services/fibrous/tokens.d.ts.map +1 -1
  137. package/dist/services/fibrous/tokens.js +7 -4
  138. package/dist/services/fibrous/tokens.js.map +1 -1
  139. package/dist/services/portfolio/portfolio.d.ts +28 -0
  140. package/dist/services/portfolio/portfolio.d.ts.map +1 -0
  141. package/dist/services/portfolio/portfolio.js +116 -0
  142. package/dist/services/portfolio/portfolio.js.map +1 -0
  143. package/dist/services/privy/account.d.ts +16 -14
  144. package/dist/services/privy/account.d.ts.map +1 -1
  145. package/dist/services/privy/account.js +6 -16
  146. package/dist/services/privy/account.js.map +1 -1
  147. package/package.json +9 -9
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ahmet Enes Dur
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # fibx
1
+ # FibX
2
2
 
3
3
  A command-line tool for DeFi operations on **Base, Citrea, HyperEVM, and Monad**, powered by [Fibrous](https://fibrous.finance) aggregation and [Privy](https://privy.io) Server Wallets.
4
4
 
@@ -7,19 +7,45 @@ A command-line tool for DeFi operations on **Base, Citrea, HyperEVM, and Monad**
7
7
  ## Features
8
8
 
9
9
  - **Multi-Chain Support**: Base, Citrea, HyperEVM, and Monad
10
+ - **Portfolio**: Cross-chain portfolio overview with USD valuations and DeFi positions
10
11
  - **Token Swaps**: Optimal routing via Fibrous aggregation with auto-slippage
11
12
  - **Transfers**: Send ETH or any ERC-20 token
12
- - **Aave V3**: Supply, borrow, repay, and withdraw on Base
13
+ - **Aave V3**: Supply, borrow, repay, withdraw, and browse markets on Base
13
14
  - **MCP Server**: Built-in AI agent integration for Cursor, Claude Desktop, and Antigravity
14
- - **Privy Server Wallets**: Secure server-side signing
15
+ - **Agent Skills**: Prompt-based AI skills via [fibx-skills](https://github.com/Fibrous-Finance/fibx-skills)
16
+ - **Privy Server Wallets**: Secure server-side signing — private keys never leave Privy's TEE
15
17
  - **Private Key Import**: Use an existing wallet for local execution
16
18
  - **Simulation**: All transactions are simulated before execution
19
+ - **Dry‑Run Mode**: `--simulate` flag estimates gas without sending a transaction
17
20
  - **JSON Output**: `--json` flag for scripting and pipelines
18
21
 
22
+ ## Supported Chains
23
+
24
+ | Chain | Native Token | Aave V3 |
25
+ | -------- | ------------ | ------- |
26
+ | Base | ETH | ✅ |
27
+ | Citrea | cBTC | — |
28
+ | HyperEVM | HYPE | — |
29
+ | Monad | MON | — |
30
+
31
+ ## Installation
32
+
33
+ Run directly with `npx` (no install needed):
34
+
35
+ ```bash
36
+ npx fibx status
37
+ ```
38
+
39
+ Or install globally:
40
+
41
+ ```bash
42
+ npm install -g fibx
43
+ ```
44
+
19
45
  ## Requirements
20
46
 
21
47
  - Node.js >= 18
22
- - A running [fibx-server](https://github.com/ahmetenesdur/fibx-server) instance (for Privy wallet operations)
48
+ - A running [fibx-server](https://github.com/ahmetenesdur/fibx-server) instance (required for Privy wallet operations; not needed for private key imports)
23
49
 
24
50
  ## Usage
25
51
 
@@ -33,47 +59,45 @@ npx fibx auth verify user@example.com 123456
33
59
  # Or import a private key (local signing, no server needed)
34
60
  npx fibx auth import
35
61
 
62
+ # Check session status
63
+ npx fibx status
64
+
36
65
  # Logout
37
66
  npx fibx auth logout
38
-
39
- # Check status
40
- npx fibx status
41
67
  ```
42
68
 
43
69
  ### Global Options
44
70
 
45
- Use `-c` or `--chain` to specify the target chain. Default is `base`.
46
-
47
- Supported: `base`, `citrea`, `hyperevm`, `monad`
71
+ | Option | Description | Default |
72
+ | -------------------- | ---------------------------------------------------- | ------- |
73
+ | `-c, --chain <name>` | Target chain (`base`, `citrea`, `hyperevm`, `monad`) | `base` |
74
+ | `--json` | Output results as JSON | `false` |
48
75
 
49
- ### Configuration
50
-
51
- You can configure custom RPC URLs to avoid rate limits on public endpoints.
76
+ ### Balance
52
77
 
53
78
  ```bash
54
- # Set a custom RPC URL for a chain
55
- npx fibx config set-rpc base https://mainnet.base.org
56
-
57
- # View current RPC URL
58
- npx fibx config get-rpc base
59
-
60
- # List all custom configurations
61
- npx fibx config list
79
+ npx fibx balance
80
+ npx fibx balance --chain citrea
62
81
  ```
63
82
 
64
- ### Balance
83
+ ### Portfolio
84
+
85
+ Consolidated cross-chain portfolio view with USD valuations:
65
86
 
66
87
  ```bash
67
- npx fibx balance
68
- npx fibx balance --chain citrea
88
+ npx fibx portfolio # Table output across all chains
89
+ npx fibx portfolio --json # Structured JSON for scripting
69
90
  ```
70
91
 
92
+ Shows all token holdings across Base, Citrea, HyperEVM, and Monad with USD values. Includes DeFi positions (Aave V3 collateral/debt) and total portfolio net worth. Token prices are sourced live from Fibrous.
93
+
71
94
  ### Send
72
95
 
73
96
  ```bash
74
97
  npx fibx send 0.001 0xRecipient # Send native token on Base (ETH)
75
98
  npx fibx send 10 0xRecipient USDC # Send ERC-20 on Base
76
- npx fibx send 1 0xRecipient --chain monad # Send on Monad native token (MON)
99
+ npx fibx send 1 0xRecipient --chain monad # Send MON on Monad
100
+ npx fibx send 0.1 0xRecipient --simulate # Estimate gas without sending
77
101
  ```
78
102
 
79
103
  ### Swap
@@ -83,9 +107,10 @@ npx fibx trade <amount> <from> <to>
83
107
  npx fibx trade 0.0001 ETH USDC
84
108
  npx fibx trade 20 USDC DAI
85
109
  npx fibx trade 1 MON USDC --chain monad
110
+ npx fibx trade 0.1 ETH USDC --simulate # Estimate gas without executing
86
111
  ```
87
112
 
88
- Options: `--slippage <n>` (default: 0.5%), `--approve-max`, `--json`
113
+ Options: `--slippage <n>` (default: 0.5%), `--approve-max`, `--simulate`, `--json`
89
114
 
90
115
  > **Note:** The `trade` command automatically detects **Wrap** (Native -> Wrapped) and **Unwrap** (Wrapped -> Native) operations and executes them directly via contract calls, bypassing aggregator routing to save gas.
91
116
 
@@ -99,29 +124,43 @@ npx fibx tx-status 0x123...abc --chain monad
99
124
  ### Wallet Info
100
125
 
101
126
  ```bash
102
- npx fibx address # Print wallet address
103
- npx fibx wallets <email> # List active wallet
127
+ npx fibx address # Print active wallet address
128
+ npx fibx wallets # Show active wallet details
104
129
  ```
105
130
 
106
131
  ### Aave V3 (Base)
107
132
 
108
133
  ```bash
109
134
  npx fibx aave status # Account health
135
+ npx fibx aave markets # List all active reserves with APY & TVL
110
136
  npx fibx aave supply 1 ETH # Auto-wraps ETH -> WETH and supplies
111
137
  npx fibx aave supply 100 USDC # Supply ERC-20
112
138
  npx fibx aave borrow 50 USDC # Borrow
113
139
  npx fibx aave repay 50 USDC # Repay
114
140
  npx fibx aave repay max ETH # Auto-wraps ETH and repays full WETH debt
115
141
  npx fibx aave withdraw max ETH # Withdraws WETH and auto-unwraps to ETH
142
+ npx fibx aave supply 1 ETH --simulate # Estimate gas without executing
116
143
  ```
117
144
 
118
145
  > **Note:** `supply`, `repay`, and `withdraw` support automatic **ETH <-> WETH** wrapping/unwrapping on Base.
119
146
 
147
+ ### Configuration
148
+
149
+ Set custom RPC URLs to avoid rate limits on public endpoints:
150
+
151
+ ```bash
152
+ npx fibx config set-rpc base https://mainnet.base.org
153
+ npx fibx config get-rpc base
154
+ npx fibx config reset-rpc base # Reset single chain to default
155
+ npx fibx config reset-rpc # Reset all chains to default
156
+ npx fibx config list
157
+ ```
158
+
120
159
  ## AI Agent Integration
121
160
 
122
161
  ### MCP Server
123
162
 
124
- fibx includes a built-in MCP server for AI editors like Cursor, Claude Desktop, and Antigravity. See [MCP.md](MCP.md) for setup and usage.
163
+ fibx includes a built-in [MCP](https://modelcontextprotocol.io) server for AI editors like Cursor, Claude Desktop, and Antigravity. See [MCP.md](MCP.md) for setup and available tools.
125
164
 
126
165
  ```bash
127
166
  npx fibx mcp-start
@@ -129,4 +168,15 @@ npx fibx mcp-start
129
168
 
130
169
  ### Agent Skills
131
170
 
132
- For prompt-based agent integration, see the [fibx-skills](https://github.com/Fibrous-Finance/fibx-skills) directory.
171
+ For prompt-based agent integration (Claude Code, Cursor, etc.), see the [fibx-skills](https://github.com/Fibrous-Finance/fibx-skills) repository.
172
+
173
+ ## Related Links
174
+
175
+ - [Fibrous Finance](https://fibrous.finance) — DEX aggregator powering swaps
176
+ - [fibx-server](https://github.com/ahmetenesdur/fibx-server) — Backend for Privy wallet operations
177
+ - [fibx-skills](https://github.com/Fibrous-Finance/fibx-skills) — AI agent skills
178
+ - [npm package](https://www.npmjs.com/package/fibx)
179
+
180
+ ## License
181
+
182
+ [MIT](https://opensource.org/licenses/MIT)
@@ -1 +1 @@
1
- {"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/import.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAOjG,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAmD1E"}
1
+ {"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/import.ts"],"names":[],"mappings":"AAAA,OAAO,EAKN,KAAK,aAAa,EAClB,MAAM,qBAAqB,CAAC;AAM7B,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CA8C1E"}
@@ -1,7 +1,6 @@
1
- import { outputResult, outputError, withSpinner } from "../../lib/format.js";
1
+ import { createSpinner, outputResult, formatError, warn, } from "../../lib/format.js";
2
2
  import { saveSession } from "../../services/auth/session.js";
3
3
  import { privateKeyToAccount } from "viem/accounts";
4
- import chalk from "chalk";
5
4
  import inquirer from "inquirer";
6
5
  export async function authImportCommand(opts) {
7
6
  try {
@@ -18,27 +17,28 @@ export async function authImportCommand(opts) {
18
17
  },
19
18
  },
20
19
  ]);
20
+ const spinner = createSpinner("Importing key...").start();
21
21
  const account = privateKeyToAccount(privateKey);
22
22
  const address = account.address;
23
- await withSpinner("Saving session...", async () => {
24
- saveSession({
25
- userId: "local-user",
26
- walletAddress: address,
27
- createdAt: new Date().toISOString(),
28
- type: "private-key",
29
- privateKey: privateKey,
30
- });
31
- }, opts);
23
+ saveSession({
24
+ userId: "local-user",
25
+ walletAddress: address,
26
+ createdAt: new Date().toISOString(),
27
+ type: "private-key",
28
+ privateKey: privateKey,
29
+ });
30
+ spinner.succeed("Private key imported");
32
31
  outputResult({
33
- message: "Private key imported successfully!",
34
32
  address: address,
35
33
  type: "private-key",
34
+ message: "You're ready to go!",
36
35
  }, opts);
37
- console.log(chalk.yellow("\n Security Warning: Your private key is stored locally in session.json."));
38
- console.log(chalk.yellow(" Make sure your machine is secure."));
36
+ console.log(warn("Your private key is stored locally in session.json."));
37
+ console.log(warn("Make sure your machine is secure."));
39
38
  }
40
39
  catch (error) {
41
- outputError(error, opts);
40
+ console.error(formatError(error));
41
+ process.exitCode = 1;
42
42
  }
43
43
  }
44
44
  //# sourceMappingURL=import.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"import.js","sourceRoot":"","sources":["../../../src/commands/auth/import.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAsB,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,IAAmB;IAC1D,IAAI,CAAC;QACJ,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;YAC5C;gBACC,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,YAAY;gBAClB,OAAO,EAAE,iCAAiC;gBAC1C,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE;oBAC3B,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;wBACxC,OAAO,sEAAsE,CAAC;oBAC/E,CAAC;oBACD,OAAO,IAAI,CAAC;gBACb,CAAC;aACD;SACD,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,mBAAmB,CAAC,UAA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AAqB,CAAC;AAEjG,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAcxF"}
1
+ {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGvE,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBxF"}
@@ -1,15 +1,13 @@
1
1
  import { apiLogin } from "../../services/api/client.js";
2
- import { outputResult, outputError, withSpinner } from "../../lib/format.js";
2
+ import { outputResult } from "../../lib/format.js";
3
+ import { runCommand } from "../../lib/cli-helpers.js";
3
4
  export async function authLoginCommand(email, opts) {
4
- try {
5
- await withSpinner("Sending OTP...", async () => apiLogin(email), opts);
6
- outputResult({
7
- email,
8
- message: `OTP sent to ${email}. Run: fibx auth verify ${email} <code>`,
9
- }, opts);
10
- }
11
- catch (error) {
12
- outputError(error, opts);
13
- }
5
+ await runCommand("Sending OTP...", "OTP sent", "Failed to send OTP", async () => {
6
+ await apiLogin(email);
7
+ return { email };
8
+ }, (data) => outputResult({
9
+ email: data.email,
10
+ message: `OTP sent to ${email}. Run: fibx auth verify ${email} <code>`,
11
+ }, opts));
14
12
  }
15
13
  //# sourceMappingURL=login.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAsB,MAAM,qBAAqB,CAAC;AAEjG,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,KAAa,EAAE,IAAmB;IACxE,IAAI,CAAC;QACJ,MAAM,WAAW,CAAC,gBAAgB,EAAE,KAAK,IAAI,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;QAEvE,YAAY,CACX;YACC,KAAK;YACL,OAAO,EAAE,eAAe,KAAK,2BAA2B,KAAK,SAAS;SACtE,EACD,IAAI,CACJ,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC1B,CAAC;AACF,CAAC"}
1
+ {"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,KAAa,EAAE,IAAmB;IACxE,MAAM,UAAU,CACf,gBAAgB,EAChB,UAAU,EACV,oBAAoB,EACpB,KAAK,IAAI,EAAE;QACV,MAAM,QAAQ,CAAC,KAAK,CAAC,CAAC;QACtB,OAAO,EAAE,KAAK,EAAE,CAAC;IAClB,CAAC,EACD,CAAC,IAAI,EAAE,EAAE,CACR,YAAY,CACX;QACC,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,OAAO,EAAE,eAAe,KAAK,2BAA2B,KAAK,SAAS;KACtE,EACD,IAAI,CACJ,CACF,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/logout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,eAAO,MAAM,aAAa,SAavB,CAAC"}
1
+ {"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/logout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,eAAO,MAAM,aAAa,SAYvB,CAAC"}
@@ -1,19 +1,11 @@
1
1
  import { Command } from "commander";
2
2
  import { clearSession } from "../../services/auth/session.js";
3
- import ora from "ora";
3
+ import { runCommand } from "../../lib/cli-helpers.js";
4
4
  export const logoutCommand = new Command("logout")
5
5
  .description("Log out and clear current session")
6
6
  .action(async () => {
7
- const spinner = ora("Logging out...").start();
8
- try {
7
+ await runCommand("Logging out...", "Logged out. Session cleared.", "Logout failed", async () => {
9
8
  clearSession();
10
- spinner.succeed("Logged out successfully. Session cleared.");
11
- }
12
- catch (error) {
13
- spinner.fail("Logout failed.");
14
- if (error instanceof Error) {
15
- console.error(error.message);
16
- }
17
- }
9
+ }, () => { });
18
10
  });
19
11
  //# sourceMappingURL=logout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logout.js","sourceRoot":"","sources":["../../../src/commands/auth/logout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAChD,WAAW,CAAC,mCAAmC,CAAC;KAChD,MAAM,CAAC,KAAK,IAAI,EAAE;IAClB,MAAM,OAAO,GAAG,GAAG,CAAC,gBAAgB,CAAC,CAAC,KAAK,EAAE,CAAC;IAC9C,IAAI,CAAC;QACJ,YAAY,EAAE,CAAC;QACf,OAAO,CAAC,OAAO,CAAC,2CAA2C,CAAC,CAAC;IAC9D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC/B,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC5B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC;AACF,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"logout.js","sourceRoot":"","sources":["../../../src/commands/auth/logout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAChD,WAAW,CAAC,mCAAmC,CAAC;KAChD,MAAM,CAAC,KAAK,IAAI,EAAE;IAClB,MAAM,UAAU,CACf,gBAAgB,EAChB,8BAA8B,EAC9B,eAAe,EACf,KAAK,IAAI,EAAE;QACV,YAAY,EAAE,CAAC;IAChB,CAAC,EACD,GAAG,EAAE,GAAE,CAAC,CACR,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/verify.ts"],"names":[],"mappings":"AAEA,OAAO,EAA0C,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEjG,wBAAsB,iBAAiB,CACtC,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,aAAa,GACjB,OAAO,CAAC,IAAI,CAAC,CAgCf"}
1
+ {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/verify.ts"],"names":[],"mappings":"AAEA,OAAO,EAA4C,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEnG,wBAAsB,iBAAiB,CACtC,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,aAAa,GACjB,OAAO,CAAC,IAAI,CAAC,CAgCf"}
@@ -1,12 +1,12 @@
1
1
  import { apiVerify } from "../../services/api/client.js";
2
2
  import { saveSession } from "../../services/auth/session.js";
3
- import { outputResult, outputError, withSpinner } from "../../lib/format.js";
3
+ import { createSpinner, outputResult, formatError } from "../../lib/format.js";
4
4
  export async function authVerifyCommand(email, code, opts) {
5
+ const spinner = createSpinner("Verifying OTP...").start();
5
6
  try {
6
- // 1. Verify OTP + provision wallet via backend
7
- const result = await withSpinner("Verifying OTP...", async () => apiVerify(email, code), opts);
8
- // 2. Save session locally (store backend JWT instead of Privy token)
9
- await saveSession({
7
+ const result = await apiVerify(email, code);
8
+ spinner.text = "Saving session...";
9
+ saveSession({
10
10
  userId: result.userId,
11
11
  walletId: result.walletId,
12
12
  walletAddress: result.walletAddress,
@@ -14,16 +14,17 @@ export async function authVerifyCommand(email, code, opts) {
14
14
  createdAt: new Date().toISOString(),
15
15
  type: "privy",
16
16
  });
17
+ spinner.succeed(result.isExisting ? "Existing wallet connected" : "New wallet created");
17
18
  outputResult({
18
19
  walletAddress: result.walletAddress,
19
20
  walletId: result.walletId,
20
- message: result.isExisting
21
- ? "Existing wallet found and connected. You're ready to go!"
22
- : "New wallet created and session saved. You're ready to go!",
21
+ message: "You're ready to go!",
23
22
  }, opts);
24
23
  }
25
24
  catch (error) {
26
- outputError(error, opts);
25
+ spinner.fail("Verification failed");
26
+ console.error(formatError(error));
27
+ process.exitCode = 1;
27
28
  }
28
29
  }
29
30
  //# sourceMappingURL=verify.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"verify.js","sourceRoot":"","sources":["../../../src/commands/auth/verify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAsB,MAAM,qBAAqB,CAAC;AAEjG,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACtC,KAAa,EACb,IAAY,EACZ,IAAmB;IAEnB,IAAI,CAAC;QACJ,+CAA+C;QAC/C,MAAM,MAAM,GAAG,MAAM,WAAW,CAC/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AAG,mBAAmB,CAAC;QAEnC,WAAW,CAAC;YACX,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,aAAa,EAAE,MAAM,CAAC,aAA8B;YACpD,OAAO,EAAE,MAAM,CAAC,KAAK;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,IAAI,EAAE,OAAO;SACb,CAAC,CAAC;QAEH,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC;QAExF,YAAY,CACX;YACC,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,OAAO,EAAE,qBAAqB;SAC9B,EACD,IAAI,CACJ,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QACpC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;QAClC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACtB,CAAC;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../src/commands/chain/transaction.ts"],"names":[],"mappings":"AAGA,OAAO,EAA0C,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEjG,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAoCtF"}
1
+ {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../src/commands/chain/transaction.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,KAAK,aAAa,EAAsB,MAAM,qBAAqB,CAAC;AAG3F,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAoCtF"}
@@ -1,31 +1,31 @@
1
1
  import { getPublicClient } from "../../services/chain/client.js";
2
2
  import { getChainConfig } from "../../services/chain/constants.js";
3
- import { outputResult, outputError, withSpinner } from "../../lib/format.js";
3
+ import { outputResult } from "../../lib/format.js";
4
+ import { runCommand } from "../../lib/cli-helpers.js";
4
5
  export async function txStatusCommand(hash, opts) {
5
- try {
6
+ await runCommand(`Fetching transaction ${hash.slice(0, 10)}...`, "Transaction fetched", "Failed to fetch transaction", async (spinner) => {
6
7
  const globalOpts = opts;
7
8
  const chainName = globalOpts.chain || "base";
8
9
  const chain = getChainConfig(chainName);
9
10
  const publicClient = getPublicClient(chain);
10
11
  const txHash = hash;
11
- const receipt = await withSpinner(`Fetching transaction status for ${hash}...`, async () => {
12
- return publicClient.waitForTransactionReceipt({ hash: txHash });
13
- }, opts);
12
+ spinner.text = "Waiting for receipt...";
13
+ const receipt = await publicClient.waitForTransactionReceipt({ hash: txHash });
14
+ spinner.text =
15
+ receipt.status === "success" ? "Transaction confirmed" : "Transaction reverted";
14
16
  const explorerLink = chain.viemChain.blockExplorers?.default.url
15
17
  ? `${chain.viemChain.blockExplorers.default.url}/tx/${hash}`
16
- : "N/A";
17
- outputResult({
18
+ : undefined;
19
+ return {
18
20
  status: receipt.status,
19
21
  blockNumber: receipt.blockNumber.toString(),
20
22
  gasUsed: receipt.gasUsed.toString(),
21
23
  from: receipt.from,
22
24
  to: receipt.to,
23
- explorerLink,
25
+ txHash: hash,
26
+ ...(explorerLink ? { explorer: explorerLink } : {}),
24
27
  chain: chain.name,
25
- }, opts);
26
- }
27
- catch (error) {
28
- outputError(error, opts);
29
- }
28
+ };
29
+ }, (data) => outputResult(data, opts));
30
30
  }
31
31
  //# sourceMappingURL=transaction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../src/commands/chain/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe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CAAC,GAAG,OAAO,IAAI,EAAE;YAC5D,CAAC,CAAC,SAAS,CAAC;QAEb,OAAO;YACN,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE;YAC3C,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE;YACnC,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,EAAE,EAAE,OAAO,CAAC,EAAE;YACd,MAAM,EAAE,IAAI;YACZ,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACnD,KAAK,EAAE,KAAK,CAAC,IAAI;SACjB,CAAC;IACH,CAAC,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAClC,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,QAkEtD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,QAwGtD"}
@@ -1,6 +1,8 @@
1
1
  import chalk from "chalk";
2
2
  import { configService } from "../../services/config/config.js";
3
3
  import { SUPPORTED_CHAINS } from "../../services/chain/constants.js";
4
+ import { success, warn, formatError } from "../../lib/format.js";
5
+ import { BLUE } from "../../lib/brand.js";
4
6
  export function registerConfigCommands(program) {
5
7
  const configCmd = program
6
8
  .command("config")
@@ -10,9 +12,10 @@ export function registerConfigCommands(program) {
10
12
  .description("Set a custom RPC URL for a specific chain")
11
13
  .argument("<chain>", "Chain name (base, citrea, hyperevm, monad)")
12
14
  .argument("<url>", "RPC URL")
15
+ .addHelpText("after", "\nExamples:\n $ fibx config set-rpc base https://my-rpc.example.com\n $ fibx config set-rpc monad https://rpc.monad.xyz")
13
16
  .action((chain, url) => {
14
17
  if (!SUPPORTED_CHAINS[chain]) {
15
- console.error(chalk.red(`Unsupported chain: ${chain}`));
18
+ console.error(formatError(new Error(`Unsupported chain: ${chain}`)));
16
19
  console.log(chalk.gray(`Supported chains: ${Object.keys(SUPPORTED_CHAINS).join(", ")}`));
17
20
  process.exit(1);
18
21
  }
@@ -20,11 +23,11 @@ export function registerConfigCommands(program) {
20
23
  new URL(url); // Validate URL format
21
24
  }
22
25
  catch {
23
- console.error(chalk.red("Invalid URL format."));
26
+ console.error(formatError(new Error("Invalid URL format.")));
24
27
  process.exit(1);
25
28
  }
26
29
  configService.setRpcUrl(chain, url);
27
- console.log(chalk.green(`Updated RPC for ${chain} to: ${url}`));
30
+ console.log(success(`Updated RPC for ${chain} to: ${url}`));
28
31
  });
29
32
  configCmd
30
33
  .command("get-rpc")
@@ -34,12 +37,12 @@ export function registerConfigCommands(program) {
34
37
  const customUrl = configService.getRpcUrl(chain);
35
38
  const defaultUrl = SUPPORTED_CHAINS[chain]?.rpcUrl;
36
39
  if (!defaultUrl) {
37
- console.error(chalk.red(`Unsupported chain: ${chain}`));
40
+ console.error(formatError(new Error(`Unsupported chain: ${chain}`)));
38
41
  process.exit(1);
39
42
  }
40
43
  if (customUrl) {
41
- console.log(chalk.bold("Current (Custom):"), chalk.cyan(customUrl));
42
- console.log(chalk.gray("Default:"), defaultUrl);
44
+ console.log(chalk.bold("Current (Custom):"), chalk.hex(BLUE)(customUrl));
45
+ console.log(chalk.gray("Default:"), chalk.dim(defaultUrl));
43
46
  }
44
47
  else {
45
48
  console.log(chalk.bold("Current (Default):"), defaultUrl);
@@ -50,16 +53,45 @@ export function registerConfigCommands(program) {
50
53
  .description("List all configuration")
51
54
  .action(() => {
52
55
  const config = configService.getConfig();
53
- console.log(chalk.bold("\nCustom RPCs:"));
56
+ console.log(chalk.bold.hex(BLUE)("\n Custom RPCs"));
54
57
  if (Object.keys(config.rpcUrls).length === 0) {
55
58
  console.log(chalk.gray(" (None set)"));
56
59
  }
57
60
  else {
58
61
  for (const [chain, url] of Object.entries(config.rpcUrls)) {
59
- console.log(` ${chalk.bold(chain)}: ${chalk.cyan(url)}`);
62
+ console.log(` ${chalk.white(chain.padEnd(12))} ${chalk.hex(BLUE)(url)}`);
60
63
  }
61
64
  }
62
65
  console.log("");
63
66
  });
67
+ configCmd
68
+ .command("reset-rpc")
69
+ .description("Reset custom RPC URL(s) to default")
70
+ .argument("[chain]", "Chain name (omit to reset all)")
71
+ .action((chain) => {
72
+ if (chain) {
73
+ if (!SUPPORTED_CHAINS[chain]) {
74
+ console.error(formatError(new Error(`Unsupported chain: ${chain}`)));
75
+ console.log(chalk.gray(`Supported chains: ${Object.keys(SUPPORTED_CHAINS).join(", ")}`));
76
+ process.exit(1);
77
+ }
78
+ const currentUrl = configService.getRpcUrl(chain);
79
+ if (!currentUrl) {
80
+ console.log(warn(`No custom RPC set for ${chain}. Already using default.`));
81
+ return;
82
+ }
83
+ configService.resetRpcUrl(chain);
84
+ console.log(success(`Reset RPC for ${chain} to default.`));
85
+ }
86
+ else {
87
+ const config = configService.getConfig();
88
+ if (Object.keys(config.rpcUrls).length === 0) {
89
+ console.log(warn("No custom RPCs set. Already using defaults."));
90
+ return;
91
+ }
92
+ configService.resetAll();
93
+ console.log(success("All custom RPC URLs have been reset to defaults."));
94
+ }
95
+ });
64
96
  }
65
97
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/config/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAA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AC;YAED,aAAa,CAAC,QAAQ,EAAE,CAAC;YACzB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,kDAAkD,CAAC,CAAC,CAAC;QAC1E,CAAC;IACF,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,6 +1,7 @@
1
1
  interface GlobalOptions {
2
2
  json?: boolean;
3
3
  chain?: string;
4
+ simulate?: boolean;
4
5
  }
5
6
  export declare const aaveCommand: (action: string, amount: string, tokenSymbol: string, opts: GlobalOptions) => Promise<void>;
6
7
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"aave.d.ts","sourceRoot":"","sources":["../../../src/commands/defi/aave.ts"],"names":[],"mappings":"AAYA,UAAU,aAAa;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAID,eAAO,MAAM,WAAW,GACvB,QAAQ,MAAM,EACd,QAAQ,MAAM,EACd,aAAa,MAAM,EACnB,MAAM,aAAa,kBA8FnB,CAAC"}
1
+ {"version":3,"file":"aave.d.ts","sourceRoot":"","sources":["../../../src/commands/defi/aave.ts"],"names":[],"mappings":"AAYA,UAAU,aAAa;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAID,eAAO,MAAM,WAAW,GACvB,QAAQ,MAAM,EACd,QAAQ,MAAM,EACd,aAAa,MAAM,EACnB,MAAM,aAAa,kBAmGnB,CAAC"}