oasisprotocol / nexus

Official indexer for the Oasis Network.
Apache License 2.0
15 stars 4 forks source link

api: Include validator's shares under escrow #751

Open aefhm opened 1 month ago

aefhm commented 1 month ago
SUMMARY

API user should be able to make a request for a particular validator pool's shares as well as amount.

curl "https://nexus.oasis.io/v1/consensus/validators/oasis1qq3xrq0urs8qcffhvmhfhz4p0mu7ewc8rscnlwxe" | jq

{
  "active": true,
  "current_commission_bound": {
    "epoch_end": 0,
    "epoch_start": 0,
    "lower": 0,
    "upper": 20000
  },
  "current_rate": 5000,
  "entity_address": "oasis1qq3xrq0urs8qcffhvmhfhz4p0mu7ewc8rscnlwxe",
  "entity_id": "eZuacXy5s3/nolB/E3gF4vqUYdvfOlVaaBXGfZcGwKc=",
  "escrow": "183178293673959461",
  "media": {
    "name": "stakefish"
  },
  "node_id": "SQZZd1wsWXdFsqswUoh6hZtmzu+ejuSnrGeHtgIBJDo=",
  "status": true
}

returns the escrow which is total amount but not shares.

ISSUE TYPE
COMPONENT NAME

API and potentially analyzer if this information is not already indexed.

ADDITIONAL INFORMATION

At least one partner would like to make a single API request to obtain necessary information such as total number of shares in escrow pool.

aefhm commented 1 month ago

@Andrew7234 pointed out that the delegation object has this on an individual basis. https://github.com/oasisprotocol/nexus/blob/09ffeb48fb72a610c3fc827b057b90cf269cd62b/api/spec/v1.yaml#L1410-L1415

aefhm commented 1 month ago

Partner was unblocked. We can deprioritize this.