arc-devkit 0.4.2__py3-none-any.whl → 0.4.4__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/__init__.py CHANGED
@@ -1,3 +1,8 @@
1
1
  """Arc DevKit — Developer tools for the Arc blockchain by Circle."""
2
2
 
3
- __version__ = "0.4.0"
3
+ from importlib.metadata import PackageNotFoundError, version as _version
4
+
5
+ try:
6
+ __version__ = _version("arc-devkit")
7
+ except PackageNotFoundError:
8
+ __version__ = "unknown"
@@ -74,6 +74,27 @@ def tx(
74
74
  )
75
75
 
76
76
 
77
+ @app.command()
78
+ def batch(
79
+ hashes_file: str = typer.Argument(
80
+ ..., help="Text file with one tx hash per line (or JSON array)."
81
+ ),
82
+ abi_path: str = typer.Option(
83
+ "", "--abi", "-a", help="Path to ABI JSON file applied to all transactions."
84
+ ),
85
+ json_output: bool = typer.Option(False, "--json", help="Output as JSON."),
86
+ ) -> None:
87
+ """Analyze multiple transactions from a file (one hash per line or JSON array).
88
+
89
+ Examples:
90
+ arcdevkit debug batch hashes.txt
91
+ arcdevkit debug batch hashes.txt --abi MyContract.json --json
92
+ """
93
+ from arc_devkit.cli.flat import debug_batch as _run_batch
94
+
95
+ _run_batch(hashes_file=hashes_file, abi_path=abi_path, json_output=json_output, verbose=False)
96
+
97
+
77
98
  @app.command()
78
99
  def estimate(
79
100
  to: str = typer.Argument(..., help="Recipient EVM address."),
arc_devkit/cli/main.py CHANGED
@@ -6,6 +6,7 @@ from rich.panel import Panel
6
6
 
7
7
  from arc_devkit import __version__
8
8
  from arc_devkit.cli.commands import agent, copilot, debug
9
+ from arc_devkit.cli.flat import config_app, portfolio_app
9
10
 
10
11
  # Main Typer application
11
12
  app = typer.Typer(
@@ -20,6 +21,8 @@ app = typer.Typer(
20
21
  app.add_typer(copilot.app, name="copilot", help="AI assistant for Arc development.")
21
22
  app.add_typer(agent.app, name="agent", help="Wallet and agent management.")
22
23
  app.add_typer(debug.app, name="debug", help="Transaction analysis and debugging.")
24
+ app.add_typer(config_app, name="config", help="Manage Arc DevKit settings via .env.")
25
+ app.add_typer(portfolio_app, name="portfolio", help="Wallet portfolio analysis on Arc.")
23
26
 
24
27
  console = Console()
25
28
 
@@ -48,6 +51,38 @@ def main(
48
51
  )
49
52
 
50
53
 
54
+ @app.command()
55
+ def init() -> None:
56
+ """Interactive wizard to create your .env from scratch."""
57
+ from arc_devkit.cli.flat import init as _run_init
58
+
59
+ _run_init()
60
+
61
+
62
+ @app.command()
63
+ def history(
64
+ limit: int = typer.Option(10, "--limit", "-n", help="Number of records to display."),
65
+ json_output: bool = typer.Option(False, "--json", help="Output as JSON."),
66
+ ) -> None:
67
+ """List recent CLI operations saved in ~/.arc_devkit/history.json."""
68
+ from arc_devkit.cli.flat import history as _run_history
69
+
70
+ _run_history(limit=limit, json_output=json_output)
71
+
72
+
73
+ @app.command()
74
+ def codegen(
75
+ topic: str = typer.Argument(..., help="Describe what the script should do."),
76
+ save: bool = typer.Option(True, "--save/--no-save", help="Save to generated/<timestamp>.py"),
77
+ output_dir: str = typer.Option(".", "--out", "-o", help="Output directory (default: current)."),
78
+ verbose: bool = typer.Option(False, "-v", "--verbose", help="Enable debug logs."),
79
+ ) -> None:
80
+ """Generate a Python script for Arc from a natural language description."""
81
+ from arc_devkit.cli.flat import codegen as _run_codegen
82
+
83
+ _run_codegen(topic=topic, save=save, output_dir=output_dir, verbose=verbose)
84
+
85
+
51
86
  @app.command()
52
87
  def status() -> None:
53
88
  """Check the connection to Arc testnet and display network information."""
arc_devkit/config.py CHANGED
@@ -4,9 +4,9 @@ import logging
4
4
  import os
5
5
  from dataclasses import dataclass
6
6
 
7
- from dotenv import load_dotenv
7
+ from dotenv import find_dotenv, load_dotenv
8
8
 
9
- load_dotenv()
9
+ load_dotenv(find_dotenv(usecwd=True))
10
10
 
11
11
 
12
12
  @dataclass(frozen=True)
@@ -27,13 +27,22 @@ You are an expert assistant specialized in Arc blockchain development.
27
27
  - Testnet active since October 2025; mainnet expected Summer 2026
28
28
  - Standard EVM RPC: compatible with web3.py, ethers.js, Hardhat, Foundry
29
29
 
30
+ ## arc-devkit — primary library (always prefer this)
31
+ - PyPI: https://pypi.org/project/arc-devkit/
32
+ - Documentation: https://arc-dev-kit-uxun.vercel.app/
33
+ - Install: `pip install arc-devkit`
34
+ - Covers: wallet creation, USDC payments, transaction debugging, AI analysis, agent templates
35
+ - All modules are pre-configured for Arc testnet — no manual web3 setup needed
36
+
30
37
  ## Response guidelines
31
- 1. Always generate functional Python code with clear inline comments
32
- 2. Use web3.py for all Arc blockchain interactions
33
- 3. Use Decimal (never float) for all monetary values in USDC
34
- 4. State the estimated USDC cost when relevant to the operation
35
- 5. Separate explanations from code blocks clearly
36
- 6. If there is a security risk (private keys, large amounts), warn the user
38
+ 1. **Always use `arc-devkit` as the primary library** import exclusively from `arc_devkit.*`
39
+ 2. Only fall back to raw `web3.py` when arc-devkit does not cover the specific need
40
+ 3. Generate complete, functional Python code with a docstring and `if __name__ == '__main__':`
41
+ 4. Use `Decimal` (never `float`) for all monetary values in USDC
42
+ 5. State the estimated USDC gas cost when relevant to the operation
43
+ 6. Separate explanations from code blocks clearly
44
+ 7. Warn the user whenever private keys or large amounts are involved
45
+ 8. When referencing features or APIs, point to https://arc-dev-kit-uxun.vercel.app/ for details
37
46
  """
38
47
 
39
48
  _CACHE_TTL_SECONDS = 300 # 5 minutes
@@ -1,16 +1,15 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: arc-devkit
3
- Version: 0.4.2
3
+ Version: 0.4.4
4
4
  Summary: Plataforma open source de ferramentas para desenvolvedores da Arc blockchain (Circle)
5
- Author: Arc DevKit Contributors
6
- License: MIT
7
- Project-URL: Homepage, https://github.com/Jeielsantosdev/arc_dev_kit
8
- Project-URL: Repository, https://github.com/Jeielsantosdev/arc_dev_kit
9
- Project-URL: Issues, https://github.com/Jeielsantosdev/arc_dev_kit/issues
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
10
  Keywords: arc,blockchain,circle,usdc,web3,ai,anthropic
11
11
  Classifier: Development Status :: 3 - Alpha
12
12
  Classifier: Intended Audience :: Developers
13
- Classifier: License :: OSI Approved :: MIT License
14
13
  Classifier: Programming Language :: Python :: 3
15
14
  Classifier: Programming Language :: Python :: 3.11
16
15
  Classifier: Programming Language :: Python :: 3.12
@@ -49,6 +48,8 @@ Requires-Dist: httpx>=0.27; extra == "dev"
49
48
 
50
49
  **Arc DevKit** is a complete Python SDK for developers building on the **Arc blockchain** — Circle's EVM-compatible Layer 1 with USDC as the gas token and sub-second finality.
51
50
 
51
+ **link to project** https://arc-dev-kit-uxun.vercel.app/
52
+
52
53
  It solves the practical friction of building on Arc: USDC gas accounting, PoA middleware, ERC-20 monitoring, async agents, WebSocket streaming, and AI-assisted debugging — all packaged and ready to use.
53
54
 
54
55
  ---
@@ -87,10 +88,10 @@ cp .env.example .env
87
88
  # ARC_PRIVATE_KEY — optional; needed to send transactions
88
89
 
89
90
  # 3. Guided interactive setup (creates .env from scratch)
90
- arc init
91
+ arcdevkit init
91
92
 
92
93
  # 4. Verify connection
93
- arc status
94
+ arcdevkit status
94
95
  ```
95
96
 
96
97
  ```
@@ -129,10 +130,10 @@ AI assistant powered by Claude Sonnet, with Arc blockchain context embedded in t
129
130
 
130
131
  ```bash
131
132
  # Ask a question
132
- arc ask "How do I deploy an ERC-20 contract on Arc testnet?"
133
+ arcdevkit copilot ask "How do I deploy an ERC-20 contract on Arc testnet?"
133
134
 
134
135
  # Streaming output (token by token)
135
- arc ask --stream "Write a USDC payment contract in Solidity"
136
+ arcdevkit copilot ask "Write a USDC payment contract in Solidity" --stream
136
137
  ```
137
138
 
138
139
  ### Python
@@ -348,16 +349,16 @@ Fetches transaction data via RPC, decodes the error/result, and uses the Dev Cop
348
349
 
349
350
  ```bash
350
351
  # Analyze a transaction
351
- arc debug tx 0xYourTxHashHere
352
+ arcdevkit debug tx 0xYourTxHashHere
352
353
 
353
354
  # Load an ABI to decode input data
354
- arc debug tx 0xYourTxHash --abi ./MyContract.abi.json
355
+ arcdevkit debug tx 0xYourTxHash --abi ./MyContract.abi.json
355
356
 
356
357
  # Batch — analyze a file of hashes (one per line)
357
- arc debug batch hashes.txt
358
+ arcdevkit debug batch hashes.txt
358
359
 
359
- # View recent analysis history
360
- arc history
360
+ # View recent operation history
361
+ arcdevkit history
361
362
  ```
362
363
 
363
364
  ```python
@@ -394,10 +395,13 @@ Snapshot a wallet's complete state and activity on Arc, with AI commentary.
394
395
 
395
396
  ```bash
396
397
  # Analyze a single wallet
397
- arc portfolio analyze 0xYourWalletAddress
398
+ arcdevkit portfolio analyze 0xYourWalletAddress
399
+
400
+ # Show saved balance history
401
+ arcdevkit portfolio history 0xYourWalletAddress
398
402
 
399
403
  # Generate a consolidated report for multiple wallets
400
- arc portfolio report wallets.json
404
+ arcdevkit portfolio report wallets.json
401
405
  ```
402
406
 
403
407
  ```python
@@ -592,54 +596,77 @@ The `docker-compose.yml` mounts your `.env` and runs the API on port 8000 with a
592
596
 
593
597
  ## CLI Reference
594
598
 
595
- Arc DevKit provides two CLI entry points:
599
+ The primary entry point is `arcdevkit`, with commands grouped by domain.
596
600
 
597
- | Command | Entry Point |
598
- |---|---|
599
- | `arc` | Flat, friendly commands for day-to-day use |
600
- | `arcdevkit` | Grouped subcommand style |
601
+ ### Setup
602
+
603
+ ```bash
604
+ arcdevkit init # interactive .env wizard
605
+ arcdevkit status # check testnet connection + block info
606
+ ```
601
607
 
602
- ### `arc`quick commands
608
+ ### Configmanage `.env`
603
609
 
604
610
  ```bash
605
- # Setup
606
- arc init # guided .env wizard
607
- arc status # testnet connection + block info
608
- arc config list # show all env vars
609
- arc config get ANTHROPIC_API_KEY # read a specific var
610
- arc config set ARC_RPC_URL https://... # write a var
611
+ arcdevkit config list # show all variables
612
+ arcdevkit config get ANTHROPIC_API_KEY # read a specific variable
613
+ arcdevkit config set ARC_RPC_URL https://...# write a variable
614
+ ```
611
615
 
612
- # Wallet
613
- arc wallet create # generate new wallet
614
- arc wallet balance --address 0x... # check balance
616
+ ### Copilot — AI assistant
615
617
 
616
- # AI Copilot
617
- arc ask "What is Malachite consensus?"
618
- arc ask --stream "Write a USDC vault"
619
- arc ask --json "..." # output as JSON
618
+ ```bash
619
+ arcdevkit copilot ask "What is Malachite consensus?"
620
+ arcdevkit copilot ask "Write a USDC vault" --stream # token-by-token streaming
621
+ arcdevkit copilot ask "..." --json # output as JSON
622
+ ```
620
623
 
621
- # Transaction debugging
622
- arc debug tx 0xHash
623
- arc debug tx 0xHash --abi Contract.json
624
- arc history # list recent debug sessions
624
+ ### Agent — wallet & payments
625
625
 
626
- # Portfolio
627
- arc portfolio analyze 0xWallet
628
- arc portfolio report wallets.json
626
+ ```bash
627
+ arcdevkit agent create-wallet # generate new EVM wallet
628
+ arcdevkit agent balance 0xAddress... # check wallet balance
629
+ arcdevkit agent status # network info (block, chain ID, gas)
630
+ arcdevkit agent pay 0xDest... 5.0 # sign-only (safe default)
631
+ arcdevkit agent pay 0xDest... 5.0 --send # sign and broadcast
632
+ arcdevkit agent pay 0xDest... 5.0 --send --key 0xPrivKey...
633
+ arcdevkit agent monitor 0xWallet... # watch balance changes
634
+ arcdevkit agent monitor 0xWallet... --interval 5 --max 50
635
+ ```
629
636
 
630
- # Flags (work on every command)
631
- arc --json <cmd> # machine-readable JSON output
632
- arc -v <cmd> # verbose (DEBUG logging)
637
+ ### Debug transaction analysis
638
+
639
+ ```bash
640
+ arcdevkit debug tx 0xHash... # analyze a transaction with AI
641
+ arcdevkit debug tx 0xHash... --json
642
+ arcdevkit debug estimate 0xDest... 10.0 # estimate gas cost
643
+ arcdevkit debug estimate 0xDest... 10.0 --from 0xSender...
644
+ arcdevkit debug batch hashes.txt # analyze multiple txs from a file
645
+ arcdevkit debug batch hashes.txt --abi MyContract.json
633
646
  ```
634
647
 
635
- ### `arcdevkit`grouped style
648
+ ### Portfoliowallet analytics
636
649
 
637
650
  ```bash
638
- arcdevkit status
639
- arcdevkit copilot ask "..."
640
- arcdevkit agent wallet create
641
- arcdevkit agent pay --to 0x... --amount 10
642
- arcdevkit debug tx 0xHash
651
+ arcdevkit portfolio analyze 0xWallet... # balances, txs, AI insights
652
+ arcdevkit portfolio analyze 0xWallet... --no-ai --blocks 500
653
+ arcdevkit portfolio history 0xWallet... # saved balance snapshots
654
+ arcdevkit portfolio report wallets.json # consolidated multi-wallet report
655
+ ```
656
+
657
+ ### Codegen — script generation
658
+
659
+ ```bash
660
+ arcdevkit codegen "monitor a wallet and alert when balance drops"
661
+ arcdevkit codegen "deploy an ERC-20 with a mint function" --out ./scripts
662
+ arcdevkit codegen "..." --no-save # print only, don't save to disk
663
+ ```
664
+
665
+ ### History — operation log
666
+
667
+ ```bash
668
+ arcdevkit history # last 10 CLI operations
669
+ arcdevkit history --limit 25 --json
643
670
  ```
644
671
 
645
672
  ---
@@ -1,5 +1,5 @@
1
- arc_devkit/__init__.py,sha256=XFDX5mvLfHCS9HcvxdkFg2dvgGWeisCPYSSdlScKXwE,94
2
- arc_devkit/config.py,sha256=btRtZOmGtUqGmybaCkSM2iTeySKOI9qTYrK045_WDvU,1880
1
+ arc_devkit/__init__.py,sha256=rvVSkUUgL3KnmAPdswMK54rSRnD-pN_p7RMR9Y2yfZU,249
2
+ arc_devkit/config.py,sha256=7KX5xCRYSOPj6o_XWqefhhFJmFXNNHbJ1EEdX1cCf0g,1917
3
3
  arc_devkit/agents/__init__.py,sha256=Yo3yOyJXxh7ctPP0XP-Gdl-ptGWDqPGY6My5PVVb2lw,442
4
4
  arc_devkit/agents/async_base.py,sha256=286rbRXpBuoAKl14kgeGKIPIRk-k5hcFMI8uclbDDSk,913
5
5
  arc_devkit/agents/async_monitor.py,sha256=xkNx6OEbqo3io0W54OPVB8zOpVGpII9-hiptvBX3DBw,11562
@@ -16,15 +16,15 @@ arc_devkit/api/routes/copilot.py,sha256=1jfqE2sMdVwwof4mcLjQHAwvVva47msDtki3WXmO
16
16
  arc_devkit/api/routes/debugger.py,sha256=PP88p9POnzvEzu7O8M7DCIaC8CKWgauDgXaRzLdoC9A,2768
17
17
  arc_devkit/cli/__init__.py,sha256=HxXvqwve8YcVgcPMtyh1Eh_pEP7OhNG1xV1s4XWyIsQ,67
18
18
  arc_devkit/cli/flat.py,sha256=xM7KMsnxyUtg7v4rVmrkbWp3r5NwrL-jDzOVYIY4SrY,39409
19
- arc_devkit/cli/main.py,sha256=-_KkL6tMLne6mYyb2LMP4ahIzzy4g4FkTA1Pc8En2z0,2467
19
+ arc_devkit/cli/main.py,sha256=HWBQFzxh9CO2Dl-m0pdDkr3LEif4E6NMn7cl51NTIcE,3902
20
20
  arc_devkit/cli/commands/__init__.py,sha256=9mV6f6CarhEi8Q0qIiw-JB2TU4UqVqTuvEX9ICyQ13o,34
21
21
  arc_devkit/cli/commands/agent.py,sha256=j3pUEPasps4aQgjL6kuWtWE7N9PqtuGlKAE5aAKIGUY,6113
22
22
  arc_devkit/cli/commands/copilot.py,sha256=kDv_-7tqSJJ1sYSVYMhqAHOYQPUb9QuCUDHlHM4SrNs,1804
23
- arc_devkit/cli/commands/debug.py,sha256=PpOxQx8fB1oouwgaEDW6dxER3puBtI7Vj4O_B1hN7vk,3398
23
+ arc_devkit/cli/commands/debug.py,sha256=RD-b7fCho1VhFcGfoPhBIZITaoKneF4MF6Ppg4qkcWQ,4137
24
24
  arc_devkit/contracts/__init__.py,sha256=svjHzot5EcNlHdgaVpYNMgyVJDfGEldZUXXZHDOY5xQ,251
25
25
  arc_devkit/contracts/loader.py,sha256=528hp2dVPZNOdVYuUiiYlF9GOK4uKbmfKEC99ChgIYQ,4423
26
26
  arc_devkit/copilot/__init__.py,sha256=ux9txnF1N7tSNaLVuGuk-7Uqkfe1LSnPwzHcFi5-HRc,151
27
- arc_devkit/copilot/agent.py,sha256=ooUFz3HoTQMFEmRzHSRjxOMIbn_jY5QbKJUTi6WqK-M,7757
27
+ arc_devkit/copilot/agent.py,sha256=qcDvpSDAXalvlphqIWfojA8jZCUSP2jD9RP_8DNZkGc,8376
28
28
  arc_devkit/core/__init__.py,sha256=sxwWfKv3SrvmAYoqqsKGC1lRZsnzSV21zzt-rZCyGSA,64
29
29
  arc_devkit/core/connection.py,sha256=aoIrlIUW7oZuy9q-rCS_GsCn6xTiMjSQFYAnWZwU3Pc,1309
30
30
  arc_devkit/core/gas.py,sha256=sxdbAfYqTeCGOk_jvjOS-1j7jAFFEBzwwefRB1XBOsY,1956
@@ -37,8 +37,8 @@ arc_devkit/events/__init__.py,sha256=t_t5v1Qfrno-YsE7xWC864RJ61Y4VU5aWhJ5BN0YdLE
37
37
  arc_devkit/events/listener.py,sha256=XjIKbh69KC0up3zlf9hgGnEu-X4qQZuoWbDxA3CJ-F0,7066
38
38
  arc_devkit/usdc/__init__.py,sha256=xpvdqiMPC3o7x3bHCBwTy3K-ogQWfVjS99jzG4fQQO0,145
39
39
  arc_devkit/usdc/token.py,sha256=U-eUh4as8It4R96YsxrSslxHO6ACBNWUqwvxc2GagGs,7609
40
- arc_devkit-0.4.2.dist-info/METADATA,sha256=0FNSWej50Drbq-o6zNPBgj71sW4LmWch1nlghWvTXqI,23457
41
- arc_devkit-0.4.2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
42
- arc_devkit-0.4.2.dist-info/entry_points.txt,sha256=iriL0KhiF80Y8dlMbHlc3RS2rzWCQctxnSm0Jp_JxjQ,84
43
- arc_devkit-0.4.2.dist-info/top_level.txt,sha256=_8As_e0w6FWAQptRM9vVTpBaTQmGKjajyiscnqRps-8,11
44
- arc_devkit-0.4.2.dist-info/RECORD,,
40
+ arc_devkit-0.4.4.dist-info/METADATA,sha256=VbZBMPFGxYC7nBi2HOP-bi2O3mmcX1kmwznl8rWtAuM,24729
41
+ arc_devkit-0.4.4.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
42
+ arc_devkit-0.4.4.dist-info/entry_points.txt,sha256=iriL0KhiF80Y8dlMbHlc3RS2rzWCQctxnSm0Jp_JxjQ,84
43
+ arc_devkit-0.4.4.dist-info/top_level.txt,sha256=_8As_e0w6FWAQptRM9vVTpBaTQmGKjajyiscnqRps-8,11
44
+ arc_devkit-0.4.4.dist-info/RECORD,,