A set of useful tools for cairo / starknet development.
Project description
Cairo-toolkit
A set of useful tools for cairo / starknet development.
- Generate / check the interfaces corresponding to your Starknet contracts.
- Easily order your imports
Installation
pip install cairo-toolkit
Usage
cairo-toolkit [OPTIONS] COMMAND [ARGS]...
Options:
--version
--help Show this message and exit.
Commands:
check-interface
generate-interface
order-imports
Generate interfaces
Usage: cairo-toolkit generate-interface [OPTIONS]
Options:
-f, --files TEXT File paths
-p, --protostar Uses `protostar.toml` to get file paths
-d, --directory TEXT Output directory for the interfaces. If unspecified,
they will be created in the same directory as the
contracts
--help Show this message and exit.
Check existing interfaces
Usage: cairo-toolkit check-interface [OPTIONS]
Options:
--files TEXT Contracts to check
-p, --protostar Uses `protostar.toml` to get file paths
-d, --directory TEXT Directory of the interfaces to check. Interfaces must
be named `i_<contract_name>.cairo`
--help Show this message and exit.
Ordering imports in existing file
Usage: cairo-toolkit order-imports [OPTIONS]
Options:
-d, --directory TEXT Directory with cairo files to format
-f, --files TEXT File paths
-i, --imports TEXT Imports order
--help Show this message and exit.
Example
Generate interfaces for the contracts in contracts/ and put them in interfaces/:
find contracts/ -iname '*.cairo' -exec cairo-toolkit generate-interface --files {} \;
Check the interface for test/main.cairo against the interface i_main.cairo in interfaces/:
cairo-toolkit check-interface --files test/main.cairo -d interfaces
Order imports for all cairo files under test
cairo-toolkit order-imports -d test
Protostar
You can use cairo-toolkit in a protostar project.
This can be paired with a github action to automatically generate the interfaces for the contracts
that specified inside the protostar.toml file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cairo-toolkit-1.0.0.tar.gz.
File metadata
- Download URL: cairo-toolkit-1.0.0.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
714f118ec8fb8e2ecbb22ca912c071fc368ff27529e58c0a61a5de6817b98b51
|
|
| MD5 |
e7d94d5559fdda0917359e8bf6243db0
|
|
| BLAKE2b-256 |
6163bb393d8b8fe657395117525bdbb280ebc2f07c8405c16b57660f6b2a4a5d
|
File details
Details for the file cairo_toolkit-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cairo_toolkit-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa85d1f62c2d31c8468672b8225e4c5fb74d9b916529c2bab80fb01f1b6449aa
|
|
| MD5 |
cd34dfb83f55da0627d2819db53f9ac1
|
|
| BLAKE2b-256 |
e76702f82f239da22287482de6d3e0438b486b68da066a3cd1e785ee09af3f5e
|