CronCats / query-indexer

ExpressJS server connecting to CronCat indexer Postgres database
0 stars 1 forks source link

Query agent balances #4

Closed nlipartiia-hacken closed 1 year ago

nlipartiia-hacken commented 1 year ago

Closes #3.

Added a new query for agent balances (for now in ujunox only), the result contains two vectors (contract balances and agent's own balances). For example, it may look like this:

{
    "manager-state": [
        {
            "x": "1",
            "y": "14046480"
        },
        {
            "x": "2",
            "y": "14146812"
        },
        {
            "x": "3",
            "y": "14096646"
        }
    ],
    "protocol": [
        {
            "x": "1",
            "y": "5200502"
        },
        {
            "x": "2",
            "y": "5109110"
        },
        {
            "x": "3",
            "y": "5154806"
        }
    ]
}

with x being fk_agent_id, y - balance.