Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API to get last oracle value #532

Merged
1 commit merged into from
Aug 24, 2022
Merged

Add API to get last oracle value #532

1 commit merged into from
Aug 24, 2022

Conversation

ghost
Copy link

@ghost ghost commented Aug 19, 2022

Description

Provide GraphQL API for oracles:

  • Subscription of the latest changes (real time with ws)
  • Get the latest value of the oracle data
  • Get the oracle data at a given time

Fixes #451

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

We can use the following query to get the last updates:

subscription {
   oracleUpdate {
      services {
         uco {
            eur
         }
      }
   }
}

We can get latest oracle data with:

query {
   oracleData {
      timestamp
      services {
         uco {
            eur
         }
      }
   } 
}

To fetch for a given date

query {
   oracleData(timestamp: ....) {
      services {
         uco {
            eur
         }
      }
   } 
}

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@ghost ghost added feature New feature request API Involve API facing user labels Aug 19, 2022
@ghost ghost requested a review from redDwarf03 August 19, 2022 13:18
This provide a live feed with subscription
and query by the latest or by time.
@ghost ghost force-pushed the last_oracle_value_api branch from b821fed to af3c3b2 Compare August 19, 2022 13:48
@ghost ghost requested a review from Neylix August 22, 2022 21:00
@ghost ghost merged commit b82bc91 into develop Aug 24, 2022
@ghost ghost deleted the last_oracle_value_api branch August 24, 2022 07:47
ghost pushed a commit that referenced this pull request Aug 25, 2022
Provide a live feed with subscription and query for the latest or by time.
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Involve API facing user feature New feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant