@polymarbot/shared 0.2.2 → 0.2.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polymarbot/shared",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
@@ -58,23 +58,23 @@ function normalizeTradeStepBuy(step, options) {
58
58
  const isLowPriceMode = price <= 0.5;
59
59
  const isChaseMode = price > 0.5;
60
60
  if (isLowPriceMode) {
61
- if (step.maxUnderlyingDiff !== void 0) {
62
- if (step.maxUnderlyingDiff >= 1 && step.maxUnderlyingDiff <= 1e3) {
63
- normalized.maxUnderlyingDiff = step.maxUnderlyingDiff;
61
+ if (step.maxUnderlyingChange !== void 0) {
62
+ if (step.maxUnderlyingChange >= 1 && step.maxUnderlyingChange <= 1e3) {
63
+ normalized.maxUnderlyingChange = step.maxUnderlyingChange;
64
64
  } else {
65
65
  }
66
66
  }
67
- if (step.minUnderlyingDiff !== void 0) {
67
+ if (step.minUnderlyingChange !== void 0) {
68
68
  }
69
69
  }
70
70
  if (isChaseMode) {
71
- if (step.minUnderlyingDiff !== void 0) {
72
- if (step.minUnderlyingDiff >= 1 && step.minUnderlyingDiff <= 1e3) {
73
- normalized.minUnderlyingDiff = step.minUnderlyingDiff;
71
+ if (step.minUnderlyingChange !== void 0) {
72
+ if (step.minUnderlyingChange >= 1 && step.minUnderlyingChange <= 1e3) {
73
+ normalized.minUnderlyingChange = step.minUnderlyingChange;
74
74
  } else {
75
75
  }
76
76
  }
77
- if (step.maxUnderlyingDiff !== void 0) {
77
+ if (step.maxUnderlyingChange !== void 0) {
78
78
  }
79
79
  }
80
80
  return normalized;
@@ -108,8 +108,8 @@ function normalizeTradeStepSell(step, options) {
108
108
  const invalidFields = [];
109
109
  if ("once" in stepAsTradeStep && stepAsTradeStep.once !== void 0) invalidFields.push("once");
110
110
  if ("outcomeIndex" in stepAsTradeStep && stepAsTradeStep.outcomeIndex !== void 0) invalidFields.push("outcomeIndex");
111
- if ("maxUnderlyingDiff" in stepAsTradeStep && stepAsTradeStep.maxUnderlyingDiff !== void 0) invalidFields.push("maxUnderlyingDiff");
112
- if ("minUnderlyingDiff" in stepAsTradeStep && stepAsTradeStep.minUnderlyingDiff !== void 0) invalidFields.push("minUnderlyingDiff");
111
+ if ("maxUnderlyingChange" in stepAsTradeStep && stepAsTradeStep.maxUnderlyingChange !== void 0) invalidFields.push("maxUnderlyingChange");
112
+ if ("minUnderlyingChange" in stepAsTradeStep && stepAsTradeStep.minUnderlyingChange !== void 0) invalidFields.push("minUnderlyingChange");
113
113
  if (invalidFields.length > 0) {
114
114
  }
115
115
  return normalized;
@@ -35,23 +35,23 @@ function normalizeTradeStepBuy(step, options) {
35
35
  const isLowPriceMode = price <= 0.5;
36
36
  const isChaseMode = price > 0.5;
37
37
  if (isLowPriceMode) {
38
- if (step.maxUnderlyingDiff !== void 0) {
39
- if (step.maxUnderlyingDiff >= 1 && step.maxUnderlyingDiff <= 1e3) {
40
- normalized.maxUnderlyingDiff = step.maxUnderlyingDiff;
38
+ if (step.maxUnderlyingChange !== void 0) {
39
+ if (step.maxUnderlyingChange >= 1 && step.maxUnderlyingChange <= 1e3) {
40
+ normalized.maxUnderlyingChange = step.maxUnderlyingChange;
41
41
  } else {
42
42
  }
43
43
  }
44
- if (step.minUnderlyingDiff !== void 0) {
44
+ if (step.minUnderlyingChange !== void 0) {
45
45
  }
46
46
  }
47
47
  if (isChaseMode) {
48
- if (step.minUnderlyingDiff !== void 0) {
49
- if (step.minUnderlyingDiff >= 1 && step.minUnderlyingDiff <= 1e3) {
50
- normalized.minUnderlyingDiff = step.minUnderlyingDiff;
48
+ if (step.minUnderlyingChange !== void 0) {
49
+ if (step.minUnderlyingChange >= 1 && step.minUnderlyingChange <= 1e3) {
50
+ normalized.minUnderlyingChange = step.minUnderlyingChange;
51
51
  } else {
52
52
  }
53
53
  }
54
- if (step.maxUnderlyingDiff !== void 0) {
54
+ if (step.maxUnderlyingChange !== void 0) {
55
55
  }
56
56
  }
57
57
  return normalized;
@@ -85,8 +85,8 @@ function normalizeTradeStepSell(step, options) {
85
85
  const invalidFields = [];
86
86
  if ("once" in stepAsTradeStep && stepAsTradeStep.once !== void 0) invalidFields.push("once");
87
87
  if ("outcomeIndex" in stepAsTradeStep && stepAsTradeStep.outcomeIndex !== void 0) invalidFields.push("outcomeIndex");
88
- if ("maxUnderlyingDiff" in stepAsTradeStep && stepAsTradeStep.maxUnderlyingDiff !== void 0) invalidFields.push("maxUnderlyingDiff");
89
- if ("minUnderlyingDiff" in stepAsTradeStep && stepAsTradeStep.minUnderlyingDiff !== void 0) invalidFields.push("minUnderlyingDiff");
88
+ if ("maxUnderlyingChange" in stepAsTradeStep && stepAsTradeStep.maxUnderlyingChange !== void 0) invalidFields.push("maxUnderlyingChange");
89
+ if ("minUnderlyingChange" in stepAsTradeStep && stepAsTradeStep.minUnderlyingChange !== void 0) invalidFields.push("minUnderlyingChange");
90
90
  if (invalidFields.length > 0) {
91
91
  }
92
92
  return normalized;
@@ -8,7 +8,7 @@ interface PositionInfo {
8
8
  balance: string;
9
9
  }
10
10
 
11
- interface PriceDifferenceInfo {
11
+ interface PriceChangeInfo {
12
12
 
13
13
  start: number;
14
14
 
@@ -42,8 +42,8 @@ interface TradeStepBuy {
42
42
  end: number;
43
43
  once?: boolean;
44
44
  outcomeIndex?: 0 | 1;
45
- maxUnderlyingDiff?: number;
46
- minUnderlyingDiff?: number;
45
+ maxUnderlyingChange?: number;
46
+ minUnderlyingChange?: number;
47
47
  }
48
48
 
49
49
  interface TradeStepSell {
@@ -95,7 +95,7 @@ interface MarketTradeContext {
95
95
 
96
96
  tradeRecord: MarketTradeRecord;
97
97
 
98
- underlyingPrice: PriceDifferenceInfo | null;
98
+ underlyingPrice: PriceChangeInfo | null;
99
99
  }
100
100
 
101
101
  interface MarketTokenData extends MarketToken {
@@ -8,7 +8,7 @@ interface PositionInfo {
8
8
  balance: string;
9
9
  }
10
10
 
11
- interface PriceDifferenceInfo {
11
+ interface PriceChangeInfo {
12
12
 
13
13
  start: number;
14
14
 
@@ -42,8 +42,8 @@ interface TradeStepBuy {
42
42
  end: number;
43
43
  once?: boolean;
44
44
  outcomeIndex?: 0 | 1;
45
- maxUnderlyingDiff?: number;
46
- minUnderlyingDiff?: number;
45
+ maxUnderlyingChange?: number;
46
+ minUnderlyingChange?: number;
47
47
  }
48
48
 
49
49
  interface TradeStepSell {
@@ -95,7 +95,7 @@ interface MarketTradeContext {
95
95
 
96
96
  tradeRecord: MarketTradeRecord;
97
97
 
98
- underlyingPrice: PriceDifferenceInfo | null;
98
+ underlyingPrice: PriceChangeInfo | null;
99
99
  }
100
100
 
101
101
  interface MarketTokenData extends MarketToken {