starkfi 0.1.0 → 0.3.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.
Files changed (240) hide show
  1. package/LICENSE +1 -1
  2. package/MCP.md +292 -0
  3. package/README.md +424 -54
  4. package/dist/commands/auth/login.js +2 -2
  5. package/dist/commands/auth/login.js.map +1 -1
  6. package/dist/commands/auth/verify.d.ts.map +1 -1
  7. package/dist/commands/auth/verify.js +2 -2
  8. package/dist/commands/auth/verify.js.map +1 -1
  9. package/dist/commands/batch/batch.d.ts +3 -0
  10. package/dist/commands/batch/batch.d.ts.map +1 -0
  11. package/dist/commands/batch/batch.js +155 -0
  12. package/dist/commands/batch/batch.js.map +1 -0
  13. package/dist/commands/chain/tx-status.js +2 -2
  14. package/dist/commands/chain/tx-status.js.map +1 -1
  15. package/dist/commands/config/config.d.ts.map +1 -1
  16. package/dist/commands/config/config.js +23 -34
  17. package/dist/commands/config/config.js.map +1 -1
  18. package/dist/commands/lending/lending.d.ts +1 -0
  19. package/dist/commands/lending/lending.d.ts.map +1 -1
  20. package/dist/commands/lending/lending.js +197 -51
  21. package/dist/commands/lending/lending.js.map +1 -1
  22. package/dist/commands/portfolio/portfolio.d.ts +3 -0
  23. package/dist/commands/portfolio/portfolio.d.ts.map +1 -0
  24. package/dist/commands/portfolio/portfolio.js +76 -0
  25. package/dist/commands/portfolio/portfolio.js.map +1 -0
  26. package/dist/commands/staking/staking.d.ts +1 -1
  27. package/dist/commands/staking/staking.d.ts.map +1 -1
  28. package/dist/commands/staking/staking.js +144 -61
  29. package/dist/commands/staking/staking.js.map +1 -1
  30. package/dist/commands/trade/multi-swap.d.ts +3 -0
  31. package/dist/commands/trade/multi-swap.d.ts.map +1 -0
  32. package/dist/commands/trade/multi-swap.js +141 -0
  33. package/dist/commands/trade/multi-swap.js.map +1 -0
  34. package/dist/commands/trade/status.js +2 -2
  35. package/dist/commands/trade/status.js.map +1 -1
  36. package/dist/commands/trade/swap.d.ts.map +1 -1
  37. package/dist/commands/trade/swap.js +48 -12
  38. package/dist/commands/trade/swap.js.map +1 -1
  39. package/dist/commands/wallet/balance.d.ts.map +1 -1
  40. package/dist/commands/wallet/balance.js +20 -3
  41. package/dist/commands/wallet/balance.js.map +1 -1
  42. package/dist/commands/wallet/deploy.d.ts.map +1 -1
  43. package/dist/commands/wallet/deploy.js +2 -1
  44. package/dist/commands/wallet/deploy.js.map +1 -1
  45. package/dist/commands/wallet/send.d.ts.map +1 -1
  46. package/dist/commands/wallet/send.js +46 -9
  47. package/dist/commands/wallet/send.js.map +1 -1
  48. package/dist/index.js +162 -9
  49. package/dist/index.js.map +1 -1
  50. package/dist/lib/banner.d.ts +6 -0
  51. package/dist/lib/banner.d.ts.map +1 -0
  52. package/dist/lib/banner.js +78 -0
  53. package/dist/lib/banner.js.map +1 -0
  54. package/dist/lib/concurrency.d.ts +2 -0
  55. package/dist/lib/concurrency.d.ts.map +1 -0
  56. package/dist/lib/concurrency.js +21 -0
  57. package/dist/lib/concurrency.js.map +1 -0
  58. package/dist/lib/config.d.ts +0 -11
  59. package/dist/lib/config.d.ts.map +1 -1
  60. package/dist/lib/config.js +0 -20
  61. package/dist/lib/config.js.map +1 -1
  62. package/dist/lib/errors.d.ts +2 -0
  63. package/dist/lib/errors.d.ts.map +1 -1
  64. package/dist/lib/errors.js +2 -0
  65. package/dist/lib/errors.js.map +1 -1
  66. package/dist/lib/fetch.d.ts +4 -0
  67. package/dist/lib/fetch.d.ts.map +1 -0
  68. package/dist/lib/fetch.js +13 -0
  69. package/dist/lib/fetch.js.map +1 -0
  70. package/dist/lib/format.d.ts +12 -2
  71. package/dist/lib/format.d.ts.map +1 -1
  72. package/dist/lib/format.js +86 -23
  73. package/dist/lib/format.js.map +1 -1
  74. package/dist/lib/retry.d.ts +8 -0
  75. package/dist/lib/retry.d.ts.map +1 -0
  76. package/dist/lib/retry.js +25 -0
  77. package/dist/lib/retry.js.map +1 -0
  78. package/dist/lib/types.d.ts +6 -0
  79. package/dist/lib/types.d.ts.map +1 -0
  80. package/dist/lib/types.js +2 -0
  81. package/dist/lib/types.js.map +1 -0
  82. package/dist/lib/validation.d.ts +0 -12
  83. package/dist/lib/validation.d.ts.map +1 -1
  84. package/dist/lib/validation.js +1 -23
  85. package/dist/lib/validation.js.map +1 -1
  86. package/dist/mcp/handlers/batch.d.ts +13 -0
  87. package/dist/mcp/handlers/batch.d.ts.map +1 -0
  88. package/dist/mcp/handlers/batch.js +33 -0
  89. package/dist/mcp/handlers/batch.js.map +1 -0
  90. package/dist/mcp/handlers/config.d.ts +1 -1
  91. package/dist/mcp/handlers/config.d.ts.map +1 -1
  92. package/dist/mcp/handlers/config.js +11 -12
  93. package/dist/mcp/handlers/config.js.map +1 -1
  94. package/dist/mcp/handlers/index.d.ts +3 -0
  95. package/dist/mcp/handlers/index.d.ts.map +1 -1
  96. package/dist/mcp/handlers/index.js +3 -0
  97. package/dist/mcp/handlers/index.js.map +1 -1
  98. package/dist/mcp/handlers/lending.d.ts +12 -1
  99. package/dist/mcp/handlers/lending.d.ts.map +1 -1
  100. package/dist/mcp/handlers/lending.js +67 -23
  101. package/dist/mcp/handlers/lending.js.map +1 -1
  102. package/dist/mcp/handlers/multi-swap.d.ts +27 -0
  103. package/dist/mcp/handlers/multi-swap.d.ts.map +1 -0
  104. package/dist/mcp/handlers/multi-swap.js +73 -0
  105. package/dist/mcp/handlers/multi-swap.js.map +1 -0
  106. package/dist/mcp/handlers/portfolio.d.ts +7 -0
  107. package/dist/mcp/handlers/portfolio.d.ts.map +1 -0
  108. package/dist/mcp/handlers/portfolio.js +11 -0
  109. package/dist/mcp/handlers/portfolio.js.map +1 -0
  110. package/dist/mcp/handlers/staking.d.ts +13 -1
  111. package/dist/mcp/handlers/staking.d.ts.map +1 -1
  112. package/dist/mcp/handlers/staking.js +18 -5
  113. package/dist/mcp/handlers/staking.js.map +1 -1
  114. package/dist/mcp/handlers/trade.d.ts +1 -0
  115. package/dist/mcp/handlers/trade.d.ts.map +1 -1
  116. package/dist/mcp/handlers/trade.js +27 -13
  117. package/dist/mcp/handlers/trade.js.map +1 -1
  118. package/dist/mcp/handlers/wallet.d.ts +1 -0
  119. package/dist/mcp/handlers/wallet.d.ts.map +1 -1
  120. package/dist/mcp/handlers/wallet.js +24 -5
  121. package/dist/mcp/handlers/wallet.js.map +1 -1
  122. package/dist/mcp/server.d.ts.map +1 -1
  123. package/dist/mcp/server.js +45 -4
  124. package/dist/mcp/server.js.map +1 -1
  125. package/dist/mcp/tools/auth.d.ts +3 -0
  126. package/dist/mcp/tools/auth.d.ts.map +1 -0
  127. package/dist/mcp/tools/auth.js +17 -0
  128. package/dist/mcp/tools/auth.js.map +1 -0
  129. package/dist/mcp/tools/error-handling.d.ts +12 -0
  130. package/dist/mcp/tools/error-handling.d.ts.map +1 -0
  131. package/dist/mcp/tools/error-handling.js +28 -0
  132. package/dist/mcp/tools/error-handling.js.map +1 -0
  133. package/dist/mcp/tools/index.d.ts +11 -0
  134. package/dist/mcp/tools/index.d.ts.map +1 -0
  135. package/dist/mcp/tools/index.js +19 -0
  136. package/dist/mcp/tools/index.js.map +1 -0
  137. package/dist/mcp/tools/lending.d.ts +3 -0
  138. package/dist/mcp/tools/lending.d.ts.map +1 -0
  139. package/dist/mcp/tools/lending.js +71 -0
  140. package/dist/mcp/tools/lending.js.map +1 -0
  141. package/dist/mcp/tools/staking.d.ts +3 -0
  142. package/dist/mcp/tools/staking.d.ts.map +1 -0
  143. package/dist/mcp/tools/staking.js +50 -0
  144. package/dist/mcp/tools/staking.js.map +1 -0
  145. package/dist/mcp/tools/trade.d.ts +3 -0
  146. package/dist/mcp/tools/trade.d.ts.map +1 -0
  147. package/dist/mcp/tools/trade.js +63 -0
  148. package/dist/mcp/tools/trade.js.map +1 -0
  149. package/dist/mcp/tools/wallet.d.ts +3 -0
  150. package/dist/mcp/tools/wallet.d.ts.map +1 -0
  151. package/dist/mcp/tools/wallet.js +27 -0
  152. package/dist/mcp/tools/wallet.js.map +1 -0
  153. package/dist/mcp/tools.d.ts.map +1 -1
  154. package/dist/mcp/tools.js +125 -41
  155. package/dist/mcp/tools.js.map +1 -1
  156. package/dist/services/api/client.d.ts +0 -12
  157. package/dist/services/api/client.d.ts.map +1 -1
  158. package/dist/services/api/client.js +7 -16
  159. package/dist/services/api/client.js.map +1 -1
  160. package/dist/services/auth/session.d.ts +1 -7
  161. package/dist/services/auth/session.d.ts.map +1 -1
  162. package/dist/services/auth/session.js +21 -0
  163. package/dist/services/auth/session.js.map +1 -1
  164. package/dist/services/batch/batch.d.ts +35 -0
  165. package/dist/services/batch/batch.d.ts.map +1 -0
  166. package/dist/services/batch/batch.js +110 -0
  167. package/dist/services/batch/batch.js.map +1 -0
  168. package/dist/services/config/config.d.ts +3 -0
  169. package/dist/services/config/config.d.ts.map +1 -1
  170. package/dist/services/config/config.js +30 -1
  171. package/dist/services/config/config.js.map +1 -1
  172. package/dist/services/fibrous/config.d.ts +4 -0
  173. package/dist/services/fibrous/config.d.ts.map +1 -0
  174. package/dist/services/fibrous/config.js +4 -0
  175. package/dist/services/fibrous/config.js.map +1 -0
  176. package/dist/services/fibrous/health.js +1 -1
  177. package/dist/services/fibrous/health.js.map +1 -1
  178. package/dist/services/fibrous/route.d.ts +15 -6
  179. package/dist/services/fibrous/route.d.ts.map +1 -1
  180. package/dist/services/fibrous/route.js +64 -3
  181. package/dist/services/fibrous/route.js.map +1 -1
  182. package/dist/services/portfolio/portfolio.d.ts +31 -0
  183. package/dist/services/portfolio/portfolio.d.ts.map +1 -0
  184. package/dist/services/portfolio/portfolio.js +104 -0
  185. package/dist/services/portfolio/portfolio.js.map +1 -0
  186. package/dist/services/simulate/simulate.d.ts +10 -0
  187. package/dist/services/simulate/simulate.d.ts.map +1 -0
  188. package/dist/services/simulate/simulate.js +57 -0
  189. package/dist/services/simulate/simulate.js.map +1 -0
  190. package/dist/services/staking/staking.d.ts +9 -30
  191. package/dist/services/staking/staking.d.ts.map +1 -1
  192. package/dist/services/staking/staking.js +44 -52
  193. package/dist/services/staking/staking.js.map +1 -1
  194. package/dist/services/starkzap/client.d.ts +2 -1
  195. package/dist/services/starkzap/client.d.ts.map +1 -1
  196. package/dist/services/starkzap/client.js +39 -21
  197. package/dist/services/starkzap/client.js.map +1 -1
  198. package/dist/services/starkzap/config.d.ts +6 -0
  199. package/dist/services/starkzap/config.d.ts.map +1 -0
  200. package/dist/services/starkzap/config.js +13 -0
  201. package/dist/services/starkzap/config.js.map +1 -0
  202. package/dist/services/tokens/balances.d.ts.map +1 -1
  203. package/dist/services/tokens/balances.js +8 -8
  204. package/dist/services/tokens/balances.js.map +1 -1
  205. package/dist/services/tokens/tokens.d.ts +2 -3
  206. package/dist/services/tokens/tokens.d.ts.map +1 -1
  207. package/dist/services/tokens/tokens.js +3 -8
  208. package/dist/services/tokens/tokens.js.map +1 -1
  209. package/dist/services/vesu/api.d.ts +28 -0
  210. package/dist/services/vesu/api.d.ts.map +1 -0
  211. package/dist/services/vesu/api.js +91 -0
  212. package/dist/services/vesu/api.js.map +1 -0
  213. package/dist/services/vesu/config.d.ts +9 -0
  214. package/dist/services/vesu/config.d.ts.map +1 -0
  215. package/dist/services/vesu/config.js +32 -0
  216. package/dist/services/vesu/config.js.map +1 -0
  217. package/dist/services/vesu/index.d.ts +2 -0
  218. package/dist/services/vesu/index.d.ts.map +1 -1
  219. package/dist/services/vesu/index.js +2 -0
  220. package/dist/services/vesu/index.js.map +1 -1
  221. package/dist/services/vesu/lending.d.ts +9 -5
  222. package/dist/services/vesu/lending.d.ts.map +1 -1
  223. package/dist/services/vesu/lending.js +176 -60
  224. package/dist/services/vesu/lending.js.map +1 -1
  225. package/dist/services/vesu/pools.d.ts +6 -12
  226. package/dist/services/vesu/pools.d.ts.map +1 -1
  227. package/dist/services/vesu/pools.js +11 -31
  228. package/dist/services/vesu/pools.js.map +1 -1
  229. package/package.json +88 -82
  230. package/skills/README.md +59 -0
  231. package/skills/authenticate-wallet/SKILL.md +119 -0
  232. package/skills/balance/SKILL.md +80 -0
  233. package/skills/batch/SKILL.md +118 -0
  234. package/skills/config/SKILL.md +144 -0
  235. package/skills/lending/SKILL.md +209 -0
  236. package/skills/multi-swap/SKILL.md +95 -0
  237. package/skills/portfolio/SKILL.md +82 -0
  238. package/skills/send/SKILL.md +82 -0
  239. package/skills/staking/SKILL.md +188 -0
  240. package/skills/trade/SKILL.md +92 -0
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 ahmetenesdur
3
+ Copyright (c) 2026 ahmetenesdur
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/MCP.md ADDED
@@ -0,0 +1,292 @@
1
+ # Model Context Protocol (MCP) Integration
2
+
3
+ StarkFi operates as a fully-featured Model Context Protocol (MCP) server. By executing `npx starkfi mcp-start` over the `stdio` transport layer, AI development environments such as Cursor, Claude Desktop, and Antigravity can interact with the Starknet blockchain and execute decentralized finance operations through natural language commands.
4
+
5
+ ## Client Configuration
6
+
7
+ To integrate StarkFi into your AI environment, configure your MCP client settings file (e.g., `.cursor/mcp.json`, `claude_desktop_config.json`, or `~/.gemini/antigravity/mcp_config.json`) with the following definition:
8
+
9
+ ```json
10
+ {
11
+ "mcpServers": {
12
+ "starkfi": {
13
+ "command": "npx",
14
+ "args": ["-y", "starkfi", "mcp-start"]
15
+ }
16
+ }
17
+ }
18
+ ```
19
+
20
+ **Authentication Requirement:** The StarkFi CLI must be authenticated locally (via `npx starkfi auth login`) before the MCP server can execute any state-mutating transactions on behalf of the user.
21
+
22
+ ## Tool Registry
23
+
24
+ Upon initialization, the StarkFi server dynamically provisions **27 tool schemas** to the connected AI client. Tools are organized into domain-specific registration modules (`src/mcp/tools/`): **auth** (2), **wallet** (5), **trade** (5), **staking** (8), and **lending** (7).
25
+
26
+ ---
27
+
28
+ ### Read-Only Tools
29
+
30
+ These tools do not mutate blockchain state and are safe to call without user confirmation.
31
+
32
+ #### `get_auth_status`
33
+
34
+ Validates the active CLI session and verifies Fibrous API connectivity.
35
+
36
+ _No input parameters required._
37
+
38
+ #### `get_balance`
39
+
40
+ Retrieves STRK, ETH, and specified ERC-20 token balances for the authenticated wallet.
41
+
42
+ | Parameter | Type | Required | Description |
43
+ | --------- | ------ | -------- | ------------------------------------------------------------------------------- |
44
+ | `token` | string | No | Specific token symbol (e.g. `STRK`, `ETH`, `USDC`). Omit to fetch all balances. |
45
+
46
+ #### `get_tx_status`
47
+
48
+ Queries the Starknet sequencer for transaction status and execution receipts.
49
+
50
+ | Parameter | Type | Required | Description |
51
+ | --------- | ------ | -------- | -------------------------- |
52
+ | `hash` | string | **Yes** | Transaction hash (`0x...`) |
53
+
54
+ #### `get_portfolio`
55
+
56
+ Returns a complete DeFi portfolio: all token balances with USD values, staking positions, and lending positions in one call.
57
+
58
+ _No input parameters required._
59
+
60
+ #### `get_swap_quote`
61
+
62
+ Calculates optimal routing, expected output, and slippage prior to execution. Always call this **before** `swap_tokens` so the user can review the expected output.
63
+
64
+ | Parameter | Type | Required | Description |
65
+ | ------------ | ------ | -------- | ---------------------------------------------------- |
66
+ | `amount` | string | **Yes** | Amount to swap (e.g. `0.1`, `100`) |
67
+ | `from_token` | string | **Yes** | Source token symbol to sell (e.g. `ETH`, `USDC`) |
68
+ | `to_token` | string | **Yes** | Destination token symbol to buy (e.g. `STRK`, `DAI`) |
69
+
70
+ #### `get_multi_swap_quote`
71
+
72
+ Calculates optimal batch routing for 2-3 swap pairs at once. Uses Fibrous `routeBatch` API when all pairs share the same output token, otherwise falls back to parallel individual routes.
73
+
74
+ | Parameter | Type | Required | Description |
75
+ | --------- | ------------------------------------------------------- | -------- | ------------------------------- |
76
+ | `swaps` | array of `{ amount, from_token, to_token }` (2-3 items) | **Yes** | Array of swap pairs (2-3 items) |
77
+
78
+ #### `list_validators`
79
+
80
+ Enumerates all officially recognized Starknet staking validators.
81
+
82
+ _No input parameters required._
83
+
84
+ #### `list_pools`
85
+
86
+ Enumerates available delegation pools for a validator, including multi-token pools.
87
+
88
+ | Parameter | Type | Required | Description |
89
+ | ----------- | ------ | -------- | -------------------------------------------------------------------------------------- |
90
+ | `validator` | string | **Yes** | Validator name (e.g. `Karnot`, `Kakarot`) or staker address. Supports partial matches. |
91
+
92
+ #### `get_staking_info`
93
+
94
+ Retrieves specific user staked balances, unclaimed rewards, and active cooldown periods.
95
+
96
+ | Parameter | Type | Required | Description |
97
+ | --------- | ------ | -------- | --------------------------------------- |
98
+ | `pool` | string | **Yes** | Staking pool contract address (`0x...`) |
99
+
100
+ #### `get_stake_status`
101
+
102
+ Generates a consolidated staking dashboard across validators. Accepts an optional target validator name to filter the view.
103
+
104
+ | Parameter | Type | Required | Description |
105
+ | ----------- | ------ | -------- | -------------------------------------------------------------------- |
106
+ | `validator` | string | No | Optional validator name or staker address to strictly filter results |
107
+
108
+ #### `list_lending_pools`
109
+
110
+ Enumerates active Vesu V2 lending pools with live data from the Vesu API — assets (with APY/APR), supported pairs, protocol version, and deprecation status.
111
+
112
+ | Parameter | Type | Required | Description |
113
+ | --------- | ------ | -------- | ------------------------------------------------------- |
114
+ | `name` | string | No | Filter pools by name (partial match). Omit to list all. |
115
+
116
+ #### `get_lending_position`
117
+
118
+ Retrieves the user's supplied yield, outstanding debt, Health Factor, and Risk Level for a specific pool.
119
+
120
+ | Parameter | Type | Required | Description |
121
+ | ------------------ | ------ | -------- | --------------------------------------------------------------------------- |
122
+ | `pool` | string | **Yes** | Pool name (e.g. `Prime`, `Re7`) or contract address (`0x...`) |
123
+ | `collateral_token` | string | **Yes** | Collateral token symbol (e.g. `ETH`, `STRK`) |
124
+ | `borrow_token` | string | No | Borrow token symbol (e.g. `USDC`, `USDT`). Optional for supply-only checks. |
125
+
126
+ ---
127
+
128
+ ### Transactional Tools
129
+
130
+ These tools construct and broadcast transactions. The connecting AI client is strictly responsible for prompting the user for explicit confirmation before execution. All transactional tools accept an optional `simulate` parameter — when set to `true`, the tool estimates fees and validates the transaction without broadcasting.
131
+
132
+ #### `deploy_account`
133
+
134
+ Deploys the associated smart contract account to the Starknet network (idempotent operation).
135
+
136
+ _No input parameters required._
137
+
138
+ #### `swap_tokens`
139
+
140
+ Broadcasts an aggregated token swap transaction via the Fibrous router. Only call this **after** showing the user a quote via `get_swap_quote`.
141
+
142
+ | Parameter | Type | Required | Description |
143
+ | ------------ | ------- | -------- | --------------------------------------------------------- |
144
+ | `amount` | string | **Yes** | Amount to swap (e.g. `0.1`, `100`) |
145
+ | `from_token` | string | **Yes** | Source token symbol to sell (e.g. `ETH`, `STRK`) |
146
+ | `to_token` | string | **Yes** | Destination token symbol to buy (e.g. `USDC`, `DAI`) |
147
+ | `slippage` | number | No | Slippage tolerance in % (default: `1`) |
148
+ | `simulate` | boolean | No | Set `true` to estimate fees without sending a transaction |
149
+
150
+ #### `send_tokens`
151
+
152
+ Broadcasts a standard token transfer transaction for STRK, ETH, or ERC-20 assets. Pre-checks balance.
153
+
154
+ | Parameter | Type | Required | Description |
155
+ | ----------- | ------- | -------- | --------------------------------------------------------- |
156
+ | `amount` | string | **Yes** | Amount to send (e.g. `0.1`, `100`) |
157
+ | `token` | string | **Yes** | Token symbol (e.g. `STRK`, `ETH`, `USDC`) |
158
+ | `recipient` | string | **Yes** | Recipient Starknet address (`0x...`) |
159
+ | `simulate` | boolean | No | Set `true` to estimate fees without sending a transaction |
160
+
161
+ #### `multi_swap`
162
+
163
+ Executes 2-3 token swaps in a single transaction via Fibrous batch routing. Call `get_multi_swap_quote` first to preview.
164
+
165
+ | Parameter | Type | Required | Description |
166
+ | ---------- | ------------------------------------------------------- | -------- | --------------------------------------------- |
167
+ | `swaps` | array of `{ amount, from_token, to_token }` (2-3 items) | **Yes** | Array of swap pairs (2-3 items) |
168
+ | `slippage` | number | No | Slippage tolerance in % (default: `1`) |
169
+ | `simulate` | boolean | No | Set `true` to estimate fees without executing |
170
+
171
+ #### `batch_execute`
172
+
173
+ Executes multiple DeFi operations (swap, stake, supply, send) in a single Starknet multicall. Minimum 2 operations.
174
+
175
+ | Parameter | Type | Required | Description |
176
+ | ------------ | ----------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
177
+ | `operations` | array of `{ type, params }` (min 2 items) | **Yes** | Each operation has a `type` (`swap`, `stake`, `supply`, `send`) and a `params` record. **swap**: `{amount, from_token, to_token}`. **stake**: `{amount, token?, pool? or validator?}`. **supply**: `{amount, token, pool}`. **send**: `{amount, token, to}`. |
178
+ | `simulate` | boolean | No | Set `true` to estimate fees without executing |
179
+
180
+ #### `stake_tokens`
181
+
182
+ Executes multi-token smart delegation (STRK, WBTC, tBTC, SolvBTC, LBTC). Auto-detects whether the user needs to enter the pool or add to an existing delegation.
183
+
184
+ | Parameter | Type | Required | Description |
185
+ | --------- | ------ | -------- | ----------------------------------------------------------------------------------- |
186
+ | `amount` | string | **Yes** | Amount to stake (e.g. `100`, `0.01`) |
187
+ | `pool` | string | **Yes** | Staking pool contract address (`0x...`) |
188
+ | `token` | string | No | Token symbol to stake (default: `STRK`). Supported: STRK, WBTC, tBTC, SolvBTC, LBTC |
189
+
190
+ #### `unstake_tokens`
191
+
192
+ Manages the strict two-step Starknet unstaking lifecycle. Step 1: call with `action="intent"` to start cooldown. Step 2: call with `action="exit"` to complete withdrawal.
193
+
194
+ | Parameter | Type | Required | Description |
195
+ | --------- | ---------------------- | ----------------- | --------------------------------------------------------------------- |
196
+ | `action` | `"intent"` or `"exit"` | **Yes** | `intent` starts unstaking, `exit` completes withdrawal after cooldown |
197
+ | `pool` | string | **Yes** | Staking pool contract address (`0x...`) |
198
+ | `amount` | string | Only for `intent` | Amount to unstake |
199
+ | `token` | string | No | Token symbol (default: `STRK`). Must match the pool's token. |
200
+
201
+ #### `claim_rewards`
202
+
203
+ Extracts earned rewards from a staking pool to the user's wallet.
204
+
205
+ | Parameter | Type | Required | Description |
206
+ | --------- | ------ | -------- | --------------------------------------- |
207
+ | `pool` | string | **Yes** | Staking pool contract address (`0x...`) |
208
+
209
+ #### `compound_rewards`
210
+
211
+ Atomically claims staking rewards and re-stakes them into the same pool in a single transaction (compound interest).
212
+
213
+ | Parameter | Type | Required | Description |
214
+ | --------- | ------ | -------- | --------------------------------------- |
215
+ | `pool` | string | **Yes** | Staking pool contract address (`0x...`) |
216
+
217
+ #### `supply_assets`
218
+
219
+ Deposits specified assets into a Vesu V2 pool to generate yield. The tokens are deposited into the pool's ERC-4626 vToken vault.
220
+
221
+ | Parameter | Type | Required | Description |
222
+ | --------- | ------ | -------- | ------------------------------------------------------------- |
223
+ | `pool` | string | **Yes** | Pool name (e.g. `Prime`, `Re7`) or contract address (`0x...`) |
224
+ | `amount` | string | **Yes** | Amount to supply (e.g. `100`, `0.5`) |
225
+ | `token` | string | **Yes** | Token symbol to supply (e.g. `STRK`, `ETH`, `USDC`) |
226
+
227
+ #### `withdraw_assets`
228
+
229
+ Redeems supplied assets from a Vesu V2 lending pool.
230
+
231
+ | Parameter | Type | Required | Description |
232
+ | --------- | ------ | -------- | ------------------------------------------------------------- |
233
+ | `pool` | string | **Yes** | Pool name (e.g. `Prime`, `Re7`) or contract address (`0x...`) |
234
+ | `amount` | string | **Yes** | Amount to withdraw (e.g. `100`, `0.5`) |
235
+ | `token` | string | **Yes** | Token symbol to withdraw (e.g. `STRK`, `ETH`, `USDC`) |
236
+
237
+ #### `borrow_assets`
238
+
239
+ Executes an atomic collateral deposit and subsequent asset borrow against a Vesu V2 pool. Supports using previously supplied vTokens as collateral.
240
+
241
+ | Parameter | Type | Required | Description |
242
+ | ------------------- | ------- | -------- | ------------------------------------------------------------------------- |
243
+ | `pool` | string | **Yes** | Pool name (e.g. `Prime`, `Re7`) or contract address (`0x...`) |
244
+ | `collateral_amount` | string | **Yes** | Collateral amount to deposit (e.g. `1000`) |
245
+ | `collateral_token` | string | **Yes** | Collateral token symbol (e.g. `STRK`, `ETH`) |
246
+ | `borrow_amount` | string | **Yes** | Amount to borrow (e.g. `100`) |
247
+ | `borrow_token` | string | **Yes** | Token to borrow (e.g. `USDC`, `USDT`) |
248
+ | `use_supplied` | boolean | No | Set `true` to use previously supplied vTokens as collateral via multicall |
249
+
250
+ #### `repay_debt`
251
+
252
+ Processes the repayment of borrowed assets against an existing Vesu V2 position.
253
+
254
+ | Parameter | Type | Required | Description |
255
+ | ------------------ | ------ | -------- | --------------------------------------------------------------------------------------- |
256
+ | `pool` | string | **Yes** | Pool name (e.g. `Prime`, `Re7`) or contract address (`0x...`) |
257
+ | `amount` | string | **Yes** | Amount to repay (e.g. `50`, `100`) |
258
+ | `token` | string | **Yes** | Token to repay (e.g. `USDC`, `USDT`) |
259
+ | `collateral_token` | string | **Yes** | Collateral token of the position (e.g. `ETH`, `STRK`). Needed to identify the position. |
260
+
261
+ #### `close_position`
262
+
263
+ Atomically closes an active Vesu V2 lending position. Repays all outstanding debt and withdraws all collateral in a single unified execution.
264
+
265
+ | Parameter | Type | Required | Description |
266
+ | ------------------ | ------ | -------- | ------------------------------------------------------------- |
267
+ | `pool` | string | **Yes** | Pool name (e.g. `Prime`, `Re7`) or contract address (`0x...`) |
268
+ | `collateral_token` | string | **Yes** | Collateral token symbol of the position (e.g. `STRK`, `ETH`) |
269
+ | `debt_token` | string | **Yes** | Borrowed token symbol of the position (e.g. `USDC`, `USDT`) |
270
+
271
+ ---
272
+
273
+ ### Configuration Utilities
274
+
275
+ #### `config_action`
276
+
277
+ Views and modifies global CLI behavior: RPC routing, network selection, and Gas Abstraction.
278
+
279
+ | Parameter | Type | Required | Description |
280
+ | --------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------- |
281
+ | `action` | enum | **Yes** | One of: `list`, `set-rpc`, `get-rpc`, `set-network`, `set-gasfree`, `set-gas-token` |
282
+ | `value` | string | No | `set-gasfree`: `on`/`off`. `set-gas-token`: symbol (`USDC`, `ETH`) or `off`. `set-rpc`: URL string. `set-network`: `mainnet`/`sepolia`. |
283
+
284
+ ---
285
+
286
+ ## Agent Best Practices
287
+
288
+ 1. **Always quote before executing** — Call `get_swap_quote` before `swap_tokens`, and `get_multi_swap_quote` before `multi_swap`
289
+ 2. **Use simulation for transparency** — Set `simulate: true` on any transactional tool to preview fees before executing
290
+ 3. **Confirm with the user** — Never execute a transactional tool without explicit user confirmation
291
+ 4. **Use `get_auth_status` first** — Verify the session is active before attempting any wallet operations
292
+ 5. **Check `get_stake_status` and `get_lending_position`** — Query existing positions before staking/lending to avoid duplicate operations