dappnode / mev-sp-oracle

3 stars 1 forks source link

Add `memory/validator/<valindices>` endpoint changes #211

Closed Marketen closed 10 months ago

Marketen commented 10 months ago

Now, the API endpoint memory/validator/<index> accepts more than one index: memory/validator/<index1, index2...> .

Found validators are returned in found_validators array. Not found validators are returned in not_found_validators array.

This PR also converts the big numbers returned in the endpoint to a string. This was not done before and it is done in other endpoints like memory/validators

An example response looks like this:

{
  "found_validators": [
    {
      "status": "active",
      "accumulated_rewards_wei": "0",
      "pending_rewards_wei": "80667772449989460",
      "collateral_wei": "80000000000000000",
      "withdrawal_address": "0x9b3b13d6b6f3f52154a8b00d818392b61e4b42b4",
      "validator_index": 656445,
      "validator_key": "0x8ec1534649a99c26da8a939c8b1ebe04f8da3ef05c2fa1a6cd221efd308478ec6d235e0cdbf61357de4c4d995dc57219",
      "subscription_type": "manual"
    }
  ],
  "not_found_validators": [
    "128"
  ]
}