# ERC1155

### /getbalance

Retrieves the number of NFTs held in the owner's account. Currently available on ethereum, polygon, BSC, and avalanche.

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

#### Query Parameters

| Name                                            | Type   | Description                                                                                                                   |
| ----------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------- |
| rpc                                             | String | Remote procedural call URL.                                                                                                   |
| chainId                                         | String | Refer to the [Chain ID ](https://docs.expand.network/ids/chain-ids)page for details.                                          |
| chainSymbol                                     | String | <p>Refer to the <a href="../../ids/chain-ids">Chain ID </a>page for details.</p><p>Chain Symbols: eth, bsc, avax, matic. </p> |
| nftCollection<mark style="color:red;">\*</mark> | String | NFT collection address                                                                                                        |
| address<mark style="color:red;">\*</mark>       | String | User's account address                                                                                                        |
| nftProtocolId                                   | String | <p>721/1155 standard choice</p><p>by default it is 721</p>                                                                    |
| tokenId<mark style="color:red;">\*</mark>       | String | Id of the token                                                                                                               |

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

```url
https://api.expand.network/nft/getbalance?nftProtocolId=1155&nftCollection=0x6d4bbC0387dD4759EEe30f6A482AC6dC2Df3Facf&address=0x41e8BF3d9288EdDAcc3206f9aB21b61A1c59Df31&tokenId=1&chainId=1
```

{% endtab %}

{% tab title="Sample Response" %}

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

{% endtab %}
{% endtabs %}

### /historicaltransactions

&#x20;Retrieves past transactions associated with a designated address, sorted based on an NFT token contract, and limited within a specific block range. Currently available on ethereum.

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

#### Query Parameters

| Name                                            | Type   | Description                                                                          |
| ----------------------------------------------- | ------ | ------------------------------------------------------------------------------------ |
| rpc                                             | String | Remote procedural call URL.                                                          |
| 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. |
| nftCollection<mark style="color:red;">\*</mark> | String | NFT collection address                                                               |
| nftProtocolId                                   | String | <p>721/1155 standard choice</p><p>by Default 721</p>                                 |
| startBlock                                      | String | <p>starting block of the range</p><p>by Default: latestBlock -100</p>                |
| page                                            | String | <p>page no to get</p><p>by Default 1</p>                                             |
| endBlock                                        | String | <p>end block of the range</p><p>by Default: latestBlock</p>                          |
| sort                                            | String | <p>asc/desc</p><p>by Default  desc</p>                                               |

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

```url
https://api.expand.network/nft/historicaltransactions?chainId=1&nftProtocolId=1155&startBlock=0&nftCollection=0x6Fc436606771bA2Cff576695FE9CA04D8D95d4ec&page=1&sort=desc
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "transactions": [
            {
                "blockNumber": "17594313",
                "timeStamp": "1688155067",
                "hash": "0x8415c34fe5a21ed999b5deb2d82d24c92a579ac8201f0a74e69991bc88a2d1c2",
                "nonce": "71",
                "blockHash": "0x2925fc992c4239963b0a4af6d76221989f7df37ccc36fc8da502f5b7139d417e",
                "transactionIndex": "86",
                "gas": "77951",
                "gasPrice": "28151909699",
                "gasUsed": "72436",
                "cumulativeGasUsed": "12259715",
                "input": "deprecated",
                "contractAddress": "0x6fc436606771ba2cff576695fe9ca04d8d95d4ec",
                "from": "0xe4de48c4abc7e97c64cea4788edf1434e2463d93",
                "to": "0xfc40dcc9ab7dd6ffa62abd82ad7b913c180f08c5",
                "tokenID": "37",
                "tokenValue": "1",
                "tokenName": "EnigmaNFT1155",
                "tokenSymbol": "NFT1155",
                "confirmations": "1374518",
                "methodId": "0xf242432a",
                "methodSignature": "safeTransferFrom(address,address,uint256,uint256,bytes)"
            },
            ...
        ]
    }

```

{% endtab %}
{% endtabs %}

### /historicallogs

Retrieves historical logs for any nftCollection. Currently available on ethereum.

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

#### Query Parameters

| Name                                            | Type   | Description                                                                          |
| ----------------------------------------------- | ------ | ------------------------------------------------------------------------------------ |
| rpc                                             | String | Remote procedural call URL.                                                          |
| 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. |
| nftCollection<mark style="color:red;">\*</mark> | String | NFT collection address                                                               |
| nftProtocolId                                   | String | <p>721/1155 standard choice</p><p>by Default 721</p>                                 |
| startBlock                                      | String | <p>starting block of the range</p><p>by Default: latestBlock -100</p>                |
| page                                            | String | <p>page no to get</p><p>by Default 1</p>                                             |
| endBlock                                        | String | <p>end block of the range</p><p>by Default: latestBlock</p>                          |
| type<mark style="color:red;">\*</mark>          | String | ERC1155: ApprovalForAll,TransferSingle                                               |

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

```url
https://api.expand.network/nft/historicallogs?nftCollection=0x6d4bbC0387dD4759EEe30f6A482AC6dC2Df3Facf&chainId=1&type=ApprovalForAll&nftProtocolId=1155&startBlock=17046490&endBlock=17151713
```

{% endtab %}

{% tab title="Sample Response" %}

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "status": 200,
    "msg": "success",
    "data": {
        "logs": [
            {
                "address": "0x6d4bbc0387dd4759eee30f6a482ac6dc2df3facf",
                "topics": [
                    "0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31",
                    "0x0000000000000000000000004525aead5112662d8c117d1d27433bac9abc2029",
                    "0x0000000000000000000000004fee7b061c97c9c496b01dbce9cdb10c02f0a0be"
                ],
                "params": {},
                "data": "0x0000000000000000000000000000000000000000000000000000000000000001",
                "blockNumber": "17046490",
                "blockHash": "0x1b78ea8731de05cee7073e5d22c4b2196acbfbba3358677e593a43efd3c27664",
                "timeStamp": "1681488623",
                "gasPrice": "32423597367",
                "gasUsed": "46718",
                "logIndex": "300",
                "transactionHash": "0xf1558666d8a5ec595d6ef0431cc9e7801faf2b57671052e2c917019b9228b646",
                "transactionIndex": "144"
            },
          ]
        }
    }
</code></pre>

{% endtab %}
{% endtabs %}
