starkfi 0.1.0 → 0.2.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 (195) hide show
  1. package/MCP.md +70 -0
  2. package/README.md +120 -58
  3. package/dist/commands/auth/login.js +2 -2
  4. package/dist/commands/auth/login.js.map +1 -1
  5. package/dist/commands/auth/verify.d.ts.map +1 -1
  6. package/dist/commands/auth/verify.js +2 -2
  7. package/dist/commands/auth/verify.js.map +1 -1
  8. package/dist/commands/batch/batch.d.ts +3 -0
  9. package/dist/commands/batch/batch.d.ts.map +1 -0
  10. package/dist/commands/batch/batch.js +143 -0
  11. package/dist/commands/batch/batch.js.map +1 -0
  12. package/dist/commands/chain/tx-status.js +2 -2
  13. package/dist/commands/chain/tx-status.js.map +1 -1
  14. package/dist/commands/config/config.d.ts.map +1 -1
  15. package/dist/commands/config/config.js +14 -31
  16. package/dist/commands/config/config.js.map +1 -1
  17. package/dist/commands/lending/lending.d.ts +1 -0
  18. package/dist/commands/lending/lending.d.ts.map +1 -1
  19. package/dist/commands/lending/lending.js +187 -48
  20. package/dist/commands/lending/lending.js.map +1 -1
  21. package/dist/commands/portfolio/portfolio.d.ts +3 -0
  22. package/dist/commands/portfolio/portfolio.d.ts.map +1 -0
  23. package/dist/commands/portfolio/portfolio.js +76 -0
  24. package/dist/commands/portfolio/portfolio.js.map +1 -0
  25. package/dist/commands/staking/staking.d.ts +1 -1
  26. package/dist/commands/staking/staking.d.ts.map +1 -1
  27. package/dist/commands/staking/staking.js +142 -61
  28. package/dist/commands/staking/staking.js.map +1 -1
  29. package/dist/commands/trade/multi-swap.d.ts +3 -0
  30. package/dist/commands/trade/multi-swap.d.ts.map +1 -0
  31. package/dist/commands/trade/multi-swap.js +140 -0
  32. package/dist/commands/trade/multi-swap.js.map +1 -0
  33. package/dist/commands/trade/status.js +2 -2
  34. package/dist/commands/trade/status.js.map +1 -1
  35. package/dist/commands/trade/swap.d.ts.map +1 -1
  36. package/dist/commands/trade/swap.js +45 -10
  37. package/dist/commands/trade/swap.js.map +1 -1
  38. package/dist/commands/wallet/balance.d.ts.map +1 -1
  39. package/dist/commands/wallet/balance.js +19 -2
  40. package/dist/commands/wallet/balance.js.map +1 -1
  41. package/dist/commands/wallet/deploy.d.ts.map +1 -1
  42. package/dist/commands/wallet/deploy.js +2 -1
  43. package/dist/commands/wallet/deploy.js.map +1 -1
  44. package/dist/commands/wallet/send.d.ts.map +1 -1
  45. package/dist/commands/wallet/send.js +45 -8
  46. package/dist/commands/wallet/send.js.map +1 -1
  47. package/dist/index.js +22 -7
  48. package/dist/index.js.map +1 -1
  49. package/dist/lib/banner.d.ts +6 -0
  50. package/dist/lib/banner.d.ts.map +1 -0
  51. package/dist/lib/banner.js +78 -0
  52. package/dist/lib/banner.js.map +1 -0
  53. package/dist/lib/config.d.ts +0 -11
  54. package/dist/lib/config.d.ts.map +1 -1
  55. package/dist/lib/config.js +0 -20
  56. package/dist/lib/config.js.map +1 -1
  57. package/dist/lib/errors.d.ts +2 -0
  58. package/dist/lib/errors.d.ts.map +1 -1
  59. package/dist/lib/errors.js +2 -0
  60. package/dist/lib/errors.js.map +1 -1
  61. package/dist/lib/format.d.ts +43 -2
  62. package/dist/lib/format.d.ts.map +1 -1
  63. package/dist/lib/format.js +51 -5
  64. package/dist/lib/format.js.map +1 -1
  65. package/dist/lib/retry.d.ts +15 -0
  66. package/dist/lib/retry.d.ts.map +1 -0
  67. package/dist/lib/retry.js +29 -0
  68. package/dist/lib/retry.js.map +1 -0
  69. package/dist/lib/validation.d.ts +0 -12
  70. package/dist/lib/validation.d.ts.map +1 -1
  71. package/dist/lib/validation.js +1 -23
  72. package/dist/lib/validation.js.map +1 -1
  73. package/dist/mcp/handlers/batch.d.ts +13 -0
  74. package/dist/mcp/handlers/batch.d.ts.map +1 -0
  75. package/dist/mcp/handlers/batch.js +33 -0
  76. package/dist/mcp/handlers/batch.js.map +1 -0
  77. package/dist/mcp/handlers/config.d.ts +1 -1
  78. package/dist/mcp/handlers/config.d.ts.map +1 -1
  79. package/dist/mcp/handlers/config.js +11 -12
  80. package/dist/mcp/handlers/config.js.map +1 -1
  81. package/dist/mcp/handlers/index.d.ts +3 -0
  82. package/dist/mcp/handlers/index.d.ts.map +1 -1
  83. package/dist/mcp/handlers/index.js +3 -0
  84. package/dist/mcp/handlers/index.js.map +1 -1
  85. package/dist/mcp/handlers/lending.d.ts +12 -1
  86. package/dist/mcp/handlers/lending.d.ts.map +1 -1
  87. package/dist/mcp/handlers/lending.js +67 -23
  88. package/dist/mcp/handlers/lending.js.map +1 -1
  89. package/dist/mcp/handlers/multi-swap.d.ts +27 -0
  90. package/dist/mcp/handlers/multi-swap.d.ts.map +1 -0
  91. package/dist/mcp/handlers/multi-swap.js +73 -0
  92. package/dist/mcp/handlers/multi-swap.js.map +1 -0
  93. package/dist/mcp/handlers/portfolio.d.ts +7 -0
  94. package/dist/mcp/handlers/portfolio.d.ts.map +1 -0
  95. package/dist/mcp/handlers/portfolio.js +11 -0
  96. package/dist/mcp/handlers/portfolio.js.map +1 -0
  97. package/dist/mcp/handlers/staking.d.ts +13 -1
  98. package/dist/mcp/handlers/staking.d.ts.map +1 -1
  99. package/dist/mcp/handlers/staking.js +18 -5
  100. package/dist/mcp/handlers/staking.js.map +1 -1
  101. package/dist/mcp/handlers/trade.d.ts +1 -0
  102. package/dist/mcp/handlers/trade.d.ts.map +1 -1
  103. package/dist/mcp/handlers/trade.js +23 -9
  104. package/dist/mcp/handlers/trade.js.map +1 -1
  105. package/dist/mcp/handlers/wallet.d.ts +1 -0
  106. package/dist/mcp/handlers/wallet.d.ts.map +1 -1
  107. package/dist/mcp/handlers/wallet.js +16 -1
  108. package/dist/mcp/handlers/wallet.js.map +1 -1
  109. package/dist/mcp/tools.d.ts.map +1 -1
  110. package/dist/mcp/tools.js +102 -33
  111. package/dist/mcp/tools.js.map +1 -1
  112. package/dist/services/api/client.d.ts +0 -12
  113. package/dist/services/api/client.d.ts.map +1 -1
  114. package/dist/services/api/client.js +3 -8
  115. package/dist/services/api/client.js.map +1 -1
  116. package/dist/services/auth/session.d.ts +1 -7
  117. package/dist/services/auth/session.d.ts.map +1 -1
  118. package/dist/services/auth/session.js +20 -0
  119. package/dist/services/auth/session.js.map +1 -1
  120. package/dist/services/batch/batch.d.ts +36 -0
  121. package/dist/services/batch/batch.d.ts.map +1 -0
  122. package/dist/services/batch/batch.js +111 -0
  123. package/dist/services/batch/batch.js.map +1 -0
  124. package/dist/services/config/config.d.ts +4 -0
  125. package/dist/services/config/config.d.ts.map +1 -1
  126. package/dist/services/config/config.js +31 -1
  127. package/dist/services/config/config.js.map +1 -1
  128. package/dist/services/fibrous/config.d.ts +4 -0
  129. package/dist/services/fibrous/config.d.ts.map +1 -0
  130. package/dist/services/fibrous/config.js +4 -0
  131. package/dist/services/fibrous/config.js.map +1 -0
  132. package/dist/services/fibrous/health.js +1 -1
  133. package/dist/services/fibrous/health.js.map +1 -1
  134. package/dist/services/fibrous/route.d.ts +19 -6
  135. package/dist/services/fibrous/route.d.ts.map +1 -1
  136. package/dist/services/fibrous/route.js +64 -3
  137. package/dist/services/fibrous/route.js.map +1 -1
  138. package/dist/services/portfolio/portfolio.d.ts +35 -0
  139. package/dist/services/portfolio/portfolio.d.ts.map +1 -0
  140. package/dist/services/portfolio/portfolio.js +106 -0
  141. package/dist/services/portfolio/portfolio.js.map +1 -0
  142. package/dist/services/simulate/simulate.d.ts +18 -0
  143. package/dist/services/simulate/simulate.d.ts.map +1 -0
  144. package/dist/services/simulate/simulate.js +61 -0
  145. package/dist/services/simulate/simulate.js.map +1 -0
  146. package/dist/services/staking/staking.d.ts +5 -13
  147. package/dist/services/staking/staking.d.ts.map +1 -1
  148. package/dist/services/staking/staking.js +44 -52
  149. package/dist/services/staking/staking.js.map +1 -1
  150. package/dist/services/starkzap/client.d.ts.map +1 -1
  151. package/dist/services/starkzap/client.js +38 -18
  152. package/dist/services/starkzap/client.js.map +1 -1
  153. package/dist/services/starkzap/config.d.ts +6 -0
  154. package/dist/services/starkzap/config.d.ts.map +1 -0
  155. package/dist/services/starkzap/config.js +13 -0
  156. package/dist/services/starkzap/config.js.map +1 -0
  157. package/dist/services/tokens/balances.d.ts.map +1 -1
  158. package/dist/services/tokens/balances.js +26 -14
  159. package/dist/services/tokens/balances.js.map +1 -1
  160. package/dist/services/tokens/tokens.d.ts +2 -3
  161. package/dist/services/tokens/tokens.d.ts.map +1 -1
  162. package/dist/services/tokens/tokens.js +3 -8
  163. package/dist/services/tokens/tokens.js.map +1 -1
  164. package/dist/services/vesu/api.d.ts +28 -0
  165. package/dist/services/vesu/api.d.ts.map +1 -0
  166. package/dist/services/vesu/api.js +97 -0
  167. package/dist/services/vesu/api.js.map +1 -0
  168. package/dist/services/vesu/config.d.ts +9 -0
  169. package/dist/services/vesu/config.d.ts.map +1 -0
  170. package/dist/services/vesu/config.js +32 -0
  171. package/dist/services/vesu/config.js.map +1 -0
  172. package/dist/services/vesu/index.d.ts +2 -0
  173. package/dist/services/vesu/index.d.ts.map +1 -1
  174. package/dist/services/vesu/index.js +2 -0
  175. package/dist/services/vesu/index.js.map +1 -1
  176. package/dist/services/vesu/lending.d.ts +8 -1
  177. package/dist/services/vesu/lending.d.ts.map +1 -1
  178. package/dist/services/vesu/lending.js +171 -52
  179. package/dist/services/vesu/lending.js.map +1 -1
  180. package/dist/services/vesu/pools.d.ts +5 -11
  181. package/dist/services/vesu/pools.d.ts.map +1 -1
  182. package/dist/services/vesu/pools.js +11 -31
  183. package/dist/services/vesu/pools.js.map +1 -1
  184. package/package.json +88 -82
  185. package/skills/README.md +63 -0
  186. package/skills/authenticate-wallet/SKILL.md +119 -0
  187. package/skills/balance/SKILL.md +80 -0
  188. package/skills/batch/SKILL.md +118 -0
  189. package/skills/config/SKILL.md +144 -0
  190. package/skills/lending/SKILL.md +209 -0
  191. package/skills/multi-swap/SKILL.md +95 -0
  192. package/skills/portfolio/SKILL.md +82 -0
  193. package/skills/send/SKILL.md +82 -0
  194. package/skills/staking/SKILL.md +188 -0
  195. package/skills/trade/SKILL.md +92 -0
package/package.json CHANGED
@@ -1,83 +1,89 @@
1
1
  {
2
- "name": "starkfi",
3
- "version": "0.1.0",
4
- "description": "Starknet DeFi CLI + MCP Server — Token swaps, staking, lending, gasless transactions",
5
- "type": "module",
6
- "bin": {
7
- "starkfi": "./dist/index.js"
8
- },
9
- "main": "./dist/index.js",
10
- "exports": {
11
- ".": {
12
- "import": "./dist/index.js",
13
- "types": "./dist/index.d.ts"
14
- }
15
- },
16
- "files": [
17
- "dist",
18
- "README.md",
19
- "LICENSE"
20
- ],
21
- "keywords": [
22
- "starknet",
23
- "defi",
24
- "cli",
25
- "mcp",
26
- "mcp-server",
27
- "starkzap",
28
- "swap",
29
- "staking",
30
- "lending",
31
- "vesu",
32
- "fibrous",
33
- "web3",
34
- "l2"
35
- ],
36
- "author": "ahmetenesdur",
37
- "license": "MIT",
38
- "repository": {
39
- "type": "git",
40
- "url": "git+https://github.com/ahmetenesdur/starkfi.git"
41
- },
42
- "bugs": {
43
- "url": "https://github.com/ahmetenesdur/starkfi/issues"
44
- },
45
- "homepage": "https://github.com/ahmetenesdur/starkfi#readme",
46
- "engines": {
47
- "node": ">=18"
48
- },
49
- "dependencies": {
50
- "@modelcontextprotocol/sdk": "^1.27.1",
51
- "chalk": "^5.6.2",
52
- "commander": "^14.0.3",
53
- "env-paths": "^3.0.0",
54
- "inquirer": "^13.3.0",
55
- "ora": "^9.3.0",
56
- "starknet": "^9.2.1",
57
- "starkzap": "^1.0.0",
58
- "zod": "^4.3.6"
59
- },
60
- "devDependencies": {
61
- "@eslint/js": "^10.0.1",
62
- "@types/node": "^22.19.11",
63
- "eslint": "^10.0.2",
64
- "eslint-config-prettier": "^10.1.8",
65
- "globals": "^17.3.0",
66
- "jiti": "^2.6.1",
67
- "prettier": "^3.8.1",
68
- "tsx": "^4.21.0",
69
- "typescript": "^5.9.3",
70
- "typescript-eslint": "^8.56.1"
71
- },
72
- "scripts": {
73
- "build": "tsc",
74
- "dev": "node --import tsx/esm src/index.ts",
75
- "typecheck": "tsc --noEmit",
76
- "lint": "eslint src/",
77
- "lint:fix": "eslint src/ --fix",
78
- "format": "prettier --write src/",
79
- "format:check": "prettier --check src/",
80
- "start": "node dist/index.js",
81
- "mcp-start": "node dist/index.js mcp-start"
82
- }
83
- }
2
+ "name": "starkfi",
3
+ "version": "0.2.0",
4
+ "description": "Starknet DeFi CLI + MCP Server — Swaps, multi-swap, batch (multicall), staking, lending, simulation, portfolio, gasless transactions",
5
+ "type": "module",
6
+ "bin": {
7
+ "starkfi": "./dist/index.js"
8
+ },
9
+ "main": "./dist/index.js",
10
+ "exports": {
11
+ ".": {
12
+ "import": "./dist/index.js",
13
+ "types": "./dist/index.d.ts"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "skills",
19
+ "README.md",
20
+ "MCP.md",
21
+ "LICENSE"
22
+ ],
23
+ "scripts": {
24
+ "build": "tsc -p tsconfig.build.json",
25
+ "dev": "node --import tsx/esm src/index.ts",
26
+ "typecheck": "tsc --noEmit",
27
+ "lint": "eslint src/",
28
+ "lint:fix": "eslint src/ --fix",
29
+ "format": "prettier --write src/",
30
+ "format:check": "prettier --check src/",
31
+ "start": "node dist/index.js",
32
+ "mcp-start": "node dist/index.js mcp-start",
33
+ "prepublishOnly": "pnpm run build"
34
+ },
35
+ "keywords": [
36
+ "starknet",
37
+ "defi",
38
+ "cli",
39
+ "mcp",
40
+ "mcp-server",
41
+ "starkzap",
42
+ "swap",
43
+ "multi-swap",
44
+ "batch",
45
+ "multicall",
46
+ "simulation",
47
+ "portfolio",
48
+ "staking",
49
+ "lending",
50
+ "vesu",
51
+ "fibrous",
52
+ "web3",
53
+ "l2"
54
+ ],
55
+ "author": "ahmetenesdur",
56
+ "license": "MIT",
57
+ "repository": {
58
+ "type": "git",
59
+ "url": "git+https://github.com/ahmetenesdur/starkfi.git"
60
+ },
61
+ "bugs": {
62
+ "url": "https://github.com/ahmetenesdur/starkfi/issues"
63
+ },
64
+ "homepage": "https://github.com/ahmetenesdur/starkfi#readme",
65
+ "engines": {
66
+ "node": ">=18"
67
+ },
68
+ "dependencies": {
69
+ "@modelcontextprotocol/sdk": "^1.27.1",
70
+ "chalk": "^5.6.2",
71
+ "commander": "^14.0.3",
72
+ "env-paths": "^3.0.0",
73
+ "ora": "^9.3.0",
74
+ "starkzap": "^1.0.0",
75
+ "zod": "^4.3.6"
76
+ },
77
+ "devDependencies": {
78
+ "@eslint/js": "^10.0.1",
79
+ "@types/node": "^22.19.15",
80
+ "eslint": "^10.0.3",
81
+ "eslint-config-prettier": "^10.1.8",
82
+ "globals": "^17.4.0",
83
+ "jiti": "^2.6.1",
84
+ "prettier": "^3.8.1",
85
+ "tsx": "^4.21.0",
86
+ "typescript": "^5.9.3",
87
+ "typescript-eslint": "^8.56.1"
88
+ }
89
+ }
@@ -0,0 +1,63 @@
1
+ # StarkFi Skills
2
+
3
+ Agent Skills for the [StarkFi](https://github.com/ahmetenesdur/starkfi) CLI — a Starknet DeFi toolkit.
4
+
5
+ ## Available Skills
6
+
7
+ | Skill | Category | Description |
8
+ | ----------------------------------------------------- | ----------- | ----------------------------------------------------------------- |
9
+ | [authenticate-wallet](./authenticate-wallet/SKILL.md) | auth | Email OTP login, session management, wallet deploy |
10
+ | [balance](./balance/SKILL.md) | wallet-data | Check STRK, ETH, and ERC-20 token balances |
11
+ | [send](./send/SKILL.md) | transaction | Transfer tokens to a Starknet address |
12
+ | [trade](./trade/SKILL.md) | transaction | Swap tokens via Fibrous aggregation |
13
+ | [multi-swap](./multi-swap/SKILL.md) | transaction | Multiple swaps in one transaction (up to 3) |
14
+ | [batch](./batch/SKILL.md) | transaction | Combine swap + stake + supply + send in one multicall |
15
+ | [staking](./staking/SKILL.md) | transaction | Stake, unstake, claim, compound (STRK, WBTC, tBTC, SolvBTC, LBTC) |
16
+ | [lending](./lending/SKILL.md) | transaction | Vesu V2 lending: supply, borrow, repay, withdraw, close |
17
+ | [portfolio](./portfolio/SKILL.md) | wallet-data | Aggregated DeFi dashboard with USD valuations |
18
+ | [config](./config/SKILL.md) | utility | RPC, network, gas settings, transaction status |
19
+
20
+ ## Installation
21
+
22
+ Install with [Vercel's Skills CLI](https://skills.sh):
23
+
24
+ ```bash
25
+ npx skills add ahmetenesdur/starkfi
26
+ ```
27
+
28
+ Or clone directly:
29
+
30
+ ```bash
31
+ git clone https://github.com/ahmetenesdur/starkfi.git
32
+ ```
33
+
34
+ ## Getting Started
35
+
36
+ 1. Install Node.js (v18+) and npm.
37
+ 2. No manual installation needed — all skills use `npx starkfi@latest`.
38
+
39
+ ## Typical Workflow
40
+
41
+ 1. **Authenticate** → `authenticate-wallet` (required first)
42
+ 2. **Check funds** → `balance` or `portfolio`
43
+ 3. **Execute** → `send`, `trade`, `multi-swap`, `batch`, `staking`, or `lending`
44
+ 4. **Verify** → `tx-status` (via `config` skill)
45
+
46
+ ## Trigger Examples
47
+
48
+ | User says... | Skill triggered |
49
+ | ----------------------------------- | --------------------- |
50
+ | "Log me in with my email" | `authenticate-wallet` |
51
+ | "How much STRK do I have?" | `balance` |
52
+ | "Send 10 USDC to 0x04a3..." | `send` |
53
+ | "Swap 100 USDC for ETH" | `trade` |
54
+ | "Swap USDC to ETH and USDT to STRK" | `multi-swap` |
55
+ | "Swap ETH and then stake STRK" | `batch` |
56
+ | "Stake 1000 STRK with Juno" | `staking` |
57
+ | "Supply 500 USDC to Genesis pool" | `lending` |
58
+ | "Show me my portfolio" | `portfolio` |
59
+ | "I'm getting rate limit errors" | `config` |
60
+
61
+ ## License
62
+
63
+ MIT
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: authenticate-wallet
3
+ description: Authenticate, manage sessions, and deploy Starknet wallets with StarkFi. Handles email OTP login (two-step), session checks, address display, account deployment, and logout. Use this skill whenever the user wants to sign in, log in, check their session, see their wallet address, deploy their account, or log out — even if they don't say "authenticate" explicitly.
4
+ license: MIT
5
+ compatibility: Requires Node.js 18+ and npx.
6
+ metadata:
7
+ version: 0.1.0
8
+ author: ahmetenesdur
9
+ category: auth
10
+ allowed-tools:
11
+ - Bash(npx starkfi@latest auth login *)
12
+ - Bash(npx starkfi@latest auth verify *)
13
+ - Bash(npx starkfi@latest auth logout)
14
+ - Bash(npx starkfi@latest status)
15
+ - Bash(npx starkfi@latest address)
16
+ - Bash(npx starkfi@latest deploy)
17
+ ---
18
+
19
+ # Authenticate Wallet
20
+
21
+ Manage authentication sessions for the StarkFi CLI. StarkFi uses a remote Auth Server with Privy TEE for email-based one-time password (OTP) authentication. A valid session is required before any transactional skill can operate.
22
+
23
+ ## Prerequisites
24
+
25
+ - The StarkFi Auth Server (`starkfi-server`) must be running and accessible.
26
+ - An email address the user has access to (for receiving OTP codes).
27
+
28
+ ## Authentication Flow
29
+
30
+ The login process is a **two-step** OTP flow:
31
+
32
+ 1. **Initiate** — `auth login <email>` sends an OTP code to the email.
33
+ 2. **Verify** — `auth verify <email> <code>` completes authentication.
34
+
35
+ The agent CANNOT guess or auto-fill the OTP code — it must wait for the user to provide it after checking their email.
36
+
37
+ ## Rules
38
+
39
+ 1. ALWAYS run `npx starkfi@latest status` first to check if the user already has an active session. If they do, skip the login flow — just inform them.
40
+ 2. After `auth login`, you MUST wait for the user to provide their OTP code. Do NOT ask more than once; just say you're waiting.
41
+ 3. After `auth verify`, you MUST run `npx starkfi@latest status` to confirm the session is active.
42
+ 4. `deploy` is idempotent — it's safe to run multiple times. It deploys the smart account contract on-chain if not already deployed.
43
+ 5. If any other skill reports `Not authenticated`, direct the user to this skill.
44
+
45
+ ## Commands
46
+
47
+ ```bash
48
+ # Step 1: Send OTP to email
49
+ npx starkfi@latest auth login <email>
50
+
51
+ # Step 2: Verify OTP code
52
+ npx starkfi@latest auth verify <email> <code>
53
+
54
+ # Check session status
55
+ npx starkfi@latest status
56
+
57
+ # Display wallet address
58
+ npx starkfi@latest address
59
+
60
+ # Deploy smart account on-chain
61
+ npx starkfi@latest deploy
62
+
63
+ # End session
64
+ npx starkfi@latest auth logout
65
+ ```
66
+
67
+ ## Parameters
68
+
69
+ | Parameter | Type | Description | Required |
70
+ | --------- | ------ | ---------------------------- | -------- |
71
+ | `email` | string | User's email address | Yes |
72
+ | `code` | string | One-time password from email | Yes |
73
+
74
+ ## Examples
75
+
76
+ **User:** "Log me in with user@example.com"
77
+
78
+ ```bash
79
+ npx starkfi@latest status
80
+ # If not authenticated:
81
+ npx starkfi@latest auth login user@example.com
82
+ # Wait for user to provide OTP code (e.g. "123456")
83
+ npx starkfi@latest auth verify user@example.com 123456
84
+ npx starkfi@latest status
85
+ ```
86
+
87
+ **User:** "What's my wallet address?"
88
+
89
+ ```bash
90
+ npx starkfi@latest address
91
+ ```
92
+
93
+ **User:** "Deploy my account"
94
+
95
+ ```bash
96
+ npx starkfi@latest deploy
97
+ ```
98
+
99
+ **User:** "Log me out"
100
+
101
+ ```bash
102
+ npx starkfi@latest auth logout
103
+ ```
104
+
105
+ ## Error Handling
106
+
107
+ | Error | Action |
108
+ | ---------------------- | --------------------------------------------------------------------------- |
109
+ | `Invalid OTP code` | Ask the user to check their email and retry `auth verify`. |
110
+ | `Session expired` | Restart from `auth login`. |
111
+ | `Server unreachable` | Ensure `starkfi-server` is running at the configured URL. |
112
+ | `Rate limit` | Wait 60 seconds before retrying. |
113
+ | `Deployment failed` | Check balance — send ETH/STRK to the address, or enable gasfree mode first. |
114
+ | `Insufficient balance` | For deploy: `npx starkfi@latest config set-gasfree on` to bypass gas costs. |
115
+
116
+ ## Related Skills
117
+
118
+ - All other skills depend on this skill — if any reports `Not authenticated`, use this.
119
+ - Use `config` to enable gasfree mode if the user can't afford deployment gas.
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: balance
3
+ description: Check Starknet wallet token balances — STRK, ETH, and all ERC-20 tokens. Use this skill when the user asks about their balance, holdings, funds, tokens, or wants to know how much of something they have. Also use before any transaction to verify sufficient funds.
4
+ license: MIT
5
+ compatibility: Requires Node.js 18+ and npx.
6
+ metadata:
7
+ version: 0.1.0
8
+ author: ahmetenesdur
9
+ category: wallet-data
10
+ allowed-tools:
11
+ - Bash(npx starkfi@latest balance)
12
+ - Bash(npx starkfi@latest balance *)
13
+ - Bash(npx starkfi@latest status)
14
+ ---
15
+
16
+ # Check Balance
17
+
18
+ Fetch wallet holdings on Starknet: STRK, ETH, and all ERC-20 tokens with non-zero balances.
19
+
20
+ ## Prerequisites
21
+
22
+ - Active session required. If not authenticated, run `authenticate-wallet` skill first.
23
+
24
+ ## Rules
25
+
26
+ 1. If the user asks to check a specific token, use `--token <symbol>`.
27
+ 2. If no token is specified, run `balance` without flags to show all balances.
28
+ 3. Use `--json` when the output will be consumed by another skill or pipeline.
29
+ 4. Run this BEFORE `send`, `trade`, `multi-swap`, or any transactional skill to verify sufficient funds.
30
+
31
+ ## Commands
32
+
33
+ ```bash
34
+ # All token balances
35
+ npx starkfi@latest balance [--json]
36
+
37
+ # Specific token balance
38
+ npx starkfi@latest balance --token <symbol> [--json]
39
+ ```
40
+
41
+ ## Parameters
42
+
43
+ | Parameter | Type | Description | Required |
44
+ | --------- | ------ | ----------------------------------------- | -------- |
45
+ | `--token` | string | Token symbol (e.g. `STRK`, `ETH`, `USDC`) | No |
46
+ | `--json` | flag | Output as JSON | No |
47
+
48
+ ## Examples
49
+
50
+ **User:** "Check my balance"
51
+
52
+ ```bash
53
+ npx starkfi@latest balance
54
+ ```
55
+
56
+ **User:** "How much STRK do I have?"
57
+
58
+ ```bash
59
+ npx starkfi@latest balance --token STRK
60
+ ```
61
+
62
+ **User:** "Get my balances as JSON"
63
+
64
+ ```bash
65
+ npx starkfi@latest balance --json
66
+ ```
67
+
68
+ ## Error Handling
69
+
70
+ | Error | Action |
71
+ | ------------------- | ---------------------------------------------------------------- |
72
+ | `Not authenticated` | Run `authenticate-wallet` skill first. |
73
+ | `Network error` | Retry once. If persistent, use `config` skill to set custom RPC. |
74
+
75
+ ## Related Skills
76
+
77
+ - Run this BEFORE `send` or `trade` to verify sufficient funds.
78
+ - Run this BEFORE `staking` to confirm available STRK/BTC tokens.
79
+ - Run this BEFORE `lending` supply operations to confirm available assets.
80
+ - Use `portfolio` for a complete view including staking and lending positions with USD values.
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: batch
3
+ description: Execute multiple different DeFi operations in a single Starknet transaction — combine swaps, staking, lending supply, and token sends into one multicall. Use this skill when the user wants to batch, combine, or chain multiple diverse operations together, such as "swap ETH and then stake STRK" in one go.
4
+ license: MIT
5
+ compatibility: Requires Node.js 18+ and npx.
6
+ metadata:
7
+ version: 0.1.0
8
+ author: ahmetenesdur
9
+ category: transaction
10
+ allowed-tools:
11
+ - Bash(npx starkfi@latest batch *)
12
+ - Bash(npx starkfi@latest status)
13
+ - Bash(npx starkfi@latest balance)
14
+ - Bash(npx starkfi@latest balance *)
15
+ - Bash(npx starkfi@latest tx-status *)
16
+ ---
17
+
18
+ # Batch Execute
19
+
20
+ Bundle multiple diverse DeFi operations into a single Starknet multicall transaction. Supports combining **swaps**, **staking**, **lending supply**, and **token sends** — all executed atomically in one on-chain call.
21
+
22
+ ## Prerequisites
23
+
24
+ - Active session required.
25
+ - Sufficient balance for all operations + gas fees.
26
+ - Minimum **2 operations** required per batch.
27
+
28
+ ## Rules
29
+
30
+ 1. BEFORE any batch, you MUST run `npx starkfi@latest status` and `npx starkfi@latest balance` to verify connectivity and funds.
31
+ 2. A batch MUST include at least **2 operations**. For single operations, use the dedicated skill (`trade`, `send`, `staking`, or `lending`).
32
+ 3. Each `--swap`, `--stake`, `--supply`, and `--send` flag can appear **multiple times** (repeatable).
33
+ 4. Suggest using `--simulate` first to verify the entire batch would succeed.
34
+ 5. AFTER a successful batch, verify with `npx starkfi@latest tx-status <hash>`.
35
+ 6. All operations in a batch are **atomic** — if any one fails, the entire transaction reverts.
36
+
37
+ ## Commands
38
+
39
+ ```bash
40
+ npx starkfi@latest batch [--simulate] [--json] \
41
+ --swap "<amount> <from> <to>" \
42
+ --stake "<amount> <token> <validator_or_pool>" \
43
+ --supply "<amount> <token> <pool_address>" \
44
+ --send "<amount> <token> <recipient>"
45
+ ```
46
+
47
+ ## Operation Formats
48
+
49
+ | Flag | Format | Example |
50
+ | ---------- | ------------------------------------------ | ------------------------------- |
51
+ | `--swap` | `"<amount> <from> <to>"` | `--swap "100 USDC ETH"` |
52
+ | `--stake` | `"<amount> <token> <validator_or_0xPool>"` | `--stake "500 STRK Juno"` |
53
+ | `--supply` | `"<amount> <token> <0xPool>"` | `--supply "100 USDC 0x04a3..."` |
54
+ | `--send` | `"<amount> <token> <0xRecipient>"` | `--send "10 STRK 0x07b2..."` |
55
+
56
+ > **Note:** `--stake` accepts either a validator name (e.g. `Juno`) or a pool contract address (starting with `0x`). The CLI auto-detects the format.
57
+
58
+ ## Parameters
59
+
60
+ | Parameter | Type | Description | Required |
61
+ | ------------ | ------ | ------------------------------------- | -------- |
62
+ | `--swap` | string | Swap operation (repeatable) | No\* |
63
+ | `--stake` | string | Stake operation (repeatable) | No\* |
64
+ | `--supply` | string | Lending supply operation (repeatable) | No\* |
65
+ | `--send` | string | Token transfer operation (repeatable) | No\* |
66
+ | `--simulate` | flag | Estimate fees without broadcasting | No |
67
+ | `--json` | flag | Output as JSON | No |
68
+
69
+ \*At least 2 operations (of any type) are required.
70
+
71
+ ## Examples
72
+
73
+ **User:** "Swap 100 USDC to ETH and stake 500 STRK with Juno in one transaction"
74
+
75
+ ```bash
76
+ npx starkfi@latest status
77
+ npx starkfi@latest balance
78
+ npx starkfi@latest batch --swap "100 USDC ETH" --stake "500 STRK Juno"
79
+ npx starkfi@latest tx-status <hash>
80
+ ```
81
+
82
+ **User:** "Batch: swap 50 USDT to STRK, supply 100 USDC and send 10 STRK"
83
+
84
+ ```bash
85
+ npx starkfi@latest status
86
+ npx starkfi@latest balance
87
+ npx starkfi@latest batch \
88
+ --swap "50 USDT STRK" \
89
+ --supply "100 USDC 0x04a3..." \
90
+ --send "10 STRK 0x07b2..."
91
+ npx starkfi@latest tx-status <hash>
92
+ ```
93
+
94
+ **User:** "Simulate a batch of two swaps and a stake"
95
+
96
+ ```bash
97
+ npx starkfi@latest batch --simulate \
98
+ --swap "100 USDC ETH" \
99
+ --swap "200 USDT STRK" \
100
+ --stake "500 STRK Juno"
101
+ ```
102
+
103
+ ## Error Handling
104
+
105
+ | Error | Action |
106
+ | ------------------------ | ------------------------------------------------------------- |
107
+ | `Too few operations` | At least 2 operations required. Use dedicated skills instead. |
108
+ | `Insufficient balance` | Check `balance` for all required tokens. |
109
+ | `Invalid validator/pool` | Run `validators`/`pools` to find valid names/addresses. |
110
+ | `Simulation failed` | One of the operations would revert. Check each individually. |
111
+ | `Not authenticated` | Run `authenticate-wallet` skill first. |
112
+
113
+ ## Related Skills
114
+
115
+ - Use `trade` for a single swap.
116
+ - Use `staking` for standalone staking operations.
117
+ - Use `lending` for standalone lending operations.
118
+ - Use `send` for standalone token transfers.