Skip to content

Instantly share code, notes, and snippets.

@codesxt
Created December 28, 2017 17:46
Show Gist options
  • Save codesxt/1a5c6e20d769ca16b6b5bac329d93c8e to your computer and use it in GitHub Desktop.
Save codesxt/1a5c6e20d769ca16b6b5bac329d93c8e to your computer and use it in GitHub Desktop.
Script para consultar la API de OrionX en GraphQL
const graphql_client = require('graphql-request');
const query = `{
marketOrderBook(marketCode:"CHACLP" limit:1){
spread
sell {
amount
limitPrice
accumulated
accumulatedPrice
}
buy {
amount
limitPrice
accumulated
accumulatedPrice
}
}
}`;
graphql_client.request(
'http://api.orionx.io/graphql', query
).then(
data => console.log(JSON.stringify(data, null, '\t'))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment