# Near

<details>

<summary>Supported Mainnnet Tokens for Portfolio Endpoint</summary>

1. Name: **SWEAT** \
   Address: token.sweat
2. Name: **Aurora** \
   Address: aaaaaa20d9e0e2461697782ef11675f668207961.factory.bridge.near
3. Name: **USN** \
   Address: usn
4. Name: **Realis** \
   Address: token.v1.realisnetwork.near
5. Name: **LiNEAR** \
   Address: linear-protocol.near
6. Name: **USD Coin** \
   Address: a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near
7. Name: **Tether USD** \
   Address: usdt.tether-token.near
8. Name: **Wrapped NEAR fungible token** \
   Address: wrap.near
9. Name: **Ref Finance Token** \
   Address: token.v2.ref-finance.near
10. Name: **Tether USD** \
    Address: dac17f958d2ee523a2206206994597c13d831ec7.factory.bridge.near
11. Name: **Staked NEAR** \
    Address: meta-pool.near
12. Name: **Ether** \
    Address: aurora
13. Name: **Octopus Network Token** \
    Address: f5cfbc74057c610c8ef151a439252680ac68c6dc.factory.bridge.near
14. Name: **Dai Stablecoin** \
    Address: 6b175474e89094c44da98b954eedeac495271d0f.factory.bridge.near
15. Name: **Wrapped BTC** \
    Address: 2260fac5e5542a773aa44fbcfedf7c193bc2c599.factory.bridge.near
16. Name: **Meta Token** \
    Address: meta-token.near
17. Name: **Aurigami Token** \
    Address: 1ab43204a195a0fd37edec621482afd3792ef90b.factory.bridge.near
18. Name: **Pulse** \
    Address: 52a047ee205701895ee06a375492490ec9c597ce.factory.bridge.near
19. Name: **PembRock** \
    Address: token.pembrock.near
20. Name: **SeatlabNFT** \
    Address: token.stlb.near
21. Name: **Burrow Token** \
    Address: token.burrow\.near
22. Name: **Wootrade Network** \
    Address: 4691937a7508860f876c9c0a2a617e7d9e945d4b.factory.bridge.near
23. Name: **HAPI** \
    Address: d9c2d319cd7e6177336b0a9c93c21cb48d84fb54.factory.bridge.near
24. Name: **PARAS** \
    Address: token.paras.near
25. Name: **Skyward Finance Token** \
    Address: token.skyward.near
26. Name: **NearPad Token** \
    Address: ea7cc765ebc94c4805e3bff28d7e4ae48d06468a.factory.bridge.near
27. Name: **Flux Token** \
    Address: 3ea8ea4237344c9931214796d9417af1a1180770.factory.bridge.near
28. Name: **YouMinter** \
    Address: e99de844ef3ef72806cf006224ef3b813e82662f.factory.bridge.near
29. Name: **Frax Share** \
    Address: 3432b6a60d23ca0dfca7761b7ab56459d9c964d0.factory.bridge.near
30. Name: **NEKO** \
    Address: ftv2.nekotoken.near
31. Name: **ABR** \
    Address: abr.a11bd.near
32. Name: **Bastion** \
    Address: 059a1f1dea1020297588c316ffc30a58a1a0d4a2.factory.bridge.near
33. Name: **Celo** \
    Address: celo.token.a11bd.near
34. Name: **Stader** \
    Address: 30d20208d987713f46dfd34ef128bb16c404d10f.factory.bridge.near
35. Name: **Wrapped Ether** \
    Address: c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.factory.bridge.near
36. Name: **1MILNFT** \
    Address: a4ef4b0b23c1fc81d3f9ecf93510e64f58a4a016.factory.bridge.near
37. Name: **Solana** \
    Address: sol.token.a11bd.near
38. Name: **marma j token** \
    Address: marmaj.tkn.near
39. Name: **Chronicle** \
    Address: 06a00715e6f92210af9d7680b584931faf71a833.factory.bridge.near
40. Name: **Huobi BTC** \
    Address: 0316eb71485b0ab14103307bf65a021042c6d380.factory.bridge.near
41. Name: **Frax** \
    Address: 853d955acef822db058eb8505911ed77f175b99e.factory.bridge.near
42. Name: **BlocksquareToken** \
    Address: 509a38b7a1cc0dcd83aa9d06214663d9ec7c7f4a.factory.bridge.near
43. Name: **DODO bird** \
    Address: 43dfc4159d86f3a37a5a4b3d4580b888ad7d4ddd.factory.bridge.near
44. Name: **Celo Dollar** \
    Address: cusd.token.a11bd.near
45. Name: **Basic Attention Token** \
    Address: 0d8775f648430679a709e98d2b0cb6250d2887ef.factory.bridge.near
46. Name: **CRO** \
    Address: a0b73e1ff0b80914ab6fe0444e65848c4c34450b.factory.bridge.near
47. Name: **Crafting Finance** \
    Address: 508df5aa4746be37b5b6a69684dfd8bdc322219d.factory.bridge.near
48. Name: **moda** \
    Address: 1117ac6ad6cdf1a3bc543bad3b133724620522d5.factory.bridge.near
49. Name: **Uniswap**\
    Address: 1f9840a85d5af5bf1d1762f925bdaddc4201f984.factory.bridge.near
50. Name: **Scamfari** \
    Address: 8353b92201f19b4812eee32efd325f7ede123718.factory.bridge.near

</details>

### /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 ](/ids/chain-ids.md)page for details. |
| chainSymbol                                 | String | Refer to the [Chain ID ](/ids/chain-ids.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.                  |
| networkId<mark style="color:red;">\*</mark> | String | Contains the network Id (testnet or mainnet).                |

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

```url
https://api.expand.network/chain/getbalance/?address=app.nearcrowd.near&chainId=1200
```

{% endtab %}

{% tab title="Sample Response" %}

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

{% 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 ](/ids/chain-ids.md)page for details. |
| chainSymbol                                   | String | Refer to the [Chain ID ](/ids/chain-ids.md)page for details. |
| blockNumber<mark style="color:red;">\*</mark> | String | The block number or block hash.                              |
| networkId                                     | String | Contains the network Id (testnet or mainnet).                |

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

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

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "difficulty": null,
        "gasLimit": null,
        "gasUsed": "100000000",
        "hash": "EH2EUAcfQuVtwgjbSy1cYSWxTqnuoE6hB7Qs3yUkwtTi",
        "miner": null,
        "nonce": null,
        "number": "48208733",
        "parentHash": "A4DPUSm6WCm34LTRLHrmVdVDobC37PjHqACd2srWGXeQ",
        "size": null,
        "timestamp": 1632130984114315800,
        "totalDifficulty": null,
        "transactions": [
            {
                "balance_burnt": "4794491933184300000000",
                "chunk_hash": "J4SbJiazEWAHnNLHTEq6FvCQbfNP2zoQjeUXDhJ7sDPz",
                "encoded_length": 3630,
                "encoded_merkle_root": "CegYTGt7DA7RTmAAvH7Vr4ZLdzocMXN4AYzZPmcp7P1m",
                "gas_limit": 1000000000000000,
                "gas_used": 64561954584952,
                "height_created": 48208733,
                "height_included": 48208733,
                "outcome_root": "81Ces8UVPcU2KqHJs3Pa3vJWgHZDyh8stsUfrPYRY3jo",
                "outgoing_receipts_root": "Fq3y8c1vT5E6erZL6VwNegmcbXMUsozfychmFDhiHpie",
                "prev_block_hash": "A4DPUSm6WCm34LTRLHrmVdVDobC37PjHqACd2srWGXeQ",
                "prev_state_root": "2MLkUCQj4sHVGuVTqwKgTh47Q1fsGSXBc2RSopEUzFx2",
                "rent_paid": "0",
                "shard_id": 0,
                "signature": "ed25519:35FPeXGCemZeajdr1D99LGFAibHZNpGQY5LPt5N3aAYxT3xqZyTSJ6S8CxTvRqxMBGnrDz7WALVLcksmdjkrHNvh",
                "tx_root": "6RyWHXk3ygrJTWUvF1BC955Fo2oC1HXKZJKp6daXFSes",
                "validator_proposals": [],
                "validator_reward": "0"
            }
        ],
        "transactionsRoot": "HDgRo5ZfnEW49HbYK6FrVzovDKvxDnexTvsNHmKtkXT2",
        "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 ](/ids/chain-ids.md)page for details. |
| chainSymbol                                       | String | Refer to the [Chain ID ](/ids/chain-ids.md)page for details. |
| transactionHash<mark style="color:red;">\*</mark> | String | The transaction Hash.                                        |
| networkId<mark style="color:red;">\*</mark>       | String | Contains the network Id (testnet or mainnet).                |

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

```url
https://api.expand.network/chain/gettransaction?chainId=1200&transactionHash=28CYUY3Jcmjjy19rx5x4GUp7kWKSuxgTuzsnm6WbjqgR
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "hash": "28CYUY3Jcmjjy19rx5x4GUp7kWKSuxgTuzsnm6WbjqgR",
        "blockNumber": "D2rC8zK6JkFDXuewMH3g15S71whhjJ6arr6ATHLXGQUF",
        "timestamp": null,
        "from": "app.nearcrowd.near",
        "to": "app.nearcrowd.near",
        "value": null,
        "transactionFees": 2428517994378,
        "gas": null,
        "gasPrice": null,
        "input": [
            {
                "FunctionCall": {
                    "args": "eyJ0YXNrX29yZGluYWwiOjEsImlzX2hvbmV5cG90IjpmYWxzZSwiaG9uZXlwb3RfcHJlaW1hZ2UiOlsxMDQsOTksMTAzLDExMCwxMTMsMTA4LDExMiwxMTEsMTA4LDExOCwxMDYsOTgsMTE5LDExNSwxMjEsMTE5XSwidGFza19wcmVpbWFnZSI6WzcwLDU3LDIwMSwxMjQsMTE0LDI0NSwxMjQsMTk1LDE5MiwxOTYsMzAsMjM5LDIyMCw0NywxODgsNTQsMTIxLDk1LDM2LDIxMywxNzEsMTI5LDEwMCw1MSwxODMsNjQsMjgsMTI2LDExNSwxMjEsMjQxLDEzNl19",
                    "deposit": "0",
                    "gas": 200000000000000,
                    "method_name": "challenge"
                }
            }
        ],
        "network": null
    }
}
```

{% endtab %}
{% endtabs %}

### /portfolio

Get the comprehensive information about the assets/ tokens owned by a user.

<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 ](/ids/chain-ids.md)page for details.                  |
| chainSymbol                               | String  | Refer to the [Chain ID ](/ids/chain-ids.md)page for details.                  |
| address<mark style="color:red;">\*</mark> | String  | Public addess of the user.                                                    |
| tokens                                    | String  | Comma-separated value of tokens to get value of. Maximum 10 at a time.        |
| availableOnly                             | Boolean | <p>By default, true. <br>If true, tokens with balance > 0 will be listed.</p> |

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

```url
https://api.expand.network/chain/portfolio?chainId=1200&address=spin.sweat&availableOnly=true
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "native": "657102532292146469652654940",
        "nep141": [
            {
                "name": "SWEAT",
                "symbol": "SWEAT",
                "address": "token.sweat",
                "balance": "4478246379997954161168780",
                "USDPrice": "0.009696888755975658"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

### **/**&#x67;etstakepositions

This endpoint retrieves information about staked native asset positions for a specified address, including the total staked amount across all validators as well as the individual positions staked with each validator.

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

#### Query Parameters

<table><thead><tr><th width="180">Name</th><th width="99">Type</th><th>Description</th></tr></thead><tbody><tr><td>rpc</td><td>String</td><td>Remote procedural call URL.</td></tr><tr><td>chainId<mark style="color:red;">*</mark></td><td>String</td><td>Refer to the <a href="/pages/5o1xMsQPqXw9GBfGTpdB">Chain ID </a>page for details.</td></tr><tr><td>chainSymbol</td><td>String</td><td>Refer to the <a href="/pages/5o1xMsQPqXw9GBfGTpdB">Chain ID </a>page for details.</td></tr><tr><td>address<mark style="color:red;">*</mark></td><td>String</td><td>Public addess of the user.</td></tr><tr><td>validatorAddress</td><td>String</td><td>Address of Validator</td></tr></tbody></table>

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

```url
https://api.expand.network/chain/getstakepositions?address=5d405172e96927a7a6de6ec95c3879345a47b3c0cf6d97653d76c61f5c1262b9&chainId=1200&validatorAddress=astro-stakers.poolv1.near
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "activeStake": "2.902585808691909e+25",
        "stakePositions": [
            {
                "stake": "2.902585808691909e+25",
                "staker": "5d405172e96927a7a6de6ec95c3879345a47b3c0cf6d97653d76c61f5c1262b9",
                "withdrawer": "5d405172e96927a7a6de6ec95c3879345a47b3c0cf6d97653d76c61f5c1262b9",
                "validator": "astro-stakers.poolv1.near"
            }
        ]
    }
}
```

{% 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>        | Integer | Refer to the [Chain ID ](/ids/chain-ids.md)page for details. |
| chainSymbol                                      | String  | Refer to the [Chain ID ](/ids/chain-ids.md)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": "1200",
    "rawTransaction": "FAAAAG1hZGh1dXV1dXV1ci50ZXN0bmV0AEkY3+wQ0vYMKdwUWiNMqpXqdeiHfeC+xzYEoSqBUbe8TokHDDheAAAUAAAAbXl0ZXN0bWFkaHVyLnRlc3RuZXQgoucUF/0pEF1+QF3rfhesMNR8DoSo9kOwUtA8jxglZgEAAAADAABAvYtbk2tsAAAAAAAAAADmi3KGo3Rw3x4pIwf/oub5d1VdfIcrgeEOgOBRs9qnXm3zZ4UQzheNJZ3om271QiMXw0hK/lFQMEWtKGOK8Z0A"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "chainId": "1200",
        "transactionHash": "FVgzzKafnM8FT6y3r86s2nDCyYbiqkEsFrZ6371b3uxs"
    }
}
```

{% endtab %}
{% endtabs %}

### /decodetransaction

Get the decoded transaction for the provided raw transaction.&#x20;

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

#### Request Body

| Name                                             | Type   | Description                                                                        |
| ------------------------------------------------ | ------ | ---------------------------------------------------------------------------------- |
| chainId<mark style="color:red;">\*</mark>        | String | Refer to the [Chain ID ](/ids/chain-ids.md)page for details. By default, Ethereum. |
| chainSymbol                                      | String | Refer to the [Chain ID ](/ids/chain-ids.md)page for details.                       |
| rawTransaction<mark style="color:red;">\*</mark> | String | The raw transaction to be given for decoding.                                      |

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

```json
{
    "chainId": "1200",
    "rawTransaction": "EQAAAGhrMTY0NjQ1NS50ZXN0bmV0AI5NZ/HOf9Z3lhnFXWzGKLlpQquoZ0koM9NwA6pyady3wVPUJFiBAAARAAAAaGsxNjQ2NDU1LnRlc3RuZXRRcSU8anY2BbU3Hdp6nFc800OP06VcXt9Y6zi7bNKS6wEAAAADAADoiQQjx4oAAAAAAAAAAACFkU6wouNgPzyGby4Ab7qs8YLUuTmgLVoihNVoUp/pNTyZT/5TC6ozr2tAIfbMxmrAEzqpxqZFEgd/p0U+zfoC"
}
```

{% endtab %}

{% tab title="Sample Response" %}

```json
{
    "status": 200,
    "msg": "success",
    "data": {
        "parsedTx": {
            "transaction": {
                "signerId": "hk1646455.testnet",
                "publicKey": {
                    "keyType": 0,
                    "data": {
                        "0": 142,
                        "1": 77,
                        "2": 103,
                        "3": 241,
                        "4": 206,
                        "5": 127,
                        "6": 214,
                        "7": 119,
                        "8": 150,
                        "9": 25,
                        "10": 197,
                        "11": 93,
                        "12": 108,
                        "13": 198,
                        "14": 40,
                        "15": 185,
                        "16": 105,
                        "17": 66,
                        "18": 171,
                        "19": 168,
                        "20": 103,
                        "21": 73,
                        "22": 40,
                        "23": 51,
                        "24": 211,
                        "25": 112,
                        "26": 3,
                        "27": 170,
                        "28": 114,
                        "29": 105,
                        "30": 220,
                        "31": 183
                    }
                },
                "nonce": "815824d453c1",
                "receiverId": "hk1646455.testnet",
                "blockHash": {
                    "0": 81,
                    "1": 113,
                    "2": 37,
                    "3": 60,
                    "4": 106,
                    "5": 118,
                    "6": 54,
                    "7": 5,
                    "8": 181,
                    "9": 55,
                    "10": 29,
                    "11": 218,
                    "12": 122,
                    "13": 156,
                    "14": 87,
                    "15": 60,
                    "16": 211,
                    "17": 67,
                    "18": 143,
                    "19": 211,
                    "20": 165,
                    "21": 92,
                    "22": 94,
                    "23": 223,
                    "24": 88,
                    "25": 235,
                    "26": 56,
                    "27": 187,
                    "28": 108,
                    "29": 210,
                    "30": 146,
                    "31": 235
                },
                "actions": [
                    {
                        "transfer": {
                            "deposit": "8ac7230489e80000"
                        },
                        "enum": "transfer"
                    }
                ]
            },
            "signature": {
                "keyType": 0,
                "data": {
                    "0": 133,
                    "1": 145,
                    "2": 78,
                    "3": 176,
                    "4": 162,
                    "5": 227,
                    "6": 96,
                    "7": 63,
                    "8": 60,
                    "9": 134,
                    "10": 111,
                    "11": 46,
                    "12": 0,
                    "13": 111,
                    "14": 186,
                    "15": 172,
                    "16": 241,
                    "17": 130,
                    "18": 212,
                    "19": 185,
                    "20": 57,
                    "21": 160,
                    "22": 45,
                    "23": 90,
                    "24": 34,
                    "25": 132,
                    "26": 213,
                    "27": 104,
                    "28": 82,
                    "29": 159,
                    "30": 233,
                    "31": 53,
                    "32": 60,
                    "33": 153,
                    "34": 79,
                    "35": 254,
                    "36": 83,
                    "37": 11,
                    "38": 170,
                    "39": 51,
                    "40": 175,
                    "41": 107,
                    "42": 64,
                    "43": 33,
                    "44": 246,
                    "45": 204,
                    "46": 198,
                    "47": 106,
                    "48": 192,
                    "49": 19,
                    "50": 58,
                    "51": 169,
                    "52": 198,
                    "53": 166,
                    "54": 69,
                    "55": 18,
                    "56": 7,
                    "57": 127,
                    "58": 167,
                    "59": 69,
                    "60": 62,
                    "61": 205,
                    "62": 250,
                    "63": 2
                }
            }
        }
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.expand.network/integrations/blockchains/non-evm-based-chains/near.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
