|
| 1 | +# EVM RPC Endpoints |
| 2 | +Below is a list of EVM-RPC endpoints provided by default on a Sei RPC node. Your RPC provider may offer slightly different/extended specifications. |
| 3 | + |
| 4 | +All endpoints are in the form of JSON-RPC and share the following request/response structure: |
| 5 | +- request |
| 6 | + - HTTP method: always "GET" |
| 7 | + - header: `accept: application/json` |
| 8 | + - header: `content-type: application/json` |
| 9 | + - body (JSON): |
| 10 | + - id: an arbitrary string identifier |
| 11 | + - jsonrpc: always "2.0" |
| 12 | + - method: endpoint name (e.g. "eth_sendRawTransaction") |
| 13 | + - params: an array that differs from endpoint to endpoint |
| 14 | +- response |
| 15 | + - body (JSON): |
| 16 | + - id: the same identifier in request |
| 17 | + - jsonrpc: always "2.0" |
| 18 | + - result: an object that differs from endpoint to endpoint |
| 19 | + |
| 20 | + |
| 21 | +## Send Transactions |
| 22 | +### eth_sendRawTransaction |
| 23 | +Sends a signed transaction. |
| 24 | +- param 1: string | hex-encoding of the signed transaction |
| 25 | +- result: string | transaction hash |
| 26 | + |
| 27 | +### sei_associate |
| 28 | +Sends a transaction to establish association between the signer's Sei address and EVM address on-chain |
| 29 | +- param 1: object |
| 30 | + - custom_message: any string message |
| 31 | + - r: the R-part of the signature over the Keccak256 hash of the custom message |
| 32 | + - s: the S-part of the signature over the Keccak256 hash of the custom message |
| 33 | + - v: the V-part of the signature over the Keccak256 hash of the custom message |
| 34 | + |
| 35 | +## Transaction Lookup |
| 36 | +### eth_getTransactionReceipt |
| 37 | +Gets the receipt of a sent transaction |
| 38 | +- param 1: string | transaction hash |
| 39 | +- result: object | [receipt object](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionreceipt) |
| 40 | + |
| 41 | +### eth_getTransactionByBlockNumberAndIndex |
| 42 | +Gets transaction by the block number and the index of the transaction in the block |
| 43 | +- param 1: string | 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. |
| 44 | +- param 2: string | transaction index as a hexadecimal number |
| 45 | +- result: object | [transaction details](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionbyhash) |
| 46 | + |
| 47 | +### eth_getTransactionByBlockHashAndIndex |
| 48 | +Gets transaction by the block hash and the index of the transaction in the block |
| 49 | +- param 1: string | block hash |
| 50 | +- param 2: string | transaction index as a hexadecimal number |
| 51 | +- result: object | [transaction details](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionbyhash) |
| 52 | + |
| 53 | +### eth_getTransactionByHash |
| 54 | +Gets transaction by the transaction hash |
| 55 | +- param 1: string | transaction hash |
| 56 | +- result: object | [transaction details](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionbyhash) |
| 57 | + |
| 58 | +## Account Information |
| 59 | +### eth_getTransactionCount |
| 60 | +Gets the number of transactions sent by the account |
| 61 | +- param 1: string | address |
| 62 | +- param 2: string | 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. |
| 63 | +- result: string | hexadecimal form of the number of transactions |
| 64 | + |
| 65 | +### eth_getBalance |
| 66 | +Gets the balance in wei (i.e. 10^-12 usei) of the account |
| 67 | +- param 1: string | address |
| 68 | +- param 2: string | 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. |
| 69 | +- result: string | hexadecimal form of the wei balance |
| 70 | + |
| 71 | +### eth_getCode |
| 72 | +Gets EVM code stored at the account address |
| 73 | +- param 1: string | address |
| 74 | +- param 2: string | 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. |
| 75 | +- result: string | hexadecimal form of the code binary |
| 76 | + |
| 77 | +### eth_getStorageAt |
| 78 | +Gets value at given key of the account |
| 79 | +- param 1: string | address |
| 80 | +- param 2: string | hexadecimal form of the key |
| 81 | +- param 3: string | 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. |
| 82 | +- result: string | hexadecimal form of the storage value |
| 83 | + |
| 84 | +### eth_getProof |
| 85 | +Gets the IAVL proof (note: not a MPT proof) of the given keys for an account |
| 86 | +- param 1: string | address |
| 87 | +- param 2: array of string | hexadecimal form of the keys |
| 88 | +- param 3: string | 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. |
| 89 | +- result: object |
| 90 | + - address - the requested address |
| 91 | + - hexValues - an array of the hexdecimal form of the values at the given keys |
| 92 | + - storageProof - an array of storage proofs, each of which follows this [format](https://github.com/sei-protocol/sei-tendermint/blob/main/proto/tendermint/crypto/proof.pb.go#L272-L274) |
| 93 | + |
| 94 | +## Block Information |
| 95 | +### eth_getBlockTransactionCountByNumber |
| 96 | +Gets the count of EVM transactions (i.e. excluding native Cosmos transactions) in a block by its number |
| 97 | +- param 1: string | 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. |
| 98 | +- result: string | hexadecimal form of the count |
| 99 | + |
| 100 | +### eth_getBlockTransactionCountByHash |
| 101 | +Gets the count of EVM transactions (i.e. excluding native Cosmos transactions) in a block by its hash |
| 102 | +- param 1: string | block hash |
| 103 | +- result: string | hexadecimal form of the count |
| 104 | + |
| 105 | +### eth_getBlockByHash |
| 106 | +Gets the block metadata and/or its EVM transactions by block hash |
| 107 | +- param 1: string | block hash |
| 108 | +- param 2: bool | whether to include transactions in the response |
| 109 | +- result: object | [block info](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash) |
| 110 | + |
| 111 | +### eth_getBlockByNumber |
| 112 | +Gets the block metadata and/or its EVM transactions by block number |
| 113 | +- param 1: string | 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. |
| 114 | +- param 2: bool | whether to include transactions in the response |
| 115 | +- result: object | [block info](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash) |
| 116 | + |
| 117 | +### eth_getBlockReceipts |
| 118 | +Gets an array of EVM transaction receipt in a block by block number |
| 119 | +- param 1: string | 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. |
| 120 | +- result: array of objects | [receipt object](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionreceipt) |
| 121 | + |
| 122 | +## Blockchain Information |
| 123 | +### eth_blockNumber |
| 124 | +Gets the latest committed block number |
| 125 | +- no param |
| 126 | +- result: string | hexadecimal form of the block number |
| 127 | + |
| 128 | +### eth_chainId |
| 129 | +Gets the chain ID |
| 130 | +- no param |
| 131 | +- result: string | hexadecimal form of the chain ID |
| 132 | + |
| 133 | +### eth_coinbase |
| 134 | +Gets the fee collector address |
| 135 | +- no param |
| 136 | +- result: string | fee collector address |
| 137 | + |
| 138 | +### eth_feeHistory |
| 139 | +Gets fee history over the requested block range |
| 140 | +- param 1: string | number of blocks to look at, in either decimal or hexadecimal form |
| 141 | +- param 2: string | block number, which can either be a hexadecimal number, or one of "safe", "finalized", or "latest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality. |
| 142 | +- param 3: array of floats | reward percentiles |
| 143 | +- result: object |
| 144 | + |
| 145 | +### eth_gasPrice |
| 146 | +Gets the 50% percentile of gas prices in the most recent block |
| 147 | +- no param |
| 148 | +- result: string | hexadecimal form of the gas price |
| 149 | + |
| 150 | +### net_version |
| 151 | +Gets the version (equal to Chain ID) |
| 152 | +- no param |
| 153 | +- result: string | hexadecimal form of the chain ID |
| 154 | + |
| 155 | +### web3_clientVersion |
| 156 | +- no param |
| 157 | +- result: string | the RPC node's runtime version |
| 158 | + |
| 159 | +## Filter Endpoints |
| 160 | +Note that log filters are subject to the following limits by default: |
| 161 | +- 10000 logs in one response if block range is open-ended |
| 162 | +- 2000 blocks to query over if block range is close-ended |
| 163 | +Your RPC provider may tweak these limits. |
| 164 | + |
| 165 | +### eth_newFilter |
| 166 | +Creates a new log filter for later queries |
| 167 | +- param 1: object | [filter criteria](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter) |
| 168 | +- result: string | the newly created filter's ID |
| 169 | + |
| 170 | +### eth_newBlockFilter |
| 171 | +Creates a new block filter for later queries |
| 172 | +- no param |
| 173 | +- result: string | the newly created filter's ID |
| 174 | + |
| 175 | +### eth_getFilterChanges |
| 176 | +Gets all the updates since the filter was last queried |
| 177 | +- param 1: string | filter ID |
| 178 | +- result: array | for block filters, the result would be an array of block hashes; for log filters, the result would be an array of [log objects](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges) |
| 179 | + |
| 180 | +### eth_getFilterLogs |
| 181 | +Get all logs for a given log filter, including the logs that have been returned before |
| 182 | +- param 1: string | filter ID |
| 183 | +- result: array | an array of [log objects](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges) |
| 184 | + |
| 185 | +### eth_getLogs |
| 186 | +Get all logs for the given filter criteria |
| 187 | +- param 1: object | [filter criteria](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter) |
| 188 | +- result: array | an array of [log objects](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges) |
| 189 | + |
| 190 | +### eth_uninstallFilter |
| 191 | +Removes a created filter |
| 192 | +- param 1: string | filter ID |
| 193 | +- result: bool | whether the filter exists |
| 194 | + |
| 195 | +## Simulation Endpoints |
| 196 | +### eth_estimateGas |
| 197 | +Same as [the official specification](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas) |
| 198 | + |
| 199 | +### eth_call |
| 200 | +Same as [the official specification](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_call) |
| 201 | + |
| 202 | +## Debugging Endpoints |
| 203 | +### debug_traceTransaction |
| 204 | +Same as [Alchemy](https://docs.alchemy.com/reference/debug-tracetransaction) |
| 205 | + |
| 206 | +### debug_traceBlockByNumber |
| 207 | +Same as [Alchemy](https://docs.alchemy.com/reference/debug-traceblockbynumber) |
| 208 | + |
| 209 | +### debug_traceBlockByHash |
| 210 | +Same as [Alchemy](https://docs.alchemy.com/reference/debug-traceblockbyhash) |
0 commit comments