Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 37 additions & 80 deletions evm/reference.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: 'Sei EVM JSON-RPC API Reference'

Check warning on line 2 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L2

Did you really mean 'Sei'?
sidebarTitle: 'RPC Reference'
description: "Comprehensive reference documentation for Sei's EVM JSON-RPC API endpoints, including standard Ethereum methods and Sei-specific extensions for developers."

Check warning on line 4 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L4

Did you really mean 'Sei's'?

Check warning on line 4 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L4

Did you really mean 'Ethereum'?
keywords: ['json-rpc', 'api reference', 'evm endpoints', 'blockchain api', 'sei development']
---
Sei fully supports the standard Ethereum JSON-RPC API, so existing EVM tooling (ethers.js, viem, Hardhat, Foundry, etc.) works out of the box. This page covers every supported `eth_*` and `debug_*` method, plus the legacy `sei_*`/`sei2_*` extensions (now deprecated) for cross-VM address resolution and synthetic transactions.

Check warning on line 7 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L7

Did you really mean 'Sei'?

Check warning on line 7 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L7

Did you really mean 'Ethereum'?

Check warning on line 7 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L7

Did you really mean 'viem'?

## Table of Contents

Expand All @@ -23,7 +23,7 @@

## Overview

Sei supports the [Ethereum JSON-RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/) with some Sei-specific extensions to support cross-VM operations, synthetic transactions, and other advanced features.

Check warning on line 26 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L26

Did you really mean 'Sei'?

All endpoints follow the standard JSON-RPC format:

Expand All @@ -49,13 +49,13 @@

</Accordion>

## Standard Ethereum Endpoints

Check warning on line 52 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L52

Did you really mean 'Ethereum'?

Sei supports all standard Ethereum JSON-RPC endpoints, organized into the following categories. Click on each category to view the available endpoints and their documentation.

Check warning on line 54 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L54

Did you really mean 'Sei'?

Check warning on line 54 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L54

Did you really mean 'Ethereum'?

### Send Transactions

These endpoints allow you to send transactions to the Sei network.

Check warning on line 58 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L58

Did you really mean 'Sei'?

<Accordion title="View Send Transaction Endpoints">
#### eth_sendRawTransaction
Expand Down Expand Up @@ -106,7 +106,7 @@

| Type | Description |
| :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `string` | The block number, which can either be a hexadecimal number, or one of "safe", "finalized", "latest", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality. |

Check warning on line 109 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L109

Did you really mean 'Sei'?
| `string` | The transaction index as a hexadecimal number. |

- **Result**:
Expand Down Expand Up @@ -165,7 +165,7 @@
| Type | Description |
| :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `string` | The address to look up. |
| `string` | The block number, which can either be a hexadecimal number, or one of "safe", "finalized", "latest", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality. |

Check warning on line 168 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L168

Did you really mean 'Sei'?

- **Result**:

Expand All @@ -173,24 +173,24 @@
| :------- | :-------------------------------------------------- |
| `string` | The hexadecimal form of the number of transactions. |

#### eth_getBalance

Check warning on line 176 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L176

Did you really mean 'eth_getBalance'?

Gets the balance in wei (i.e. 10^-12 usei) of the account

Check warning on line 178 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L178

Did you really mean 'wei'?

Check warning on line 178 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L178

Did you really mean 'usei'?

- **Parameters**:

| Type | Description |
| :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `string` | The address to look up. |
| `string` | The block number or hash, which can be one of 1. block hash, 2. hexadecimal block number, 3. one of `safe`, `finalized`, `latest`, `pending`, or `earliest`. Note that `safe`, `finalized`, and `latest` mean the same thing on Sei due to its instant finality. |

Check warning on line 185 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L185

Did you really mean 'Sei'?

- **Result**:

| Type | Description |
| :------- | :--------------------------------------- |
| `string` | The hexadecimal form of the wei balance. |

Check warning on line 191 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L191

Did you really mean 'wei'?

#### eth_getCode

Check warning on line 193 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L193

Did you really mean 'eth_getCode'?

Gets EVM code stored at the account address

Expand All @@ -199,7 +199,7 @@
| Type | Description |
| :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `string` | The address to look up. |
| `string` | The block number or hash, which can be one of 1. block hash, 2. hexadecimal block number, 3. one of `safe`, `finalized`, `latest`, `pending`, or `earliest`. Note that `safe`, `finalized`, and `latest` mean the same thing on Sei due to its instant finality. |

Check warning on line 202 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L202

Did you really mean 'Sei'?

- **Result**:

Expand All @@ -217,7 +217,7 @@
| :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `string` | The address to look up. |
| `string` | The hexadecimal form of the key. |
| `string` | The block number or hash, which can be one of 1. block hash, 2. hexadecimal block number, 3. one of `safe`, `finalized`, `latest`, `pending`, or `earliest`. Note that `safe`, `finalized`, and `latest` mean the same thing on Sei due to its instant finality. |

Check warning on line 220 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L220

Did you really mean 'Sei'?

- **Result**:

Expand All @@ -225,10 +225,10 @@
| :------- | :----------------------------------------- |
| `string` | The hexadecimal form of the storage value. |

#### eth_getProof

Check warning on line 228 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L228

Did you really mean 'eth_getProof'?

<Warning>
Sei uses IAVL trees instead of Merkle Patricia Tries (MPT). The proof returned by this endpoint is an IAVL proof, not an MPT proof. Ethereum tooling that expects MPT proofs may not parse the response correctly.

Check warning on line 231 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L231

Did you really mean 'Sei'?

Check warning on line 231 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L231

Did you really mean 'Merkle'?

Check warning on line 231 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L231

Did you really mean 'Ethereum'?
</Warning>

Gets the IAVL proof of the given keys for an account.
Expand All @@ -239,7 +239,7 @@
| :--------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `string` | The address to look up. |
| `string[]` | The hexadecimal form of the keys. |
| `string` | The block number or hash, which can be one of 1. block hash, 2. hexadecimal block number, 3. one of `safe`, `finalized`, `latest`, `pending`, or `earliest`. Note that `safe`, `finalized`, and `latest` mean the same thing on Sei due to its instant finality. |

Check warning on line 242 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L242

Did you really mean 'Sei'?

- **Result**:

Expand Down Expand Up @@ -734,23 +734,20 @@

| Method | Description |
| ------ | ----------- |
| `sei_associate` | Associate Sei and EVM addresses |
| `sei_getSeiAddress` | Get Sei address for an EVM address |
| `sei_getEVMAddress` | Get EVM address for a Sei address |
| `sei_getCosmosTx` | Get Cosmos transaction by EVM tx hash |

Check warning on line 737 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L737

Did you really mean 'tx'?
| `sei_getEvmTx` | Get EVM transaction by Cosmos tx hash |

Check warning on line 738 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L738

Did you really mean 'tx'?
| `sei_getTransactionErrorByHash` | Get error message for a failed transaction |
| `sei_getVMError` | Get VM error details for a transaction |
| `sei_getBlockByHash` | Get block by hash (includes synthetic txs) |

Check warning on line 741 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L741

Did you really mean 'txs'?
| `sei_getBlockByNumber` | Get block by number (includes synthetic txs) |

Check warning on line 742 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L742

Did you really mean 'txs'?
| `sei_getBlockReceipts` | Get block receipts (includes synthetic txs) |

Check warning on line 743 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L743

Did you really mean 'txs'?
| `sei_getBlockTransactionCountByHash` | Get tx count by block hash (includes synthetic txs) |

Check warning on line 744 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L744

Did you really mean 'tx'?

Check warning on line 744 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L744

Did you really mean 'txs'?
| `sei_getBlockTransactionCountByNumber` | Get tx count by block number (includes synthetic txs) |

Check warning on line 745 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L745

Did you really mean 'tx'?

Check warning on line 745 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L745

Did you really mean 'txs'?
| `sei_getTransactionByBlockHashAndIndex` | Get tx by block hash and index (includes synthetic txs) |

Check warning on line 746 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L746

Did you really mean 'tx'?

Check warning on line 746 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L746

Did you really mean 'txs'?
| `sei_getTransactionByBlockNumberAndIndex` | Get tx by block number and index (includes synthetic txs) |

Check warning on line 747 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L747

Did you really mean 'tx'?

Check warning on line 747 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L747

Did you really mean 'txs'?
| `sei_getTransactionByHash` | Get transaction by hash (includes synthetic txs) |

Check warning on line 748 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L748

Did you really mean 'txs'?
| `sei_getTransactionCount` | Get account transaction count |
| `sei_getTransactionReceipt` | Get transaction receipt (includes synthetic txs) |

Check warning on line 750 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L750

Did you really mean 'txs'?
| `sei_getFilterLogs` | Get filter logs (includes synthetic logs) |
| `sei_getLogs` | Get logs (includes synthetic logs) |
| `sei_getFilterChanges` | Get filter changes (includes synthetic events) |
Expand All @@ -770,106 +767,66 @@
| `sei2_getBlockByHash` | Get block by hash (includes bank transfers) |
| `sei2_getBlockByNumber` | Get block by number (includes bank transfers) |
| `sei2_getBlockReceipts` | Get block receipts (includes bank transfers) |
| `sei2_getBlockTransactionCountByHash` | Get tx count by block hash (includes bank transfers) |

Check warning on line 770 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L770

Did you really mean 'tx'?
| `sei2_getBlockTransactionCountByNumber` | Get tx count by block number (includes bank transfers) |

Check warning on line 771 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L771

Did you really mean 'tx'?
| `sei2_getBlockByHashExcludeTraceFail` | Get block by hash excluding failed traces (includes bank transfers) |
| `sei2_getBlockByNumberExcludeTraceFail` | Get block by number excluding failed traces (includes bank transfers) |

</Accordion>

### Address & Cross-VM Helpers
### Address Resolution

These endpoints provide cross-VM address resolution and transaction lookup between the EVM and Cosmos environments. `sei_getSeiAddress`, `sei_getEVMAddress`, and `sei_getCosmosTx` are enabled by default.
For resolving the EVM (`0x…`) ↔ Sei (`sei1…`) address pair, use the **`addr` precompile at `0x0000000000000000000000000000000000001004`** via a standard `eth_call`. The precompile is universally available on every Sei RPC, is not part of the deprecated `sei_*` namespace, and is the canonical resolution path going forward.

Check warning on line 779 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L779

Did you really mean 'Sei'?

Check warning on line 779 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L779

Did you really mean 'precompile'?

Check warning on line 779 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L779

Did you really mean 'precompile'?

Check warning on line 779 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L779

Did you really mean 'Sei'?

Check warning on line 779 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L779

Did you really mean 'namespace'?

<Accordion title="View Address & Cross-VM Helper Endpoints">
#### sei_associate

Sends a transaction to establish association between the signer's Sei address
and EVM address on-chain.

- **Parameters**:

| Type | Description |
| :------- | :--------------------------------------------------------------------------------- |
| `object` | A custom object containing a string message and the v, r, s of the signed message. |

Object Schema:

```json
{
custom_message: // Any string message
r: // The R-part of the signature over the Keccak256 hash of the custom message.
s: // The S-part of the signature over the Keccak256 hash of the custom message.
v: // The V-part of the signature over the Keccak256 hash of the custom message.
}
```

- **Result**:

| Type | Description |
| :------- | :------------------------------------ |
| `string` | The transaction hash of the association transaction. |

---

#### sei_getSeiAddress

Returns the Sei (bech32) address associated with an EVM address.

- **Parameters**:

| Type | Description |
| :------- | :---------------------------------- |
| `string` | The EVM address (0x-prefixed hex). |

- **Result**:

| Type | Description |
| :------- | :------------------------------------- |
| `string` | The associated Sei bech32 address. |

**Example Request**

```json
{
```bash
# EVM → Sei (getSeiAddr(address), selector 0x0c3c20ed)
curl -X POST $SEIEVM -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"method": "sei_getSeiAddress",
"params": ["0x1234567890abcdef1234567890abcdef12345678"],
"method": "eth_call",
"params": [{
"to": "0x0000000000000000000000000000000000001004",
"data": "0x0c3c20ed000000000000000000000000<evmAddressWithout0x>"
}, "latest"],
"id": 1
}
}'
```

---
In TypeScript with viem:

Check warning on line 794 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L794

Did you really mean 'viem'?

#### sei_getEVMAddress
```ts
import { createPublicClient, http } from 'viem';
import { sei } from 'viem/chains';

Returns the EVM address associated with a Sei (bech32) address.
const ADDR_PRECOMPILE = '0x0000000000000000000000000000000000001004';
const ADDR_ABI = [
{ name: 'getSeiAddr', type: 'function', stateMutability: 'view',
inputs: [{ name: 'addr', type: 'address' }],
outputs: [{ name: 'response', type: 'string' }] },
{ name: 'getEvmAddr', type: 'function', stateMutability: 'view',
inputs: [{ name: 'addr', type: 'string' }],
outputs: [{ name: 'response', type: 'address' }] },
] as const;

- **Parameters**:
const client = createPublicClient({ chain: sei, transport: http() });

| Type | Description |
| :------- | :------------------------------ |
| `string` | The Sei bech32 address. |
const seiAddr = await client.readContract({
address: ADDR_PRECOMPILE, abi: ADDR_ABI, functionName: 'getSeiAddr', args: ['0x…'],
});

- **Result**:
const evmAddr = await client.readContract({
address: ADDR_PRECOMPILE, abi: ADDR_ABI, functionName: 'getEvmAddr', args: ['sei1…'],
});
```

| Type | Description |
| :------- | :------------------------------- |
| `string` | The associated EVM address. |
The call reverts when the input address is not yet associated. See [Accounts](/learn/accounts) for the full association lifecycle and how the bidirectional mapping is established.

**Example Request**
<Note>The legacy JSON-RPC helpers `sei_getSeiAddress` and `sei_getEVMAddress` historically served this role and are still enabled by default on nodes today, but they belong to the deprecated `sei_*` namespace and may be removed in a future release. New integrations should call the precompile.</Note>

Check warning on line 823 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L823

Did you really mean 'sei_getEVMAddress'?

```json
{
"jsonrpc": "2.0",
"method": "sei_getEVMAddress",
"params": ["sei1..."],
"id": 1
}
```
### Cross-VM Transaction Lookup

---
`sei_getCosmosTx` resolves the underlying Cosmos transaction hash for a given EVM transaction. It does not yet have a precompile equivalent and is enabled by default on Sei nodes.

Check warning on line 827 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L827

Did you really mean 'precompile'?

Check warning on line 827 in evm/reference.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/reference.mdx#L827

Did you really mean 'Sei'?

<Accordion title="View Cross-VM Lookup Endpoints">
#### sei_getCosmosTx

Returns the Cosmos transaction details for a given EVM transaction hash.
Expand Down
Loading
Loading