@keystrokehq/polymarket 0.0.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.
- package/dist/_official/index.d.mts +2 -0
- package/dist/_official/index.mjs +3 -0
- package/dist/data.d.mts +106 -0
- package/dist/data.mjs +114 -0
- package/dist/discovery.d.mts +81 -0
- package/dist/discovery.mjs +126 -0
- package/dist/events.d.mts +211 -0
- package/dist/events.mjs +69 -0
- package/dist/index.d.mts +372 -0
- package/dist/index.mjs +10 -0
- package/dist/integration-CSROawvr.d.mts +22 -0
- package/dist/integration-KDxC97JC.mjs +27 -0
- package/dist/markets.d.mts +152 -0
- package/dist/markets.mjs +69 -0
- package/dist/orderbook.d.mts +65 -0
- package/dist/orderbook.mjs +58 -0
- package/dist/pricing.d.mts +63 -0
- package/dist/pricing.mjs +105 -0
- package/dist/schemas-C6SqZjA-.mjs +337 -0
- package/package.json +84 -0
package/dist/data.d.mts
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
|
|
3
|
+
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
4
|
+
|
|
5
|
+
//#region src/data.d.ts
|
|
6
|
+
declare const listTrades: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
7
|
+
market: z.ZodOptional<z.ZodString>;
|
|
8
|
+
asset_id: z.ZodOptional<z.ZodString>;
|
|
9
|
+
maker_address: z.ZodOptional<z.ZodString>;
|
|
10
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
before: z.ZodOptional<z.ZodString>;
|
|
13
|
+
after: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
15
|
+
id: z.ZodOptional<z.ZodString>;
|
|
16
|
+
taker_order_id: z.ZodOptional<z.ZodString>;
|
|
17
|
+
market: z.ZodOptional<z.ZodString>;
|
|
18
|
+
asset_id: z.ZodOptional<z.ZodString>;
|
|
19
|
+
side: z.ZodOptional<z.ZodString>;
|
|
20
|
+
size: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>>;
|
|
21
|
+
fee_rate_bps: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>>;
|
|
22
|
+
price: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>>;
|
|
23
|
+
status: z.ZodOptional<z.ZodString>;
|
|
24
|
+
match_time: z.ZodOptional<z.ZodString>;
|
|
25
|
+
last_update: z.ZodOptional<z.ZodString>;
|
|
26
|
+
outcome: z.ZodOptional<z.ZodString>;
|
|
27
|
+
maker_address: z.ZodOptional<z.ZodString>;
|
|
28
|
+
trader_side: z.ZodOptional<z.ZodString>;
|
|
29
|
+
transaction_hash: z.ZodOptional<z.ZodString>;
|
|
30
|
+
bucket_index: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
owner: z.ZodOptional<z.ZodString>;
|
|
32
|
+
type: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$loose>>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
34
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
36
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
38
|
+
declare const getUserPositions: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
39
|
+
address: z.ZodString;
|
|
40
|
+
sizeThreshold: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
44
|
+
asset: z.ZodOptional<z.ZodString>;
|
|
45
|
+
conditionId: z.ZodOptional<z.ZodString>;
|
|
46
|
+
proxyWallet: z.ZodOptional<z.ZodString>;
|
|
47
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
avgPrice: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
initialValue: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
currentValue: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
cashPnl: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
percentPnl: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
totalBought: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
totalSold: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
realizedPnl: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
curPrice: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
redeemed: z.ZodOptional<z.ZodBoolean>;
|
|
58
|
+
mergeable: z.ZodOptional<z.ZodBoolean>;
|
|
59
|
+
outcome: z.ZodOptional<z.ZodString>;
|
|
60
|
+
title: z.ZodOptional<z.ZodString>;
|
|
61
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
62
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
63
|
+
eventSlug: z.ZodOptional<z.ZodString>;
|
|
64
|
+
eventTitle: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$loose>>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
66
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
68
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
70
|
+
declare const getMarketHolders: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
71
|
+
conditionId: z.ZodString;
|
|
72
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
75
|
+
address: z.ZodOptional<z.ZodString>;
|
|
76
|
+
proxyWallet: z.ZodOptional<z.ZodString>;
|
|
77
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
78
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
position: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, z.core.$loose>>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
81
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
82
|
+
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
83
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
84
|
+
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
85
|
+
declare const getOpenInterest: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
86
|
+
conditionId: z.ZodString;
|
|
87
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
88
|
+
conditionId: z.ZodOptional<z.ZodString>;
|
|
89
|
+
openInterest: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
}, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
91
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
92
|
+
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
93
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
94
|
+
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
95
|
+
declare const getLiveVolume: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
96
|
+
eventId: z.ZodString;
|
|
97
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
98
|
+
volume: z.ZodOptional<z.ZodNumber>;
|
|
99
|
+
volume24hr: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
}, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
101
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
102
|
+
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
103
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
104
|
+
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
105
|
+
//#endregion
|
|
106
|
+
export { getLiveVolume, getMarketHolders, getOpenInterest, getUserPositions, listTrades };
|
package/dist/data.mjs
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { D as createPolymarketClient, E as polymarketOperation, T as tradeSchema, a as holderSchema, c as liveVolumeSchema, m as positionSchema, u as openInterestSchema } from "./schemas-C6SqZjA-.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
//#region src/data.ts
|
|
5
|
+
/**
|
|
6
|
+
* polymarket/data.ts
|
|
7
|
+
*
|
|
8
|
+
* Steps for trades, positions, holders, open interest, and live volume
|
|
9
|
+
* via the Polymarket Data API.
|
|
10
|
+
*/
|
|
11
|
+
const listTrades = polymarketOperation({
|
|
12
|
+
id: "list_polymarket_trades",
|
|
13
|
+
name: "List Polymarket Trades",
|
|
14
|
+
description: "List trades with filters via the Data API",
|
|
15
|
+
input: z.object({
|
|
16
|
+
market: z.string().optional(),
|
|
17
|
+
asset_id: z.string().optional(),
|
|
18
|
+
maker_address: z.string().optional(),
|
|
19
|
+
limit: z.number().optional(),
|
|
20
|
+
offset: z.number().optional(),
|
|
21
|
+
before: z.string().optional(),
|
|
22
|
+
after: z.string().optional()
|
|
23
|
+
}),
|
|
24
|
+
output: z.array(tradeSchema),
|
|
25
|
+
run: async (input, credentials) => {
|
|
26
|
+
return createPolymarketClient(credentials).request({
|
|
27
|
+
host: "data",
|
|
28
|
+
method: "GET",
|
|
29
|
+
path: "/trades",
|
|
30
|
+
query: input
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const getUserPositions = polymarketOperation({
|
|
35
|
+
id: "get_polymarket_user_positions",
|
|
36
|
+
name: "Get Polymarket User Positions",
|
|
37
|
+
description: "Get positions for a user wallet via the Data API",
|
|
38
|
+
input: z.object({
|
|
39
|
+
address: z.string(),
|
|
40
|
+
sizeThreshold: z.number().optional(),
|
|
41
|
+
limit: z.number().optional(),
|
|
42
|
+
offset: z.number().optional()
|
|
43
|
+
}),
|
|
44
|
+
output: z.array(positionSchema),
|
|
45
|
+
run: async (input, credentials) => {
|
|
46
|
+
return createPolymarketClient(credentials).request({
|
|
47
|
+
host: "data",
|
|
48
|
+
method: "GET",
|
|
49
|
+
path: "/positions",
|
|
50
|
+
query: {
|
|
51
|
+
address: input.address,
|
|
52
|
+
sizeThreshold: input.sizeThreshold,
|
|
53
|
+
limit: input.limit,
|
|
54
|
+
offset: input.offset
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const getMarketHolders = polymarketOperation({
|
|
60
|
+
id: "get_polymarket_market_holders",
|
|
61
|
+
name: "Get Polymarket Market Holders",
|
|
62
|
+
description: "Get top holders for a market via the Data API",
|
|
63
|
+
input: z.object({
|
|
64
|
+
conditionId: z.string(),
|
|
65
|
+
limit: z.number().optional(),
|
|
66
|
+
offset: z.number().optional()
|
|
67
|
+
}),
|
|
68
|
+
output: z.array(holderSchema),
|
|
69
|
+
run: async (input, credentials) => {
|
|
70
|
+
return createPolymarketClient(credentials).request({
|
|
71
|
+
host: "data",
|
|
72
|
+
method: "GET",
|
|
73
|
+
path: "/holders",
|
|
74
|
+
query: {
|
|
75
|
+
market: input.conditionId,
|
|
76
|
+
limit: input.limit,
|
|
77
|
+
offset: input.offset
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
const getOpenInterest = polymarketOperation({
|
|
83
|
+
id: "get_polymarket_open_interest",
|
|
84
|
+
name: "Get Polymarket Open Interest",
|
|
85
|
+
description: "Get open interest for market(s) via the Data API",
|
|
86
|
+
input: z.object({ conditionId: z.string() }),
|
|
87
|
+
output: openInterestSchema,
|
|
88
|
+
run: async (input, credentials) => {
|
|
89
|
+
return createPolymarketClient(credentials).request({
|
|
90
|
+
host: "data",
|
|
91
|
+
method: "GET",
|
|
92
|
+
path: "/oi",
|
|
93
|
+
query: { market: input.conditionId }
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
const getLiveVolume = polymarketOperation({
|
|
98
|
+
id: "get_polymarket_live_volume",
|
|
99
|
+
name: "Get Polymarket Live Volume",
|
|
100
|
+
description: "Get live volume for an event via the Data API",
|
|
101
|
+
input: z.object({ eventId: z.string() }),
|
|
102
|
+
output: liveVolumeSchema,
|
|
103
|
+
run: async (input, credentials) => {
|
|
104
|
+
return createPolymarketClient(credentials).request({
|
|
105
|
+
host: "data",
|
|
106
|
+
method: "GET",
|
|
107
|
+
path: "/live-volume",
|
|
108
|
+
query: { event_id: input.eventId }
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
//#endregion
|
|
114
|
+
export { getLiveVolume, getMarketHolders, getOpenInterest, getUserPositions, listTrades };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
|
|
3
|
+
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
4
|
+
|
|
5
|
+
//#region src/discovery.d.ts
|
|
6
|
+
declare const listTags: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
label: z.ZodString;
|
|
9
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$loose>>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
11
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
13
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
15
|
+
declare const listSeries: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
16
|
+
id: z.ZodString;
|
|
17
|
+
title: z.ZodString;
|
|
18
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
19
|
+
description: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$loose>>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
21
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
23
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
25
|
+
declare const getSeries: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
26
|
+
id: z.ZodString;
|
|
27
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
title: z.ZodString;
|
|
30
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
31
|
+
description: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
33
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
35
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
37
|
+
declare const search: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
38
|
+
q: z.ZodString;
|
|
39
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
40
|
+
events: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
41
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
42
|
+
profiles: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
43
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
44
|
+
hasMore: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
totalResults: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
}, z.core.$strip>, 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 getProfile: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
53
|
+
address: z.ZodString;
|
|
54
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
55
|
+
address: z.ZodString;
|
|
56
|
+
pseudonym: z.ZodOptional<z.ZodString>;
|
|
57
|
+
bio: z.ZodOptional<z.ZodString>;
|
|
58
|
+
profileImage: z.ZodOptional<z.ZodString>;
|
|
59
|
+
displayUsernamePublic: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
}, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
61
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
62
|
+
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
63
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
65
|
+
declare const getSportsMetadata: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodUnknown, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
66
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
68
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
70
|
+
declare const getSportsMarketTypes: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodUnknown, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
71
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
73
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
75
|
+
declare const getSportsTeams: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodUnknown, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
76
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
77
|
+
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
78
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
79
|
+
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
80
|
+
//#endregion
|
|
81
|
+
export { getProfile, getSeries, getSportsMarketTypes, getSportsMetadata, getSportsTeams, listSeries, listTags, search };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { D as createPolymarketClient, E as polymarketOperation, S as sportsTeamSchema, _ as profileSchema, b as sportsMarketTypeSchema, v as searchResultSchema, w as tagSchema, x as sportsMetadataSchema, y as seriesSchema } from "./schemas-C6SqZjA-.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
//#region src/discovery.ts
|
|
5
|
+
/**
|
|
6
|
+
* polymarket/discovery.ts
|
|
7
|
+
*
|
|
8
|
+
* Steps for tags, series, search, profiles, and sports metadata via the Gamma API.
|
|
9
|
+
*/
|
|
10
|
+
const listTags = polymarketOperation({
|
|
11
|
+
id: "list_polymarket_tags",
|
|
12
|
+
name: "List Polymarket Tags",
|
|
13
|
+
description: "List all tags from the Gamma API",
|
|
14
|
+
input: z.object({}),
|
|
15
|
+
output: z.array(tagSchema),
|
|
16
|
+
run: async (_input, credentials) => {
|
|
17
|
+
return createPolymarketClient(credentials).request({
|
|
18
|
+
host: "gamma",
|
|
19
|
+
method: "GET",
|
|
20
|
+
path: "/tags"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const listSeries = polymarketOperation({
|
|
25
|
+
id: "list_polymarket_series",
|
|
26
|
+
name: "List Polymarket Series",
|
|
27
|
+
description: "List all series from the Gamma API",
|
|
28
|
+
input: z.object({}),
|
|
29
|
+
output: z.array(seriesSchema),
|
|
30
|
+
run: async (_input, credentials) => {
|
|
31
|
+
return createPolymarketClient(credentials).request({
|
|
32
|
+
host: "gamma",
|
|
33
|
+
method: "GET",
|
|
34
|
+
path: "/series"
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const getSeries = polymarketOperation({
|
|
39
|
+
id: "get_polymarket_series",
|
|
40
|
+
name: "Get Polymarket Series",
|
|
41
|
+
description: "Get a series by ID from the Gamma API",
|
|
42
|
+
input: z.object({ id: z.string() }),
|
|
43
|
+
output: seriesSchema,
|
|
44
|
+
run: async (input, credentials) => {
|
|
45
|
+
return createPolymarketClient(credentials).request({
|
|
46
|
+
host: "gamma",
|
|
47
|
+
method: "GET",
|
|
48
|
+
path: `/series/${input.id}`
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
const search = polymarketOperation({
|
|
53
|
+
id: "search_polymarket",
|
|
54
|
+
name: "Search Polymarket",
|
|
55
|
+
description: "Search markets, events, and profiles via the Gamma API",
|
|
56
|
+
input: z.object({ q: z.string() }),
|
|
57
|
+
output: searchResultSchema,
|
|
58
|
+
run: async (input, credentials) => {
|
|
59
|
+
return createPolymarketClient(credentials).request({
|
|
60
|
+
host: "gamma",
|
|
61
|
+
method: "GET",
|
|
62
|
+
path: "/public-search",
|
|
63
|
+
query: { q: input.q }
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
const getProfile = polymarketOperation({
|
|
68
|
+
id: "get_polymarket_profile",
|
|
69
|
+
name: "Get Polymarket Profile",
|
|
70
|
+
description: "Get a user profile by wallet address via the Gamma API",
|
|
71
|
+
input: z.object({ address: z.string().regex(/^0x[a-fA-F0-9]{40}$/) }),
|
|
72
|
+
output: profileSchema,
|
|
73
|
+
run: async (input, credentials) => {
|
|
74
|
+
return createPolymarketClient(credentials).request({
|
|
75
|
+
host: "gamma",
|
|
76
|
+
method: "GET",
|
|
77
|
+
path: "/public-profile",
|
|
78
|
+
query: { address: input.address }
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
const getSportsMetadata = polymarketOperation({
|
|
83
|
+
id: "get_polymarket_sports_metadata",
|
|
84
|
+
name: "Get Polymarket Sports Metadata",
|
|
85
|
+
description: "Get sports metadata from the Gamma API",
|
|
86
|
+
input: z.object({}),
|
|
87
|
+
output: sportsMetadataSchema,
|
|
88
|
+
run: async (_input, credentials) => {
|
|
89
|
+
return createPolymarketClient(credentials).request({
|
|
90
|
+
host: "gamma",
|
|
91
|
+
method: "GET",
|
|
92
|
+
path: "/sports"
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
const getSportsMarketTypes = polymarketOperation({
|
|
97
|
+
id: "get_polymarket_sports_market_types",
|
|
98
|
+
name: "Get Polymarket Sports Market Types",
|
|
99
|
+
description: "Get sports market types from the Gamma API",
|
|
100
|
+
input: z.object({}),
|
|
101
|
+
output: sportsMarketTypeSchema,
|
|
102
|
+
run: async (_input, credentials) => {
|
|
103
|
+
return createPolymarketClient(credentials).request({
|
|
104
|
+
host: "gamma",
|
|
105
|
+
method: "GET",
|
|
106
|
+
path: "/sports/market-types"
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
const getSportsTeams = polymarketOperation({
|
|
111
|
+
id: "get_polymarket_sports_teams",
|
|
112
|
+
name: "Get Polymarket Sports Teams",
|
|
113
|
+
description: "Get sports teams from the Gamma API",
|
|
114
|
+
input: z.object({}),
|
|
115
|
+
output: sportsTeamSchema,
|
|
116
|
+
run: async (_input, credentials) => {
|
|
117
|
+
return createPolymarketClient(credentials).request({
|
|
118
|
+
host: "gamma",
|
|
119
|
+
method: "GET",
|
|
120
|
+
path: "/sports/teams"
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
//#endregion
|
|
126
|
+
export { getProfile, getSeries, getSportsMarketTypes, getSportsMetadata, getSportsTeams, listSeries, listTags, search };
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
|
|
3
|
+
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
4
|
+
|
|
5
|
+
//#region src/events.d.ts
|
|
6
|
+
declare const listEvents: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
7
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
order: z.ZodOptional<z.ZodString>;
|
|
10
|
+
ascending: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
id: z.ZodOptional<z.ZodString>;
|
|
12
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
13
|
+
tag_id: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
tag_slug: z.ZodOptional<z.ZodString>;
|
|
15
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
archived: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
featured: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
closed: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
liquidity_min: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
liquidity_max: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
volume_min: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
volume_max: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
start_date_min: z.ZodOptional<z.ZodString>;
|
|
24
|
+
start_date_max: z.ZodOptional<z.ZodString>;
|
|
25
|
+
end_date_min: z.ZodOptional<z.ZodString>;
|
|
26
|
+
end_date_max: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
title: z.ZodString;
|
|
30
|
+
slug: z.ZodString;
|
|
31
|
+
description: z.ZodOptional<z.ZodString>;
|
|
32
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
33
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
34
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
closed: z.ZodOptional<z.ZodBoolean>;
|
|
36
|
+
archived: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
+
featured: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
liquidity: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
volume: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
41
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
42
|
+
markets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
43
|
+
id: z.ZodString;
|
|
44
|
+
question: z.ZodString;
|
|
45
|
+
conditionId: z.ZodString;
|
|
46
|
+
slug: z.ZodString;
|
|
47
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
48
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
49
|
+
description: z.ZodOptional<z.ZodString>;
|
|
50
|
+
outcomes: z.ZodOptional<z.ZodString>;
|
|
51
|
+
outcomePrices: z.ZodOptional<z.ZodString>;
|
|
52
|
+
volume: z.ZodOptional<z.ZodString>;
|
|
53
|
+
volumeNum: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
liquidity: z.ZodOptional<z.ZodString>;
|
|
55
|
+
liquidityNum: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
bestBid: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
bestAsk: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
lastTradePrice: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
closed: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
+
archived: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
+
acceptingOrders: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
clobTokenIds: z.ZodOptional<z.ZodString>;
|
|
64
|
+
image: z.ZodOptional<z.ZodString>;
|
|
65
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
66
|
+
groupItemTitle: z.ZodOptional<z.ZodString>;
|
|
67
|
+
groupItemThreshold: z.ZodOptional<z.ZodString>;
|
|
68
|
+
enableOrderBook: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
70
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
71
|
+
}, z.core.$loose>>>;
|
|
72
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
73
|
+
id: z.ZodString;
|
|
74
|
+
label: z.ZodString;
|
|
75
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
76
|
+
}, z.core.$loose>>>;
|
|
77
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
78
|
+
}, z.core.$loose>>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
79
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
81
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
82
|
+
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
83
|
+
declare const getEvent: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
84
|
+
id: z.ZodString;
|
|
85
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
86
|
+
id: z.ZodString;
|
|
87
|
+
title: z.ZodString;
|
|
88
|
+
slug: z.ZodString;
|
|
89
|
+
description: z.ZodOptional<z.ZodString>;
|
|
90
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
91
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
92
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
93
|
+
closed: z.ZodOptional<z.ZodBoolean>;
|
|
94
|
+
archived: z.ZodOptional<z.ZodBoolean>;
|
|
95
|
+
featured: z.ZodOptional<z.ZodBoolean>;
|
|
96
|
+
liquidity: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
volume: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
99
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
100
|
+
markets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
101
|
+
id: z.ZodString;
|
|
102
|
+
question: z.ZodString;
|
|
103
|
+
conditionId: z.ZodString;
|
|
104
|
+
slug: z.ZodString;
|
|
105
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
106
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
107
|
+
description: z.ZodOptional<z.ZodString>;
|
|
108
|
+
outcomes: z.ZodOptional<z.ZodString>;
|
|
109
|
+
outcomePrices: z.ZodOptional<z.ZodString>;
|
|
110
|
+
volume: z.ZodOptional<z.ZodString>;
|
|
111
|
+
volumeNum: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
liquidity: z.ZodOptional<z.ZodString>;
|
|
113
|
+
liquidityNum: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
bestBid: z.ZodOptional<z.ZodNumber>;
|
|
115
|
+
bestAsk: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
lastTradePrice: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
118
|
+
closed: z.ZodOptional<z.ZodBoolean>;
|
|
119
|
+
archived: z.ZodOptional<z.ZodBoolean>;
|
|
120
|
+
acceptingOrders: z.ZodOptional<z.ZodBoolean>;
|
|
121
|
+
clobTokenIds: z.ZodOptional<z.ZodString>;
|
|
122
|
+
image: z.ZodOptional<z.ZodString>;
|
|
123
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
124
|
+
groupItemTitle: z.ZodOptional<z.ZodString>;
|
|
125
|
+
groupItemThreshold: z.ZodOptional<z.ZodString>;
|
|
126
|
+
enableOrderBook: z.ZodOptional<z.ZodBoolean>;
|
|
127
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
128
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
129
|
+
}, z.core.$loose>>>;
|
|
130
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
131
|
+
id: z.ZodString;
|
|
132
|
+
label: z.ZodString;
|
|
133
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
134
|
+
}, z.core.$loose>>>;
|
|
135
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
136
|
+
}, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
137
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
138
|
+
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
139
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
140
|
+
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
141
|
+
declare const getEventBySlug: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
142
|
+
slug: z.ZodString;
|
|
143
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
144
|
+
id: z.ZodString;
|
|
145
|
+
title: z.ZodString;
|
|
146
|
+
slug: z.ZodString;
|
|
147
|
+
description: z.ZodOptional<z.ZodString>;
|
|
148
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
149
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
150
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
151
|
+
closed: z.ZodOptional<z.ZodBoolean>;
|
|
152
|
+
archived: z.ZodOptional<z.ZodBoolean>;
|
|
153
|
+
featured: z.ZodOptional<z.ZodBoolean>;
|
|
154
|
+
liquidity: z.ZodOptional<z.ZodNumber>;
|
|
155
|
+
volume: z.ZodOptional<z.ZodNumber>;
|
|
156
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
157
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
158
|
+
markets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
159
|
+
id: z.ZodString;
|
|
160
|
+
question: z.ZodString;
|
|
161
|
+
conditionId: z.ZodString;
|
|
162
|
+
slug: z.ZodString;
|
|
163
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
164
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
165
|
+
description: z.ZodOptional<z.ZodString>;
|
|
166
|
+
outcomes: z.ZodOptional<z.ZodString>;
|
|
167
|
+
outcomePrices: z.ZodOptional<z.ZodString>;
|
|
168
|
+
volume: z.ZodOptional<z.ZodString>;
|
|
169
|
+
volumeNum: z.ZodOptional<z.ZodNumber>;
|
|
170
|
+
liquidity: z.ZodOptional<z.ZodString>;
|
|
171
|
+
liquidityNum: z.ZodOptional<z.ZodNumber>;
|
|
172
|
+
bestBid: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
bestAsk: z.ZodOptional<z.ZodNumber>;
|
|
174
|
+
lastTradePrice: z.ZodOptional<z.ZodNumber>;
|
|
175
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
+
closed: z.ZodOptional<z.ZodBoolean>;
|
|
177
|
+
archived: z.ZodOptional<z.ZodBoolean>;
|
|
178
|
+
acceptingOrders: z.ZodOptional<z.ZodBoolean>;
|
|
179
|
+
clobTokenIds: z.ZodOptional<z.ZodString>;
|
|
180
|
+
image: z.ZodOptional<z.ZodString>;
|
|
181
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
182
|
+
groupItemTitle: z.ZodOptional<z.ZodString>;
|
|
183
|
+
groupItemThreshold: z.ZodOptional<z.ZodString>;
|
|
184
|
+
enableOrderBook: z.ZodOptional<z.ZodBoolean>;
|
|
185
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
186
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
187
|
+
}, z.core.$loose>>>;
|
|
188
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
189
|
+
id: z.ZodString;
|
|
190
|
+
label: z.ZodString;
|
|
191
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
192
|
+
}, z.core.$loose>>>;
|
|
193
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
194
|
+
}, z.core.$loose>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
195
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
196
|
+
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
197
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
198
|
+
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
199
|
+
declare const getEventTags: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
200
|
+
id: z.ZodString;
|
|
201
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
202
|
+
id: z.ZodString;
|
|
203
|
+
label: z.ZodString;
|
|
204
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
205
|
+
}, z.core.$loose>>, readonly [_keystrokehq_core0.CredentialSet<"polymarket", z.ZodObject<{
|
|
206
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
207
|
+
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
208
|
+
POLYMARKET_API_KEY: z.ZodOptional<z.ZodString>;
|
|
209
|
+
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
210
|
+
//#endregion
|
|
211
|
+
export { getEvent, getEventBySlug, getEventTags, listEvents };
|