Assume you want to check all the amount in the wallet and assets in multiple account,
Simple python code to check the grand total. Assuming a local wallet is running.
The addresses of all the burst addresses can be in the BurstAddresses file.
Main code , info.py
import time import socket import urllib import urllib2 import json import urllib import urllib2 def connect(url,values): data = urllib.urlencode(values) req = urllib2.Request(url, data) try: response = urllib2.urlopen(req) the_page = response.read() final_data = json.loads(the_page) return final_data except: return 0 file = open("BurstAddresses", "r") addresses = file.readlines() #account_id=input("Account Id:") grand_total_asset_value=0 grand_wallet_value=0 for account_id in addresses: print account_id print("Connecting...") url = 'http://127.0.0.1:8125/burst' values = {'requestType' : 'getAccount', 'account' : account_id} data = connect(url,values) if(data==0): print("Net error!") time.sleep(1) else: total_asset_value=0 for asset in data['assetBalances']: print("") values={'requestType' :'getAsset','asset':asset['asset']} data_asset= connect(url,values) if(data_asset==0): print("Net error!") time.sleep(1) values={'requestType':'getBidOrders','asset':asset['asset'],'lastIndex':'0'} data_bid = connect(url,values) if(data_bid==0): print("Net error!") time.sleep(1) print("asset ID:"+asset['asset']) print("asset name:"+data_asset['name']) asset_bal=float(asset['balanceQNT'])/(10**data_asset['decimals']) print("Qty:"+str(asset_bal)) #print("decimals:"+str(data_asset['decimals'])) try: bid_value=float(data_bid['bidOrders'][0]['priceNQT'])/10**(8-int(data_asset['decimals'])) print("Highest Bid:"+str(bid_value)) asset_value_burst=bid_value * float(asset_bal) print("Value in Burst:"+str(asset_value_burst)) total_asset_value=total_asset_value+float(asset_value_burst) except : print("Highest Bid: None") #balance=float(data['guaranteedBalanceNQT'])/100000000 balance=float(data['unconfirmedBalanceNQT'])/100000000 print("=============================") print("Wallet Balance:"+"{0:.2f}".format(balance)) print("Total Asset Value:"+str(total_asset_value)) print("=============================") values = {'requestType' : 'getBlockchainStatus'} data = connect(url,values) print("Height:"+str(data['lastBlockchainFeederHeight'])) grand_total_asset_value=grand_total_asset_value+total_asset_value grand_wallet_value=grand_wallet_value+balance print("=============GRAND TOTAL============") print("Wallet Balance:"+"{0:.2f}".format(grand_wallet_value)) print("Total Asset Value:"+str(grand_total_asset_value)) print("=============================") print("Net Value:"+str(grand_total_asset_value+grand_wallet_value)) print("=============================")BurstAddresses file
17132087616482062663 10526241997328042230Output
17132087616482062663 Connecting... asset ID:6037211370250490240 asset name:hsassets Qty:51.0 Highest Bid:86.0 Value in Burst:4386.0 ============================= Wallet Balance:218.18 Total Asset Value:4386.0 ============================= Height:340991 =============GRAND TOTAL============ Wallet Balance:218.18 Total Asset Value:4386.0 ============================= Net Value:4604.17629936 ============================= 10526241997328042230 Connecting... asset ID:6037211370250490240 asset name:hsassets Qty:100.0 Highest Bid:86.0 Value in Burst:8600.0 asset ID:16885738494266455518 asset name:SolarGrid Qty:10000.0 Highest Bid: None asset ID:1892701762360056549 asset name:btcdragon Qty:20.0 Highest Bid:70.0001 Value in Burst:1400.002 asset ID:15266167261394017138 asset name:casino Qty:20.0 Highest Bid:473.5 Value in Burst:9470.0 ============================= Wallet Balance:2164.33 Total Asset Value:19470.002 ============================= Height:340991 =============GRAND TOTAL============ Wallet Balance:2382.51 Total Asset Value:23856.002 ============================= Net Value:26238.5088186 =============================