pandora-cli-skills 1.1.63 → 1.1.64
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/SKILL.md +1 -1
- package/cli/lib/polymarket_adapter.cjs +15 -4
- package/cli/lib/polymarket_trade_adapter.cjs +16 -10
- package/package.json +1 -1
package/SKILL.md
CHANGED
|
@@ -14,6 +14,19 @@ function toTimestampSeconds(value) {
|
|
|
14
14
|
return Math.floor(parsed / 1000);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
function resolvePolymarketTimestampValue(row) {
|
|
18
|
+
if (!row || typeof row !== 'object') return null;
|
|
19
|
+
return (
|
|
20
|
+
row.game_start_time ||
|
|
21
|
+
row.gameStartTime ||
|
|
22
|
+
row.endDateIso ||
|
|
23
|
+
row.end_date_iso ||
|
|
24
|
+
row.endDate ||
|
|
25
|
+
row.closedTime ||
|
|
26
|
+
null
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
17
30
|
function normalizeTokens(tokens) {
|
|
18
31
|
if (!Array.isArray(tokens) || !tokens.length) {
|
|
19
32
|
return { yes: null, no: null, diagnostics: ['No token prices available from Polymarket market payload.'] };
|
|
@@ -92,9 +105,7 @@ function mapGammaRow(row) {
|
|
|
92
105
|
const marketId = row && (row.conditionId || row.condition_id || row.id || row.questionID) ? String(
|
|
93
106
|
row.conditionId || row.condition_id || row.id || row.questionID,
|
|
94
107
|
) : null;
|
|
95
|
-
const closeTimestamp = toTimestampSeconds(
|
|
96
|
-
row && (row.endDateIso || row.end_date_iso || row.endDate || row.game_start_time || row.closedTime),
|
|
97
|
-
);
|
|
108
|
+
const closeTimestamp = toTimestampSeconds(resolvePolymarketTimestampValue(row));
|
|
98
109
|
return {
|
|
99
110
|
legId: `polymarket:${String(marketId || '')}`,
|
|
100
111
|
venue: 'polymarket',
|
|
@@ -123,7 +134,7 @@ function mapPolymarketRow(row) {
|
|
|
123
134
|
venue: 'polymarket',
|
|
124
135
|
marketId,
|
|
125
136
|
question,
|
|
126
|
-
closeTimestamp: toTimestampSeconds(row
|
|
137
|
+
closeTimestamp: toTimestampSeconds(resolvePolymarketTimestampValue(row)),
|
|
127
138
|
yesPct: mapped.yes,
|
|
128
139
|
noPct: mapped.no,
|
|
129
140
|
liquidityUsd: null,
|
|
@@ -49,6 +49,21 @@ function toTimestampSeconds(value) {
|
|
|
49
49
|
return numeric > 1e12 ? Math.floor(numeric / 1000) : Math.floor(numeric);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
function resolvePolymarketEventTimestamp(row) {
|
|
53
|
+
if (!row || typeof row !== 'object') return null;
|
|
54
|
+
return (
|
|
55
|
+
row.game_start_time ||
|
|
56
|
+
row.gameStartTime ||
|
|
57
|
+
row.end_date_iso ||
|
|
58
|
+
row.endDateIso ||
|
|
59
|
+
row.endDate ||
|
|
60
|
+
row.end_date ||
|
|
61
|
+
row.accepting_orders_timestamp ||
|
|
62
|
+
row.closeTime ||
|
|
63
|
+
null
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
52
67
|
function normalizeHostList(hostInput) {
|
|
53
68
|
const rawValues = Array.isArray(hostInput) ? hostInput : String(hostInput || '').split(',');
|
|
54
69
|
const hosts = rawValues
|
|
@@ -409,16 +424,7 @@ function normalizeMarketRow(row) {
|
|
|
409
424
|
eventSlug: toStringOrNull(row && (row.event_slug || row.eventSlug)),
|
|
410
425
|
eventTitle: toStringOrNull(row && (row.event_title || row.eventTitle)),
|
|
411
426
|
description: rulesSections.length ? rulesSections.join('\n\n') : null,
|
|
412
|
-
closeTimestamp: toTimestampSeconds(
|
|
413
|
-
row &&
|
|
414
|
-
(row.end_date_iso ||
|
|
415
|
-
row.endDate ||
|
|
416
|
-
row.end_date ||
|
|
417
|
-
row.endDateIso ||
|
|
418
|
-
row.accepting_orders_timestamp ||
|
|
419
|
-
row.game_start_time ||
|
|
420
|
-
row.closeTime),
|
|
421
|
-
),
|
|
427
|
+
closeTimestamp: toTimestampSeconds(resolvePolymarketEventTimestamp(row)),
|
|
422
428
|
yesPct: tokens.yes,
|
|
423
429
|
noPct: tokens.no,
|
|
424
430
|
yesTokenId: tokens.yesTokenId,
|