# On-Chain Developer Platform Client SDK

## Introduction

The Crypto.com On-Chain Developer Platform Client SDK is 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.

### Features

{% hint style="info" %}
**Currently in beta**: Expect frequent updates and potential changes in future releases.
{% endhint %}

* Supports `Cronos EVM` and `Cronos zkEVM`.
* Simple and intuitive API for interacting with Cronos blockchain networks.
* Native and ERC20/ERC721 token operations
* Token transfers, wrapping, and swapping.
* Transaction queries by address or hash, and fetching transaction statuses.
* Smart contract ABI and bytecode fetching by contract address.
* Wallet creation and balance management.
* Cronos ID forward/reverse resolution.
* DeFi protocols and features, including yield farming and token utilities.
* Crypto.com exchange data

### Installation

{% tabs %}
{% tab title="Python" %}
To install the package, run the following command:

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

{% endtab %}

{% tab title="TypeScript / JavaScript" %}
To install the package, run the following command in your project directory:

```
npm install @crypto.com/developer-platform-client
```

{% endtab %}
{% endtabs %}

### Usage

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

#### Initialize the Client

First, initialize the client with your API key. To obtain an API key, please refer to the following page:

{% content-ref url="/pages/BTultEZRI7GfltzdChTh" %}
[Developer Platform Dashboard](/crypto.com-developer-platform/developer-platform-dashboard.md)
{% endcontent-ref %}

{% tabs %}
{% tab title="Python" %}

```python
from crypto_com_developer_platform_client import Client

Client.init(
    api_key="YOUR_API_KEY",
    provider="https://your-provider.com"  # Optional
)
```

{% endtab %}

{% tab title="TypeScript / JavaScript" %}

```typescript
import { Client } from '@crypto.com/developer-platform-client';

Client.init({
  apiKey: 'YOUR_API_KEY',
  provider: 'https://your-provider-url.com', // Optional
});
```

{% endtab %}
{% endtabs %}

#### Supported Chains

The SDK supports both **Cronos EVM** and **Cronos ZK EVM** networks.

{% tabs %}
{% tab title="Python" %}

```python
from crypto_com_developer_platform_client.interfaces.chain_interfaces import CronosEvm, CronosZkEvm

CronosEvm.MAINNET     # Chain ID: 25
CronosEvm.TESTNET     # Chain ID: 338
CronosZkEvm.MAINNET   # Chain ID: 388
CronosZkEvm.TESTNET   # Chain ID: 240
```

{% endtab %}

{% tab title="TypeScript / JavaScript" %}

<pre class="language-typescript"><code class="lang-typescript"><strong>import { CronosEvm, CronosZkEvm } from '@crypto.com/developer-platform-client';
</strong>
CronosEvm.Mainnet; // Chain ID: 25
CronosEvm.Testnet; // Chain ID: 338
CronosZkEvm.Mainnet; // Chain ID: 388
CronosZkEvm.Testnet; // Chain ID: 240
</code></pre>

{% endtab %}
{% endtabs %}

#### Modules and Examples

Below section provides detailed information on these blockchain functions and example interactions, guiding developers on how to effectively interact with Cronos Chains using the Developer Platform Client SDK.

{% content-ref url="/pages/WtCRA7xj6YnCxHuqyfK0" %}
[Wallet Module](/crypto.com-developer-platform/on-chain-developer-platform-client-sdk/wallet-module.md)
{% endcontent-ref %}

{% content-ref url="/pages/kFXul71c58dO9uQFOLLe" %}
[Token Module](/crypto.com-developer-platform/on-chain-developer-platform-client-sdk/token-module.md)
{% endcontent-ref %}

{% content-ref url="/pages/k0Nwxh2PoS7YCaXMZcd0" %}
[Transaction Module](/crypto.com-developer-platform/on-chain-developer-platform-client-sdk/transaction-module.md)
{% endcontent-ref %}

{% content-ref url="/pages/3HvwAV6tgoxqSSG4PLxp" %}
[Block Module](/crypto.com-developer-platform/on-chain-developer-platform-client-sdk/block-module.md)
{% endcontent-ref %}

{% content-ref url="/pages/y7AhF15U4HGW6sG7YgRb" %}
[Contract Module](/crypto.com-developer-platform/on-chain-developer-platform-client-sdk/contract-module.md)
{% endcontent-ref %}

{% content-ref url="/pages/arObB9kZv5BzNGT29Qhg" %}
[CronosID Module](/crypto.com-developer-platform/on-chain-developer-platform-client-sdk/cronosid-module.md)
{% endcontent-ref %}

{% content-ref url="/pages/3qWjI2eV3uzKw7c5OF3O" %}
[Defi Module](/crypto.com-developer-platform/on-chain-developer-platform-client-sdk/defi-module.md)
{% endcontent-ref %}

{% content-ref url="/pages/qrYepsZzhEHhzwH8LPpb" %}
[Exchange Module](/crypto.com-developer-platform/on-chain-developer-platform-client-sdk/exchange-module.md)
{% endcontent-ref %}

{% content-ref url="/pages/aWiQJQgvChafFotESSsK" %}
[Event Module](/crypto.com-developer-platform/on-chain-developer-platform-client-sdk/event-module.md)
{% endcontent-ref %}

{% content-ref url="/pages/SKfHkbzjYYAVYdfcDTZb" %}
[Network Module](/crypto.com-developer-platform/on-chain-developer-platform-client-sdk/network-module.md)
{% endcontent-ref %}

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ai-agent-sdk-docs.crypto.com/crypto.com-developer-platform/on-chain-developer-platform-client-sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
