diff --git a/pages/index.mdx b/pages/index.mdx index 38c14dbc..21aac1ce 100644 --- a/pages/index.mdx +++ b/pages/index.mdx @@ -15,7 +15,7 @@ From [public RPC endpoints](https://www.ankr.com/rpc/) that developers have come * Access RPC/REST Endpoints via HTTPS or WebSockets. -* Interact with 50+ [supported blockchains](/rpc-service/chains/chains-list/). +* Interact with 60+ [supported blockchains](/rpc-service/chains/chains-list/). * Test out and get important stats. * Suitable for Web3 developers and enthusiasts of all skill levels.
diff --git a/pages/rpc-service/chains/chains-api/_meta.json b/pages/rpc-service/chains/chains-api/_meta.json index 026d1cb1..2f4e72cf 100644 --- a/pages/rpc-service/chains/chains-api/_meta.json +++ b/pages/rpc-service/chains/chains-api/_meta.json @@ -51,6 +51,7 @@ "secret-network": "Secret Network", "sei": "Sei", "solana": "Solana", + "sonic": "Sonic", "stellar": "Stellar", "story": "Story", "sui": "Sui", diff --git a/pages/rpc-service/chains/chains-api/gnosis.mdx b/pages/rpc-service/chains/chains-api/gnosis.mdx index d487181f..9ee58626 100644 --- a/pages/rpc-service/chains/chains-api/gnosis.mdx +++ b/pages/rpc-service/chains/chains-api/gnosis.mdx @@ -29,7 +29,6 @@ The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification * [`eth_protocolVersion`](/rpc-service/chains/chains-api/gnosis/#eth_protocolversion) — returns the current protocol version. * [`eth_syncing`](/rpc-service/chains/chains-api/gnosis/#eth_syncing) — returns data on the sync status or false. * [`eth_gasPrice`](/rpc-service/chains/chains-api/gnosis/#eth_gasprice) — returns the current price per gas in wei. - * [`eth_accounts`](/rpc-service/chains/chains-api/gnosis/#eth_accounts) — returns a list of addresses owned by client. * [`eth_blockNumber`](/rpc-service/chains/chains-api/gnosis/#eth_blocknumber) — returns the number of most recent block. * [`eth_getBalance`](/rpc-service/chains/chains-api/gnosis/#eth_getbalance) — returns the balance of the account specified by address. * [`eth_getStorageAt`](/rpc-service/chains/chains-api/gnosis/#eth_getstorageat) — returns the value from a storage position at an address specified. @@ -367,50 +366,6 @@ curl -X POST https://rpc.ankr.com/gnosis \ --- -## `eth_accounts` - -> Returns a list of addresses owned by client. - -### Parameters -
- - * `id` (integer; required): a request ID (example: 1). - * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). - * `method` (string; required): a method used for the request. - * `params` (array; required): none. - -### Returns -
- - * `` (string; data, 20 bytes): addresses owned by the client. - -### Request example - -```shell -curl -X POST https://rpc.ankr.com/gnosis \ --H 'Content-Type: application/json' \ --d '{ - "jsonrpc": "2.0", - "method": "eth_accounts", - "params": [], - "id": 1 - }' -``` - -### Response example - -```json -{ - "id": 1, - "jsonrpc": "2.0", - "result": [ - "0x407d73d8a49eeb85d32cf465507dd71d507100c1" - ] -} -``` - ---- - ## `eth_blockNumber` > Returns the number of most recent block. diff --git a/pages/rpc-service/chains/chains-api/sonic.mdx b/pages/rpc-service/chains/chains-api/sonic.mdx new file mode 100644 index 00000000..ac3007b7 --- /dev/null +++ b/pages/rpc-service/chains/chains-api/sonic.mdx @@ -0,0 +1,1719 @@ +import { Callout } from "components"; + +# Sonic + +> Sonic API is available on [Web3 API platform](https://www.ankr.com/rpc/sonic). + +*Sonic* is an EVM-compatible Layer 1 blockchain designed to deliver high-speed, low-latency transactions, aiming to process over 10,000 transactions per second with sub-second finality. + +Key Features of Sonic: + + * **High Throughput and Speed**: Sonic achieves transaction finality in approximately 720 milliseconds, positioning it among the fastest EVM-compatible blockchains. + * **Developer Incentives**: The platform offers attractive incentives, including a fee monetization program that allows developers to earn up to 90% of the fees generated by their applications. + * **EVM Compatibility**: Sonic's compatibility with the Ethereum Virtual Machine enables seamless deployment of existing Ethereum-based decentralized applications (dApps) without significant modifications. + * **Secure Ethereum Gateway**: Sonic provides a secure bridge to Ethereum, facilitating easy access to Ethereum's liquidity and assets while maintaining high transaction speeds and low costs. + +In order for your Web3 application to interact with Sonic — either by reading blockchain data or sending transactions to the network — it must connect to a Sonic node. Developers interact with the blockchain using the methods provided by the API. + +The API interaction follows the [JSON-RPC](https://www.jsonrpc.org/specification) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format. + +--- + +## Methods supported +
+ + * [`web3_clientVersion`](/rpc-service/chains/chains-api/sonic/#web3_clientversion) — returns the current client version. + * [`web3_sha3`](/rpc-service/chains/chains-api/sonic/#web3_sha3) — returns Keccak-256 (not the standardized SHA3-256) of the given data. + * [`net_version`](/rpc-service/chains/chains-api/sonic/#net_version) — returns the current network ID. + * [`net_listening`](/rpc-service/chains/chains-api/sonic/#net_listening) — returns true if client is actively listening for network connections. + * [`eth_syncing`](/rpc-service/chains/chains-api/sonic/#eth_syncing) — returns data on the sync status or false. + * [`eth_gasPrice`](/rpc-service/chains/chains-api/sonic/#eth_gasprice) — returns the current price per gas in wei. + * [`eth_accounts`](/rpc-service/chains/chains-api/sonic/#eth_accounts) — returns a list of addresses owned by client. + * [`eth_blockNumber`](/rpc-service/chains/chains-api/sonic/#eth_blocknumber) — returns the number of most recent block. + * [`eth_getBalance`](/rpc-service/chains/chains-api/sonic/#eth_getbalance) — returns the balance of the account specified by address. + * [`eth_getStorageAt`](/rpc-service/chains/chains-api/sonic/#eth_getstorageat) — returns the value from a storage position at an address specified. + * [`eth_getTransactionCount`](/rpc-service/chains/chains-api/sonic/#eth_gettransactioncount) — returns the number of transactions sent from an address. + * [`eth_getBlockTransactionCountByHash`](/rpc-service/chains/chains-api/sonic/#eth_getblocktransactioncountbyhash) — returns the number of transactions in a block specified by block hash. + * [`eth_getBlockTransactionCountByNumber`](/rpc-service/chains/chains-api/sonic/#eth_getblocktransactioncountbynumber) — returns the number of transactions in the block specified by number. + * [`eth_getUncleCountByBlockHash`](/rpc-service/chains/chains-api/sonic/#eth_getunclecountbyblockhash) — returns the number of uncles in a block specified by block hash. + * [`eth_getUncleCountByBlockNumber`](/rpc-service/chains/chains-api/sonic/#eth_getunclecountbyblocknumber) — returns the number of uncles in a block specified by block number. + * [`eth_getCode`](/rpc-service/chains/chains-api/sonic/#eth_getcode) — returns code at an address specified. + * [`eth_sendRawTransaction`](/rpc-service/chains/chains-api/sonic/#eth_sendrawtransaction) — creates a new message call transaction or a contract creation for signed transactions. + * [`eth_call`](/rpc-service/chains/chains-api/sonic/#eth_call) — executes a new message call immediately without creating a transaction on the blockchain. + * [`eth_estimateGas`](/rpc-service/chains/chains-api/sonic/#eth_estimategas) — generates and returns an estimate of how much gas is necessary to allow the transaction to complete. + * [`eth_getBlockByHash`](/rpc-service/chains/chains-api/sonic/#eth_getblockbyhash) — returns information for the block specified by block hash. + * [`eth_getBlockByNumber`](/rpc-service/chains/chains-api/sonic/#eth_getblockbynumber) — returns information for the block specified by block number. + * [`eth_getTransactionByHash`](/rpc-service/chains/chains-api/sonic/#eth_gettransactionbyhash) — returns information on a transaction specified by transaction hash. + * [`eth_getTransactionByBlockHashAndIndex`](/rpc-service/chains/chains-api/sonic/#eth_gettransactionbyblockhashandindex) — returns information on a transaction specified by block hash and transaction index position. + * [`eth_getTransactionByBlockNumberAndIndex`](/rpc-service/chains/chains-api/sonic/#eth_gettransactionbyblocknumberandindex) — returns information on a transaction by block number and transaction index position. + * [`eth_getTransactionReceipt`](/rpc-service/chains/chains-api/sonic/#eth_gettransactionreceipt) — returns the receipt of a transaction by transaction hash. + * [`eth_getUncleByBlockHashAndIndex`](/rpc-service/chains/chains-api/sonic/#eth_getunclebyblockhashandindex) — returns information about an uncle of a block by hash and uncle index position. + * [`eth_getUncleByBlockNumberAndIndex`](/rpc-service/chains/chains-api/sonic/#eth_getunclebyblocknumberandindex) — returns information about an uncle of a block by number and uncle index position. + * [`eth_getLogs`](/rpc-service/chains/chains-api/sonic/#eth_getlogs) — returns logs matching the parameters specified. + +--- + +## `web3_clientVersion` + +> Returns the current client version. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): none. + +### Returns +
+ + * ``: the current client version. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "web3_clientVersion", + "params": [], + "id": 1 + }' +``` + +### Response example + +```json +{ + "jsonrpc": "2.0", + "result": "Sonic/v2.0.1-1933d89b-1733132635/linux-amd64/go1.23.2", + "id": 1 +} +``` + +--- + +## `web3_sha3` + +> Returns Keccak-256 (not the standardized SHA3-256) of the given data. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + * `` (data): the data to convert into a SHA3 hash. + +### Returns +
+ + * `` (data): the SHA3 result of the given string. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "web3_sha3", + "params": ["0x68656c6c6f20776f726c64"], + "id": 1 + }' +``` + +### Response example + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad" +} +``` + +--- + +## `net_version` + +> Returns the current network ID. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): none. + +### Returns +
+ + * ``: the current network ID. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "net_version", + "params": [], + "id": 1 + }' +``` + +### Response example + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "146" +} +``` + +--- + +## `net_listening` + +> Returns `true` if client is actively listening for network connections. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): none. + +### Returns +
+ + * ``: `true` when listening, otherwise `false`. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "net_listening", + "params": [], + "id": 1 + }' +``` + +### Response example + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": true +} +``` + +--- + +## `eth_syncing` + +> Returns an object with data about the sync status or false. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): none. + +### Returns +
+ + * ``|``: an object with sync status data or `false`, when not syncing: + * `startingBlock` (quantity): the block at which the import started (will only be reset, after the sync reached its head). + * `currentBlock` (quantity): the current block, same as `eth_blockNumber`. + * `highestBlock` (quantity): the estimated highest block. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_syncing", + "params": [], + "id": 1 + }' +``` + +### Response example + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": false +} +``` + +--- + +## `eth_gasPrice` + +> Returns the current price per gas in wei. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): none. + +### Returns +
+ + * `` (quantity): the current gas price in wei. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_gasPrice", + "params": [], + "id": 1 + }' +``` + +### Response example + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0x4190ab00" +} +``` + +--- + +## `eth_accounts` + +> Returns a list of addresses owned by client. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): none. + +### Returns +
+ + * `` (string; data, 20 bytes): addresses owned by the client. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_accounts", + "params": [], + "id": 1 + }' +``` + +### Response example + +```json +{ + "id": 1, + "jsonrpc": "2.0", + "result": [] +} +``` + +--- + +## `eth_blockNumber` + +> Returns the number of most recent block. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): none. + +### Returns +
+ + * `` (quantity): the current block number the client is on. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_blockNumber", + "params": [], + "id": 1 + }' +``` + +### Response example + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0x5223d" +} +``` + +--- + +## `eth_getBalance` + +> Returns the balance of the account specified by address. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `` (data, 20 bytes): an address to check for balance. + 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: + * `earliest`: the lowest numbered block available on the client. + * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. + * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. + * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. + * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. + +### Returns +
+ + * `` (quantity): the current balance in wei. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_getBalance", + "params": ["0x4DF5875E703A29627D87BB0AF5b9d185AFe09982", "latest"], + "id": 1 + }' +``` + +### Response example + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0x879dbc66802a609e" +} +``` + +--- + +## `eth_getStorageAt` + +> Returns the value from a storage position at an address specified. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `` (data, 20 bytes): an address of the storage (hex encoded). + 2. `` (quantity): a slot position in the storage (hex encoded unsigned integer). + 3. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: + + * `earliest`: the lowest numbered block available on the client. + * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. + * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. + * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. + * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. + +### Returns +
+ + * `` (data): the value at this storage position. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_getStorageAt", + "params": ["0x4DF5875E703A29627D87BB0AF5b9d185AFe09982", "0x0", "latest"], + "id": 1 + }' +``` + +### Response example + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0x0000000000000000000000000000000000000000000000000000000000000000" +} +``` + +--- + +## `eth_getTransactionCount` + +> Returns the number of transactions sent from an address. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `` (data, 20 bytes): an address. + 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: + + * `earliest`: the lowest numbered block available on the client. + * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. + * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. + * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. + * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. + +### Returns +
+ + * `` (quantity): the number of transactions send from this address. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_getTransactionCount", + "params": ["0x4DF5875E703A29627D87BB0AF5b9d185AFe09982", "latest"], + "id": 1 + }' +``` + +### Response example + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0x24a0" +} +``` + +--- + +## `eth_getBlockTransactionCountByHash` + +> Returns the number of transactions in a block specified by block hash. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `` (data, 32 bytes): a block hash. + +### Returns +
+ + * `` (quantity): the number of transactions in this block. + +### Request example: + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_getBlockTransactionCountByHash", + "params": ["0xa335691b34232e9376817d7edea89bc2b23b20528ac7721d8e39879d044bc739"], + "id": 1 + }' +``` + +### Response example + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0x1" +} +``` + +--- + +## `eth_getBlockTransactionCountByNumber` + +> Returns the number of transactions in the block specified by number. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: + * `earliest`: the lowest numbered block available on the client. + * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. + * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. + * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. + * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. + +### Returns +
+ + * `` (quantity): the number of transactions in this block. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_getBlockTransactionCountByNumber", + "params": ["0x52212"], + "id": 1 + }' +``` + +### Response example + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0x1" +} +``` + +--- + +## `eth_getUncleCountByBlockHash` + +> Returns the number of uncles in a block specified by block hash. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `` (data, 32 bytes): a block hash. + +### Returns +
+ + * `` (quantity): the number of uncles in this block. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_getUncleCountByBlockHash", + "params": ["0xe0400def67cf2f1d5a13c39830b850cda5231968887665bc12ac8bb29d86a6c3"], + "id": 1 + }' +``` + +### Response example + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0x0" +} +``` + +--- + +## `eth_getUncleCountByBlockNumber` + +> Returns the number of uncles in a block specified by block number. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: + * `earliest`: the lowest numbered block available on the client. + * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. + * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. + * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. + * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. + +### Returns +
+ + * `` (quantity): the number of uncles in this block. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_getUncleCountByBlockNumber", + "params": ["0x52212"], + "id": 1 + }' +``` + +### Response example + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0x0" +} +``` + +--- + +## `eth_getCode` + +> Returns code at a given address. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `` (data, 20 bytes): an address to get the code from. + 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: + * `earliest`: the lowest numbered block available on the client. + * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. + * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. + * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. + * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. + +### Returns +
+ + * `` (data): the code from the given address. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_getCode", + "params": ["0x2C7F8b79de38Db416346D65e011757b8EcAeCbDe", "latest"], + "id": 1 + }' +``` + +### Response example + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0x" +} +``` + +--- + +## `eth_sendRawTransaction` + +> Creates new message call transaction or a contract creation for signed transactions. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `` (data): the signed transaction data. + +### Returns +
+ + * `` (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available. + +Use [eth_getTransactionReceipt](/rpc-service/chains/chains-api/sonic/#eth_gettransactionreceipt) to get the contract address, after the transaction was mined, when you created a contract. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_sendRawTransaction", + "params": ["signed_transaction_data"], + "id": 1 +}' +``` + +### Response example + +```json +{ + "id": 1, + "jsonrpc": "2.0", + "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" +} +``` + +--- + +## `eth_call` + +> Executes a new message call immediately without creating a transaction on the blockchain. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `` (hex encoded): the transaction object: + * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. + * `to` (string; data, 20 bytes): the address the transaction is directed to. + * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. + * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. + * `value` (string; quantity; optional): the value sent with this transaction, in wei. + * `data` (string; data; optional): the hash of the method signature and encoded parameters. + + 2. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: + * `earliest`: the lowest numbered block available on the client. + * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. + * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. + * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. + * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. + +### Returns +
+ + * `` (hex encoded bytes): the return value of executed contract. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_call", + "params": [ + { + "to": "0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83", + "data": "0x70a082310000000000000000000000005A93A3F8C5E3EAE603B36E3E0805A2E2290B1E82" + }, + "latest" + ], + "id": 1 +}' +``` + +### Response example + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0x" +} +``` + +--- + +## `eth_estimateGas` + +> Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. + +The transaction will not be added to the blockchain. Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `` (hex encoded): the transaction object: + * `from` (string; data, 20 bytes; optional): the address the transaction is sent from. + * `to` (string; data, 20 bytes; optional): the address the transaction is directed to. + * `gas` (string; quantity; optional): the gas provided for the transaction execution. `eth_call` consumes zero gas, but this parameter may be needed by some executions. + * `gasPrice` (string; quantity; optional): the gas price willing to be paid by the sender in wei. + * `value` (string; quantity; optional): the value sent with this transaction, in wei. + * `data` (string; data; optional): the hash of the method signature and encoded parameters. + + 2. `` (quantity|tag; optional): either a HEX value of a *block number* or one of the following *block tags*: + * `earliest`: the lowest numbered block available on the client. + * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. + * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. + * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. + * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. + +### Returns +
+ + * `` (quantity): the amount of gas used. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_estimateGas", + "params": [ + { + "from": "0x3561607590e28e0848ba3B67074C676D6D1C9953", + "to": "0x5A93A3F8C5E3EAE603B36E3E0805A2E2290B1E82", + "value": "0x2386f26fc10000" + } + ], + "id": 1 +}' +``` + +### Response example + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0x5208" +} +``` + +--- + +## `eth_getBlockByHash` + +> Returns information for the block specified by block hash. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `` (data, 32 bytes): the block hash. + 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. + +### Returns +
+ + * ``: a block object, or null when no block was found: + * `number` (string; quantity): the block number; null when it's a pending block. + * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. + * `parentHash` (string; data, 32 bytes): the hash of the parent block. + * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. + * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. + * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. + * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. + * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. + * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. + * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. + * `difficulty` (string; quantity): the difficulty for this block. + * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. + * `extraData` (string; data): the **extra data** field of this block. + * `size` (string; quantity): the size of this block in bytes. + * `gasLimit` (string; quantity): the maximum gas allowed in this block. + * `gasUsed` (string; quantity): the total used gas by all transactions in this block. + * `timestamp` (string; quantity): the unix timestamp for when the block was collated. + * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. + * `uncles` (array of strings): an array of uncle hashes. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_getBlockByHash", + "params": ["0x82fe8e8aec1d5faabe61c618e5fff17127b0a6ea881be2383f6cb5f829ef563b", false], + "id": 1 + }' +``` + +### Response example + +```json +{ + "id": 1, + "jsonrpc": "2.0", + "result": { + "parentHash": "0xe8eb5513b16b8eb8b2be12a96e152a6499bff9b1a35e20093efa8ecf2f9ee68f", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "miner": "0x0000000000000000000000000000000000000000", + "stateRoot": "0x83b6d171379b20bb862eb75be7c27f069b2e3ae09d7422170f30d42cbdb595b7", + "transactionsRoot": "0xacdedffe20b24f7d038de5cc021060ba3bcb17accda55b0c7951126fcbad0f4b", + "receiptsRoot": "0x06e8fb351cd05705aa7a7319abd441121798c3e8481e0a00901838b7fb244f90", + "logsBloom": "0x00000000000000000000000000000000000001000000000000000000000000000000000800000000000000000000020000000000000000022008000000000000000000000000000000000008000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000010000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000080000000000000000001000000008000000020000200000000000000000002000000000000000000000000000000000000000000", + "difficulty": "0x0", + "number": "0x521b8", + "gasLimit": "0x3b9aca00", + "gasUsed": "0x260f8", + "timestamp": "0x675adcd2", + "timestampNano": "0x18106f1b1049d289", + "extraData": "0x21b81e8900000000b7e32c07", + "mixHash": "0x4e41663dbed98b5493d2867d5d3d05c01fc31e8e80a82c19eac6414232c81d98", + "nonce": "0x0000000000000000", + "baseFeePerGas": "0x3b9aca00", + "hash": "0x82fe8e8aec1d5faabe61c618e5fff17127b0a6ea881be2383f6cb5f829ef563b", + "epoch": "0x615", + "totalDifficulty": "0x0", + "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "blobGasUsed": "0x0", + "excessBlobGas": "0x0", + "transactions": [ + "0x844f55303dc97b4e71f9669acd6efad3dcc6e7e727c3a14ea3cbd243dee195a8" + ], + "size": "0x435", + "uncles": [] + } +} +``` + +--- + +## `eth_getBlockByNumber` + +> Returns information for the block specified by block number. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `` (quantity|tag): either the hex value of a *block number* or one of the following *block tags*: + * `earliest`: the lowest numbered block available on the client. + * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. + * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. + * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. + * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. + 2. ``: if `true` it returns the full transaction objects, if `false` — only the hashes of the transactions. + +### Returns +
+ + * ``: a block object, or null when no block was found: + * `number` (string; quantity): the block number; null when it's a pending block. + * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. + * `parentHash` (string; data, 32 bytes): the hash of the parent block. + * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. + * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. + * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. + * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. + * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. + * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. + * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. + * `difficulty` (string; quantity): the difficulty for this block. + * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. + * `extraData` (string; data): the **extra data** field of this block. + * `size` (string; quantity): the size of this block in bytes. + * `gasLimit` (string; quantity): the maximum gas allowed in this block. + * `gasUsed` (string; quantity): the total used gas by all transactions in this block. + * `timestamp` (string; quantity): the unix timestamp for when the block was collated. + * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. + * `uncles` (array of strings): an array of uncle hashes. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_getBlockByNumber", + "params": ["latest", true], + "id": 1 + }' +``` + +### Response example + +```json +{ + "id": 1, + "jsonrpc": "2.0", + "result": { + "parentHash": "0x6487e909bb86f04165bd5fb6dfe7ad7ed9d4ebd9e1b177a35f01c7711c69d999", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "miner": "0x0000000000000000000000000000000000000000", + "stateRoot": "0xeaa7a4cec2ab5b3eb639b1170df4f5465b5db5403992122c2328e13821a61016", + "transactionsRoot": "0x4a784bb0085a0081a1648cb5f27914657dd4bd029d20fddf4188d5e8e7adbef4", + "receiptsRoot": "0x4ca54bd7bfdbbc68f7134724c7c2b1ed3fa70ff6bc67713f37ea2e47fcc15089", + "logsBloom": "0x00000000000000000000000000000000000001000000000000000000000400000000000800800000000000000000000000000000000000020000000000000000000000000000000000000008000800000000000000000000000000000000000000000000020000000000000000000800000000000000000000000010000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000002000000000000000000000000000000000001000000008000000020000000000000000000000002000000000000000000000000000000000200000000", + "difficulty": "0x0", + "number": "0x52881", + "gasLimit": "0x3b9aca00", + "gasUsed": "0x26104", + "timestamp": "0x675aee4b", + "timestampNano": "0x1810732c95444006", + "extraData": "0x331f1206000000002dda168a", + "mixHash": "0x791c91d9720778698a98dd336026c813d9b21a9ba0fd54fb9799e3392924c9ad", + "nonce": "0x0000000000000000", + "baseFeePerGas": "0x3b9aca00", + "hash": "0xfda0b9e3d7d9f239cdbfe5857018306ec7299c05a394c0ed7e9f34b84dd37b87", + "epoch": "0x61d", + "totalDifficulty": "0x0", + "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "blobGasUsed": "0x0", + "excessBlobGas": "0x0", + "transactions": [ + { + "blockHash": "0xfda0b9e3d7d9f239cdbfe5857018306ec7299c05a394c0ed7e9f34b84dd37b87", + "blockNumber": "0x52881", + "from": "0xbe0332bb852ddb346752a6cf1e45daec723ef8e1", + "gas": "0x2681e", + "gasPrice": "0x4190ab00", + "maxFeePerGas": "0x4190ab00", + "maxPriorityFeePerGas": "0x4190ab00", + "hash": "0xa41a7200f0724199da5b1cb8f215ffeafbc95a5721802dc018e38ad76aefe64c", + "input": "0x84bb1e42000000000000000000000000be0332bb852ddb346752a6cf1e45daec723ef8e10000000000000000000000000000000000000000000000000000000000000001000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000c28f219c40000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000c28f219c400000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x0", + "to": "0x13c42cccedb63ccb8980f3b2135e1bd5630269af", + "transactionIndex": "0x0", + "value": "0xc28f219c400", + "type": "0x2", + "accessList": [], + "chainId": "0x92", + "v": "0x1", + "r": "0x62e5ddfac6ec5317784f401494f5ad9b348797901867447421fc8db90c9b65d", + "s": "0x36f1cb064e9589d70d068bff6257c3351724f42b73a931a7272ab1c596f74881", + "maxFeePerBlobGas": null, + "blobVersionedHashes": null + } + ], + "size": "0x435", + "uncles": [] + } +} +``` + +--- + +## `eth_getTransactionByHash` + +> Returns information on a transaction specified by transaction hash. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `` (data, 32 bytes): a transaction hash. + +### Returns +
+ + * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. + * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. + * `from` (string; data, 20 bytes): an address of the sender. + * `gas` (string; quantity): the gas provided by the sender. + * `gasPrice` (string; quantity): the gas price provided by the sender in wei. + * `hash` (string; data, 32 bytes): the hash of the transaction. + * `input` (string; data): the data send along with the transaction. + * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. + * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. + * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. + * `value` (string; quantity): the value transferred in wei. + * `v` (string; quantity): ECDSA recovery ID. + * `r` (string; quantity): ECDSA signature r. + * `s` (string; quantity): ECDSA signature s. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_getTransactionByHash", + "params": ["0x844f55303dc97b4e71f9669acd6efad3dcc6e7e727c3a14ea3cbd243dee195a8"], + "id": 1 + }' +``` + +### Response example + +```json +{ + "id": 1, + "jsonrpc": "2.0", + "result": { + "blockHash": "0x82fe8e8aec1d5faabe61c618e5fff17127b0a6ea881be2383f6cb5f829ef563b", + "blockNumber": "0x521b8", + "from": "0xa66b0798e5f3812d84a91e5d14723c1c90fb2d00", + "gas": "0x26812", + "gasPrice": "0x4190ab00", + "maxFeePerGas": "0x4190ab00", + "maxPriorityFeePerGas": "0x4190ab00", + "hash": "0x844f55303dc97b4e71f9669acd6efad3dcc6e7e727c3a14ea3cbd243dee195a8", + "input": "0x84bb1e42000000000000000000000000a66b0798e5f3812d84a91e5d14723c1c90fb2d000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000c28f219c40000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000c28f219c400000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x0", + "to": "0x13c42cccedb63ccb8980f3b2135e1bd5630269af", + "transactionIndex": "0x0", + "value": "0xc28f219c400", + "type": "0x2", + "accessList": [], + "chainId": "0x92", + "v": "0x1", + "r": "0xfad93fb7b0d204241bdbe082857e9b37c5cc085eca348ee1159fb2887615af5", + "s": "0x2ffe202fe44c01158896f8b6f9d15b4da730eee52102fa3b69b9a697d0841cb8", + "maxFeePerBlobGas": null, + "blobVersionedHashes": null + } +} +``` + +--- + +## `eth_getTransactionByBlockHashAndIndex` + +> Returns information on a transaction specified by block hash and transaction index position. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `` (data, 32 bytes): a block hash. + 2. `` (quantity): a transaction index position. + +### Returns +
+ + * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. + * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. + * `from` (string; data, 20 bytes): an address of the sender. + * `gas` (string; quantity): the gas provided by the sender. + * `gasPrice` (string; quantity): the gas price provided by the sender in wei. + * `hash` (string; data, 32 bytes): the hash of the transaction. + * `input` (string; data): the data send along with the transaction. + * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. + * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. + * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. + * `value` (string; quantity): the value transferred in wei. + * `v` (string; quantity): ECDSA recovery ID. + * `r` (string; quantity): ECDSA signature r. + * `s` (string; quantity): ECDSA signature s. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_getTransactionByBlockHashAndIndex", + "params": ["0x82fe8e8aec1d5faabe61c618e5fff17127b0a6ea881be2383f6cb5f829ef563b", "0x0"], + "id": 1 + }' +``` + +### Response example + +```json +{ + "id": 1, + "jsonrpc": "2.0", + "result": { + "blockHash": "0x82fe8e8aec1d5faabe61c618e5fff17127b0a6ea881be2383f6cb5f829ef563b", + "blockNumber": "0x521b8", + "from": "0xa66b0798e5f3812d84a91e5d14723c1c90fb2d00", + "gas": "0x26812", + "gasPrice": "0x4190ab00", + "maxFeePerGas": "0x4190ab00", + "maxPriorityFeePerGas": "0x4190ab00", + "hash": "0x844f55303dc97b4e71f9669acd6efad3dcc6e7e727c3a14ea3cbd243dee195a8", + "input": "0x84bb1e42000000000000000000000000a66b0798e5f3812d84a91e5d14723c1c90fb2d000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000c28f219c40000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000c28f219c400000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x0", + "to": "0x13c42cccedb63ccb8980f3b2135e1bd5630269af", + "transactionIndex": "0x0", + "value": "0xc28f219c400", + "type": "0x2", + "accessList": [], + "chainId": "0x92", + "v": "0x1", + "r": "0xfad93fb7b0d204241bdbe082857e9b37c5cc085eca348ee1159fb2887615af5", + "s": "0x2ffe202fe44c01158896f8b6f9d15b4da730eee52102fa3b69b9a697d0841cb8", + "maxFeePerBlobGas": null, + "blobVersionedHashes": null + } +} +``` + +--- + +## `eth_getTransactionByBlockNumberAndIndex` + +> Returns information on a transaction by block number and transaction index position. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: + * `earliest`: the lowest numbered block available on the client. + * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. + * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. + * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. + * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. + 2. `` (quantity): the transaction index position. + +### Returns +
+ + * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending. + * `blockNumber` (string; quantity): a number of the block containing the transaction; null when it's pending. + * `from` (string; data, 20 bytes): an address of the sender. + * `gas` (string; quantity): the gas provided by the sender. + * `gasPrice` (string; quantity): the gas price provided by the sender in wei. + * `hash` (string; data, 32 bytes): the hash of the transaction. + * `input` (string; data): the data send along with the transaction. + * `nonce` (string; quantity): the number of transactions made by the sender prior to this one. + * `to` (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction. + * `transactionIndex` (string; quantity): the transaction index position in the block; null when it's pending. + * `value` (string; quantity): the value transferred in wei. + * `v` (string; quantity): ECDSA recovery ID. + * `r` (string; quantity): ECDSA signature r. + * `s` (string; quantity): ECDSA signature s. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_getTransactionByBlockNumberAndIndex", + "params": ["0x521B8", "0x0"], + "id": 1 + }' +``` + +### Response example + +```json +{ + "id": 1, + "jsonrpc": "2.0", + "result": { + "blockHash": "0x82fe8e8aec1d5faabe61c618e5fff17127b0a6ea881be2383f6cb5f829ef563b", + "blockNumber": "0x521b8", + "from": "0xa66b0798e5f3812d84a91e5d14723c1c90fb2d00", + "gas": "0x26812", + "gasPrice": "0x4190ab00", + "maxFeePerGas": "0x4190ab00", + "maxPriorityFeePerGas": "0x4190ab00", + "hash": "0x844f55303dc97b4e71f9669acd6efad3dcc6e7e727c3a14ea3cbd243dee195a8", + "input": "0x84bb1e42000000000000000000000000a66b0798e5f3812d84a91e5d14723c1c90fb2d000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee00000000000000000000000000000000000000000000000000000c28f219c40000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000c28f219c400000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x0", + "to": "0x13c42cccedb63ccb8980f3b2135e1bd5630269af", + "transactionIndex": "0x0", + "value": "0xc28f219c400", + "type": "0x2", + "accessList": [], + "chainId": "0x92", + "v": "0x1", + "r": "0xfad93fb7b0d204241bdbe082857e9b37c5cc085eca348ee1159fb2887615af5", + "s": "0x2ffe202fe44c01158896f8b6f9d15b4da730eee52102fa3b69b9a697d0841cb8", + "maxFeePerBlobGas": null, + "blobVersionedHashes": null + } +} +``` + +--- + +## `eth_getTransactionReceipt` + +> Returns the receipt of a transaction by transaction hash. + +The receipt is not available for pending transactions. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `` (data, 32 bytes): a hash of the transaction. + +### Returns +
+ + * `object`: a transaction receipt object, or null when no receipt was found: + + * `transactionHash` (string; data, 32 bytes): a hash of the transaction. + * `transactionIndex` (string; quantity): the transactions index position in the block. + * `blockHash` (string; data, 32 bytes): a hash of the block containing the transaction. + * `blockNumber` (string; quantity): a number of the block containing the transaction. + * `from` (string; data, 20 bytes): an address of the sender. + * `to` (string; data, 20 bytes): an address of the receiver; null when it's a contract creation transaction. + * `cumulativeGasUsed` (string; quantity): the total amount of gas used when this transaction was executed in the block. + * `effectiveGasPrice` (string; quantity): the sum of the base fee and tip paid per unit of gas. + * `gasUsed` (string; quantity): the amount of gas used by this specific transaction alone. + * `contractAddress` (string; data, 20 bytes): the contract address created, if the transaction was a contract creation, otherwise null. + * `logs` (array): an array of log objects, which this transaction generated. + * `logsBloom` (string; data, 256 bytes): a bloom filter for light clients to quickly retrieve related logs. + * `type` (string; data): the transaction type, `0x00` for legacy transactions, `0x01` for access list types, `0x02` for dynamic fees. It also returns either of the following: + + * `root` (string; data, 32 bytes): a post-transaction stateroot (pre Byzantium). + * `status` (string; quantity): either 1 (success) or 0 (failure). + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_getTransactionReceipt", + "params": ["0x844f55303dc97b4e71f9669acd6efad3dcc6e7e727c3a14ea3cbd243dee195a8"], + "id": 1 + }' +``` + +### Response example + +```json +{ + "id": 1, + "jsonrpc": "2.0", + "result": { + "blockHash": "0x82fe8e8aec1d5faabe61c618e5fff17127b0a6ea881be2383f6cb5f829ef563b", + "blockNumber": "0x521b8", + "contractAddress": null, + "cumulativeGasUsed": "0x260f8", + "effectiveGasPrice": "0x4190ab00", + "from": "0xa66b0798e5f3812d84a91e5d14723c1c90fb2d00", + "gasUsed": "0x260f8", + "logs": [ + { + "address": "0x13c42cccedb63ccb8980f3b2135e1bd5630269af", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000a66b0798e5f3812d84a91e5d14723c1c90fb2d00", + "0x0000000000000000000000000000000000000000000000000000000000000745" + ], + "data": "0x", + "blockNumber": "0x521b8", + "transactionHash": "0x844f55303dc97b4e71f9669acd6efad3dcc6e7e727c3a14ea3cbd243dee195a8", + "transactionIndex": "0x0", + "blockHash": "0x82fe8e8aec1d5faabe61c618e5fff17127b0a6ea881be2383f6cb5f829ef563b", + "logIndex": "0x0", + "removed": false + } + ], + "logsBloom": "0x00000000000000000000000000000000000001000000000000000000000000000000000800000000000000000000020000000000000000022008000000000000000000000000000000000008000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000010000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000080000000000000000001000000008000000020000200000000000000000002000000000000000000000000000000000000000000", + "status": "0x1", + "to": "0x13c42cccedb63ccb8980f3b2135e1bd5630269af", + "transactionHash": "0x844f55303dc97b4e71f9669acd6efad3dcc6e7e727c3a14ea3cbd243dee195a8", + "transactionIndex": "0x0", + "type": "0x2" + } +} +``` + +--- + +## `eth_getUncleByBlockHashAndIndex` + +> Returns information about an uncle of a block by hash and uncle index position. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `` (data, 32 bytes): the hash of a block. + 2. `` (quantity): the uncle's index position. + +### Returns +
+ + * ``: a block object, or null when no block was found: + * `number` (string; quantity): the block number; null when it's a pending block. + * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. + * `parentHash` (string; data, 32 bytes): the hash of the parent block. + * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. + * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. + * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. + * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. + * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. + * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. + * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. + * `difficulty` (string; quantity): the difficulty for this block. + * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. + * `extraData` (string; data): the **extra data** field of this block. + * `size` (string; quantity): the size of this block in bytes. + * `gasLimit` (string; quantity): the maximum gas allowed in this block. + * `gasUsed` (string; quantity): the total used gas by all transactions in this block. + * `timestamp` (string; quantity): the unix timestamp for when the block was collated. + * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. + * `uncles` (array of strings): an array of uncle hashes. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_getUncleByBlockHashAndIndex", + "params": ["0x82fe8e8aec1d5faabe61c618e5fff17127b0a6ea881be2383f6cb5f829ef563b", "0x0"], + "id": 1 + }' +``` + +### Response example + +```json +{ + "id": 1, + "jsonrpc": "2.0", + "result": null +} +``` + +--- + +## `eth_getUncleByBlockNumberAndIndex` + +> Returns information about an uncle of a block by number and uncle index position. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `` (quantity|tag): either the hex value of a _block number_ or one of the following _block tags_: + * `earliest`: the lowest numbered block available on the client. + * `finalized`: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination. + * `safe`: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions. + * `latest`: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions. + * `pending`: a sample next block built by the client on top of the `latest` and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet. + 2. `` (quantity): the uncle's index position. + +### Returns +
+ + * ``: a block object, or null when no block was found: + * `number` (string; quantity): the block number; null when it's a pending block. + * `hash` (string; data, 32 bytes): the hash of the block; null when it's a pending block. + * `parentHash` (string; data, 32 bytes): the hash of the parent block. + * `nonce` (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block. + * `sha3Uncles` (string; data, 32 bytes): SHA3 of the uncles data in the block. + * `logsBloom` (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block. + * `transactionsRoot` (string; data, 32 bytes): the root of the transaction trie of the block. + * `stateRoot` (string; data, 32 bytes): the root of the final state trie of the block. + * `receiptsRoot` (string; data, 32 bytes): the root of the receipts trie of the block. + * `miner` (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given. + * `difficulty` (string; quantity): the difficulty for this block. + * `totalDifficulty` (string; quantity): the total difficulty of the chain until this block. + * `extraData` (string; data): the **extra data** field of this block. + * `size` (string; quantity): the size of this block in bytes. + * `gasLimit` (string; quantity): the maximum gas allowed in this block. + * `gasUsed` (string; quantity): the total used gas by all transactions in this block. + * `timestamp` (string; quantity): the unix timestamp for when the block was collated. + * `transactions` (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter. + * `uncles` (array of strings): an array of uncle hashes. + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_getUncleByBlockNumberAndIndex", + "params": ["latest", "0x0"], + "id": 1 + }' +``` + +### Response example + +```json +{ + "id": 1, + "jsonrpc": "2.0", + "result": null +} +``` + +--- + +## `eth_getLogs` + +> Returns an array of all logs matching a given filter object. + +### Parameters +
+ + * `id` (integer; required): a request ID (example: 1). + * `jsonrpc` (string; required): a JSON RPC spec used (example: 2.0). + * `method` (string; required): a method used for the request. + * `params` (array; required): + + 1. `object`: the filter options: + + * `fromBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: + + * `latest`: for the last mined block. + * `earliest`: for the lowest numbered block available on the client. + * `pending`: for not yet mined transactions. + + * `toBlock` (string; quantity|tag; optional; default: "latest"): either the _block number_ or one of the following _block tags_: + + * `latest`: for the last mined block. + * `earliest`: for the lowest numbered block available on the client. + * `pending`: for not yet mined transactions. + + * `address` (array of strings; data, 20 bytes; optional): a contract address or a list of addresses from which logs should originate. + * `topics` (array of strings; data; optional): an array of 32 bytes data topics. Topics are order-dependent. Each topic can also be an array of data with "or" options. + * `blockhash` (string; data, 32 bytes; optional; **future**): with the addition of EIP-234, `blockHash` will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to `fromBlock = toBlock = the block` number with hash blockHash. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed. + +### Returns +
+ + * `removed` (string; tag): `true` when the log was removed, due to a chain reorganization; `false` if it's a valid log. + * `logIndex` (string; quantity): the log index position in the block; null when it's a pending log. + * `transactionIndex` (string; quantity): the transactions index position log was created from; null when it's a pending log. + * `transactionHash` (string; data, 32 bytes): a hash of the transactions this log was created from; null when it's a pending log. + * `blockHash` (string; data, 32 bytes): a hash of the block containing the log; null when it's pending; null when it's a pending log. + * `blockNumber` (string; quantity): the number of the block containing the log; null when it's pending; null when it's a pending log. + * `address` (string; data, 20 bytes): an address from which this log originated. + * `data` (string; data): contains one or more 32 bytes non-indexed arguments of the log. + * `topics` (array of strings; data): an array of 0 to 4 32 bytes data of indexed log arguments. (In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier.) + +### Request example + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_getLogs", + "params": [ + { + "fromBlock": "0x1", + "toBlock": "latest", + "address": "0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" + ] + } + ], + "id": 1 +}' +``` + +### Response example + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": [] +} +``` + diff --git a/pages/rpc-service/chains/chains-list.mdx b/pages/rpc-service/chains/chains-list.mdx index 4d048487..a23fbe10 100644 --- a/pages/rpc-service/chains/chains-list.mdx +++ b/pages/rpc-service/chains/chains-list.mdx @@ -22,17 +22,18 @@ Find the chain you require and go to its docs section by clicking it. | | | | | | | |-----------------------------------------------------------------------|-------------------------------------------------------|----------------------------------------------------------------|-------------------------------------------------------|-------------------------------------------------------------------|---------------------------------------------------------| -| [Allora](/rpc-service/chains/chains-list/#allora) | [Bitlayer](/rpc-service/chains/chains-list/#bitlayer) | [Fantom](/rpc-service/chains/chains-list/#fantom) | [Kaia](/rpc-service/chains/chains-list/#kaia) | [Polkadot](/rpc-service/chains/chains-list/#polkadot) | [Swell](/rpc-service/chains/chains-list/#swell) | -| [Aptos](/rpc-service/chains/chains-list/#aptos) | [BitTorrent Chain](/rpc-service/chains/chains-list/#bittorrent-chain) | [Filecoin](/rpc-service/chains/chains-list/#filecoin) | [Kava](/rpc-service/chains/chains-list/#kava) | [Polygon](/rpc-service/chains/chains-list/#polygon) | [Syscoin](/rpc-service/chains/chains-list/#syscoin) | -| [Arbitrum](/rpc-service/chains/chains-list/#arbitrum) | [Blast](/rpc-service/chains/chains-list/#blast) | [Flare](/rpc-service/chains/chains-list/#flare) | [Kinto](/rpc-service/chains/chains-list/#kinto) | [Polygon zkEVM](/rpc-service/chains/chains-list/#polygon-zkevm) | [Taiko](/rpc-service/chains/chains-list/#taiko) | -| [Arbitrum Nova](/rpc-service/chains/chains-list/#arbitrum-nova) | [BNB Smart Chain](/rpc-service/chains/chains-list/#bnb-smart-chain) | [Gnosis](/rpc-service/chains/chains-list/#gnosis) | [Kusama](/rpc-service/chains/chains-list/#kusama) | [Rollux](/rpc-service/chains/chains-list/#rollux) | [Telos](/rpc-service/chains/chains-list/#telos) | -| [Atleta](/rpc-service/chains/chains-list/#atleta) | [Botanix](/rpc-service/chains/chains-list/#botanix) | [Gnosis Beacon](/rpc-service/chains/chains-list/#gnosis-beacon) | [Linea](/rpc-service/chains/chains-list/#linea) | [Scroll](/rpc-service/chains/chains-list/#scroll) | [Tenet](/rpc-service/chains/chains-list/#tenet) | -| [Avail](/rpc-service/chains/chains-list/#avail) | [Celo](/rpc-service/chains/chains-list/#celo) | [GOAT](/rpc-service/chains/chains-list/#goat) | [Mantle](/rpc-service/chains/chains-list/#mantle) | [Secret Network](/rpc-service/chains/chains-list/#secret-network) | [TON](/rpc-service/chains/chains-list/#ton) | -| [Avalanche](/rpc-service/chains/chains-list/#avalanche) | [Chiliz](/rpc-service/chains/chains-list/#chiliz) | [Gravity](/rpc-service/chains/chains-list/#gravity) | [Metis](/rpc-service/chains/chains-list/#metis) | [Sei](/rpc-service/chains/chains-list/#sei) | [TRON](/rpc-service/chains/chains-list/#tron) | -| [B2 Network](/rpc-service/chains/chains-list/#b2-network) | [Core](/rpc-service/chains/chains-list/#core) | [Harmony](/rpc-service/chains/chains-list/#harmony) | [Moonbeam](/rpc-service/chains/chains-list/#moonbeam) | [Solana](/rpc-service/chains/chains-list/#solana) | [Xai](/rpc-service/chains/chains-list/#xai) | -| [Bahamut](/rpc-service/chains/chains-list/#bahamut) | [Electroneum](/rpc-service/chains/chains-list/#electroneum) | [HECO Chain](/rpc-service/chains/chains-list/#huobi-eco-chain) | [NEAR](/rpc-service/chains/chains-list/#near) | [Stellar](/rpc-service/chains/chains-list/#stellar) | [XDC](/rpc-service/chains/chains-list/#xdc) | -| [Base](/rpc-service/chains/chains-list/#base) | [Ethereum](/rpc-service/chains/chains-list/#ethereum) | [Horizen EON](/rpc-service/chains/chains-list/#horizen-eon) | [Nervos](/rpc-service/chains/chains-list/#nervos) | [Story](/rpc-service/chains/chains-list/#story) | [X Layer](/rpc-service/chains/chains-list/#x-layer) | -| [Bitcoin](/rpc-service/chains/chains-list/#bitcoin) | [Ethereum Beacon](/rpc-service/chains/chains-list/#eth-beacon) | [IoTeX](/rpc-service/chains/chains-list/#iotex) | [Optimism](/rpc-service/chains/chains-list/#optimism) | [Sui](/rpc-service/chains/chains-list/#sui) | [zkSync Era](/rpc-service/chains/chains-list/#zksync-era) | +| [Allora](/rpc-service/chains/chains-list/#allora) | [BitTorrent Chain](/rpc-service/chains/chains-list/#bittorrent-chain) | [Flare](/rpc-service/chains/chains-list/#flare) | [Kusama](/rpc-service/chains/chains-list/#kusama) | [Scroll](/rpc-service/chains/chains-list/#scroll) | [Tenet](/rpc-service/chains/chains-list/#tenet) | +| [Aptos](/rpc-service/chains/chains-list/#aptos) | [Blast](/rpc-service/chains/chains-list/#blast) | [Gnosis](/rpc-service/chains/chains-list/#gnosis) | [Linea](/rpc-service/chains/chains-list/#linea) | [Secret Network](/rpc-service/chains/chains-list/#secret-network) | [TON](/rpc-service/chains/chains-list/#ton) | +| [Arbitrum](/rpc-service/chains/chains-list/#arbitrum) | [BNB Smart Chain](/rpc-service/chains/chains-list/#bnb-smart-chain) | [Gnosis Beacon](/rpc-service/chains/chains-list/#gnosis-beacon) | [Mantle](/rpc-service/chains/chains-list/#mantle) | [Sei](/rpc-service/chains/chains-list/#sei) | [TRON](/rpc-service/chains/chains-list/#tron) | +| [Arbitrum Nova](/rpc-service/chains/chains-list/#arbitrum-nova) | [Botanix](/rpc-service/chains/chains-list/#botanix) | [GOAT](/rpc-service/chains/chains-list/#goat) | [Metis](/rpc-service/chains/chains-list/#metis) | [Solana](/rpc-service/chains/chains-list/#solana) | [Xai](/rpc-service/chains/chains-list/#xai) | +| [Atleta](/rpc-service/chains/chains-list/#atleta) | [Celo](/rpc-service/chains/chains-list/#celo) | [Gravity](/rpc-service/chains/chains-list/#gravity) | [Moonbeam](/rpc-service/chains/chains-list/#moonbeam) | [Sonic](/rpc-service/chains/chains-list/#sonic) | [XDC](/rpc-service/chains/chains-list/#xdc) | +| [Avail](/rpc-service/chains/chains-list/#avail) | [Chiliz](/rpc-service/chains/chains-list/#chiliz) | [Harmony](/rpc-service/chains/chains-list/#harmony) | [NEAR](/rpc-service/chains/chains-list/#near) | [Stellar](/rpc-service/chains/chains-list/#stellar) | [X Layer](/rpc-service/chains/chains-list/#x-layer) | +| [Avalanche](/rpc-service/chains/chains-list/#avalanche) | [Core](/rpc-service/chains/chains-list/#core) | [HECO Chain](/rpc-service/chains/chains-list/#huobi-eco-chain) | [Nervos](/rpc-service/chains/chains-list/#nervos) | [Story](/rpc-service/chains/chains-list/#story) | [zkSync Era](/rpc-service/chains/chains-list/#zksync-era) | +| [B2 Network](/rpc-service/chains/chains-list/#b2-network) | [Electroneum](/rpc-service/chains/chains-list/#electroneum) | [Horizen EON](/rpc-service/chains/chains-list/#horizen-eon) | [Optimism](/rpc-service/chains/chains-list/#optimism) | [Sui](/rpc-service/chains/chains-list/#sui) | | +| [Bahamut](/rpc-service/chains/chains-list/#bahamut) | [Ethereum](/rpc-service/chains/chains-list/#ethereum) | [IoTeX](/rpc-service/chains/chains-list/#iotex) | [Polkadot](/rpc-service/chains/chains-list/#polkadot) | [Swell](/rpc-service/chains/chains-list/#swell) | | +| [Base](/rpc-service/chains/chains-list/#base) | [Ethereum Beacon](/rpc-service/chains/chains-list/#eth-beacon) | [Kaia](/rpc-service/chains/chains-list/#kaia) | [Polygon](/rpc-service/chains/chains-list/#polygon) | [Syscoin](/rpc-service/chains/chains-list/#syscoin) | | +| [Bitcoin](/rpc-service/chains/chains-list/#bitcoin) | [Fantom](/rpc-service/chains/chains-list/#fantom) | [Kava](/rpc-service/chains/chains-list/#kava) | [Polygon zkEVM](/rpc-service/chains/chains-list/#polygon-zkevm) | [Taiko](/rpc-service/chains/chains-list/#taiko) | | +| [Bitlayer](/rpc-service/chains/chains-list/#bitlayer) | [Filecoin](/rpc-service/chains/chains-list/#filecoin) | [Kinto](/rpc-service/chains/chains-list/#kinto) | [Rollux](/rpc-service/chains/chains-list/#rollux) | [Telos](/rpc-service/chains/chains-list/#telos) | | ## Allora @@ -7925,6 +7926,151 @@ curl -X POST https://rpc.ankr.com/solana \ --- +## Sonic + +> Sonic API is available on [Web3 API platform](https://www.ankr.com/rpc/sonic). + +Sonic is an EVM-compatible Layer 1 blockchain designed to deliver high-speed, low-latency transactions, aiming to process over 10,000 transactions per second with sub-second finality. + +Key Features of Sonic: + + * **High Throughput and Speed**: Sonic achieves transaction finality in approximately 720 milliseconds, positioning it among the fastest EVM-compatible blockchains. + * **Developer Incentives**: The platform offers attractive incentives, including a fee monetization program that allows developers to earn up to 90% of the fees generated by their applications. + * **EVM Compatibility**: Sonic's compatibility with the Ethereum Virtual Machine enables seamless deployment of existing Ethereum-based decentralized applications (dApps) without significant modifications. + * **Secure Ethereum Gateway**: Sonic provides a secure bridge to Ethereum, facilitating easy access to Ethereum's liquidity and assets while maintaining high transaction speeds and low costs. + +Official quick links: [Website](https://www.soniclabs.com/), [Docs](https://docs.soniclabs.com/), [GitHub](https://github.com/Fantom-Foundationf) + +### Networks + + * Mainnet (`HTTPS` and `WSS`) + * Testnet (`HTTPS` and `WSS`) + +### API methods + +For Sonic, we support blockchain interaction via all the [applicable methods](/rpc-service/chains/chains-api/sonic) except for those listed as unsupported. + +#### Unsupported + + + This section contains a list of methods we don't support for _Premium_ service plan. + + + + If you require any of the methods from the list, contact our Sales (`sales@ankr.com`) about moving to the _Enterprise_ service plan that can provide the services tailored to your specific needs. + + +**HTTPS**: + +`eth_newFilter`, `eth_getFilterChanges`, `eth_coinbase`, `eth_hashrate`, `eth_mining`, `eth_getWork`,`eth_submitWork`, `eth_submitHashrate`, `net_peerCount`, `eth_newBlockFilter`, `eth_newPendingTransactionFilter`, `eth_uninstallFilter`, `eth_getFilterLogs`, + +`debug_*` (exception: `debug_traceBlockByHash`, `debug_traceBlockByNumber`, `debug_traceTransaction`, `debug_traceCall`, `debug_traceBlock`), + +`personal_*`, `admin_*`, `clique_*`, `les_*`, `miner_*`, `engine_*`, `parity_*` + +**WSS**: + +`txpool_content`, `txpool_inspect`, `txpool_status`, `txpool_contentFrom` + +### API querying + +#### Request example + + + + +```shell +curl -X POST https://rpc.ankr.com/sonic_mainnet \ +-H 'Content-Type: application/json' \ +-d '{ + "jsonrpc": "2.0", + "method": "eth_blockNumber", + "params": [], + "id": 1 + }' +``` + + + +```go +package main + +import ( + "context" + "fmt" + "github.com/ethereum/go-ethereum/ethclient" +) + +func main() { + const url = "https://rpc.ankr.com/sonic_mainnet" // url string + + rpcClient,err := ethclient.Dial(url) + + if err != nil { + panic(err) + } + + blockNumber, err := rpcClient.BlockNumber(context.Background()) + + if err != nil { + panic(err) + } + + fmt.Println(blockNumber) +} +``` + + + +```js +const Web3 = require('web3'); + +const url = 'https://rpc.ankr.com/sonic_mainnet' // url string + +const web3 = new Web3(new Web3.providers.HttpProvider(url)); + +web3.eth.getBlockNumber((error, blockNumber) => { + if(!error) { + console.log(blockNumber); + } else { + console.log(error); + } +}); +``` + + + +```python +from web3 import Web3 + +def test_block_number(self): + url = 'https://rpc.ankr.com/sonic_mainnet' # url string + + web3 = Web3(HTTPProvider(url)) + print(web3.eth.block_number) +``` + + + +#### Response example + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0x51008" +} +``` + +--- + ## Stellar > Stellar API is available on [Web3 API platform](https://www.ankr.com/rpc/stellar).