Files
smom-dbis-138/docs/api/API_REFERENCE.md
defiQUG 1fb7266469 Add Oracle Aggregator and CCIP Integration
- Introduced Aggregator.sol for Chainlink-compatible oracle functionality, including round-based updates and access control.
- Added OracleWithCCIP.sol to extend Aggregator with CCIP cross-chain messaging capabilities.
- Created .gitmodules to include OpenZeppelin contracts as a submodule.
- Developed a comprehensive deployment guide in NEXT_STEPS_COMPLETE_GUIDE.md for Phase 2 and smart contract deployment.
- Implemented Vite configuration for the orchestration portal, supporting both Vue and React frameworks.
- Added server-side logic for the Multi-Cloud Orchestration Portal, including API endpoints for environment management and monitoring.
- Created scripts for resource import and usage validation across non-US regions.
- Added tests for CCIP error handling and integration to ensure robust functionality.
- Included various new files and directories for the orchestration portal and deployment scripts.
2025-12-12 14:57:48 -08:00

4.3 KiB

API Reference

Last Updated: 2025-01-27
Status: Active
Base URL: https://rpc.d-bis.org

Table of Contents

Overview

This API provides JSON-RPC 2.0 endpoints for interacting with the DeFi Oracle Meta Mainnet (ChainID 138).

Authentication

Currently, the public RPC endpoint does not require authentication. Rate limiting is applied per IP address.

Note

: For production applications, consider using authenticated endpoints or API keys.

JSON-RPC Methods

Standard Ethereum Methods

All standard Ethereum JSON-RPC methods are supported. See Ethereum JSON-RPC Specification for complete reference.

Common Methods

  • eth_blockNumber - Get latest block number
  • eth_getBalance - Get account balance
  • eth_getTransactionCount - Get transaction count (nonce)
  • eth_sendTransaction - Send transaction
  • eth_call - Execute call without creating transaction
  • eth_getTransactionReceipt - Get transaction receipt
  • eth_getLogs - Get event logs

Example Request

curl -X POST https://rpc.d-bis.org \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_blockNumber",
    "params": [],
    "id": 1
  }'

Example Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x12345"
}

Request/Response Format

Request Format

{
  "jsonrpc": "2.0",
  "method": "method_name",
  "params": [param1, param2],
  "id": 1
}

Response Format

Success:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "result_data"
}

Error:

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32000,
    "message": "Error message"
  }
}

Error Handling

Error Codes

Code Meaning Description
-32700 Parse error Invalid JSON
-32600 Invalid Request JSON is not a valid request
-32601 Method not found Method does not exist
-32602 Invalid params Invalid method parameters
-32603 Internal error Internal JSON-RPC error
-32000 Server error Generic server error
-32001 Rate limit Rate limit exceeded

Error Response Example

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32001,
    "message": "Rate limit exceeded",
    "data": {
      "limit": 1200,
      "window": "1 minute"
    }
  }
}

Rate Limits

  • Default: 1200 requests per minute per IP
  • eth_call: 600 requests per minute
  • eth_getLogs: 300 requests per minute
  • eth_getBlockByNumber: 600 requests per minute

Rate limit headers are included in responses:

  • X-RateLimit-Limit: Maximum requests allowed
  • X-RateLimit-Remaining: Remaining requests in window
  • X-RateLimit-Reset: Time when limit resets

Examples

Get Latest Block Number

curl -X POST https://rpc.d-bis.org \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_blockNumber",
    "params": [],
    "id": 1
  }'

Get Account Balance

curl -X POST https://rpc.d-bis.org \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_getBalance",
    "params": ["0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb", "latest"],
    "id": 1
  }'

Call Contract Method

curl -X POST https://rpc.d-bis.org \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [{
      "to": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
      "data": "0x70a08231000000000000000000000000742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
    }, "latest"],
    "id": 1
  }'

Get Transaction Receipt

curl -X POST https://rpc.d-bis.org \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_getTransactionReceipt",
    "params": ["0x1234567890abcdef..."],
    "id": 1
  }'

Last Updated: 2025-01-27