orionx-sdk
Advanced tools
Comparing version 1.3.10 to 1.3.11
{ | ||
"name": "orionx-sdk", | ||
"version": "1.3.10", | ||
"version": "1.3.11", | ||
"description": "Help developers with Orionx integrations", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
import gql from 'graphql-tag' | ||
export default async function({ code }) { | ||
if (!code) | ||
throw new Error('code missing, try with Orionx.market({code: \'LTCBTC\'})') | ||
const query = gql` | ||
query getMarket($code: ID) { | ||
market(code: $code) { | ||
name | ||
code | ||
lastTrade { | ||
price | ||
} | ||
mainCurrency { | ||
code | ||
units | ||
format | ||
symbol | ||
} | ||
secondaryCurrency { | ||
code | ||
units | ||
format | ||
symbol | ||
} | ||
} | ||
} | ||
` | ||
const response = await this.graphql({ query, variables: { code } }) | ||
return response.market | ||
export default async function ({code}) { | ||
if (!code) throw new Error('code missing, try with Orionx.market({code: \'LTCBTC\'})') | ||
const query = gql` | ||
query getMarket($code: ID) { | ||
market(code: $code) { | ||
name | ||
code | ||
lastTrade { | ||
price | ||
} | ||
mainCurrency { | ||
code | ||
units | ||
format | ||
symbol | ||
} | ||
secondaryCurrency { | ||
code | ||
units | ||
format | ||
symbol | ||
} | ||
} | ||
} | ||
` | ||
const response = await this.graphql({query, variables: {code}}) | ||
return response.market | ||
} |
import gql from 'graphql-tag' | ||
export default async function({ marketCode, limit }) { | ||
if (!marketCode) | ||
throw new Error( | ||
'marketCode missing, try with Orionx.marketOrderBook({marketCode: \'LTCBTC\', limit: 5})' | ||
) | ||
export default async function ({marketCode, limit}) { | ||
if (!marketCode) | ||
throw new Error( | ||
'marketCode missing, try with Orionx.marketOrderBook({marketCode: \'LTCBTC\', limit: 5})' | ||
) | ||
if (!limit) | ||
throw new Error( | ||
'limit missing, try with Orionx.marketOrderBook({marketCode: \'LTCBTC\', limit: 5})' | ||
) | ||
if (!limit) | ||
throw new Error( | ||
'limit missing, try with Orionx.marketOrderBook({marketCode: \'LTCBTC\', limit: 5})' | ||
) | ||
const query = gql` | ||
query marketOrderBook($marketCode: ID!, $limit: Int) { | ||
marketOrderBook(marketCode: $marketCode, limit: $limit) { | ||
sell { | ||
amount | ||
limitPrice | ||
} | ||
buy { | ||
amount | ||
limitPrice | ||
} | ||
spread | ||
mid | ||
} | ||
} | ||
` | ||
const response = await this.graphql({ | ||
query, | ||
variables: { marketCode, limit } | ||
}) | ||
return response.marketOrderBook | ||
const query = gql` | ||
query marketOrderBook($marketCode: ID!, $limit: Int) { | ||
marketOrderBook(marketCode: $marketCode, limit: $limit) { | ||
sell { | ||
amount | ||
limitPrice | ||
} | ||
buy { | ||
amount | ||
limitPrice | ||
} | ||
spread | ||
mid | ||
} | ||
} | ||
` | ||
const response = await this.graphql({ | ||
query, | ||
variables: {marketCode, limit} | ||
}) | ||
console.log('response', response) | ||
return response.marketOrderBook | ||
} |
import gql from 'graphql-tag' | ||
export default async function() { | ||
const query = gql` | ||
query { | ||
markets { | ||
code | ||
name | ||
mainCurrency { | ||
code | ||
name | ||
units | ||
} | ||
secondaryCurrency { | ||
code | ||
name | ||
units | ||
} | ||
} | ||
} | ||
` | ||
const response = await this.graphql({ query, variables: {} }) | ||
return response.markets | ||
export default async function () { | ||
const query = gql` | ||
query { | ||
markets { | ||
code | ||
name | ||
mainCurrency { | ||
code | ||
name | ||
units | ||
} | ||
secondaryCurrency { | ||
code | ||
name | ||
units | ||
} | ||
} | ||
} | ||
` | ||
const response = await this.graphql({query, variables: {}}) | ||
return response.markets | ||
} |
import gql from 'graphql-tag' | ||
export default async function() { | ||
const query = gql` | ||
query { | ||
me { | ||
_id | ||
name | ||
createdAt | ||
} | ||
} | ||
` | ||
const response = await this.graphql({ query, variables: {} }) | ||
return response.me | ||
export default async function () { | ||
const query = gql` | ||
query { | ||
me { | ||
_id | ||
name | ||
createdAt | ||
} | ||
} | ||
` | ||
const response = await this.graphql({query, variables: {}}) | ||
return response.me | ||
} |
import gql from 'graphql-tag' | ||
export default async function({marketCode, limit}) { | ||
export default async function ({marketCode, limit}) { | ||
if (!marketCode) | ||
throw new Error("Missing marketCode, try Orionx.openOrders({marketCode: 'BTCCLP'})") | ||
throw new Error('Missing marketCode, try Orionx.openOrders({marketCode: \'BTCCLP\'})') | ||
@@ -7,0 +7,0 @@ if (!limit) limit = 15 |
import gql from 'graphql-tag' | ||
export default async function({ currencyCode }) { | ||
if (!currencyCode) | ||
throw new Error( | ||
'Missing currencyCode, try Orionx.wallet({currencyCode: \'CLP\'})' | ||
) | ||
export default async function ({currencyCode}) { | ||
if (!currencyCode) | ||
throw new Error('Missing currencyCode, try Orionx.wallet({currencyCode: \'CLP\'})') | ||
const query = gql` | ||
query getWallet($currencyCode: ID!) { | ||
me { | ||
_id | ||
wallet(currencyCode: $currencyCode) { | ||
_id | ||
balance | ||
availableBalance | ||
currency { | ||
code | ||
name | ||
symbol | ||
format | ||
} | ||
} | ||
} | ||
} | ||
` | ||
const response = await this.graphql({ query, variables: { currencyCode } }) | ||
const query = gql` | ||
query getWallet($currencyCode: ID!) { | ||
me { | ||
_id | ||
wallet(currencyCode: $currencyCode) { | ||
_id | ||
balance | ||
availableBalance | ||
currency { | ||
code | ||
name | ||
symbol | ||
format | ||
} | ||
} | ||
} | ||
} | ||
` | ||
const response = await this.graphql({query, variables: {currencyCode}}) | ||
return response.me.wallet | ||
return response.me.wallet | ||
} |
import gql from 'graphql-tag' | ||
export default async function() { | ||
const query = gql` | ||
query { | ||
me { | ||
_id | ||
wallets { | ||
_id | ||
balance | ||
availableBalance | ||
currency { | ||
code | ||
name | ||
symbol | ||
format | ||
units | ||
} | ||
} | ||
} | ||
} | ||
` | ||
const response = await this.graphql({query, variables: {}}) | ||
export default async function () { | ||
const query = gql` | ||
query { | ||
me { | ||
_id | ||
wallets { | ||
_id | ||
balance | ||
availableBalance | ||
currency { | ||
code | ||
name | ||
symbol | ||
format | ||
units | ||
} | ||
} | ||
} | ||
} | ||
` | ||
const response = await this.graphql({query, variables: {}}) | ||
return response.me.wallets | ||
return response.me.wallets | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74648
1724