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.
- package/MCP.md +70 -0
- package/README.md +120 -58
- package/dist/commands/auth/login.js +2 -2
- package/dist/commands/auth/login.js.map +1 -1
- package/dist/commands/auth/verify.d.ts.map +1 -1
- package/dist/commands/auth/verify.js +2 -2
- package/dist/commands/auth/verify.js.map +1 -1
- package/dist/commands/batch/batch.d.ts +3 -0
- package/dist/commands/batch/batch.d.ts.map +1 -0
- package/dist/commands/batch/batch.js +143 -0
- package/dist/commands/batch/batch.js.map +1 -0
- package/dist/commands/chain/tx-status.js +2 -2
- package/dist/commands/chain/tx-status.js.map +1 -1
- package/dist/commands/config/config.d.ts.map +1 -1
- package/dist/commands/config/config.js +14 -31
- package/dist/commands/config/config.js.map +1 -1
- package/dist/commands/lending/lending.d.ts +1 -0
- package/dist/commands/lending/lending.d.ts.map +1 -1
- package/dist/commands/lending/lending.js +187 -48
- package/dist/commands/lending/lending.js.map +1 -1
- package/dist/commands/portfolio/portfolio.d.ts +3 -0
- package/dist/commands/portfolio/portfolio.d.ts.map +1 -0
- package/dist/commands/portfolio/portfolio.js +76 -0
- package/dist/commands/portfolio/portfolio.js.map +1 -0
- package/dist/commands/staking/staking.d.ts +1 -1
- package/dist/commands/staking/staking.d.ts.map +1 -1
- package/dist/commands/staking/staking.js +142 -61
- package/dist/commands/staking/staking.js.map +1 -1
- package/dist/commands/trade/multi-swap.d.ts +3 -0
- package/dist/commands/trade/multi-swap.d.ts.map +1 -0
- package/dist/commands/trade/multi-swap.js +140 -0
- package/dist/commands/trade/multi-swap.js.map +1 -0
- package/dist/commands/trade/status.js +2 -2
- package/dist/commands/trade/status.js.map +1 -1
- package/dist/commands/trade/swap.d.ts.map +1 -1
- package/dist/commands/trade/swap.js +45 -10
- package/dist/commands/trade/swap.js.map +1 -1
- package/dist/commands/wallet/balance.d.ts.map +1 -1
- package/dist/commands/wallet/balance.js +19 -2
- package/dist/commands/wallet/balance.js.map +1 -1
- package/dist/commands/wallet/deploy.d.ts.map +1 -1
- package/dist/commands/wallet/deploy.js +2 -1
- package/dist/commands/wallet/deploy.js.map +1 -1
- package/dist/commands/wallet/send.d.ts.map +1 -1
- package/dist/commands/wallet/send.js +45 -8
- package/dist/commands/wallet/send.js.map +1 -1
- package/dist/index.js +22 -7
- package/dist/index.js.map +1 -1
- package/dist/lib/banner.d.ts +6 -0
- package/dist/lib/banner.d.ts.map +1 -0
- package/dist/lib/banner.js +78 -0
- package/dist/lib/banner.js.map +1 -0
- package/dist/lib/config.d.ts +0 -11
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +0 -20
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/errors.d.ts +2 -0
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/errors.js +2 -0
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/format.d.ts +43 -2
- package/dist/lib/format.d.ts.map +1 -1
- package/dist/lib/format.js +51 -5
- package/dist/lib/format.js.map +1 -1
- package/dist/lib/retry.d.ts +15 -0
- package/dist/lib/retry.d.ts.map +1 -0
- package/dist/lib/retry.js +29 -0
- package/dist/lib/retry.js.map +1 -0
- package/dist/lib/validation.d.ts +0 -12
- package/dist/lib/validation.d.ts.map +1 -1
- package/dist/lib/validation.js +1 -23
- package/dist/lib/validation.js.map +1 -1
- package/dist/mcp/handlers/batch.d.ts +13 -0
- package/dist/mcp/handlers/batch.d.ts.map +1 -0
- package/dist/mcp/handlers/batch.js +33 -0
- package/dist/mcp/handlers/batch.js.map +1 -0
- package/dist/mcp/handlers/config.d.ts +1 -1
- package/dist/mcp/handlers/config.d.ts.map +1 -1
- package/dist/mcp/handlers/config.js +11 -12
- package/dist/mcp/handlers/config.js.map +1 -1
- package/dist/mcp/handlers/index.d.ts +3 -0
- package/dist/mcp/handlers/index.d.ts.map +1 -1
- package/dist/mcp/handlers/index.js +3 -0
- package/dist/mcp/handlers/index.js.map +1 -1
- package/dist/mcp/handlers/lending.d.ts +12 -1
- package/dist/mcp/handlers/lending.d.ts.map +1 -1
- package/dist/mcp/handlers/lending.js +67 -23
- package/dist/mcp/handlers/lending.js.map +1 -1
- package/dist/mcp/handlers/multi-swap.d.ts +27 -0
- package/dist/mcp/handlers/multi-swap.d.ts.map +1 -0
- package/dist/mcp/handlers/multi-swap.js +73 -0
- package/dist/mcp/handlers/multi-swap.js.map +1 -0
- package/dist/mcp/handlers/portfolio.d.ts +7 -0
- package/dist/mcp/handlers/portfolio.d.ts.map +1 -0
- package/dist/mcp/handlers/portfolio.js +11 -0
- package/dist/mcp/handlers/portfolio.js.map +1 -0
- package/dist/mcp/handlers/staking.d.ts +13 -1
- package/dist/mcp/handlers/staking.d.ts.map +1 -1
- package/dist/mcp/handlers/staking.js +18 -5
- package/dist/mcp/handlers/staking.js.map +1 -1
- package/dist/mcp/handlers/trade.d.ts +1 -0
- package/dist/mcp/handlers/trade.d.ts.map +1 -1
- package/dist/mcp/handlers/trade.js +23 -9
- package/dist/mcp/handlers/trade.js.map +1 -1
- package/dist/mcp/handlers/wallet.d.ts +1 -0
- package/dist/mcp/handlers/wallet.d.ts.map +1 -1
- package/dist/mcp/handlers/wallet.js +16 -1
- package/dist/mcp/handlers/wallet.js.map +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +102 -33
- package/dist/mcp/tools.js.map +1 -1
- package/dist/services/api/client.d.ts +0 -12
- package/dist/services/api/client.d.ts.map +1 -1
- package/dist/services/api/client.js +3 -8
- package/dist/services/api/client.js.map +1 -1
- package/dist/services/auth/session.d.ts +1 -7
- package/dist/services/auth/session.d.ts.map +1 -1
- package/dist/services/auth/session.js +20 -0
- package/dist/services/auth/session.js.map +1 -1
- package/dist/services/batch/batch.d.ts +36 -0
- package/dist/services/batch/batch.d.ts.map +1 -0
- package/dist/services/batch/batch.js +111 -0
- package/dist/services/batch/batch.js.map +1 -0
- package/dist/services/config/config.d.ts +4 -0
- package/dist/services/config/config.d.ts.map +1 -1
- package/dist/services/config/config.js +31 -1
- package/dist/services/config/config.js.map +1 -1
- package/dist/services/fibrous/config.d.ts +4 -0
- package/dist/services/fibrous/config.d.ts.map +1 -0
- package/dist/services/fibrous/config.js +4 -0
- package/dist/services/fibrous/config.js.map +1 -0
- package/dist/services/fibrous/health.js +1 -1
- package/dist/services/fibrous/health.js.map +1 -1
- package/dist/services/fibrous/route.d.ts +19 -6
- package/dist/services/fibrous/route.d.ts.map +1 -1
- package/dist/services/fibrous/route.js +64 -3
- package/dist/services/fibrous/route.js.map +1 -1
- package/dist/services/portfolio/portfolio.d.ts +35 -0
- package/dist/services/portfolio/portfolio.d.ts.map +1 -0
- package/dist/services/portfolio/portfolio.js +106 -0
- package/dist/services/portfolio/portfolio.js.map +1 -0
- package/dist/services/simulate/simulate.d.ts +18 -0
- package/dist/services/simulate/simulate.d.ts.map +1 -0
- package/dist/services/simulate/simulate.js +61 -0
- package/dist/services/simulate/simulate.js.map +1 -0
- package/dist/services/staking/staking.d.ts +5 -13
- package/dist/services/staking/staking.d.ts.map +1 -1
- package/dist/services/staking/staking.js +44 -52
- package/dist/services/staking/staking.js.map +1 -1
- package/dist/services/starkzap/client.d.ts.map +1 -1
- package/dist/services/starkzap/client.js +38 -18
- package/dist/services/starkzap/client.js.map +1 -1
- package/dist/services/starkzap/config.d.ts +6 -0
- package/dist/services/starkzap/config.d.ts.map +1 -0
- package/dist/services/starkzap/config.js +13 -0
- package/dist/services/starkzap/config.js.map +1 -0
- package/dist/services/tokens/balances.d.ts.map +1 -1
- package/dist/services/tokens/balances.js +26 -14
- package/dist/services/tokens/balances.js.map +1 -1
- package/dist/services/tokens/tokens.d.ts +2 -3
- package/dist/services/tokens/tokens.d.ts.map +1 -1
- package/dist/services/tokens/tokens.js +3 -8
- package/dist/services/tokens/tokens.js.map +1 -1
- package/dist/services/vesu/api.d.ts +28 -0
- package/dist/services/vesu/api.d.ts.map +1 -0
- package/dist/services/vesu/api.js +97 -0
- package/dist/services/vesu/api.js.map +1 -0
- package/dist/services/vesu/config.d.ts +9 -0
- package/dist/services/vesu/config.d.ts.map +1 -0
- package/dist/services/vesu/config.js +32 -0
- package/dist/services/vesu/config.js.map +1 -0
- package/dist/services/vesu/index.d.ts +2 -0
- package/dist/services/vesu/index.d.ts.map +1 -1
- package/dist/services/vesu/index.js +2 -0
- package/dist/services/vesu/index.js.map +1 -1
- package/dist/services/vesu/lending.d.ts +8 -1
- package/dist/services/vesu/lending.d.ts.map +1 -1
- package/dist/services/vesu/lending.js +171 -52
- package/dist/services/vesu/lending.js.map +1 -1
- package/dist/services/vesu/pools.d.ts +5 -11
- package/dist/services/vesu/pools.d.ts.map +1 -1
- package/dist/services/vesu/pools.js +11 -31
- package/dist/services/vesu/pools.js.map +1 -1
- package/package.json +88 -82
- package/skills/README.md +63 -0
- package/skills/authenticate-wallet/SKILL.md +119 -0
- package/skills/balance/SKILL.md +80 -0
- package/skills/batch/SKILL.md +118 -0
- package/skills/config/SKILL.md +144 -0
- package/skills/lending/SKILL.md +209 -0
- package/skills/multi-swap/SKILL.md +95 -0
- package/skills/portfolio/SKILL.md +82 -0
- package/skills/send/SKILL.md +82 -0
- package/skills/staking/SKILL.md +188 -0
- package/skills/trade/SKILL.md +92 -0
package/package.json
CHANGED
|
@@ -1,83 +1,89 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
+
}
|
package/skills/README.md
ADDED
|
@@ -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.
|