crypto-com-developer-platform-client


Namecrypto-com-developer-platform-client JSON
Version 1.0.2 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-10-25 06:44:27
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.2",
    "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": "8887695cf6cbcfdbbea7ba7355497968cb775e3a090303e22323aa2811e9cc68",
                "md5": "8713395663e5f686fbc0a72a068edbf1",
                "sha256": "4fff75cb7fa5b83f1c4c10e7f0c6e41df690cd2171b91e21572195ea7a2e8b57"
            },
            "downloads": -1,
            "filename": "crypto_com_developer_platform_client-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8713395663e5f686fbc0a72a068edbf1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0.0,>=3.8.1",
            "size": 13355,
            "upload_time": "2024-10-25T06:44:27",
            "upload_time_iso_8601": "2024-10-25T06:44:27.061497Z",
            "url": "https://files.pythonhosted.org/packages/88/87/695cf6cbcfdbbea7ba7355497968cb775e3a090303e22323aa2811e9cc68/crypto_com_developer_platform_client-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-25 06:44:27",
    "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.11363s