Address

APIs to obtain address related details

Asset Type

Native Asset

1. Get address balance by token type

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":""
		}
	]
}

2. Get address balance by asset name

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":""
		}
	]
}

3. Get address balance by contract hash

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":""
		}
	]
}

4. Get transaction list by address and page

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":""
					}
				]
			}
		]
}

5. Get transaction list by address and time

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":""
					}
				]
			}
    ]
}

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

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":""
					}
				]
			}
    	]
}

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

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":""
					}
				]
			}
    ]
}

8. Get staking information in all nodes by address

url:/v2/addresses/{address}/staking-info
method:GET
  • request:

  • response:

{
    "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
        }
    ]
}

Last updated