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
Currently in beta: Expect frequent updates and potential changes in future releases.
Supports Cronos EVM and Cronos zkEVM.
Simple and intuitive API for interacting with Cronos blockchain networks.
Transaction queries by address or hash, and fetching transaction statuses.
Smart contract ABI fetching by contract address.
Wallet creation and balance management.
Installation
To install the package, run the following command in your project directory:
npm install @crypto.com/developer-platform-client
To install the package, run the following command:
pip install crypto-com-developer-platform-client
Usage
Configuring the Client
Here’s how you can use the Crypto.com Client for Developer Platform in your project:
First, configure the client with your API key and desired blockchain network (Cronos EVM or Cronos ZK EVM):
import { Client, CronosZkEvm } from '@crypto.com/developer-platform-client';
Client.init({
chain: CronosZkEvm.Testnet, // Or CronosEvm.Mainnet for mainnet
apiKey: 'YOUR_API_KEY', // Explorer API
provider: 'https://provider-url.com', // Optional provider URL for signing
});
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")