Skip to content

Commit

Permalink
Merge branch 'master' into remove-nested-promise-loadallorders
Browse files Browse the repository at this point in the history
  • Loading branch information
CjS77 authored Nov 28, 2017
2 parents 6fe9f26 + c26e277 commit c7454f1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
13 changes: 12 additions & 1 deletion src/exchanges/gdax/GDAXExchangeAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ export class GDAXExchangeAPI implements PublicExchangeAPI, AuthenticatedExchange
};
break;
case 'market':
case 'stop':
gdaxOrder = {
type: 'market',
product_id: order.productId,
Expand All @@ -211,6 +210,18 @@ export class GDAXExchangeAPI implements PublicExchangeAPI, AuthenticatedExchange
stp: order.extra && order.extra.stp
};
break;
case 'stop':
gdaxOrder = {
type: 'stop',
product_id: order.productId,
side: side,
size: order.size,
price: order.price,
funds: order.funds,
client_oid: order.clientId,
stp: order.extra && order.extra.stp
};
break;
default:
return Promise.reject(new GTTError('Invalid Order type: ' + order.type));
}
Expand Down
2 changes: 1 addition & 1 deletion src/exchanges/poloniex/PoloniexFeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class PoloniexFeed extends ExchangeFeed {
this.subscriptions = {};
for (const key in oldSubscriptions) {
const channel = oldSubscriptions[key];
this.subscribe(channel.id);
this.resubscribe(channel.id);
}
this.pinger = setInterval(() => {
if (!this.isConnected()) {
Expand Down
2 changes: 1 addition & 1 deletion src/factories/poloniexFactories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function getSubscribedFeeds(options: any, products: string[]): Promise<Po
const feed = getFeed<PoloniexFeed, ExchangeFeedConfig>(PoloniexFeed, config);
if (!feed.isConnected()) {
feed.reconnect(0);
feed.on('websocket-open', () => {
feed.once('websocket-open', () => {
subscribeToAll(products, feed, info);
});
} else {
Expand Down

0 comments on commit c7454f1

Please sign in to comment.