@qntx/wallet-engine 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1057 -20
- package/dist/apps-fiat24.d.mts +202 -0
- package/dist/apps-fiat24.mjs +1378 -0
- package/dist/apps-fiat24.mjs.map +1 -0
- package/dist/apps-hyperliquid.d.mts +549 -0
- package/dist/apps-hyperliquid.mjs +2742 -0
- package/dist/apps-hyperliquid.mjs.map +1 -0
- package/dist/apps-polymarket.d.mts +729 -0
- package/dist/apps-polymarket.mjs +3786 -0
- package/dist/apps-polymarket.mjs.map +1 -0
- package/dist/apps.d.mts +136 -0
- package/dist/apps.mjs +535 -0
- package/dist/apps.mjs.map +1 -0
- package/dist/connect-BY1C5ZRI.mjs +210 -0
- package/dist/connect-BY1C5ZRI.mjs.map +1 -0
- package/dist/connect.d.mts +17 -9
- package/dist/connect.mjs +3 -185
- package/dist/controller-DpNVHVsj.d.mts +2295 -0
- package/dist/controller-rMnaxKAH.mjs +46 -0
- package/dist/controller-rMnaxKAH.mjs.map +1 -0
- package/dist/decimal-COJ4g8qy.mjs +38 -0
- package/dist/decimal-COJ4g8qy.mjs.map +1 -0
- package/dist/eligibility-BfM9ybYZ.mjs +48 -0
- package/dist/eligibility-BfM9ybYZ.mjs.map +1 -0
- package/dist/engine-Dic_kkEr.d.mts +1829 -0
- package/dist/errors-B8W-hoYW.d.mts +7 -0
- package/dist/errors-horUy5k1.mjs +24 -0
- package/dist/errors-horUy5k1.mjs.map +1 -0
- package/dist/gateway-contract.d.mts +3 -362
- package/dist/gateway-contract.mjs +1531 -81
- package/dist/gateway-contract.mjs.map +1 -1
- package/dist/idb.d.mts +5 -0
- package/dist/idb.mjs +122 -46
- package/dist/idb.mjs.map +1 -1
- package/dist/index-vBgfOFIh.d.mts +2227 -0
- package/dist/index.d.mts +58 -515
- package/dist/index.mjs +22314 -4901
- package/dist/index.mjs.map +1 -1
- package/dist/json-BDwV38cj.mjs +15 -0
- package/dist/json-BDwV38cj.mjs.map +1 -0
- package/dist/link-Ceq8Dggp.mjs +139 -0
- package/dist/link-Ceq8Dggp.mjs.map +1 -0
- package/dist/primitives-DbSHLZKq.mjs +31 -0
- package/dist/primitives-DbSHLZKq.mjs.map +1 -0
- package/dist/push-message-AQuzoNFY.d.mts +84 -0
- package/dist/push-message-kbnH1A5w.mjs +142 -0
- package/dist/push-message-kbnH1A5w.mjs.map +1 -0
- package/dist/push.d.mts +13 -0
- package/dist/push.mjs +70 -0
- package/dist/push.mjs.map +1 -0
- package/dist/qr.d.mts +292 -0
- package/dist/qr.mjs +1725 -0
- package/dist/qr.mjs.map +1 -0
- package/dist/registry-CbtwcxkX.mjs +374 -0
- package/dist/registry-CbtwcxkX.mjs.map +1 -0
- package/dist/risk-DyABgg4W.mjs +757 -0
- package/dist/risk-DyABgg4W.mjs.map +1 -0
- package/dist/session-CNJFLarP.mjs +18 -0
- package/dist/session-CNJFLarP.mjs.map +1 -0
- package/dist/socket-ChG9JRT_.mjs +110 -0
- package/dist/socket-ChG9JRT_.mjs.map +1 -0
- package/dist/spi-BrTw5s98.d.mts +3 -0
- package/dist/timer-Cdk5rGM2.mjs +43 -0
- package/dist/timer-Cdk5rGM2.mjs.map +1 -0
- package/dist/types-BpvioFGo.d.mts +258 -0
- package/dist/types-DbftVZ3I.mjs +90 -0
- package/dist/types-DbftVZ3I.mjs.map +1 -0
- package/dist/walletconnect.d.mts +86 -0
- package/dist/walletconnect.mjs +1507 -0
- package/dist/walletconnect.mjs.map +1 -0
- package/dist/webln-BgrtPXpG.mjs +2593 -0
- package/dist/webln-BgrtPXpG.mjs.map +1 -0
- package/dist/webln-Bllk_xJ2.d.mts +666 -0
- package/package.json +94 -19
- package/dist/connect.mjs.map +0 -1
- package/dist/errors-DpkJneDe.d.mts +0 -1696
- package/dist/registry-Deo5WQe1.d.mts +0 -25
- package/dist/registry-wYrcuFNc.mjs +0 -99
- package/dist/registry-wYrcuFNc.mjs.map +0 -1
- package/dist/webln-DzsI7jVb.mjs +0 -3629
- package/dist/webln-DzsI7jVb.mjs.map +0 -1
|
@@ -0,0 +1,729 @@
|
|
|
1
|
+
import { ln as EvmFeeTier } from "./controller-DpNVHVsj.mjs";
|
|
2
|
+
import { c as AppGroup, d as AppGroupState, i as AppDefinition } from "./types-BpvioFGo.mjs";
|
|
3
|
+
import "./spi-BrTw5s98.mjs";
|
|
4
|
+
import "zod/mini";
|
|
5
|
+
import { Wallet } from "@qntx/wallet";
|
|
6
|
+
import { ChainsApi } from "@qntx/wallet/chains";
|
|
7
|
+
type PolymarketServerTime = {
|
|
8
|
+
/** CLOB server unix seconds. */
|
|
9
|
+
readonly serverSeconds: number;
|
|
10
|
+
/** `serverSeconds * 1000` minus the request's local midpoint — positive means the server is ahead. */
|
|
11
|
+
readonly skewMs: number;
|
|
12
|
+
};
|
|
13
|
+
type PolymarketWalletCandidates = {
|
|
14
|
+
/** The current deposit-wallet template — where a fresh account deploys. */
|
|
15
|
+
readonly beacon: `0x${string}`;
|
|
16
|
+
/** The pre-2026-06-29 deposit-wallet template. */
|
|
17
|
+
readonly uups: `0x${string}`;
|
|
18
|
+
/** The legacy Safe account. */
|
|
19
|
+
readonly safe: `0x${string}`;
|
|
20
|
+
};
|
|
21
|
+
type PolymarketAccount = {
|
|
22
|
+
/** The group's `evm.bip44` address — the CLOB `POLY_ADDRESS`/owner. */
|
|
23
|
+
readonly signer: `0x${string}`;
|
|
24
|
+
/** The account address positions/value/orders reads scope to. */
|
|
25
|
+
readonly wallet: `0x${string}`;
|
|
26
|
+
readonly kind: "deposit-wallet" | "safe";
|
|
27
|
+
readonly deployed: boolean;
|
|
28
|
+
/** A deployed legacy Safe alongside a live deposit wallet — read-only display. */
|
|
29
|
+
readonly legacySafe?: `0x${string}`;
|
|
30
|
+
};
|
|
31
|
+
type PolymarketWallets = {
|
|
32
|
+
readonly derive: (signer: `0x${string}`) => PolymarketWalletCandidates;
|
|
33
|
+
readonly locate: (signer: `0x${string}`) => Promise<PolymarketAccount>;
|
|
34
|
+
};
|
|
35
|
+
type PolymarketPosition = {
|
|
36
|
+
readonly assetId: string;
|
|
37
|
+
readonly conditionId: string;
|
|
38
|
+
/** Current holding in shares (decimal string). */
|
|
39
|
+
readonly size: string;
|
|
40
|
+
readonly avgPrice?: string;
|
|
41
|
+
readonly price?: string;
|
|
42
|
+
/** `size × price` in USDC. */
|
|
43
|
+
readonly value?: string;
|
|
44
|
+
readonly entryCost?: string;
|
|
45
|
+
readonly realizedPnl?: string;
|
|
46
|
+
readonly unrealizedPnl?: string;
|
|
47
|
+
readonly totalPnl?: string;
|
|
48
|
+
readonly status: string;
|
|
49
|
+
readonly redeemable: boolean;
|
|
50
|
+
readonly mergeable: boolean;
|
|
51
|
+
readonly negRisk: boolean;
|
|
52
|
+
readonly title?: string;
|
|
53
|
+
readonly slug?: string;
|
|
54
|
+
readonly outcome?: string;
|
|
55
|
+
readonly outcomeIndex?: number;
|
|
56
|
+
readonly endDate?: string;
|
|
57
|
+
};
|
|
58
|
+
type PolymarketActivity = {
|
|
59
|
+
/** TRADE, SPLIT, MERGE, REDEEM, REWARD, CONVERSION, … */
|
|
60
|
+
readonly type: string;
|
|
61
|
+
readonly timestamp: number;
|
|
62
|
+
readonly conditionId: string;
|
|
63
|
+
readonly assetId: string;
|
|
64
|
+
readonly side?: string;
|
|
65
|
+
readonly size?: string;
|
|
66
|
+
readonly usdcSize?: string;
|
|
67
|
+
readonly price?: string;
|
|
68
|
+
readonly transactionHash: string;
|
|
69
|
+
readonly outcome?: string;
|
|
70
|
+
readonly outcomeIndex?: number;
|
|
71
|
+
};
|
|
72
|
+
type PolymarketPnlPoint = {
|
|
73
|
+
readonly timestamp: number;
|
|
74
|
+
readonly realizedPnl: string;
|
|
75
|
+
readonly positionPnl?: string;
|
|
76
|
+
readonly economicPnl?: string;
|
|
77
|
+
readonly volume?: string;
|
|
78
|
+
readonly tradeCount?: number;
|
|
79
|
+
};
|
|
80
|
+
type PolymarketPnl = {
|
|
81
|
+
readonly wallet: string;
|
|
82
|
+
readonly interval: string;
|
|
83
|
+
readonly fidelity: string;
|
|
84
|
+
readonly points: ReadonlyArray<PolymarketPnlPoint>;
|
|
85
|
+
};
|
|
86
|
+
type PolymarketApproval = {
|
|
87
|
+
readonly id: string;
|
|
88
|
+
readonly feature: string;
|
|
89
|
+
readonly token: `0x${string}`;
|
|
90
|
+
readonly spender: `0x${string}`;
|
|
91
|
+
/** ERC20 allowance — `max` or a raw integer string; absent on ERC1155 rows. */
|
|
92
|
+
readonly amount?: string;
|
|
93
|
+
readonly standard: string;
|
|
94
|
+
readonly approved: boolean;
|
|
95
|
+
};
|
|
96
|
+
type PolymarketApprovals = {
|
|
97
|
+
readonly address: `0x${string}`;
|
|
98
|
+
readonly checkedAt: string;
|
|
99
|
+
readonly contracts: ReadonlyArray<PolymarketApproval>;
|
|
100
|
+
};
|
|
101
|
+
type PolymarketOrder = {
|
|
102
|
+
readonly id: string;
|
|
103
|
+
readonly status: string;
|
|
104
|
+
readonly conditionId: string;
|
|
105
|
+
readonly assetId: string;
|
|
106
|
+
readonly side: string;
|
|
107
|
+
readonly price: string;
|
|
108
|
+
readonly originalSize: string;
|
|
109
|
+
readonly sizeMatched: string;
|
|
110
|
+
readonly outcome?: string;
|
|
111
|
+
readonly orderType: string;
|
|
112
|
+
readonly expiration: string;
|
|
113
|
+
readonly createdAt: number;
|
|
114
|
+
readonly makerAddress: string;
|
|
115
|
+
};
|
|
116
|
+
type PolymarketTrade = {
|
|
117
|
+
readonly id: string;
|
|
118
|
+
readonly takerOrderId: string;
|
|
119
|
+
readonly conditionId: string;
|
|
120
|
+
readonly assetId: string;
|
|
121
|
+
readonly side: string;
|
|
122
|
+
readonly size: string;
|
|
123
|
+
readonly price: string;
|
|
124
|
+
readonly status: string;
|
|
125
|
+
readonly matchTime: string;
|
|
126
|
+
readonly outcome?: string;
|
|
127
|
+
readonly transactionHash?: string;
|
|
128
|
+
readonly traderSide: string;
|
|
129
|
+
readonly makerOrders: ReadonlyArray<{
|
|
130
|
+
readonly orderId: string;
|
|
131
|
+
readonly matchedAmount: string;
|
|
132
|
+
readonly price: string;
|
|
133
|
+
}>;
|
|
134
|
+
};
|
|
135
|
+
type PolymarketBalance = {
|
|
136
|
+
/** Collateral balance as a raw 6-decimal integer string. */
|
|
137
|
+
readonly balance: string;
|
|
138
|
+
/** Spender → allowance, raw 6-decimal integer strings. */
|
|
139
|
+
readonly allowances: Readonly<Record<string, string>>;
|
|
140
|
+
};
|
|
141
|
+
type PolymarketPositionsParams = {
|
|
142
|
+
readonly cursor?: string;
|
|
143
|
+
readonly limit?: number;
|
|
144
|
+
};
|
|
145
|
+
type PolymarketActivityParams = {
|
|
146
|
+
readonly cursor?: string;
|
|
147
|
+
readonly limit?: number;
|
|
148
|
+
readonly start?: number;
|
|
149
|
+
readonly end?: number;
|
|
150
|
+
readonly sortDirection?: "ASC" | "DESC";
|
|
151
|
+
};
|
|
152
|
+
type PolymarketPnlParams = {
|
|
153
|
+
readonly interval?: "max" | "all" | "1m" | "1w" | "1d" | "12h" | "6h";
|
|
154
|
+
readonly fidelity?: "1d" | "18h" | "12h" | "3h" | "1h";
|
|
155
|
+
};
|
|
156
|
+
type PolymarketOpenOrdersParams = {
|
|
157
|
+
/** Condition id — required when `assetId` is given (the CLOB refuses asset-only queries). */
|
|
158
|
+
readonly market?: string;
|
|
159
|
+
readonly assetId?: string;
|
|
160
|
+
readonly cursor?: string;
|
|
161
|
+
};
|
|
162
|
+
type PolymarketTradesParams = {
|
|
163
|
+
readonly market?: string;
|
|
164
|
+
readonly assetId?: string;
|
|
165
|
+
readonly before?: number;
|
|
166
|
+
readonly after?: number;
|
|
167
|
+
readonly cursor?: string;
|
|
168
|
+
};
|
|
169
|
+
type PolymarketPage<T> = {
|
|
170
|
+
readonly items: ReadonlyArray<T>;
|
|
171
|
+
/** Follow with the same params plus `cursor` — absent on the last page. */
|
|
172
|
+
readonly nextCursor?: string;
|
|
173
|
+
};
|
|
174
|
+
type PolymarketAccountReads = {
|
|
175
|
+
/** Where this group's account lives — the located wallet or the beacon it will deploy to. */
|
|
176
|
+
readonly locate: (group: AppGroup) => Promise<PolymarketAccount>;
|
|
177
|
+
readonly positions: (wallet: `0x${string}`, params?: PolymarketPositionsParams) => Promise<PolymarketPage<PolymarketPosition>>;
|
|
178
|
+
/** The wallet's portfolio value in USDC (decimal string). */
|
|
179
|
+
readonly value: (wallet: `0x${string}`) => Promise<string>;
|
|
180
|
+
readonly activity: (wallet: `0x${string}`, params?: PolymarketActivityParams) => Promise<PolymarketPage<PolymarketActivity>>;
|
|
181
|
+
readonly pnl: (wallet: `0x${string}`, params?: PolymarketPnlParams) => Promise<PolymarketPnl>;
|
|
182
|
+
readonly approvals: (wallet: `0x${string}`) => Promise<PolymarketApprovals>;
|
|
183
|
+
readonly openOrders: (group: AppGroup, params?: PolymarketOpenOrdersParams) => Promise<PolymarketPage<PolymarketOrder>>;
|
|
184
|
+
/** `undefined` when the CLOB has no such order — its documented 404. */
|
|
185
|
+
readonly order: (group: AppGroup, orderId: string) => Promise<PolymarketOrder | undefined>;
|
|
186
|
+
readonly trades: (group: AppGroup, params?: PolymarketTradesParams) => Promise<PolymarketPage<PolymarketTrade>>;
|
|
187
|
+
/** Collateral balance + allowances at `signature_type: 3` (the deposit wallet). */
|
|
188
|
+
readonly balance: (group: AppGroup) => Promise<PolymarketBalance>;
|
|
189
|
+
/** Forces the CLOB to re-read on-chain balance/allowance, then returns them. */
|
|
190
|
+
readonly refreshAllowance: (group: AppGroup, params: {
|
|
191
|
+
readonly assetType: "COLLATERAL" | "CONDITIONAL";
|
|
192
|
+
readonly tokenId?: string;
|
|
193
|
+
}) => Promise<PolymarketBalance>;
|
|
194
|
+
/** `false` also when the address has no ban record (the documented 404). */
|
|
195
|
+
readonly closedOnly: (group: AppGroup) => Promise<boolean>;
|
|
196
|
+
/** `DELETE /auth/api-key` — revokes the group's API key on the CLOB (L2-signed). */
|
|
197
|
+
readonly revokeApiKey: (group: AppGroup) => Promise<void>;
|
|
198
|
+
};
|
|
199
|
+
/** The four `POLY_BUILDER_*` headers the host's builder signer returns (research.md §2/§9). */
|
|
200
|
+
type PolymarketBuilderHeaders = {
|
|
201
|
+
readonly POLY_BUILDER_API_KEY: string;
|
|
202
|
+
readonly POLY_BUILDER_PASSPHRASE: string;
|
|
203
|
+
readonly POLY_BUILDER_SIGNATURE: string;
|
|
204
|
+
readonly POLY_BUILDER_TIMESTAMP: string;
|
|
205
|
+
};
|
|
206
|
+
type PolymarketFundingOutcome = {
|
|
207
|
+
readonly kind: "ok";
|
|
208
|
+
} | {
|
|
209
|
+
readonly kind: "unknown";
|
|
210
|
+
};
|
|
211
|
+
type PolymarketFunding = {
|
|
212
|
+
/**
|
|
213
|
+
* Move `amount` pUSD (6-decimal units) from the owner's EOA into the deposit wallet — a described
|
|
214
|
+
* `send` request. Not eligibility-gated: a deposit opens nothing.
|
|
215
|
+
*/
|
|
216
|
+
readonly deposit: (group: AppGroup, params: {
|
|
217
|
+
readonly amount: bigint;
|
|
218
|
+
readonly fee: EvmFeeTier;
|
|
219
|
+
}) => Promise<{
|
|
220
|
+
readonly requestId: string;
|
|
221
|
+
readonly outcome: Promise<PolymarketFundingOutcome>;
|
|
222
|
+
}>;
|
|
223
|
+
/**
|
|
224
|
+
* Move `amount` pUSD from the deposit wallet back to the owner's EOA — a relayer `Batch` of one
|
|
225
|
+
* `transfer`. Needs the host's builder signer. `unknown` means the submit was lost; reconcile by
|
|
226
|
+
* checking the balance, never by blind resubmission.
|
|
227
|
+
*/
|
|
228
|
+
readonly withdraw: (group: AppGroup, params: {
|
|
229
|
+
readonly amount: bigint;
|
|
230
|
+
}) => Promise<{
|
|
231
|
+
readonly requestId: string;
|
|
232
|
+
readonly outcome: Promise<PolymarketFundingOutcome>;
|
|
233
|
+
}>;
|
|
234
|
+
};
|
|
235
|
+
/** What a live view reports — `data` is kept while `stale`, never while absent. */
|
|
236
|
+
type PolymarketLiveState<T> = {
|
|
237
|
+
readonly status: "connecting" | "live" | "stale";
|
|
238
|
+
readonly data: T | undefined;
|
|
239
|
+
/** Set when the view stopped on a fatal error (lock, `unlock-required`, `not-enabled`). */
|
|
240
|
+
readonly error: string | undefined;
|
|
241
|
+
readonly updatedAt: number | undefined;
|
|
242
|
+
};
|
|
243
|
+
type PolymarketLiveView<T> = {
|
|
244
|
+
readonly getState: () => PolymarketLiveState<T>;
|
|
245
|
+
/** Listener on every state change; returns an unsubscribe. */
|
|
246
|
+
readonly subscribe: (listener: (state: PolymarketLiveState<T>) => void) => () => void;
|
|
247
|
+
/** Drops the subscription — the view keeps its last state and never updates again. */
|
|
248
|
+
readonly close: () => Promise<void>;
|
|
249
|
+
};
|
|
250
|
+
type PolymarketBookLevel = {
|
|
251
|
+
readonly price: string;
|
|
252
|
+
readonly size: string;
|
|
253
|
+
};
|
|
254
|
+
type PolymarketBookData = {
|
|
255
|
+
/** Bids sorted best-first (price descending). */
|
|
256
|
+
readonly bids: ReadonlyArray<PolymarketBookLevel>;
|
|
257
|
+
/** Asks sorted best-first (price ascending). */
|
|
258
|
+
readonly asks: ReadonlyArray<PolymarketBookLevel>;
|
|
259
|
+
readonly tickSize: string | undefined;
|
|
260
|
+
readonly timestamp: string | undefined;
|
|
261
|
+
readonly hash: string | undefined;
|
|
262
|
+
};
|
|
263
|
+
type PolymarketMarketData = {
|
|
264
|
+
readonly book?: PolymarketBookData | undefined;
|
|
265
|
+
readonly lastTrade?: {
|
|
266
|
+
readonly price: string;
|
|
267
|
+
readonly size: string;
|
|
268
|
+
readonly side: "BUY" | "SELL";
|
|
269
|
+
} | undefined;
|
|
270
|
+
readonly bestBidAsk?: {
|
|
271
|
+
readonly bestBid: string;
|
|
272
|
+
readonly bestAsk: string;
|
|
273
|
+
readonly spread: string;
|
|
274
|
+
} | undefined;
|
|
275
|
+
readonly resolved?: {
|
|
276
|
+
readonly winningAssetId: string;
|
|
277
|
+
readonly winningOutcome: string;
|
|
278
|
+
} | undefined;
|
|
279
|
+
};
|
|
280
|
+
type PolymarketAccountLiveData = {
|
|
281
|
+
readonly wallet: `0x${string}`;
|
|
282
|
+
readonly openOrders: ReadonlyArray<PolymarketOrder>;
|
|
283
|
+
readonly positions: ReadonlyArray<PolymarketPosition>;
|
|
284
|
+
readonly trades: ReadonlyArray<PolymarketTrade>;
|
|
285
|
+
/** Whether the data flows from the user socket or the REST fallback poll. */
|
|
286
|
+
readonly source: "stream" | "poll";
|
|
287
|
+
};
|
|
288
|
+
type PolymarketLive = {
|
|
289
|
+
/** The order book for one outcome asset (CLOB token id). */
|
|
290
|
+
readonly book: (assetId: string) => PolymarketLiveView<PolymarketMarketData>;
|
|
291
|
+
/**
|
|
292
|
+
* Orders + positions + trades for the group over the user channel — one authenticated socket per
|
|
293
|
+
* view with a REST poll fallback while disconnected. Stops on lock or a
|
|
294
|
+
* `unlock-required`/`not-enabled` error.
|
|
295
|
+
*/
|
|
296
|
+
readonly account: (group: AppGroup) => PolymarketLiveView<PolymarketAccountLiveData>;
|
|
297
|
+
};
|
|
298
|
+
type PolymarketMarket = {
|
|
299
|
+
readonly id: string;
|
|
300
|
+
readonly conditionId: string;
|
|
301
|
+
readonly questionId?: string;
|
|
302
|
+
readonly question: string;
|
|
303
|
+
readonly slug: string;
|
|
304
|
+
readonly outcomes: ReadonlyArray<string>;
|
|
305
|
+
/** PositionIds on Gamma `version: "v2"` markets, parsed `clobTokenIds` otherwise. */
|
|
306
|
+
readonly assetIds: ReadonlyArray<string>;
|
|
307
|
+
readonly version: "v1" | "v2";
|
|
308
|
+
readonly negRisk: boolean;
|
|
309
|
+
readonly tickSize: string;
|
|
310
|
+
readonly minOrderSize: string;
|
|
311
|
+
readonly acceptingOrders: boolean;
|
|
312
|
+
readonly active: boolean;
|
|
313
|
+
readonly closed: boolean;
|
|
314
|
+
readonly endDate?: string;
|
|
315
|
+
readonly outcomePrices?: ReadonlyArray<string>;
|
|
316
|
+
readonly volume?: string;
|
|
317
|
+
readonly liquidity?: string;
|
|
318
|
+
/** Display only — never used to sign. */
|
|
319
|
+
readonly fees?: {
|
|
320
|
+
readonly makerBaseFee?: number;
|
|
321
|
+
readonly takerBaseFee?: number;
|
|
322
|
+
};
|
|
323
|
+
};
|
|
324
|
+
type PolymarketEvent = {
|
|
325
|
+
readonly id: string;
|
|
326
|
+
readonly slug: string;
|
|
327
|
+
readonly title: string;
|
|
328
|
+
readonly active: boolean;
|
|
329
|
+
readonly closed: boolean;
|
|
330
|
+
readonly negRisk?: boolean;
|
|
331
|
+
readonly endDate?: string;
|
|
332
|
+
readonly markets: ReadonlyArray<PolymarketMarket>;
|
|
333
|
+
};
|
|
334
|
+
type PolymarketBook = {
|
|
335
|
+
readonly assetId: string;
|
|
336
|
+
readonly conditionId: string;
|
|
337
|
+
readonly version: "v1" | "v2";
|
|
338
|
+
/** Sorted by price descending. */
|
|
339
|
+
readonly bids: ReadonlyArray<{
|
|
340
|
+
readonly price: string;
|
|
341
|
+
readonly size: string;
|
|
342
|
+
}>;
|
|
343
|
+
/** Sorted by price ascending. */
|
|
344
|
+
readonly asks: ReadonlyArray<{
|
|
345
|
+
readonly price: string;
|
|
346
|
+
readonly size: string;
|
|
347
|
+
}>;
|
|
348
|
+
readonly tickSize: string;
|
|
349
|
+
readonly minOrderSize: string;
|
|
350
|
+
readonly negRisk: boolean;
|
|
351
|
+
readonly timestamp: string;
|
|
352
|
+
readonly hash: string;
|
|
353
|
+
};
|
|
354
|
+
type PolymarketClobMarket = {
|
|
355
|
+
readonly conditionId?: string;
|
|
356
|
+
readonly tokens: ReadonlyArray<{
|
|
357
|
+
readonly assetId: string;
|
|
358
|
+
readonly outcome?: string;
|
|
359
|
+
}>;
|
|
360
|
+
readonly minOrderSize?: string;
|
|
361
|
+
readonly tickSize?: string;
|
|
362
|
+
readonly acceptingOrders?: boolean;
|
|
363
|
+
/** The market only accepts buy orders against its closing book. */
|
|
364
|
+
readonly buyOnly?: boolean;
|
|
365
|
+
readonly version: "v1" | "v2";
|
|
366
|
+
readonly blockaidEnabled?: boolean;
|
|
367
|
+
readonly rewards?: {
|
|
368
|
+
readonly enabled?: boolean;
|
|
369
|
+
readonly minIncentiveSize?: string;
|
|
370
|
+
readonly maxIncentiveRate?: string;
|
|
371
|
+
readonly minOrderAgeSec?: number;
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
type PolymarketPricePoint = {
|
|
375
|
+
readonly t: number;
|
|
376
|
+
readonly p: string;
|
|
377
|
+
};
|
|
378
|
+
type PolymarketResolution = {
|
|
379
|
+
readonly conditionId?: string;
|
|
380
|
+
readonly questionId?: string;
|
|
381
|
+
readonly status: string;
|
|
382
|
+
readonly resolved: boolean;
|
|
383
|
+
readonly marketType?: string;
|
|
384
|
+
readonly reporter?: string;
|
|
385
|
+
readonly wasDisputed: boolean;
|
|
386
|
+
readonly extendedReview: boolean;
|
|
387
|
+
readonly resolvedAt?: string;
|
|
388
|
+
/** Micro-USDC per share, `[outcome0, outcome1]`, on resolved rows. */
|
|
389
|
+
readonly payouts?: ReadonlyArray<number>;
|
|
390
|
+
readonly price?: string;
|
|
391
|
+
};
|
|
392
|
+
type PolymarketEventsParams = {
|
|
393
|
+
readonly limit?: number;
|
|
394
|
+
readonly offset?: number;
|
|
395
|
+
readonly closed?: boolean;
|
|
396
|
+
readonly order?: string;
|
|
397
|
+
readonly ascending?: boolean;
|
|
398
|
+
readonly tag_id?: number;
|
|
399
|
+
};
|
|
400
|
+
type PolymarketHistoryParams = {
|
|
401
|
+
readonly startTs?: number;
|
|
402
|
+
readonly endTs?: number;
|
|
403
|
+
readonly interval?: "max" | "all" | "1m" | "1w" | "1d" | "6h" | "1h";
|
|
404
|
+
readonly fidelity?: number;
|
|
405
|
+
};
|
|
406
|
+
type PolymarketMarkets = {
|
|
407
|
+
readonly events: (params?: PolymarketEventsParams) => Promise<ReadonlyArray<PolymarketEvent>>;
|
|
408
|
+
readonly event: (slug: string) => Promise<PolymarketEvent>;
|
|
409
|
+
readonly markets: (params?: PolymarketEventsParams) => Promise<ReadonlyArray<PolymarketMarket>>;
|
|
410
|
+
readonly market: (slug: string) => Promise<PolymarketMarket>;
|
|
411
|
+
readonly search: (query: string) => Promise<ReadonlyArray<PolymarketEvent>>;
|
|
412
|
+
readonly book: (assetId: string) => Promise<PolymarketBook>;
|
|
413
|
+
readonly price: (assetId: string, side: "BUY" | "SELL") => Promise<string>;
|
|
414
|
+
readonly midpoint: (assetId: string) => Promise<string>;
|
|
415
|
+
readonly history: (assetId: string, params?: PolymarketHistoryParams) => Promise<ReadonlyArray<PolymarketPricePoint>>;
|
|
416
|
+
readonly clobMarket: (conditionId: string) => Promise<PolymarketClobMarket>;
|
|
417
|
+
readonly feeRate: (assetId: string) => Promise<number>;
|
|
418
|
+
readonly resolution: (conditionId: string) => Promise<ReadonlyArray<PolymarketResolution>>;
|
|
419
|
+
readonly time: () => Promise<PolymarketServerTime>;
|
|
420
|
+
};
|
|
421
|
+
type PolymarketSide = "BUY" | "SELL";
|
|
422
|
+
type PolymarketLimitParams = {
|
|
423
|
+
readonly assetId: string;
|
|
424
|
+
readonly side: PolymarketSide;
|
|
425
|
+
readonly price: string;
|
|
426
|
+
readonly size: string;
|
|
427
|
+
};
|
|
428
|
+
type PolymarketMarketParams = {
|
|
429
|
+
readonly assetId: string;
|
|
430
|
+
readonly side: PolymarketSide;
|
|
431
|
+
/** PUSD to spend (BUY) or shares to sell (SELL). */
|
|
432
|
+
readonly amount: string;
|
|
433
|
+
/** Worst-price headroom past the last touched book level — 0..5000. */
|
|
434
|
+
readonly slippageBps: number;
|
|
435
|
+
/** Fill-or-kill refuses insufficient depth; fill-and-kill takes what exists. */
|
|
436
|
+
readonly orderType: "FOK" | "FAK";
|
|
437
|
+
};
|
|
438
|
+
/** Display-only market metadata — never signed (invariant 6: the V2 struct has no fee field). */
|
|
439
|
+
type PolymarketQuoteFees = {
|
|
440
|
+
readonly makerBaseFee?: number;
|
|
441
|
+
readonly takerBaseFee?: number;
|
|
442
|
+
};
|
|
443
|
+
type PolymarketQuote = {
|
|
444
|
+
readonly kind: "limit" | "market";
|
|
445
|
+
readonly assetId: string;
|
|
446
|
+
readonly side: PolymarketSide;
|
|
447
|
+
/** Limit: the tick-aligned price. Market: absent. */
|
|
448
|
+
readonly price?: string;
|
|
449
|
+
/** Limit: the size after rounding down to two decimals. */
|
|
450
|
+
readonly size?: string;
|
|
451
|
+
/** Market: the pUSD/shares amount the order carries — the fillable part when `partial`. */
|
|
452
|
+
readonly amount?: string;
|
|
453
|
+
/** The worst signed price — the limit price itself, or the slippage bound for a market order. */
|
|
454
|
+
readonly bound: string;
|
|
455
|
+
/** 6-decimal integer strings, as signed. */
|
|
456
|
+
readonly makerAmount: string;
|
|
457
|
+
readonly takerAmount: string;
|
|
458
|
+
/** `makerAmount/takerAmount` for BUY, `takerAmount/makerAmount` for SELL — display only. */
|
|
459
|
+
readonly impliedPrice: string;
|
|
460
|
+
/** The pUSD notional of the order — display only. */
|
|
461
|
+
readonly notional: string;
|
|
462
|
+
readonly minOrderSize: string;
|
|
463
|
+
/** Market FAK that cannot fill in full — the order carries the depth that exists. */
|
|
464
|
+
readonly partial?: boolean;
|
|
465
|
+
/** From the market object, unsigned. */
|
|
466
|
+
readonly fees?: PolymarketQuoteFees;
|
|
467
|
+
};
|
|
468
|
+
/**
|
|
469
|
+
* The exchange the order commits to — selected from the book's own version/negRisk, refetched for
|
|
470
|
+
* every placement (docs trading/place-orders.md §Order Domain).
|
|
471
|
+
*/
|
|
472
|
+
type PolymarketExchangeDomain = {
|
|
473
|
+
readonly verifyingContract: `0x${string}`;
|
|
474
|
+
readonly version: "2" | "3";
|
|
475
|
+
};
|
|
476
|
+
/**
|
|
477
|
+
* The unsigned order — the V2 `Order` struct's fields as wire strings (ctf-exchange-v2
|
|
478
|
+
* `Structs.sol`; `expiration` rides the wire unsigned — the kernel cannot bound it, so the order
|
|
479
|
+
* description marks it unsigned and it is validated here instead).
|
|
480
|
+
*/
|
|
481
|
+
type PolymarketOrderDraft = {
|
|
482
|
+
/** Decimal string ≤ 2^53−1 — serialized as a JSON number on the wire. */
|
|
483
|
+
readonly salt: string;
|
|
484
|
+
readonly maker: `0x${string}`;
|
|
485
|
+
readonly signer: `0x${string}`;
|
|
486
|
+
readonly tokenId: string;
|
|
487
|
+
readonly makerAmount: string;
|
|
488
|
+
readonly takerAmount: string;
|
|
489
|
+
/** 0 = BUY, 1 = SELL. */
|
|
490
|
+
readonly side: 0 | 1;
|
|
491
|
+
/** Deposit-wallet orders sign type 3 (ERC-1271 through TypedDataSign). */
|
|
492
|
+
readonly signatureType: 3;
|
|
493
|
+
/** Milliseconds since epoch, decimal string. */
|
|
494
|
+
readonly timestamp: string;
|
|
495
|
+
readonly metadata: `0x${string}`;
|
|
496
|
+
readonly builder: `0x${string}`;
|
|
497
|
+
/** Unix seconds, decimal string; `"0"` unless GTD. */
|
|
498
|
+
readonly expiration: string;
|
|
499
|
+
};
|
|
500
|
+
type PolymarketOrderType = "GTC" | "GTD" | "FOK" | "FAK";
|
|
501
|
+
type PolymarketPlaceParams = ({
|
|
502
|
+
readonly kind: "limit";
|
|
503
|
+
} & PolymarketLimitParams & {
|
|
504
|
+
readonly orderType: "GTC" | "GTD";
|
|
505
|
+
/** GTD only — unix seconds ≥ now + 180 (unsigned on the wire; the CLOB enforces it). */
|
|
506
|
+
readonly expiration?: number;
|
|
507
|
+
/** The order must rest on the book, never match immediately. */
|
|
508
|
+
readonly postOnly?: boolean;
|
|
509
|
+
}) | ({
|
|
510
|
+
readonly kind: "market";
|
|
511
|
+
} & PolymarketMarketParams);
|
|
512
|
+
/** Why the CLOB refused an order — classified from its `errorMsg`/`error` text. */
|
|
513
|
+
type PolymarketRejectReason = "balance-or-allowance" | "tick" | "min-size" | "market-closed" | "post-only-cross" | "fok-unfilled" | "invalid-signature" | "rate-limited" | "close-only" | "other";
|
|
514
|
+
/**
|
|
515
|
+
* What the defensive `DELETE /order` after an unproven absence did — present on `unknown` outcomes
|
|
516
|
+
* only when the order was never seen by any reconcile read.
|
|
517
|
+
*/
|
|
518
|
+
type PolymarketCancelAttempt =
|
|
519
|
+
/**
|
|
520
|
+
* The CLOB listed our order id under `canceled` — only the remaining size was canceled; the order
|
|
521
|
+
* may still have partially filled first (the outcome/correction carries the fill).
|
|
522
|
+
*/
|
|
523
|
+
{
|
|
524
|
+
readonly kind: "canceled";
|
|
525
|
+
} |
|
|
526
|
+
/** The CLOB refused — `reason` is its `not_canceled[id]` text, or that it listed neither. */
|
|
527
|
+
{
|
|
528
|
+
readonly kind: "not-canceled";
|
|
529
|
+
readonly reason: string;
|
|
530
|
+
} |
|
|
531
|
+
/** The DELETE itself never produced an answer. */
|
|
532
|
+
{
|
|
533
|
+
readonly kind: "failed";
|
|
534
|
+
readonly message: string;
|
|
535
|
+
};
|
|
536
|
+
type PolymarketOrderOutcome =
|
|
537
|
+
/** `live` — resting on the book. */
|
|
538
|
+
{
|
|
539
|
+
readonly kind: "resting";
|
|
540
|
+
readonly orderId: string;
|
|
541
|
+
} | {
|
|
542
|
+
readonly kind: "matched";
|
|
543
|
+
readonly orderId: string;
|
|
544
|
+
readonly making?: string;
|
|
545
|
+
readonly taking?: string;
|
|
546
|
+
readonly tradeIds?: ReadonlyArray<string>;
|
|
547
|
+
} |
|
|
548
|
+
/** `delayed` — accepted, matching delayed by market conditions. */
|
|
549
|
+
{
|
|
550
|
+
readonly kind: "delayed";
|
|
551
|
+
readonly orderId: string;
|
|
552
|
+
} | {
|
|
553
|
+
readonly kind: "unmatched";
|
|
554
|
+
readonly orderId: string;
|
|
555
|
+
} |
|
|
556
|
+
/** The CLOB definitively refused — nothing was posted. */
|
|
557
|
+
{
|
|
558
|
+
readonly kind: "rejected";
|
|
559
|
+
readonly reason: PolymarketRejectReason;
|
|
560
|
+
readonly message: string;
|
|
561
|
+
} |
|
|
562
|
+
/**
|
|
563
|
+
* Reconcile found the order canceled. `making` is the row's `size_matched` — > "0" means the
|
|
564
|
+
* order partially filled before it was canceled; re-place only the unfilled remainder.
|
|
565
|
+
*/
|
|
566
|
+
{
|
|
567
|
+
readonly kind: "canceled";
|
|
568
|
+
readonly orderId: string;
|
|
569
|
+
readonly making: string;
|
|
570
|
+
} |
|
|
571
|
+
/**
|
|
572
|
+
* The POST's fate is unknowable — the order may or may not exist; never blindly re-place (a
|
|
573
|
+
* later-landing first order plus the retry is a duplicate position). `cancel` — present iff the
|
|
574
|
+
* order was never seen — records the defensive `DELETE /order` attempt; `trade.corrections`
|
|
575
|
+
* reports the eventual status for up to ten minutes.
|
|
576
|
+
*/
|
|
577
|
+
{
|
|
578
|
+
readonly kind: "unknown";
|
|
579
|
+
readonly orderId: string;
|
|
580
|
+
readonly cancel?: PolymarketCancelAttempt;
|
|
581
|
+
};
|
|
582
|
+
/** The eventual status of an outcome that resolved `unknown` — emitted by `trade.corrections`. */
|
|
583
|
+
type PolymarketOutcomeCorrection = {
|
|
584
|
+
readonly group: AppGroup;
|
|
585
|
+
readonly orderId: string;
|
|
586
|
+
readonly outcome: PolymarketOrderOutcome;
|
|
587
|
+
};
|
|
588
|
+
type PolymarketPlacedOrder = {
|
|
589
|
+
/** The approval request the host shows — the kernel describes the deposit-wallet order. */
|
|
590
|
+
readonly requestId: string;
|
|
591
|
+
/** The order's EIP-712 hash — known before approval, asserted against the answer's `orderID`. */
|
|
592
|
+
readonly orderId: string;
|
|
593
|
+
readonly quote: PolymarketQuote;
|
|
594
|
+
/** Resolves to the classified outcome; rejects with `approval-rejected`/`unlock-required`. */
|
|
595
|
+
readonly outcome: Promise<PolymarketOrderOutcome>;
|
|
596
|
+
};
|
|
597
|
+
type PolymarketCancelResult = {
|
|
598
|
+
readonly canceled: ReadonlyArray<string>;
|
|
599
|
+
/** Id → the server's reason it stayed. */
|
|
600
|
+
readonly notCanceled: Readonly<Record<string, string>>;
|
|
601
|
+
};
|
|
602
|
+
type PolymarketTrading = {
|
|
603
|
+
/**
|
|
604
|
+
* Quote an order against the current book — BUY quotes are gated like `place` (availability +
|
|
605
|
+
* closed-only).
|
|
606
|
+
*/
|
|
607
|
+
readonly quote: (group: AppGroup, params: PolymarketPlaceParams) => Promise<PolymarketQuote>;
|
|
608
|
+
/** Build, get approval for and post an order — see the module doc for the outcome contract. */
|
|
609
|
+
readonly place: (group: AppGroup, params: PolymarketPlaceParams) => Promise<PolymarketPlacedOrder>;
|
|
610
|
+
readonly cancel: (group: AppGroup, orderId: string) => Promise<PolymarketCancelResult>;
|
|
611
|
+
/** 1..500 ids per call. */
|
|
612
|
+
readonly cancelMany: (group: AppGroup, orderIds: ReadonlyArray<string>) => Promise<PolymarketCancelResult>;
|
|
613
|
+
readonly cancelAll: (group: AppGroup) => Promise<PolymarketCancelResult>;
|
|
614
|
+
readonly cancelMarket: (group: AppGroup, params: {
|
|
615
|
+
readonly market?: string;
|
|
616
|
+
readonly assetId?: string;
|
|
617
|
+
}) => Promise<PolymarketCancelResult>;
|
|
618
|
+
/**
|
|
619
|
+
* Late reconcile of `unknown` outcomes: the order id is re-asked every 10 s for 10 minutes and
|
|
620
|
+
* the found status is emitted once — a correction is never re-posted and a lock drops every
|
|
621
|
+
* pending entry.
|
|
622
|
+
*/
|
|
623
|
+
readonly corrections: {
|
|
624
|
+
readonly subscribe: (listener: (correction: PolymarketOutcomeCorrection) => void) => () => void;
|
|
625
|
+
};
|
|
626
|
+
};
|
|
627
|
+
/**
|
|
628
|
+
* The host-injected Remote Builder Signing surface (invariant 9): the host's server holds the
|
|
629
|
+
* builder secret and HMACs `{method, path, body}` relayer submissions; `code` is the bytes32
|
|
630
|
+
* builder code attached to orders, absent means the zero code.
|
|
631
|
+
*/
|
|
632
|
+
type PolymarketBuilder = {
|
|
633
|
+
readonly code?: `0x${string}`;
|
|
634
|
+
readonly sign: (request: {
|
|
635
|
+
readonly method: string;
|
|
636
|
+
readonly path: string;
|
|
637
|
+
readonly body: string;
|
|
638
|
+
}) => Promise<PolymarketBuilderHeaders>;
|
|
639
|
+
};
|
|
640
|
+
type PolymarketProvider = {
|
|
641
|
+
readonly markets: PolymarketMarkets;
|
|
642
|
+
readonly account: PolymarketAccountReads;
|
|
643
|
+
readonly trade: PolymarketTrading;
|
|
644
|
+
readonly live: PolymarketLive;
|
|
645
|
+
readonly fund: PolymarketFunding;
|
|
646
|
+
};
|
|
647
|
+
/** The resumable enablement step a group is in; absent when `status` is terminal. */
|
|
648
|
+
type PolymarketStep = "locate-wallet" | "deploy-wallet" | "credentials" | "approvals" | "verify";
|
|
649
|
+
/** The located Polymarket account — positions/balance reads scope to `wallet`. */
|
|
650
|
+
type PolymarketAccountState = {
|
|
651
|
+
readonly wallet: string;
|
|
652
|
+
/**
|
|
653
|
+
* `safe` is a legacy Safe the wallet can only read: the group reconciles to `needs-migration`
|
|
654
|
+
* until the user migrates it outside the wallet.
|
|
655
|
+
*/
|
|
656
|
+
readonly kind: "deposit-wallet" | "safe";
|
|
657
|
+
readonly deployed: boolean;
|
|
658
|
+
readonly legacySafe?: string;
|
|
659
|
+
};
|
|
660
|
+
/** Polymarket's own group-state fields on top of the controller's base. */
|
|
661
|
+
type PolymarketDetail = {
|
|
662
|
+
/** The step an `enabling` flow is at — `verify` also marks a lost-POST re-check. */
|
|
663
|
+
readonly step?: PolymarketStep;
|
|
664
|
+
/** The located account the group enables or is enabled against. */
|
|
665
|
+
readonly account?: PolymarketAccountState;
|
|
666
|
+
};
|
|
667
|
+
/** One wallet group's Polymarket app state. */
|
|
668
|
+
type PolymarketGroupState = AppGroupState<PolymarketDetail>;
|
|
669
|
+
type AppsPolymarketConfig = {
|
|
670
|
+
/**
|
|
671
|
+
* The host's Remote Builder Signing oracle — its server holds the builder secret and HMACs
|
|
672
|
+
* relayer submissions (design.md 不变量 9). `code` is the bytes32 builder code written into orders;
|
|
673
|
+
* absent means the zero code.
|
|
674
|
+
*/
|
|
675
|
+
readonly builder?: PolymarketBuilder;
|
|
676
|
+
};
|
|
677
|
+
export declare function polymarket(config?: AppsPolymarketConfig): AppDefinition<"polymarket", PolymarketProvider, PolymarketDetail>;
|
|
678
|
+
/** Polymarket provider error categories — never carry request payloads or secrets. */
|
|
679
|
+
type PolymarketErrorCategory =
|
|
680
|
+
/** The request may have reached the server; an L2 post's outcome is unknown. */
|
|
681
|
+
"network" | "timeout" |
|
|
682
|
+
/** The server answered with a non-2xx status. */
|
|
683
|
+
"unavailable" |
|
|
684
|
+
/** The answer did not satisfy its schema — nothing was accepted into state. */
|
|
685
|
+
"malformed" |
|
|
686
|
+
/** The device clock disagrees with the CLOB `/time` beyond the signing window. */
|
|
687
|
+
"clock-skew" |
|
|
688
|
+
/** A caller input fails validation before any request. */
|
|
689
|
+
"invalid-input" |
|
|
690
|
+
/** The CLOB rejected the request itself (a failed L2 action). */
|
|
691
|
+
"rejected" |
|
|
692
|
+
/** The vault is locked — the credential store is closed; nothing was posted. */
|
|
693
|
+
"unlock-required" |
|
|
694
|
+
/** The group has no enabled Polymarket credentials — enable first. */
|
|
695
|
+
"not-enabled" |
|
|
696
|
+
/** The step needs the relayer, which requires the host's builder signer. */
|
|
697
|
+
"builder-required" |
|
|
698
|
+
/** The user refused, or the approval request expired or was invalidated. */
|
|
699
|
+
"approval-rejected" |
|
|
700
|
+
/** An enablement flow is already running for the group — wait or cancel it. */
|
|
701
|
+
"busy" |
|
|
702
|
+
/** The account or jurisdiction may only close positions, not open them. */
|
|
703
|
+
"close-only" |
|
|
704
|
+
/** A blocked jurisdiction, or an unknown/error eligibility answer — the gate fails closed. */
|
|
705
|
+
"blocked" |
|
|
706
|
+
/** The group resolves to a legacy Safe — read-only until migrated to a deposit wallet. */
|
|
707
|
+
"needs-migration" |
|
|
708
|
+
/**
|
|
709
|
+
* The relayer, the chain RPC and the host endpoint disagree on which account wallet exists, or
|
|
710
|
+
* the code there is not the expected template — nothing is chosen.
|
|
711
|
+
*/
|
|
712
|
+
"deployment-mismatch";
|
|
713
|
+
export declare class PolymarketError extends Error {
|
|
714
|
+
readonly category: PolymarketErrorCategory;
|
|
715
|
+
/**
|
|
716
|
+
* The HTTP status — set on `unavailable` only. Callers distinguish a definitive 4xx (the request
|
|
717
|
+
* never ran as asked) from a 5xx/timeout (the outcome is unknown).
|
|
718
|
+
*/
|
|
719
|
+
readonly status?: number;
|
|
720
|
+
/** The server's parsed JSON error body when it was an object — `unavailable` only. */
|
|
721
|
+
readonly body?: Readonly<Record<string, unknown>>;
|
|
722
|
+
constructor(category: PolymarketErrorCategory, message: string, options?: {
|
|
723
|
+
readonly cause?: unknown;
|
|
724
|
+
readonly status?: number;
|
|
725
|
+
readonly body?: Readonly<Record<string, unknown>>;
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
export type { AppsPolymarketConfig, PolymarketAccount, PolymarketAccountLiveData, PolymarketAccountReads, PolymarketAccountState, PolymarketActivity, PolymarketActivityParams, PolymarketApproval, PolymarketApprovals, PolymarketBalance, PolymarketBook, PolymarketBookData, PolymarketBookLevel, PolymarketBuilder, PolymarketBuilderHeaders, PolymarketCancelAttempt, PolymarketCancelResult, PolymarketClobMarket, PolymarketDetail, PolymarketErrorCategory, PolymarketEvent, PolymarketEventsParams, PolymarketExchangeDomain, PolymarketFunding, PolymarketFundingOutcome, PolymarketGroupState, PolymarketHistoryParams, PolymarketLimitParams, PolymarketLive, PolymarketLiveState, PolymarketLiveView, PolymarketMarket, PolymarketMarketData, PolymarketMarketParams, PolymarketMarkets, PolymarketOpenOrdersParams, PolymarketOrder, PolymarketOrderDraft, PolymarketOrderOutcome, PolymarketOrderType, PolymarketOutcomeCorrection, PolymarketPage, PolymarketPlaceParams, PolymarketPlacedOrder, PolymarketPnl, PolymarketPnlParams, PolymarketPnlPoint, PolymarketPosition, PolymarketPositionsParams, PolymarketPricePoint, PolymarketProvider, PolymarketQuote, PolymarketQuoteFees, PolymarketRejectReason, PolymarketResolution, PolymarketSide, PolymarketStep, PolymarketTrade, PolymarketTradesParams, PolymarketTrading, PolymarketWalletCandidates, PolymarketWallets };
|
|
729
|
+
//# sourceMappingURL=apps-polymarket.d.mts.map
|