arc-devkit 0.2.0__tar.gz → 0.2.1__tar.gz
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.
- arc_devkit-0.2.1/PKG-INFO +322 -0
- arc_devkit-0.2.1/README.md +288 -0
- arc_devkit-0.2.1/arc_devkit.egg-info/PKG-INFO +322 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/pyproject.toml +3 -4
- arc_devkit-0.2.0/PKG-INFO +0 -238
- arc_devkit-0.2.0/README.md +0 -203
- arc_devkit-0.2.0/arc_devkit.egg-info/PKG-INFO +0 -238
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/__init__.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/agents/__init__.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/agents/base_agent.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/agents/monitor_agent.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/agents/payment_agent.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/api/__init__.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/api/main.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/api/routes/__init__.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/api/routes/agents.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/api/routes/copilot.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/api/routes/debugger.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/cli/__init__.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/cli/commands/__init__.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/cli/commands/agent.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/cli/commands/copilot.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/cli/commands/debug.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/cli/main.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/config.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/copilot/__init__.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/copilot/agent.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/core/__init__.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/core/connection.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/core/gas.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/core/wallet.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/debugger/__init__.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit/debugger/tx_analyzer.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit.egg-info/SOURCES.txt +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit.egg-info/dependency_links.txt +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit.egg-info/entry_points.txt +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit.egg-info/requires.txt +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/arc_devkit.egg-info/top_level.txt +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/setup.cfg +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/tests/test_agents.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/tests/test_api.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/tests/test_connection.py +0 -0
- {arc_devkit-0.2.0 → arc_devkit-0.2.1}/tests/test_copilot.py +0 -0
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: arc-devkit
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Plataforma open source de ferramentas para desenvolvedores da Arc blockchain (Circle)
|
|
5
|
+
Author-email: Jeielsantosdev <jeielsantos.ti@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Jeielsantosdev/arc-devkit
|
|
8
|
+
Project-URL: Repository, https://github.com/Jeielsantosdev/arc-devkit
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/Jeielsantosdev/arc-devkit/issues
|
|
10
|
+
Keywords: arc,blockchain,circle,usdc,web3,ai,anthropic
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
18
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
Requires-Dist: typer[all]>=0.12
|
|
22
|
+
Requires-Dist: rich>=13.7
|
|
23
|
+
Requires-Dist: fastapi>=0.115
|
|
24
|
+
Requires-Dist: uvicorn[standard]>=0.30
|
|
25
|
+
Requires-Dist: web3>=7.0
|
|
26
|
+
Requires-Dist: anthropic>=0.40
|
|
27
|
+
Requires-Dist: python-dotenv>=1.0
|
|
28
|
+
Requires-Dist: httpx>=0.27
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
31
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
|
|
32
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
33
|
+
Requires-Dist: httpx>=0.27; extra == "dev"
|
|
34
|
+
|
|
35
|
+
# Arc DevKit
|
|
36
|
+
|
|
37
|
+
[](https://www.python.org/downloads/)
|
|
38
|
+
[](LICENSE)
|
|
39
|
+
[](https://arc.io)
|
|
40
|
+
[]()
|
|
41
|
+
|
|
42
|
+
**Arc DevKit** is a Python toolkit for developers building applications on the **Arc blockchain** — Circle's Layer 1 with USDC as the gas token and sub-second finality.
|
|
43
|
+
|
|
44
|
+
It solves a practical problem: Arc has unique characteristics (USDC gas, Malachite consensus, Circle Agent Stack) that don't exist on Ethereum or other EVMs. Without a dedicated kit, developers must dig through scattered documentation, configure Arc-specific middleware, and manually figure out how to estimate costs in USDC, debug reverted transactions, or structure an economic agent. Arc DevKit packages all of that.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## What is Arc?
|
|
49
|
+
|
|
50
|
+
**Arc** is a Layer 1 blockchain developed by Circle (creators of USDC), designed for programmable payments and autonomous economic agents.
|
|
51
|
+
|
|
52
|
+
| Feature | Detail |
|
|
53
|
+
|---|---|
|
|
54
|
+
| **EVM-compatible** | Solidity contracts work without modification |
|
|
55
|
+
| **USDC as gas** | No need for ETH or a separate native token |
|
|
56
|
+
| **Malachite consensus** | Sub-second finality |
|
|
57
|
+
| **Circle Agent Stack** | Native infrastructure for AI economic agents |
|
|
58
|
+
| **Testnet** | Live since October 2025; mainnet expected summer 2026 |
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## What you can build with Arc DevKit
|
|
63
|
+
|
|
64
|
+
### On-chain contracts and scripts
|
|
65
|
+
Use the **Dev Copilot** to ask questions, generate Solidity boilerplate, deploy scripts, and Circle ecosystem integrations — all with Arc-specific context built in.
|
|
66
|
+
|
|
67
|
+
**Examples of what to generate:**
|
|
68
|
+
- Recurring USDC payment contract
|
|
69
|
+
- ERC-20 token deployed to Arc testnet
|
|
70
|
+
- USDC approval and transfer script
|
|
71
|
+
- Circle CCTP (Cross-Chain Transfer Protocol) integration
|
|
72
|
+
|
|
73
|
+
### Autonomous economic agents
|
|
74
|
+
Use the **Agent Starter Kit** to build agents that interact with Arc programmatically — monitor wallets, execute conditional payments, react to on-chain events.
|
|
75
|
+
|
|
76
|
+
**Examples of what to build:**
|
|
77
|
+
- Agent that monitors a wallet and triggers actions when USDC is received
|
|
78
|
+
- Recurring payment bot (e.g. monthly subscription in USDC)
|
|
79
|
+
- Balance control agent with threshold alerts
|
|
80
|
+
- Automated payment processing pipeline
|
|
81
|
+
|
|
82
|
+
### Transaction debugging
|
|
83
|
+
Use the **Tx Debugger** to understand why a transaction failed — without manually decoding raw EVM traces. It fetches the transaction data, decodes the error, and produces a plain-language explanation with a suggested fix.
|
|
84
|
+
|
|
85
|
+
**Useful for:**
|
|
86
|
+
- Reverted transactions with generic error messages
|
|
87
|
+
- Gas estimation failures in USDC
|
|
88
|
+
- Diagnosing interactions with external contracts
|
|
89
|
+
- Analyzing the real cost of an operation
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Modules
|
|
94
|
+
|
|
95
|
+
### Dev Copilot
|
|
96
|
+
AI assistant (Claude Sonnet) with built-in Arc context. Answers technical questions, generates code, and explains Circle ecosystem concepts — without you needing to paste documentation into a chat window.
|
|
97
|
+
|
|
98
|
+
### Agent Starter Kit
|
|
99
|
+
Base classes and templates for economic agents. Includes `PaymentAgent` (USDC payments) and `MonitorAgent` (wallet monitoring). Supports read-only mode (no private key) and write mode (with private key).
|
|
100
|
+
|
|
101
|
+
### Tx Debugger
|
|
102
|
+
Fetches the transaction via RPC (`eth_getTransaction` + `eth_getTransactionReceipt`), decodes the result, and calls the Dev Copilot to generate a natural-language analysis with diagnosis and suggestion.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Installation
|
|
107
|
+
|
|
108
|
+
**Requirements:** Python 3.11 or higher.
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# Standard install via PyPI
|
|
112
|
+
pip install arc-devkit
|
|
113
|
+
|
|
114
|
+
# Development install (clone + editable mode)
|
|
115
|
+
git clone https://github.com/Jeielsantosdev/arc-devkit.git
|
|
116
|
+
cd arc-devkit
|
|
117
|
+
pip install -e ".[dev]"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Environment variables
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
# Required — Anthropic API key (used by Dev Copilot and Tx Debugger)
|
|
124
|
+
export ANTHROPIC_API_KEY="your-key-here"
|
|
125
|
+
|
|
126
|
+
# Arc RPC URL (default: public testnet)
|
|
127
|
+
export ARC_RPC_URL="https://rpc.arc.io/testnet"
|
|
128
|
+
|
|
129
|
+
# Optional — required only to send transactions (agents in write mode)
|
|
130
|
+
export ARC_PRIVATE_KEY="your-private-key"
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Create a `.env` file at the project root so you don't need to export these on every session.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Usage
|
|
138
|
+
|
|
139
|
+
### Check testnet connection
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
arcdevkit status
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
Arc testnet: connected
|
|
147
|
+
Chain ID: 7777777
|
|
148
|
+
Latest block: 4821903
|
|
149
|
+
Gas (USDC): 0.000021 USDC/tx
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### Dev Copilot — ask questions and generate code
|
|
155
|
+
|
|
156
|
+
Via CLI:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
arcdevkit copilot ask "How do I deploy an ERC-20 contract on Arc testnet?"
|
|
160
|
+
arcdevkit copilot ask "What is the difference between ETH gas and USDC gas on Arc?"
|
|
161
|
+
arcdevkit copilot ask "How do I integrate Circle CCTP into my Solidity contract?"
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Via Python:
|
|
165
|
+
|
|
166
|
+
```python
|
|
167
|
+
from arc_devkit.copilot.agent import DevCopilot
|
|
168
|
+
|
|
169
|
+
copilot = DevCopilot()
|
|
170
|
+
|
|
171
|
+
response = copilot.ask(
|
|
172
|
+
"How do I implement recurring USDC payments on Arc using Solidity?"
|
|
173
|
+
)
|
|
174
|
+
print(response)
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
### Agent Starter Kit — create and manage agent wallets
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# Create a new wallet for an agent
|
|
183
|
+
arcdevkit agent wallet create
|
|
184
|
+
|
|
185
|
+
# Check balance (USDC and gas)
|
|
186
|
+
arcdevkit agent wallet balance --address 0xYourWalletHere
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Via Python — monitor agent:
|
|
190
|
+
|
|
191
|
+
```python
|
|
192
|
+
from arc_devkit.agents.monitor_agent import MonitorAgent
|
|
193
|
+
|
|
194
|
+
agent = MonitorAgent(private_key=None) # read-only mode, no private key
|
|
195
|
+
|
|
196
|
+
balance = agent.get_balance("0xYourWalletHere")
|
|
197
|
+
print(f"Balance: {balance} USDC")
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Via Python — payment agent:
|
|
201
|
+
|
|
202
|
+
```python
|
|
203
|
+
from arc_devkit.agents.payment_agent import PaymentAgent
|
|
204
|
+
import os
|
|
205
|
+
|
|
206
|
+
agent = PaymentAgent(private_key=os.environ["ARC_PRIVATE_KEY"])
|
|
207
|
+
|
|
208
|
+
result = agent.execute({
|
|
209
|
+
"to": "0xDestinationHere",
|
|
210
|
+
"amount_usdc": "10.00",
|
|
211
|
+
})
|
|
212
|
+
print(result)
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
### Tx Debugger — analyze transactions
|
|
218
|
+
|
|
219
|
+
Via CLI:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
arcdevkit debug tx 0xyour_transaction_hash_here
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Via Python:
|
|
226
|
+
|
|
227
|
+
```python
|
|
228
|
+
from arc_devkit.debugger.tx_analyzer import TxAnalyzer
|
|
229
|
+
|
|
230
|
+
analyzer = TxAnalyzer()
|
|
231
|
+
analysis = analyzer.analyze("0xyour_transaction_hash_here")
|
|
232
|
+
print(analysis)
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Example output for a reverted transaction:
|
|
236
|
+
|
|
237
|
+
```
|
|
238
|
+
Status: reverted
|
|
239
|
+
Error: ERC20: transfer amount exceeds balance
|
|
240
|
+
Cost: 0.0008 USDC
|
|
241
|
+
Diagnosis: The sender wallet did not have enough USDC balance at execution
|
|
242
|
+
time. Check the balance before calling transfer().
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
### REST API
|
|
248
|
+
|
|
249
|
+
Arc DevKit also exposes a REST API for integrating with other systems or frontends:
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
uvicorn arc_devkit.api.main:app --reload
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Available endpoints:
|
|
256
|
+
|
|
257
|
+
| Method | Route | Description |
|
|
258
|
+
|--------|-------|-------------|
|
|
259
|
+
| `POST` | `/copilot/ask` | Send a question to the Dev Copilot |
|
|
260
|
+
| `GET` | `/agents/balance/{address}` | Query wallet balance |
|
|
261
|
+
| `POST` | `/agents/payment` | Execute a USDC payment |
|
|
262
|
+
| `GET` | `/debugger/tx/{hash}` | Analyze a transaction |
|
|
263
|
+
| `GET` | `/debugger/block` | Current block information |
|
|
264
|
+
|
|
265
|
+
CORS pre-configured for `localhost:3000`, `localhost:5173`, and `localhost:8080`.
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## Project Structure
|
|
270
|
+
|
|
271
|
+
```
|
|
272
|
+
arc_devkit/
|
|
273
|
+
├── config.py # Global config; reads .env and validates required vars
|
|
274
|
+
├── core/
|
|
275
|
+
│ ├── connection.py # web3.py client with PoA middleware for Arc
|
|
276
|
+
│ └── wallet.py # Wallet utilities
|
|
277
|
+
├── copilot/
|
|
278
|
+
│ └── agent.py # DevCopilot — Anthropic SDK wrapper with Arc system prompt
|
|
279
|
+
├── agents/
|
|
280
|
+
│ ├── base_agent.py # ABC with get_balance() and execute()
|
|
281
|
+
│ ├── payment_agent.py
|
|
282
|
+
│ └── monitor_agent.py
|
|
283
|
+
├── debugger/
|
|
284
|
+
│ └── tx_analyzer.py # Fetches tx via RPC + analysis with DevCopilot
|
|
285
|
+
├── api/
|
|
286
|
+
│ ├── main.py # FastAPI app
|
|
287
|
+
│ └── routes/ # copilot.py, agents.py, debugger.py
|
|
288
|
+
└── cli/
|
|
289
|
+
├── main.py # Typer entry point (arcdevkit)
|
|
290
|
+
└── commands/ # copilot.py, agent.py, debug.py
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## Tests
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
# Unit tests (no testnet connection required)
|
|
299
|
+
pytest
|
|
300
|
+
|
|
301
|
+
# Single test
|
|
302
|
+
pytest -k "test_copilot"
|
|
303
|
+
|
|
304
|
+
# Integration tests (require ARC_RPC_URL and ANTHROPIC_API_KEY)
|
|
305
|
+
pytest -m integration
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## License
|
|
311
|
+
|
|
312
|
+
MIT — see [LICENSE](LICENSE) for details.
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## About Arc
|
|
317
|
+
|
|
318
|
+
Arc is developed by Circle, the company behind USDC. For more information about the blockchain and the economic agents ecosystem, see Circle's official documentation.
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
> **Actively in development.** Arc DevKit is in early stage — the Arc testnet is still running and mainnet is expected in summer 2026. APIs and interfaces may change between versions. Keep this in mind for production use.
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
# Arc DevKit
|
|
2
|
+
|
|
3
|
+
[](https://www.python.org/downloads/)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](https://arc.io)
|
|
6
|
+
[]()
|
|
7
|
+
|
|
8
|
+
**Arc DevKit** is a Python toolkit for developers building applications on the **Arc blockchain** — Circle's Layer 1 with USDC as the gas token and sub-second finality.
|
|
9
|
+
|
|
10
|
+
It solves a practical problem: Arc has unique characteristics (USDC gas, Malachite consensus, Circle Agent Stack) that don't exist on Ethereum or other EVMs. Without a dedicated kit, developers must dig through scattered documentation, configure Arc-specific middleware, and manually figure out how to estimate costs in USDC, debug reverted transactions, or structure an economic agent. Arc DevKit packages all of that.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## What is Arc?
|
|
15
|
+
|
|
16
|
+
**Arc** is a Layer 1 blockchain developed by Circle (creators of USDC), designed for programmable payments and autonomous economic agents.
|
|
17
|
+
|
|
18
|
+
| Feature | Detail |
|
|
19
|
+
|---|---|
|
|
20
|
+
| **EVM-compatible** | Solidity contracts work without modification |
|
|
21
|
+
| **USDC as gas** | No need for ETH or a separate native token |
|
|
22
|
+
| **Malachite consensus** | Sub-second finality |
|
|
23
|
+
| **Circle Agent Stack** | Native infrastructure for AI economic agents |
|
|
24
|
+
| **Testnet** | Live since October 2025; mainnet expected summer 2026 |
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## What you can build with Arc DevKit
|
|
29
|
+
|
|
30
|
+
### On-chain contracts and scripts
|
|
31
|
+
Use the **Dev Copilot** to ask questions, generate Solidity boilerplate, deploy scripts, and Circle ecosystem integrations — all with Arc-specific context built in.
|
|
32
|
+
|
|
33
|
+
**Examples of what to generate:**
|
|
34
|
+
- Recurring USDC payment contract
|
|
35
|
+
- ERC-20 token deployed to Arc testnet
|
|
36
|
+
- USDC approval and transfer script
|
|
37
|
+
- Circle CCTP (Cross-Chain Transfer Protocol) integration
|
|
38
|
+
|
|
39
|
+
### Autonomous economic agents
|
|
40
|
+
Use the **Agent Starter Kit** to build agents that interact with Arc programmatically — monitor wallets, execute conditional payments, react to on-chain events.
|
|
41
|
+
|
|
42
|
+
**Examples of what to build:**
|
|
43
|
+
- Agent that monitors a wallet and triggers actions when USDC is received
|
|
44
|
+
- Recurring payment bot (e.g. monthly subscription in USDC)
|
|
45
|
+
- Balance control agent with threshold alerts
|
|
46
|
+
- Automated payment processing pipeline
|
|
47
|
+
|
|
48
|
+
### Transaction debugging
|
|
49
|
+
Use the **Tx Debugger** to understand why a transaction failed — without manually decoding raw EVM traces. It fetches the transaction data, decodes the error, and produces a plain-language explanation with a suggested fix.
|
|
50
|
+
|
|
51
|
+
**Useful for:**
|
|
52
|
+
- Reverted transactions with generic error messages
|
|
53
|
+
- Gas estimation failures in USDC
|
|
54
|
+
- Diagnosing interactions with external contracts
|
|
55
|
+
- Analyzing the real cost of an operation
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Modules
|
|
60
|
+
|
|
61
|
+
### Dev Copilot
|
|
62
|
+
AI assistant (Claude Sonnet) with built-in Arc context. Answers technical questions, generates code, and explains Circle ecosystem concepts — without you needing to paste documentation into a chat window.
|
|
63
|
+
|
|
64
|
+
### Agent Starter Kit
|
|
65
|
+
Base classes and templates for economic agents. Includes `PaymentAgent` (USDC payments) and `MonitorAgent` (wallet monitoring). Supports read-only mode (no private key) and write mode (with private key).
|
|
66
|
+
|
|
67
|
+
### Tx Debugger
|
|
68
|
+
Fetches the transaction via RPC (`eth_getTransaction` + `eth_getTransactionReceipt`), decodes the result, and calls the Dev Copilot to generate a natural-language analysis with diagnosis and suggestion.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Installation
|
|
73
|
+
|
|
74
|
+
**Requirements:** Python 3.11 or higher.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Standard install via PyPI
|
|
78
|
+
pip install arc-devkit
|
|
79
|
+
|
|
80
|
+
# Development install (clone + editable mode)
|
|
81
|
+
git clone https://github.com/Jeielsantosdev/arc-devkit.git
|
|
82
|
+
cd arc-devkit
|
|
83
|
+
pip install -e ".[dev]"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Environment variables
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Required — Anthropic API key (used by Dev Copilot and Tx Debugger)
|
|
90
|
+
export ANTHROPIC_API_KEY="your-key-here"
|
|
91
|
+
|
|
92
|
+
# Arc RPC URL (default: public testnet)
|
|
93
|
+
export ARC_RPC_URL="https://rpc.arc.io/testnet"
|
|
94
|
+
|
|
95
|
+
# Optional — required only to send transactions (agents in write mode)
|
|
96
|
+
export ARC_PRIVATE_KEY="your-private-key"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Create a `.env` file at the project root so you don't need to export these on every session.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Usage
|
|
104
|
+
|
|
105
|
+
### Check testnet connection
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
arcdevkit status
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
Arc testnet: connected
|
|
113
|
+
Chain ID: 7777777
|
|
114
|
+
Latest block: 4821903
|
|
115
|
+
Gas (USDC): 0.000021 USDC/tx
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
### Dev Copilot — ask questions and generate code
|
|
121
|
+
|
|
122
|
+
Via CLI:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
arcdevkit copilot ask "How do I deploy an ERC-20 contract on Arc testnet?"
|
|
126
|
+
arcdevkit copilot ask "What is the difference between ETH gas and USDC gas on Arc?"
|
|
127
|
+
arcdevkit copilot ask "How do I integrate Circle CCTP into my Solidity contract?"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Via Python:
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
from arc_devkit.copilot.agent import DevCopilot
|
|
134
|
+
|
|
135
|
+
copilot = DevCopilot()
|
|
136
|
+
|
|
137
|
+
response = copilot.ask(
|
|
138
|
+
"How do I implement recurring USDC payments on Arc using Solidity?"
|
|
139
|
+
)
|
|
140
|
+
print(response)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
### Agent Starter Kit — create and manage agent wallets
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# Create a new wallet for an agent
|
|
149
|
+
arcdevkit agent wallet create
|
|
150
|
+
|
|
151
|
+
# Check balance (USDC and gas)
|
|
152
|
+
arcdevkit agent wallet balance --address 0xYourWalletHere
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Via Python — monitor agent:
|
|
156
|
+
|
|
157
|
+
```python
|
|
158
|
+
from arc_devkit.agents.monitor_agent import MonitorAgent
|
|
159
|
+
|
|
160
|
+
agent = MonitorAgent(private_key=None) # read-only mode, no private key
|
|
161
|
+
|
|
162
|
+
balance = agent.get_balance("0xYourWalletHere")
|
|
163
|
+
print(f"Balance: {balance} USDC")
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Via Python — payment agent:
|
|
167
|
+
|
|
168
|
+
```python
|
|
169
|
+
from arc_devkit.agents.payment_agent import PaymentAgent
|
|
170
|
+
import os
|
|
171
|
+
|
|
172
|
+
agent = PaymentAgent(private_key=os.environ["ARC_PRIVATE_KEY"])
|
|
173
|
+
|
|
174
|
+
result = agent.execute({
|
|
175
|
+
"to": "0xDestinationHere",
|
|
176
|
+
"amount_usdc": "10.00",
|
|
177
|
+
})
|
|
178
|
+
print(result)
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
### Tx Debugger — analyze transactions
|
|
184
|
+
|
|
185
|
+
Via CLI:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
arcdevkit debug tx 0xyour_transaction_hash_here
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Via Python:
|
|
192
|
+
|
|
193
|
+
```python
|
|
194
|
+
from arc_devkit.debugger.tx_analyzer import TxAnalyzer
|
|
195
|
+
|
|
196
|
+
analyzer = TxAnalyzer()
|
|
197
|
+
analysis = analyzer.analyze("0xyour_transaction_hash_here")
|
|
198
|
+
print(analysis)
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Example output for a reverted transaction:
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
Status: reverted
|
|
205
|
+
Error: ERC20: transfer amount exceeds balance
|
|
206
|
+
Cost: 0.0008 USDC
|
|
207
|
+
Diagnosis: The sender wallet did not have enough USDC balance at execution
|
|
208
|
+
time. Check the balance before calling transfer().
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
### REST API
|
|
214
|
+
|
|
215
|
+
Arc DevKit also exposes a REST API for integrating with other systems or frontends:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
uvicorn arc_devkit.api.main:app --reload
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Available endpoints:
|
|
222
|
+
|
|
223
|
+
| Method | Route | Description |
|
|
224
|
+
|--------|-------|-------------|
|
|
225
|
+
| `POST` | `/copilot/ask` | Send a question to the Dev Copilot |
|
|
226
|
+
| `GET` | `/agents/balance/{address}` | Query wallet balance |
|
|
227
|
+
| `POST` | `/agents/payment` | Execute a USDC payment |
|
|
228
|
+
| `GET` | `/debugger/tx/{hash}` | Analyze a transaction |
|
|
229
|
+
| `GET` | `/debugger/block` | Current block information |
|
|
230
|
+
|
|
231
|
+
CORS pre-configured for `localhost:3000`, `localhost:5173`, and `localhost:8080`.
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Project Structure
|
|
236
|
+
|
|
237
|
+
```
|
|
238
|
+
arc_devkit/
|
|
239
|
+
├── config.py # Global config; reads .env and validates required vars
|
|
240
|
+
├── core/
|
|
241
|
+
│ ├── connection.py # web3.py client with PoA middleware for Arc
|
|
242
|
+
│ └── wallet.py # Wallet utilities
|
|
243
|
+
├── copilot/
|
|
244
|
+
│ └── agent.py # DevCopilot — Anthropic SDK wrapper with Arc system prompt
|
|
245
|
+
├── agents/
|
|
246
|
+
│ ├── base_agent.py # ABC with get_balance() and execute()
|
|
247
|
+
│ ├── payment_agent.py
|
|
248
|
+
│ └── monitor_agent.py
|
|
249
|
+
├── debugger/
|
|
250
|
+
│ └── tx_analyzer.py # Fetches tx via RPC + analysis with DevCopilot
|
|
251
|
+
├── api/
|
|
252
|
+
│ ├── main.py # FastAPI app
|
|
253
|
+
│ └── routes/ # copilot.py, agents.py, debugger.py
|
|
254
|
+
└── cli/
|
|
255
|
+
├── main.py # Typer entry point (arcdevkit)
|
|
256
|
+
└── commands/ # copilot.py, agent.py, debug.py
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## Tests
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
# Unit tests (no testnet connection required)
|
|
265
|
+
pytest
|
|
266
|
+
|
|
267
|
+
# Single test
|
|
268
|
+
pytest -k "test_copilot"
|
|
269
|
+
|
|
270
|
+
# Integration tests (require ARC_RPC_URL and ANTHROPIC_API_KEY)
|
|
271
|
+
pytest -m integration
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## License
|
|
277
|
+
|
|
278
|
+
MIT — see [LICENSE](LICENSE) for details.
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## About Arc
|
|
283
|
+
|
|
284
|
+
Arc is developed by Circle, the company behind USDC. For more information about the blockchain and the economic agents ecosystem, see Circle's official documentation.
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
> **Actively in development.** Arc DevKit is in early stage — the Arc testnet is still running and mainnet is expected in summer 2026. APIs and interfaces may change between versions. Keep this in mind for production use.
|