Skip to main content

APIs & SDKs Overview

Circle Layer provides comprehensive APIs and SDKs for seamless blockchain integration. This section covers all the endpoints, libraries, and tools you need for development.

πŸ”§ Available APIs​

JSON-RPC API​

  • Endpoint: https://testnet-rpc.circlelayer.com
  • Compatibility: Full Ethereum JSON-RPC compatibility
  • Use Cases: Transaction submission, contract deployment, balance queries, block data

WebSocket API​

  • Endpoint: wss://testnet-rpc.circlelayer.com
  • Purpose: Real-time blockchain events and subscriptions
  • Features: Block subscriptions, transaction notifications, contract events
  • Use Cases: Live updates, event monitoring, real-time dApp features

GraphQL API​

  • Endpoint: https://testnet.circlelayer.com/graphiql
  • Purpose: Flexible, efficient data queries with filtering capabilities
  • Status: Available for testing with enhanced querying and indexing

πŸ“š Supported Web3 Libraries​

Circle Layer works seamlessly with all popular Ethereum libraries:

Web3.js​

const Web3 = require('web3');
const web3 = new Web3('https://testnet-rpc.circlelayer.com');

// Standard Ethereum methods work identically
const balance = await web3.eth.getBalance(address);
const gasPrice = await web3.eth.getGasPrice();

Ethers.js​

const { ethers } = require('ethers');
const provider = new ethers.providers.JsonRpcProvider('https://testnet-rpc.circlelayer.com');

// Same patterns as Ethereum development
const wallet = new ethers.Wallet(privateKey, provider);
const contract = new ethers.Contract(address, abi, wallet);

Viem​

import { createPublicClient, http } from 'viem';

const client = createPublicClient({
transport: http('https://testnet-rpc.circlelayer.com')
});

// Modern TypeScript-first Web3 library support

πŸ› οΈ Development Environment Integration​

Smart Contract Development​

  • Hardhat: Full development environment with Circle Layer network configuration
  • Truffle: Complete framework support with CLAYER gas configuration
  • Remix: Browser-based IDE with injected provider support
  • Foundry: Rust-based toolkit for advanced smart contract development

Frontend Frameworks​

  • React: Complete integration examples with Web3 hooks
  • Vue.js: Component libraries and reactive Web3 integration
  • Angular: Service-based Web3 integration patterns
  • Next.js: Server-side rendering with Web3 provider handling

πŸ“– API Reference Categories​

  1. RPC Endpoints - Complete JSON-RPC API documentation
  2. Web3 Libraries - Integration examples and configurations
  3. Smart Contract Development - Contract deployment guides
  4. Web3 Integration - Frontend integration patterns

πŸ“Š API Status & Availability​

ServiceStatusDocumentationRate Limits
JSON-RPC API🟒 LiveCompleteStandard Ethereum limits
WebSocket API🟒 LiveComplete100 connections/IP
Block Explorer API🟒 LiveAvailable1000 requests/hour
GraphQL API🟒 LiveAvailable1000 requests/hour

πŸ”’ API Security & Best Practices​

Rate Limiting​

  • JSON-RPC: Standard Ethereum rate limits apply
  • WebSocket: Maximum 100 concurrent connections per IP
  • Public Endpoints: Fair usage policy enforced

Error Handling​

// Proper error handling example
try {
const result = await web3.eth.sendTransaction(txParams);
console.log('Transaction sent:', result.transactionHash);
} catch (error) {
if (error.code === -32603) {
console.error('Internal error:', error.message);
} else if (error.code === -32000) {
console.error('Transaction failed:', error.message);
}
}

Network Resilience​

// Multiple endpoint configuration for redundancy
const providers = [
'https://testnet-rpc.circlelayer.com',
// Additional endpoints can be added for failover
];

const provider = new ethers.providers.FallbackProvider(
providers.map(url => new ethers.providers.JsonRpcProvider(url))
);

πŸš€ Getting Started Quick Guide​

1. Basic Setup​

# Install required dependencies
npm install web3 ethers
# or
npm install @wagmi/core viem

2. Network Configuration​

// Basic provider setup
const provider = new ethers.providers.JsonRpcProvider('https://testnet-rpc.circlelayer.com');

// Or with Web3.js
const web3 = new Web3('https://testnet-rpc.circlelayer.com');

3. Contract Interaction​

// Deploy or interact with contracts
const contract = new ethers.Contract(contractAddress, abi, provider);
const result = await contract.someMethod();

πŸ†˜ Developer Support​

Documentation Resources​

  • πŸ“– Complete API reference documentation
  • πŸ’¬ Community support via Telegram
  • πŸ› Issue tracking on GitHub
  • πŸ“§ Direct developer support available

Integration Examples​

Next Steps​

Ready to start building? Check out our development guides: