crypto-com-developer-platform-client


Namecrypto-com-developer-platform-client JSON
Version 1.0.5 PyPI version JSON
download
home_pagehttps://github.com/crypto-com/developer-platform-client-py
SummaryA python client to interact with @cryptocom/developer-platform-service
upload_time2024-11-01 08:09:29
maintainerNone
docs_urlNone
authorRic Arcifa
requires_python<4.0.0,>=3.8.1
licenseMIT
keywords blockchain crypto.com tool sdk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Crypto.com Developer Platform Client.py

The **Crypto.com Developer Platform Client.py** is a pyton SDK designed to interact seamlessly with the Crypto.com Developer Platform Service API. This client library simplifies interactions with the Cronos blockchain, supporting native tokens, ERC20 tokens, smart contracts, transactions, blocks, and wallets.

![PyPI](https://pypi.org/project/developer-platform-client-py)

## Features

- Simple and intuitive API for interacting with Cronos blockchain networks.
- Supports token balances (native & ERC20), token transfers, wrapping, and swapping.
- Transaction queries by address or hash, and fetching transaction statuses.
- Smart contract ABI fetching by contract address.
- Wallet creation and balance management.
- Supports **Cronos EVM** and **Cronos ZK EVM** chains.

## Installation

To install the package, run the following command:

```bash
pip install crypto-com-developer-platform-client
```

## Usage

Here’s how you can use the Crypto.com Python Client for Developer Platform in your project:

### Configuring the Client

```py
from crypto-com-developer-platform-client import Block, Client
from crypto-com-developer-platform-client.interfaces.chain_interfaces import CronosZkEvm


Client.init(api_key="EXPLORER_API_KEY",
            chain_id=CronosZkEvm.TESTNET,provider="YOUR_PROVIDER")

block = Block.get_by_tag("latest")
```

## API Methods

### Block

- `get_by_tag(tag, tx_detail)`
  - `tag`: Integer of a block number in hex, or the string "earliest", "latest" or "pending", as in https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block
  - `tx_detail`: If true it returns the full transaction objects, if false only the hashes of the transactions.

### Contract

- `get_contract_abi(contract_address)`
  - `contract_address`: The address of the smart contract.

### Token

- `get_native_balance(address)`
  - `address`: The address to get the balance for.
- `get_erc20_balance(address, contract_address, block_height)`
  - `address`: The address to get the balance for.
  - `contract_address`: The contract address to get the balance for.
  - `block_height`: The block height to get the balance for. Optional, default to "latest".
- `transfer_token(to, amount)`
  - `to`: The address to transfer the token to.
  - `amount`: The amount of token to transfer.
- `wrap_token(from_contract_address, to_contract_address, to, amount)`
  - `from_contract_address`: The address to wrap the token from.
  - `to_contract_address`: The address to wrap the token to.
  - `to`: The address to send the wrapped token to
  - `amount`: The amount of token to wrap.
- `swap_token(from_contract_address, to_contract_address, to, amount)`
  - `from_contract_address`: The token to swap from.
  - `to_contract_address`: The token to swap to.
  - `to`: The address to send the swapped token to
  - `amount`: The amount of token to swap.

### Transaction

- `get_transactions_by_address(address, session, limit)`
  - `address`: The address to get the transactions for.
  - `session`: The session to get the transactions for. Optional, default to "".
  - `limit`: The limit of the transactions to get. Optional, default to "20".
- `get_transaction_by_hash(hash)`
  - `hash`: The hash of the transaction.
- `get_transaction_status(hash)`
  - `hash`: The hash of the transaction to get the status for.

### Wallet

- `create_wallet()`
- `get_balance(address)`
  - `address`: The address to get the balance for.

## Licensing

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

## Contact

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


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/crypto-com/developer-platform-client-py",
    "name": "crypto-com-developer-platform-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0.0,>=3.8.1",
    "maintainer_email": null,
    "keywords": "blockchain, crypto.com, tool, SDK",
    "author": "Ric Arcifa",
    "author_email": "ricardo.arcifa@crypto.com",
    "download_url": null,
    "platform": null,
    "description": "# Crypto.com Developer Platform Client.py\n\nThe **Crypto.com Developer Platform Client.py** is a pyton SDK designed to interact seamlessly with the Crypto.com Developer Platform Service API. This client library simplifies interactions with the Cronos blockchain, supporting native tokens, ERC20 tokens, smart contracts, transactions, blocks, and wallets.\n\n![PyPI](https://pypi.org/project/developer-platform-client-py)\n\n## Features\n\n- Simple and intuitive API for interacting with Cronos blockchain networks.\n- Supports token balances (native & ERC20), token transfers, wrapping, and swapping.\n- Transaction queries by address or hash, and fetching transaction statuses.\n- Smart contract ABI fetching by contract address.\n- Wallet creation and balance management.\n- Supports **Cronos EVM** and **Cronos ZK EVM** chains.\n\n## Installation\n\nTo install the package, run the following command:\n\n```bash\npip install crypto-com-developer-platform-client\n```\n\n## Usage\n\nHere\u2019s how you can use the Crypto.com Python Client for Developer Platform in your project:\n\n### Configuring the Client\n\n```py\nfrom crypto-com-developer-platform-client import Block, Client\nfrom crypto-com-developer-platform-client.interfaces.chain_interfaces import CronosZkEvm\n\n\nClient.init(api_key=\"EXPLORER_API_KEY\",\n            chain_id=CronosZkEvm.TESTNET,provider=\"YOUR_PROVIDER\")\n\nblock = Block.get_by_tag(\"latest\")\n```\n\n## API Methods\n\n### Block\n\n- `get_by_tag(tag, tx_detail)`\n  - `tag`: Integer of a block number in hex, or the string \"earliest\", \"latest\" or \"pending\", as in https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block\n  - `tx_detail`: If true it returns the full transaction objects, if false only the hashes of the transactions.\n\n### Contract\n\n- `get_contract_abi(contract_address)`\n  - `contract_address`: The address of the smart contract.\n\n### Token\n\n- `get_native_balance(address)`\n  - `address`: The address to get the balance for.\n- `get_erc20_balance(address, contract_address, block_height)`\n  - `address`: The address to get the balance for.\n  - `contract_address`: The contract address to get the balance for.\n  - `block_height`: The block height to get the balance for. Optional, default to \"latest\".\n- `transfer_token(to, amount)`\n  - `to`: The address to transfer the token to.\n  - `amount`: The amount of token to transfer.\n- `wrap_token(from_contract_address, to_contract_address, to, amount)`\n  - `from_contract_address`: The address to wrap the token from.\n  - `to_contract_address`: The address to wrap the token to.\n  - `to`: The address to send the wrapped token to\n  - `amount`: The amount of token to wrap.\n- `swap_token(from_contract_address, to_contract_address, to, amount)`\n  - `from_contract_address`: The token to swap from.\n  - `to_contract_address`: The token to swap to.\n  - `to`: The address to send the swapped token to\n  - `amount`: The amount of token to swap.\n\n### Transaction\n\n- `get_transactions_by_address(address, session, limit)`\n  - `address`: The address to get the transactions for.\n  - `session`: The session to get the transactions for. Optional, default to \"\".\n  - `limit`: The limit of the transactions to get. Optional, default to \"20\".\n- `get_transaction_by_hash(hash)`\n  - `hash`: The hash of the transaction.\n- `get_transaction_status(hash)`\n  - `hash`: The hash of the transaction to get the status for.\n\n### Wallet\n\n- `create_wallet()`\n- `get_balance(address)`\n  - `address`: The address to get the balance for.\n\n## Licensing\n\nThe code in this project is licensed under the MIT license.\n\n## Contact\n\nIf you have any questions or comments about the library, please feel free to open an issue or a pull request on our GitHub repository.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A python client to interact with @cryptocom/developer-platform-service",
    "version": "1.0.5",
    "project_urls": {
        "Documentation": "https://github.com/crypto-com/developer-platform-client-py#readme",
        "Homepage": "https://github.com/crypto-com/developer-platform-client-py",
        "Repository": "https://github.com/crypto-com/developer-platform-client-py"
    },
    "split_keywords": [
        "blockchain",
        " crypto.com",
        " tool",
        " sdk"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b324aba8a49ef659071fc97bd119a9a7563168f5f8327f306b0f9284d040365d",
                "md5": "1f503c35fe1719891b5658ac700c3196",
                "sha256": "3099b0cddfaf0d30b0e237cd9140b25a90ee5884cee84c105f5e97ba4d9b3560"
            },
            "downloads": -1,
            "filename": "crypto_com_developer_platform_client-1.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1f503c35fe1719891b5658ac700c3196",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0.0,>=3.8.1",
            "size": 13375,
            "upload_time": "2024-11-01T08:09:29",
            "upload_time_iso_8601": "2024-11-01T08:09:29.759546Z",
            "url": "https://files.pythonhosted.org/packages/b3/24/aba8a49ef659071fc97bd119a9a7563168f5f8327f306b0f9284d040365d/crypto_com_developer_platform_client-1.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-01 08:09:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "crypto-com",
    "github_project": "developer-platform-client-py",
    "github_not_found": true,
    "lcname": "crypto-com-developer-platform-client"
}
        
Elapsed time: 1.01064s