apow-cli 0.6.0 → 0.6.1

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/.env.example CHANGED
@@ -26,7 +26,7 @@ LLM_API_KEY=
26
26
  # SQUID_INTEGRATOR_ID=
27
27
 
28
28
  # Ethereum mainnet RPC (only for `apow fund --chain ethereum`)
29
- # Default: https://eth.llamarpc.com (free)
29
+ # Default: https://ethereum-rpc.publicnode.com (free)
30
30
  # ETHEREUM_RPC_URL=
31
31
 
32
32
  # Contract addresses (defaults built-in, override only if needed)
package/README.md CHANGED
@@ -116,7 +116,7 @@ LLM_MODEL=gpt-4o-mini # Required for minting only; mining uses optimized
116
116
  LLM_API_KEY=sk-... # Required for minting only
117
117
  # Bridging (only for `apow fund`)
118
118
  # SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
119
- # ETHEREUM_RPC_URL=https://eth.llamarpc.com # free, for `--chain ethereum` only
119
+ # ETHEREUM_RPC_URL=https://ethereum-rpc.publicnode.com # free, for `--chain ethereum` only
120
120
  # SQUID_INTEGRATOR_ID= # free, get at squidrouter.com (deposit address flow only)
121
121
  # Contract addresses (defaults built-in, override only if needed)
122
122
  # MINING_AGENT_ADDRESS=0xB7caD3ca5F2BD8aEC2Eb67d6E8D448099B3bC03D
@@ -131,7 +131,7 @@ async function bridgeFromSolana(solanaKeypair, baseAddress, amount, route = expo
131
131
  async function bridgeFromEvm(privateKey, baseAddress, amount, route = exports.ROUTES.eth_to_base_eth) {
132
132
  const startTime = Date.now();
133
133
  const evmAccount = (0, accounts_1.privateKeyToAccount)(privateKey);
134
- const rpcUrl = process.env.ETHEREUM_RPC_URL ?? "https://eth.llamarpc.com";
134
+ const rpcUrl = process.env.ETHEREUM_RPC_URL ?? "https://ethereum-rpc.publicnode.com";
135
135
  const ethWalletClient = (0, viem_1.createWalletClient)({
136
136
  account: evmAccount,
137
137
  chain: chains_1.mainnet,
package/dist/errors.js CHANGED
@@ -118,11 +118,11 @@ const patterns = [
118
118
  }),
119
119
  },
120
120
  {
121
- test: (m) => m.includes("eth.llamarpc") || (m.includes("ETHEREUM_RPC") && m.includes("unreachable")),
121
+ test: (m) => m.includes("ethereum-rpc.publicnode") || (m.includes("ETHEREUM_RPC") && m.includes("unreachable")),
122
122
  classify: () => ({
123
123
  category: "setup",
124
124
  userMessage: "Ethereum mainnet RPC unreachable",
125
- recovery: "Set ETHEREUM_RPC_URL in .env (default: https://eth.llamarpc.com)",
125
+ recovery: "Set ETHEREUM_RPC_URL in .env (default: https://ethereum-rpc.publicnode.com)",
126
126
  }),
127
127
  },
128
128
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apow-cli",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Mine AGENT tokens on Base L2 with Agentic Proof of Work",
5
5
  "keywords": [
6
6
  "apow",
package/skill.md CHANGED
@@ -25,14 +25,7 @@ metadata:
25
25
  configure the miner, mint, and mine. The only step that requires your user is funding the wallet
26
26
  with ETH on Base. Everything else you handle yourself.
27
27
 
28
- > **IMPORTANT: You need a dedicated RPC endpoint.** The default public RPC (`https://mainnet.base.org`) has aggressive rate limits and **will cause minting and mining to fail**. Before starting, get a free Alchemy endpoint:
29
- >
30
- > 1. Go to [alchemy.com](https://www.alchemy.com/) and sign up (free, no credit card)
31
- > 2. Click **Create new app** → Name: `apow-miner` → Chain: **Base** → Network: **Base Mainnet**
32
- > 3. Copy the **HTTPS** URL: `https://base-mainnet.g.alchemy.com/v2/YOUR_API_KEY`
33
- > 4. Set `RPC_URL` to this URL in your `.env`
34
- >
35
- > Alchemy's free tier (300M compute units/month) is more than enough. See [RPC Recommendations](#rpc-recommendations) for alternatives.
28
+ > **RPC:** The CLI uses [Alchemy x402](https://x402.alchemy.com/) by default -- a premium Base RPC that charges per-request via USDC in your mining wallet. No API key, no account, no rate limits. Just fund your wallet with USDC (the `apow fund` command handles this automatically). If no USDC is available, it falls back to the public RPC. To use a custom RPC, set `RPC_URL` in `.env`.
36
29
 
37
30
  ---
38
31
 
@@ -78,10 +71,11 @@ MINING_AGENT_ADDRESS=0xB7caD3ca5F2BD8aEC2Eb67d6E8D448099B3bC03D
78
71
  AGENT_COIN_ADDRESS=0x12577CF0D8a07363224D6909c54C056A183e13b3
79
72
  EOF
80
73
 
81
- # 3. Fund the wallet (bridge from Solana or send ETH on Base)
82
- npx apow-cli fund --solana # interactive bridge SOL → ETH on Base
83
- # Or: npx apow-cli fund --solana --key <base58> # direct signing (~20s)
84
- # Or: ask your user to send ≥0.005 ETH on Base directly
74
+ # 3. Fund the wallet (bridge from any chain, auto-splits into ETH + USDC)
75
+ npx apow-cli fund --chain solana --token sol # bridge SOL → ETH+USDC on Base
76
+ # Or: npx apow-cli fund --chain solana --token sol --key <base58> # direct signing (~20s)
77
+ # Or: npx apow-cli fund --chain ethereum --token eth # bridge from Ethereum mainnet
78
+ # Or: ask your user to send ETH + USDC on Base directly
85
79
 
86
80
  # 4. Mint + mine (fully autonomous from here)
87
81
  npx apow-cli mint
@@ -158,26 +152,32 @@ Your mining wallet needs ETH on Base for gas and the mint fee.
158
152
 
159
153
  ### Built-in Bridge: `apow fund` (Recommended)
160
154
 
161
- The CLI has a built-in cross-chain bridge for Solana users:
155
+ The CLI accepts deposits in 6 forms across 3 chains, auto-bridges to Base, and auto-splits into ETH (gas) + USDC (x402 RPC):
162
156
 
163
157
  ```bash
164
- npx apow-cli fund # Interactive: choose funding method
165
- npx apow-cli fund --solana # Deposit address + QR code
166
- npx apow-cli fund --solana --key <base58> # Direct Solana signing (~20s)
167
- npx apow-cli fund --solana --amount 0.01 # Custom ETH target
158
+ npx apow-cli fund # Interactive: choose chain + token
159
+ npx apow-cli fund --chain solana --token sol # Bridge SOL → ETH+USDC on Base
160
+ npx apow-cli fund --chain solana --token sol --key <b58> # Direct Solana signing (~20s)
161
+ npx apow-cli fund --chain solana --token usdc # Bridge Solana USDC → Base
162
+ npx apow-cli fund --chain ethereum --token eth # Bridge ETH from mainnet
163
+ npx apow-cli fund --chain ethereum --token usdc # Bridge USDC from mainnet
164
+ npx apow-cli fund --chain base # Show address, wait for deposit
165
+ npx apow-cli fund --chain base --no-swap # Skip auto-split
168
166
  ```
169
167
 
170
- **Three funding paths:**
168
+ **Bridge methods per chain:**
169
+
170
+ | Chain | Direct signing | Deposit address |
171
+ |-------|---------------|-----------------|
172
+ | Solana | deBridge DLN (~20s, `--key`) | Squid Router (~1-3 min) |
173
+ | Ethereum | deBridge DLN (~20s, uses PRIVATE_KEY on mainnet) | Squid Router (~1-3 min) |
174
+ | Base | N/A (already on Base) | Show address + QR code |
171
175
 
172
- | Path | How it works | Speed | Requires Solana key? |
173
- |------|-------------|-------|---------------------|
174
- | Direct signing | deBridge DLN signs + submits via your Solana keypair | ~20 seconds | Yes (`--key`) |
175
- | Deposit address | Squid Router generates a Solana address; send from any wallet | ~1-3 minutes | No |
176
- | Manual | Shows your Base address + QR code | Varies | No |
176
+ **Auto-split:** After bridging, the CLI checks ETH and USDC balances. If either is below the minimum (0.003 ETH for gas, 2.00 USDC for x402 RPC), it swaps the needed amount via Uniswap V3 on Base. Use `--no-swap` to skip.
177
177
 
178
- **Direct signing (`--key`):** Provide your base58 Solana secret key. The CLI calls deBridge DLN to create a bridge order, signs the Solana transaction locally, submits it, and polls until ETH arrives on Base. No API key needed.
178
+ **Direct signing (Solana `--key`):** Provide your base58 Solana secret key. The CLI calls deBridge DLN to create a bridge order, signs the Solana transaction locally, submits it, and polls until funds arrive on Base. No API key needed.
179
179
 
180
- **Deposit address (`--solana` without `--key`):** Requires `SQUID_INTEGRATOR_ID` in `.env` (free, apply at [squidrouter.com](https://app.squidrouter.com/)). Generates a one-time Solana deposit address with a QR code. Send SOL from any wallet (Phantom, Backpack, etc.) and the bridge handles the rest.
180
+ **Deposit address (no `--key`):** Requires `SQUID_INTEGRATOR_ID` in `.env` (free, apply at [squidrouter.com](https://app.squidrouter.com/)). Generates a one-time deposit address with a QR code. Send tokens from any wallet and the bridge handles the rest.
181
181
 
182
182
  ### Manual Funding Options
183
183
 
@@ -277,9 +277,10 @@ CHAIN=base
277
277
  | `LLM_API_KEY` | For minting | - | API key for minting. Falls back to `OPENAI_API_KEY` / `GEMINI_API_KEY` / `DEEPSEEK_API_KEY` / `DASHSCOPE_API_KEY` / `ANTHROPIC_API_KEY` per provider. Not needed for `ollama` or mining. |
278
278
  | `LLM_MODEL` | For minting | `gpt-4o-mini` | Model identifier passed to the provider (minting only) |
279
279
  | `MINER_THREADS` | No | All CPU cores | Number of threads for parallel nonce grinding |
280
- | `RPC_URL` | **Strongly recommended** | `https://mainnet.base.org` | Base JSON-RPC endpoint. **The default public RPC is unreliable. Use Alchemy (free) or another dedicated provider.** |
280
+ | `RPC_URL` | No | Alchemy x402 | Base JSON-RPC endpoint. Default uses Alchemy x402 (premium, paid via USDC). Set to override with a custom endpoint. |
281
281
  | `CHAIN` | No | `base` | Network selector; auto-detects `baseSepolia` if RPC URL contains "sepolia" |
282
- | `SOLANA_RPC_URL` | No | `https://api.mainnet-beta.solana.com` | Solana RPC endpoint (only for `apow fund --solana`) |
282
+ | `SOLANA_RPC_URL` | No | `https://api.mainnet-beta.solana.com` | Solana RPC endpoint (only for `apow fund --chain solana`) |
283
+ | `ETHEREUM_RPC_URL` | No | `https://ethereum-rpc.publicnode.com` | Ethereum mainnet RPC (only for `apow fund --chain ethereum`) |
283
284
  | `SQUID_INTEGRATOR_ID` | No | - | Squid Router integrator ID for deposit address flow (free at [squidrouter.com](https://app.squidrouter.com/)) |
284
285
 
285
286
  ### LLM Provider Recommendations (for Minting)
@@ -635,10 +636,11 @@ The CLI makes only these network calls:
635
636
 
636
637
  1. **Blockchain RPC** (to user-configured RPC URL, default: `mainnet.base.org`): standard `eth_call`, `eth_sendRawTransaction`, etc.
637
638
  2. **LLM API** (to user-configured provider): sends only word-puzzle prompts for SMHL solving, never wallet data
638
- 3. **Bridge APIs** (only when using `apow fund --solana`):
639
+ 3. **Bridge APIs** (only when using `apow fund`):
639
640
  - **CoinGecko** (`api.coingecko.com`): SOL/ETH price quotes
640
641
  - **deBridge DLN** (`dln.debridge.finance`): bridge order creation and status (direct signing flow)
641
642
  - **Squid Router** (`v2.api.squidrouter.com`): deposit address generation (deposit address flow)
643
+ - **Uniswap V3** (on-chain, Base): ETH/USDC swaps for auto-split
642
644
  - **Solana RPC** (`api.mainnet-beta.solana.com` or custom): balance checks and tx submission
643
645
 
644
646
  No private keys are transmitted to bridge providers. deBridge returns a serialized Solana transaction that is signed locally. Squid generates a deposit address, and the user sends SOL themselves.