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

@ex-master/core

Package Overview
Dependencies
Maintainers
1
Versions
141
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ex-master/core - npm Package Compare versions

Comparing version 0.1.42 to 0.1.43

1

bld/exchange/exchange.d.ts

@@ -27,2 +27,3 @@ import { Decimal } from 'decimal.js';

pendingUpdates: number;
canceling: number | false;
becomeInactive: Promise<void>;

@@ -29,0 +30,0 @@ becomeInactiveResolver(): void;

@@ -10,2 +10,3 @@ "use strict";

const debug = Debug('ex-master:core:exchange');
const ORDER_CANCELING_TIMEOUT = 1000;
class Exchange {

@@ -62,2 +63,3 @@ constructor(client, dashboard, { pendingUpdatesPriorityScale = 2 } = {}) {

let activeOrders = Array.from(activeOrderMap.values());
let now = Date.now();
let orders = activeOrders.length

@@ -90,2 +92,6 @@ ? await this.client.getOrders(activeOrders)

}
let ordersToReCancel = Array.from(activeOrderMap.values()).filter(order => order.canceling && order.canceling + ORDER_CANCELING_TIMEOUT < now);
if (ordersToReCancel.length) {
await this.cancelOrders(ordersToReCancel);
}
});

@@ -346,2 +352,3 @@ }

pendingUpdates: 0,
canceling: false,
becomeInactive,

@@ -355,4 +362,5 @@ becomeInactiveResolver,

async cancelOrder(order) {
let { group, label, becomeInactive } = order;
let { group, id, label, becomeInactive } = order;
this.dashboard.info(`cancel order [${group}] "${label}"`);
this.activeOrderMap.set(id, { ...order, canceling: Date.now() });
await this.client.cancelOrder(order);

@@ -372,2 +380,6 @@ await becomeInactive;

this.dashboard.info(`cancel orders ${ordersStr}`);
let now = Date.now();
for (let order of orders) {
this.activeOrderMap.set(order.id, { ...order, canceling: now });
}
await this.client.cancelOrders(orders);

@@ -374,0 +386,0 @@ await Promise.all(orders.map(order => order.becomeInactive));

2

package.json
{
"name": "@ex-master/core",
"version": "0.1.42",
"version": "0.1.43",
"main": "bld/index.js",

@@ -5,0 +5,0 @@ "types": "bld/index.d.ts",

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