Skip to content

Commit

Permalink
Adding new code to relax the code when now new orders are found.
Browse files Browse the repository at this point in the history
  • Loading branch information
danilo-silva-funttastic committed Aug 26, 2024
1 parent deb077a commit b7c572e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/connectors/kujira/kujira.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1395,8 +1395,8 @@ export class Kujira {
}

const combinedOrders = [
...response.orders,
...partialResponse.orders,
...response?.orders || [],
...partialResponse?.orders || [],
];

const seenIndices = new Set<number>();
Expand All @@ -1410,16 +1410,16 @@ export class Kujira {
return false;
});
} while (
partialResponse.orders.length > 0 &&
response.orders.length < KujiraConfig.config.orders.open.limit
(partialResponse?.orders || []).length > 0 &&
(response?.orders || []).length < KujiraConfig.config.orders.open.limit
);

const bundles = IMap<string, any>().asMutable();

bundles.setIn(['common', 'response'], response);
bundles.setIn(['common', 'status'], options.status);
bundles.setIn(['common', 'market'], market);
bundles.setIn(['orders'], response.orders);
bundles.setIn(['orders'], response.orders || []);

orders = convertKujiraOrdersToMapOfOrders({
type: ConvertOrderType.GET_ORDERS,
Expand Down

0 comments on commit b7c572e

Please sign in to comment.