Skip to main content

Generate interfaces for your Starknet contracts

Project description

Starknet interface generator

Generate / check the interfaces corresponding to your Starknet contracts.

Installation

pip install starknet-interface-generator

Usage

Options :

Generate interfaces

Usage: starknet-interface-generator generate [OPTIONS]

Options:
  --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

starknet-interface-generator check [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.

Example

Generate interfaces for the contracts in contracts/ and put them in interfaces/:

find contracts/ -iname '*.cairo' -exec starknet-interface-generator generate --files {} \;

Check the interface for test/main.cairo against the interface i_main.cairo in interfaces/:

starknet-interface-generator check --files test/main.cairo -d interfaces

Protostar

You can use starknet-interface-generator 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.

starknet-interface-generator [generate||check] --protostar

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

starknet-interface-generator-0.1.5.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

starknet_interface_generator-0.1.5-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file starknet-interface-generator-0.1.5.tar.gz.

File metadata

File hashes

Hashes for starknet-interface-generator-0.1.5.tar.gz
Algorithm Hash digest
SHA256 69a3a373298a2fa7a1e2376e159c21d11e428d32c8f511fa9ab310cac8668db8
MD5 89611d2a0edfe1d1662b2f06fb865fb2
BLAKE2b-256 a70f5f74ec59a3d8db3c56cd7f33f1f6a4d112f6f259abfaf3ae539d06c6813e

See more details on using hashes here.

File details

Details for the file starknet_interface_generator-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for starknet_interface_generator-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6a67a91ddfbca4a035dd1ad8839dac8a9469063a54bb6fc278344dc28b40178f
MD5 8a802f18c1ebdb89d64c8b458d2527e6
BLAKE2b-256 b1805460c31fc73d90bd621021610a2f614478f1a3dc1d1fe5929bfc7c3d11d8

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