@riocrypto/common 1.0.2344 → 1.0.2346

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- import { Order } from "../types/order";
1
+ import { Side } from "../types/side";
2
2
  import { User } from "../types/user";
3
- export declare const getCanDisburseWithoutCosigner: (user: User, order: Order) => boolean | undefined;
3
+ export declare const getCanDisburseWithoutCosigner: (user: User, side: Side) => boolean | undefined;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCanDisburseWithoutCosigner = void 0;
4
4
  const side_1 = require("../types/side");
5
5
  const user_attribute_1 = require("../types/user-attribute");
6
- const getCanDisburseWithoutCosigner = (user, order) => {
6
+ const getCanDisburseWithoutCosigner = (user, side) => {
7
7
  var _a, _b, _c, _d;
8
8
  // If between 8am and 3:40pm Mexico City time, check if user has disburseMorningBuyOrdersWithoutCosigner or disburseMorningSellOrdersWithoutCosigner
9
9
  // If between 3:40pm and 8am Mexico City time, check if user has disburseEveningBuyOrdersWithoutCosigner or disburseEveningSellOrdersWithoutCosigner
@@ -23,7 +23,7 @@ const getCanDisburseWithoutCosigner = (user, order) => {
23
23
  // Check if current time is in morning period (8:00 AM - 3:40 PM)
24
24
  if (currentTime >= morningStart.getTime() &&
25
25
  currentTime < morningEnd.getTime()) {
26
- return order.side === side_1.Side.Buy
26
+ return side === side_1.Side.Buy
27
27
  ? (_a = user.attributes) === null || _a === void 0 ? void 0 : _a.includes(user_attribute_1.UserAttribute.DisburseMorningBuyOrdersWithoutCosigner)
28
28
  : (_b = user.attributes) === null || _b === void 0 ? void 0 : _b.includes(user_attribute_1.UserAttribute.DisburseMorningSellOrdersWithoutCosigner);
29
29
  }
@@ -31,7 +31,7 @@ const getCanDisburseWithoutCosigner = (user, order) => {
31
31
  // For evening period, we need to handle the case where it spans across midnight
32
32
  const isEveningPeriod = currentTime >= eveningStart.getTime() || currentTime < eveningEnd.getTime();
33
33
  if (isEveningPeriod) {
34
- return order.side === side_1.Side.Buy
34
+ return side === side_1.Side.Buy
35
35
  ? (_c = user.attributes) === null || _c === void 0 ? void 0 : _c.includes(user_attribute_1.UserAttribute.DisburseEveningBuyOrdersWithoutCosigner)
36
36
  : (_d = user.attributes) === null || _d === void 0 ? void 0 : _d.includes(user_attribute_1.UserAttribute.DisburseEveningSellOrdersWithoutCosigner);
37
37
  }
@@ -9,6 +9,7 @@ export declare enum UserAttribute {
9
9
  NoProcessingOrTransferFees = "noProcessingOrTransferFees",
10
10
  CanSpecifyNetPrice = "canSpecifyNetPrice",
11
11
  CanDeferPayment = "canDeferPayment",
12
+ CanTWAP = "canTWAP",
12
13
  CanUsePayoutAdvances = "canUsePayoutAdvances",
13
14
  AddToVolumeOnCreateOrder = "addToVolumeOnCreateOrder",
14
15
  DisburseMorningBuyOrdersWithoutCosigner = "disburseMorningBuyOrdersWithoutCosigner",
@@ -13,6 +13,7 @@ var UserAttribute;
13
13
  UserAttribute["NoProcessingOrTransferFees"] = "noProcessingOrTransferFees";
14
14
  UserAttribute["CanSpecifyNetPrice"] = "canSpecifyNetPrice";
15
15
  UserAttribute["CanDeferPayment"] = "canDeferPayment";
16
+ UserAttribute["CanTWAP"] = "canTWAP";
16
17
  UserAttribute["CanUsePayoutAdvances"] = "canUsePayoutAdvances";
17
18
  UserAttribute["AddToVolumeOnCreateOrder"] = "addToVolumeOnCreateOrder";
18
19
  UserAttribute["DisburseMorningBuyOrdersWithoutCosigner"] = "disburseMorningBuyOrdersWithoutCosigner";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.2344",
3
+ "version": "1.0.2346",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",