Socket
Socket
Sign inDemoInstall

stocks-exchange-client

Package Overview
Dependencies
214
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.4.2 to 2.5.1

254

lib/stocks-exchange-client.js

@@ -57,123 +57,81 @@ 'use strict';

subscribeRate(cb) {
return this.websocketV3.subscribeRate('rate', function (res) {
cb(res)
});
}
subscribeRate = (cb) => this.websocketV3.subscribeRate('rate', (res) => cb(res));
subscribeOrderFillCreated(currency_pair_id, cb) {
return this.websocketV3.subscribeOrderFillCreated('trade_c' + currency_pair_id, function (res) {
cb(res)
});
subscribeOrderFillCreated = (currency_pair_id, cb) => {
return this.websocketV3.subscribeOrderFillCreated('trade_c' + currency_pair_id, (res) => cb(res));
}
subscribeGlassTotalChanged(currency_pair_id, type, cb) {
return this.websocketV3.subscribeGlassTotalChanged((type || 'sell') + '_total_data' + currency_pair_id, function (res) {
cb(res)
});
subscribeGlassTotalChanged = (currency_pair_id, type, cb) => {
return this.websocketV3.subscribeGlassTotalChanged((type || 'sell') + '_total_data' + currency_pair_id, (res) => cb(res));
}
subscribeGlassRowChanged(currency_pair_id, type, cb) {
return this.websocketV3.subscribeGlassRowChanged((type || 'sell') + '_data' + currency_pair_id, function (res) {
cb(res)
});
subscribeGlassRowChanged = (currency_pair_id, type, cb) => {
return this.websocketV3.subscribeGlassRowChanged((type || 'sell') + '_data' + currency_pair_id, (res) => cb(res));
}
subscribeBestPriceChanged(currency_pair_id, type, cb) {
return this.websocketV3.subscribeBestPriceChanged('best_' + (type || 'bid') + '_price_' + currency_pair_id, function (res) {
cb(res)
});
subscribeBestPriceChanged = (currency_pair_id, type, cb) => {
return this.websocketV3.subscribeBestPriceChanged('best_' + (type || 'bid') + '_price_' + currency_pair_id, (res) => cb(res));
}
subscribeCandleChanged(currency_pair_id, chart_type, cb) {
return this.websocketV3.subscribeCandleChanged('stats_data_' + (chart_type || '1') + '_' + currency_pair_id, function (res) {
cb(res)
});
subscribeCandleChanged = (currency_pair_id, chart_type, cb) => {
return this.websocketV3.subscribeCandleChanged('stats_data_' + (chart_type || '1') + '_' + currency_pair_id, (res) => cb(res));
}
subscribeBalanceChanged(wallet_id, cb) {
return this.websocketV3.subscribeBalanceChanged('private-balance_changed_w_' + wallet_id, function (res) {
cb(res)
});
subscribeBalanceChanged = (wallet_id, cb) => {
return this.websocketV3.subscribeBalanceChanged('private-balance_changed_w_' + wallet_id, (res) => cb(res));
}
subscribeUserOrder(user_id, currency_pair_id, type, cb) {
return this.websocketV3.subscribeUserOrder('private-' + (type || 'sell') + '_user_data_u' + user_id + 'c' + currency_pair_id, function (res) {
cb(res)
});
subscribeUserOrder = (user_id, currency_pair_id, type, cb) => {
return this.websocketV3.subscribeUserOrder('private-' + (type || 'sell') + '_user_data_u' + user_id + 'c' + currency_pair_id, (res) => cb(res));
}
subscribeUserOrderDeleted(user_id, currency_pair_id, cb) {
return this.websocketV3.subscribeUserOrderDeleted('private-del_order_u' + user_id + 'c' + currency_pair_id, function (res) {
cb(res)
});
subscribeUserOrderDeleted = (user_id, currency_pair_id, cb) => {
return this.websocketV3.subscribeUserOrderDeleted('private-del_order_u' + user_id + 'c' + currency_pair_id, (res) => cb(res));
}
subscribeUserOrderFillCreated(user_id, currency_pair_id, cb) {
return this.websocketV3.subscribeUserOrderFillCreated('private-trade_u' + user_id + 'c' + currency_pair_id, function (res) {
cb(res)
});
subscribeUserOrderFillCreated = (user_id, currency_pair_id, cb) => {
return this.websocketV3.subscribeUserOrderFillCreated('private-trade_u' + user_id + 'c' + currency_pair_id, (res) => cb(res));
}
profileInfo(cb) {
return this.privateV2.getProfileInfo(function (res) {
cb(res)
});
profileInfo = (cb) => {
return this.privateV2.getProfileInfo((res) => cb(res));
}
profileWallets(params, cb) {
return this.privateV2.getProfileWallets(params, function (res) {
cb(res)
});
profileWallets = (params, cb) => {
return this.privateV2.getProfileWallets(params, (res) => cb(res));
}
profileWalletsById(walletId, cb) {
return this.privateV2.getProfileWalletsById(walletId, function (res) {
cb(res)
});
profileWalletsById = (walletId, cb) => {
return this.privateV2.getProfileWalletsById(walletId, (res) => cb(res));
}
newProfileWalletsByCurrencyId(currencyId, cb) {
return this.privateV2.setProfileWalletsByCurrencyId(currencyId, function (res) {
cb(res)
});
newProfileWalletsByCurrencyId = (currencyId, cb) => {
return this.privateV2.setProfileWalletsByCurrencyId(currencyId, (res) => cb(res));
}
profileWalletsAddressById(walletId, cb) {
return this.privateV2.getProfileWalletsAddressById(walletId, function (res) {
cb(res)
});
profileWalletsAddressById = (walletId, cb) => {
return this.privateV2.getProfileWalletsAddressById(walletId, (res) => cb(res));
}
newProfileWalletsAddressById(walletId, cb) {
return this.privateV2.setProfileWalletsAddressById(walletId, function (res) {
cb(res)
});
newProfileWalletsAddressById = (walletId, cb) => {
return this.privateV2.setProfileWalletsAddressById(walletId, (res) => cb(res));
}
profileDeposits(params, cb) {
return this.privateV2.getProfileDeposits(params, function (res) {
cb(res)
});
profileDeposits = (params, cb) => {
return this.privateV2.getProfileDeposits(params, (res) => cb(res));
}
profileDepositsById(id, cb) {
return this.privateV2.getProfileDepositsById(id, function (res) {
cb(res)
});
profileDepositsById = (id, cb) => {
return this.privateV2.getProfileDepositsById(id, (res) => cb(res));
}
profileWithdrawals(params, cb) {
return this.privateV2.getProfileWithdrawals(params, function (res) {
cb(res)
});
profileWithdrawals = (params, cb) => {
return this.privateV2.getProfileWithdrawals(params, (res) => cb(res));
}
profileWithdrawalsById(id, cb) {
return this.privateV2.getProfileWithdrawalsById(id, function (res) {
cb(res)
});
profileWithdrawalsById = (id, cb) => {
return this.privateV2.getProfileWithdrawalsById(id, (res) => cb(res));
}
createProfileWithdrawals(currency_id, amount, address, additional_address, cb) {
createProfileWithdrawals = (currency_id, amount, address, additional_address, cb) => {
return this.privateV2.sendCreateProfileWithdrawals(

@@ -183,131 +141,87 @@ currency_id,

address,
additional_address, function (res) {
cb(res)
});
additional_address, (res) => cb(res));
}
profileWithdrawalCancelById(withdrawalId, cb) {
return this.privateV2.profileWithdrawalCancelById(withdrawalId, function (res) {
cb(res)
});
profileWithdrawalCancelById = (withdrawalId, cb) => {
return this.privateV2.profileWithdrawalCancelById(withdrawalId, (res) => cb(res));
}
reportsOrders(params, cb) {
return this.privateV2.getReportsOrders(params, function (res) {
cb(res)
});
reportsOrders = (params, cb) => {
return this.privateV2.getReportsOrders(params, (res) => cb(res));
}
reportsOrdersById(id, cb) {
return this.privateV2.getReportsOrdersById(id, function (res) {
cb(res)
});
reportsOrdersById = (id, cb) => {
return this.privateV2.getReportsOrdersById(id, (res) => cb(res));
}
tradingOrders(cb) {
return this.privateV2.getTradingOrders( function (res) {
cb(res)
});
tradingOrders = (cb) => {
return this.privateV2.getTradingOrders( (res) => cb(res));
}
deleteAllTradingOrders(cb) {
return this.privateV2.deleteAllTradingOrders( function (res) {
cb(res)
});
deleteAllTradingOrders = (cb) => {
return this.privateV2.deleteAllTradingOrders( (res) => cb(res));
}
tradingOrdersById(currencyPairId, cb) {
return this.privateV2.getTradingOrdersById(currencyPairId, function (res) {
cb(res)
});
tradingOrdersById = (currencyPairId, cb) => {
return this.privateV2.getTradingOrdersById(currencyPairId, (res) => cb(res));
}
deleteTradingOrdersById(currencyPairId, cb) {
return this.privateV2.deleteTradingOrdersById(currencyPairId, function (res) {
cb(res)
});
deleteTradingOrdersById = (currencyPairId, cb) => {
return this.privateV2.deleteTradingOrdersById(currencyPairId, (res) => cb(res));
}
createTradingOrdersById(currencyPairId, params, cb) {
return this.privateV2.createTradingOrdersById(currencyPairId, params, function (res) {
cb(res)
});
createTradingOrdersById = (currencyPairId, params, cb) => {
return this.privateV2.createTradingOrdersById(currencyPairId, params, (res) => cb(res));
}
tradingOrderByOrderId(orderId, cb) {
return this.privateV2.tradingOrderByOrderId(orderId, function (res) {
cb(res)
});
tradingOrderByOrderId = (orderId, cb) => {
return this.privateV2.tradingOrderByOrderId(orderId, (res) => cb(res));
}
cancelTradingOrderByOrderId(orderId, cb) {
return this.privateV2.cancelTradingOrderByOrderId(orderId, function (res) {
cb(res)
});
cancelTradingOrderByOrderId = (orderId, cb) => {
return this.privateV2.cancelTradingOrderByOrderId(orderId, (res) => cb(res));
}
publicPing(cb) {
return this.publicV2.publicPing(function (res) {
cb(res)
});
}
publicPing = (cb) => this.publicV2.publicPing((res) => cb(res));
publicChart(currencyPairId, candlesType, params, cb) {
return this.publicV2.publicChart(currencyPairId, candlesType, params, function (res) {
cb(res)
});
publicTwitter = (cb) => this.publicV2.publicTwitter((res) => cb(res));
publicChart = (currencyPairId, candlesType, params, cb) => {
return this.publicV2.publicChart(currencyPairId, candlesType, params, (res) => cb(res));
}
publicOrderbook(currencyPairId, params, cb) {
return this.publicV2.publicOrderbook(currencyPairId, params, function (res) {
cb(res)
});
publicOrderbook = (currencyPairId, params, cb) => {
return this.publicV2.publicOrderbook(currencyPairId, params, (res) => cb(res));
}
publicTrades(currencyPairId, params, cb) {
return this.publicV2.publicTrades(currencyPairId, params, function (res) {
cb(res)
});
publicTrades = (currencyPairId, params, cb) => {
return this.publicV2.publicTrades(currencyPairId, params, (res) => cb(res));
}
publicTicker(currencyPairId, cb) {
return this.publicV2.publicTicker(currencyPairId, function (res) {
cb(res)
});
publicTicker = (currencyPairId, cb) => {
return this.publicV2.publicTicker(currencyPairId, (res) => cb(res));
}
allPublicTicker(cb) {
return this.publicV2.allPublicTicker(function (res) {
cb(res)
});
allPublicTicker = (cb) => {
return this.publicV2.allPublicTicker((res) => cb(res));
}
publicCurrencyPairsById(currencyPairId, cb) {
return this.publicV2.publicCurrencyPairsById(currencyPairId, function (res) {
cb(res)
});
publicCurrencyPairsById = (currencyPairId, cb) => {
return this.publicV2.publicCurrencyPairsById(currencyPairId, (res) => cb(res));
}
publicCurrencyPairsListByCode(code, cb) {
return this.publicV2.publicCurrencyPairsListByCode(code, function (res) {
cb(res)
});
publicCurrencyPairsListByCode = (code, cb) => {
return this.publicV2.publicCurrencyPairsListByCode(code, (res) => cb(res));
}
publicMarkets(cb) {
return this.publicV2.publicMarkets(function (res) {
cb(res)
});
publicMarkets = (cb) => {
return this.publicV2.publicMarkets((res) => cb(res));
}
publicCurrencyById(currencyId, cb) {
return this.publicV2.publicCurrencyById(currencyId, function (res) {
cb(res)
});
publicCurrencyById = (currencyId, cb) => {
return this.publicV2.publicCurrencyById(currencyId, (res) => cb(res));
}
publicCurrency(cb) {
return this.publicV2.publicCurrency(function (res) {
cb(res)
});
publicCurrency = (cb) => {
return this.publicV2.publicCurrency((res) => cb(res));
}

@@ -314,0 +228,0 @@ }

@@ -16,12 +16,13 @@ 'use strict';

this.url = this.parent_url + '/public/ping';
this.request({}, function (res) {
cb(res);
})
this.request({}, (res) => cb(res))
}
publicTwitter(cb) {
this.url = this.parent_url + '/public/twitter';
this.request({}, (res) => cb(res))
}
publicChart(currencyPairId, candlesType, params, cb) {
this.url = this.parent_url + '/public/chart/' + currencyPairId + '/' + candlesType;
this.request(params, function (res) {
cb(res);
})
this.request(params, (res) => cb(res))
}

@@ -31,5 +32,3 @@

this.url = this.parent_url + '/public/orderbook/' + currencyPairId;
this.request(params, function (res) {
cb(res);
})
this.request(params, (res) => cb(res))
}

@@ -39,5 +38,3 @@

this.url = this.parent_url + '/public/trades/' + currencyPairId;
this.request(params, function (res) {
cb(res);
})
this.request(params, (res) => cb(res))
}

@@ -47,5 +44,3 @@

this.url = this.parent_url + '/public/ticker/' + currencyPairId;
this.request({}, function (res) {
cb(res);
})
this.request({}, (res) => cb(res))
}

@@ -55,5 +50,3 @@

this.url = this.parent_url + '/public/ticker';
this.request({}, function (res) {
cb(res);
})
this.request({}, (res) => cb(res))
}

@@ -63,5 +56,3 @@

this.url = this.parent_url + '/public/currency_pairs/' + currencyPairId;
this.request({}, function (res) {
cb(res);
})
this.request({}, (res) => cb(res))
}

@@ -71,5 +62,3 @@

this.url = this.parent_url + '/public/currency_pairs/list/' + code;
this.request({}, function (res) {
cb(res);
})
this.request({}, (res) => cb(res))
}

@@ -79,5 +68,3 @@

this.url = this.parent_url + '/public/markets';
this.request({}, function (res) {
cb(res);
})
this.request({}, (res) => cb(res))
}

@@ -87,5 +74,3 @@

this.url = this.parent_url + '/public/currencies/' + currencyId;
this.request({}, function (res) {
cb(res);
})
this.request({}, (res) => cb(res))
}

@@ -95,5 +80,3 @@

this.url = this.parent_url + '/public/currencies';
this.request({}, function (res) {
cb(res);
})
this.request({}, (res) => cb(res))
}

@@ -100,0 +83,0 @@

@@ -15,3 +15,3 @@ 'use strict';

});
this.subscribe("App\\Events\\Ticker", function(obj){cb(obj)});
this.subscribe("App\\Events\\Ticker", (obj) => cb(obj));
}

@@ -23,3 +23,3 @@

});
this.subscribe("App\\Events\\OrderFillCreated", function(obj){cb(obj)});
this.subscribe("App\\Events\\OrderFillCreated", (obj) => cb(obj));
}

@@ -31,3 +31,3 @@

});
this.subscribe("App\\Events\\GlassTotalChanged", function(obj){cb(obj)});
this.subscribe("App\\Events\\GlassTotalChanged", (obj) => cb(obj));
}

@@ -39,3 +39,3 @@

});
this.subscribe("App\\Events\\GlassRowChanged", function(obj){cb(obj)});
this.subscribe("App\\Events\\GlassRowChanged", (obj) => cb(obj));
}

@@ -47,3 +47,3 @@

});
this.subscribe("App\\Events\\BestPriceChanged", function(obj){cb(obj)});
this.subscribe("App\\Events\\BestPriceChanged", (obj) => cb(obj));
}

@@ -55,46 +55,34 @@

});
this.subscribe("App\\Events\\CandleChanged", function(obj){cb(obj)});
this.subscribe("App\\Events\\CandleChanged", (obj) => cb(obj));
}
subscribeBalanceChanged(channel, cb) {
this.subscribePrivate(channel, 'BalanceChanged', function(obj) {
cb(obj)
})
this.subscribePrivate(channel, 'BalanceChanged', (obj) => cb(obj))
}
subscribeUserOrder(channel, cb) {
this.subscribePrivate(channel, 'UserOrder', function(obj) {
cb(obj)
})
this.subscribePrivate(channel, 'UserOrder', (obj) => cb(obj))
}
subscribeUserOrderDeleted(channel, cb) {
this.subscribePrivate(channel, 'UserOrderDeleted', function(obj) {
cb(obj)
})
this.subscribePrivate(channel, 'UserOrderDeleted', (obj) => cb(obj))
}
subscribeUserOrderFillCreated(channel, cb) {
this.subscribePrivate(channel, 'UserOrderFillCreated', function(obj) {
cb(obj)
})
this.subscribePrivate(channel, 'UserOrderFillCreated', (obj) => cb(obj))
}
subscribe(name, cb) {
this.socket.on('connect', function() {
console.log('Connected');
});
this.socket.on('connect_failed', function() {
this.socket.on('connect', () => console.log('Connected'));
this.socket.on('connect_failed', () => {
throw new Error('Sorry, there seems to be an issue with the connection!');
});
this.socket.on('disconnect', function() {
console.log('Disconnected');
this.socket.on('disconnect', () => console.log('Disconnect'));
this.socket.on('error', () => {
throw new Error('Undefined Error')
});
this.socket.on('error', function() {
throw new Error('Undefined Error');
});
this.socket.on('reconnect_failed', function() {
this.socket.on('reconnect_failed', () => {
throw new Error('Reconnect_failed');
});
this.socket.on(name, function(msg, obj) {
this.socket.on(name, (msg, obj) => {
cb(obj)

@@ -104,5 +92,5 @@ });

subscribePrivate(channel,name, cb) {
var self = this;
this.client.getToken(function (err, token) {
subscribePrivate(channel, name, cb) {
const self = this;
this.client.getToken((err, token) => {
self.socket.emit('subscribe', {

@@ -112,3 +100,5 @@ channel: channel,

});
self.subscribe("App\\Events\\" + name, function(obj){cb(obj)});
self.subscribe("App\\Events\\" + name, (obj) => {
cb(obj)
});
});

@@ -115,0 +105,0 @@ }

{
"name": "stocks-exchange-client",
"version": "2.4.2",
"version": "2.5.1",
"description": "STEX (former Stocks.Exchange) provides all the core exchange functionality, and additional merchant tools available via the HTTPS API where all returned messages are in JSON. It's much easier to work with the API by using one of the clients provided by StocksExchange, so while this page describes the API in case you want or need to build your own client, the examples use the NodeJS client.",
"main": "index.js",
"scripts": {
"test": "mocha tests/*.test.js"
"test": "mocha --reporter spec --exit --timeout 10000"
},

@@ -27,3 +27,3 @@ "repository": {

"devDependencies": {
"mocha": "^5.1.1"
"mocha": "^9.0.0"
},

@@ -37,7 +37,9 @@ "engines": {

"dependencies": {
"crypto-js": "^3.1.9-1",
"chai": "^4.3.4",
"crypto-js": "^4.0.0",
"fs": "0.0.1-security",
"global": "^4.4.0",
"http-build-query": "^0.7.0",
"jsonfile": "^5.0.0",
"pkg": "^4.3.3",
"jsonfile": "^6.1.0",
"pkg": "^5.2.1",
"request": "^2.87.0",

@@ -44,0 +46,0 @@ "socket.io-client": "^2.2.0"

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc