fibx 0.5.1 → 0.7.0
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/README.md +73 -2
- package/dist/index.js +277 -292
- package/dist/index.js.map +1 -1
- package/package.json +13 -14
- package/dist/commands/auth/import.d.ts +0 -3
- package/dist/commands/auth/import.d.ts.map +0 -1
- package/dist/commands/auth/import.js +0 -44
- package/dist/commands/auth/import.js.map +0 -1
- package/dist/commands/auth/login.d.ts +0 -3
- package/dist/commands/auth/login.d.ts.map +0 -1
- package/dist/commands/auth/login.js +0 -13
- package/dist/commands/auth/login.js.map +0 -1
- package/dist/commands/auth/logout.d.ts +0 -3
- package/dist/commands/auth/logout.d.ts.map +0 -1
- package/dist/commands/auth/logout.js +0 -11
- package/dist/commands/auth/logout.js.map +0 -1
- package/dist/commands/auth/verify.d.ts +0 -3
- package/dist/commands/auth/verify.d.ts.map +0 -1
- package/dist/commands/auth/verify.js +0 -30
- package/dist/commands/auth/verify.js.map +0 -1
- package/dist/commands/chain/transaction.d.ts +0 -3
- package/dist/commands/chain/transaction.d.ts.map +0 -1
- package/dist/commands/chain/transaction.js +0 -31
- package/dist/commands/chain/transaction.js.map +0 -1
- package/dist/commands/config/index.d.ts +0 -3
- package/dist/commands/config/index.d.ts.map +0 -1
- package/dist/commands/config/index.js +0 -97
- package/dist/commands/config/index.js.map +0 -1
- package/dist/commands/defi/aave.d.ts +0 -8
- package/dist/commands/defi/aave.d.ts.map +0 -1
- package/dist/commands/defi/aave.js +0 -238
- package/dist/commands/defi/aave.js.map +0 -1
- package/dist/commands/portfolio/index.d.ts +0 -3
- package/dist/commands/portfolio/index.d.ts.map +0 -1
- package/dist/commands/portfolio/index.js +0 -64
- package/dist/commands/portfolio/index.js.map +0 -1
- package/dist/commands/trade/status.d.ts +0 -3
- package/dist/commands/trade/status.d.ts.map +0 -1
- package/dist/commands/trade/status.js +0 -30
- package/dist/commands/trade/status.js.map +0 -1
- package/dist/commands/trade/swap.d.ts +0 -9
- package/dist/commands/trade/swap.d.ts.map +0 -1
- package/dist/commands/trade/swap.js +0 -205
- package/dist/commands/trade/swap.js.map +0 -1
- package/dist/commands/wallet/address.d.ts +0 -3
- package/dist/commands/wallet/address.d.ts.map +0 -1
- package/dist/commands/wallet/address.js +0 -13
- package/dist/commands/wallet/address.js.map +0 -1
- package/dist/commands/wallet/balance.d.ts +0 -3
- package/dist/commands/wallet/balance.d.ts.map +0 -1
- package/dist/commands/wallet/balance.js +0 -73
- package/dist/commands/wallet/balance.js.map +0 -1
- package/dist/commands/wallet/list.d.ts +0 -3
- package/dist/commands/wallet/list.d.ts.map +0 -1
- package/dist/commands/wallet/list.js +0 -22
- package/dist/commands/wallet/list.js.map +0 -1
- package/dist/commands/wallet/send.d.ts +0 -7
- package/dist/commands/wallet/send.d.ts.map +0 -1
- package/dist/commands/wallet/send.js +0 -115
- package/dist/commands/wallet/send.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/lib/brand.d.ts +0 -5
- package/dist/lib/brand.d.ts.map +0 -1
- package/dist/lib/brand.js +0 -15
- package/dist/lib/brand.js.map +0 -1
- package/dist/lib/cache.d.ts +0 -3
- package/dist/lib/cache.d.ts.map +0 -1
- package/dist/lib/cache.js +0 -23
- package/dist/lib/cache.js.map +0 -1
- package/dist/lib/cli-helpers.d.ts +0 -10
- package/dist/lib/cli-helpers.d.ts.map +0 -1
- package/dist/lib/cli-helpers.js +0 -20
- package/dist/lib/cli-helpers.js.map +0 -1
- package/dist/lib/concurrency.d.ts +0 -8
- package/dist/lib/concurrency.d.ts.map +0 -1
- package/dist/lib/concurrency.js +0 -26
- package/dist/lib/concurrency.js.map +0 -1
- package/dist/lib/config.d.ts +0 -7
- package/dist/lib/config.d.ts.map +0 -1
- package/dist/lib/config.js +0 -9
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/errors.d.ts +0 -28
- package/dist/lib/errors.d.ts.map +0 -1
- package/dist/lib/errors.js +0 -33
- package/dist/lib/errors.js.map +0 -1
- package/dist/lib/format.d.ts +0 -31
- package/dist/lib/format.d.ts.map +0 -1
- package/dist/lib/format.js +0 -169
- package/dist/lib/format.js.map +0 -1
- package/dist/lib/parse-evm-error.d.ts +0 -6
- package/dist/lib/parse-evm-error.d.ts.map +0 -1
- package/dist/lib/parse-evm-error.js +0 -48
- package/dist/lib/parse-evm-error.js.map +0 -1
- package/dist/lib/parseAmount.d.ts +0 -3
- package/dist/lib/parseAmount.d.ts.map +0 -1
- package/dist/lib/parseAmount.js +0 -9
- package/dist/lib/parseAmount.js.map +0 -1
- package/dist/lib/retry.d.ts +0 -20
- package/dist/lib/retry.d.ts.map +0 -1
- package/dist/lib/retry.js +0 -36
- package/dist/lib/retry.js.map +0 -1
- package/dist/lib/validation.d.ts +0 -6
- package/dist/lib/validation.d.ts.map +0 -1
- package/dist/lib/validation.js +0 -24
- package/dist/lib/validation.js.map +0 -1
- package/dist/mcp/handlers.d.ts +0 -87
- package/dist/mcp/handlers.d.ts.map +0 -1
- package/dist/mcp/handlers.js +0 -394
- package/dist/mcp/handlers.js.map +0 -1
- package/dist/mcp/server.d.ts +0 -2
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js +0 -21
- package/dist/mcp/server.js.map +0 -1
- package/dist/mcp/tools.d.ts +0 -3
- package/dist/mcp/tools.d.ts.map +0 -1
- package/dist/mcp/tools.js +0 -227
- package/dist/mcp/tools.js.map +0 -1
- package/dist/services/api/client.d.ts +0 -34
- package/dist/services/api/client.d.ts.map +0 -1
- package/dist/services/api/client.js +0 -68
- package/dist/services/api/client.js.map +0 -1
- package/dist/services/auth/policy.d.ts +0 -2
- package/dist/services/auth/policy.d.ts.map +0 -1
- package/dist/services/auth/policy.js +0 -3
- package/dist/services/auth/policy.js.map +0 -1
- package/dist/services/auth/session.d.ts +0 -20
- package/dist/services/auth/session.d.ts.map +0 -1
- package/dist/services/auth/session.js +0 -70
- package/dist/services/auth/session.js.map +0 -1
- package/dist/services/chain/client.d.ts +0 -17493
- package/dist/services/chain/client.d.ts.map +0 -1
- package/dist/services/chain/client.js +0 -30
- package/dist/services/chain/client.js.map +0 -1
- package/dist/services/chain/constants.d.ts +0 -163
- package/dist/services/chain/constants.d.ts.map +0 -1
- package/dist/services/chain/constants.js +0 -118
- package/dist/services/chain/constants.js.map +0 -1
- package/dist/services/chain/erc20.d.ts +0 -100
- package/dist/services/chain/erc20.d.ts.map +0 -1
- package/dist/services/chain/erc20.js +0 -117
- package/dist/services/chain/erc20.js.map +0 -1
- package/dist/services/chain/nonceManager.d.ts +0 -13
- package/dist/services/chain/nonceManager.d.ts.map +0 -1
- package/dist/services/chain/nonceManager.js +0 -45
- package/dist/services/chain/nonceManager.js.map +0 -1
- package/dist/services/config/config.d.ts +0 -20
- package/dist/services/config/config.d.ts.map +0 -1
- package/dist/services/config/config.js +0 -75
- package/dist/services/config/config.js.map +0 -1
- package/dist/services/defi/aave.d.ts +0 -50
- package/dist/services/defi/aave.d.ts.map +0 -1
- package/dist/services/defi/aave.js +0 -605
- package/dist/services/defi/aave.js.map +0 -1
- package/dist/services/defi/abi/aave.d.ts +0 -304
- package/dist/services/defi/abi/aave.d.ts.map +0 -1
- package/dist/services/defi/abi/aave.js +0 -194
- package/dist/services/defi/abi/aave.js.map +0 -1
- package/dist/services/defi/constants.d.ts +0 -11
- package/dist/services/defi/constants.d.ts.map +0 -1
- package/dist/services/defi/constants.js +0 -12
- package/dist/services/defi/constants.js.map +0 -1
- package/dist/services/fibrous/abi/base.d.ts +0 -768
- package/dist/services/fibrous/abi/base.d.ts.map +0 -1
- package/dist/services/fibrous/abi/base.js +0 -984
- package/dist/services/fibrous/abi/base.js.map +0 -1
- package/dist/services/fibrous/abi/citrea.d.ts +0 -773
- package/dist/services/fibrous/abi/citrea.d.ts.map +0 -1
- package/dist/services/fibrous/abi/citrea.js +0 -990
- package/dist/services/fibrous/abi/citrea.js.map +0 -1
- package/dist/services/fibrous/abi/hyperevm.d.ts +0 -773
- package/dist/services/fibrous/abi/hyperevm.d.ts.map +0 -1
- package/dist/services/fibrous/abi/hyperevm.js +0 -990
- package/dist/services/fibrous/abi/hyperevm.js.map +0 -1
- package/dist/services/fibrous/abi/monad.d.ts +0 -773
- package/dist/services/fibrous/abi/monad.d.ts.map +0 -1
- package/dist/services/fibrous/abi/monad.js +0 -990
- package/dist/services/fibrous/abi/monad.js.map +0 -1
- package/dist/services/fibrous/balances.d.ts +0 -15
- package/dist/services/fibrous/balances.d.ts.map +0 -1
- package/dist/services/fibrous/balances.js +0 -27
- package/dist/services/fibrous/balances.js.map +0 -1
- package/dist/services/fibrous/health.d.ts +0 -12
- package/dist/services/fibrous/health.d.ts.map +0 -1
- package/dist/services/fibrous/health.js +0 -16
- package/dist/services/fibrous/health.js.map +0 -1
- package/dist/services/fibrous/route.d.ts +0 -48
- package/dist/services/fibrous/route.d.ts.map +0 -1
- package/dist/services/fibrous/route.js +0 -65
- package/dist/services/fibrous/route.js.map +0 -1
- package/dist/services/fibrous/tokens.d.ts +0 -12
- package/dist/services/fibrous/tokens.d.ts.map +0 -1
- package/dist/services/fibrous/tokens.js +0 -38
- package/dist/services/fibrous/tokens.js.map +0 -1
- package/dist/services/portfolio/portfolio.d.ts +0 -28
- package/dist/services/portfolio/portfolio.d.ts.map +0 -1
- package/dist/services/portfolio/portfolio.js +0 -116
- package/dist/services/portfolio/portfolio.js.map +0 -1
- package/dist/services/privy/account.d.ts +0 -20
- package/dist/services/privy/account.d.ts.map +0 -1
- package/dist/services/privy/account.js +0 -60
- package/dist/services/privy/account.js.map +0 -1
- package/dist/services/privy/client.d.ts +0 -2
- package/dist/services/privy/client.d.ts.map +0 -1
- package/dist/services/privy/client.js +0 -7
- package/dist/services/privy/client.js.map +0 -1
package/README.md
CHANGED
|
@@ -11,13 +11,14 @@ A command-line tool for DeFi operations on **Base, Citrea, HyperEVM, and Monad**
|
|
|
11
11
|
- **Token Swaps**: Optimal routing via Fibrous aggregation with auto-slippage
|
|
12
12
|
- **Transfers**: Send ETH or any ERC-20 token
|
|
13
13
|
- **Aave V3**: Supply, borrow, repay, withdraw, and browse markets on Base
|
|
14
|
-
- **MCP Server**: Built-in AI agent integration for Cursor, Claude Desktop, and Antigravity
|
|
14
|
+
- **MCP Server**: Built-in AI agent integration for Cursor, Claude Desktop, and Antigravity (11 tools, 4 categories)
|
|
15
15
|
- **Agent Skills**: Prompt-based AI skills via [fibx-skills](https://github.com/Fibrous-Finance/fibx-skills)
|
|
16
16
|
- **Privy Server Wallets**: Secure server-side signing — private keys never leave Privy's TEE
|
|
17
|
-
- **Private Key Import**: Use an existing wallet
|
|
17
|
+
- **Private Key Import**: Use an existing wallet with AES-256-GCM encrypted local storage
|
|
18
18
|
- **Simulation**: All transactions are simulated before execution
|
|
19
19
|
- **Dry‑Run Mode**: `--simulate` flag estimates gas without sending a transaction
|
|
20
20
|
- **JSON Output**: `--json` flag for scripting and pipelines
|
|
21
|
+
- **Zero-Dependency Install**: Single-file bundle via tsup — `npx fibx` runs near-instantly
|
|
21
22
|
|
|
22
23
|
## Supported Chains
|
|
23
24
|
|
|
@@ -47,6 +48,42 @@ npm install -g fibx
|
|
|
47
48
|
- Node.js >= 18
|
|
48
49
|
- A running [fibx-server](https://github.com/ahmetenesdur/fibx-server) instance (required for Privy wallet operations; not needed for private key imports)
|
|
49
50
|
|
|
51
|
+
## Quick Start — First Swap in 3 Minutes
|
|
52
|
+
|
|
53
|
+
### Step 1: Get a Price Quote (no auth needed)
|
|
54
|
+
|
|
55
|
+
Try FibX instantly — no sign-up, no wallet, no keys:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx fibx quote 0.01 ETH USDC # Check price on Base
|
|
59
|
+
npx fibx quote 100 USDC DAI --chain base # Compare pairs
|
|
60
|
+
npx fibx quote 0.5 MON USDC --chain monad # Check Monad prices
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Step 2: Authenticate (pick one)
|
|
64
|
+
|
|
65
|
+
**Option A — Email Login** (Privy Server Wallet, no keys to manage):
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npx fibx auth login you@email.com # Sends OTP to your email
|
|
69
|
+
npx fibx auth verify you@email.com 123456 # Verify & create wallet
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Option B — Import Private Key** (use an existing wallet):
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npx fibx auth import # Paste your key (encrypted at rest)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Step 3: Execute
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npx fibx trade 0.01 ETH USDC # Execute the swap
|
|
82
|
+
npx fibx balance # Check your balances
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
That's it. Three steps from zero to first swap.
|
|
86
|
+
|
|
50
87
|
## Usage
|
|
51
88
|
|
|
52
89
|
### Authentication
|
|
@@ -66,6 +103,8 @@ npx fibx status
|
|
|
66
103
|
npx fibx auth logout
|
|
67
104
|
```
|
|
68
105
|
|
|
106
|
+
> **Security:** When using `auth import`, your private key is encrypted at rest with AES-256-GCM. The encryption key is auto-generated per machine and stored in the OS config directory (e.g. `~/.config/fibx-nodejs/encryption-key` on Linux). You can also set the `FIBX_SESSION_SECRET` environment variable for CI/Docker environments.
|
|
107
|
+
|
|
69
108
|
### Global Options
|
|
70
109
|
|
|
71
110
|
| Option | Description | Default |
|
|
@@ -100,6 +139,18 @@ npx fibx send 1 0xRecipient --chain monad # Send MON on Monad
|
|
|
100
139
|
npx fibx send 0.1 0xRecipient --simulate # Estimate gas without sending
|
|
101
140
|
```
|
|
102
141
|
|
|
142
|
+
### Quote
|
|
143
|
+
|
|
144
|
+
Get swap prices without authentication:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
npx fibx quote 0.01 ETH USDC # Price check on Base
|
|
148
|
+
npx fibx quote 100 USDC DAI --chain monad # Compare pairs
|
|
149
|
+
npx fibx quote 0.1 ETH USDC --json # JSON output for scripts
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
> **No wallet or authentication required.** Use `quote` to explore prices, then `trade` to execute.
|
|
153
|
+
|
|
103
154
|
### Swap
|
|
104
155
|
|
|
105
156
|
```bash
|
|
@@ -156,6 +207,8 @@ npx fibx config reset-rpc # Reset all chains to default
|
|
|
156
207
|
npx fibx config list
|
|
157
208
|
```
|
|
158
209
|
|
|
210
|
+
> **Hot-reload:** Config changes are picked up automatically — no need to restart the CLI or MCP server.
|
|
211
|
+
|
|
159
212
|
## AI Agent Integration
|
|
160
213
|
|
|
161
214
|
### MCP Server
|
|
@@ -166,10 +219,28 @@ fibx includes a built-in [MCP](https://modelcontextprotocol.io) server for AI ed
|
|
|
166
219
|
npx fibx mcp-start
|
|
167
220
|
```
|
|
168
221
|
|
|
222
|
+
The MCP server exposes **11 tools** across 4 categories (Auth & Config, Wallet & Portfolio, Trading, DeFi). All write operations support a `simulate=true` parameter for fee estimation without execution.
|
|
223
|
+
|
|
169
224
|
### Agent Skills
|
|
170
225
|
|
|
171
226
|
For prompt-based agent integration (Claude Code, Cursor, etc.), see the [fibx-skills](https://github.com/Fibrous-Finance/fibx-skills) repository.
|
|
172
227
|
|
|
228
|
+
## Architecture
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
fibx/
|
|
232
|
+
├── src/ # CLI + MCP server (single tsup bundle)
|
|
233
|
+
│ ├── commands/ # CLI commands (auth, trade, send, aave, config)
|
|
234
|
+
│ ├── mcp/ # Modular MCP server
|
|
235
|
+
│ │ ├── server.ts # Entry point + MCP_INSTRUCTIONS
|
|
236
|
+
│ │ ├── tools/ # Tool registrations (auth, wallet, trade, defi)
|
|
237
|
+
│ │ └── handlers/ # Tool implementations + context helpers
|
|
238
|
+
│ ├── services/ # Business logic (chain, fibrous, auth, defi)
|
|
239
|
+
│ └── lib/ # Shared utilities (errors, fetch, format, crypto)
|
|
240
|
+
├── fibx-server/ # Privy wallet backend (Hono)
|
|
241
|
+
└── fibx-telegram-bot/ # AI-powered Telegram bot
|
|
242
|
+
```
|
|
243
|
+
|
|
173
244
|
## Related Links
|
|
174
245
|
|
|
175
246
|
- [Fibrous Finance](https://fibrous.finance) — DEX aggregator powering swaps
|