arc-devkit 0.2.0__py3-none-any.whl → 0.2.1__py3-none-any.whl
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.dist-info/METADATA +322 -0
- {arc_devkit-0.2.0.dist-info → arc_devkit-0.2.1.dist-info}/RECORD +5 -5
- arc_devkit-0.2.0.dist-info/METADATA +0 -238
- {arc_devkit-0.2.0.dist-info → arc_devkit-0.2.1.dist-info}/WHEEL +0 -0
- {arc_devkit-0.2.0.dist-info → arc_devkit-0.2.1.dist-info}/entry_points.txt +0 -0
- {arc_devkit-0.2.0.dist-info → arc_devkit-0.2.1.dist-info}/top_level.txt +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.
|
|
@@ -24,8 +24,8 @@ arc_devkit/core/gas.py,sha256=eww3ANeFDi4vWBaTvC9yV66ZtjyQZOlMWig8G-YuLn0,1961
|
|
|
24
24
|
arc_devkit/core/wallet.py,sha256=eRkQiC9-gDIXqQ7MFwsvC7n0-_GXBJkL53aU-Pa87ZE,2100
|
|
25
25
|
arc_devkit/debugger/__init__.py,sha256=p9--cHKoWMjuemxzfb--PUJ7EIMyLXR8cIKb3w6rweQ,142
|
|
26
26
|
arc_devkit/debugger/tx_analyzer.py,sha256=PYB62AjxczK_EMWmojZK_ffEXimfL71vtdXKmxJaHuo,3899
|
|
27
|
-
arc_devkit-0.2.
|
|
28
|
-
arc_devkit-0.2.
|
|
29
|
-
arc_devkit-0.2.
|
|
30
|
-
arc_devkit-0.2.
|
|
31
|
-
arc_devkit-0.2.
|
|
27
|
+
arc_devkit-0.2.1.dist-info/METADATA,sha256=1i60dJ1CjT7xUSO1lzuhJCZzSIGbb6BIttafPv4deow,9952
|
|
28
|
+
arc_devkit-0.2.1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
29
|
+
arc_devkit-0.2.1.dist-info/entry_points.txt,sha256=wKF8LAEu1vWKfiujTrp7h_df1kVCsbuGl96Ql75QjfU,54
|
|
30
|
+
arc_devkit-0.2.1.dist-info/top_level.txt,sha256=_8As_e0w6FWAQptRM9vVTpBaTQmGKjajyiscnqRps-8,11
|
|
31
|
+
arc_devkit-0.2.1.dist-info/RECORD,,
|
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: arc-devkit
|
|
3
|
-
Version: 0.2.0
|
|
4
|
-
Summary: Plataforma open source de ferramentas para desenvolvedores da Arc blockchain (Circle)
|
|
5
|
-
Author-email: Jeiel Santos <jeielsantos.ti@gmail.com>
|
|
6
|
-
License: 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: License :: OSI Approved :: MIT License
|
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
-
Classifier: Topic :: Software Development :: Libraries
|
|
19
|
-
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
|
|
20
|
-
Requires-Python: >=3.11
|
|
21
|
-
Description-Content-Type: text/markdown
|
|
22
|
-
Requires-Dist: typer[all]>=0.12
|
|
23
|
-
Requires-Dist: rich>=13.7
|
|
24
|
-
Requires-Dist: fastapi>=0.115
|
|
25
|
-
Requires-Dist: uvicorn[standard]>=0.30
|
|
26
|
-
Requires-Dist: web3>=7.0
|
|
27
|
-
Requires-Dist: anthropic>=0.40
|
|
28
|
-
Requires-Dist: python-dotenv>=1.0
|
|
29
|
-
Requires-Dist: httpx>=0.27
|
|
30
|
-
Provides-Extra: dev
|
|
31
|
-
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
32
|
-
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
|
|
33
|
-
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
34
|
-
Requires-Dist: httpx>=0.27; extra == "dev"
|
|
35
|
-
|
|
36
|
-
# Arc DevKit
|
|
37
|
-
|
|
38
|
-
[](https://www.python.org/downloads/)
|
|
39
|
-
[](LICENSE)
|
|
40
|
-
[](https://arc.io)
|
|
41
|
-
[]()
|
|
42
|
-
|
|
43
|
-
Uma plataforma open source de ferramentas para desenvolvedores que constroem na **Arc blockchain** — a Layer 1 da Circle com USDC como token de gás e finalidade em menos de 1 segundo.
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## O que é a Arc?
|
|
48
|
-
|
|
49
|
-
A **Arc** é uma blockchain Layer 1 desenvolvida pela Circle (criadores do USDC), com foco em pagamentos programáveis e agentes econômicos autônomos. Características principais:
|
|
50
|
-
|
|
51
|
-
- **EVM-compatível** — contratos Solidity funcionam sem modificação
|
|
52
|
-
- **USDC como gás** — sem necessidade de ETH ou token nativo separado
|
|
53
|
-
- **Consenso Malachite** — finalidade em menos de 1 segundo
|
|
54
|
-
- **Circle Agent Stack** — infraestrutura nativa para agentes de IA econômicos
|
|
55
|
-
- **Testnet ativa** desde outubro de 2025; mainnet prevista para o verão de 2026
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
## Módulos
|
|
60
|
-
|
|
61
|
-
### Dev Copilot
|
|
62
|
-
Assistente de IA para geração de código Arc. Responde a perguntas, gera contratos Solidity, scripts de deploy e interações com o ecossistema Circle.
|
|
63
|
-
|
|
64
|
-
### Agent Starter Kit
|
|
65
|
-
Templates prontos para agentes econômicos autônomos: pagamento recorrente, monitoramento de carteira, arbitragem de câmbio e marketplace descentralizado.
|
|
66
|
-
|
|
67
|
-
### Tx Debugger
|
|
68
|
-
Ferramenta de análise de transações Arc. Decodifica traces, identifica erros, calcula custos em USDC e sugere correções.
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## Instalação
|
|
73
|
-
|
|
74
|
-
**Pré-requisitos:** Python 3.11 ou superior, pip.
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
# Instalação padrão
|
|
78
|
-
pip install arc-devkit
|
|
79
|
-
|
|
80
|
-
# Instalação para desenvolvimento (inclui ferramentas de teste e lint)
|
|
81
|
-
git clone https://github.com/seu-usuario/arc-devkit.git
|
|
82
|
-
cd arc-devkit
|
|
83
|
-
pip install -e ".[dev]"
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### Configurar variáveis de ambiente
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
# Chave da API Anthropic (obrigatória para o Dev Copilot)
|
|
90
|
-
export ANTHROPIC_API_KEY="sua-chave-aqui"
|
|
91
|
-
|
|
92
|
-
# URL RPC da Arc (padrão: testnet)
|
|
93
|
-
export ARC_RPC_URL="https://rpc.arc.io/testnet"
|
|
94
|
-
|
|
95
|
-
# Chave privada da carteira (opcional — necessária apenas para enviar transações)
|
|
96
|
-
export ARC_PRIVATE_KEY="sua-chave-privada"
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
|
|
101
|
-
## Uso Rápido
|
|
102
|
-
|
|
103
|
-
### Dev Copilot — Gerar código com IA
|
|
104
|
-
|
|
105
|
-
```python
|
|
106
|
-
from arc_devkit.copilot import DevCopilot
|
|
107
|
-
|
|
108
|
-
copilot = DevCopilot()
|
|
109
|
-
|
|
110
|
-
# Gerar um contrato de pagamento recorrente
|
|
111
|
-
resposta = copilot.perguntar(
|
|
112
|
-
"Como implemento pagamento recorrente em USDC na Arc usando Solidity?"
|
|
113
|
-
)
|
|
114
|
-
print(resposta)
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
Via linha de comando:
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
arc-copilot perguntar "Como fazer deploy de um contrato ERC-20 na Arc testnet?"
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
---
|
|
124
|
-
|
|
125
|
-
### Agent Starter Kit — Criar agente econômico
|
|
126
|
-
|
|
127
|
-
```python
|
|
128
|
-
from arc_devkit.agents import AgenteMonitoramento
|
|
129
|
-
from decimal import Decimal
|
|
130
|
-
|
|
131
|
-
# Monitorar uma carteira e agir ao receber USDC
|
|
132
|
-
agente = AgenteMonitoramento(
|
|
133
|
-
carteira="0xSuaCarteiraAqui",
|
|
134
|
-
limiar_usdc=Decimal("100.00"), # agir ao receber 100 USDC ou mais
|
|
135
|
-
intervalo_segundos=30,
|
|
136
|
-
)
|
|
137
|
-
|
|
138
|
-
agente.ao_receber(lambda evento: print(f"Recebido: {evento.valor} USDC"))
|
|
139
|
-
agente.iniciar()
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
Via linha de comando:
|
|
143
|
-
|
|
144
|
-
```bash
|
|
145
|
-
arc-agents iniciar monitoramento \
|
|
146
|
-
--carteira 0xSuaCarteiraAqui \
|
|
147
|
-
--limiar 100 \
|
|
148
|
-
--intervalo 30
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
---
|
|
152
|
-
|
|
153
|
-
### Tx Debugger — Analisar transação
|
|
154
|
-
|
|
155
|
-
```python
|
|
156
|
-
from arc_devkit.debugger import TxDebugger
|
|
157
|
-
|
|
158
|
-
debugger = TxDebugger()
|
|
159
|
-
|
|
160
|
-
# Analisar uma transação que falhou
|
|
161
|
-
analise = debugger.analisar("0xhash_da_transacao_aqui")
|
|
162
|
-
|
|
163
|
-
print(analise.status) # "revertida"
|
|
164
|
-
print(analise.motivo) # "ERC20: transferência excede saldo"
|
|
165
|
-
print(analise.custo_usdc) # "0.0012 USDC"
|
|
166
|
-
print(analise.sugestao) # "Verifique o saldo antes de transferir"
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
Via linha de comando:
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
arc-debug analisar 0xhash_da_transacao_aqui --formato json
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
---
|
|
176
|
-
|
|
177
|
-
## Estrutura do Projeto
|
|
178
|
-
|
|
179
|
-
```
|
|
180
|
-
arc_devkit/
|
|
181
|
-
├── core/ # Fundação: cliente RPC, utilitários de gás em USDC
|
|
182
|
-
│ ├── client.py # Cliente Arc (web3.py com defaults Arc)
|
|
183
|
-
│ ├── gas.py # Estimativa e conversão de gás em USDC
|
|
184
|
-
│ └── config.py # Carregamento de configuração e variáveis de ambiente
|
|
185
|
-
│
|
|
186
|
-
├── copilot/ # Módulo Dev Copilot
|
|
187
|
-
│ ├── ai.py # Wrapper do SDK Anthropic com streaming
|
|
188
|
-
│ ├── cli.py # Interface de linha de comando (Click)
|
|
189
|
-
│ └── prompts/ # Templates de prompt por tipo de tarefa
|
|
190
|
-
│
|
|
191
|
-
├── agents/ # Módulo Agent Starter Kit
|
|
192
|
-
│ ├── base.py # Classe base para todos os agentes
|
|
193
|
-
│ ├── pagamento.py # Agente de pagamento recorrente
|
|
194
|
-
│ ├── monitoramento.py # Agente de monitoramento de carteira
|
|
195
|
-
│ ├── cambio.py # Agente de arbitragem de câmbio
|
|
196
|
-
│ └── marketplace.py # Agente de marketplace descentralizado
|
|
197
|
-
│
|
|
198
|
-
└── debugger/ # Módulo Tx Debugger
|
|
199
|
-
├── debugger.py # Orquestrador principal
|
|
200
|
-
├── trace.py # Decodificador de traces de transação
|
|
201
|
-
├── abi.py # Resolução de ABI (cache local + Sourcify)
|
|
202
|
-
└── cli.py # Interface de linha de comando (Click)
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
## Documentação
|
|
208
|
-
|
|
209
|
-
- [Começando](docs/getting-started.md) — instalação, configuração e primeiro exemplo
|
|
210
|
-
- [Dev Copilot](docs/modules/dev-copilot.md) — uso completo do assistente de IA
|
|
211
|
-
- [Agent Starter Kit](docs/modules/agent-starter-kit.md) — templates de agentes econômicos
|
|
212
|
-
- [Tx Debugger](docs/modules/tx-debugger.md) — análise e debugging de transações
|
|
213
|
-
|
|
214
|
-
---
|
|
215
|
-
|
|
216
|
-
## Contribuição
|
|
217
|
-
|
|
218
|
-
Contribuições são bem-vindas! Leia [CONTRIBUTING.md](CONTRIBUTING.md) para entender o processo.
|
|
219
|
-
|
|
220
|
-
```bash
|
|
221
|
-
# Rodar os testes
|
|
222
|
-
pytest
|
|
223
|
-
|
|
224
|
-
# Verificar formatação e tipos
|
|
225
|
-
ruff check . && mypy arc_devkit/
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
---
|
|
229
|
-
|
|
230
|
-
## Licença
|
|
231
|
-
|
|
232
|
-
MIT — veja [LICENSE](LICENSE) para detalhes.
|
|
233
|
-
|
|
234
|
-
---
|
|
235
|
-
|
|
236
|
-
## Sobre a Arc
|
|
237
|
-
|
|
238
|
-
A Arc é desenvolvida pela Circle, a empresa por trás do USDC. Para mais informações sobre a blockchain e o ecossistema de agentes econômicos, consulte a documentação oficial da Circle.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|