Created
December 28, 2017 17:46
-
-
Save codesxt/1a5c6e20d769ca16b6b5bac329d93c8e to your computer and use it in GitHub Desktop.
Script para consultar la API de OrionX en GraphQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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