> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paxeer.app/llms.txt
> Use this file to discover all available pages before exploring further.

# RPC Methods

> Test HyperPaxeer RPC methods in real-time

## Overview

Test HyperPaxeer RPC methods in real-time. Select an example or write your own JSON-RPC request.

<Info>
  **RPC Endpoint:** `https://public-rpc.paxeer.app/rpc`
</Info>

<CardGroup cols={2}>
  <Card title="Chain ID" icon="link">
    **125**
  </Card>

  <Card title="Currency" icon="coins">
    **HPX**
  </Card>
</CardGroup>

## Common RPC Methods

### eth\_blockNumber

Returns the number of the most recent block.

<CodeGroup>
  ```json Request theme={null}
  {
    "jsonrpc": "2.0",
    "method": "eth_blockNumber",
    "params": [],
    "id": 1
  }
  ```

  ```json Response theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x5daf3b"
  }
  ```
</CodeGroup>

<Accordion title="Parameters">
  None
</Accordion>

<Accordion title="Returns">
  `QUANTITY` - Integer of the current block number the client is on
</Accordion>

***

### eth\_getBalance

Returns the balance of the account of given address.

<CodeGroup>
  ```json Request theme={null}
  {
    "jsonrpc": "2.0",
    "method": "eth_getBalance",
    "params": [
      "0x407d73d8a49eeb85d32cf465507dd71d507100c1",
      "latest"
    ],
    "id": 1
  }
  ```

  ```json Response theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x0234c8a3397aab58"
  }
  ```
</CodeGroup>

<Accordion title="Parameters">
  1. `DATA`, 20 Bytes - Address to check for balance
  2. `QUANTITY|TAG` - Integer block number, or the string "latest", "earliest" or "pending"
</Accordion>

<Accordion title="Returns">
  `QUANTITY` - Integer of the current balance in wei
</Accordion>

***

### eth\_gasPrice

Returns the current price per gas in wei.

<CodeGroup>
  ```json Request theme={null}
  {
    "jsonrpc": "2.0",
    "method": "eth_gasPrice",
    "params": [],
    "id": 1
  }
  ```

  ```json Response theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x09184e72a000"
  }
  ```
</CodeGroup>

<Accordion title="Parameters">
  None
</Accordion>

<Accordion title="Returns">
  `QUANTITY` - Integer of the current gas price in wei
</Accordion>

***

### eth\_chainId

Returns the chain ID of the current network.

<CodeGroup>
  ```json Request theme={null}
  {
    "jsonrpc": "2.0",
    "method": "eth_chainId",
    "params": [],
    "id": 1
  }
  ```

  ```json Response theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0xe5"
  }
  ```
</CodeGroup>

<Accordion title="Parameters">
  None
</Accordion>

<Accordion title="Returns">
  `QUANTITY` - Integer of the current chain ID (125 for HyperPaxeer)
</Accordion>

***

### eth\_call

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

<CodeGroup>
  ```json Request theme={null}
  {
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [
      {
        "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
        "data": "0x..."
      },
      "latest"
    ],
    "id": 1
  }
  ```

  ```json Response theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x..."
  }
  ```
</CodeGroup>

<Accordion title="Parameters">
  1. `Object` - The transaction call object
     * `from`: (optional) Address - The address the transaction is sent from
     * `to`: Address - The address the transaction is directed to
     * `gas`: (optional) Integer - Gas provided for the transaction execution
     * `gasPrice`: (optional) Integer - Gas price provided for each paid gas
     * `value`: (optional) Integer - Value sent with this transaction
     * `data`: (optional) Data - Hash of the method signature and encoded parameters
  2. `QUANTITY|TAG` - Integer block number, or the string "latest", "earliest" or "pending"
</Accordion>

<Accordion title="Returns">
  `DATA` - The return value of the executed contract
</Accordion>

***

### eth\_sendTransaction

Creates new message call transaction or a contract creation.

<Warning>
  This method requires a wallet connection to sign the transaction.
</Warning>

<CodeGroup>
  ```json Request theme={null}
  {
    "jsonrpc": "2.0",
    "method": "eth_sendTransaction",
    "params": [
      {
        "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
        "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
        "gas": "0x76c0",
        "gasPrice": "0x9184e72a000",
        "value": "0x9184e72a",
        "data": "0x..."
      }
    ],
    "id": 1
  }
  ```

  ```json Response theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
  }
  ```
</CodeGroup>

<Accordion title="Parameters">
  1. `Object` - The transaction object
     * `from`: Address - The address the transaction is sent from
     * `to`: (optional) Address - The address the transaction is directed to (null for contract creation)
     * `gas`: (optional) Integer - Gas provided for the transaction execution
     * `gasPrice`: (optional) Integer - Gas price provided for each paid gas
     * `value`: (optional) Integer - Value sent with this transaction
     * `data`: Data - Compiled contract code or hash of the invoked method signature and encoded parameters
</Accordion>

<Accordion title="Returns">
  `DATA`, 32 Bytes - The transaction hash, or the zero hash if the transaction is not yet available
</Accordion>

***

### eth\_getTransactionByHash

Returns information about a transaction by transaction hash.

<CodeGroup>
  ```json Request theme={null}
  {
    "jsonrpc": "2.0",
    "method": "eth_getTransactionByHash",
    "params": [
      "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"
    ],
    "id": 1
  }
  ```

  ```json Response theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
      "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2",
      "blockNumber": "0x5daf3b",
      "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d",
      "gas": "0xc350",
      "gasPrice": "0x4a817c800",
      "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b",
      "input": "0x68656c6c6f21",
      "nonce": "0x15",
      "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb",
      "transactionIndex": "0x41",
      "value": "0xf3dbb76162000",
      "v": "0x25",
      "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea",
      "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c"
    }
  }
  ```
</CodeGroup>

<Accordion title="Parameters">
  1. `DATA`, 32 Bytes - Hash of a transaction
</Accordion>

<Accordion title="Returns">
  `Object` - A transaction object, or null when no transaction was found
</Accordion>

## Using with cURL

```bash theme={null}
curl -X POST \
  https://public-rpc.paxeer.app/rpc \
  -H 'Content-Type: application/json' \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_blockNumber",
    "params": [],
    "id": 1
  }'
```

## Using with JavaScript

```javascript theme={null}
const response = await fetch('https://public-rpc.paxeer.app/rpc', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    jsonrpc: '2.0',
    method: 'eth_blockNumber',
    params: [],
    id: 1,
  }),
});

const data = await response.json();
console.log(data.result);
```

## Using with Python

```python theme={null}
import requests
import json

url = 'https://public-rpc.paxeer.app/rpc'
payload = {
    'jsonrpc': '2.0',
    'method': 'eth_blockNumber',
    'params': [],
    'id': 1
}

response = requests.post(url, json=payload)
print(response.json())
```

## Next Steps

<CardGroup cols={2}>
  <Card title="API Reference" icon="book" href="/api-reference">
    Complete API documentation for all methods
  </Card>

  <Card title="Examples" icon="code" href="/examples">
    Integration examples and code samples
  </Card>
</CardGroup>
