trustwallet / blockatlas

Clean and lightweight cross-chain transaction API
MIT License
371 stars 230 forks source link

[Delegations] Add staked balance in delegations response #1180

Closed leoneparise closed 3 years ago

leoneparise commented 4 years ago

Current Functionality

There are some coins that has auto-delegation (ALGO and VET), which the user delegates only by having a balance in their wallets. Take Algorand, for example:

https://blockatlas.trustwallet.com/v2/algorand/staking/delegations/3YE4CLWELB55PL6P4NYOA5U5LYYOOZ567WPSBWTBHCNROMUQTSC4KFDXTM
{
    "delegations": [],
    "balance": "426761906",
    "address": "3YE4CLWELB55PL6P4NYOA5U5LYYOOZ567WPSBWTBHCNROMUQTSC4KFDXTM",
    "coin": {
        "coin": 283,
        "symbol": "ALGO",
        "name": "Algorand",
        "decimals": 6
    },
    "details": {
        "reward": {
            "annual": 6.1
        },
        "locktime": 0,
        "minimum_amount": "0",
        "type": "auto"
    }
}

To support those blockchains we should add a staked balance attribute. staked will be the sum of current delegations or balance for auto-delegated blockchains.

ArtemGoryunov commented 4 years ago

@EnoRage could you take this issue soon?

vikmeup commented 3 years ago

Closing this, clients would be responsible to fetch this data from the node itself