@keystrokehq/polymarket 0.0.9 → 0.0.16-integration-id-canonicalization.0
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/README.md +5 -0
- package/dist/credential-sets/index.d.mts +2 -0
- package/dist/credential-sets/index.mjs +3 -0
- package/dist/{schemas-DGLbQgHc.mjs → data-g8Gt5cqR.mjs} +74 -164
- package/dist/index.d.mts +4 -372
- package/dist/index.mjs +4 -9
- package/dist/operations/index.d.mts +2 -0
- package/dist/operations/index.mjs +3 -0
- package/dist/{integration-B_E07iTd.d.mts → polymarket.credential-set-jU6p-ps3.d.mts} +5 -12
- package/dist/polymarket.credential-set-wbGYLp9q.mjs +19 -0
- package/dist/pricing-x-VWqR0L.d.mts +309 -0
- package/dist/schemas/index.d.mts +2 -0
- package/dist/schemas/index.mjs +3 -0
- package/dist/search-polymarket.operation-BW-S0mae.d.mts +700 -0
- package/dist/search-polymarket.operation-DPkjnHty.mjs +624 -0
- package/package.json +12 -28
- package/dist/_official/index.d.mts +0 -2
- package/dist/_official/index.mjs +0 -3
- package/dist/data.d.mts +0 -106
- package/dist/data.mjs +0 -114
- package/dist/discovery.d.mts +0 -81
- package/dist/discovery.mjs +0 -126
- package/dist/events.d.mts +0 -211
- package/dist/events.mjs +0 -69
- package/dist/integration-Bf-3OGOJ.mjs +0 -117
- package/dist/markets.d.mts +0 -152
- package/dist/markets.mjs +0 -69
- package/dist/orderbook.d.mts +0 -65
- package/dist/orderbook.mjs +0 -58
- package/dist/pricing.d.mts +0 -63
- package/dist/pricing.mjs +0 -105
package/dist/pricing.mjs
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { D as createPolymarketClient, E as polymarketOperation, g as priceHistoryResponseSchema, n as clobPriceSchema, r as clobPricesMapSchema, t as clobMidpointSchema } from "./schemas-DGLbQgHc.mjs";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
//#region src/pricing.ts
|
|
5
|
-
/**
|
|
6
|
-
* polymarket/pricing.ts
|
|
7
|
-
*
|
|
8
|
-
* Steps for pricing data via the CLOB API.
|
|
9
|
-
* Note: CLOB API returns prices as strings, not numbers.
|
|
10
|
-
*/
|
|
11
|
-
const getPrice = polymarketOperation({
|
|
12
|
-
id: "polymarket.get-polymarket-price",
|
|
13
|
-
name: "Get Polymarket Price",
|
|
14
|
-
description: "Get price for a token and side (BUY/SELL) via the CLOB API",
|
|
15
|
-
input: z.object({
|
|
16
|
-
tokenID: z.string(),
|
|
17
|
-
side: z.enum(["BUY", "SELL"])
|
|
18
|
-
}),
|
|
19
|
-
output: clobPriceSchema,
|
|
20
|
-
run: async (input, credentials) => {
|
|
21
|
-
return createPolymarketClient(credentials).request({
|
|
22
|
-
host: "clob",
|
|
23
|
-
method: "GET",
|
|
24
|
-
path: "/price",
|
|
25
|
-
query: {
|
|
26
|
-
token_id: input.tokenID,
|
|
27
|
-
side: input.side
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
const getMidpoint = polymarketOperation({
|
|
33
|
-
id: "polymarket.get-polymarket-midpoint",
|
|
34
|
-
name: "Get Polymarket Midpoint",
|
|
35
|
-
description: "Get midpoint price for a token via the CLOB API",
|
|
36
|
-
input: z.object({ tokenID: z.string() }),
|
|
37
|
-
output: clobMidpointSchema,
|
|
38
|
-
run: async (input, credentials) => {
|
|
39
|
-
return createPolymarketClient(credentials).request({
|
|
40
|
-
host: "clob",
|
|
41
|
-
method: "GET",
|
|
42
|
-
path: "/midpoint",
|
|
43
|
-
query: { token_id: input.tokenID }
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
const listPrices = polymarketOperation({
|
|
48
|
-
id: "polymarket.list-polymarket-prices",
|
|
49
|
-
name: "List Polymarket Prices",
|
|
50
|
-
description: "Get all current prices via the CLOB API",
|
|
51
|
-
input: z.object({}),
|
|
52
|
-
output: clobPricesMapSchema,
|
|
53
|
-
run: async (_input, credentials) => {
|
|
54
|
-
return createPolymarketClient(credentials).request({
|
|
55
|
-
host: "clob",
|
|
56
|
-
method: "GET",
|
|
57
|
-
path: "/prices"
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
const batchGetPrices = polymarketOperation({
|
|
62
|
-
id: "polymarket.batch-get-polymarket-prices",
|
|
63
|
-
name: "Batch Get Polymarket Prices",
|
|
64
|
-
description: "Get prices for multiple tokens (max 500) via the CLOB API",
|
|
65
|
-
input: z.object({ tokenIDs: z.array(z.string()).max(500) }),
|
|
66
|
-
output: clobPricesMapSchema,
|
|
67
|
-
run: async (input, credentials) => {
|
|
68
|
-
return createPolymarketClient(credentials).request({
|
|
69
|
-
host: "clob",
|
|
70
|
-
method: "POST",
|
|
71
|
-
path: "/prices",
|
|
72
|
-
body: input.tokenIDs
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
const getPriceHistory = polymarketOperation({
|
|
77
|
-
id: "polymarket.get-polymarket-price-history",
|
|
78
|
-
name: "Get Polymarket Price History",
|
|
79
|
-
description: "Get historical prices with interval/fidelity via the CLOB API",
|
|
80
|
-
input: z.object({
|
|
81
|
-
tokenID: z.string(),
|
|
82
|
-
interval: z.string().optional(),
|
|
83
|
-
fidelity: z.number().optional(),
|
|
84
|
-
startTs: z.number().optional(),
|
|
85
|
-
endTs: z.number().optional()
|
|
86
|
-
}),
|
|
87
|
-
output: priceHistoryResponseSchema,
|
|
88
|
-
run: async (input, credentials) => {
|
|
89
|
-
return createPolymarketClient(credentials).request({
|
|
90
|
-
host: "clob",
|
|
91
|
-
method: "GET",
|
|
92
|
-
path: "/prices-history",
|
|
93
|
-
query: {
|
|
94
|
-
market: input.tokenID,
|
|
95
|
-
interval: input.interval,
|
|
96
|
-
fidelity: input.fidelity,
|
|
97
|
-
startTs: input.startTs,
|
|
98
|
-
endTs: input.endTs
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
//#endregion
|
|
105
|
-
export { batchGetPrices, getMidpoint, getPrice, getPriceHistory, listPrices };
|