@polymarbot/shared 0.1.4 → 0.2.1

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.
@@ -0,0 +1,20 @@
1
+ // src/utils/markets/types.ts
2
+ var SupportedSymbol = /* @__PURE__ */ ((SupportedSymbol2) => {
3
+ SupportedSymbol2["ETH"] = "eth";
4
+ SupportedSymbol2["BTC"] = "btc";
5
+ SupportedSymbol2["SOL"] = "sol";
6
+ SupportedSymbol2["XRP"] = "xrp";
7
+ return SupportedSymbol2;
8
+ })(SupportedSymbol || {});
9
+ var SupportedInterval = /* @__PURE__ */ ((SupportedInterval2) => {
10
+ SupportedInterval2["M15"] = "15m";
11
+ SupportedInterval2["H1"] = "1h";
12
+ SupportedInterval2["H4"] = "4h";
13
+ SupportedInterval2["D1"] = "1d";
14
+ return SupportedInterval2;
15
+ })(SupportedInterval || {});
16
+
17
+ export {
18
+ SupportedSymbol,
19
+ SupportedInterval
20
+ };
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/utils/markets/tools.ts
31
+ var tools_exports = {};
32
+ __export(tools_exports, {
33
+ SUPPORTED_SYMBOLS: () => SUPPORTED_SYMBOLS,
34
+ SYMBOL_FULL_NAME_MAP: () => SYMBOL_FULL_NAME_MAP,
35
+ calculatePeriodStartInET: () => calculatePeriodStartInET,
36
+ generate15mSlug: () => generate15mSlug,
37
+ generate1dSlug: () => generate1dSlug,
38
+ generate1hSlug: () => generate1hSlug,
39
+ generate4hSlug: () => generate4hSlug,
40
+ generateMarketUrl: () => generateMarketUrl
41
+ });
42
+ module.exports = __toCommonJS(tools_exports);
43
+
44
+ // src/utils/dayjs.ts
45
+ var import_dayjs = __toESM(require("dayjs"), 1);
46
+ var import_utc = __toESM(require("dayjs/plugin/utc"), 1);
47
+ var import_timezone = __toESM(require("dayjs/plugin/timezone"), 1);
48
+ var import_duration = __toESM(require("dayjs/plugin/duration"), 1);
49
+ import_dayjs.default.extend(import_utc.default);
50
+ import_dayjs.default.extend(import_timezone.default);
51
+ import_dayjs.default.extend(import_duration.default);
52
+ var dayjs_default = import_dayjs.default;
53
+
54
+ // src/utils/markets/types.ts
55
+ var SupportedSymbol = /* @__PURE__ */ ((SupportedSymbol2) => {
56
+ SupportedSymbol2["ETH"] = "eth";
57
+ SupportedSymbol2["BTC"] = "btc";
58
+ SupportedSymbol2["SOL"] = "sol";
59
+ SupportedSymbol2["XRP"] = "xrp";
60
+ return SupportedSymbol2;
61
+ })(SupportedSymbol || {});
62
+
63
+ // src/utils/markets/tools.ts
64
+ var SUPPORTED_SYMBOLS = Object.values(SupportedSymbol);
65
+ var SYMBOL_FULL_NAME_MAP = {
66
+ ["eth" /* ETH */]: "ethereum",
67
+ ["btc" /* BTC */]: "bitcoin",
68
+ ["sol" /* SOL */]: "solana"
69
+ };
70
+ var MONTH_NAMES = [
71
+ "january",
72
+ "february",
73
+ "march",
74
+ "april",
75
+ "may",
76
+ "june",
77
+ "july",
78
+ "august",
79
+ "september",
80
+ "october",
81
+ "november",
82
+ "december"
83
+ ];
84
+ function generateMarketUrl(slug) {
85
+ return `https://polymarket.com/event/${slug}`;
86
+ }
87
+ function generate15mSlug(timestamp, symbol) {
88
+ const prefix = symbol.toLowerCase();
89
+ return `${prefix}-updown-15m-${timestamp}`;
90
+ }
91
+ function generate1hSlug(timestamp, symbol) {
92
+ const prefix = SYMBOL_FULL_NAME_MAP[symbol] || symbol.toLowerCase();
93
+ const etTime = dayjs_default.unix(timestamp).tz("America/New_York");
94
+ const month = etTime.format("MMMM").toLowerCase();
95
+ const day = etTime.date();
96
+ const hour = etTime.format("h");
97
+ const ampm = etTime.format("a");
98
+ return `${prefix}-up-or-down-${month}-${day}-${hour}${ampm}-et`;
99
+ }
100
+ function generate4hSlug(timestamp, symbol) {
101
+ const prefix = symbol.toLowerCase();
102
+ return `${prefix}-updown-4h-${timestamp}`;
103
+ }
104
+ function generate1dSlug(timestamp, symbol) {
105
+ const prefix = SYMBOL_FULL_NAME_MAP[symbol] || symbol.toLowerCase();
106
+ const date = new Date(timestamp * 1e3);
107
+ const month = MONTH_NAMES[date.getUTCMonth()];
108
+ const day = date.getUTCDate();
109
+ return `${prefix}-up-or-down-on-${month}-${day}`;
110
+ }
111
+ function calculatePeriodStartInET(intervalSeconds) {
112
+ const now = Math.floor(Date.now() / 1e3);
113
+ const utcTime = dayjs_default.unix(now).utc();
114
+ const etTime = dayjs_default.unix(now).tz("America/New_York");
115
+ const offset = utcTime.utcOffset() * 60 - etTime.utcOffset() * 60;
116
+ const nowInET = now - offset;
117
+ const periodStartInET = Math.floor(nowInET / intervalSeconds) * intervalSeconds;
118
+ return periodStartInET + offset;
119
+ }
120
+ // Annotate the CommonJS export names for ESM import in node:
121
+ 0 && (module.exports = {
122
+ SUPPORTED_SYMBOLS,
123
+ SYMBOL_FULL_NAME_MAP,
124
+ calculatePeriodStartInET,
125
+ generate15mSlug,
126
+ generate1dSlug,
127
+ generate1hSlug,
128
+ generate4hSlug,
129
+ generateMarketUrl
130
+ });
@@ -0,0 +1,18 @@
1
+ import { SupportedSymbol, SymbolFullNameMap } from './types.cjs';
2
+
3
+ declare const SUPPORTED_SYMBOLS: SupportedSymbol[];
4
+ declare const SYMBOL_FULL_NAME_MAP: SymbolFullNameMap;
5
+
6
+ declare function generateMarketUrl(slug: string): string;
7
+
8
+ declare function generate15mSlug(timestamp: number, symbol: SupportedSymbol): string;
9
+
10
+ declare function generate1hSlug(timestamp: number, symbol: SupportedSymbol): string;
11
+
12
+ declare function generate4hSlug(timestamp: number, symbol: SupportedSymbol): string;
13
+
14
+ declare function generate1dSlug(timestamp: number, symbol: SupportedSymbol): string;
15
+
16
+ declare function calculatePeriodStartInET(intervalSeconds: number): number;
17
+
18
+ export { SUPPORTED_SYMBOLS, SYMBOL_FULL_NAME_MAP, calculatePeriodStartInET, generate15mSlug, generate1dSlug, generate1hSlug, generate4hSlug, generateMarketUrl };
@@ -0,0 +1,18 @@
1
+ import { SupportedSymbol, SymbolFullNameMap } from './types.js';
2
+
3
+ declare const SUPPORTED_SYMBOLS: SupportedSymbol[];
4
+ declare const SYMBOL_FULL_NAME_MAP: SymbolFullNameMap;
5
+
6
+ declare function generateMarketUrl(slug: string): string;
7
+
8
+ declare function generate15mSlug(timestamp: number, symbol: SupportedSymbol): string;
9
+
10
+ declare function generate1hSlug(timestamp: number, symbol: SupportedSymbol): string;
11
+
12
+ declare function generate4hSlug(timestamp: number, symbol: SupportedSymbol): string;
13
+
14
+ declare function generate1dSlug(timestamp: number, symbol: SupportedSymbol): string;
15
+
16
+ declare function calculatePeriodStartInET(intervalSeconds: number): number;
17
+
18
+ export { SUPPORTED_SYMBOLS, SYMBOL_FULL_NAME_MAP, calculatePeriodStartInET, generate15mSlug, generate1dSlug, generate1hSlug, generate4hSlug, generateMarketUrl };
@@ -0,0 +1,81 @@
1
+ import {
2
+ SupportedSymbol
3
+ } from "../chunk-S6EEUHHX.js";
4
+
5
+ // src/utils/dayjs.ts
6
+ import dayjs from "dayjs";
7
+ import utc from "dayjs/plugin/utc";
8
+ import timezone from "dayjs/plugin/timezone";
9
+ import duration from "dayjs/plugin/duration";
10
+ dayjs.extend(utc);
11
+ dayjs.extend(timezone);
12
+ dayjs.extend(duration);
13
+ var dayjs_default = dayjs;
14
+
15
+ // src/utils/markets/tools.ts
16
+ var SUPPORTED_SYMBOLS = Object.values(SupportedSymbol);
17
+ var SYMBOL_FULL_NAME_MAP = {
18
+ ["eth" /* ETH */]: "ethereum",
19
+ ["btc" /* BTC */]: "bitcoin",
20
+ ["sol" /* SOL */]: "solana"
21
+ };
22
+ var MONTH_NAMES = [
23
+ "january",
24
+ "february",
25
+ "march",
26
+ "april",
27
+ "may",
28
+ "june",
29
+ "july",
30
+ "august",
31
+ "september",
32
+ "october",
33
+ "november",
34
+ "december"
35
+ ];
36
+ function generateMarketUrl(slug) {
37
+ return `https://polymarket.com/event/${slug}`;
38
+ }
39
+ function generate15mSlug(timestamp, symbol) {
40
+ const prefix = symbol.toLowerCase();
41
+ return `${prefix}-updown-15m-${timestamp}`;
42
+ }
43
+ function generate1hSlug(timestamp, symbol) {
44
+ const prefix = SYMBOL_FULL_NAME_MAP[symbol] || symbol.toLowerCase();
45
+ const etTime = dayjs_default.unix(timestamp).tz("America/New_York");
46
+ const month = etTime.format("MMMM").toLowerCase();
47
+ const day = etTime.date();
48
+ const hour = etTime.format("h");
49
+ const ampm = etTime.format("a");
50
+ return `${prefix}-up-or-down-${month}-${day}-${hour}${ampm}-et`;
51
+ }
52
+ function generate4hSlug(timestamp, symbol) {
53
+ const prefix = symbol.toLowerCase();
54
+ return `${prefix}-updown-4h-${timestamp}`;
55
+ }
56
+ function generate1dSlug(timestamp, symbol) {
57
+ const prefix = SYMBOL_FULL_NAME_MAP[symbol] || symbol.toLowerCase();
58
+ const date = new Date(timestamp * 1e3);
59
+ const month = MONTH_NAMES[date.getUTCMonth()];
60
+ const day = date.getUTCDate();
61
+ return `${prefix}-up-or-down-on-${month}-${day}`;
62
+ }
63
+ function calculatePeriodStartInET(intervalSeconds) {
64
+ const now = Math.floor(Date.now() / 1e3);
65
+ const utcTime = dayjs_default.unix(now).utc();
66
+ const etTime = dayjs_default.unix(now).tz("America/New_York");
67
+ const offset = utcTime.utcOffset() * 60 - etTime.utcOffset() * 60;
68
+ const nowInET = now - offset;
69
+ const periodStartInET = Math.floor(nowInET / intervalSeconds) * intervalSeconds;
70
+ return periodStartInET + offset;
71
+ }
72
+ export {
73
+ SUPPORTED_SYMBOLS,
74
+ SYMBOL_FULL_NAME_MAP,
75
+ calculatePeriodStartInET,
76
+ generate15mSlug,
77
+ generate1dSlug,
78
+ generate1hSlug,
79
+ generate4hSlug,
80
+ generateMarketUrl
81
+ };
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/utils/markets/types.ts
21
+ var types_exports = {};
22
+ __export(types_exports, {
23
+ SupportedInterval: () => SupportedInterval,
24
+ SupportedSymbol: () => SupportedSymbol
25
+ });
26
+ module.exports = __toCommonJS(types_exports);
27
+ var SupportedSymbol = /* @__PURE__ */ ((SupportedSymbol2) => {
28
+ SupportedSymbol2["ETH"] = "eth";
29
+ SupportedSymbol2["BTC"] = "btc";
30
+ SupportedSymbol2["SOL"] = "sol";
31
+ SupportedSymbol2["XRP"] = "xrp";
32
+ return SupportedSymbol2;
33
+ })(SupportedSymbol || {});
34
+ var SupportedInterval = /* @__PURE__ */ ((SupportedInterval2) => {
35
+ SupportedInterval2["M15"] = "15m";
36
+ SupportedInterval2["H1"] = "1h";
37
+ SupportedInterval2["H4"] = "4h";
38
+ SupportedInterval2["D1"] = "1d";
39
+ return SupportedInterval2;
40
+ })(SupportedInterval || {});
41
+ // Annotate the CommonJS export names for ESM import in node:
42
+ 0 && (module.exports = {
43
+ SupportedInterval,
44
+ SupportedSymbol
45
+ });
@@ -0,0 +1,75 @@
1
+ declare enum SupportedSymbol {
2
+ ETH = "eth",
3
+ BTC = "btc",
4
+ SOL = "sol",
5
+ XRP = "xrp"
6
+ }
7
+ declare enum SupportedInterval {
8
+ M15 = "15m",
9
+ H1 = "1h",
10
+ H4 = "4h",
11
+ D1 = "1d"
12
+ }
13
+ interface MarketConfig {
14
+ marketName: string;
15
+ symbol: SupportedSymbol;
16
+ interval: SupportedInterval;
17
+ intervalName: string;
18
+ intervalSeconds: number;
19
+ generateSlug: (timestamp: number) => string;
20
+ }
21
+ interface RawMarketData {
22
+ id: string;
23
+ conditionId: string;
24
+ question: string;
25
+ slug: string;
26
+ eventStartTime: string;
27
+ endDate: string;
28
+ active: boolean;
29
+ closed: boolean;
30
+ umaResolutionStatus?: string;
31
+ customLiveness?: number;
32
+ outcomes: string;
33
+ outcomePrices?: string;
34
+ clobTokenIds?: string;
35
+ orderPriceMinTickSize: number;
36
+ orderMinSize: number;
37
+ negRisk: boolean;
38
+ volume: string;
39
+ liquidity: string;
40
+ bestBid?: number;
41
+ bestAsk?: number;
42
+ }
43
+ interface Market {
44
+ id: string;
45
+ conditionId: string;
46
+ question: string;
47
+ slug: string;
48
+ url: string;
49
+ startTimestamp: number;
50
+ endTimestamp: number;
51
+ orderMinSize: number;
52
+ orderPriceMinTickSize: number;
53
+ negRisk: boolean;
54
+ outcomes: string[];
55
+ clobTokenIds: string[];
56
+ marketName: string;
57
+ symbol: SupportedSymbol;
58
+ interval: SupportedInterval;
59
+ intervalName: string | null;
60
+ raw: RawMarketData;
61
+ }
62
+ interface IntervalConfig {
63
+ name: string;
64
+ seconds: number;
65
+ generateSlug: (timestamp: number, symbol: SupportedSymbol) => string;
66
+ }
67
+ type SymbolFullNameMap = {
68
+ [key in SupportedSymbol]?: string;
69
+ };
70
+ interface MarketToken {
71
+ id: string;
72
+ name: string;
73
+ }
74
+
75
+ export { type IntervalConfig, type Market, type MarketConfig, type MarketToken, type RawMarketData, SupportedInterval, SupportedSymbol, type SymbolFullNameMap };
@@ -0,0 +1,75 @@
1
+ declare enum SupportedSymbol {
2
+ ETH = "eth",
3
+ BTC = "btc",
4
+ SOL = "sol",
5
+ XRP = "xrp"
6
+ }
7
+ declare enum SupportedInterval {
8
+ M15 = "15m",
9
+ H1 = "1h",
10
+ H4 = "4h",
11
+ D1 = "1d"
12
+ }
13
+ interface MarketConfig {
14
+ marketName: string;
15
+ symbol: SupportedSymbol;
16
+ interval: SupportedInterval;
17
+ intervalName: string;
18
+ intervalSeconds: number;
19
+ generateSlug: (timestamp: number) => string;
20
+ }
21
+ interface RawMarketData {
22
+ id: string;
23
+ conditionId: string;
24
+ question: string;
25
+ slug: string;
26
+ eventStartTime: string;
27
+ endDate: string;
28
+ active: boolean;
29
+ closed: boolean;
30
+ umaResolutionStatus?: string;
31
+ customLiveness?: number;
32
+ outcomes: string;
33
+ outcomePrices?: string;
34
+ clobTokenIds?: string;
35
+ orderPriceMinTickSize: number;
36
+ orderMinSize: number;
37
+ negRisk: boolean;
38
+ volume: string;
39
+ liquidity: string;
40
+ bestBid?: number;
41
+ bestAsk?: number;
42
+ }
43
+ interface Market {
44
+ id: string;
45
+ conditionId: string;
46
+ question: string;
47
+ slug: string;
48
+ url: string;
49
+ startTimestamp: number;
50
+ endTimestamp: number;
51
+ orderMinSize: number;
52
+ orderPriceMinTickSize: number;
53
+ negRisk: boolean;
54
+ outcomes: string[];
55
+ clobTokenIds: string[];
56
+ marketName: string;
57
+ symbol: SupportedSymbol;
58
+ interval: SupportedInterval;
59
+ intervalName: string | null;
60
+ raw: RawMarketData;
61
+ }
62
+ interface IntervalConfig {
63
+ name: string;
64
+ seconds: number;
65
+ generateSlug: (timestamp: number, symbol: SupportedSymbol) => string;
66
+ }
67
+ type SymbolFullNameMap = {
68
+ [key in SupportedSymbol]?: string;
69
+ };
70
+ interface MarketToken {
71
+ id: string;
72
+ name: string;
73
+ }
74
+
75
+ export { type IntervalConfig, type Market, type MarketConfig, type MarketToken, type RawMarketData, SupportedInterval, SupportedSymbol, type SymbolFullNameMap };
@@ -0,0 +1,8 @@
1
+ import {
2
+ SupportedInterval,
3
+ SupportedSymbol
4
+ } from "../chunk-S6EEUHHX.js";
5
+ export {
6
+ SupportedInterval,
7
+ SupportedSymbol
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polymarbot/shared",
3
- "version": "0.1.4",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "main": "./basic.cjs",
6
6
  "module": "./basic.js",
@@ -16,6 +16,26 @@
16
16
  "default": "./basic.cjs"
17
17
  }
18
18
  },
19
+ "./markets/tools": {
20
+ "import": {
21
+ "types": "./markets/tools.d.ts",
22
+ "default": "./markets/tools.js"
23
+ },
24
+ "require": {
25
+ "types": "./markets/tools.d.cts",
26
+ "default": "./markets/tools.cjs"
27
+ }
28
+ },
29
+ "./markets/types": {
30
+ "import": {
31
+ "types": "./markets/types.d.ts",
32
+ "default": "./markets/types.js"
33
+ },
34
+ "require": {
35
+ "types": "./markets/types.d.cts",
36
+ "default": "./markets/types.cjs"
37
+ }
38
+ },
19
39
  "./relayer-client": {
20
40
  "import": {
21
41
  "types": "./relayer-client.d.ts",
@@ -64,6 +84,7 @@
64
84
  "**/*.d.cts"
65
85
  ],
66
86
  "dependencies": {
87
+ "dayjs": "^1.11.19",
67
88
  "viem": "^2.38.6",
68
89
  "@polymarket/builder-relayer-client": "^0.0.6",
69
90
  "@polymarket/builder-signing-sdk": "^0.0.8"
@@ -1,5 +1,6 @@
1
1
  import { StrategyConfig } from './types.cjs';
2
2
  import '@polymarket/clob-client';
3
+ import '../markets/types.cjs';
3
4
 
4
5
  interface NormalizeStrategyOptions {
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { StrategyConfig } from './types.js';
2
2
  import '@polymarket/clob-client';
3
+ import '../markets/types.js';
3
4
 
4
5
  interface NormalizeStrategyOptions {
5
6
 
@@ -1,62 +1,5 @@
1
1
  import { ClobClient } from '@polymarket/clob-client';
2
-
3
- declare enum SupportedSymbol {
4
- ETH = "eth",
5
- BTC = "btc",
6
- SOL = "sol",
7
- XRP = "xrp"
8
- }
9
- declare enum SupportedInterval {
10
- M15 = "15m",
11
- H1 = "1h",
12
- H4 = "4h",
13
- D1 = "1d"
14
- }
15
- interface RawMarketData {
16
- id: string;
17
- conditionId: string;
18
- question: string;
19
- slug: string;
20
- eventStartTime: string;
21
- endDate: string;
22
- active: boolean;
23
- closed: boolean;
24
- umaResolutionStatus?: string;
25
- customLiveness?: number;
26
- outcomes: string;
27
- outcomePrices?: string;
28
- clobTokenIds?: string;
29
- orderPriceMinTickSize: number;
30
- orderMinSize: number;
31
- negRisk: boolean;
32
- volume: string;
33
- liquidity: string;
34
- bestBid?: number;
35
- bestAsk?: number;
36
- }
37
- interface Market {
38
- id: string;
39
- conditionId: string;
40
- question: string;
41
- slug: string;
42
- url: string;
43
- startTimestamp: number;
44
- endTimestamp: number;
45
- orderMinSize: number;
46
- orderPriceMinTickSize: number;
47
- negRisk: boolean;
48
- outcomes: string[];
49
- clobTokenIds: string[];
50
- marketName: string;
51
- symbol: SupportedSymbol;
52
- interval: SupportedInterval;
53
- intervalName: string | null;
54
- raw: RawMarketData;
55
- }
56
- interface MarketToken {
57
- id: string;
58
- name: string;
59
- }
2
+ import { Market, MarketToken } from '../markets/types.cjs';
60
3
 
61
4
  interface PositionInfo {
62
5
 
@@ -1,62 +1,5 @@
1
1
  import { ClobClient } from '@polymarket/clob-client';
2
-
3
- declare enum SupportedSymbol {
4
- ETH = "eth",
5
- BTC = "btc",
6
- SOL = "sol",
7
- XRP = "xrp"
8
- }
9
- declare enum SupportedInterval {
10
- M15 = "15m",
11
- H1 = "1h",
12
- H4 = "4h",
13
- D1 = "1d"
14
- }
15
- interface RawMarketData {
16
- id: string;
17
- conditionId: string;
18
- question: string;
19
- slug: string;
20
- eventStartTime: string;
21
- endDate: string;
22
- active: boolean;
23
- closed: boolean;
24
- umaResolutionStatus?: string;
25
- customLiveness?: number;
26
- outcomes: string;
27
- outcomePrices?: string;
28
- clobTokenIds?: string;
29
- orderPriceMinTickSize: number;
30
- orderMinSize: number;
31
- negRisk: boolean;
32
- volume: string;
33
- liquidity: string;
34
- bestBid?: number;
35
- bestAsk?: number;
36
- }
37
- interface Market {
38
- id: string;
39
- conditionId: string;
40
- question: string;
41
- slug: string;
42
- url: string;
43
- startTimestamp: number;
44
- endTimestamp: number;
45
- orderMinSize: number;
46
- orderPriceMinTickSize: number;
47
- negRisk: boolean;
48
- outcomes: string[];
49
- clobTokenIds: string[];
50
- marketName: string;
51
- symbol: SupportedSymbol;
52
- interval: SupportedInterval;
53
- intervalName: string | null;
54
- raw: RawMarketData;
55
- }
56
- interface MarketToken {
57
- id: string;
58
- name: string;
59
- }
2
+ import { Market, MarketToken } from '../markets/types.js';
60
3
 
61
4
  interface PositionInfo {
62
5