# ERC20

### /gettokendetails

Get the name, symbol and decimals of provided token address. Currently available on EVM chains and Near

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

#### Query Parameters

| Name                                           | Type   | Description                                                                          |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------ |
| rpc                                            | String | Remote procedural call URL.                                                          |
| tokenAddress<mark style="color:red;">\*</mark> | String | <p>Comma seperated address of token.<br>Maximum 10 tokens allowed.<br></p>           |
| chainId                                        | 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. |

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

```url
https://api.expand.network/fungibletoken/gettokendetails?tokenAddress=0xEB1112Ac78D537853150E2a07E8b765E29d3F019
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": [
        {
            "address": "0xeb1112ac78d537853150e2a07e8b765e29d3f019",
            "name": "HASH",
            "symbol": "HASH",
            "decimals": "18",
            "possibleSpam": false,
            "verifiedContract": false
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### /getuserallowance

Get the amount that the spender is allowed to withdraw on behalf of the owner. Currently available on EVM chains and Tron

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

#### Query Parameters

| Name                                           | Type   | Description                                                                               |
| ---------------------------------------------- | ------ | ----------------------------------------------------------------------------------------- |
| tokenAddress<mark style="color:red;">\*</mark> | String | Address of the token.                                                                     |
| owner<mark style="color:red;">\*</mark>        | String | Public address of the owner.                                                              |
| spender<mark style="color:red;">\*</mark>      | String | Public address of the spender.                                                            |
| rpc                                            | String | Remote procedural call URL.                                                               |
| chainId                                        | String | Refer to the [Chain ID](https://docs.expand.network/ids/chain-ids) page for more details. |
| chainSymbol                                    | String | Refer to the [Chain ID](https://docs.expand.network/ids/chain-ids) page for more details. |

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

```url
https://api.expand.network/fungibletoken/getuserallowance?owner=0x6Fb447Ae94F5180254D436A693907a1f57696900&tokenAddress=0x6b175474e89094c44da98b954eedeac495271d0f&spender=0xBA12222222228d8Ba445958a75a0704d566BF2C8
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "allowance": "999000000000000000000"
    }
}
```

{% endtab %}
{% endtabs %}

### /getuserbalance

Get the balance of the given token. Currently available on EVM chains

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

#### Query Parameters

| 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. |
| tokenAddress<mark style="color:red;">\*</mark> | String | Address of the token.                                                                |
| address<mark style="color:red;">\*</mark>      | String | Public Address of the user                                                           |
| chainSymbol                                    | String | Refer to the [Chain ID](https://docs.expand.network/ids/chain-ids) page for details. |

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

```url
https://api.expand.network/fungibletoken/getuserbalance?tokenAddress=0x6B175474E89094C44Da98b954EedeAC495271d0F&address=0x63056E00436Da25BcF48A40dfBbDcc7089351006&chainId=1
```

{% endtab %}

{% tab title="Sample Response" %}

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

{% endtab %}
{% endtabs %}

### /historicaltransactions

Retrieves all the transfers for the given address in the given range.

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

#### Query Parameters

| Name                                           | Type   | Description                                                                          |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------ |
| chainId                                        | String | Refer to the [Chain ID](https://docs.expand.network/ids/chain-ids) page for details. |
| address                                        | String | Public Address of the user                                                           |
| chainSymbol                                    | String | Refer to the [Chain ID](https://docs.expand.network/ids/chain-ids) page for details. |
| startBlock                                     | String | <p>Starting block of the range.</p><p>by default latestBlock -100</p>                |
| endBlock                                       | String | <p>Last block of the range.</p><p>by default its latestBlock</p>                     |
| page                                           | String | <p>page to get response on,</p><p>by default its 1</p>                               |
| sort                                           | String | <p>asc/desc sorting method,</p><p>by default its desc</p>                            |
| tokenAddress<mark style="color:red;">\*</mark> | String | address of the erc20 token                                                           |

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

```url
https://api.expand.network/fungibletoken/historicaltransactions?tokenAddress=0x6b175474e89094c44da98b954eedeac495271d0f
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "transactions": [
            {
                "blockNumber": "18968825",
                "timeStamp": "1704796271",
                "hash": "0x6df96285db80a5c1792a056bf9f38c63e9f250572c2f5afac945bcf996a145e5",
                "nonce": "21",
                "blockHash": "0xe8cf4dda5e648b707ff2837741708176122cb2196559c20c8618debf8c991997",
                "from": "0x3f2488a54c8b397525ff85ce5d32ac5f27dd8ce5",
                "contractAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
                "to": "0x1715a3e4a142d8b698131108995174f37aeba10d",
                "value": "193485657300000000000",
                "tokenName": "Dai Stablecoin",
                "tokenSymbol": "DAI",
                "tokenDecimal": "18",
                "transactionIndex": "114",
                "gas": "216896",
                "gasPrice": "12898560151",
                "gasUsed": "189283",
                "cumulativeGasUsed": "10458631",
                "input": "deprecated",
                "confirmations": "67",
                "methodId": "0xad58bdd1",
                "methodSignature": "relayTokens(address,address,uint256)"
            },
        ]
    }
}
```

{% endtab %}
{% endtabs %}

### /historical/weth

Retrieves all the WETH transfers for the given address in the given range.

<mark style="color:blue;">`GET`</mark> `https://api.expand.network/fungibletoken/historical/weth`

#### Query Parameters

| Name        | Type   | Description                                                                          |
| ----------- | ------ | ------------------------------------------------------------------------------------ |
| chainId     | String | Refer to the [Chain ID](https://docs.expand.network/ids/chain-ids) page for details. |
| address     | String | Public Address of the user                                                           |
| chainSymbol | String | Refer to the [Chain ID](https://docs.expand.network/ids/chain-ids) page for details. |
| startBlock  | String | <p>Starting block of the range.</p><p>by default latestBlock -100</p>                |
| endBlock    | String | <p>Last block of the range.</p><p>by default its latestBlock</p>                     |
| page        | String | <p>page to get response on,</p><p>by default its 1</p>                               |
| sort        | String | <p>asc/desc sorting method,</p><p>by default its desc</p>                            |

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

```url
https://api.expand.network/fungibletoken/historical/weth
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "transactions": [
            {
                "blockNumber": "17320271",
                "timeStamp": "1684824623",
                "hash": "0x051aac77f464921c72bb628fea7e1f57663b28e0286d20c69e830498307f15d5",
                "nonce": "367",
                "blockHash": "0x3dc921095193718262dcf3f07b52f1921351bef675a8617dd6f1badde6093f19",
                "from": "0x55d5c232d921b9eaa6b37b5845e439acd04b4dba",
                "contractAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
                "to": "0xef1c6e67703c7bd7107eed8303fbe6ec2554bf6b",
                "value": "449713740022466855",
                "tokenName": "Wrapped Ether",
                "tokenSymbol": "WETH",
                "tokenDecimal": "18",
                "transactionIndex": "112",
                "gas": "212952",
                "gasPrice": "37761736473",
                "gasUsed": "149768",
                "cumulativeGasUsed": "10771742",
                "input": "deprecated",
                "confirmations": "1"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

### /historicallogs

Retrieves all the logs for the given address in the given range.

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

#### Query Parameters

| Name                                           | Type   | Description                                                                          |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------ |
| chainId                                        | 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. |
| startBlock                                     | String | <p>Starting block of the range.</p><p>by default its (latestBlock -100)</p>          |
| endBlock                                       | String | <p>Last block of the range.</p><p>by default its latestBlock</p>                     |
| tokenAddress<mark style="color:red;">\*</mark> | String | address of the erc20 token                                                           |
| type<mark style="color:red;">\*</mark>         | String | Approval/Transfer logs                                                               |

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

```url
https://api.expand.network/fungibletoken/historicallogs?tokenAddress=0x6B175474E89094C44Da98b954EedeAC495271d0F&type=Approval
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "logs": [
            {
                "address": "0x6b175474e89094c44da98b954eedeac495271d0f",
                "topics": [
                    "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",
                    "0x000000000000000000000000975f7b8e68e99c04807e94f72d63e98ec21f5ad5",
                    "0x0000000000000000000000001715a3e4a142d8b698131108995174f37aeba10d"
                ],
                "params": {
                    "src": "0x975f7b8e68e99c04807e94f72d63e98ec21f5ad5",
                    "guy": "0x1715a3e4a142d8b698131108995174f37aeba10d",
                    "wad": "127000000000000000000"
                },
                "data": "0x000000000000000000000000000000000000000000000006e27aa3200a9c0000",
                "blockNumber": "17320089",
                "blockHash": "0x39b65a913a44fefa4f1432dc00927839cf8ba6bcbc778afb3effaf5c91a2a5d1",
                "timeStamp": "1684822391",
                "gasPrice": "37991235385",
                "gasUsed": "46158",
                "logIndex": "302",
                "transactionHash": "0x8b9159d1fc58b9dd33a0f8ebcb6980bca0416c3836bb08771c2cac5737dbadba",
                "transactionIndex": "109"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

### /historicalusertransactions

Retrieves all the ERC-20 transfers for the given address. \
Currently support for all EVM chains-Except zksync-era

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

#### Query Parameters

<table><thead><tr><th width="177">Name</th><th width="140">Type</th><th>Description</th></tr></thead><tbody><tr><td>chainId</td><td>String</td><td>Refer to the <a href="../../ids/chain-ids">Chain ID</a> page for details.</td></tr><tr><td>chainSymbol</td><td>String</td><td>Refer to the <a href="../../ids/chain-ids">Chain ID</a> page for details.</td></tr><tr><td>address<mark style="color:red;">*</mark></td><td>String</td><td>Public Address of the user</td></tr><tr><td>tokenAddress<mark style="color:red;">*</mark></td><td>String</td><td>ERC-20 token address</td></tr><tr><td>startBlock</td><td>String</td><td><p>Starting block of the range.</p><p>by default latestBlock -100</p></td></tr><tr><td>endBlock</td><td>String</td><td><p>Last block of the range.</p><p>by default its latestBlock</p></td></tr><tr><td>pageSize</td><td>String</td><td><p>page to get response on,</p><p>by default its 1</p></td></tr><tr><td>pageToken</td><td>String</td><td>Present at the top of a lengthy response to fetch the next page.</td></tr><tr><td>sortOrder</td><td>String</td><td><p>asc/desc sorting method,</p><p>by default its desc</p></td></tr><tr><td>fromTimestamp</td><td>String</td><td>The start date from which to get the transactions ( format in seconds or date string )<br>Note-If 'fromTimestamp' and 'startBlock' are provided, 'startBlock' will be used.<br>By default, the Genesis block timestamp</td></tr><tr><td>toTimestamp</td><td>String</td><td><p>The end date from which to get the transactions ( format in seconds or date string )<br>Note- If 'toTimestamp' and 'endBlock' are provided, 'endBlock' will be used.</p><p>By default, the current block timestamp</p></td></tr><tr><td>startBlock</td><td>String</td><td>The starting block number from which to get the transactions.<br>By default, the Genesis block</td></tr><tr><td>endBlock</td><td>String</td><td>The ending block number from which to get the transactions<br>By default, the current block</td></tr></tbody></table>

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

```url
https://api.expand.network/fungibletoken/historicalusertransactions?chainId=1&address=0x83A32a54D31Ee4f1f9dFFAd2A63A6d214e469eC3&tokenAddress=0xdAC17F958D2ee523a2206206994597C13D831ec7&sortOrder=asc&pageSize=10
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
  "status": 200,
  "msg": "success",
  "data": {
    "nextPageToken": "eyJhbGciOiJIUzI1NiJ9.eyJhc2NlbmRpbmciOnRydWUsImxpbWl0IjoxMCwicGFnZSI6MCwibGFzdEV2YWx1YXRlZEtleSI6eyJ3YWxsZXRBZGRyZXNzIjoiMHg4M2EzMmE1NGQzMWVlNGYxZjlkZmZhZDJhNjNhNmQyMTRlNDY5ZWMzIiwibG9nSWRlbnRpZmllclJvbGx1cCI6IjAwMDE3MTYwMDAxNDMwMDAwMDAwMDAwMDAwMDAwMDA4In0sInRhYmxlSW5kZXgiOjl9.cRYxg4nozOYVDq9pvYE5RLb0yoe-IKyIhV2VvvNr4tQ",
    "transactions": [
      {
        "token_name": "Tether USD",
        "token_symbol": "USDT",
        "token_decimals": "6",
        "from_address_entity": null,
        "from_address_entity_logo": null,
        "from_address": "0x83bdf89ce9b2b587785a89603d2d451f05cf719b",
        "from_address_label": null,
        "to_address_entity": null,
        "to_address_entity_logo": null,
        "to_address": "0x83a32a54d31ee4f1f9dffad2a63a6d214e469ec3",
        "to_address_label": null,
        "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "block_hash": "0x1faa804cbd9899e08a6f56b995524d32926c2fe08a2cfae9448987087e8f85b1",
        "block_number": "19768965",
        "block_timestamp": "2024-04-30T15:17:23.000Z",
        "transaction_hash": "0x22d5762ea04387c8e3517420c24f81becd7bd9f9836c9d5ae530878ac89d47e9",
        "transaction_index": 35,
        "log_index": 131,
        "value": "1000000"
      },
      {
        "token_name": "Tether USD",
        "token_symbol": "USDT",
        "token_decimals": "6",
        "from_address_entity": null,
        "from_address_entity_logo": null,
        "from_address": "0x83bdf89ce9b2b587785a89603d2d451f05cf719b",
        "from_address_label": null,
        "to_address_entity": null,
        "to_address_entity_logo": null,
        "to_address": "0x83a32a54d31ee4f1f9dffad2a63a6d214e469ec3",
        "to_address_label": null,
        "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "block_hash": "0x31ad28e590986b7f4ac84be0bf95557177f571a1e9be8062d1a7c96f8e273eb9",
        "block_number": "19781205",
        "block_timestamp": "2024-05-02T08:20:23.000Z",
        "transaction_hash": "0x877cd91398440e3cf502cc99ec2ad463fa77dd3ce2bf5ee169aae42dffb5bdbc",
        "transaction_index": 24,
        "log_index": 31,
        "value": "30000000000000"
      },
      {
        "token_name": "Tether USD",
        "token_symbol": "USDT",
        "token_decimals": "6",
        "from_address_entity": null,
        "from_address_entity_logo": null,
        "from_address": "0x83bdf89ce9b2b587785a89603d2d451f05cf719b",
        "from_address_label": null,
        "to_address_entity": null,
        "to_address_entity_logo": null,
        "to_address": "0x83a32a54d31ee4f1f9dffad2a63a6d214e469ec3",
        "to_address_label": null,
        "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "block_hash": "0xf742ac23e06f776e28a228ab5cd9944ea354f267ecec324af7bbdfe30e7cec3a",
        "block_number": "19781354",
        "block_timestamp": "2024-05-02T08:50:11.000Z",
        "transaction_hash": "0x77945592114d7df433fedd66515eada9070ce1838c81b2b348c2e5d416e0a47b",
        "transaction_index": 44,
        "log_index": 38,
        "value": "30000000000000"
      },
      {
        "token_name": "Tether USD",
        "token_symbol": "USDT",
        "token_decimals": "6",
        "from_address_entity": null,
        "from_address_entity_logo": null,
        "from_address": "0x83bdf89ce9b2b587785a89603d2d451f05cf719b",
        "from_address_label": null,
        "to_address_entity": null,
        "to_address_entity_logo": null,
        "to_address": "0x83a32a54d31ee4f1f9dffad2a63a6d214e469ec3",
        "to_address_label": null,
        "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "block_hash": "0xcfb6479ee16d2815aabd49789d2e630f891043bce1fe5ee699cd093e2fd3d954",
        "block_number": "19781375",
        "block_timestamp": "2024-05-02T08:54:23.000Z",
        "transaction_hash": "0x24a959f0989328de6a7cdc97ffab4d07f4e612d98523bab17a5dd31291f3d8ed",
        "transaction_index": 71,
        "log_index": 135,
        "value": "30000000000000"
      },
      {
        "token_name": "Tether USD",
        "token_symbol": "USDT",
        "token_decimals": "6",
        "from_address_entity": null,
        "from_address_entity_logo": null,
        "from_address": "0x83bdf89ce9b2b587785a89603d2d451f05cf719b",
        "from_address_label": null,
        "to_address_entity": null,
        "to_address_entity_logo": null,
        "to_address": "0x83a32a54d31ee4f1f9dffad2a63a6d214e469ec3",
        "to_address_label": null,
        "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "block_hash": "0xeada8469b9cace2e42f21588cb5523de83f68712e3091d6128c73d71f3aba3d5",
        "block_number": "19801538",
        "block_timestamp": "2024-05-05T04:34:11.000Z",
        "transaction_hash": "0x1d22a82e6973d137b3afcfb01ee608152a38102b8963ac6fd1dc5d295da4b721",
        "transaction_index": 107,
        "log_index": 248,
        "value": "1744527000000"
      },
      {
        "token_name": "Tether USD",
        "token_symbol": "USDT",
        "token_decimals": "6",
        "from_address_entity": null,
        "from_address_entity_logo": null,
        "from_address": "0x83bdf89ce9b2b587785a89603d2d451f05cf719b",
        "from_address_label": null,
        "to_address_entity": null,
        "to_address_entity_logo": null,
        "to_address": "0x83a32a54d31ee4f1f9dffad2a63a6d214e469ec3",
        "to_address_label": null,
        "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "block_hash": "0x1b524eb085ed2037f8d603c930cda05327c64bc0fe95d3617731d13fc691fca4",
        "block_number": "19808133",
        "block_timestamp": "2024-05-06T02:42:23.000Z",
        "transaction_hash": "0xc8929c5cba88438537969fdd10ca2ed8c3c586fdc4b6860141ab99886ee97519",
        "transaction_index": 13,
        "log_index": 33,
        "value": "2140680000000"
      },
      {
        "token_name": "Tether USD",
        "token_symbol": "USDT",
        "token_decimals": "6",
        "from_address_entity": null,
        "from_address_entity_logo": null,
        "from_address": "0x83bdf89ce9b2b587785a89603d2d451f05cf719b",
        "from_address_label": null,
        "to_address_entity": null,
        "to_address_entity_logo": null,
        "to_address": "0x83a32a54d31ee4f1f9dffad2a63a6d214e469ec3",
        "to_address_label": null,
        "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "block_hash": "0x92552bb7fcf9611d83ed4321648a8dbb37ebf9ba1d07da05b7cfd550471123a3",
        "block_number": "19815775",
        "block_timestamp": "2024-05-07T04:21:11.000Z",
        "transaction_hash": "0xbf6370013bb6ea39abec1b36ea4fcbc66261f11f07f6d48bb48dfc5b5b7b8d7a",
        "transaction_index": 29,
        "log_index": 84,
        "value": "171606000000"
      },
      {
        "token_name": "Tether USD",
        "token_symbol": "USDT",
        "token_decimals": "6",
        "from_address_entity": null,
        "from_address_entity_logo": null,
        "from_address": "0x83bdf89ce9b2b587785a89603d2d451f05cf719b",
        "from_address_label": null,
        "to_address_entity": null,
        "to_address_entity_logo": null,
        "to_address": "0x83a32a54d31ee4f1f9dffad2a63a6d214e469ec3",
        "to_address_label": null,
        "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "block_hash": "0x7c85bece4fadca37c185da98fc46efc9fdfead14589b3801dbea57322772601b",
        "block_number": "19836736",
        "block_timestamp": "2024-05-10T02:44:11.000Z",
        "transaction_hash": "0xd4ba9d623ecc631360d9e7ed0b2a0c2b1bc56380fe758a0243f377cd3c5804f6",
        "transaction_index": 30,
        "log_index": 91,
        "value": "1901967000000"
      },
      {
        "token_name": "Tether USD",
        "token_symbol": "USDT",
        "token_decimals": "6",
        "from_address_entity": null,
        "from_address_entity_logo": null,
        "from_address": "0x83bdf89ce9b2b587785a89603d2d451f05cf719b",
        "from_address_label": null,
        "to_address_entity": null,
        "to_address_entity_logo": null,
        "to_address": "0x83a32a54d31ee4f1f9dffad2a63a6d214e469ec3",
        "to_address_label": null,
        "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "block_hash": "0xb993dc6955b4ddc316b7a81ce9bbabf5384861a992bc03bcfddf370f9a147997",
        "block_number": "19879628",
        "block_timestamp": "2024-05-16T02:42:23.000Z",
        "transaction_hash": "0x3b491f01db569331737a6c25087c2f11ab0c277f518c8f85059fb1ef4000ea0b",
        "transaction_index": 18,
        "log_index": 42,
        "value": "348518000000"
      },
      {
        "token_name": "Tether USD",
        "token_symbol": "USDT",
        "token_decimals": "6",
        "from_address_entity": null,
        "from_address_entity_logo": null,
        "from_address": "0x83bdf89ce9b2b587785a89603d2d451f05cf719b",
        "from_address_label": null,
        "to_address_entity": null,
        "to_address_entity_logo": null,
        "to_address": "0x83a32a54d31ee4f1f9dffad2a63a6d214e469ec3",
        "to_address_label": null,
        "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "block_hash": "0xcc8aa648ac4a05a5038dd330143468de3cc560e86f5d157730c9c66be6a82677",
        "block_number": "19893927",
        "block_timestamp": "2024-05-18T02:42:23.000Z",
        "transaction_hash": "0x23f1f304b510a8c04dcc9659c4ce965e7648f288c1ab000a96fa95946fc8a87c",
        "transaction_index": 10,
        "log_index": 8,
        "value": "1443489000000"
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

### /approve

Sets amount as the allowance of spender over the user’s tokens. Currently available on EVM chains, Solana and Tron

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

#### Request Body

| Name                                           | Type   | Description                                                                          |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------ |
| rpc                                            | String | Remote procedural call URL.                                                          |
| from<mark style="color:red;">\*</mark>         | String | Address of the sender of the token.                                                  |
| tokenAddress<mark style="color:red;">\*</mark> | String | Address of token.                                                                    |
| amount<mark style="color:red;">\*</mark>       | String | Number of tokens.                                                                    |
| to<mark style="color:red;">\*</mark>           | String | Address to get approval of.                                                          |
| gas                                            | String | Maximum gas limit provided by the sender, for the transaction.                       |
| chainId                                        | 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. |
| gasPriority                                    | String | low, medium, or high.                                                                |

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

```json
{
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006", 
    "tokenAddress":"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",  
    "amount": "1000000000000000000000",                  
    "to": "0x828b154032950c8ff7cf8085d841723db2696056", 
    "gas": "100000",
    "chainId": "1"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
        "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "value": "0",
        "gas": "100000",
        "data": "0x095ea7b3000000000000000000000000828b154032950c8ff7cf8085d841723db269605600000000000000000000000000000000000000000000003635c9adc5dea00000",
        "referenceId": "ab50faa439b64b66beae1a894e1f0a0a"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Request" %}
**With gasPriority:**

```json
{
    "from": "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a", 
    "tokenAddress":"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",  
    "amount": "1000000000000000000000",
    "to": "0x828b154032950c8ff7cf8085d841723db2696056", 
    "gas": "100000",
    "gasPriority":"medium",
    "chainId": "1"
}
```

{% endtab %}

{% tab title="Sample Response" %}
**With gasPriority:**

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a",
        "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "value": "0",
        "gas": "100000",
        "data": "0x095ea7b3000000000000000000000000828b154032950c8ff7cf8085d841723db269605600000000000000000000000000000000000000000000003635c9adc5dea00000",
        "gasPrice": "4041564215",
        "referenceId": "bdf577b2ea2141ad96822cc9be56563e"
    }
}
```

{% endtab %}
{% endtabs %}

### /transfer

Moves amount tokens from the user’s account to the recipient. Currently available on EVM chains and Solana

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

#### Request Body

| Name                                           | Type   | Description                                                                          |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------ |
| rpc                                            | String | Remote procedural call URL.                                                          |
| from<mark style="color:red;">\*</mark>         | String | Address of the sender of the token.                                                  |
| tokenAddress<mark style="color:red;">\*</mark> | String | Address of token.                                                                    |
| amount<mark style="color:red;">\*</mark>       | String | Number of tokens.                                                                    |
| to<mark style="color:red;">\*</mark>           | String | Address of the recipient of the token.                                               |
| gas<mark style="color:red;">\*</mark>          | String | Maximum gas limit provided by the sender, for the transaction.                       |
| chainId                                        | 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. |
| gasPriority                                    | String | low, medium, or high.                                                                |

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

```json
{
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "tokenAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "amount": "1", 
    "to": "0x3E1Ca9fe2FC3021408d0E869BD3AFb167F889F38",
    "gas": "2307200"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
        "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "value": "0",
        "gas": "2307200",
        "data": "0xa9059cbb0000000000000000000000003e1ca9fe2fc3021408d0e869bd3afb167f889f380000000000000000000000000000000000000000000000000000000000000001",
        "referenceId": "03b43cb740914e9d91e4be1de40d3795"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Request" %}
**With gasPriority:**

```json
{
    "from": "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a",
    "tokenAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "amount": "1000000000000", 
    "to": "0x3E1Ca9fe2FC3021408d0E869BD3AFb167F889F38",
    "gas": "2307200",
    "gasPriority":"medium"
}
```

{% endtab %}

{% tab title="Sample Response" %}
**With gasPriority:**

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a",
        "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "value": "0",
        "gas": "2307200",
        "data": "0xa9059cbb0000000000000000000000003e1ca9fe2fc3021408d0e869bd3afb167f889f38000000000000000000000000000000000000000000000000000000e8d4a51000",
        "gasPrice": "4117306380",
        "referenceId": "666d67bc71184619b73157ad4571817f"
    }
}
```

{% endtab %}
{% endtabs %}

### /transferfrom

Transfers tokens from sender to recipient using the allowance mechanism. Currently available on EVM chains

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

#### Request Body

| Name                                           | Type   | Description                                                                          |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------ |
| rpc                                            | String | Remote procedural call URL.                                                          |
| from<mark style="color:red;">\*</mark>         | String | Address of the sender of the token.                                                  |
| tokenAddress<mark style="color:red;">\*</mark> | String | Address of token.                                                                    |
| amount<mark style="color:red;">\*</mark>       | String | Number of tokens.                                                                    |
| to<mark style="color:red;">\*</mark>           | String | Address, on whose behalf, tokens are spent.                                          |
| gas<mark style="color:red;">\*</mark>          | String | Maximum gas limit provided by the sender, for the transaction.                       |
| chainId                                        | 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. |
| reciever<mark style="color:red;">\*</mark>     | String | Receiver of the tokens.                                                              |
| gasPriority                                    | String | low, medium, or high.                                                                |

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

```json
{
       "from": "0x6Fb447Ae94F5180254D436A693907a1f57696900",
       "tokenAddress": "0x4B9eb6c0b6ea15176BBF62841C6B2A8a398cb656",
       "amount": "10000000000000",
       "reciever":"0x56D2208EfD27Fe9C67e3879DeBCe35833B9D4cC7",
       "to": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
       "gas": "390000"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x6Fb447Ae94F5180254D436A693907a1f57696900",
        "to": "0x4B9eb6c0b6ea15176BBF62841C6B2A8a398cb656",
        "value": "0",
        "gas": "390000",
        "data": "0x23b872dd000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e599400000000000000000000000056d2208efd27fe9c67e3879debce35833b9d4cc7000000000000000000000000000000000000000000000000000009184e72a000",
        "referenceId": "ad4b0020353440d9bebc194695e204e1"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Request" %}
**With gasPriority:**

```json
{
       "from": "0x6Fb447Ae94F5180254D436A693907a1f57696900",
       "tokenAddress": "0x4B9eb6c0b6ea15176BBF62841C6B2A8a398cb656",
       "amount": "10000000000000",
       "reciever":"0x56D2208EfD27Fe9C67e3879DeBCe35833B9D4cC7",
       "to": "0xa67E9B68c41b0f26184D64C26e0b2B81466E5994",
       "gas": "390000",
       "gasPriority":"medium"
       
}
```

{% endtab %}

{% tab title="Sample Response" %}
**With gasPriority:**

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x6Fb447Ae94F5180254D436A693907a1f57696900",
        "to": "0x4B9eb6c0b6ea15176BBF62841C6B2A8a398cb656",
        "value": "0",
        "gas": "390000",
        "data": "0x23b872dd000000000000000000000000a67e9b68c41b0f26184d64c26e0b2b81466e599400000000000000000000000056d2208efd27fe9c67e3879debce35833b9d4cc7000000000000000000000000000000000000000000000000000009184e72a000",
        "gasPrice": "4119327710",
        "referenceId": "36215433fb864b738d885304f0956858"
    }
}
```

{% endtab %}
{% endtabs %}

### /convertbasetokentowraptoken

Converts base token to wrap token. Currently available on EVM chains.

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

#### Request Body

| Name                                           | Type   | Description                                                                          |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------ |
| rpc                                            | String | Remote procedural call URL.                                                          |
| from<mark style="color:red;">\*</mark>         | String | Address of the sender of the token.                                                  |
| tokenAddress<mark style="color:red;">\*</mark> | String | Address of token.                                                                    |
| amount<mark style="color:red;">\*</mark>       | String | Number of tokens.                                                                    |
| gas                                            | String | Maximum gas limit provided by the sender, for the transaction.                       |
| chainId                                        | 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. |
| gasPriority                                    | String | low, medium, or high.                                                                |

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

```json
{
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "tokenAddress":"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", 
    "gas": "2307200",
    "chainId": "1",
    "amount":"10"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
        "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "value": "0xa",
        "gas": "2307200",
        "data": "0xd0e30db0",
        "referenceId": "2418a38f53a047a6abb50dd26aa34621"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Request" %}
**With gasPriority:**

```json
{
    "from": "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a",
    "tokenAddress":"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", 
    "gas": "2307200",
    "gasPriority":"medium",
    "chainId": "1",
    "amount":"10"
}
```

{% endtab %}

{% tab title="Sample Response" %}
**With gasPriority:**

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0xDeBB1a42a27051FD18d6d6C2055A44d330A4D80a",
        "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "value": "0xa",
        "gas": "2307200",
        "data": "0xd0e30db0",
        "gasPrice": "4126473966",
        "referenceId": "4792b75c3a64401596f7366a0ce5b69a"
    }
}
```

{% endtab %}
{% endtabs %}

### /convertwraptokentobasetoken

Converts wrap token to base token. Currently available on EVM chains.

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

#### Request Body

| Name                                           | Type   | Description                                                                          |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------ |
| rpc                                            | String | Remote procedural call URL.                                                          |
| from<mark style="color:red;">\*</mark>         | String | Address of the sender of the token.                                                  |
| tokenAddress<mark style="color:red;">\*</mark> | String | Address of token.                                                                    |
| amount<mark style="color:red;">\*</mark>       | String | Number of tokens.                                                                    |
| gas                                            | String | Maximum gas limit provided by the sender, for the transaction.                       |
| chainId                                        | 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. |
| gasPriority                                    | String | low, medium, or high.                                                                |

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

```json
{
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "tokenAddress":"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "amount": "5", 
    "gas": "2307200",
    "chainId": "1"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
        "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "value": "0",
        "gas": "2307200",
        "data": "0x2e1a7d4d0000000000000000000000000000000000000000000000000000000000000005",
        "referenceId": "e911c9db36b54dfe889f10875af33fd4"
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Request" %}
**With gasPriority(medium):**

```json
{
    "from": "0xE4c0ddb2695415466be83f2A99b44b043CB55590",
    "tokenAddress":"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "amount": "100000000000",
    "gas": "2307200",
    "gasPriority":"medium",
    "chainId": "1"
}
```

{% endtab %}

{% tab title="Sample Response" %}
**With gasPriority:**

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1",
        "from": "0xE4c0ddb2695415466be83f2A99b44b043CB55590",
        "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "value": "0",
        "gas": "2307200",
        "data": "0x2e1a7d4d000000000000000000000000000000000000000000000000000000174876e800",
        "gasPrice": "4075756054",
        "referenceId": "396438be736f4b13834f3fc095919e70"
    }
}
```

{% endtab %}
{% endtabs %}
