@polymarbot/shared 0.1.2 → 0.1.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.1.2",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "main": "./basic.cjs",
6
6
  "module": "./basic.js",
@@ -57,8 +57,8 @@ function normalizeTradeStepBuy(step, options) {
57
57
  if (step.once === true) {
58
58
  normalized.once = true;
59
59
  }
60
- if (step.outcome === "Up" || step.outcome === "Down") {
61
- normalized.outcome = step.outcome;
60
+ if (step.outcomeIndex === 0 || step.outcomeIndex === 1) {
61
+ normalized.outcomeIndex = step.outcomeIndex;
62
62
  }
63
63
  const isLowPriceMode = price <= 0.5;
64
64
  const isChaseMode = price > 0.5;
@@ -112,7 +112,7 @@ function normalizeTradeStepSell(step, options) {
112
112
  const stepAsTradeStep = step;
113
113
  const invalidFields = [];
114
114
  if ("once" in stepAsTradeStep && stepAsTradeStep.once !== void 0) invalidFields.push("once");
115
- if ("outcome" in stepAsTradeStep && stepAsTradeStep.outcome !== void 0) invalidFields.push("outcome");
115
+ if ("outcomeIndex" in stepAsTradeStep && stepAsTradeStep.outcomeIndex !== void 0) invalidFields.push("outcomeIndex");
116
116
  if ("maxUnderlyingDiff" in stepAsTradeStep && stepAsTradeStep.maxUnderlyingDiff !== void 0) invalidFields.push("maxUnderlyingDiff");
117
117
  if ("minUnderlyingDiff" in stepAsTradeStep && stepAsTradeStep.minUnderlyingDiff !== void 0) invalidFields.push("minUnderlyingDiff");
118
118
  if (invalidFields.length > 0) {
@@ -31,8 +31,8 @@ function normalizeTradeStepBuy(step, options) {
31
31
  if (step.once === true) {
32
32
  normalized.once = true;
33
33
  }
34
- if (step.outcome === "Up" || step.outcome === "Down") {
35
- normalized.outcome = step.outcome;
34
+ if (step.outcomeIndex === 0 || step.outcomeIndex === 1) {
35
+ normalized.outcomeIndex = step.outcomeIndex;
36
36
  }
37
37
  const isLowPriceMode = price <= 0.5;
38
38
  const isChaseMode = price > 0.5;
@@ -86,7 +86,7 @@ function normalizeTradeStepSell(step, options) {
86
86
  const stepAsTradeStep = step;
87
87
  const invalidFields = [];
88
88
  if ("once" in stepAsTradeStep && stepAsTradeStep.once !== void 0) invalidFields.push("once");
89
- if ("outcome" in stepAsTradeStep && stepAsTradeStep.outcome !== void 0) invalidFields.push("outcome");
89
+ if ("outcomeIndex" in stepAsTradeStep && stepAsTradeStep.outcomeIndex !== void 0) invalidFields.push("outcomeIndex");
90
90
  if ("maxUnderlyingDiff" in stepAsTradeStep && stepAsTradeStep.maxUnderlyingDiff !== void 0) invalidFields.push("maxUnderlyingDiff");
91
91
  if ("minUnderlyingDiff" in stepAsTradeStep && stepAsTradeStep.minUnderlyingDiff !== void 0) invalidFields.push("minUnderlyingDiff");
92
92
  if (invalidFields.length > 0) {
@@ -94,7 +94,7 @@ interface TradeStepBuy {
94
94
  start: number;
95
95
  end: number;
96
96
  once?: boolean;
97
- outcome?: 'Up' | 'Down';
97
+ outcomeIndex?: 0 | 1;
98
98
  maxUnderlyingDiff?: number;
99
99
  minUnderlyingDiff?: number;
100
100
  }
@@ -94,7 +94,7 @@ interface TradeStepBuy {
94
94
  start: number;
95
95
  end: number;
96
96
  once?: boolean;
97
- outcome?: 'Up' | 'Down';
97
+ outcomeIndex?: 0 | 1;
98
98
  maxUnderlyingDiff?: number;
99
99
  minUnderlyingDiff?: number;
100
100
  }