> For the complete documentation index, see [llms.txt](https://docs.ont.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ont.io/developer-tools/api/explorer-api/address.md).

# Address

## **Asset Type**

|  Asset | Type   | Description                          |
| :----: | ------ | ------------------------------------ |
|  OEP4  | String | oep4 asset                           |
|  OEP5  | String | oep5 asset                           |
|  OEP8  | String | oep8 asset                           |
| Native | String | ont, ong, waitbound ong, unbound ong |

## **Native Asset**

|     Value    | Type   | Description   |
| :----------: | ------ | ------------- |
|      ont     | String | ont           |
|      ong     | String | ong           |
| waitboundong | String | waitbound ong |
|  unboundong  | String | unbound ong   |

## 1. Get address balance by token type

```javascript
jsurl：/v2/addresses/{address}/{token_type}/balances, 
method：GET, 
successResponse：{
    "code":0, 
    "msg":"SUCCESS", 
    "result":[
		{
			"balance": "138172.922008484", 
			"asset_name": "ong", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"balance": "14006.83021186", 
			"asset_name": "waitboundong", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"balance": "71472.14798338", 
			"asset_name": "unboundong", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"balance": "8637767", 
			"asset_name": "ont", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"asset_name": "pumpkin01", 
			"balance": "7", 
			"asset_type":"oep8", 
            "contract_hash":""
		}, 
		{
			"asset_name": "TNT", 
			"balance": "19888", 
			"asset_type":"oep4", 
            "contract_hash":""
		}, 
		{
			"asset_name": "HyperDragons:2", 
			"balance": "3", 
			"asset_type":"oep5", 
            "contract_hash":""
		}
	]
}
```

| URL Field   | Type   | Description                                                  |
| ----------- | ------ | ------------------------------------------------------------ |
| address     | String | address                                                      |
| token\_type | String | oep4\|OEP4\|oep5\|OEP5\|oep8\|OEP8\|native\|NATIVE\|all\|ALL |

| ResponseField  | Type   | Description                         |
| -------------- | ------ | ----------------------------------- |
| asset\_name    | String | asset name                          |
| balance        | String | balance                             |
| asset\_type    | String | asset type：oep4, oep5, oep8, native |
| contract\_hash | String | contract hash                       |

## 2. Get address balance by asset name

```javascript
url：/v2/addresses/{address}/balances?asset_name={assetName}, 
method：GET, 
successResponse：{
    "code":0, 
    "msg":"SUCCESS", 
    "result":[
		{
			"balance": "138172.922008484", 
			"asset_name": "ong", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"balance": "14006.83021186", 
			"asset_name": "waitboundong", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"balance": "71472.14798338", 
			"asset_name": "unboundong", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"balance": "8637767", 
			"asset_name": "ont", 
			"asset_type":"native", 
            "contract_hash":""
		}
	]
}
```

| URL Field | Type   | Description                                        |
| --------- | ------ | -------------------------------------------------- |
| address   | String | address                                            |
| assetName | String | <p>asset name.<br>ong, ont or oep token symbol</p> |

| ResponseField  | Type   | Description                         |
| -------------- | ------ | ----------------------------------- |
| asset\_name    | String | asset name                          |
| balance        | String | balance                             |
| asset\_type    | String | asset type：oep4, oep5, oep8, native |
| contract\_hash | String | contract hash                       |

## 3. Get address balance by contract hash

```javascript
url：/v2/addresses/{address}/balances?contract_hash={contractHash}, 
method：GET, 
successResponse：{
    "code":0, 
    "msg":"SUCCESS", 
    "result":[
		{
			"balance": "138172.922008484", 
			"asset_name": "ong", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"balance": "14006.83021186", 
			"asset_name": "waitboundong", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"balance": "71472.14798338", 
			"asset_name": "unboundong", 
			"asset_type":"native", 
            "contract_hash":""
		}, 
		{
			"balance": "8637767", 
			"asset_name": "ont", 
			"asset_type":"native", 
            "contract_hash":""
		}
	]
}
```

| URL Field    | Type   | Description   |
| ------------ | ------ | ------------- |
| address      | String | address       |
| contractHash | String | contract hash |

| ResponseField  | Type   | Description                         |
| -------------- | ------ | ----------------------------------- |
| asset\_name    | String | asset name                          |
| balance        | String | balance                             |
| asset\_type    | String | asset type：oep4, oep5, oep8, native |
| contract\_hash | String | contract Hash                       |

## 4. Get transaction list by address and page

```javascript
url：/v2/addresses/{address}/transactions?page_size=10&page_number=1, 
method：GET, 
successResponse：{
    "code":0, 
    "msg":"SUCCESS", 
    "result":[
			{
				"tx_hash":"09e599ecde6ee....55239e1b1bd291558e5a6ef3fa", 
				"confirm_flag":1, 
				"tx_type":208, 
				"tx_time":1522207168, 
				"block_height":11, 
				"fee":"0.01", 
				"block_index":1, 
				"transfers": [
					{
                        "amount": "2.01", 
                        "from_address":"Aege6VvWEiKauFa2ngrtwdXt8FeGkWNPRH", 
                        "to_address":"ATUD7W6t6tLPGgd8H9tCN6Kwkb9WKFddch", 
                        "asset_name":"ont", 
                        "contract_hash":""
					}, 
                    {
                        "amount": "0.01", 
                        "from_address":"Aege6VvWEiKauFa2ngrtwdXt8FeGkWNPRH", 
                        "to_address":"ATUD7W6t6tLPGgd8H9tCN6Kwkb9WKFddch", 
                        "asset_name":"ong", 
                        "contract_hash":""
					}
				]
			}
		]
}
```

| Url RequestField | Type   | Description                                                               |
| ---------------- | ------ | ------------------------------------------------------------------------- |
| address          | String | address                                                                   |
| page\_size       | int    | number of records in one page (The page size is limited between 1 and 20) |
| page\_number     | int    | number of the page (At least 1 or greater)                                |

| ResponseField            | Type   | Description                                              |
| ------------------------ | ------ | -------------------------------------------------------- |
| tx\_hash                 | String | transaction hash                                         |
| confirm\_flag            | int    | transaction state on the blockchain, 1:success 0:failure |
| block\_height            | int    | block height                                             |
| tx\_type                 | int    | (208/209/210)                                            |
| tx\_time                 | int    | UNIX time of the transaction                             |
| fee                      | String | fee                                                      |
| block\_index             | int    | index in the block                                       |
| transfers.from\_address  | String | from\_address                                            |
| transfers.to\_address    | String | to\_address                                              |
| transfers.amount         | String | amount                                                   |
| transfers.asset\_name    | String | asset name                                               |
| transfers.contract\_hash | String | contract hash                                            |

## 5. Get transaction list by address and time

```javascript
url：/v2/addresses/{address}/transactions?begin_time=1556017050&end_time=1556017250, 
method：GET, 
successResponse：{
    "code":0, 
    "msg":"SUCCESS", 
    "result":[
			{
				"tx_hash":"09e599ecde6ee....55239e1b1bd291558e5a6ef3fa", 
				"confirm_flag":1, 
				"tx_type":208, 
				"tx_time":1522207168, 
				"block_height":11, 
				"fee":"0.01", 
				"block_index":1, 
				"transfers": [
					{
                        "amount": "2.01", 
                        "from_address":"Aege6VvWEiKauFa2ngrtwdXt8FeGkWNPRH", 
                        "to_address":"ATUD7W6t6tLPGgd8H9tCN6Kwkb9WKFddch", 
                        "asset_name":"ont", 
                        "contract_hash":""
					}, 
                    {
                        "amount": "0.01", 
                        "from_address":"Aege6VvWEiKauFa2ngrtwdXt8FeGkWNPRH", 
                        "to_address":"ATUD7W6t6tLPGgd8H9tCN6Kwkb9WKFddch", 
                        "asset_name":"ong", 
                        "contract_hash":""
					}
				]
			}
    ]
}
```

| Url RequestField | Type   | Description                                                               |
| ---------------- | ------ | ------------------------------------------------------------------------- |
| address          | String | address                                                                   |
| end\_time        | int    | unxi time                                                                 |
| begin\_time      | int    | <p>UNIX time.<br>The maximum time range is <strong>one week</strong>.</p> |

| ResponseField            | Type   | Description                                             |
| ------------------------ | ------ | ------------------------------------------------------- |
| tx\_hash                 | String | transaction hash                                        |
| confirm\_flag            | int    | transaction state on the blockchain,1:success 0:failure |
| block\_height            | int    | block height                                            |
| tx\_type                 | int    | 208 or 209                                              |
| tx\_time                 | int    | UNIX time of the transaction                            |
| fee                      | String | fee                                                     |
| block\_index             | int    | index in the block                                      |
| transfers.from\_address  | String | from\_address                                           |
| transfers.to\_address    | String | to\_address                                             |
| transfers.amount         | String | amount                                                  |
| transfers.asset\_name    | String | asset name                                              |
| transfers.contract\_hash | String | contract hash                                           |

## 6. Get transaction list by address and asset name and page

```javascript
url：/v2/addresses/{address}/{asset_name}/transactions?page_size=10&page_number=1, 
method：GET, 
successResponse：{
    "code":0, 
    "msg":"SUCCESS", 
    "result":[
			{
				"tx_hash":"09e599ecde6ee....55239e1b1bd291558e5a6ef3fa", 
				"confirm_flag":1, 
				"tx_type":208, 
				"tx_time":1522207168, 
				"block_height":11, 
				"fee":"0.01", 
				"block_index":1, 
				"transfers": [
					{
                        "amount": "2.01", 
                        "from_address":"Aege6VvWEiKauFa2ngrtwdXt8FeGkWNPRH", 
                        "to_address":"ATUD7W6t6tLPGgd8H9tCN6Kwkb9WKFddch", 
                        "asset_name":"ont", 
                        "contract_hash":""
					}
				]
			}
    	]
}
```

| Url RequestField | Type   | Description                                                               |
| ---------------- | ------ | ------------------------------------------------------------------------- |
| address          | String | address                                                                   |
| asset\_name      | String | asset name                                                                |
| page\_size       | int    | number of records in one page (The page size is limited between 1 and 20) |
| page\_number     | int    | number of the page (At least 1 or greater)                                |

| ResponseField            | Type   | Description                                             |
| ------------------------ | ------ | ------------------------------------------------------- |
| tx\_hash                 | String | transaction hash                                        |
| confirm\_flag            | int    | transaction state on the blockchain,1:success 0:failure |
| block\_height            | int    | block height                                            |
| tx\_type                 | int    | 208 or 209                                              |
| tx\_time                 | int    | UNIX time of the transaction                            |
| fee                      | String | fee                                                     |
| block\_index             | int    | index in the block                                      |
| transfers.from\_address  | String | from\_address                                           |
| transfers.to\_address    | String | to\_address                                             |
| transfers.amount         | String | amount                                                  |
| transfers.asset\_name    | String | asset name                                              |
| transfers.contract\_hash | String | contract hash                                           |

## 7. Get transaction list by address and asset name and time

```javascript
url：/v2/addresses/{address}/{asset_name}/transactions?begin_time=1556017050&end_time=1556017250, 
method：GET, 
successResponse：{
    "code":0, 
    "msg":"SUCCESS", 
    "result":[
			{
				"tx_hash":"09e599ecde6ee....55239e1b1bd291558e5a6ef3fa", 
				"confirm_flag":1, 
				"tx_type":208, 
				"tx_time":1522207168, 
				"block_height":11, 
				"fee":"0.01", 
				"block_index":1, 
				"transfers": [
					{
                        "amount": "2.01", 
                        "from_address":"Aege6VvWEiKauFa2ngrtwdXt8FeGkWNPRH", 
                        "to_address":"ATUD7W6t6tLPGgd8H9tCN6Kwkb9WKFddch", 
                        "asset_name":"ont", 
                        "contract_hash":""
					}
				]
			}
    ]
}
```

| Url RequestField | Type   | Description                                                              |
| ---------------- | ------ | ------------------------------------------------------------------------ |
| address          | String | address                                                                  |
| asset\_name      | String | asset name                                                               |
| begin\_time      | int    | UNIX time                                                                |
| end\_time        | int    | <p>UNIX time<br>The maximum time range is <strong>one week</strong>.</p> |

| ResponseField            | Type   | Description                                             |
| ------------------------ | ------ | ------------------------------------------------------- |
| tx\_hash                 | String | transaction hash                                        |
| confirm\_flag            | int    | transaction state on the blockchain,1:success 0:failure |
| block\_height            | int    | block height                                            |
| tx\_type                 | int    | 208 or 209                                              |
| tx\_time                 | int    | UNIX time of the transaction                            |
| fee                      | String | fee                                                     |
| block\_index             | int    | index in the block                                      |
| transfers.from\_address  | String | from\_address                                           |
| transfers.to\_address    | String | to\_address                                             |
| transfers.amount         | String | amount                                                  |
| transfers.asset\_name    | String | asset name                                              |
| transfers.contract\_hash | String | contract hash                                           |

## 8. Get staking information in all nodes by address

```
url：/v2/addresses/{address}/staking-info
method：GET
```

* request:

| Field\_Name | Type   | Description    |
| ----------- | ------ | -------------- |
| address     | String | wallet address |

* response：

```markdown
{
    "code": 0,
    "msg": "SUCCESS",
    "result": [
        {
            "node_name": "Phecda (Coinbase Cloud)",
            "node_pub_key": "022e911fb5a20b4b2e4f917f10eb92f27d17cad16b916bce8fd2dd8c11ac2878c0",
            "amount": "200",
            "state": 1
        },
        {
            "node_name": "Merak (Coinbase Cloud)",
            "node_pub_key": "0251f06bc247b1da94ec7d9fe25f5f913cedaecba8524140353b826cf9b1cbd9f4",
            "amount": "500",
            "state": 2
        },
        {
            "node_name": "Dubhe (Coinbase Cloud)",
            "node_pub_key": "02bcdd278a27e4969d48de95d6b7b086b65b8d1d4ff6509e7a9eab364a76115af7",
            "amount": "136",
            "state": 3
        },
        {
            "node_name": "Alkaid",
            "node_pub_key": "03c8f63775536eb420c96228cdccc9de7d80e87f1b562a6eb93c0838064350aa53",
            "amount": "66",
            "state": 4
        }
    ]
}
```

| Field\_Name    | Type   | Description                                            |
| -------------- | ------ | ------------------------------------------------------ |
| node\_name     | String | node name                                              |
| node\_pub\_key | String | node public key                                        |
| amount         | String | ONT amount                                             |
| state          | int    | state: 1-processing;2-staking;3-claimable;4-cancelling |
