snconvert

Crates.iosnconvert
lib.rssnconvert
version0.1.3
sourcesrc
created_at2024-09-16 11:09:14.819432
updated_at2024-09-17 09:00:52.624868
descriptionA CLI tool to convert common starknet types
homepagehttps://github.com/Leonard-Pat/starknet-converter-cli
repositoryhttps://github.com/Leonard-Pat/starknet-converter-cli
max_upload_size
id1376233
size28,619
(tiffgerst)

documentation

README

Starknet Converter CLI

A command-line interface tool for converting between different data types commonly used in the Starknet blockchain ecosystem.

Features

  • 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

Installation

To install please use the cargo install command:

cargo install snconvert

This will install the CLI tool directly from crates.io

Usage

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.

Options

  • -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.

Examples

  1. Convert a hexadecimal value:

    snconvert 0x6869 -f -s
    
  2. Convert a felt value:

    snconvert 310939249775 -x -s
    
  3. Convert a short string:

    snconvert 'Hello, Starknet!' -x -f
    
  4. Display all representations:

    snconvert 0x48656c6c6f20576f726c6421
    

Error Handling

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.

Contributing

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.

Commit count: 0

cargo fmt