> For the complete documentation index, see [llms.txt](https://docs.blocksscan.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.blocksscan.io/api-endpoints/geth-parity-proxy.md).

# Geth/Parity Proxy (WIP)

## **eth\_blockNumber (WIP)**

Returns the number of most recent block

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_blockNumber
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_blockNumber\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
No parameters required.
{% endtab %}

{% tab title="Response" %}
Sample response

```
{
   "jsonrpc":"2.0",
   "id":83,
   "result":"0x1104728"
}
```

{% endtab %}
{% endtabs %}

## **eth\_getBlockTransactionCountByNumber (WIP)**

Returns the number of transactions in a block.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_getBlockTransactionCountByNumber
   &tag=0x10FB78
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_getBlockTransactionCountByNumber\&tag=0x10FB78\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                             |
| ------------ | --------------------------------------- |
| tag          | the block number, in hex eg. `0x10FB78` |
| {% endtab %} |                                         |

{% tab title="Response" %}
Sample response

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

{% endtab %}
{% endtabs %}

## **eth\_getTransactionByHash (WIP)**

Returns the information about a transaction requested by transaction hash.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_getTransactionByHash
   &txhash=0xbc78ab8a9e9a0bca7d0321a27b2c03addeae08ba81ea98b03cd3dd237eabed44
   &apikey=YourApiKeyToken
```

> Try this endpoint in your[ **browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_getTransactionByHash\&txhash=0xbc78ab8a9e9a0bca7d0321a27b2c03addeae08ba81ea98b03cd3dd237eabed44\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                           |
| ------------ | ----------------------------------------------------- |
| txhash       | the `string` representing the hash of the transaction |
| {% endtab %} |                                                       |

{% tab title="Response" %}
Sample Response

```
{
   "jsonrpc":"2.0",
   "id":1,
   "result":{
      "blockHash":"0xf850331061196b8f2b67e1f43aaa9e69504c059d3d3fb9547b04f9ed4d141ab7",
      "blockNumber":"0xcf2420",
      "from":"0x00192fb10df37c9fb26829eb2cc623cd1bf599e8",
      "gas":"0x5208",
      "gasPrice":"0x19f017ef49",
      "maxFeePerGas":"0x1f6ea08600",
      "maxPriorityFeePerGas":"0x3b9aca00",
      "hash":"0xbc78ab8a9e9a0bca7d0321a27b2c03addeae08ba81ea98b03cd3dd237eabed44",
      "input":"0x",
      "nonce":"0x33b79d",
      "to":"0xc67f4e626ee4d3f272c2fb31bad60761ab55ed9f",
      "transactionIndex":"0x5b",
      "value":"0x19755d4ce12c00",
      "type":"0x2",
      "accessList":[
         
      ],
      "chainId":"0x1",
      "v":"0x0",
      "r":"0xa681faea68ff81d191169010888bbbe90ec3eb903e31b0572cd34f13dae281b9",
      "s":"0x3f59b0fa5ce6cf38aff2cfeb68e7a503ceda2a72b4442c7e2844d63544383e3"
   }
}
```

{% endtab %}
{% endtabs %}

## **eth\_getTransactionByBlockNumberAndIndex (WIP)**

Returns information about a transaction by block number and transaction index position.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_getTransactionByBlockNumberAndIndex
   &tag=0xC6331D
   &index=0x11A
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_getTransactionByBlockNumberAndIndex\&tag=0xC6331D\&index=0x11A\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                      |
| ------------ | ---------------------------------------------------------------- |
| tag          | the block number, in hex eg. `0x10FB78`                          |
| index        | the position of the uncle's index in the block, in hex eg. `0x0` |
| {% endtab %} |                                                                  |

{% tab title="Response" %}
Sample Response

```
{
   "jsonrpc":"2.0",
   "result":{
      "accessList":[
         
      ],
      "blockHash":"0xdce94191f861842c2786e3594da0c0109707fd78409cab5f38e10eb87d0f301c",
      "blockNumber":"0xa36e44",
      "chainId":"0x3",
      "condition":null,
      "creates":null,
      "from":"0xb910ae1db14a9fbc64ce175bdca6d3a743f690ab",
      "gas":"0x186a0",
      "gasPrice":"0x3b9aca09",
      "hash":"0xf96ff62ba5aaf46cd824b6766f7fa6f6b9595b1dd4ef1d31bcf1f765047c2835",
      "input":"0xd0e30db0",
      "maxFeePerGas":"0x3b9aca12",
      "maxPriorityFeePerGas":"0x3b9aca00",
      "nonce":"0xc6",
      "publicKey":"0x6dbf7068e19de8457c426a758a92ea54827ebd5b8467c3a1a5c4ac19bc7570457738fe496a40ea4e1f59d39d89636a430afdec0bf2a8060c6bf7d612bfe90ad3",
      "r":"0xdecdc48821a06bf116e82b355d520dc5a44d6df98234e5344c16565b0b3dfdba",
      "raw":"0x02f8750381c6843b9aca00843b9aca12830186a094c778417e063141139fce010982780140aa0cd5ab8502540be40084d0e30db0c001a0decdc48821a06bf116e82b355d520dc5a44d6df98234e5344c16565b0b3dfdbaa06b85bb6fd8153e86b50f0011787585e8c709a2a25e7ee3c2579572f07acfd42e",
      "s":"0x6b85bb6fd8153e86b50f0011787585e8c709a2a25e7ee3c2579572f07acfd42e",
      "to":"0xc778417e063141139fce010982780140aa0cd5ab",
      "transactionIndex":"0xd",
      "type":"0x2",
      "v":"0x1",
      "value":"0x2540be400"
   },
   "id":1
}
```

{% endtab %}
{% endtabs %}

## **eth\_getTransactionCount (WIP)**

Returns the number of transactions performed by an address.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_getTransactionCount
   &address=0x4bd5900Cb274ef15b153066D736bf3e83A9ba44e
   &tag=latest
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_getTransactionCount\&address=0x4bd5900Cb274ef15b153066D736bf3e83A9ba44e\&tag=latest\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                        |
| ------------ | ---------------------------------------------------------------------------------- |
| address      | the `string` representing the address to get transaction count                     |
| tag          | the `string` pre-defined block parameter, either `earliest`, `pending` or `latest` |
| {% endtab %} |                                                                                    |

{% tab title="Response" %}
Sample Response

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

{% endtab %}
{% endtabs %}

## **eth\_sendRawTransaction (WIP)**

Submits a pre-signed transaction for broadcast to the XDC network.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_sendRawTransaction
   &hex=0xf904808000831cfde080
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_sendRawTransaction\&hex=0xf904808000831cfde080\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}

{% endtab %}

{% tab %}
Query Parameters
{% endtab %}
{% endtabs %}

| Parameter | Description                                                             |
| --------- | ----------------------------------------------------------------------- |
| hex       | the `string` representing the signed raw transaction data to broadcast. |

{% tabs %}
{% tab title="Response" %}
Sample Response

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

{% endtab %}
{% endtabs %}

{% hint style="info" %}
:bulb: **Tip:** Send a **POST** request if your hex string is particularly long.
{% endhint %}

{% hint style="info" %}
:pick: **Note:** The `result` represents the **transaction hash** of the submitted raw transaction.

Use **eth\_getTransactionReceipt (WIP)** to retrieve full details.
{% endhint %}

## **eth\_getTransactionReceipt (WIP)**

Returns the receipt of a transaction by transaction hash.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_getTransactionReceipt
   &txhash=0xadb8aec59e80db99811ac4a0235efa3e45da32928bcff557998552250fa672eb
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_getTransactionReceipt\&txhash=0xadb8aec59e80db99811ac4a0235efa3e45da32928bcff557998552250fa672eb\&apikey=YourApiKeyToken) :link:

Query Parameters

| Parameter | Description                                           |
| --------- | ----------------------------------------------------- |
| txhash    | the `string` representing the hash of the transaction |

Sample Response

```
{
   "jsonrpc":"2.0",
   "id":1,
   "result":{
      "blockHash":"0x07c17710dbb7514e92341c9f83b4aab700c5dba7c4fb98caadd7926a32e47799",
      "blockNumber":"0xcf2427",
      "contractAddress":null,
      "cumulativeGasUsed":"0xeb67d5",
      "effectiveGasPrice":"0x1a96b24c26",
      "from":"0x292f04a44506c2fd49bac032e1ca148c35a478c8",
      "gasUsed":"0xb41d",
      "logs":[
         {
            "address":"0xdac17f958d2ee523a2206206994597c13d831ec7",
            "topics":[
               "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
               "0x000000000000000000000000292f04a44506c2fd49bac032e1ca148c35a478c8",
               "0x000000000000000000000000ab6960a6511ff18ed8b8c012cb91c7f637947fc0"
            ],
            "data":"0x00000000000000000000000000000000000000000000000000000000013f81a6",
            "blockNumber":"0xcf2427",
            "transactionHash":"0xadb8aec59e80db99811ac4a0235efa3e45da32928bcff557998552250fa672eb",
            "transactionIndex":"0x122",
            "blockHash":"0x07c17710dbb7514e92341c9f83b4aab700c5dba7c4fb98caadd7926a32e47799",
            "logIndex":"0xdb",
            "removed":false
         }
      ],
      "logsBloom":"0x00000000000000000000000000000000000000000000000000000000000004000000000004000000000000000000010000000000000000000000000000000000000000000000000000000008000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000010000000001100000000000000000000000000000000000000000000000000000200100000000000000000000000000080000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
      "status":"0x1",
      "to":"0xdac17f958d2ee523a2206206994597c13d831ec7",
      "transactionHash":"0xadb8aec59e80db99811ac4a0235efa3e45da32928bcff557998552250fa672eb",
      "transactionIndex":"0x122",
      "type":"0x2"
   }
}
```

## **eth\_call (WIP)**

Executes a new message call immediately without creating a transaction on the block chain.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_call
   &to=0xAEEF46DB4855E25702F8237E8f403FddcaF931C0
   &data=0x70a08231000000000000000000000000e16359506c028e51f16be38986ec5746251e9724
   &tag=latest
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_call\&to=0xAEEF46DB4855E25702F8237E8f403FddcaF931C0\&data=0x70a08231000000000000000000000000e16359506c028e51f16be38986ec5746251e9724\&tag=latest\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter | Description                                                                        |
| --------- | ---------------------------------------------------------------------------------- |
| to        | the `string` representing the address to interact with                             |
| data      | the hash of the method signature and encoded parameters                            |
| tag       | the `string` pre-defined block parameter, either `earliest`, `pending` or `latest` |

{% hint style="info" %}
:fuelpump: **Note:** The `gas` parameter is capped at **2x** the current block gas limit.
{% endhint %}
{% endtab %}

{% tab title="Response" %}
Sample Response

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

{% endtab %}
{% endtabs %}

## **eth\_getCode (WIP)**

Returns code at a given address.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_getCode
   &address=0xf75e354c5edc8efed9b59ee9f67a80845ade7d0c
   &tag=latest
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_getCode\&address=0xf75e354c5edc8efed9b59ee9f67a80845ade7d0c\&tag=latest\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                        |
| ------------ | ---------------------------------------------------------------------------------- |
| address      | the `string` representing the address to get code                                  |
| tag          | the `string` pre-defined block parameter, either `earliest`, `pending` or `latest` |
| {% endtab %} |                                                                                    |

{% tab title="Response" %}
Sample Response

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

{% endtab %}
{% endtabs %}

## **eth\_getStorageAt (WIP)**

Returns the value from a storage position at a given address.

{% hint style="danger" %}
This endpoint is still **experimental** and may have potential issues
{% endhint %}

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_getStorageAt
   &address=0x6e03d9cce9d60f3e9f2597e13cd4c54c55330cfd
   &position=0x0
   &tag=latest
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_getStorageAt\&address=0x6e03d9cce9d60f3e9f2597e13cd4c54c55330cfd\&position=0x0\&tag=latest\&apikey=YourApiKeyToken)

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter    | Description                                                                        |
| ------------ | ---------------------------------------------------------------------------------- |
| address      | the `string` representing the address to get code                                  |
| position     | the hex code of the position in storage, eg `0x0`                                  |
| tag          | the `string` pre-defined block parameter, either `earliest`, `pending` or `latest` |
| {% endtab %} |                                                                                    |

{% tab title="Response" %}
Sample Response

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

{% endtab %}
{% endtabs %}

## **eth\_gasPrice (WIP)**

Returns the current price per gas in wei.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_gasPrice
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_gasPrice\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
No parameters required.
{% endtab %}

{% tab title="Response" %}
Sample Response

```
{
   "jsonrpc":"2.0",
   "id":73,
   "result":"0x430e23400"
}
```

{% hint style="info" %}
:book: **Tip:** The `result` is returned in **wei**.

Easily convert XDC units using our [**unit converter.**](https://xdc.blocksscan.io/unitconverter)
{% endhint %}
{% endtab %}
{% endtabs %}

## **eth\_estimateGas (WIP)**

Makes a call or transaction, which won't be added to the blockchain and returns the used gas.

```
https://api.xdcscan.io/api
   ?module=proxy
   &action=eth_estimateGas
   &data=0x4e71d92d
   &to=0xf0160428a8552ac9bb7e050d90eeade4ddd52843
   &value=0xff22
   &gasPrice=0x51da038cc
   &gas=0x5f5e0ff
   &apikey=YourApiKeyToken
```

> Try this endpoint in your [**browser**](https://api.xdcscan.io/api?module=proxy\&action=eth_estimateGas\&data=0x4e71d92d\&to=0xf0160428a8552ac9bb7e050d90eeade4ddd52843\&value=0xff22\&gasPrice=0x51da038cc\&gas=0x5f5e0ff\&apikey=YourApiKeyToken) :link:

{% tabs %}
{% tab title="Request" %}
Query Parameters

| Parameter | Description                                                                                                                                                                         |
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| data      | the hash of the method signature and encoded parameters                                                                                                                             |
| to        | the `string` representing the address to interact with                                                                                                                              |
| value     | the value sent in this transaction, in hex eg. `0xff22`                                                                                                                             |
| gas       | the amount of gas provided for the transaction, in hex eg. `0x5f5e0ff`                                                                                                              |
| gasPrice  | <p>the gas price paid for each unit of gas, in wei</p><p>post <strong>EIP-1559</strong>, the <code>gasPrice</code> has to be higher than the block's <code>baseFeePerGas</code></p> |

{% hint style="info" %}
:fuelpump: **Note:** The `gas` parameter is capped at **2x** the current block gas limit.
{% endhint %}
{% endtab %}

{% tab title="Response" %}
Sample Response

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

{% endtab %}
{% endtabs %}
