Skip to main content

A Python client for interacting with the Cronos Chains

Project description

Cronos Chain Client

The Cronos Chain Client is a Python library designed to facilitate easy and efficient interactions with the Cronos Chains. This client library provides methods to fetch CRC20 tokens, making it easy for developers to work with tokens on the Cronos chain.

Features

  • Simple and intuitive API for interacting with the Cronos blockchain.
  • Supports fetching a list of CRC20 tokens.
  • Configurable client instances tailored to your specific blockchain endpoint and API key needs.

Installation

To install the package, run the following command in your project directory:

pip install cronos-chain-client

Usage

Here’s how you can use the Cronos Chain Client in your project:

Configuring the Client

from cronos_chain_client.client import create_client

client = create_client({
    'chain': 'evm',
    'network': 'mainnet',
    'explorer': {
        'apiKey': 'OPPTIONAL_API_KEY', # Optional
    }
})

Fetching CRC20 Token List

To get a list of CRC20 tokens with their id, name, symbol, and contract_address, you can call the following method:

tokens = client.tokens.getCRC20TokenList()
print(tokens)

Example output:

[
{"id": 1, "name": "Tether USD", "symbol": "USDT", "contract_address": "0x66e428c3f67a68878562e79a0234c1f83c208770"},
{"id": 2, "name": "USD Coin", "symbol": "USDC", "contract_address": "0xc21223249ca28397b4b6541dffaecc539bff0c59"},
{"id": 3, "name": "Dogecoin", "symbol": "DOGE", "contract_address": "0x1a8e39ae59e5556b56b76fcba98d22c9ae557396"},
]

Print token information

API

CRC20 Methods

  • getCRC20TokenList(): Fetches the list of CRC20 tokens.

Licensing

The code in this project is licensed under the MIT license.

Contact

If you have any questions or comments about the library, feel free to open an issue or a pull request on our GitHub repository.

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

cronos_chain_client-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

cronos_chain_client-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file cronos_chain_client-0.1.0.tar.gz.

File metadata

  • Download URL: cronos_chain_client-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.1

File hashes

Hashes for cronos_chain_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f5074ce6cc7c625046aa7b2e9e0de666ade5fce7aa98db7949b72d93ab5d46d3
MD5 ff8d604a46b609939069be40d0cc00e9
BLAKE2b-256 16b2f762fd28c952626d76fbe6f3e83c2ab941ada07d2e3d60dd73c4e9ec401f

See more details on using hashes here.

File details

Details for the file cronos_chain_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cronos_chain_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5f57acb5ad7306c11ad96fb78cb78e5f420123957d1f6c0ca60ffd23ea9fa49
MD5 cd85f4a6d938027a22560f752d5ea997
BLAKE2b-256 1880b3c9016e8893064d848985d173aa5c1e388a1fabaf7adfbe0ae81296720b

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