A command-line interface tool for converting between different data types commonly used in the Starknet blockchain ecosystem.
- Convert between hexadecimal, felt (field element), and short string representations
- Easy-to-use CLI with intuitive options
- Robust error handling and informative error messages
- Support for various input formats
To install please use the cargo install command:
cargo install snconvert
This will install the CLI tool directly from crates.io
The basic syntax for using the Starknet Converter CLI is:
snconvert <INPUT> [OPTIONS]
Where <INPUT>
is the value you want to convert, and [OPTIONS]
are the conversion options you want to apply.
-x, --hex
: Display the hexadecimal representation-f, --felt
: Display the felt (field element) representation-s, --string
: Display the short string representation
If no options are specified, the tool will display all available representations.
-
Convert a hexadecimal value:
snconvert 0x6869 -f -s
-
Convert a felt value:
snconvert 310939249775 -x -s
-
Convert a short string:
snconvert 'Hello, Starknet!' -x -f
-
Display all representations:
snconvert 0x48656c6c6f20576f726c6421
The Starknet Converter CLI includes robust error handling to help you identify issues with your input:
- Invalid input format
- String too long (max 31 characters for Starknet short strings)
- Non-ASCII characters in short string input
- Invalid hexadecimal format
If an error occurs, the tool will display a helpful error message explaining the issue.
Contributions to the Starknet Converter CLI are welcome! Please feel free to submit pull requests, create issues, or suggest new features.
For installation instructions, please see the Installation section above.