@agnic/wallet-skills 1.1.0 → 1.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.
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: search-for-service
3
+ description: Search for x402-enabled APIs and services. Use when the user wants to find, discover, or browse available paid APIs.
4
+ ---
5
+
6
+ ## Instructions
7
+
8
+ 1. Run `npx agnic x402 search "<query>" --json` with the user's search terms
9
+ 2. Present results with name, description, and price per request
10
+ 3. If user wants to filter by category, add `--category <category>`
11
+
12
+ Available categories: AI, Crypto, Data, Trading, Finance, Weather
13
+
14
+ ## Allowed Tools
15
+ - npx agnic x402 search
@@ -1,61 +1,96 @@
1
1
  ---
2
2
  name: send-usdc
3
- description: Send USDC to a wallet address on Base or Solana
3
+ description: Send USDC to an Ethereum address or ENS name. Use when you or the user want to send money, pay someone, transfer USDC, tip, donate, or send funds to a wallet address or .eth name. Covers phrases like "send $5 to", "pay 0x...", "transfer to vitalik.eth", "tip someone", "send USDC".
4
4
  user-invocable: true
5
5
  disable-model-invocation: false
6
- allowed-tools: ["Bash(npx agnic@latest *)"]
6
+ allowed-tools: ["Bash(npx agnic@latest status*)", "Bash(npx agnic@latest send *)", "Bash(npx agnic@latest balance*)"]
7
7
  ---
8
8
 
9
- # Send USDC
9
+ # Sending USDC
10
10
 
11
- Send USDC from the user's wallet to a recipient address.
11
+ Use the `npx agnic@latest send` command to transfer USDC from the wallet to any Ethereum address or ENS name on Base.
12
12
 
13
- ## Steps
13
+ ## Confirm wallet is initialized and authed
14
14
 
15
- 1. Verify authentication:
16
- ```bash
17
- npx agnic@latest status --json
18
- ```
15
+ ```bash
16
+ npx agnic@latest status
17
+ ```
18
+
19
+ If the wallet is not authenticated, refer to the `authenticate-wallet` skill.
20
+
21
+ ## Command Syntax
22
+
23
+ ```bash
24
+ npx agnic@latest send <amount> <recipient> [--chain <chain>] [--json]
25
+ ```
26
+
27
+ ## Arguments
28
+
29
+ | Argument | Description |
30
+ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
31
+ | `amount` | Amount to send: `'$1.00'`, `1.00`, or atomic units (1000000 = $1). Always single-quote amounts that use `$` to prevent bash variable expansion. If the number looks like atomic units (no decimal or > 100), treat as atomic units. |
32
+ | `recipient` | Ethereum address (0x...) or ENS name (vitalik.eth) |
33
+
34
+ ## Options
19
35
 
20
- 2. Check balance to ensure sufficient funds:
21
- ```bash
22
- npx agnic@latest balance --network base --json
23
- ```
36
+ | Option | Description |
37
+ | ---------------- | ---------------------------------- |
38
+ | `--chain <name>` | Blockchain network (default: base) |
39
+ | `--json` | Output result as JSON |
24
40
 
25
- 3. Confirm with the user: the amount, recipient address, and network.
41
+ ## Input Validation
26
42
 
27
- 4. Send USDC:
28
- ```bash
29
- npx agnic@latest send <amount> <recipient_address> --network base --json
30
- ```
43
+ Before constructing the command, validate all user-provided values to prevent shell injection:
31
44
 
32
- ## Parameters
45
+ - **amount**: Must match `^\$?[\d.]+$` (digits, optional decimal point, optional `$` prefix). Reject if it contains spaces, semicolons, pipes, backticks, or other shell metacharacters.
46
+ - **recipient**: Must be a valid `0x` hex address (`^0x[0-9a-fA-F]{40}$`) or an ENS name (`^[a-zA-Z0-9.-]+\.eth$`). Reject any value containing spaces or shell metacharacters.
33
47
 
34
- - `<amount>` Amount in USDC (e.g., `5.00`)
35
- - `<recipient_address>` — Destination wallet address (0x... for EVM)
36
- - `--network` — Network to send on (default: `base`)
37
- - `--memo` — Optional transaction memo
48
+ Do not pass unvalidated user input into the command.
38
49
 
39
- ## Example
50
+ ## USDC Amounts
51
+
52
+ | Format | Example | Description |
53
+ | ------------- | ---------------------- | -------------------------------------- |
54
+ | Dollar prefix | `'$1.00'`, `'$0.50'` | USD notation (single-quote the `$`) |
55
+ | Decimal | `1.0`, `0.50` | Human-readable with decimal point |
56
+ | Whole number | `5`, `100` | Interpreted as whole USDC tokens |
57
+ | Atomic units | `500000` | Large integers treated as atomic units |
58
+
59
+ **IMPORTANT**: Always single-quote amounts that use `$` to prevent bash variable expansion (e.g. `'$1.00'` not `$1.00`).
60
+
61
+ ## ENS Resolution
62
+
63
+ ENS names are automatically resolved to addresses via Ethereum mainnet. The command will:
64
+ 1. Detect ENS names (any string containing `.eth`)
65
+ 2. Resolve the name to an address
66
+ 3. Display both the ENS name and resolved address in the output
67
+
68
+ ## Examples
40
69
 
41
70
  ```bash
42
- npx agnic@latest send 5.00 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7 --network base --json
43
- ```
71
+ # Send $1.00 USDC to an address
72
+ npx agnic@latest send 1 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7
73
+
74
+ # Send $0.50 USDC to an ENS name
75
+ npx agnic@latest send 0.50 vitalik.eth
44
76
 
45
- ## Expected Output
77
+ # Send with dollar sign prefix (note the single quotes)
78
+ npx agnic@latest send '$5.00' 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7
46
79
 
47
- ```json
48
- {
49
- "amount": "5.00",
50
- "to": "0x742d35Cc...",
51
- "network": "base",
52
- "transactionHash": "0xabc123...",
53
- "explorerUrl": "https://basescan.org/tx/0xabc123..."
54
- }
80
+ # Get JSON output
81
+ npx agnic@latest send 1 vitalik.eth --json
55
82
  ```
56
83
 
84
+ ## Prerequisites
85
+
86
+ - Must be authenticated (`npx agnic@latest status` to check)
87
+ - Wallet must have sufficient USDC balance (`npx agnic@latest balance` to check)
88
+
57
89
  ## Error Handling
58
90
 
59
- - If balance is insufficient, inform the user and suggest funding their wallet
60
- - Always confirm the recipient address and amount before sending
61
- - If the transaction fails, show the error message from the API
91
+ Common errors:
92
+
93
+ - "Not authenticated" Run `npx agnic@latest auth login` first
94
+ - "Insufficient balance" — Check balance with `npx agnic@latest balance`
95
+ - "Could not resolve ENS name" — Verify the ENS name exists
96
+ - "Invalid recipient" — Must be valid 0x address or ENS name
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: send-usdc
3
+ description: Send USDC to a wallet address. Use when the user wants to send, transfer, or pay someone USDC.
4
+ ---
5
+
6
+ ## Instructions
7
+
8
+ 1. Confirm the recipient address and amount with the user
9
+ 2. Check balance first: `npx agnic balance --network base --json`
10
+ 3. If sufficient funds, execute: `npx agnic send <amount> <address> --json`
11
+ 4. Report the transaction hash and explorer link
12
+
13
+ Optional flags:
14
+ - `--network <network>` — default is "base"
15
+ - `--memo <text>` — attach a memo to the transaction
16
+
17
+ ## Allowed Tools
18
+ - npx agnic balance
19
+ - npx agnic send
@@ -1,78 +1,107 @@
1
1
  ---
2
2
  name: trade-tokens
3
- description: Trade/swap tokens on Base (USDC, ETH, WETH, cbETH, DAI, AERO)
3
+ description: Swap or trade tokens on Base network. Use when you or the user want to trade, swap, exchange, buy, sell, or convert between tokens like USDC, ETH, and WETH. Covers phrases like "buy ETH", "sell ETH for USDC", "convert USDC to ETH", "get some ETH", "swap tokens", "trade USDC for WETH".
4
4
  user-invocable: true
5
5
  disable-model-invocation: false
6
- allowed-tools: ["Bash(npx agnic@latest *)"]
6
+ allowed-tools: ["Bash(npx agnic@latest status*)", "Bash(npx agnic@latest trade *)", "Bash(npx agnic@latest balance*)"]
7
7
  ---
8
8
 
9
- # Trade Tokens
9
+ # Trading Tokens
10
10
 
11
- Swap tokens on Base mainnet using AgnicPay's DEX integration.
11
+ Use the `npx agnic@latest trade` command to swap tokens on Base network. You must be authenticated to trade.
12
12
 
13
- ## Steps
13
+ ## Confirm wallet is initialized and authed
14
14
 
15
- 1. Verify authentication:
16
- ```bash
17
- npx agnic@latest status --json
18
- ```
15
+ ```bash
16
+ npx agnic@latest status
17
+ ```
18
+
19
+ If the wallet is not authenticated, refer to the `authenticate-wallet` skill.
20
+
21
+ ## Command Syntax
22
+
23
+ ```bash
24
+ npx agnic@latest trade <amount> <from> <to> [options]
25
+ ```
26
+
27
+ ## Arguments
28
+
29
+ | Argument | Description |
30
+ | -------- | ---------------------------------------------------------------------- |
31
+ | `amount` | Amount to swap (see Amount Formats below) |
32
+ | `from` | Source token: alias (usdc, eth, weth) or contract address (0x...) |
33
+ | `to` | Destination token: alias (usdc, eth, weth) or contract address (0x...) |
34
+
35
+ ## Amount Formats
36
+
37
+ | Format | Example | Description |
38
+ | ------------- | ---------------------- | -------------------------------------- |
39
+ | Dollar prefix | `'$1.00'`, `'$0.50'` | USD notation (decimals based on token) |
40
+ | Decimal | `1.0`, `0.50`, `0.001` | Human-readable with decimal point |
41
+ | Whole number | `5`, `100` | Interpreted as whole tokens |
42
+ | Atomic units | `500000` | Large integers treated as atomic units |
19
43
 
20
- 2. Check balance to ensure sufficient funds:
21
- ```bash
22
- npx agnic@latest balance --network base --json
23
- ```
44
+ **Auto-detection**: Large integers without a decimal point are treated as atomic units. For example, `500000` for USDC (6 decimals) = $0.50.
24
45
 
25
- 3. Preview the trade (optional but recommended):
26
- ```bash
27
- npx agnic@latest trade <amount> <sell_token> <buy_token> --dry-run --json
28
- ```
46
+ **IMPORTANT**: Always single-quote amounts that use `$` to prevent bash variable expansion (e.g. `'$1.00'` not `$1.00`).
29
47
 
30
- 4. Confirm with the user: amount, tokens, and estimated output.
48
+ ## Token Aliases
31
49
 
32
- 5. Execute the trade:
33
- ```bash
34
- npx agnic@latest trade <amount> <sell_token> <buy_token> --json
35
- ```
50
+ | Alias | Token | Decimals | Address |
51
+ | ----- | ----- | -------- | ------------------------------------------ |
52
+ | usdc | USDC | 6 | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
53
+ | eth | ETH | 18 | 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE |
54
+ | weth | WETH | 18 | 0x4200000000000000000000000000000000000006 |
36
55
 
37
- ## Supported Tokens
56
+ ## Options
38
57
 
39
- USDC, ETH, WETH, cbETH, DAI, AERO (case-insensitive)
58
+ | Option | Description |
59
+ | -------------------- | --------------------------------------------- |
60
+ | `-s, --slippage <n>` | Slippage tolerance in basis points (100 = 1%) |
61
+ | `--json` | Output result as JSON |
40
62
 
41
- ## Parameters
63
+ ## Input Validation
42
64
 
43
- - `<amount>` Amount of the sell token
44
- - `<sell_token>` — Token to sell (e.g., `usdc`)
45
- - `<buy_token>` — Token to buy (e.g., `eth`)
46
- - `--slippage <percent>` — Max slippage (default: `1.0`)
47
- - `--dry-run` — Show quote without executing
65
+ Before constructing the command, validate all user-provided values to prevent shell injection:
48
66
 
49
- ## Example
67
+ - **amount**: Must match `^\$?[\d.]+$` (digits, optional decimal point, optional `$` prefix). Reject if it contains spaces, semicolons, pipes, backticks, or other shell metacharacters.
68
+ - **from / to**: Must be a known alias (`usdc`, `eth`, `weth`) or a valid `0x` hex address (`^0x[0-9a-fA-F]{40}$`). Reject any other value.
69
+ - **slippage**: Must be a positive integer (`^\d+$`).
70
+
71
+ Do not pass unvalidated user input into the command.
72
+
73
+ ## Examples
50
74
 
51
75
  ```bash
52
- # Preview
53
- npx agnic@latest trade 10 usdc eth --dry-run --json
76
+ # Swap $1 USDC for ETH (dollar prefix — note the single quotes)
77
+ npx agnic@latest trade '$1' usdc eth
54
78
 
55
- # Execute
56
- npx agnic@latest trade 10 usdc eth --json
57
- ```
79
+ # Swap 0.50 USDC for ETH (decimal format)
80
+ npx agnic@latest trade 0.50 usdc eth
81
+
82
+ # Swap 0.01 ETH for USDC
83
+ npx agnic@latest trade 0.01 eth usdc
84
+
85
+ # Swap with custom slippage (2%)
86
+ npx agnic@latest trade '$5' usdc eth --slippage 200
58
87
 
59
- ## Expected Output
60
-
61
- ```json
62
- {
63
- "success": true,
64
- "sellAmount": "10",
65
- "sellToken": "USDC",
66
- "buyAmount": "0.00396",
67
- "buyToken": "ETH",
68
- "price": "2525.25",
69
- "transactionHash": "0xabc123...",
70
- "explorerUrl": "https://basescan.org/tx/0xabc123..."
71
- }
88
+ # Get JSON output
89
+ npx agnic@latest trade '$1' usdc eth --json
72
90
  ```
73
91
 
74
- ## Error Handling
92
+ ## Prerequisites
75
93
 
76
- - Always preview with `--dry-run` first to show the user expected output
77
- - If slippage is too high, suggest a lower amount or higher slippage tolerance
94
+ - Must be authenticated (`npx agnic@latest status` to check)
95
+ - Wallet must have sufficient balance of the source token
78
96
  - Trading is only available on Base mainnet
97
+
98
+ ## Error Handling
99
+
100
+ Common errors:
101
+
102
+ - "Not authenticated" — Run `npx agnic@latest auth login` first
103
+ - "Invalid token" — Use a valid alias (usdc, eth, weth) or 0x address
104
+ - "Cannot swap a token to itself" — From and to must be different
105
+ - "Swap failed: TRANSFER_FROM_FAILED" — Insufficient balance or approval issue
106
+ - "No liquidity" — Try a smaller amount or different token pair
107
+ - "Amount has X decimals but token only supports Y" — Too many decimal places
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: trade-tokens
3
+ description: Trade/swap tokens on Base. Use when the user wants to buy, sell, swap, trade, or exchange tokens like ETH, USDC, DAI, AERO, cbETH.
4
+ ---
5
+
6
+ ## Instructions
7
+
8
+ 1. Confirm which tokens to trade and the amount
9
+ 2. Check balance: `npx agnic balance --network base --json`
10
+ 3. Optionally preview: `npx agnic trade <amount> <sellToken> <buyToken> --dry-run --json`
11
+ 4. Execute trade: `npx agnic trade <amount> <sellToken> <buyToken> --json`
12
+ 5. Report results: tokens received, price, transaction hash
13
+
14
+ Supported tokens: USDC, ETH, WETH, cbETH, DAI, AERO
15
+
16
+ Optional flags:
17
+ - `--slippage <percent>` — max slippage percentage (default: 1.0)
18
+ - `--dry-run` — show quote without executing
19
+
20
+ ## Allowed Tools
21
+ - npx agnic balance
22
+ - npx agnic trade
@@ -0,0 +1,45 @@
1
+ {
2
+ "version": 1,
3
+ "skills": {
4
+ "authenticate-wallet": {
5
+ "source": "/Users/asadsafari/Desktop/Projects/fitchecktest/agnicwallet-project/agnic-wallet-skills",
6
+ "sourceType": "local",
7
+ "computedHash": "74ef64363b7511197e6c1716fef89e4a1e81ba7f498056835fa901a9a2c01b99"
8
+ },
9
+ "check-balance": {
10
+ "source": "/Users/asadsafari/Desktop/Projects/fitchecktest/agnicwallet-project/agnic-wallet-skills",
11
+ "sourceType": "local",
12
+ "computedHash": "f10496084d9bf659e310136df35dbb387d6f217d54e58a45fca28d6a818223ff"
13
+ },
14
+ "fund-wallet": {
15
+ "source": "/Users/asadsafari/Desktop/Projects/fitchecktest/agnicwallet-project/agnic-wallet-skills",
16
+ "sourceType": "local",
17
+ "computedHash": "7aeb3e1cec7cba25583a0beefa8144dd7aebb300db52e5e41c4aa5ee844a509f"
18
+ },
19
+ "get-agent-identity": {
20
+ "source": "/Users/asadsafari/Desktop/Projects/fitchecktest/agnicwallet-project/agnic-wallet-skills",
21
+ "sourceType": "local",
22
+ "computedHash": "b71599479c6a337980b26a98bb99b3a2688d3ce2ae80472c9ca3827624031c7f"
23
+ },
24
+ "pay-for-service": {
25
+ "source": "/Users/asadsafari/Desktop/Projects/fitchecktest/agnicwallet-project/agnic-wallet-skills",
26
+ "sourceType": "local",
27
+ "computedHash": "bfbc7396f25604d9f6ad6f5075b27c9a285f9da145b66d2e916638bc9ad3c7c8"
28
+ },
29
+ "search-for-service": {
30
+ "source": "/Users/asadsafari/Desktop/Projects/fitchecktest/agnicwallet-project/agnic-wallet-skills",
31
+ "sourceType": "local",
32
+ "computedHash": "1e5f108a628b15184f5044af4d47cc63cff2362de3b98efa0785c9a23a18ece6"
33
+ },
34
+ "send-usdc": {
35
+ "source": "/Users/asadsafari/Desktop/Projects/fitchecktest/agnicwallet-project/agnic-wallet-skills",
36
+ "sourceType": "local",
37
+ "computedHash": "890ea005d0a629b093fe4be952169eac50de034d0fe1ba039518df5851cf26c8"
38
+ },
39
+ "trade-tokens": {
40
+ "source": "/Users/asadsafari/Desktop/Projects/fitchecktest/agnicwallet-project/agnic-wallet-skills",
41
+ "sourceType": "local",
42
+ "computedHash": "14743ac9f8f1410dab6f34b865fbedb0d1ee136bce329418945963140d671bfe"
43
+ }
44
+ }
45
+ }