@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/events.mjs
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { D as createPolymarketClient, E as polymarketOperation, i as eventSchema, o as listEventsParamsSchema, w as tagSchema } from "./schemas-DGLbQgHc.mjs";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
//#region src/events.ts
|
|
5
|
-
/**
|
|
6
|
-
* polymarket/events.ts
|
|
7
|
-
*
|
|
8
|
-
* Steps for listing, getting, and querying Polymarket events via the Gamma API.
|
|
9
|
-
*/
|
|
10
|
-
const listEvents = polymarketOperation({
|
|
11
|
-
id: "polymarket.list-polymarket-events",
|
|
12
|
-
name: "List Polymarket Events",
|
|
13
|
-
description: "List and filter events with query params via the Gamma API",
|
|
14
|
-
input: listEventsParamsSchema,
|
|
15
|
-
output: z.array(eventSchema),
|
|
16
|
-
run: async (input, credentials) => {
|
|
17
|
-
return createPolymarketClient(credentials).request({
|
|
18
|
-
host: "gamma",
|
|
19
|
-
method: "GET",
|
|
20
|
-
path: "/events",
|
|
21
|
-
query: input
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
const getEvent = polymarketOperation({
|
|
26
|
-
id: "polymarket.get-polymarket-event",
|
|
27
|
-
name: "Get Polymarket Event",
|
|
28
|
-
description: "Get a single event by ID from the Gamma API",
|
|
29
|
-
input: z.object({ id: z.string() }),
|
|
30
|
-
output: eventSchema,
|
|
31
|
-
run: async (input, credentials) => {
|
|
32
|
-
return createPolymarketClient(credentials).request({
|
|
33
|
-
host: "gamma",
|
|
34
|
-
method: "GET",
|
|
35
|
-
path: `/events/${input.id}`
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
const getEventBySlug = polymarketOperation({
|
|
40
|
-
id: "polymarket.get-polymarket-event-by-slug",
|
|
41
|
-
name: "Get Polymarket Event by Slug",
|
|
42
|
-
description: "Get a single event by slug from the Gamma API",
|
|
43
|
-
input: z.object({ slug: z.string() }),
|
|
44
|
-
output: eventSchema,
|
|
45
|
-
run: async (input, credentials) => {
|
|
46
|
-
return createPolymarketClient(credentials).request({
|
|
47
|
-
host: "gamma",
|
|
48
|
-
method: "GET",
|
|
49
|
-
path: `/events/slug/${input.slug}`
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
const getEventTags = polymarketOperation({
|
|
54
|
-
id: "polymarket.get-polymarket-event-tags",
|
|
55
|
-
name: "Get Polymarket Event Tags",
|
|
56
|
-
description: "Get tags for an event by event ID from the Gamma API",
|
|
57
|
-
input: z.object({ id: z.string() }),
|
|
58
|
-
output: z.array(tagSchema),
|
|
59
|
-
run: async (input, credentials) => {
|
|
60
|
-
return createPolymarketClient(credentials).request({
|
|
61
|
-
host: "gamma",
|
|
62
|
-
method: "GET",
|
|
63
|
-
path: `/events/${input.id}/tags`
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
//#endregion
|
|
69
|
-
export { getEvent, getEventBySlug, getEventTags, listEvents };
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { CredentialSet, Operation } from "@keystrokehq/core";
|
|
3
|
-
|
|
4
|
-
//#region ../../packages/integration-authoring/dist/official/runtime.mjs
|
|
5
|
-
const REGISTRY_KEY = "__ks_official_integration_metadata_registry";
|
|
6
|
-
function getRegistry() {
|
|
7
|
-
const globalStore = globalThis;
|
|
8
|
-
if (!globalStore[REGISTRY_KEY]) globalStore[REGISTRY_KEY] = /* @__PURE__ */ new WeakMap();
|
|
9
|
-
return globalStore[REGISTRY_KEY];
|
|
10
|
-
}
|
|
11
|
-
function registerOfficialOperation(operation, metadata) {
|
|
12
|
-
getRegistry().set(operation, Object.freeze({ ...metadata }));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region ../../packages/integration-authoring/dist/official/index.mjs
|
|
17
|
-
const OFFICIAL_CREDENTIAL_SET_ID_PREFIX = "keystroke:";
|
|
18
|
-
function stripOfficialCredentialSetIdPrefix(id) {
|
|
19
|
-
return id.startsWith(OFFICIAL_CREDENTIAL_SET_ID_PREFIX) ? id.slice(10) : id;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Creates a factory for Keystroke-official integration operations.
|
|
23
|
-
*
|
|
24
|
-
* It keeps the same flat `run(input, credentials)` ergonomics as the generic
|
|
25
|
-
* operation factory, while registering official metadata for builder/runtime
|
|
26
|
-
* operation metadata.
|
|
27
|
-
*/
|
|
28
|
-
function createOfficialOperationFactory(credentialSet) {
|
|
29
|
-
const integrationId = stripOfficialCredentialSetIdPrefix(credentialSet.id);
|
|
30
|
-
return (config) => {
|
|
31
|
-
const wrappedRun = async (input, ctx) => {
|
|
32
|
-
const creds = ctx.credentials[credentialSet.id];
|
|
33
|
-
return config.run(input, creds);
|
|
34
|
-
};
|
|
35
|
-
const operation = new Operation({
|
|
36
|
-
id: config.id,
|
|
37
|
-
name: config.name,
|
|
38
|
-
description: config.description,
|
|
39
|
-
input: config.input,
|
|
40
|
-
output: config.output,
|
|
41
|
-
credentialSets: [credentialSet],
|
|
42
|
-
...config.tags !== void 0 ? { tags: config.tags } : {},
|
|
43
|
-
...config.needsApproval !== void 0 ? { needsApproval: config.needsApproval } : {},
|
|
44
|
-
...config.requiredOAuthScopes !== void 0 ? { requiredOAuthScopes: config.requiredOAuthScopes } : {},
|
|
45
|
-
...config.retries !== void 0 ? { retries: config.retries } : {},
|
|
46
|
-
...config.timeout !== void 0 ? { timeout: config.timeout } : {},
|
|
47
|
-
...config.maxDurationMs !== void 0 ? { maxDurationMs: config.maxDurationMs } : {},
|
|
48
|
-
run: wrappedRun
|
|
49
|
-
});
|
|
50
|
-
registerOfficialOperation(operation, { integrationId });
|
|
51
|
-
return operation;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Creates an official integration bundle from a single config object.
|
|
56
|
-
*
|
|
57
|
-
* - Creates the public `CredentialSet` internally.
|
|
58
|
-
* - Accepts optional `internal` fields for Keystroke-owned platform credentials.
|
|
59
|
-
*/
|
|
60
|
-
function defineOfficialIntegration(config) {
|
|
61
|
-
const internalCredentialSets = config.internal ?? {};
|
|
62
|
-
const allInternalCredentialSets = [
|
|
63
|
-
...internalCredentialSets.providerApp ? [internalCredentialSets.providerApp] : [],
|
|
64
|
-
...internalCredentialSets.providerAppVariants ?? [],
|
|
65
|
-
...internalCredentialSets.webhookVerification ? [internalCredentialSets.webhookVerification] : [],
|
|
66
|
-
...internalCredentialSets.other ?? []
|
|
67
|
-
];
|
|
68
|
-
const credentialSet = new CredentialSet({
|
|
69
|
-
id: config.id,
|
|
70
|
-
name: config.name,
|
|
71
|
-
description: config.description,
|
|
72
|
-
auth: config.auth,
|
|
73
|
-
...config.connections ? { connections: config.connections } : {},
|
|
74
|
-
...config.proxy ? { proxy: config.proxy } : {},
|
|
75
|
-
...config.needsRawSecret === true ? { needsRawSecret: true } : {}
|
|
76
|
-
});
|
|
77
|
-
return Object.freeze({
|
|
78
|
-
integration: {
|
|
79
|
-
id: config.id,
|
|
80
|
-
name: config.name,
|
|
81
|
-
...config.description !== void 0 ? { description: config.description } : {},
|
|
82
|
-
auth: config.auth,
|
|
83
|
-
...config.proxy ? { proxy: config.proxy } : {},
|
|
84
|
-
...config.needsRawSecret === true ? { needsRawSecret: true } : {},
|
|
85
|
-
...config.connections ? { connections: config.connections } : {}
|
|
86
|
-
},
|
|
87
|
-
credentialSet,
|
|
88
|
-
internalCredentialSets,
|
|
89
|
-
allInternalCredentialSets
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
//#endregion
|
|
94
|
-
//#region src/integration.ts
|
|
95
|
-
const polymarketAuthSchema = z.object({ POLYMARKET_API_KEY: z.string().optional() });
|
|
96
|
-
/**
|
|
97
|
-
* Polymarket integration — prediction market data via three public APIs.
|
|
98
|
-
*
|
|
99
|
-
* The API key is stored as a credential and included as a header when present.
|
|
100
|
-
* This enables future support for authenticated CLOB trading endpoints.
|
|
101
|
-
*/
|
|
102
|
-
const polymarketOfficialIntegration = {
|
|
103
|
-
id: "polymarket",
|
|
104
|
-
name: "Polymarket",
|
|
105
|
-
description: "Polymarket — decentralized prediction market data",
|
|
106
|
-
auth: polymarketAuthSchema,
|
|
107
|
-
proxy: { hosts: [
|
|
108
|
-
"gamma-api.polymarket.com",
|
|
109
|
-
"clob.polymarket.com",
|
|
110
|
-
"data-api.polymarket.com"
|
|
111
|
-
] }
|
|
112
|
-
};
|
|
113
|
-
const polymarketBundle = defineOfficialIntegration(polymarketOfficialIntegration);
|
|
114
|
-
const polymarket = polymarketBundle.credentialSet;
|
|
115
|
-
|
|
116
|
-
//#endregion
|
|
117
|
-
export { polymarketBundle as n, createOfficialOperationFactory as r, polymarket as t };
|
package/dist/markets.d.mts
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
3
|
-
import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
|
|
4
|
-
|
|
5
|
-
//#region src/markets.d.ts
|
|
6
|
-
declare const listMarkets: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
7
|
-
limit: z.ZodOptional<z.ZodNumber>;
|
|
8
|
-
offset: z.ZodOptional<z.ZodNumber>;
|
|
9
|
-
order: z.ZodOptional<z.ZodEnum<{
|
|
10
|
-
volume24hr: "volume24hr";
|
|
11
|
-
startDate: "startDate";
|
|
12
|
-
endDate: "endDate";
|
|
13
|
-
volumeNum: "volumeNum";
|
|
14
|
-
liquidityNum: "liquidityNum";
|
|
15
|
-
competitive: "competitive";
|
|
16
|
-
closedTime: "closedTime";
|
|
17
|
-
}>>;
|
|
18
|
-
ascending: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
-
id: z.ZodOptional<z.ZodString>;
|
|
20
|
-
slug: z.ZodOptional<z.ZodString>;
|
|
21
|
-
clob_token_ids: z.ZodOptional<z.ZodString>;
|
|
22
|
-
condition_ids: z.ZodOptional<z.ZodString>;
|
|
23
|
-
liquidity_num_min: z.ZodOptional<z.ZodNumber>;
|
|
24
|
-
liquidity_num_max: z.ZodOptional<z.ZodNumber>;
|
|
25
|
-
volume_num_min: z.ZodOptional<z.ZodNumber>;
|
|
26
|
-
volume_num_max: z.ZodOptional<z.ZodNumber>;
|
|
27
|
-
start_date_min: z.ZodOptional<z.ZodString>;
|
|
28
|
-
start_date_max: z.ZodOptional<z.ZodString>;
|
|
29
|
-
end_date_min: z.ZodOptional<z.ZodString>;
|
|
30
|
-
end_date_max: z.ZodOptional<z.ZodString>;
|
|
31
|
-
tag_id: z.ZodOptional<z.ZodNumber>;
|
|
32
|
-
closed: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
-
active: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
-
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
35
|
-
id: z.ZodString;
|
|
36
|
-
question: z.ZodString;
|
|
37
|
-
conditionId: z.ZodString;
|
|
38
|
-
slug: z.ZodString;
|
|
39
|
-
endDate: z.ZodOptional<z.ZodString>;
|
|
40
|
-
startDate: z.ZodOptional<z.ZodString>;
|
|
41
|
-
description: z.ZodOptional<z.ZodString>;
|
|
42
|
-
outcomes: z.ZodOptional<z.ZodString>;
|
|
43
|
-
outcomePrices: z.ZodOptional<z.ZodString>;
|
|
44
|
-
volume: z.ZodOptional<z.ZodString>;
|
|
45
|
-
volumeNum: z.ZodOptional<z.ZodNumber>;
|
|
46
|
-
liquidity: z.ZodOptional<z.ZodString>;
|
|
47
|
-
liquidityNum: z.ZodOptional<z.ZodNumber>;
|
|
48
|
-
bestBid: z.ZodOptional<z.ZodNumber>;
|
|
49
|
-
bestAsk: z.ZodOptional<z.ZodNumber>;
|
|
50
|
-
lastTradePrice: z.ZodOptional<z.ZodNumber>;
|
|
51
|
-
active: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
-
closed: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
-
acceptingOrders: z.ZodOptional<z.ZodBoolean>;
|
|
55
|
-
clobTokenIds: z.ZodOptional<z.ZodString>;
|
|
56
|
-
image: z.ZodOptional<z.ZodString>;
|
|
57
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
58
|
-
groupItemTitle: z.ZodOptional<z.ZodString>;
|
|
59
|
-
groupItemThreshold: z.ZodOptional<z.ZodString>;
|
|
60
|
-
enableOrderBook: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
-
createdAt: z.ZodOptional<z.ZodString>;
|
|
62
|
-
updatedAt: z.ZodOptional<z.ZodString>;
|
|
63
|
-
}, z.core.$loose>>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
64
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
65
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
66
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
67
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
68
|
-
declare const getMarket: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
69
|
-
id: z.ZodString;
|
|
70
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
71
|
-
id: z.ZodString;
|
|
72
|
-
question: z.ZodString;
|
|
73
|
-
conditionId: z.ZodString;
|
|
74
|
-
slug: z.ZodString;
|
|
75
|
-
endDate: z.ZodOptional<z.ZodString>;
|
|
76
|
-
startDate: z.ZodOptional<z.ZodString>;
|
|
77
|
-
description: z.ZodOptional<z.ZodString>;
|
|
78
|
-
outcomes: z.ZodOptional<z.ZodString>;
|
|
79
|
-
outcomePrices: z.ZodOptional<z.ZodString>;
|
|
80
|
-
volume: z.ZodOptional<z.ZodString>;
|
|
81
|
-
volumeNum: z.ZodOptional<z.ZodNumber>;
|
|
82
|
-
liquidity: z.ZodOptional<z.ZodString>;
|
|
83
|
-
liquidityNum: z.ZodOptional<z.ZodNumber>;
|
|
84
|
-
bestBid: z.ZodOptional<z.ZodNumber>;
|
|
85
|
-
bestAsk: z.ZodOptional<z.ZodNumber>;
|
|
86
|
-
lastTradePrice: z.ZodOptional<z.ZodNumber>;
|
|
87
|
-
active: z.ZodOptional<z.ZodBoolean>;
|
|
88
|
-
closed: z.ZodOptional<z.ZodBoolean>;
|
|
89
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
90
|
-
acceptingOrders: z.ZodOptional<z.ZodBoolean>;
|
|
91
|
-
clobTokenIds: z.ZodOptional<z.ZodString>;
|
|
92
|
-
image: z.ZodOptional<z.ZodString>;
|
|
93
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
94
|
-
groupItemTitle: z.ZodOptional<z.ZodString>;
|
|
95
|
-
groupItemThreshold: z.ZodOptional<z.ZodString>;
|
|
96
|
-
enableOrderBook: z.ZodOptional<z.ZodBoolean>;
|
|
97
|
-
createdAt: z.ZodOptional<z.ZodString>;
|
|
98
|
-
updatedAt: z.ZodOptional<z.ZodString>;
|
|
99
|
-
}, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
100
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
101
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
102
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
103
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
104
|
-
declare const getMarketBySlug: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
105
|
-
slug: z.ZodString;
|
|
106
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
107
|
-
id: z.ZodString;
|
|
108
|
-
question: z.ZodString;
|
|
109
|
-
conditionId: z.ZodString;
|
|
110
|
-
slug: z.ZodString;
|
|
111
|
-
endDate: z.ZodOptional<z.ZodString>;
|
|
112
|
-
startDate: z.ZodOptional<z.ZodString>;
|
|
113
|
-
description: z.ZodOptional<z.ZodString>;
|
|
114
|
-
outcomes: z.ZodOptional<z.ZodString>;
|
|
115
|
-
outcomePrices: z.ZodOptional<z.ZodString>;
|
|
116
|
-
volume: z.ZodOptional<z.ZodString>;
|
|
117
|
-
volumeNum: z.ZodOptional<z.ZodNumber>;
|
|
118
|
-
liquidity: z.ZodOptional<z.ZodString>;
|
|
119
|
-
liquidityNum: z.ZodOptional<z.ZodNumber>;
|
|
120
|
-
bestBid: z.ZodOptional<z.ZodNumber>;
|
|
121
|
-
bestAsk: z.ZodOptional<z.ZodNumber>;
|
|
122
|
-
lastTradePrice: z.ZodOptional<z.ZodNumber>;
|
|
123
|
-
active: z.ZodOptional<z.ZodBoolean>;
|
|
124
|
-
closed: z.ZodOptional<z.ZodBoolean>;
|
|
125
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
126
|
-
acceptingOrders: z.ZodOptional<z.ZodBoolean>;
|
|
127
|
-
clobTokenIds: z.ZodOptional<z.ZodString>;
|
|
128
|
-
image: z.ZodOptional<z.ZodString>;
|
|
129
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
130
|
-
groupItemTitle: z.ZodOptional<z.ZodString>;
|
|
131
|
-
groupItemThreshold: z.ZodOptional<z.ZodString>;
|
|
132
|
-
enableOrderBook: z.ZodOptional<z.ZodBoolean>;
|
|
133
|
-
createdAt: z.ZodOptional<z.ZodString>;
|
|
134
|
-
updatedAt: z.ZodOptional<z.ZodString>;
|
|
135
|
-
}, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
136
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
137
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
138
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
139
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
140
|
-
declare const getMarketTags: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
141
|
-
id: z.ZodString;
|
|
142
|
-
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
143
|
-
id: z.ZodString;
|
|
144
|
-
label: z.ZodString;
|
|
145
|
-
slug: z.ZodOptional<z.ZodString>;
|
|
146
|
-
}, z.core.$loose>>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
147
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
148
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
149
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
150
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
151
|
-
//#endregion
|
|
152
|
-
export { getMarket, getMarketBySlug, getMarketTags, listMarkets };
|
package/dist/markets.mjs
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { D as createPolymarketClient, E as polymarketOperation, l as marketSchema, s as listMarketsParamsSchema, w as tagSchema } from "./schemas-DGLbQgHc.mjs";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
//#region src/markets.ts
|
|
5
|
-
/**
|
|
6
|
-
* polymarket/markets.ts
|
|
7
|
-
*
|
|
8
|
-
* Steps for listing, getting, and querying Polymarket markets via the Gamma API.
|
|
9
|
-
*/
|
|
10
|
-
const listMarkets = polymarketOperation({
|
|
11
|
-
id: "polymarket.list-polymarket-markets",
|
|
12
|
-
name: "List Polymarket Markets",
|
|
13
|
-
description: "List and filter markets with extensive query params via the Gamma API",
|
|
14
|
-
input: listMarketsParamsSchema,
|
|
15
|
-
output: z.array(marketSchema),
|
|
16
|
-
run: async (input, credentials) => {
|
|
17
|
-
return createPolymarketClient(credentials).request({
|
|
18
|
-
host: "gamma",
|
|
19
|
-
method: "GET",
|
|
20
|
-
path: "/markets",
|
|
21
|
-
query: input
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
const getMarket = polymarketOperation({
|
|
26
|
-
id: "polymarket.get-polymarket-market",
|
|
27
|
-
name: "Get Polymarket Market",
|
|
28
|
-
description: "Get a single market by ID from the Gamma API",
|
|
29
|
-
input: z.object({ id: z.string() }),
|
|
30
|
-
output: marketSchema,
|
|
31
|
-
run: async (input, credentials) => {
|
|
32
|
-
return createPolymarketClient(credentials).request({
|
|
33
|
-
host: "gamma",
|
|
34
|
-
method: "GET",
|
|
35
|
-
path: `/markets/${input.id}`
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
const getMarketBySlug = polymarketOperation({
|
|
40
|
-
id: "polymarket.get-polymarket-market-by-slug",
|
|
41
|
-
name: "Get Polymarket Market by Slug",
|
|
42
|
-
description: "Get a single market by slug from the Gamma API",
|
|
43
|
-
input: z.object({ slug: z.string() }),
|
|
44
|
-
output: marketSchema,
|
|
45
|
-
run: async (input, credentials) => {
|
|
46
|
-
return createPolymarketClient(credentials).request({
|
|
47
|
-
host: "gamma",
|
|
48
|
-
method: "GET",
|
|
49
|
-
path: `/markets/slug/${input.slug}`
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
const getMarketTags = polymarketOperation({
|
|
54
|
-
id: "polymarket.get-polymarket-market-tags",
|
|
55
|
-
name: "Get Polymarket Market Tags",
|
|
56
|
-
description: "Get tags for a market by market ID from the Gamma API",
|
|
57
|
-
input: z.object({ id: z.string() }),
|
|
58
|
-
output: z.array(tagSchema),
|
|
59
|
-
run: async (input, credentials) => {
|
|
60
|
-
return createPolymarketClient(credentials).request({
|
|
61
|
-
host: "gamma",
|
|
62
|
-
method: "GET",
|
|
63
|
-
path: `/markets/${input.id}/tags`
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
//#endregion
|
|
69
|
-
export { getMarket, getMarketBySlug, getMarketTags, listMarkets };
|
package/dist/orderbook.d.mts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
3
|
-
import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
|
|
4
|
-
|
|
5
|
-
//#region src/orderbook.d.ts
|
|
6
|
-
declare const getOrderBook: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
7
|
-
tokenID: z.ZodString;
|
|
8
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
9
|
-
market: z.ZodOptional<z.ZodString>;
|
|
10
|
-
asset_id: z.ZodString;
|
|
11
|
-
timestamp: z.ZodOptional<z.ZodString>;
|
|
12
|
-
hash: z.ZodOptional<z.ZodString>;
|
|
13
|
-
bids: z.ZodArray<z.ZodObject<{
|
|
14
|
-
price: z.ZodString;
|
|
15
|
-
size: z.ZodString;
|
|
16
|
-
}, z.core.$strip>>;
|
|
17
|
-
asks: z.ZodArray<z.ZodObject<{
|
|
18
|
-
price: z.ZodString;
|
|
19
|
-
size: z.ZodString;
|
|
20
|
-
}, z.core.$strip>>;
|
|
21
|
-
min_order_size: z.ZodOptional<z.ZodString>;
|
|
22
|
-
tick_size: z.ZodOptional<z.ZodString>;
|
|
23
|
-
neg_risk: z.ZodOptional<z.ZodBoolean>;
|
|
24
|
-
}, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
25
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
26
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
27
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
28
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
29
|
-
declare const batchGetOrderBooks: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
30
|
-
tokenIDs: z.ZodArray<z.ZodString>;
|
|
31
|
-
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
32
|
-
market: z.ZodOptional<z.ZodString>;
|
|
33
|
-
asset_id: z.ZodString;
|
|
34
|
-
timestamp: z.ZodOptional<z.ZodString>;
|
|
35
|
-
hash: z.ZodOptional<z.ZodString>;
|
|
36
|
-
bids: z.ZodArray<z.ZodObject<{
|
|
37
|
-
price: z.ZodString;
|
|
38
|
-
size: z.ZodString;
|
|
39
|
-
}, z.core.$strip>>;
|
|
40
|
-
asks: z.ZodArray<z.ZodObject<{
|
|
41
|
-
price: z.ZodString;
|
|
42
|
-
size: z.ZodString;
|
|
43
|
-
}, z.core.$strip>>;
|
|
44
|
-
min_order_size: z.ZodOptional<z.ZodString>;
|
|
45
|
-
tick_size: z.ZodOptional<z.ZodString>;
|
|
46
|
-
neg_risk: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
-
}, z.core.$loose>>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
48
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
49
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
50
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
51
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
52
|
-
declare const batchGetSpreads: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
53
|
-
tokenIDs: z.ZodArray<z.ZodString>;
|
|
54
|
-
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
55
|
-
asset_id: z.ZodString;
|
|
56
|
-
spread: z.ZodString;
|
|
57
|
-
bid: z.ZodOptional<z.ZodString>;
|
|
58
|
-
ask: z.ZodOptional<z.ZodString>;
|
|
59
|
-
}, z.core.$loose>>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
60
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
61
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
62
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
63
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
64
|
-
//#endregion
|
|
65
|
-
export { batchGetOrderBooks, batchGetSpreads, getOrderBook };
|
package/dist/orderbook.mjs
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { C as spreadSchema, D as createPolymarketClient, E as polymarketOperation, f as orderBookSummarySchema } from "./schemas-DGLbQgHc.mjs";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
//#region src/orderbook.ts
|
|
5
|
-
/**
|
|
6
|
-
* polymarket/orderbook.ts
|
|
7
|
-
*
|
|
8
|
-
* Steps for order book data via the CLOB API.
|
|
9
|
-
* Prices and sizes are returned as strings.
|
|
10
|
-
*/
|
|
11
|
-
const getOrderBook = polymarketOperation({
|
|
12
|
-
id: "polymarket.get-polymarket-order-book",
|
|
13
|
-
name: "Get Polymarket Order Book",
|
|
14
|
-
description: "Get order book (bids/asks) for a token via the CLOB API",
|
|
15
|
-
input: z.object({ tokenID: z.string() }),
|
|
16
|
-
output: orderBookSummarySchema,
|
|
17
|
-
run: async (input, credentials) => {
|
|
18
|
-
return createPolymarketClient(credentials).request({
|
|
19
|
-
host: "clob",
|
|
20
|
-
method: "GET",
|
|
21
|
-
path: "/book",
|
|
22
|
-
query: { token_id: input.tokenID }
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
const batchGetOrderBooks = polymarketOperation({
|
|
27
|
-
id: "polymarket.batch-get-polymarket-order-books",
|
|
28
|
-
name: "Batch Get Polymarket Order Books",
|
|
29
|
-
description: "Get order books for multiple tokens (max 500) via the CLOB API",
|
|
30
|
-
input: z.object({ tokenIDs: z.array(z.string()).max(500) }),
|
|
31
|
-
output: z.array(orderBookSummarySchema),
|
|
32
|
-
run: async (input, credentials) => {
|
|
33
|
-
return createPolymarketClient(credentials).request({
|
|
34
|
-
host: "clob",
|
|
35
|
-
method: "POST",
|
|
36
|
-
path: "/books",
|
|
37
|
-
body: input.tokenIDs
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
const batchGetSpreads = polymarketOperation({
|
|
42
|
-
id: "polymarket.batch-get-polymarket-spreads",
|
|
43
|
-
name: "Batch Get Polymarket Spreads",
|
|
44
|
-
description: "Get spreads for multiple tokens (max 500) via the CLOB API",
|
|
45
|
-
input: z.object({ tokenIDs: z.array(z.string()).max(500) }),
|
|
46
|
-
output: z.array(spreadSchema),
|
|
47
|
-
run: async (input, credentials) => {
|
|
48
|
-
return createPolymarketClient(credentials).request({
|
|
49
|
-
host: "clob",
|
|
50
|
-
method: "POST",
|
|
51
|
-
path: "/spreads",
|
|
52
|
-
body: input.tokenIDs
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
//#endregion
|
|
58
|
-
export { batchGetOrderBooks, batchGetSpreads, getOrderBook };
|
package/dist/pricing.d.mts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
3
|
-
import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
|
|
4
|
-
|
|
5
|
-
//#region src/pricing.d.ts
|
|
6
|
-
declare const getPrice: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
7
|
-
tokenID: z.ZodString;
|
|
8
|
-
side: z.ZodEnum<{
|
|
9
|
-
BUY: "BUY";
|
|
10
|
-
SELL: "SELL";
|
|
11
|
-
}>;
|
|
12
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
13
|
-
price: z.ZodString;
|
|
14
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
15
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
16
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
17
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
18
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
19
|
-
declare const getMidpoint: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
20
|
-
tokenID: z.ZodString;
|
|
21
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
22
|
-
mid: z.ZodString;
|
|
23
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
24
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
25
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
26
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
27
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
28
|
-
declare const listPrices: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
29
|
-
BUY: z.ZodString;
|
|
30
|
-
SELL: z.ZodString;
|
|
31
|
-
}, z.core.$strip>>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
32
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
33
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
34
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
35
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
36
|
-
declare const batchGetPrices: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
37
|
-
tokenIDs: z.ZodArray<z.ZodString>;
|
|
38
|
-
}, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
39
|
-
BUY: z.ZodString;
|
|
40
|
-
SELL: z.ZodString;
|
|
41
|
-
}, z.core.$strip>>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
42
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
43
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
44
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
45
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
46
|
-
declare const getPriceHistory: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
47
|
-
tokenID: z.ZodString;
|
|
48
|
-
interval: z.ZodOptional<z.ZodString>;
|
|
49
|
-
fidelity: z.ZodOptional<z.ZodNumber>;
|
|
50
|
-
startTs: z.ZodOptional<z.ZodNumber>;
|
|
51
|
-
endTs: z.ZodOptional<z.ZodNumber>;
|
|
52
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
53
|
-
history: z.ZodArray<z.ZodObject<{
|
|
54
|
-
t: z.ZodNumber;
|
|
55
|
-
p: z.ZodNumber;
|
|
56
|
-
}, z.core.$strip>>;
|
|
57
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
58
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
59
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
60
|
-
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
61
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
62
|
-
//#endregion
|
|
63
|
-
export { batchGetPrices, getMidpoint, getPrice, getPriceHistory, listPrices };
|