@polymarket/client 0.0.0-canary-20260421120448

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Polymarket
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # `@polymarket/client`
2
+
3
+ The `@polymarket/client` package is the core TypeScript client for the Polymarket SDK.
4
+
5
+ ## Status
6
+
7
+ This package is currently scaffolded as the first SDK workspace package and does not yet expose a public API beyond the base entrypoint.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ pnpm add @polymarket/client
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```ts
18
+ import { createPublicClient } from '@polymarket/client';
19
+ import { listMarkets } from '@polymarket/client/actions';
20
+
21
+ const client = createPublicClient();
22
+
23
+ const result = listMarkets(client, {
24
+ closed: false,
25
+ pageSize: 3,
26
+ });
27
+
28
+ for await (const page of result) {
29
+ // page.items: Market[]
30
+ }
31
+ ```
32
+
33
+ ## Development
34
+
35
+ From the monorepo root:
36
+
37
+ ```bash
38
+ pnpm --filter @polymarket/client build
39
+ ```
40
+
41
+ ## License
42
+
43
+ MIT
@@ -0,0 +1,266 @@
1
+ import { R as RateLimitError, G as RequestRejectedError, O as SigningError, Z as TransportError, a0 as UnexpectedResponseError, U as UserInputError, I as InsufficientLiquidityError, l as BaseSecureClient, ad as PrepareLimitOrderRequest, ae as OrderWorkflow, af as OrderPostingWorkflow, ag as PrepareMarketOrderRequest, B as BaseClient } from '../types-BcwWqAsH.js';
2
+ export { ah as CancelAllError, ai as CancelMarketOrdersError, aj as CancelMarketOrdersRequest, ak as CancelOrderError, al as CancelOrderRequest, am as CancelOrdersError, an as CancelOrdersRequest, ao as DownloadAccountingSnapshotError, ap as DownloadAccountingSnapshotRequest, aq as DropNotificationsError, ar as DropNotificationsRequest, as as Erc1155ApprovalForAllWorkflow, at as Erc1155ApprovalForAllWorkflowRequest, au as Erc20ApprovalWorkflow, av as Erc20ApprovalWorkflowRequest, aw as Erc20TransferWorkflow, ax as Erc20TransferWorkflowRequest, ay as EstimateMarketPriceError, az as EstimateMarketPriceRequest, aA as FetchBalanceAllowanceError, aB as FetchBalanceAllowanceRequest, aC as FetchClosedOnlyModeError, aD as FetchCommentsByIdError, aE as FetchCommentsByIdRequest, aF as FetchEventError, aG as FetchEventLiveVolumeError, aH as FetchEventLiveVolumeRequest, aI as FetchEventRequest, aJ as FetchEventTagsError, aK as FetchEventTagsRequest, aL as FetchExecuteParamsError, aM as FetchExecuteParamsRequest, aN as FetchFeeRateError, aO as FetchFeeRateRequest, aP as FetchGaslessTransactionRequest, aQ as FetchLastTradePriceError, aR as FetchLastTradePriceRequest, aS as FetchLastTradePricesError, aT as FetchLastTradePricesRequest, aU as FetchMarketError, aV as FetchMarketRequest, aW as FetchMarketTagsError, aX as FetchMarketTagsRequest, aY as FetchMidpointError, aZ as FetchMidpointRequest, a_ as FetchMidpointsError, a$ as FetchMidpointsRequest, b0 as FetchNegRiskError, b1 as FetchNegRiskRequest, b2 as FetchNotificationsError, b3 as FetchOrderBookError, b4 as FetchOrderBookRequest, b5 as FetchOrderBooksError, b6 as FetchOrderBooksRequest, b7 as FetchOrderError, b8 as FetchOrderRequest, b9 as FetchOrderScoringError, ba as FetchOrderScoringRequest, bb as FetchOrdersScoringError, bc as FetchOrdersScoringRequest, bd as FetchPortfolioValueError, be as FetchPortfolioValueRequest, bf as FetchPriceError, bg as FetchPriceHistoryError, bh as FetchPriceHistoryRequest, bi as FetchPriceRequest, bj as FetchPricesError, bk as FetchPricesRequest, bl as FetchPublicProfileError, bm as FetchPublicProfileRequest, bn as FetchRelatedTagResourcesError, bo as FetchRelatedTagResourcesRequest, bp as FetchRelatedTagsError, bq as FetchRelatedTagsRequest, br as FetchRewardPercentagesError, bs as FetchSeriesError, bt as FetchSeriesRequest, bu as FetchSpreadError, bv as FetchSpreadRequest, bw as FetchSpreadsError, bx as FetchSpreadsRequest, by as FetchTagError, bz as FetchTagRequest, bA as FetchTickSizeError, bB as FetchTickSizeRequest, bC as FetchTotalEarningsForUserForDayError, bD as FetchTotalEarningsForUserForDayRequest, bE as FetchTradedMarketCountError, bF as FetchTradedMarketCountRequest, bG as GaslessTransactionMetadataSchema, bH as GaslessWalletWorkflow, bI as GaslessWalletWorkflowRequest, bJ as GaslessWorkflow, bK as GaslessWorkflowRequest, bL as IsGaslessReadyError, bM as IsGaslessReadyRequest, bN as ListAccountTradesError, bO as ListAccountTradesRequest, bP as ListActivityError, bQ as ListActivityRequest, bR as ListBuilderLeaderboardError, bS as ListBuilderLeaderboardRequest, bT as ListBuilderTradesError, bU as ListBuilderTradesRequest, bV as ListBuilderVolumeError, bW as ListBuilderVolumeRequest, bX as ListClosedPositionsError, bY as ListClosedPositionsRequest, bZ as ListCommentsByUserAddressError, b_ as ListCommentsByUserAddressRequest, b$ as ListCommentsError, c0 as ListCommentsRequest, c1 as ListCurrentRewardsError, c2 as ListCurrentRewardsRequest, c3 as ListEventsError, c4 as ListEventsRequest, c5 as ListMarketHoldersError, c6 as ListMarketHoldersRequest, c7 as ListMarketPositionsError, c8 as ListMarketPositionsRequest, c9 as ListMarketRewardsError, ca as ListMarketRewardsRequest, cb as ListMarketsError, cc as ListMarketsRequest, cd as ListOpenInterestError, ce as ListOpenInterestRequest, cf as ListOpenOrdersError, cg as ListOpenOrdersRequest, ch as ListPositionsError, ci as ListPositionsRequest, cj as ListSeriesError, ck as ListSeriesRequest, cl as ListTagsError, cm as ListTagsRequest, cn as ListTeamsError, co as ListTeamsRequest, cp as ListTraderLeaderboardError, cq as ListTraderLeaderboardRequest, cr as ListTradesError, cs as ListTradesRequest, ct as ListUserEarningsAndMarketsConfigError, cu as ListUserEarningsAndMarketsConfigRequest, cv as ListUserEarningsForDayError, cw as ListUserEarningsForDayRequest, cx as MergePositionsWorkflow, cy as MergePositionsWorkflowRequest, cz as OrderDraft, cA as OrderWorkflowRequest, cB as PostOrderError, cC as PostOrdersError, cD as PostOrdersRequest, cE as PrepareErc1155ApprovalForAllError, cF as PrepareErc1155ApprovalForAllRequest, cG as PrepareErc20ApprovalError, cH as PrepareErc20ApprovalRequest, cI as PrepareErc20TransferError, cJ as PrepareErc20TransferRequest, cK as PrepareGaslessTransactionError, cL as PrepareGaslessTransactionRequest, cM as PrepareGaslessWalletError, cN as PrepareMergePositionsError, cO as PrepareMergePositionsRequest, cP as PrepareRedeemPositionsError, cQ as PrepareRedeemPositionsRequest, cR as PrepareSplitPositionError, cS as PrepareSplitPositionRequest, cT as PrepareTradingApprovalsError, cU as RedeemPositionsWorkflow, cV as RedeemPositionsWorkflowRequest, cW as SearchError, cX as SearchRequest, cY as SignedOrder, cZ as SplitPositionWorkflow, c_ as SplitPositionWorkflowRequest, c$ as TradingApprovalsWorkflow, d0 as TradingApprovalsWorkflowRequest, d1 as UpdateBalanceAllowanceError, d2 as UpdateBalanceAllowanceRequest, d3 as WaitForGaslessTransactionError, d4 as cancelAll, d5 as cancelMarketOrders, d6 as cancelOrder, d7 as cancelOrders, d8 as downloadAccountingSnapshot, d9 as dropNotifications, da as estimateMarketPrice, db as fetchBalanceAllowance, dc as fetchBuilderVolume, dd as fetchClosedOnlyMode, de as fetchCommentsById, df as fetchEvent, dg as fetchEventLiveVolume, dh as fetchEventTags, di as fetchExecuteParams, dj as fetchFeeRate, dk as fetchLastTradePrice, dl as fetchLastTradePrices, dm as fetchMarket, dn as fetchMarketTags, dp as fetchMidpoint, dq as fetchMidpoints, dr as fetchNegRisk, ds as fetchNotifications, dt as fetchOrder, du as fetchOrderBook, dv as fetchOrderBooks, dw as fetchOrderScoring, dx as fetchOrdersScoring, dy as fetchPortfolioValue, dz as fetchPrice, dA as fetchPriceHistory, dB as fetchPrices, dC as fetchPublicProfile, dD as fetchRelatedTagResources, dE as fetchRelatedTags, dF as fetchRewardPercentages, dG as fetchSeries, dH as fetchSpread, dI as fetchSpreads, dJ as fetchTag, dK as fetchTickSize, dL as fetchTotalEarningsForUserForDay, dM as fetchTradedMarketCount, dN as fetchTransaction, dO as isGaslessReady, dP as listAccountTrades, dQ as listActivity, dR as listBuilderLeaderboard, dS as listBuilderTrades, dT as listClosedPositions, dU as listComments, dV as listCommentsByUserAddress, dW as listCurrentRewards, dX as listEvents, dY as listMarketHolders, dZ as listMarketPositions, d_ as listMarketRewards, d$ as listMarkets, e0 as listOpenInterest, e1 as listOpenOrders, e2 as listPositions, e3 as listSeries, e4 as listTags, e5 as listTeams, e6 as listTraderLeaderboard, e7 as listTrades, e8 as listUserEarningsAndMarketsConfig, e9 as listUserEarningsForDay, ea as postOrder, eb as postOrders, ec as prepareErc1155ApprovalForAll, ed as prepareErc20Approval, ee as prepareErc20Transfer, ef as prepareGaslessTransaction, eg as prepareGaslessWallet, eh as prepareMergePositions, ei as prepareRedeemPositions, ej as prepareSplitPosition, ek as prepareTradingApprovals, el as search, em as updateBalanceAllowance } from '../types-BcwWqAsH.js';
3
+ import { ApiKey } from '@polymarket/bindings';
4
+ import { ApiKeyCreds, BuilderApiKeyCreds, BuilderApiKey } from '@polymarket/bindings/clob';
5
+ import { EvmAddress, EvmSignature } from '@polymarket/types';
6
+ import { SportsMarketTypesResponse, SportsMetadata } from '@polymarket/bindings/gamma';
7
+ import '@polymarket/bindings/relayer';
8
+ import 'zod';
9
+ import '@polymarket/bindings/data';
10
+ import 'ox';
11
+
12
+ type PrepareMarketOrderError = InsufficientLiquidityError | RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
13
+ /**
14
+ * Starts the market-order workflow.
15
+ *
16
+ * @throws {@link PrepareMarketOrderError}
17
+ * Thrown on failure.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const response = await prepareMarketOrder(client, {
22
+ * amount: 10,
23
+ * side: OrderSide.BUY,
24
+ * tokenId: '123',
25
+ * })
26
+ * .then(completeWith(wallet))
27
+ * .then(postOrder(client));
28
+ *
29
+ * // response: OrderResponse
30
+ * ```
31
+ */
32
+ declare function prepareMarketOrder(client: BaseSecureClient, request: PrepareMarketOrderRequest): Promise<OrderWorkflow>;
33
+ type PrepareLimitOrderError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
34
+ /**
35
+ * Starts the limit-order workflow.
36
+ *
37
+ * @throws {@link PrepareLimitOrderError}
38
+ * Thrown on failure.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const order = await prepareLimitOrder(client, {
43
+ * postOnly: true,
44
+ * price: 0.52,
45
+ * side: OrderSide.BUY,
46
+ * size: 10,
47
+ * tokenId: '123',
48
+ * }).then(completeWith(wallet))
49
+ * .then(postOrder(client));
50
+ *
51
+ * // response: OrderResponse
52
+ * ```
53
+ */
54
+ declare function prepareLimitOrder(client: BaseSecureClient, request: PrepareLimitOrderRequest): Promise<OrderWorkflow>;
55
+ type PrepareMarketOrderPostingError = PrepareMarketOrderError;
56
+ /**
57
+ * Starts and posts a market-order workflow.
58
+ *
59
+ * @throws {@link PrepareMarketOrderPostingError}
60
+ * Thrown on failure.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * const response = await prepareMarketOrderPosting(client, {
65
+ * amount: 10,
66
+ * side: OrderSide.BUY,
67
+ * tokenId: '123',
68
+ * }).then(completeWith(wallet));
69
+ *
70
+ * // response: OrderResponse
71
+ * ```
72
+ */
73
+ declare function prepareMarketOrderPosting(client: BaseSecureClient, request: PrepareMarketOrderRequest): Promise<OrderPostingWorkflow>;
74
+ type PrepareLimitOrderPostingError = PrepareLimitOrderError;
75
+ /**
76
+ * Starts and posts a limit-order workflow.
77
+ *
78
+ * @throws {@link PrepareLimitOrderPostingError}
79
+ * Thrown on failure.
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * const response = await prepareLimitOrderPosting(client, {
84
+ * postOnly: true,
85
+ * price: 0.52,
86
+ * side: OrderSide.BUY,
87
+ * size: 10,
88
+ * tokenId: '123',
89
+ * }).then(completeWith(wallet));
90
+ *
91
+ * // response: OrderResponse
92
+ * ```
93
+ */
94
+ declare function prepareLimitOrderPosting(client: BaseSecureClient, request: PrepareLimitOrderRequest): Promise<OrderPostingWorkflow>;
95
+
96
+ type ApiKeyAuthRequest = {
97
+ address: EvmAddress;
98
+ nonce: number;
99
+ signature: EvmSignature;
100
+ timestamp: number;
101
+ };
102
+ type CreateApiKeyError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError;
103
+ /**
104
+ * Creates a new API key from a signed L1 auth payload.
105
+ *
106
+ * @remarks
107
+ * This is a low-level auth action that most SDK consumers will not need.
108
+ *
109
+ * @example
110
+ * ```ts
111
+ * const creds = await createApiKey(client, request);
112
+ * ```
113
+ *
114
+ * @throws {@link CreateApiKeyError}
115
+ * Thrown on failure.
116
+ */
117
+ declare function createApiKey(client: BaseClient, request: ApiKeyAuthRequest): Promise<ApiKeyCreds>;
118
+ type DeriveApiKeyError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError;
119
+ /**
120
+ * Derives an existing API key from a signed L1 auth payload.
121
+ *
122
+ * @remarks
123
+ * This is a low-level auth action that most SDK consumers will not need.
124
+ *
125
+ * @example
126
+ * ```ts
127
+ * const creds = await deriveApiKey(client, request);
128
+ * ```
129
+ *
130
+ * @throws {@link DeriveApiKeyError}
131
+ * Thrown on failure.
132
+ */
133
+ declare function deriveApiKey(client: BaseClient, request: ApiKeyAuthRequest): Promise<ApiKeyCreds>;
134
+ type CreateOrDeriveApiKeyError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError;
135
+ /**
136
+ * Creates an API key and falls back to derivation when it already exists.
137
+ *
138
+ * @remarks
139
+ * This is a low-level auth action that most SDK consumers will not need.
140
+ *
141
+ * @example
142
+ * ```ts
143
+ * const creds = await createOrDeriveApiKey(client, request);
144
+ * ```
145
+ *
146
+ * @throws {@link CreateOrDeriveApiKeyError}
147
+ * Thrown on failure.
148
+ */
149
+ declare function createOrDeriveApiKey(client: BaseClient, request: ApiKeyAuthRequest): Promise<ApiKeyCreds>;
150
+ type FetchApiKeysError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError;
151
+ /**
152
+ * Fetches all API keys associated with the authenticated client.
153
+ *
154
+ * @remarks
155
+ * This is a low-level auth action that most SDK consumers will not need.
156
+ *
157
+ * @example
158
+ * ```ts
159
+ * const apiKeys = await fetchApiKeys(client);
160
+ * ```
161
+ *
162
+ * @throws {@link FetchApiKeysError}
163
+ * Thrown on failure.
164
+ */
165
+ declare function fetchApiKeys(client: BaseSecureClient): Promise<ApiKey[]>;
166
+ type DeleteApiKeyError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError;
167
+ /**
168
+ * Deletes the authenticated API key.
169
+ *
170
+ * @remarks
171
+ * This is a low-level auth action that most SDK consumers will not need.
172
+ *
173
+ * @example
174
+ * ```ts
175
+ * await deleteApiKey(client);
176
+ * ```
177
+ *
178
+ * @throws {@link DeleteApiKeyError}
179
+ * Thrown when request signing fails, or the request is rejected, rate limited,
180
+ * interrupted by transport issues, or returns an unexpected response.
181
+ */
182
+ declare function deleteApiKey(client: BaseSecureClient): Promise<void>;
183
+ type CreateBuilderApiKeyError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError;
184
+ /**
185
+ * Creates a new builder API key for the authenticated client.
186
+ *
187
+ * @remarks
188
+ * This is a low-level auth action that most SDK consumers will not need.
189
+ *
190
+ * @example
191
+ * ```ts
192
+ * const builderApiKey = await createBuilderApiKey(client);
193
+ * ```
194
+ *
195
+ * @throws {@link CreateBuilderApiKeyError}
196
+ * Thrown when request signing fails, or the request is rejected, rate limited,
197
+ * interrupted by transport issues, or returns an unexpected response.
198
+ */
199
+ declare function createBuilderApiKey(client: BaseSecureClient): Promise<BuilderApiKeyCreds>;
200
+ type FetchBuilderApiKeysError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError;
201
+ /**
202
+ * Fetches builder API keys associated with the authenticated client.
203
+ *
204
+ * @remarks
205
+ * This is a low-level auth action that most SDK consumers will not need.
206
+ *
207
+ * @example
208
+ * ```ts
209
+ * const builderApiKeys = await fetchBuilderApiKeys(client);
210
+ * ```
211
+ *
212
+ * @throws {@link FetchBuilderApiKeysError}
213
+ * Thrown when request signing fails, or the request is rejected, rate limited,
214
+ * interrupted by transport issues, or returns an unexpected response.
215
+ */
216
+ declare function fetchBuilderApiKeys(client: BaseSecureClient): Promise<BuilderApiKey[]>;
217
+ type RevokeBuilderApiKeyError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError;
218
+ /**
219
+ * Revokes a builder API key.
220
+ *
221
+ * @remarks
222
+ * This is a low-level auth action that most SDK consumers will not need.
223
+ *
224
+ * @example
225
+ * ```ts
226
+ * await revokeBuilderApiKey(client);
227
+ * ```
228
+ *
229
+ * @throws {@link RevokeBuilderApiKeyError}
230
+ * Thrown when request signing fails, or the request is rejected, rate limited,
231
+ * interrupted by transport issues, or returns an unexpected response.
232
+ */
233
+ declare function revokeBuilderApiKey(client: BaseClient): Promise<void>;
234
+
235
+ type ListSportsError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError;
236
+ /**
237
+ * Lists available sports metadata.
238
+ *
239
+ * @throws {@link ListSportsError}
240
+ * Thrown on failure.
241
+ *
242
+ * @example
243
+ * ```ts
244
+ * const sports = await listSports(client);
245
+ *
246
+ * // sports: SportsMetadata[]
247
+ * ```
248
+ */
249
+ declare function listSports(client: BaseClient): Promise<SportsMetadata[]>;
250
+ type FetchSportsMarketTypesError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError;
251
+ /**
252
+ * Fetches the available market types grouped by sport.
253
+ *
254
+ * @throws {@link FetchSportsMarketTypesError}
255
+ * Thrown on failure.
256
+ *
257
+ * @example
258
+ * ```ts
259
+ * const marketTypes = await fetchSportsMarketTypes(client);
260
+ *
261
+ * // marketTypes === SportsMarketTypesResponse
262
+ * ```
263
+ */
264
+ declare function fetchSportsMarketTypes(client: BaseClient): Promise<SportsMarketTypesResponse>;
265
+
266
+ export { type ApiKeyAuthRequest, type CreateApiKeyError, type CreateBuilderApiKeyError, type CreateOrDeriveApiKeyError, type DeleteApiKeyError, type DeriveApiKeyError, type FetchApiKeysError, type FetchBuilderApiKeysError, type FetchSportsMarketTypesError, type ListSportsError, OrderPostingWorkflow, OrderWorkflow, type PrepareLimitOrderError, type PrepareLimitOrderPostingError, PrepareLimitOrderRequest, type PrepareMarketOrderError, type PrepareMarketOrderPostingError, PrepareMarketOrderRequest, type RevokeBuilderApiKeyError, createApiKey, createBuilderApiKey, createOrDeriveApiKey, deleteApiKey, deriveApiKey, fetchApiKeys, fetchBuilderApiKeys, fetchSportsMarketTypes, listSports, prepareLimitOrder, prepareLimitOrderPosting, prepareMarketOrder, prepareMarketOrderPosting, revokeBuilderApiKey };
@@ -0,0 +1,2 @@
1
+ export{P as GaslessTransactionMetadataSchema,Ba as cancelAll,Ca as cancelMarketOrders,za as cancelOrder,Aa as cancelOrders,k as createApiKey,p as createBuilderApiKey,m as createOrDeriveApiKey,o as deleteApiKey,l as deriveApiKey,Qa as downloadAccountingSnapshot,y as dropNotifications,Da as estimateMarketPrice,n as fetchApiKeys,z as fetchBalanceAllowance,q as fetchBuilderApiKeys,ra as fetchBuilderVolume,t as fetchClosedOnlyMode,ka as fetchCommentsById,na as fetchEvent,pa as fetchEventLiveVolume,oa as fetchEventTags,L as fetchExecuteParams,Z as fetchFeeRate,ea as fetchLastTradePrice,fa as fetchLastTradePrices,ua as fetchMarket,va as fetchMarketTags,V as fetchMidpoint,W as fetchMidpoints,Y as fetchNegRisk,x as fetchNotifications,v as fetchOrder,aa as fetchOrderBook,ba as fetchOrderBooks,B as fetchOrderScoring,C as fetchOrdersScoring,Oa as fetchPortfolioValue,_ as fetchPrice,ga as fetchPriceHistory,$ as fetchPrices,Ua as fetchPublicProfile,bb as fetchRelatedTagResources,ab as fetchRelatedTags,G as fetchRewardPercentages,Xa as fetchSeries,Za as fetchSportsMarketTypes,ca as fetchSpread,da as fetchSpreads,$a as fetchTag,X as fetchTickSize,E as fetchTotalEarningsForUserForDay,Pa as fetchTradedMarketCount,O as fetchTransaction,M as isGaslessReady,w as listAccountTrades,I as listActivity,qa as listBuilderLeaderboard,U as listBuilderTrades,Na as listClosedPositions,ja as listComments,la as listCommentsByUserAddress,ha as listCurrentRewards,ma as listEvents,wa as listMarketHolders,ya as listMarketPositions,ia as listMarketRewards,ta as listMarkets,xa as listOpenInterest,u as listOpenOrders,Ma as listPositions,Wa as listSeries,Ya as listSports,_a as listTags,cb as listTeams,sa as listTraderLeaderboard,H as listTrades,F as listUserEarningsAndMarketsConfig,D as listUserEarningsForDay,Fa as postOrder,Ga as postOrders,S as prepareErc1155ApprovalForAll,R as prepareErc20Approval,db as prepareErc20Transfer,Q as prepareGaslessTransaction,N as prepareGaslessWallet,Ja as prepareLimitOrder,La as prepareLimitOrderPosting,Ia as prepareMarketOrder,Ka as prepareMarketOrderPosting,Sa as prepareMergePositions,Ta as prepareRedeemPositions,Ra as prepareSplitPosition,T as prepareTradingApprovals,Ea as resolveEstimatedMarketPrice,r as revokeBuilderApiKey,Va as search,Ha as signOrder,A as updateBalanceAllowance}from'../chunk-VQMBZJB5.js';import'../chunk-X2E5YUTB.js';//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,2 @@
1
+ import {PolymarketError}from'@polymarket/types';var o=class e extends PolymarketError{name="TransportError";constructor(r,s={}){super(r,s);}static fromError(r){return new e(r instanceof Error?r.message:"Request failed",{cause:r})}};var n=class extends PolymarketError{name="TimeoutError";constructor(r,s={}){super(r,s);}},a=class extends PolymarketError{name="TransactionFailedError";constructor(r,s={}){super(r,s);}},c=class e extends PolymarketError{name="CancelledSigningError";constructor(r,s={}){super(r,s);}static fromError(r){return new e(r.message,{cause:r})}};var i=class e extends PolymarketError{name="SigningError";constructor(r,s={}){super(r,s);}static fromError(r,s){let p=s??(r instanceof Error?r.message:"Signing failed");return new e(p,{cause:r})}};export{o as a,n as b,a as c,c as d,i as e};//# sourceMappingURL=chunk-DBVGNMB5.js.map
2
+ //# sourceMappingURL=chunk-DBVGNMB5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/errors.ts"],"names":["TransportError","_TransportError","PolymarketError","message","options","error","TimeoutError","TransactionFailedError","CancelledSigningError","_CancelledSigningError","SigningError","_SigningError","msg"],"mappings":"gDAmDO,IAAMA,EAAN,MAAMC,CAAAA,SAAuBC,eAAgB,CACzC,KAAO,gBAAA,CAEhB,WAAA,CAAYC,CAAAA,CAAiBC,CAAAA,CAAwB,EAAC,CAAG,CACvD,KAAA,CAAMD,CAAAA,CAASC,CAAO,EACxB,CAEA,OAAO,SAAA,CAAUC,EAAgC,CAC/C,OAAO,IAAIJ,CAAAA,CACTI,aAAiB,KAAA,CAAQA,CAAAA,CAAM,OAAA,CAAU,gBAAA,CACzC,CACE,KAAA,CAAOA,CACT,CACF,CACF,CACF,EAmCO,IAAMC,CAAAA,CAAN,cAA2BJ,eAAgB,CACvC,IAAA,CAAO,cAAA,CAEhB,YAAYC,CAAAA,CAAiBC,CAAAA,CAAwB,EAAC,CAAG,CACvD,KAAA,CAAMD,CAAAA,CAASC,CAAO,EACxB,CACF,CAAA,CAKaG,CAAAA,CAAN,cAAqCL,eAAgB,CACjD,IAAA,CAAO,wBAAA,CAEhB,WAAA,CAAYC,CAAAA,CAAiBC,EAAwB,EAAC,CAAG,CACvD,KAAA,CAAMD,EAASC,CAAO,EACxB,CACF,CAAA,CAKaI,CAAAA,CAAN,MAAMC,CAAAA,SAA8BP,eAAgB,CAChD,IAAA,CAAO,uBAAA,CAEhB,WAAA,CAAYC,CAAAA,CAAiBC,EAAwB,EAAC,CAAG,CACvD,KAAA,CAAMD,EAASC,CAAO,EACxB,CAEA,OAAO,UAAUC,CAAAA,CAAqC,CACpD,OAAO,IAAII,EAAsBJ,CAAAA,CAAM,OAAA,CAAS,CAC9C,KAAA,CAAOA,CACT,CAAC,CACH,CACF,MAkBaK,CAAAA,CAAN,MAAMC,CAAAA,SAAqBT,eAAgB,CACvC,IAAA,CAAO,cAAA,CAEhB,WAAA,CAAYC,CAAAA,CAAiBC,EAAwB,EAAC,CAAG,CACvD,KAAA,CAAMD,EAASC,CAAO,EACxB,CAEA,OAAO,UAAUC,CAAAA,CAAgBF,CAAAA,CAAgC,CAC/D,IAAMS,EACJT,CAAAA,GAAYE,CAAAA,YAAiB,KAAA,CAAQA,CAAAA,CAAM,QAAU,gBAAA,CAAA,CACvD,OAAO,IAAIM,CAAAA,CAAaC,EAAK,CAAE,KAAA,CAAOP,CAAM,CAAC,CAC/C,CACF","file":"chunk-DBVGNMB5.js","sourcesContent":["import { PolymarketError } from '@polymarket/types';\nimport type { ZodError } from 'zod';\nimport {\n formatInputZodError,\n formatResponseZodError,\n type ResponseValidationContext,\n} from './validation';\n\n/**\n * Error thrown when an action input fails SDK validation before a request is\n * sent.\n */\nexport class UserInputError extends PolymarketError {\n override name = 'UserInputError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n\n static fromZodError(error: ZodError): UserInputError {\n return new UserInputError(formatInputZodError(error), {\n cause: error,\n });\n }\n}\n\n/**\n * Error thrown when a service response does not match the action's expected\n * response shape.\n */\nexport class UnexpectedResponseError extends PolymarketError {\n override name = 'UnexpectedResponseError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n\n static fromZodError(\n error: ZodError,\n context: ResponseValidationContext,\n ): UnexpectedResponseError {\n return new UnexpectedResponseError(formatResponseZodError(error, context), {\n cause: error,\n });\n }\n}\n\n/**\n * Error thrown when the SDK cannot complete a request because of a network or\n * runtime transport failure.\n */\nexport class TransportError extends PolymarketError {\n override name = 'TransportError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n\n static fromError(error: unknown): TransportError {\n return new TransportError(\n error instanceof Error ? error.message : 'Request failed',\n {\n cause: error,\n },\n );\n }\n}\n\nexport type RequestRejectedErrorOptions = {\n status: number;\n};\n\n/**\n * Error thrown when a service responds with a non-success status other than\n * rate limiting.\n */\nexport class RequestRejectedError extends PolymarketError {\n override name = 'RequestRejectedError' as const;\n\n readonly status: number;\n\n constructor(\n message: string,\n options: ErrorOptions & RequestRejectedErrorOptions,\n ) {\n super(message, options);\n this.status = options.status;\n }\n}\n\n/**\n * Error thrown when the service rejects a request because the rate limit has\n * been exceeded.\n */\nexport class RateLimitError extends PolymarketError {\n override name = 'RateLimitError' as const;\n}\n\n/**\n * Error thrown when an async wait operation exceeds its allotted polling time.\n */\nexport class TimeoutError extends PolymarketError {\n override name = 'TimeoutError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n}\n\n/**\n * Error thrown when a submitted transaction reaches a terminal failure state.\n */\nexport class TransactionFailedError extends PolymarketError {\n override name = 'TransactionFailedError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n}\n\n/**\n * Error thrown when the user cancels a required wallet signing action.\n */\nexport class CancelledSigningError extends PolymarketError {\n override name = 'CancelledSigningError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n\n static fromError(error: Error): CancelledSigningError {\n return new CancelledSigningError(error.message, {\n cause: error,\n });\n }\n}\n\n/**\n * Error thrown when there is not enough resting market liquidity to satisfy the\n * requested execution semantics.\n */\nexport class InsufficientLiquidityError extends PolymarketError {\n override name = 'InsufficientLiquidityError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n}\n\n/**\n * Error thrown when the SDK cannot produce a required signature or\n * authentication payload.\n */\nexport class SigningError extends PolymarketError {\n override name = 'SigningError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n\n static fromError(error: unknown, message?: string): SigningError {\n const msg =\n message ?? (error instanceof Error ? error.message : 'Signing failed');\n return new SigningError(msg, { cause: error });\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import {t,y,x,w,sa,ra,qa,U,H,wa,xa,Da,ga,fa,ea,da,ca,ba,aa,$,_,W,V,pa,la,ka,ja,Ua,cb,Za,Ya,Va,bb,ab,$a,_a,Xa,Wa,va,ua,ta,oa,na,ma,G,F,E,D,C,B,v,u,Ca,Ba,Aa,za,Ga,Fa,La,Ja,Ka,Ia,Ta,Sa,Ra,db,S,R,T,I,ya,Qa,Pa,Oa,Na,Ma,ia,ha,N,M}from'./chunk-VQMBZJB5.js';function xe(e){return {listPositions:Ma.bind(null,e),listClosedPositions:Na.bind(null,e),fetchPortfolioValue:Oa.bind(null,e),fetchTradedMarketCount:Pa.bind(null,e),downloadAccountingSnapshot:Qa.bind(null,e),listMarketPositions:ya.bind(null,e),listActivity:I.bind(null,e)}}function r(e){let t$1=xe(e);return e.isPublicClient()?t$1:{...t$1,listAccountTrades:w.bind(null,e),fetchNotifications:x.bind(null,e),dropNotifications:y.bind(null,e),fetchClosedOnlyMode:t.bind(null,e)}}function s(e){return {listBuilderTrades:U.bind(null,e),listBuilderLeaderboard:qa.bind(null,e),fetchBuilderVolume:ra.bind(null,e),listTraderLeaderboard:sa.bind(null,e)}}function i(e){return {fetchEventLiveVolume:pa.bind(null,e),fetchMidpoint:V.bind(null,e),fetchMidpoints:W.bind(null,e),fetchPrice:_.bind(null,e),fetchPrices:$.bind(null,e),fetchOrderBook:aa.bind(null,e),fetchOrderBooks:ba.bind(null,e),fetchSpread:ca.bind(null,e),fetchSpreads:da.bind(null,e),fetchLastTradePrice:ea.bind(null,e),fetchLastTradePrices:fa.bind(null,e),fetchPriceHistory:ga.bind(null,e),estimateMarketPrice:Da.bind(null,e),listOpenInterest:xa.bind(null,e),listMarketHolders:wa.bind(null,e),listTrades:H.bind(null,e)}}function o(e){return {listEvents:ma.bind(null,e),fetchEvent:na.bind(null,e),fetchEventTags:oa.bind(null,e),listMarkets:ta.bind(null,e),fetchMarket:ua.bind(null,e),fetchMarketTags:va.bind(null,e),listSeries:Wa.bind(null,e),fetchSeries:Xa.bind(null,e),listTags:_a.bind(null,e),fetchTag:$a.bind(null,e),fetchRelatedTags:ab.bind(null,e),fetchRelatedTagResources:bb.bind(null,e),search:Va.bind(null,e),listSports:Ya.bind(null,e),fetchSportsMarketTypes:Za.bind(null,e),listTeams:cb.bind(null,e),fetchPublicProfile:Ua.bind(null,e),listComments:ja.bind(null,e),fetchCommentsById:ka.bind(null,e),listCommentsByUserAddress:la.bind(null,e)}}function We(e){return {listCurrentRewards:ha.bind(null,e),listMarketRewards:ia.bind(null,e)}}function n(e){let t=We(e);return e.isPublicClient()?t:{...t,fetchOrderScoring:B.bind(null,e),fetchOrdersScoring:C.bind(null,e),listUserEarningsForDay:D.bind(null,e),fetchTotalEarningsForUserForDay:E.bind(null,e),listUserEarningsAndMarketsConfig:F.bind(null,e),fetchRewardPercentages:G.bind(null,e)}}function ve(e){return {prepareMarketOrder:Ia.bind(null,e),prepareMarketOrderPosting:Ka.bind(null,e),prepareLimitOrder:Ja.bind(null,e),prepareLimitOrderPosting:La.bind(null,e),postOrder:Fa(e),postOrders:Ga(e),cancelOrder:za.bind(null,e),cancelOrders:Aa.bind(null,e),cancelAll:Ba.bind(null,e),cancelMarketOrders:Ca.bind(null,e),listOpenOrders:u.bind(null,e),fetchOrder:v.bind(null,e)}}function De(e){return {isGaslessReady:M.bind(null,e),prepareGaslessWallet:N.bind(null,e)}}function a(e){let t=De(e);return e.isPublicClient()?t:{...t,prepareTradingApprovals:T.bind(null,e),prepareErc20Approval:R.bind(null,e),prepareErc1155ApprovalForAll:S.bind(null,e),prepareErc20Transfer:db.bind(null,e),prepareSplitPosition:Ra.bind(null,e),prepareMergePositions:Sa.bind(null,e),prepareRedeemPositions:Ta.bind(null,e)}}function ot(e){return e.isSecureClient()?{...r(e),...s(e),...i(e),...o(e),...n(e),...ve(e),...a(e)}:{...r(e),...s(e),...i(e),...o(e),...n(e),...a(e)}}export{r as a,s as b,i as c,o as d,n as e,ve as f,a as g,ot as h};//# sourceMappingURL=chunk-KLADIGW6.js.map
2
+ //# sourceMappingURL=chunk-KLADIGW6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/decorators/account.ts","../src/decorators/analytics.ts","../src/decorators/data.ts","../src/decorators/discovery.ts","../src/decorators/rewards.ts","../src/decorators/trading.ts","../src/decorators/wallet.ts","../src/decorators/index.ts"],"names":["publicAccountActions","client","listPositions","listClosedPositions","fetchPortfolioValue","fetchTradedMarketCount","downloadAccountingSnapshot","listMarketPositions","listActivity","accountActions","actions","listAccountTrades","fetchNotifications","dropNotifications","fetchClosedOnlyMode","analyticsActions","listBuilderTrades","listBuilderLeaderboard","fetchBuilderVolume","listTraderLeaderboard","dataActions","fetchEventLiveVolume","fetchMidpoint","fetchMidpoints","fetchPrice","fetchPrices","fetchOrderBook","fetchOrderBooks","fetchSpread","fetchSpreads","fetchLastTradePrice","fetchLastTradePrices","fetchPriceHistory","estimateMarketPrice","listOpenInterest","listMarketHolders","listTrades","discoveryActions","listEvents","fetchEvent","fetchEventTags","listMarkets","fetchMarket","fetchMarketTags","listSeries","fetchSeries","listTags","fetchTag","fetchRelatedTags","fetchRelatedTagResources","search","listSports","fetchSportsMarketTypes","listTeams","fetchPublicProfile","listComments","fetchCommentsById","listCommentsByUserAddress","publicRewardsActions","listCurrentRewards","listMarketRewards","rewardsActions","fetchOrderScoring","fetchOrdersScoring","listUserEarningsForDay","fetchTotalEarningsForUserForDay","listUserEarningsAndMarketsConfig","fetchRewardPercentages","tradingActions","prepareMarketOrder","prepareMarketOrderPosting","prepareLimitOrder","prepareLimitOrderPosting","postOrder","postOrders","cancelOrder","cancelOrders","cancelAll","cancelMarketOrders","listOpenOrders","fetchOrder","publicWalletActions","isGaslessReady","prepareGaslessWallet","walletActions","prepareTradingApprovals","prepareErc20Approval","prepareErc1155ApprovalForAll","prepareErc20Transfer","prepareSplitPosition","prepareMergePositions","prepareRedeemPositions","allActions"],"mappings":"0PA4TA,SAASA,GAAqBC,CAAAA,CAA0C,CACtE,OAAO,CACL,cAAeC,EAAAA,CAAc,IAAA,CAAK,IAAA,CAAMD,CAAM,EAC9C,mBAAA,CAAqBE,EAAAA,CAAoB,IAAA,CAAK,IAAA,CAAMF,CAAM,CAAA,CAC1D,mBAAA,CAAqBG,EAAAA,CAAoB,IAAA,CAAK,KAAMH,CAAM,CAAA,CAC1D,sBAAA,CAAwBI,EAAAA,CAAuB,KAAK,IAAA,CAAMJ,CAAM,CAAA,CAChE,0BAAA,CAA4BK,GAA2B,IAAA,CAAK,IAAA,CAAML,CAAM,CAAA,CACxE,oBAAqBM,EAAAA,CAAoB,IAAA,CAAK,IAAA,CAAMN,CAAM,EAC1D,YAAA,CAAcO,CAAAA,CAAa,IAAA,CAAK,IAAA,CAAMP,CAAM,CAC9C,CACF,CAIO,SAASQ,EACdR,CAAAA,CACuC,CACvC,IAAMS,GAAAA,CAAUV,GAAqBC,CAAM,CAAA,CAE3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,CAAM,CAAA,CAC1B,GAAG4D,EAAe5D,CAAM,CAAA,CACxB,GAAGmF,CAAAA,CAAcnF,CAAM,CACzB,CACF","file":"chunk-KLADIGW6.js","sourcesContent":["import type {\n ClobTrade,\n NotificationsResponse,\n} from '@polymarket/bindings/clob';\nimport type {\n Activity,\n ClosedPosition,\n MetaMarketPositionV1,\n Position,\n Traded,\n Value,\n} from '@polymarket/bindings/data';\nimport type { Prettify } from '@polymarket/types';\nimport {\n type DownloadAccountingSnapshotRequest,\n type DropNotificationsRequest,\n downloadAccountingSnapshot,\n dropNotifications,\n type FetchPortfolioValueRequest,\n type FetchTradedMarketCountRequest,\n fetchClosedOnlyMode,\n fetchNotifications,\n fetchPortfolioValue,\n fetchTradedMarketCount,\n type ListAccountTradesRequest,\n type ListActivityRequest,\n type ListClosedPositionsRequest,\n type ListMarketPositionsRequest,\n type ListPositionsRequest,\n listAccountTrades,\n listActivity,\n listClosedPositions,\n listMarketPositions,\n listPositions,\n} from '../actions';\nimport type {\n BaseClient,\n BasePublicClient,\n BaseSecureClient,\n} from '../clients';\nimport type { Paginated } from '../pagination';\n\nexport type AccountPublicActions = {\n /**\n * Lists current positions for a wallet.\n *\n * @throws {@link ListPositionsError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listPositions({\n * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',\n * pageSize: 10,\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: Position[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listPositions({\n * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',\n * pageSize: 10,\n * });\n *\n * for await (const page of paginator) {\n * // page.items: Position[]\n * }\n * ```\n */\n listPositions(request: ListPositionsRequest): Paginated<Position>;\n /**\n * Lists closed positions for a wallet.\n *\n * @throws {@link ListClosedPositionsError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listClosedPositions({\n * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',\n * pageSize: 10,\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: ClosedPosition[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listClosedPositions({\n * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',\n * pageSize: 10,\n * });\n *\n * for await (const page of paginator) {\n * // page.items: ClosedPosition[]\n * }\n * ```\n */\n listClosedPositions(\n request: ListClosedPositionsRequest,\n ): Paginated<ClosedPosition>;\n /**\n * Fetches the total value for a wallet's positions.\n *\n * @throws {@link FetchPortfolioValueError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const value = await client.fetchPortfolioValue({\n * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',\n * });\n * ```\n */\n fetchPortfolioValue(request: FetchPortfolioValueRequest): Promise<Value[]>;\n /**\n * Fetches the total number of markets a wallet has traded.\n *\n * @throws {@link FetchTradedMarketCountError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const traded = await client.fetchTradedMarketCount({\n * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',\n * });\n * ```\n */\n fetchTradedMarketCount(\n request: FetchTradedMarketCountRequest,\n ): Promise<Traded>;\n /**\n * Downloads an accounting snapshot archive for a wallet.\n *\n * @throws {@link DownloadAccountingSnapshotError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const snapshot = await client.downloadAccountingSnapshot({\n * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',\n * });\n * ```\n */\n downloadAccountingSnapshot(\n request: DownloadAccountingSnapshotRequest,\n ): Promise<Blob>;\n /**\n * Lists positions for a market.\n *\n * @throws {@link ListMarketPositionsError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listMarketPositions({\n * market: '0xe546672750517f62c45a5a00067481981e62b9c20fa8220203232c9dc8fd2093',\n * pageSize: 10,\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: MetaMarketPositionV1[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listMarketPositions({\n * market: '0xe546672750517f62c45a5a00067481981e62b9c20fa8220203232c9dc8fd2093',\n * pageSize: 10,\n * });\n *\n * for await (const page of paginator) {\n * // page.items: MetaMarketPositionV1[]\n * }\n * ```\n */\n listMarketPositions(\n request: ListMarketPositionsRequest,\n ): Paginated<MetaMarketPositionV1>;\n /**\n * Lists wallet activity.\n *\n * @throws {@link ListActivityError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listActivity({\n * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',\n * pageSize: 10,\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: Activity[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listActivity({\n * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',\n * pageSize: 10,\n * });\n *\n * for await (const page of paginator) {\n * // page.items: Activity[]\n * }\n * ```\n */\n listActivity(request: ListActivityRequest): Paginated<Activity>;\n};\n\nexport type AccountActions = Prettify<\n AccountPublicActions & {\n /**\n * Lists trades for the authenticated account across all pages.\n *\n * @throws {@link ListAccountTradesError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listAccountTrades({\n * market: '0x0000000000000000000000000000000000000000000000000000000000000001',\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: ClobTrade[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listAccountTrades({\n * market: '0x0000000000000000000000000000000000000000000000000000000000000001',\n * });\n *\n * for await (const page of paginator) {\n * // page.items: ClobTrade[]\n * }\n * ```\n */\n listAccountTrades(request?: ListAccountTradesRequest): Paginated<ClobTrade>;\n /**\n * Fetches notifications for the authenticated account.\n *\n * @throws {@link FetchNotificationsError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const notifications = await client.fetchNotifications();\n * ```\n */\n fetchNotifications(): Promise<NotificationsResponse>;\n /**\n * Drops notifications for the authenticated account.\n *\n * @throws {@link DropNotificationsError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * await client.dropNotifications({\n * ids: ['1', '2'],\n * });\n * ```\n */\n dropNotifications(request: DropNotificationsRequest): Promise<void>;\n /**\n * Fetches whether the account is restricted to closed-only trading.\n *\n * @throws {@link FetchClosedOnlyModeError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const closedOnly = await client.fetchClosedOnlyMode();\n * ```\n */\n fetchClosedOnlyMode(): Promise<boolean>;\n }\n>;\n\nfunction publicAccountActions(client: BaseClient): AccountPublicActions {\n return {\n listPositions: listPositions.bind(null, client),\n listClosedPositions: listClosedPositions.bind(null, client),\n fetchPortfolioValue: fetchPortfolioValue.bind(null, client),\n fetchTradedMarketCount: fetchTradedMarketCount.bind(null, client),\n downloadAccountingSnapshot: downloadAccountingSnapshot.bind(null, client),\n listMarketPositions: listMarketPositions.bind(null, client),\n listActivity: listActivity.bind(null, client),\n };\n}\n\nexport function accountActions(client: BasePublicClient): AccountPublicActions;\nexport function accountActions(client: BaseSecureClient): AccountActions;\nexport function accountActions(\n client: BaseClient,\n): AccountPublicActions | AccountActions {\n const actions = publicAccountActions(client);\n\n if (client.isPublicClient()) {\n return actions;\n }\n\n return {\n ...actions,\n listAccountTrades: listAccountTrades.bind(null, client),\n fetchNotifications: fetchNotifications.bind(null, client),\n dropNotifications: dropNotifications.bind(null, client),\n fetchClosedOnlyMode: fetchClosedOnlyMode.bind(null, client),\n };\n}\n","import type { BuilderTrade } from '@polymarket/bindings/clob';\nimport type {\n BuilderVolumeEntry,\n LeaderboardEntry,\n TraderLeaderboardEntry,\n} from '@polymarket/bindings/data';\nimport {\n fetchBuilderVolume,\n type ListBuilderLeaderboardRequest,\n type ListBuilderTradesRequest,\n type ListBuilderVolumeRequest,\n type ListTraderLeaderboardRequest,\n listBuilderLeaderboard,\n listBuilderTrades,\n listTraderLeaderboard,\n} from '../actions';\nimport type {\n BaseClient,\n BasePublicClient,\n BaseSecureClient,\n} from '../clients';\nimport type { Paginated } from '../pagination';\n\nexport type AnalyticsActions = {\n /**\n * Lists builder-attributed trades.\n *\n * @throws {@link ListBuilderTradesError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listBuilderTrades({\n * pageSize: 10,\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: BuilderTrade[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listBuilderTrades({\n * pageSize: 10,\n * });\n *\n * for await (const page of paginator) {\n * // page.items: BuilderTrade[]\n * }\n * ```\n */\n listBuilderTrades(\n request?: ListBuilderTradesRequest,\n ): Paginated<BuilderTrade>;\n\n /**\n * Lists builder leaderboard rankings.\n *\n * @throws {@link ListBuilderLeaderboardError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listBuilderLeaderboard({\n * pageSize: 10,\n * timePeriod: 'DAY',\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: LeaderboardEntry[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listBuilderLeaderboard({\n * pageSize: 10,\n * timePeriod: 'DAY',\n * });\n *\n * for await (const page of paginator) {\n * // page.items: LeaderboardEntry[]\n * }\n * ```\n */\n listBuilderLeaderboard(\n request?: ListBuilderLeaderboardRequest,\n ): Paginated<LeaderboardEntry>;\n\n /**\n * Lists daily builder volume entries.\n *\n * @throws {@link ListBuilderVolumeError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const volume = await client.fetchBuilderVolume({\n * timePeriod: 'DAY',\n * });\n * ```\n */\n fetchBuilderVolume(\n request?: ListBuilderVolumeRequest,\n ): Promise<BuilderVolumeEntry[]>;\n\n /**\n * Lists trader leaderboard rankings.\n *\n * @throws {@link ListTraderLeaderboardError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listTraderLeaderboard({\n * orderBy: 'PNL',\n * pageSize: 10,\n * timePeriod: 'DAY',\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: TraderLeaderboardEntry[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listTraderLeaderboard({\n * orderBy: 'PNL',\n * pageSize: 10,\n * timePeriod: 'DAY',\n * });\n *\n * for await (const page of paginator) {\n * // page.items: TraderLeaderboardEntry[]\n * }\n * ```\n */\n listTraderLeaderboard(\n request?: ListTraderLeaderboardRequest,\n ): Paginated<TraderLeaderboardEntry>;\n};\n\nexport function analyticsActions(client: BasePublicClient): AnalyticsActions;\nexport function analyticsActions(client: BaseSecureClient): AnalyticsActions;\nexport function analyticsActions(client: BaseClient): AnalyticsActions {\n return {\n listBuilderTrades: listBuilderTrades.bind(null, client),\n listBuilderLeaderboard: listBuilderLeaderboard.bind(null, client),\n fetchBuilderVolume: fetchBuilderVolume.bind(null, client),\n listTraderLeaderboard: listTraderLeaderboard.bind(null, client),\n };\n}\n","import type {\n LastTradePrice,\n LastTradePriceForToken,\n OrderBook,\n PriceHistoryPoint,\n Prices,\n} from '@polymarket/bindings/clob';\nimport type {\n LiveVolume,\n MetaHolder,\n OpenInterest,\n Trade,\n} from '@polymarket/bindings/data';\nimport {\n type EstimateMarketPriceRequest,\n estimateMarketPrice,\n type FetchEventLiveVolumeRequest,\n type FetchLastTradePriceRequest,\n type FetchLastTradePricesRequest,\n type FetchMidpointRequest,\n type FetchMidpointsRequest,\n type FetchOrderBookRequest,\n type FetchOrderBooksRequest,\n type FetchPriceHistoryRequest,\n type FetchPriceRequest,\n type FetchPricesRequest,\n type FetchSpreadRequest,\n type FetchSpreadsRequest,\n fetchEventLiveVolume,\n fetchLastTradePrice,\n fetchLastTradePrices,\n fetchMidpoint,\n fetchMidpoints,\n fetchOrderBook,\n fetchOrderBooks,\n fetchPrice,\n fetchPriceHistory,\n fetchPrices,\n fetchSpread,\n fetchSpreads,\n type ListMarketHoldersRequest,\n type ListOpenInterestRequest,\n type ListTradesRequest,\n listMarketHolders,\n listOpenInterest,\n listTrades,\n} from '../actions';\nimport type {\n BaseClient,\n BasePublicClient,\n BaseSecureClient,\n} from '../clients';\nimport type { Paginated } from '../pagination';\n\nexport type DataActions = {\n /**\n * Fetches live volume for an event.\n *\n * @throws {@link FetchEventLiveVolumeError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const volume = await client.fetchEventLiveVolume({ id: '123' });\n * ```\n */\n fetchEventLiveVolume(\n request: FetchEventLiveVolumeRequest,\n ): Promise<LiveVolume[]>;\n /**\n * Fetches the midpoint price for a token.\n *\n * @throws {@link FetchMidpointError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const midpoint = await client.fetchMidpoint({ tokenId: '123' });\n * ```\n */\n fetchMidpoint(request: FetchMidpointRequest): Promise<string>;\n /**\n * Fetches midpoint prices for multiple tokens.\n *\n * @throws {@link FetchMidpointsError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const midpoints = await client.fetchMidpoints([{ tokenId: '123' }]);\n * ```\n */\n fetchMidpoints(\n request: FetchMidpointsRequest,\n ): Promise<Record<string, string>>;\n /**\n * Fetches the current quoted price for a token and side.\n *\n * @throws {@link FetchPriceError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const price = await client.fetchPrice({ tokenId: '123', side: OrderSide.BUY });\n * ```\n */\n fetchPrice(request: FetchPriceRequest): Promise<string>;\n /**\n * Fetches quoted prices for multiple tokens.\n *\n * @throws {@link FetchPricesError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const prices = await client.fetchPrices([{ tokenId: '123', side: OrderSide.BUY }]);\n * ```\n */\n fetchPrices(request: FetchPricesRequest): Promise<Prices>;\n /**\n * Fetches the current order book for a token.\n *\n * @throws {@link FetchOrderBookError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const book = await client.fetchOrderBook({ tokenId: '123' });\n * ```\n */\n fetchOrderBook(request: FetchOrderBookRequest): Promise<OrderBook>;\n /**\n * Fetches order books for multiple tokens.\n *\n * @throws {@link FetchOrderBooksError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const books = await client.fetchOrderBooks([{ tokenId: '123' }]);\n * ```\n */\n fetchOrderBooks(request: FetchOrderBooksRequest): Promise<OrderBook[]>;\n /**\n * Fetches the spread for a token.\n *\n * @throws {@link FetchSpreadError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const spread = await client.fetchSpread({ tokenId: '123' });\n * ```\n */\n fetchSpread(request: FetchSpreadRequest): Promise<string>;\n /**\n * Fetches spreads for multiple tokens.\n *\n * @throws {@link FetchSpreadsError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const spreads = await client.fetchSpreads([{ tokenId: '123' }]);\n * ```\n */\n fetchSpreads(request: FetchSpreadsRequest): Promise<Record<string, string>>;\n /**\n * Fetches the last traded price for a token.\n *\n * @throws {@link FetchLastTradePriceError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const price = await client.fetchLastTradePrice({ tokenId: '123' });\n * ```\n */\n fetchLastTradePrice(\n request: FetchLastTradePriceRequest,\n ): Promise<LastTradePrice>;\n /**\n * Fetches last traded prices for multiple tokens.\n *\n * @throws {@link FetchLastTradePricesError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const prices = await client.fetchLastTradePrices([{ tokenId: '123' }]);\n * ```\n */\n fetchLastTradePrices(\n request: FetchLastTradePricesRequest,\n ): Promise<LastTradePriceForToken[]>;\n /**\n * Fetches historical price points for a token.\n *\n * @throws {@link FetchPriceHistoryError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const history = await client.fetchPriceHistory({ tokenId: '123', interval: '1d' });\n * ```\n */\n fetchPriceHistory(\n request: FetchPriceHistoryRequest,\n ): Promise<PriceHistoryPoint[]>;\n /**\n * Estimates the price level a market order would cross at current book depth.\n *\n * For BUY orders, `amount` is the amount of collateral to spend. For SELL orders,\n * `amount` is the number of shares to sell.\n *\n * @throws {@link EstimateMarketPriceError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const price = await client.estimateMarketPrice({\n * tokenId: '123',\n * side: OrderSide.BUY,\n * amount: 10,\n * });\n * ```\n */\n estimateMarketPrice(request: EstimateMarketPriceRequest): Promise<number>;\n /**\n * Lists open interest for one or more markets.\n *\n * @throws {@link ListOpenInterestError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const openInterest = await client.listOpenInterest({\n * market: ['0xe546672750517f62c45a5a00067481981e62b9c20fa8220203232c9dc8fd2093'],\n * });\n * ```\n */\n listOpenInterest(request?: ListOpenInterestRequest): Promise<OpenInterest[]>;\n /**\n * Lists the top holders for one or more markets.\n *\n * @throws {@link ListMarketHoldersError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const holders = await client.listMarketHolders({\n * market: ['0xe546672750517f62c45a5a00067481981e62b9c20fa8220203232c9dc8fd2093'],\n * limit: 5,\n * });\n * ```\n */\n listMarketHolders(request: ListMarketHoldersRequest): Promise<MetaHolder[]>;\n /**\n * Lists trades for a wallet, market, or event.\n *\n * @throws {@link ListTradesError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listTrades({\n * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',\n * pageSize: 10,\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: Trade[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listTrades({\n * user: '0x7c3db723f1d4d8cb9c550095203b686cb11e5c6b',\n * pageSize: 10,\n * });\n *\n * for await (const page of paginator) {\n * // page.items: Trade[]\n * }\n * ```\n */\n listTrades(request?: ListTradesRequest): Paginated<Trade>;\n};\n\nexport function dataActions(client: BasePublicClient): DataActions;\nexport function dataActions(client: BaseSecureClient): DataActions;\nexport function dataActions(client: BaseClient): DataActions {\n return {\n fetchEventLiveVolume: fetchEventLiveVolume.bind(null, client),\n fetchMidpoint: fetchMidpoint.bind(null, client),\n fetchMidpoints: fetchMidpoints.bind(null, client),\n fetchPrice: fetchPrice.bind(null, client),\n fetchPrices: fetchPrices.bind(null, client),\n fetchOrderBook: fetchOrderBook.bind(null, client),\n fetchOrderBooks: fetchOrderBooks.bind(null, client),\n fetchSpread: fetchSpread.bind(null, client),\n fetchSpreads: fetchSpreads.bind(null, client),\n fetchLastTradePrice: fetchLastTradePrice.bind(null, client),\n fetchLastTradePrices: fetchLastTradePrices.bind(null, client),\n fetchPriceHistory: fetchPriceHistory.bind(null, client),\n estimateMarketPrice: estimateMarketPrice.bind(null, client),\n listOpenInterest: listOpenInterest.bind(null, client),\n listMarketHolders: listMarketHolders.bind(null, client),\n listTrades: listTrades.bind(null, client),\n };\n}\n","import type {\n Comment,\n Event,\n Market,\n PublicProfile,\n PublicSearchResponse,\n RelatedTag,\n Series,\n SportsMarketTypesResponse,\n SportsMetadata,\n Tag,\n TagReference,\n Team,\n} from '@polymarket/bindings/gamma';\nimport {\n type FetchCommentsByIdRequest,\n type FetchEventRequest,\n type FetchEventTagsRequest,\n type FetchMarketRequest,\n type FetchMarketTagsRequest,\n type FetchPublicProfileRequest,\n type FetchRelatedTagResourcesRequest,\n type FetchRelatedTagsRequest,\n type FetchSeriesRequest,\n type FetchTagRequest,\n fetchCommentsById,\n fetchEvent,\n fetchEventTags,\n fetchMarket,\n fetchMarketTags,\n fetchPublicProfile,\n fetchRelatedTagResources,\n fetchRelatedTags,\n fetchSeries,\n fetchSportsMarketTypes,\n fetchTag,\n type ListCommentsByUserAddressRequest,\n type ListCommentsRequest,\n type ListEventsRequest,\n type ListMarketsRequest,\n type ListSeriesRequest,\n type ListTagsRequest,\n type ListTeamsRequest,\n listComments,\n listCommentsByUserAddress,\n listEvents,\n listMarkets,\n listSeries,\n listSports,\n listTags,\n listTeams,\n type SearchRequest,\n search,\n} from '../actions';\nimport type {\n BaseClient,\n BasePublicClient,\n BaseSecureClient,\n} from '../clients';\nimport type { Paginated } from '../pagination';\n\nexport type DiscoveryActions = {\n /**\n * Lists events.\n *\n * @throws {@link ListEventsError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listEvents({\n * pageSize: 10,\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: Event[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listEvents({\n * pageSize: 10,\n * });\n *\n * for await (const page of paginator) {\n * // page.items: Event[]\n * }\n * ```\n */\n listEvents(request?: ListEventsRequest): Paginated<Event>;\n\n /**\n * Fetches an event.\n *\n * @throws {@link FetchEventError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const event = await client.fetchEvent({\n * id: '123',\n * });\n * ```\n */\n fetchEvent(request: FetchEventRequest): Promise<Event>;\n\n /**\n * Fetches an event's tags.\n *\n * @throws {@link FetchEventTagsError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const tags = await client.fetchEventTags({\n * id: '123',\n * });\n * ```\n */\n fetchEventTags(request: FetchEventTagsRequest): Promise<TagReference[]>;\n\n /**\n * Lists markets.\n *\n * @throws {@link ListMarketsError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listMarkets({\n * closed: false,\n * pageSize: 10,\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: Market[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listMarkets({\n * closed: false,\n * pageSize: 10,\n * });\n *\n * for await (const page of paginator) {\n * // page.items: Market[]\n * }\n * ```\n */\n listMarkets(request?: ListMarketsRequest): Paginated<Market>;\n\n /**\n * Fetches a market.\n *\n * @throws {@link FetchMarketError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const market = await client.fetchMarket({\n * id: '12345',\n * });\n * ```\n */\n fetchMarket(request: FetchMarketRequest): Promise<Market>;\n\n /**\n * Fetches a market's tags.\n *\n * @throws {@link FetchMarketTagsError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const tags = await client.fetchMarketTags({\n * id: '12345',\n * });\n * ```\n */\n fetchMarketTags(request: FetchMarketTagsRequest): Promise<TagReference[]>;\n\n /**\n * Lists series.\n *\n * @throws {@link ListSeriesError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listSeries({\n * pageSize: 10,\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: Series[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listSeries({\n * pageSize: 10,\n * });\n *\n * for await (const page of paginator) {\n * // page.items: Series[]\n * }\n * ```\n */\n listSeries(request?: ListSeriesRequest): Paginated<Series>;\n\n /**\n * Fetches a series.\n *\n * @throws {@link FetchSeriesError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const series = await client.fetchSeries({\n * id: '123',\n * });\n * ```\n */\n fetchSeries(request: FetchSeriesRequest): Promise<Series>;\n\n /**\n * Lists tags.\n *\n * @throws {@link ListTagsError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listTags({\n * pageSize: 10,\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: Tag[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listTags({\n * pageSize: 10,\n * });\n *\n * for await (const page of paginator) {\n * // page.items: Tag[]\n * }\n * ```\n */\n listTags(request?: ListTagsRequest): Paginated<Tag>;\n\n /**\n * Fetches a tag by id or slug.\n *\n * @throws {@link FetchTagError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const tag = await client.fetchTag({\n * slug: 'politics',\n * });\n * ```\n */\n fetchTag(request: FetchTagRequest): Promise<Tag>;\n\n /**\n * Fetches related tag relationships by id or slug.\n *\n * @throws {@link FetchRelatedTagsError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const related = await client.fetchRelatedTags({\n * slug: 'politics',\n * });\n * ```\n */\n fetchRelatedTags(request: FetchRelatedTagsRequest): Promise<RelatedTag[]>;\n\n /**\n * Fetches resources linked from related tag relationships by id or slug.\n *\n * @throws {@link FetchRelatedTagResourcesError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const resources = await client.fetchRelatedTagResources({\n * slug: 'politics',\n * });\n * ```\n */\n fetchRelatedTagResources(\n request: FetchRelatedTagResourcesRequest,\n ): Promise<Tag[]>;\n\n /**\n * Runs a public full-text search.\n *\n * @throws {@link SearchError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const results = await client.search({\n * query: 'election',\n * });\n * ```\n */\n search(request: SearchRequest): Promise<PublicSearchResponse>;\n\n /**\n * Lists available sports metadata.\n *\n * @throws {@link ListSportsError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const sports = await client.listSports();\n * ```\n */\n listSports(): Promise<SportsMetadata[]>;\n\n /**\n * Fetches the available market types grouped by sport.\n *\n * @throws {@link FetchSportsMarketTypesError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const marketTypes = await client.fetchSportsMarketTypes();\n * ```\n */\n fetchSportsMarketTypes(): Promise<SportsMarketTypesResponse>;\n\n /**\n * Lists teams.\n *\n * @throws {@link ListTeamsError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listTeams({\n * pageSize: 10,\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: Team[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listTeams({\n * pageSize: 10,\n * });\n *\n * for await (const page of paginator) {\n * // page.items: Team[]\n * }\n * ```\n */\n listTeams(request?: ListTeamsRequest): Paginated<Team>;\n\n /**\n * Fetches a public profile by wallet address.\n *\n * @throws {@link FetchPublicProfileError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const profile = await client.fetchPublicProfile({\n * address: '0x1234...',\n * });\n * ```\n */\n fetchPublicProfile(\n request: FetchPublicProfileRequest,\n ): Promise<PublicProfile | null>;\n\n /**\n * Lists comments for an event or series.\n *\n * @throws {@link ListCommentsError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listComments({\n * parentEntityId: '123',\n * parentEntityType: 'Event',\n * pageSize: 20,\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: Comment[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listComments({\n * parentEntityId: '123',\n * parentEntityType: 'Event',\n * pageSize: 20,\n * });\n *\n * for await (const page of paginator) {\n * // page.items: Comment[]\n * }\n * ```\n */\n listComments(request: ListCommentsRequest): Paginated<Comment>;\n\n /**\n * Fetches a comment thread by comment id.\n *\n * @throws {@link FetchCommentsByIdError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const thread = await client.fetchCommentsById({\n * id: '456',\n * getPositions: true,\n * });\n * ```\n */\n fetchCommentsById(request: FetchCommentsByIdRequest): Promise<Comment[]>;\n\n /**\n * Lists comments written by a wallet address.\n *\n * @throws {@link ListCommentsByUserAddressError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listCommentsByUserAddress({\n * address: '0x1234...',\n * pageSize: 10,\n * order: 'DESC',\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: Comment[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listCommentsByUserAddress({\n * address: '0x1234...',\n * pageSize: 10,\n * order: 'DESC',\n * });\n *\n * for await (const page of paginator) {\n * // page.items: Comment[]\n * }\n * ```\n */\n listCommentsByUserAddress(\n request: ListCommentsByUserAddressRequest,\n ): Paginated<Comment>;\n};\n\nexport function discoveryActions(client: BasePublicClient): DiscoveryActions;\nexport function discoveryActions(client: BaseSecureClient): DiscoveryActions;\nexport function discoveryActions(client: BaseClient): DiscoveryActions {\n return {\n listEvents: listEvents.bind(null, client),\n fetchEvent: fetchEvent.bind(null, client),\n fetchEventTags: fetchEventTags.bind(null, client),\n listMarkets: listMarkets.bind(null, client),\n fetchMarket: fetchMarket.bind(null, client),\n fetchMarketTags: fetchMarketTags.bind(null, client),\n listSeries: listSeries.bind(null, client),\n fetchSeries: fetchSeries.bind(null, client),\n listTags: listTags.bind(null, client),\n fetchTag: fetchTag.bind(null, client),\n fetchRelatedTags: fetchRelatedTags.bind(null, client),\n fetchRelatedTagResources: fetchRelatedTagResources.bind(null, client),\n search: search.bind(null, client),\n listSports: listSports.bind(null, client),\n fetchSportsMarketTypes: fetchSportsMarketTypes.bind(null, client),\n listTeams: listTeams.bind(null, client),\n fetchPublicProfile: fetchPublicProfile.bind(null, client),\n listComments: listComments.bind(null, client),\n fetchCommentsById: fetchCommentsById.bind(null, client),\n listCommentsByUserAddress: listCommentsByUserAddress.bind(null, client),\n };\n}\n","import type {\n CurrentReward,\n MarketReward,\n OrdersScoringResponse,\n RewardsPercentages,\n TotalUserEarning,\n UserEarning,\n UserRewardsEarning,\n} from '@polymarket/bindings/clob';\nimport type { Prettify } from '@polymarket/types';\nimport {\n type FetchOrderScoringRequest,\n type FetchOrdersScoringRequest,\n type FetchTotalEarningsForUserForDayRequest,\n fetchOrderScoring,\n fetchOrdersScoring,\n fetchRewardPercentages,\n fetchTotalEarningsForUserForDay,\n type ListCurrentRewardsRequest,\n type ListMarketRewardsRequest,\n type ListUserEarningsAndMarketsConfigRequest,\n type ListUserEarningsForDayRequest,\n listCurrentRewards,\n listMarketRewards,\n listUserEarningsAndMarketsConfig,\n listUserEarningsForDay,\n} from '../actions';\nimport type {\n BaseClient,\n BasePublicClient,\n BaseSecureClient,\n} from '../clients';\nimport type { Paginated } from '../pagination';\n\nexport type RewardsPublicActions = {\n /**\n * Lists current active market rewards.\n *\n * @throws {@link ListCurrentRewardsError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listCurrentRewards();\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: CurrentReward[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listCurrentRewards();\n *\n * for await (const page of paginator) {\n * // page.items: CurrentReward[]\n * }\n * ```\n */\n listCurrentRewards(\n request?: ListCurrentRewardsRequest,\n ): Paginated<CurrentReward>;\n /**\n * Lists reward configurations for a market.\n *\n * @throws {@link ListMarketRewardsError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listMarketRewards({\n * conditionId:\n * '0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af',\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: MarketReward[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listMarketRewards({\n * conditionId:\n * '0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af',\n * });\n *\n * for await (const page of paginator) {\n * // page.items: MarketReward[]\n * }\n * ```\n */\n listMarketRewards(request: ListMarketRewardsRequest): Paginated<MarketReward>;\n};\n\nexport type RewardsActions = Prettify<\n RewardsPublicActions & {\n /**\n * Fetches whether a single order is currently scoring.\n *\n * @throws {@link FetchOrderScoringError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const scoring = await client.fetchOrderScoring({\n * orderId: '123',\n * });\n * ```\n */\n fetchOrderScoring(request: FetchOrderScoringRequest): Promise<boolean>;\n /**\n * Fetches scoring state for multiple orders.\n *\n * @throws {@link FetchOrdersScoringError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const scoring = await client.fetchOrdersScoring({\n * orderIds: ['1', '2'],\n * });\n * ```\n */\n fetchOrdersScoring(\n request: FetchOrdersScoringRequest,\n ): Promise<OrdersScoringResponse>;\n /**\n * Lists per-market earnings for the authenticated account on a given day.\n *\n * @throws {@link ListUserEarningsForDayError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listUserEarningsForDay({\n * date: '2026-04-16',\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: UserEarning[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listUserEarningsForDay({\n * date: '2026-04-16',\n * });\n *\n * for await (const page of paginator) {\n * // page.items: UserEarning[]\n * }\n * ```\n */\n listUserEarningsForDay(\n request: ListUserEarningsForDayRequest,\n ): Paginated<UserEarning>;\n /**\n * Fetches total earnings for the authenticated account on a given day.\n *\n * @throws {@link FetchTotalEarningsForUserForDayError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const earnings = await client.fetchTotalEarningsForUserForDay({\n * date: '2026-04-16',\n * });\n * ```\n */\n fetchTotalEarningsForUserForDay(\n request: FetchTotalEarningsForUserForDayRequest,\n ): Promise<TotalUserEarning[]>;\n /**\n * Lists market reward configuration and earnings for the authenticated account on a given day.\n *\n * @throws {@link ListUserEarningsAndMarketsConfigError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listUserEarningsAndMarketsConfig({\n * date: '2026-04-16',\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: UserRewardsEarning[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listUserEarningsAndMarketsConfig({\n * date: '2026-04-16',\n * });\n *\n * for await (const page of paginator) {\n * // page.items: UserRewardsEarning[]\n * }\n * ```\n */\n listUserEarningsAndMarketsConfig(\n request: ListUserEarningsAndMarketsConfigRequest,\n ): Paginated<UserRewardsEarning>;\n /**\n * Fetches reward percentages for the authenticated account.\n *\n * @throws {@link FetchRewardPercentagesError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const percentages = await client.fetchRewardPercentages();\n * ```\n */\n fetchRewardPercentages(): Promise<RewardsPercentages>;\n }\n>;\n\nfunction publicRewardsActions(client: BaseClient): RewardsPublicActions {\n return {\n listCurrentRewards: listCurrentRewards.bind(null, client),\n listMarketRewards: listMarketRewards.bind(null, client),\n };\n}\n\nexport function rewardsActions(client: BasePublicClient): RewardsPublicActions;\nexport function rewardsActions(client: BaseSecureClient): RewardsActions;\nexport function rewardsActions(\n client: BaseClient,\n): RewardsPublicActions | RewardsActions {\n const actions = publicRewardsActions(client);\n\n if (client.isPublicClient()) {\n return actions;\n }\n\n return {\n ...actions,\n fetchOrderScoring: fetchOrderScoring.bind(null, client),\n fetchOrdersScoring: fetchOrdersScoring.bind(null, client),\n listUserEarningsForDay: listUserEarningsForDay.bind(null, client),\n fetchTotalEarningsForUserForDay: fetchTotalEarningsForUserForDay.bind(\n null,\n client,\n ),\n listUserEarningsAndMarketsConfig: listUserEarningsAndMarketsConfig.bind(\n null,\n client,\n ),\n fetchRewardPercentages: fetchRewardPercentages.bind(null, client),\n };\n}\n","import type {\n CancelOrdersResponse,\n OpenOrder,\n OrderResponse,\n OrderResponses,\n} from '@polymarket/bindings/clob';\nimport type { OrderWorkflow } from '../actions';\nimport {\n type CancelMarketOrdersRequest,\n type CancelOrderRequest,\n type CancelOrdersRequest,\n cancelAll,\n cancelMarketOrders,\n cancelOrder,\n cancelOrders,\n type FetchOrderRequest,\n fetchOrder,\n type ListOpenOrdersRequest,\n listOpenOrders,\n type OrderPostingWorkflow,\n type PostOrdersRequest,\n type PrepareLimitOrderRequest,\n type PrepareMarketOrderRequest,\n postOrder,\n postOrders,\n prepareLimitOrder,\n prepareLimitOrderPosting,\n prepareMarketOrder,\n prepareMarketOrderPosting,\n} from '../actions';\nimport type { SignedOrder } from '../actions/orders';\nimport type { BaseSecureClient } from '../clients';\nimport type { Paginated } from '../pagination';\n\nexport type TradingActions = {\n /**\n * Starts the market-order workflow.\n *\n * @throws {@link PrepareMarketOrderError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const order = await client.prepareMarketOrder({\n * amount: 10,\n * side: OrderSide.BUY,\n * tokenId: '123',\n * }).then(completeWith(wallet));\n *\n * const response = await client.postOrder(order);\n *\n * // response: OrderResponse\n * ```\n */\n prepareMarketOrder(\n request: PrepareMarketOrderRequest,\n ): Promise<OrderWorkflow>;\n /**\n * Starts and posts a market-order workflow.\n *\n * @throws {@link PrepareMarketOrderPostingError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const response = await client.prepareMarketOrderPosting({\n * amount: 10,\n * side: OrderSide.BUY,\n * tokenId: '123',\n * }).then(completeWith(wallet));\n *\n * // response: OrderResponse\n * ```\n */\n prepareMarketOrderPosting(\n request: PrepareMarketOrderRequest,\n ): Promise<OrderPostingWorkflow>;\n /**\n * Starts the limit-order workflow.\n *\n * @throws {@link PrepareLimitOrderError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const order = await client.prepareLimitOrder({\n * postOnly: true,\n * price: 0.52,\n * side: OrderSide.BUY,\n * size: 10,\n * tokenId: '123',\n * }).then(completeWith(wallet));\n *\n * const response = await client.postOrder(order);\n *\n * // response: OrderResponse\n * ```\n */\n prepareLimitOrder(request: PrepareLimitOrderRequest): Promise<OrderWorkflow>;\n /**\n * Starts and posts a limit-order workflow.\n *\n * @throws {@link PrepareLimitOrderPostingError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const response = await client.prepareLimitOrderPosting({\n * postOnly: true,\n * price: 0.52,\n * side: OrderSide.BUY,\n * size: 10,\n * tokenId: '123',\n * }).then(completeWith(wallet));\n *\n * // response: OrderResponse\n * ```\n */\n prepareLimitOrderPosting(\n request: PrepareLimitOrderRequest,\n ): Promise<OrderPostingWorkflow>;\n /**\n * Posts a signed order for the authenticated account.\n *\n * @throws {@link PostOrderError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const response = await client.postOrder(signedOrder);\n * ```\n */\n postOrder(order: SignedOrder): Promise<OrderResponse>;\n /**\n * Posts multiple signed orders for the authenticated account.\n *\n * @remarks\n * Accepts between 1 and 15 orders, matching the current service limit.\n *\n * @throws {@link PostOrdersError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const responses = await client.postOrders([firstSignedOrder, secondSignedOrder]);\n * ```\n */\n postOrders(orders: PostOrdersRequest): Promise<OrderResponses>;\n /**\n * Cancels a single open order for the authenticated account.\n *\n * @throws {@link CancelOrderError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const response = await client.cancelOrder({ orderId: '123' });\n *\n * // response.canceled: string[]\n * ```\n */\n cancelOrder(request: CancelOrderRequest): Promise<CancelOrdersResponse>;\n /**\n * Cancels multiple open orders for the authenticated account.\n *\n * @throws {@link CancelOrdersError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const response = await client.cancelOrders({ orderIds: ['1', '2'] });\n *\n * // response.canceled: string[]\n * ```\n */\n cancelOrders(request: CancelOrdersRequest): Promise<CancelOrdersResponse>;\n /**\n * Cancels all open orders for the authenticated account.\n *\n * @throws {@link CancelAllError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const response = await client.cancelAll();\n *\n * // response.canceled: string[]\n * ```\n */\n cancelAll(): Promise<CancelOrdersResponse>;\n /**\n * Cancels all open orders for the authenticated account that match the market or asset filter.\n *\n * @throws {@link CancelMarketOrdersError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const response = await client.cancelMarketOrders({\n * market: '0x0000000000000000000000000000000000000000000000000000000000000001',\n * });\n *\n * // response.canceled: string[]\n * ```\n */\n cancelMarketOrders(\n request: CancelMarketOrdersRequest,\n ): Promise<CancelOrdersResponse>;\n /**\n * Lists open orders for the authenticated account across all pages.\n *\n * @throws {@link ListOpenOrdersError}\n * Thrown on failure.\n *\n * @example\n * Fetch the first page of results:\n * ```ts\n * const paginator = client.listOpenOrders({\n * market: '0x0000000000000000000000000000000000000000000000000000000000000001',\n * });\n *\n * const firstPage = await paginator.firstPage();\n *\n * // Optionally, fetch additional pages:\n * for await (const page of paginator.from(firstPage.nextCursor)) {\n * // page.items: OpenOrder[]\n * }\n * ```\n *\n * @example\n * Loop through all pages with `for await`:\n * ```ts\n * const paginator = client.listOpenOrders({\n * market: '0x0000000000000000000000000000000000000000000000000000000000000001',\n * });\n *\n * for await (const page of paginator) {\n * // page.items: OpenOrder[]\n * }\n * ```\n */\n listOpenOrders(request?: ListOpenOrdersRequest): Paginated<OpenOrder>;\n /**\n * Fetches a single order for the authenticated account.\n *\n * @throws {@link FetchOrderError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const order = await client.fetchOrder({ orderId: '123' });\n * ```\n */\n fetchOrder(request: FetchOrderRequest): Promise<OpenOrder>;\n};\n\nexport function tradingActions(client: BaseSecureClient): TradingActions;\nexport function tradingActions(client: BaseSecureClient): TradingActions {\n return {\n prepareMarketOrder: prepareMarketOrder.bind(null, client),\n prepareMarketOrderPosting: prepareMarketOrderPosting.bind(null, client),\n prepareLimitOrder: prepareLimitOrder.bind(null, client),\n prepareLimitOrderPosting: prepareLimitOrderPosting.bind(null, client),\n postOrder: postOrder(client),\n postOrders: postOrders(client),\n cancelOrder: cancelOrder.bind(null, client),\n cancelOrders: cancelOrders.bind(null, client),\n cancelAll: cancelAll.bind(null, client),\n cancelMarketOrders: cancelMarketOrders.bind(null, client),\n listOpenOrders: listOpenOrders.bind(null, client),\n fetchOrder: fetchOrder.bind(null, client),\n };\n}\n","import type { Prettify } from '@polymarket/types';\nimport {\n type Erc20ApprovalWorkflow,\n type Erc20TransferWorkflow,\n type Erc1155ApprovalForAllWorkflow,\n type GaslessWalletWorkflow,\n type IsGaslessReadyRequest,\n isGaslessReady,\n type MergePositionsWorkflow,\n type PrepareErc20ApprovalRequest,\n type PrepareErc20TransferRequest,\n type PrepareErc1155ApprovalForAllRequest,\n type PrepareMergePositionsRequest,\n type PrepareRedeemPositionsRequest,\n type PrepareSplitPositionRequest,\n prepareErc20Approval,\n prepareErc20Transfer,\n prepareErc1155ApprovalForAll,\n prepareGaslessWallet,\n prepareMergePositions,\n prepareRedeemPositions,\n prepareSplitPosition,\n prepareTradingApprovals,\n type RedeemPositionsWorkflow,\n type SplitPositionWorkflow,\n type TradingApprovalsWorkflow,\n} from '../actions';\nimport type {\n BaseClient,\n BasePublicClient,\n BaseSecureClient,\n} from '../clients';\n\nexport type PublicWalletActions = {\n /**\n * Checks whether a wallet is ready for gasless transactions.\n *\n * @throws {@link IsGaslessReadyError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const ready = await client.isGaslessReady({\n * wallet: '0x1234...',\n * });\n * ```\n */\n isGaslessReady(request: IsGaslessReadyRequest): Promise<boolean>;\n /**\n * Starts preparing the wallet for gasless transactions.\n *\n * @throws {@link PrepareGaslessWalletError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const handle = await client.prepareGaslessWallet().then(completeWith(wallet));\n *\n * const outcome = await handle.wait();\n *\n * // outcome.transactionHash: TxHash\n * ```\n */\n prepareGaslessWallet(): Promise<GaslessWalletWorkflow>;\n};\n\nexport type SecureWalletActions = Prettify<\n PublicWalletActions & {\n /**\n * Starts a trading-setup approval workflow.\n *\n * @throws {@link PrepareTradingApprovalsError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const handle = await client.prepareTradingApprovals().then(completeWith(wallet));\n *\n * const outcome = await handle.wait();\n *\n * // outcome.transactionHash: TxHash\n * ```\n */\n prepareTradingApprovals(): Promise<TradingApprovalsWorkflow>;\n /**\n * Starts an ERC-20 approval workflow.\n *\n * @throws {@link PrepareErc20ApprovalError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const handle = await client.prepareErc20Approval({\n * amount: 'max',\n * spenderAddress: '0x1234…',\n * tokenAddress: '0x5678…',\n * }).then(completeWith(wallet));\n *\n * const outcome = await handle.wait();\n *\n * // outcome.transactionHash: TxHash\n * ```\n */\n prepareErc20Approval(\n request: PrepareErc20ApprovalRequest,\n ): Promise<Erc20ApprovalWorkflow>;\n /**\n * Starts an ERC-1155 approval-for-all workflow.\n *\n * @throws {@link PrepareErc1155ApprovalForAllError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const handle = await client.prepareErc1155ApprovalForAll({\n * operatorAddress: '0x1234…',\n * tokenAddress: '0x5678…',\n * }).then(completeWith(wallet));\n *\n * const outcome = await handle.wait();\n *\n * // outcome.transactionHash: TxHash\n * ```\n */\n prepareErc1155ApprovalForAll(\n request: PrepareErc1155ApprovalForAllRequest,\n ): Promise<Erc1155ApprovalForAllWorkflow>;\n /**\n * Starts an ERC-20 transfer workflow.\n *\n * @throws {@link PrepareErc20TransferError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const handle = await client.prepareErc20Transfer({\n * amount: 1n,\n * recipientAddress: client.account.signer,\n * tokenAddress: client.environment.collateralToken,\n * }).then(completeWith(wallet));\n *\n * const outcome = await handle.wait();\n *\n * // outcome.transactionHash: TxHash\n * ```\n */\n prepareErc20Transfer(\n request: PrepareErc20TransferRequest,\n ): Promise<Erc20TransferWorkflow>;\n /**\n * Starts a split workflow for a market condition.\n *\n * @throws {@link PrepareSplitPositionError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const handle = await client.prepareSplitPosition({\n * amount: 1n,\n * conditionId:\n * '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',\n * }).then(completeWith(wallet));\n *\n * const outcome = await handle.wait();\n *\n * // outcome.transactionHash: TxHash\n * ```\n */\n prepareSplitPosition(\n request: PrepareSplitPositionRequest,\n ): Promise<SplitPositionWorkflow>;\n /**\n * Starts a workflow to merge complementary positions in a market back into collateral.\n *\n * @throws {@link PrepareMergePositionsError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const handle = await client.prepareMergePositions({\n * amount: 'max',\n * conditionId:\n * '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',\n * }).then(completeWith(wallet));\n *\n * const outcome = await handle.wait();\n *\n * // outcome.transactionHash: TxHash\n * ```\n */\n prepareMergePositions(\n request: PrepareMergePositionsRequest,\n ): Promise<MergePositionsWorkflow>;\n /**\n * Starts a redemption workflow for resolved positions.\n *\n * @throws {@link PrepareRedeemPositionsError}\n * Thrown on failure.\n *\n * @example\n * ```ts\n * const handle = await client.prepareRedeemPositions({\n * conditionId:\n * '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',\n * }).then(completeWith(wallet));\n *\n * const outcome = await handle.wait();\n *\n * // outcome.transactionHash: TxHash\n * ```\n */\n prepareRedeemPositions(\n request: PrepareRedeemPositionsRequest,\n ): Promise<RedeemPositionsWorkflow>;\n }\n>;\n\nfunction publicWalletActions(client: BaseClient): PublicWalletActions {\n return {\n isGaslessReady: isGaslessReady.bind(null, client),\n prepareGaslessWallet: prepareGaslessWallet.bind(null, client),\n };\n}\n\nexport function walletActions(client: BasePublicClient): PublicWalletActions;\nexport function walletActions(client: BaseSecureClient): SecureWalletActions;\nexport function walletActions(\n client: BaseClient,\n): PublicWalletActions | SecureWalletActions {\n const actions = publicWalletActions(client);\n\n if (client.isPublicClient()) {\n return actions;\n }\n\n return {\n ...actions,\n prepareTradingApprovals: prepareTradingApprovals.bind(null, client),\n prepareErc20Approval: prepareErc20Approval.bind(null, client),\n prepareErc1155ApprovalForAll: prepareErc1155ApprovalForAll.bind(\n null,\n client,\n ),\n prepareErc20Transfer: prepareErc20Transfer.bind(null, client),\n prepareSplitPosition: prepareSplitPosition.bind(null, client),\n prepareMergePositions: prepareMergePositions.bind(null, client),\n prepareRedeemPositions: prepareRedeemPositions.bind(null, client),\n };\n}\n","import type { Prettify } from '@polymarket/types';\nimport type {\n BaseClient,\n BasePublicClient,\n BaseSecureClient,\n} from '../clients';\nimport {\n type AccountActions,\n type AccountPublicActions,\n accountActions,\n} from './account';\nimport { type AnalyticsActions, analyticsActions } from './analytics';\nimport { type DataActions, dataActions } from './data';\nimport { type DiscoveryActions, discoveryActions } from './discovery';\nimport {\n type RewardsActions,\n type RewardsPublicActions,\n rewardsActions,\n} from './rewards';\nimport { type TradingActions, tradingActions } from './trading';\nimport {\n type PublicWalletActions,\n type SecureWalletActions,\n walletActions,\n} from './wallet';\n\nexport type PublicActions = Prettify<\n DiscoveryActions &\n DataActions &\n AnalyticsActions &\n AccountPublicActions &\n RewardsPublicActions &\n PublicWalletActions\n>;\n\nexport type SecureActions = Prettify<\n DiscoveryActions &\n DataActions &\n AnalyticsActions &\n AccountActions &\n RewardsActions &\n SecureWalletActions &\n TradingActions\n>;\n\nexport function allActions(client: BasePublicClient): PublicActions;\nexport function allActions(client: BaseSecureClient): SecureActions;\nexport function allActions(client: BaseClient): PublicActions | SecureActions {\n if (client.isSecureClient()) {\n return {\n ...accountActions(client),\n ...analyticsActions(client),\n ...dataActions(client),\n ...discoveryActions(client),\n ...rewardsActions(client),\n ...tradingActions(client),\n ...walletActions(client),\n };\n }\n\n return {\n ...accountActions(client),\n ...analyticsActions(client),\n ...dataActions(client),\n ...discoveryActions(client),\n ...rewardsActions(client),\n ...walletActions(client),\n };\n}\n\nexport * from './account';\nexport * from './analytics';\nexport * from './data';\nexport * from './discovery';\nexport * from './rewards';\nexport * from './trading';\nexport * from './wallet';\n"]}