Skip to content

Commit

Permalink
Merge branch 'update-staking-rewards-api' into release-v0.5.15
Browse files Browse the repository at this point in the history
  • Loading branch information
tombeynon committed Feb 12, 2024
2 parents 11648ad + 3e51add commit d30bf8f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions services/servicesMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,15 @@ function ServicesMonitor() {
}
}).json()
const providers = providerResponse.data.rewardOptions
const validators = await client.json.get('validators:' + chain.path, '$') || {}
const validators = await client.json.get('validators:' + chain.path, '$')
if(!validators?.validators) return

const calls = Object.entries(validators.validators).map(([address, validator]) => {
return async () => {
const assetProvider = providers.find(provider => {
return provider.validators.find(el => el.address === address)
})
if (assetProvider) {
if (assetProvider?.providers) {
const provider = assetProvider.providers[0]
await client.json.set('validators:' + chain.path, `$.validators.${address}.services`, {}, { NX: true });
await client.json.set('validators:' + chain.path, `$.validators.${address}.services.staking_rewards`, {
Expand Down

0 comments on commit d30bf8f

Please sign in to comment.