KomodoPlatform / komodo-defi-framework

This is the official Komodo DeFi Framework repository
https://komodoplatform.com/en/docs/komodo-defi-framework/
104 stars 94 forks source link

More information about KMD rewards #676

Closed tonymorony closed 4 years ago

tonymorony commented 4 years ago

essential info for that: KMD utxos structure, locktimes presistance and expiration time. Should simplify this infromation reflection in GUI and prevent the cases when rewards already stopped to accure (at the moment after 30 days) but user don't know about that, or when user don't have locktime on his UTXO(s) or when his balance is >10 but particular UTXOs size <10 so he is not accuring rewards

artemii235 commented 4 years ago

Thanks for creating the issue! It is worth to implement for sure, let's discuss the time frame on meetup.

tonymorony commented 4 years ago

https://github.com/VerusCoin/Agama/releases Verus Agama "Claim rewards" page can be used as a good ref. of what info GUI need for information displaying about:

a) amount of utxos b) size of utxos c) infomratrion on if locktime set d) amount of accured rewards e) timer for rewards accuring stop for given UTXO

artemii235 commented 4 years ago

Expected API reference:

  1. Method name kmd_rewards_info.
  2. Works only when KMD is activated.
  3. Input arguments: no.
  4. Expected output (subject to change):
    {
    "result":[{
    "tx_hash":"UTXO_HASH",
    "index":"UTXO_POSITION",
    "utxo_amount":"11.0",
    "locktime":timestamp,
    "accrued_rewards":"0.0001",
    "accrue_stop_at":timestamp
    },...]
    }

It might worth to add more info to output, let's discuss it.

sergeyboyko0791 commented 4 years ago

@tonymorony please test the functional.

RPC method: "kmd_rewards_info",

RPC response: { "result": [ { "tx_hash": String, // unspent output TX hash "height": Option, // if the transaction is mined already "amount": u64, "locktime": timestamp, "accrued_rewards": u64, "accrue_stop_at": Option // if the transaction is mined already }, .... ] }