Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cairo-toolkit-1.0.1.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cairo_toolkit-1.0.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file cairo-toolkit-1.0.1.tar.gz.

File metadata

  • Download URL: cairo-toolkit-1.0.1.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for cairo-toolkit-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d1c4ca6f36506a434d7b654048661f2ca18dc7cc9e0caec086d2cb00d5209d7f
MD5 5ab277bd53d647e8b28d492f1e3e7127
BLAKE2b-256 44e434a72d134c747f2627350b1da139bd4f301e1341e476665a4940602b8bfa

See more details on using hashes here.

File details

Details for the file cairo_toolkit-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: cairo_toolkit-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for cairo_toolkit-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d13d4052952651e2b20f258a5bc819ca7de65b2941022aee0df926c9fbf50119
MD5 eb0fafe1ec60f7404683d43242100537
BLAKE2b-256 191878b1c518e2c5cae799d84aa0f2556d68452a7a8d81df3558067194324e82

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page