Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

orionx-sdk

Package Overview
Dependencies
Maintainers
2
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

orionx-sdk - npm Package Compare versions

Comparing version 1.3.9 to 1.3.10

build/mutations/requestRealtimeToken.js

2

.eslintrc.json

@@ -13,3 +13,3 @@ {

"rules": {
"indent": ["error", "spaces"],
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],

@@ -16,0 +16,0 @@ "quotes": ["error", "single"],

@@ -19,5 +19,5 @@ 'use strict';

var _requestPromise = require('request-promise');
var _nodeFetch = require('node-fetch');
var _requestPromise2 = _interopRequireDefault(_requestPromise);
var _nodeFetch2 = _interopRequireDefault(_nodeFetch);

@@ -31,3 +31,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var timestamp, signature, response, _JSON$parse, data, errors;
var timestamp, signature, response, _ref3, data, errors;

@@ -42,4 +42,3 @@ return _regenerator2.default.wrap(function _callee$(_context) {

_context.next = 5;
return (0, _requestPromise2.default)({
uri: credentials.apiUri,
return (0, _nodeFetch2.default)(credentials.apiUri, {
method: 'POST',

@@ -56,6 +55,12 @@ headers: {

response = _context.sent;
_JSON$parse = JSON.parse(response), data = _JSON$parse.data, errors = _JSON$parse.errors;
_context.next = 8;
return response.json();
case 8:
_ref3 = _context.sent;
data = _ref3.data;
errors = _ref3.errors;
if (!errors) {
_context.next = 9;
_context.next = 13;
break;

@@ -66,11 +71,11 @@ }

case 9:
case 13:
return _context.abrupt('return', data);
case 12:
_context.prev = 12;
case 16:
_context.prev = 16;
_context.t0 = _context['catch'](2);
throw Error(_context.t0.message);
case 15:
case 19:
case 'end':

@@ -80,3 +85,3 @@ return _context.stop();

}
}, _callee, this, [[2, 12]]);
}, _callee, this, [[2, 16]]);
}));

@@ -83,0 +88,0 @@

'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
value: true
});

@@ -16,6 +16,6 @@

exports.default = function () {
_index2.default.setCredentials({
apiKey: process.env.API_KEY,
secretKey: process.env.SECRET_KEY
});
_index2.default.setCredentials({
apiKey: process.env.API_KEY,
secretKey: process.env.SECRET_KEY
});
};
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
value: true
});

@@ -23,9 +23,14 @@

var _requestRealtimeToken = require('./requestRealtimeToken');
var _requestRealtimeToken2 = _interopRequireDefault(_requestRealtimeToken);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = {
cancelOrder: _cancelOrder2.default,
createPayment: _createPayment2.default,
placeLimitOrder: _placeLimitOrder2.default,
placeMarketOrder: _placeMarketOrder2.default
cancelOrder: _cancelOrder2.default,
createPayment: _createPayment2.default,
placeLimitOrder: _placeLimitOrder2.default,
placeMarketOrder: _placeMarketOrder2.default,
requestRealtimeToken: _requestRealtimeToken2.default
};
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
value: true
});

@@ -35,12 +35,17 @@

var _openOrders = require('./openOrders');
var _openOrders2 = _interopRequireDefault(_openOrders);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = {
market: _market2.default,
marketOrderBook: _marketOrderBook2.default,
markets: _markets2.default,
me: _me2.default,
transactions: _transactions2.default,
wallet: _wallet2.default,
wallets: _wallets2.default
market: _market2.default,
marketOrderBook: _marketOrderBook2.default,
markets: _markets2.default,
me: _me2.default,
transactions: _transactions2.default,
wallet: _wallet2.default,
wallets: _wallets2.default,
openOrders: _openOrders2.default
};
{
"name": "orionx-sdk",
"version": "1.3.9",
"version": "1.3.10",
"description": "Help developers with Orionx integrations",

@@ -48,8 +48,7 @@ "main": "build/index.js",

"babel-register": "^6.26.0",
"dotenv": "^6.0.0",
"eslint": "^5.5.0",
"dotenv": "^8.2.0",
"eslint": "^6.8.0",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-standard": "^3.1.0",
"tap-nyan": "^1.1.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-standard": "^4.0.1",
"watch": "^1.0.2"

@@ -59,8 +58,7 @@ },

"babel-runtime": "6",
"graphql": "^14.0.2",
"graphql": "^15.0.0",
"graphql-tag": "^2.9.2",
"jssha": "^2.3.1",
"request": "^2.88.2",
"request-promise": "^4.2.2"
"jssha": "^3.1.0",
"node-fetch": "^2.6.0"
}
}

@@ -42,5 +42,5 @@ <p align="center">

Orionx.setCredentials({
apiKey: '<apiKey>',
secretKey: '<secretKey>',
apiUri: '<https://apiUri.com/graphql>'
apiKey: '<apiKey>',
secretKey: '<secretKey>',
apiUri: 'https://api2.orionx.com/graphql',
})

@@ -50,194 +50,12 @@

Orionx.market({code: 'LTCBTC'})
.then(function(market) {
console.log(market)
})
.catch(function(err) {
console.log(err)
})
.then(function (market) {
console.log(market)
})
.catch(function (err) {
console.log(err)
})
```
## Methods
## Documentation & Examples
### cancelOrder
Cancel an order by id.
```js
await Orionx.cancelOrder({orderId: 'asd73jksslksdf'})
```
#### Params
**orderId:** Id of the order
---
### createPayment
The `createPayment()` creates a new payment and returns its data.
```js
await Orionx.createPayment({
acceptedCurrenciesCodes: ['LTC', 'BTC'],
amount: 1000,
description: 'Testing...',
mainCurrencyCode: 'CLP',
title: 'Test'
})
```
#### Params
**acceptedCurrenciesCodes:** The coin codes that the buyer will be able to use as payment
**amount** The price in mainCurrencyCode units
**description** Some descriptive text
**mainCurrencyCode** The coin that you will recieve
**title** Some descriptive title
---
### me
The `me()` method returns yours user data.
```js
await Orionx.me()
```
---
### market
The `market()` method returns the info of a specified market.
```js
await Orionx.market({code: ':marketCode'})
```
#### Params
**code:** Market code
---
### marketOrderBook
The `marketOrderBook()` method returns the info of a specified market order book.
```js
await Orionx.marketOrderBook({marketCode: ':marketCode', limit: 5})
```
#### Params
**marketCode:** Market code
**limit** Number of buy/sell orders
---
### markets
The `markets()` method returns the info of all the markets.
```js
await Orionx.markets()
```
---
### placeLimitOrder
The `placeLimitOrder()` creates and returns a limit order .
```js
await Orionx.placeLimitOrder({marketCode: ':marketCode', amount: :amount, limitPrice: :limitPrice, sell: :sell})
```
#### Params
**marketCode:** Market code
**amount** The amount to be bought or sold, this amount must be multiplied by 10 ^ (unit amount)
For example BTC units = 8 so to sell 1 BTC amount should be 1 \* 10⁸.
**limitPrice** The price for the order
**sell** Boolean that defines if you buy or sell
---
### placeMarketOrder
The `placeMarketOrder()` creates and returns a market order .
```js
await Orionx.placeMarketOrder({marketCode: ':marketCode', amount: :amount, sell: :sell})
```
#### Params
**marketCode:** Market code
**amount** The amount to be bought or sold, this amount must be multiplied by 10 ^ (unit amount)
For example BTC units = 8 so to sell 1 BTC amount should be 1 \* 10⁸.
**sell** Boolean that defines if you buy or sell
---
### transactions
The `transactions()` shows all transactions from the given wallet. It's results are paginated.
```js
await Orionx.transactions({walletId: ':walletId', page: :page, limit: :limit })
```
#### Params
**walletId:** The ID of the wallet you want to display the transactions
**page:** The page of results you want to display.
**limit:** The number of items per page.
### Wallet
Get a wallet by an id
```js
await Orionx.wallet({currencyCode: ':currencyCode'})
```
#### Params
**currencyCode:** Currency code
---
### Wallets
Gets all my wallets
```js
await Orionx.wallets()
```
---
## Docs
For further information about, visit our [Docs](http://docs.orionx.com/docs/getStarted/)
## Opening Issues
If you encounter a bug with the Orionx SDK for JavaScript we would like to hear about it. Search the [existing issues](https://github.com/orionx-dev/orionx-sdk-js/issues) and try to make sure your problem doesn’t already exist before opening a new issue. It’s helpful if you include the version of the SDK, Node.js and OS you’re using.
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
All documentation is [over here](http://docs.orionx.com/docs/sdk-javascript/)
import generateSignature from './generateSignature'
import rp from 'request-promise'
import fetch from 'node-fetch'
export default async function({body, credentials}) {
export default async function ({body, credentials}) {
const timestamp = new Date().getTime() / 1000

@@ -9,4 +9,3 @@ const signature = generateSignature({body, timestamp, secretKey: credentials.secretKey})

try {
const response = await rp({
uri: credentials.apiUri,
const response = await fetch(credentials.apiUri, {
method: 'POST',

@@ -20,3 +19,3 @@ headers: {

})
const {data, errors} = JSON.parse(response)
const {data, errors} = await response.json()

@@ -23,0 +22,0 @@ if (errors) throw Error(errors[0].message)

@@ -5,6 +5,6 @@ require('dotenv').config()

export default () => {
Orionx.setCredentials({
apiKey: process.env.API_KEY,
secretKey: process.env.SECRET_KEY
})
Orionx.setCredentials({
apiKey: process.env.API_KEY,
secretKey: process.env.SECRET_KEY
})
}

@@ -5,8 +5,10 @@ import createPayment from './createPayment'

import placeMarketOrder from './placeMarketOrder'
import requestRealtimeToken from './requestRealtimeToken'
export default {
cancelOrder,
createPayment,
placeLimitOrder,
placeMarketOrder
cancelOrder,
createPayment,
placeLimitOrder,
placeMarketOrder,
requestRealtimeToken
}

@@ -8,11 +8,13 @@ import market from './market'

import wallets from './wallets'
import openOrders from './openOrders'
export default {
market,
marketOrderBook,
markets,
me,
transactions,
wallet,
wallets
market,
marketOrderBook,
markets,
me,
transactions,
wallet,
wallets,
openOrders
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc