# Tron

### /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 ](https://docs.expand.network/ids/chain-ids)page for details. |
| chainSymbol                               | String | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)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=TSgdbpW9UcUpMkyb3E3SuY8f3DJn4nYbux&chainId=1000
```

{% endtab %}

{% tab title="Sample Response" %}

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

{% endtab %}
{% endtabs %}

### /getblock

Get details of a block.

<mark style="color:blue;">`GET`</mark> `https://historicallp.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 ](https://docs.expand.network/ids/chain-ids)page for details. |
| chainSymbol                                   | String | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)page for details. |
| blockNumber<mark style="color:red;">\*</mark> | String | The block number or block hash.                                                      |

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

```url
https://historicallp.api.expand.network/chain/getblock?blockNumber=48208733&chainId=1000
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "difficulty": null,
        "gasLimit": null,
        "gasUsed": null,
        "hash": "eca6c09ca08c8d0dddc1d09de5ac266ca200f2e236ca66f368fffe301e1827b0",
        "miner": "4114f2c09d3de3fe82a71960da65d4935a30b24e1f",
        "nonce": null,
        "size": null,
        "totalDifficulty": null,
        "transactions": [
            {
                "ret": [
                    {
                        "contractRet": "SUCCESS"
                    }
                ],
                "signature": [
                    "8e523c5a79d2232ea15bf63dab09a2adf10d75a88d0b1c04b7167106789e35635c6a71fc02f84b33aa881de91c1b50d8bc10b7113bc4ab151277395b3f141dc401"
                ],
                "txID": "30adceb49a8490f67896d9c9c7d6a0ddb6c2ef01239b550afbdc53f35e05204b",
                "raw_data": {
                    "contract": [
                        {
                            "parameter": {
                                "value": {
                                    "amount": 3,
                                    "owner_address": "4174d6b16fffe751fa24a3b8191261cf90ea430375",
                                    "to_address": "41c626d897457111e3bfc1541029eb9cce2709a89b"
                                },
                                "type_url": "type.googleapis.com/protocol.TransferContract"
                            },
                            "type": "TransferContract"
                        }
                    ],
                    "ref_block_bytes": "9b49",
                    "ref_block_hash": "39e7bbee118cadac",
                    "expiration": 1675226820000,
                    "fee_limit": 10,
                    "timestamp": 1675226763375
                },
                "raw_data_hex": "0a029b49220839e7bbee118cadac40a0dbb2dae0305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a154174d6b16fffe751fa24a3b8191261cf90ea430375121541c626d897457111e3bfc1541029eb9cce2709a89b180370efa0afdae03090010a"
            },
            {
                "ret": [
                    {
                        "contractRet": "SUCCESS"
                    }
                ],
                "signature": [
                    "af956f79c6f558798bef8232feb300429bb1bc791da1589383b27b84beca06925947db6817b617cd92e214bac8ce4dbfd54c0aefb4ec408db0ad682709fc189201"
                ],
                "txID": "a63c688a237a50a44f2dab2c9b22ac17b54511a5b5ff6c25037885d231c67de9",
                "raw_data": {
                    "contract": [
                        {
                            "parameter": {
                                "value": {
                                    "data": "b6e405ef000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000340000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004c0000000000000000000000000000000000000000000000000000000000000058000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000005000000000000000000000000c69f3ede17ce98ee9dcb4d1f8b2850790253a63700000000000000000000000063b9f3f8616233aad5b35f7e48b828af2bfc1e9f000000000000000000000000c69f3ede17ce98ee9dcb4d1f8b2850790253a637000000000000000000000000c69f3ede17ce98ee9dcb4d1f8b2850790253a637000000000000000000000000697542ce1786ee6cd01096b47e637d1ccd311f2700000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000004f3a00000000000000000000000000000000000000000000000000000000000043b1000000000000000000000000000000000000000000000000000000000000445d00000000000000000000000000000000000000000000000000000000000045890000000000000000000000000000000000000000000000000000000000004593000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000634ff41c0000000000000000000000000000000000000000000000000000000063508f800000000000000000000000000000000000000000000000000000000063508f800000000000000000000000000000000000000000000000000000000063508f800000000000000000000000000000000000000000000000000000000063508f80000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000c7ec0000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000006e0000000000000000000000000000000000000000000000000000000000000082000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a",
                                    "owner_address": "416764e69712991cd2193c07a790f035d3a73af2a7",
                                    "contract_address": "411fe7a0d8f7ace1f4486d473cd7294740ee0510cd"
                                },
                                "type_url": "type.googleapis.com/protocol.TriggerSmartContract"
                            },
                            "type": "TriggerSmartContract"
                        }
                    ],
                    "ref_block_bytes": "9b49",
                    "ref_block_hash": "39e7bbee118cadac",
                    "expiration": 1675226820000,
                    "fee_limit": 500000000,
                    "timestamp": 1675226762181
                },
                "raw_data_hex": "0a029b49220839e7bbee118cadac40a0dbb2dae0305af00e081f12eb0e0a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412b50e0a15416764e69712991cd2193c07a790f035d3a73af2a71215411fe7a0d8f7ace1f4486d473cd7294740ee0510cd22840eb6e405ef000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000340000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004c0000000000000000000000000000000000000000000000000000000000000058000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000005000000000000000000000000c69f3ede17ce98ee9dcb4d1f8b2850790253a63700000000000000000000000063b9f3f8616233aad5b35f7e48b828af2bfc1e9f000000000000000000000000c69f3ede17ce98ee9dcb4d1f8b2850790253a637000000000000000000000000c69f3ede17ce98ee9dcb4d1f8b2850790253a637000000000000000000000000697542ce1786ee6cd01096b47e637d1ccd311f2700000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000004f3a00000000000000000000000000000000000000000000000000000000000043b1000000000000000000000000000000000000000000000000000000000000445d00000000000000000000000000000000000000000000000000000000000045890000000000000000000000000000000000000000000000000000000000004593000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000634ff41c0000000000000000000000000000000000000000000000000000000063508f800000000000000000000000000000000000000000000000000000000063508f800000000000000000000000000000000000000000000000000000000063508f800000000000000000000000000000000000000000000000000000000063508f80000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000c7ec0000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000006e0000000000000000000000000000000000000000000000000000000000000082000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a70c597afdae030900180cab5ee01"
            }
        ],
        "transactionsRoot": null,
        "uncles": null
    }
}
```

{% 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 ](https://docs.expand.network/ids/chain-ids)page for details. |
| chainSymbol                                       | String | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)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=1000&transactionHash=b13e765c34a70c735c273d7e24b1fd467fd399e5bec8e816709839cfcbf34f3a
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "hash": "b13e765c34a70c735c273d7e24b1fd467fd399e5bec8e816709839cfcbf34f3a",
        "transactionStatus": "SUCCESS",
        "blockNumber": null,
        "timestamp": 1675231016887,
        "from": {
            "tronAddress": "TMkK9G2KfKoVPycYTC9C5D7oU5wn8tu3w5",
            "hexAddress": "4181313a7d9ea7ab0b7c7372019150ec3197008e6f"
        },
        "to": {},
        "transactionFees": null,
        "gas": null,
        "gasPrice": null,
        "input": "0a02a0d322082def2f21354f1ac440d0adb6dce0305a6e080c12680a34747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e667265657a6542616c616e6365436f6e747261637412300a154181313a7d9ea7ab0b7c7372019150ec3197008e6f50017a1541b68942ddb8108d0201caab6efebbc14d0c7e22c8280370b7efb2dce030",
        "nonce": null,
        "network": null
    }
}
```

{% 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                                                                          |
| ------------------------------------------------ | ------ | ------------------------------------------------------------------------------------ |
| chainId<mark style="color:red;">\*</mark>        | String | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)page for details. |
| chainSymbol                                      | String | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)page for details. |
| rawTransaction<mark style="color:red;">\*</mark> | String | The encoded transaction, obtained from signed transaction.                           |
| rpc                                              | String | Remote procedural call URL.                                                          |

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

```json
{
    "chainId": "1000",
    "rawTransaction": "0a020add22086c2763abadf9ed2940c8d5deea822e5a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a15418840e6c55b9ada326d211d818c34a994aeced808121541d3136787e667d1e055d2cd5db4b5f6c880563049186470ac89dbea822e"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1000",
        "transactionHash": "8735e61e3be580a2d707dbddab35900a57609608285c344c89577002922f990a"
    }
}
```

{% endtab %}
{% endtabs %}
