> For the complete documentation index, see [llms.txt](https://docs.expand.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.expand.network/~/changes/CwwHZ0oIeFsEWwiEWd1b/integrations/blockchain/evm-based-blockchains/base.md).

# Base

### /getbalance

## Get the balance or number of the given token in the requested public address.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/chain/getbalance`

#### Query Parameters

| Name                                      | Type   | Description                                                                                          |
| ----------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------- |
| rpc                                       | String | Remote procedural call URL                                                                           |
| chainId<mark style="color:red;">\*</mark> | String | Refer to the [Chain ID ](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/chain-id.md)page for details. |
| chainSymbol                               | String | Refer to the [Chain ID ](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/chain-id.md)page for details. |
| address<mark style="color:red;">\*</mark> | String | The public address to get the balance of.                                                            |
| tokenAddress                              | String | The address of token to get the balance of.                                                          |

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

```url
https://api.expand.network/chain/getbalance?address=0xf8fdd0c01e286e1f692f1581e155bafe4896ef17&chainId=8453
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "balance": "7710580086784116"
    }
}
```

{% endtab %}
{% endtabs %}

### /getblock

## Get details of a block.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/chain/getblock`

#### Query Parameters

| Name                                          | Type   | Description                                                                                          |
| --------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------- |
| rpc                                           | String | Remote procedural call URL.                                                                          |
| chainId<mark style="color:red;">\*</mark>     | String | Refer to the [Chain ID ](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/chain-id.md)page for details. |
| chainSymbol                                   | String | Refer to the [Chain ID ](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/chain-id.md)page for details. |
| blockNumber<mark style="color:red;">\*</mark> | String | The block number or block hash.                                                                      |

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

```url
https://api.expand.network/chain/getblock?chainId=8453&blockNumber=6283173
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "difficulty": "0",
        "gasLimit": 30000000,
        "gasUsed": 918397,
        "hash": "0x97250c54e310eb29a30b7ab4184b1cce9e466e7063b5590d52b73709e0bb230e",
        "miner": "0x4200000000000000000000000000000000000011",
        "nonce": "0x0000000000000000",
        "number": 6283173,
        "parentHash": "0xed86a845409a882270d4512487b7dafdfe91157da6d1e6c50d738de5a4a3ae92",
        "size": 4031,
        "timestamp": 1699355693,
        "totalDifficulty": "0",
        "transactions": [
            "0xefd80cb6f1e2b08a00ae403b9c07db6722c9dd7e98498c7e8e658a20c28f9b44",
            "0x56bda2ad97b7dc3609c97a5bfff3837d3b5394104d28d16c9e7a58b6d87dfb89",
            "0x88b6a08eea996e17dc67d917fde9cb4286163ee40a1a93a72458f88d0dde6535",
            "0xf9e572807b753ee98330eb84b7db4b6c5a14bcbb9966dd11e08b0af73a52b280",
            "0x43996c7f898e15d08d2157a0d4ed856a92c073c3c4752c95ae0f1cd8f3698a8f",
            "0x73d955224527330ef12cac53196ae3708a0d8feef0184474266c3a6078205e35"
        ],
        "transactionsRoot": "0xb5bde09f63711b915471936e273ed18b8dc7d6038ce053fe629ae82a66133bff",
        "uncles": []
    }
}
```

{% endtab %}
{% endtabs %}

### /getgasprice

## Get the current gas price from the network.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/chain/getgasprice`

#### Query Parameters

| Name                                      | Type   | Description                                                                                          |
| ----------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------- |
| rpc                                       | String | Remote procedural call URL.                                                                          |
| chainId<mark style="color:red;">\*</mark> | String | Refer to the [Chain ID ](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/chain-id.md)page for details. |
| chainSymbol                               | String | Refer to the [Chain ID ](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/chain-id.md)page for details. |

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

```url
https://api.expand.network/chain/getgasprice?chainId=8453
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "gasPrice": "100000061"
    }
}
```

{% endtab %}
{% endtabs %}

### /getstorage

## Get data stored in the given slot.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/chain/getstorage`

#### Query Parameters

| Name                                      | Type   | Description                                                                                          |
| ----------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------- |
| rpc                                       | String | Remote procedural call URL.                                                                          |
| chainId<mark style="color:red;">\*</mark> | String | Refer to the [Chain ID ](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/chain-id.md)page for details. |
| chainSymbol                               | String | Refer to the [Chain ID ](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/chain-id.md)page for details. |
| address<mark style="color:red;">\*</mark> | String | Contract address whose storage is needed.                                                            |
| index                                     | String | Slot index on the smart contract. By default,  it is taken as 0.                                     |

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

```url
https://api.expand.network/chain/getstorage?chainId=8453&address=0xCA6f5B49967B492FEE81cA9C92a63a98903DD965
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "data": "0x0000000000000000000000007dbc67df4d4ea21420b1baa077028d2c1cca7399"
    }
}
```

{% endtab %}
{% endtabs %}

### /gettransaction

## Get details of a transaction.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/chain/gettransaction`

#### Query Parameters

| Name                                              | Type   | Description                                                                                          |
| ------------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------- |
| rpc                                               | String | Remote procedural call URL.                                                                          |
| chainId<mark style="color:red;">\*</mark>         | String | Refer to the [Chain ID ](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/chain-id.md)page for details. |
| chainSymbol                                       | String | Refer to the [Chain ID ](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/chain-id.md)page for details. |
| transactionHash<mark style="color:red;">\*</mark> | String | The transaction hash.                                                                                |

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

```url
https://api.expand.network/chain/gettransaction?chainId=8453&transactionHash=0xcf15634c154cb70b8e02268eedd58d4949312414f796ca3296eebe07dc94ffb4
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "hash": "0xcf15634c154cb70b8e02268eedd58d4949312414f796ca3296eebe07dc94ffb4",
        "transactionStatus": true,
        "blockNumber": "6283395",
        "timestamp": null,
        "from": "0x2c40a57BC2E05eBcd00C2c007097f838c7b3a115",
        "to": "0x10d16248bED1E0D0c7cF94fFD99A50c336c7Bcdc",
        "value": "264853642455711",
        "transactionFees": "27221958120",
        "gas": "545832",
        "gasPrice": "58632",
        "input": "0x2d62fc1a000000000000000000000000000000000000000000000000000000000000006a000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000034ac8b7d0000000000000000000000000000000000000000000000000000000034691f45000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001e00002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000068c7abb8b1c3d1ce467e28265770f3a7ecf3265400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000142c40a57bc2e05ebcd00c2c007097f838c7b3a11500000000000000000000000000000000000000000000000000000000000000000000000000000000000000142c40a57bc2e05ebcd00c2c007097f838c7b3a115000000000000000000000000",
        "nonce": 7,
        "network": null
    }
}
```

{% endtab %}
{% endtabs %}

### /portfolio

## Get detailed information about the verified assets or tokens currently associated with a user's wallet address.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/chain/portfolio`

#### Query Parameters

| Name                                      | Type    | Description                                                                                               |
| ----------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------- |
| rpc                                       | String  | Remote procedural call URL.                                                                               |
| chainId                                   | String  | Refer to the [Chain ID ](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/chain-id.md)page for details.      |
| chainSymbol                               | String  | Refer to the [Chain ID ](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/chain-id.md)page for details.      |
| address<mark style="color:red;">\*</mark> | String  | Public addess of the user.                                                                                |
| tokens                                    | String  | Comma-separated value of ERC-20 tokens to get value of. Maximum 10 at a time.                             |
| availableOnly                             | Boolean | <p>By default, false. <br>If true, tokens with balance > 0 will be listed.</p>                            |
| pageToken                                 | String  | Present at the end of a lengthy response to fetch the next page.                                          |
| assetType                                 | String  | <p><code>fungible</code>/<code>nonFungible</code> standard choice.  <br>By default, <code>all</code>.</p> |

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

```url
https://api.expand.network/chain/portfolio?chainId=8453&address=0xA5af143fd6f6093FDcF6D51d3641F08eaa07d53f&availableOnly=true
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "native": "3975672043073686",
        "evmTokens": [
            {
                "name": "The Doge NFT",
                "symbol": "DOG",
                "decimals": "18",
                "address": "0xafb89a09d82fbde58f18ac6437b3fc81724e4df6",
                "balance": "10000000000000000000",
                "assetType": "ERC20",
                "USDPrice": "0.013040102445834898"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

### **/sendtransaction**

## Send transaction on the chain.

<mark style="color:green;">`POST`</mark> `https://api.expand.network/chain/sendtransaction`

#### Request Body

| Name                                             | Type   | Description                                                                                          |
| ------------------------------------------------ | ------ | ---------------------------------------------------------------------------------------------------- |
| rpc                                              | String | Remote procedural call URL.                                                                          |
| chainId<mark style="color:red;">\*</mark>        | String | Refer to the [Chain ID ](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/chain-id.md)page for details. |
| chainSymbol                                      | String | Refer to the [Chain ID ](/~/changes/CwwHZ0oIeFsEWwiEWd1b/important-ids/chain-id.md)page for details. |
| rawTransaction<mark style="color:red;">\*</mark> | String | The encoded transaction, obtained from the signed transaction.                                       |

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

```json
{
    "chainId": "8453",
    "rawTransaction": "0xf86a80830f4272830a3d8794a67e9b68c41b0f26184d64c26e0b2b81466e5994843b9aca00808302948ca0e073bcaa02ab49f019278be707e3e50433ac7ae6107649a8b1cbdbc368e9482ea05ba36d559c5b70ffa289f90a572adc0863c46fdd067c40c2f37b9ea666fcc8e7"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "8453",
        "transactionHash": "0x2e5309f53a8c11841afc88c12c099e5c5c59271379fa3cc65df863fa18a64a60" 
    }
}
```

{% endtab %}
{% endtabs %}
