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.
Metadata
Release files for cairo-toolkit 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cairo-toolkit-1.0.1.tar.gz | 12.2 kB | Without provenance | Details for cairo-toolkit-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cairo_toolkit-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for cairo_toolkit-1.0.1-py3-none-any.whl |
Total release size: 21.8 kB
Release files / cairo-toolkit-1.0.1.tar.gz
| Download URL | cairo-toolkit-1.0.1.tar.gz |
|---|---|
| Size | 12.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d1c4ca6f36506a434d7b654048661f2ca18dc7cc9e0caec086d2cb00d5209d7f
|
|
BLAKE2b-256 checksum How to use checksums |
44e434a72d134c747f2627350b1da139bd4f301e1341e476665a4940602b8bfa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.7
|
Release files / cairo_toolkit-1.0.1-py3-none-any.whl
| Download URL | cairo_toolkit-1.0.1-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d13d4052952651e2b20f258a5bc819ca7de65b2941022aee0df926c9fbf50119
|
|
BLAKE2b-256 checksum How to use checksums |
191878b1c518e2c5cae799d84aa0f2556d68452a7a8d81df3558067194324e82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.7
|
Security for cairo-toolkit 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.