> For the complete documentation index, see [llms.txt](https://docs.dotone.online/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dotone.online/developers/api-reference-or-dotone-smart-chain-docs.md).

# API Reference | Dotone Smart Chain Docs

Build on an Open Network

dotOne Smart Chain exposes a standard set of APIs for developers, researchers, and integrators. All public endpoints follow Ethereum-compatible JSON-RPC conventions, making integration straightforward for any EVM-compatible tooling.

## RPC Endpoints

### Mainnet

| Type      | Endpoint                     | Chain ID |
| --------- | ---------------------------- | -------- |
| HTTPS RPC | `https://rpc.dotone.network` | *505*    |
| WebSocket | `wss://ws.dotone.network`    | *505*    |

### Testnet

| Type      | Endpoint                             | Chain ID  |
| --------- | ------------------------------------ | --------- |
| HTTPS RPC | `https://testnet-rpc.dotone.network` | *5000005* |
| WebSocket | `wss://testnet-ws.dotone.network`    | *5000005* |

## JSON-RPC API

dotOne is fully compatible with the Ethereum JSON-RPC specification. All standard `eth_`, `net_`, and `web3_` namespaces are supported.

### Example — Get Latest Block Number

**Request:**

```bash
curl -X POST https://rpc.dotone.network \
  -H "Content-Type: application/json" \
  --data '{
    "jsonrpc": "2.0",
    "method": "eth_blockNumber",
    "params": [],
    "id": 1
  }'
```

**Response:**

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x1a2b3c"
}
```

### Example — Get Transaction by Hash

**Request:**

```bash
curl -X POST https://rpc.dotone.network \
  -H "Content-Type: application/json" \
  --data '{
    "jsonrpc": "2.0",
    "method": "eth_getTransactionByHash",
    "params": ["0x{transaction_hash}"],
    "id": 1
  }'
```

### Example — Get Wallet Balance

**Request:**

```bash
curl -X POST https://rpc.dotone.network \
  -H "Content-Type: application/json" \
  --data '{
    "jsonrpc": "2.0",
    "method": "eth_getBalance",
    "params": ["0x{wallet_address}", "latest"],
    "id": 1
  }'
```

**Response:**

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x56BC75E2D63100000"
}
```

> Balance is returned in Wei. Divide by `10^18` to convert to DOTO.

## WebSocket API

WebSocket connections allow real-time subscriptions to on-chain events without polling.

### Connect

```javascript
const ws = new WebSocket("wss://ws.dotone.network");
```

### Subscribe to New Block Headers

```javascript
ws.send(JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_subscribe",
  "params": ["newHeads"],
  "id": 1
}));
```

### Subscribe to Pending Transactions

```javascript
ws.send(JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_subscribe",
  "params": ["newPendingTransactions"],
  "id": 2
}));
```

### Subscribe to Contract Logs

```javascript
ws.send(JSON.stringify({
  "jsonrpc": "2.0",
  "method": "eth_subscribe",
  "params": [
    "logs",
    {
      "address": "0x{contract_address}",
      "topics": []
    }
  ],
  "id": 3
}));
```

## Explorer API

The DotOne Explorer exposes a REST API for querying indexed blockchain data — useful for analytics, dashboards, and monitoring tools.

**Base URL:** `https://explorer.dotone.network/api`

### Common Endpoints

**Get Transaction Details**

```
GET /api?module=transaction&action=gettxinfo&txhash={tx_hash}
```

**Get Address Transaction History**

```
GET /api?module=account&action=txlist&address={wallet_address}&page=1&offset=20
```

**Get Token Transfers for Address**

```
GET /api?module=account&action=tokentx&address={wallet_address}
```

**Get Block Details**

```
GET /api?module=block&action=getblockreward&blockno={block_number}
```

**Get Contract ABI**

```
GET /api?module=contract&action=getabi&address={contract_address}
```

## Supported Libraries

DotOne is compatible with all standard EVM development libraries:

| Library     | Language                | Usage                                   |
| ----------- | ----------------------- | --------------------------------------- |
| `ethers.js` | JavaScript / TypeScript | Wallet, contract, provider interactions |
| `web3.js`   | JavaScript              | Full Ethereum API coverage              |
| `viem`      | TypeScript              | Modern, type-safe EVM client            |
| `web3.py`   | Python                  | Backend integrations and scripts        |
| `ethers-rs` | Rust                    | High-performance applications           |

### Connect with ethers.js

```javascript
import { ethers } from "ethers";

const provider = new ethers.JsonRpcProvider("https://rpc.dotone.network");

const blockNumber = await provider.getBlockNumber();
console.log("Latest block:", blockNumber);
```

### Connect with web3.py

```python
from web3 import Web3

w3 = Web3(Web3.HTTPProvider("https://rpc.dotone.network"))

print("Connected:", w3.is_connected())
print("Latest block:", w3.eth.block_number)
```

## Rate Limits

Public RPC endpoints are available for development and light usage. For production applications requiring consistent throughput:

* Use a **dedicated node** or **private RPC endpoint**
* Implement **request batching** where possible
* Use **WebSocket subscriptions** instead of polling for real-time data
* Cache responses for static or slowly-changing data (e.g. block confirmations)

> For high-volume integrations, contact the DotOne team regarding dedicated infrastructure access.

## Further Reference

* [Ethereum JSON-RPC Specification](https://ethereum.org/en/developers/docs/apis/json-rpc/)
* [Explorer](https://explorer.dotone.network/)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.dotone.online/developers/api-reference-or-dotone-smart-chain-docs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
