@polymarket/bindings 0.1.0-beta.0 → 0.1.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/rfq.d.ts ADDED
@@ -0,0 +1,701 @@
1
+ import * as _polymarket_types from '@polymarket/types';
2
+ import { EvmAddress, HexString, EvmSignature, Erc1271Signature } from '@polymarket/types';
3
+ import { MarketId, CtfConditionId, PositionId, DecimalString, PaginationCursor, RfqId, RfqQuoteId, ComboConditionId, EpochMilliseconds, OrderSide, TokenId, BaseUnits, RfqRequestorPublicId } from './index.js';
4
+ import { z } from 'zod';
5
+ import { S as SignatureType } from './signature-type-CrLAA9AN.js';
6
+
7
+ declare enum RfqDirection {
8
+ Buy = "BUY",
9
+ Sell = "SELL"
10
+ }
11
+ declare enum RfqSide {
12
+ Yes = "YES",
13
+ No = "NO"
14
+ }
15
+ declare enum RfqConfirmationDecision {
16
+ Confirm = "CONFIRM",
17
+ Decline = "DECLINE"
18
+ }
19
+ declare enum RfqExecutionStatus {
20
+ Matched = "MATCHED",
21
+ Mined = "MINED",
22
+ Confirmed = "CONFIRMED",
23
+ Retrying = "RETRYING",
24
+ Failed = "FAILED"
25
+ }
26
+ declare enum RfqRequestedSizeUnit {
27
+ Notional = "notional",
28
+ Shares = "shares"
29
+ }
30
+ declare enum RfqErrorCode {
31
+ AddressMismatch = "ADDRESS_MISMATCH",
32
+ AllowanceValidationFailed = "ALLOWANCE_VALIDATION_FAILED",
33
+ BalanceValidationFailed = "BALANCE_VALIDATION_FAILED",
34
+ ContradictoryLegs = "CONTRADICTORY_LEGS",
35
+ ExpiredRfq = "EXPIRED_RFQ",
36
+ InvalidAcceptance = "INVALID_ACCEPTANCE",
37
+ InvalidConfirmation = "INVALID_CONFIRMATION",
38
+ InvalidExecutionResult = "INVALID_EXECUTION_RESULT",
39
+ InvalidIdentity = "INVALID_IDENTITY",
40
+ InvalidMessage = "INVALID_MESSAGE",
41
+ InvalidQuote = "INVALID_QUOTE",
42
+ InvalidRfq = "INVALID_RFQ",
43
+ InvalidRfqState = "INVALID_RFQ_STATE",
44
+ InvalidRole = "INVALID_ROLE",
45
+ InvalidSignature = "INVALID_SIGNATURE",
46
+ InternalError = "INTERNAL_ERROR",
47
+ LegMetadataUnavailable = "LEG_METADATA_UNAVAILABLE",
48
+ MakerAlreadyResponded = "MAKER_ALREADY_RESPONDED",
49
+ MakerNotRequired = "MAKER_NOT_REQUIRED",
50
+ PreExecutionBalanceReservationFailed = "PRE_EXECUTION_BALANCE_RESERVATION_FAILED",
51
+ QuoteMismatch = "QUOTE_MISMATCH",
52
+ QuoteUnavailable = "QUOTE_UNAVAILABLE",
53
+ RateLimited = "RATE_LIMITED",
54
+ RequestFailed = "REQUEST_FAILED",
55
+ ServiceUnavailable = "SERVICE_UNAVAILABLE",
56
+ SubmissionWindowClosed = "SUBMISSION_WINDOW_CLOSED",
57
+ TradeSubmissionFailed = "TRADE_SUBMISSION_FAILED",
58
+ Unauthenticated = "UNAUTHENTICATED",
59
+ UnauthorizedRole = "UNAUTHORIZED_ROLE",
60
+ UnknownRfq = "UNKNOWN_RFQ"
61
+ }
62
+ declare const RfqDirectionSchema: z.ZodEnum<typeof RfqDirection>;
63
+ declare const RfqSideSchema: z.ZodLiteral<RfqSide.Yes>;
64
+ declare const RfqConfirmationDecisionSchema: z.ZodEnum<typeof RfqConfirmationDecision>;
65
+ declare const RfqExecutionStatusSchema: z.ZodEnum<typeof RfqExecutionStatus>;
66
+ declare const RfqRequestedSizeUnitSchema: z.ZodEnum<typeof RfqRequestedSizeUnit>;
67
+ declare const RfqErrorCodeSchema: z.ZodEnum<typeof RfqErrorCode>;
68
+ type ComboMarket = {
69
+ id: MarketId;
70
+ conditionId: CtfConditionId;
71
+ slug: string;
72
+ title: string;
73
+ outcomes: ComboMarketOutcomes;
74
+ image: string;
75
+ volume: number;
76
+ tags: string[];
77
+ };
78
+ type ComboMarketOutcome = {
79
+ label: string;
80
+ positionId: PositionId;
81
+ price: DecimalString;
82
+ };
83
+ type ComboMarketOutcomes = {
84
+ yes: ComboMarketOutcome;
85
+ no: ComboMarketOutcome;
86
+ };
87
+ declare const ComboMarketSchema: z.ZodPipe<z.ZodObject<{
88
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<MarketId, string>>;
89
+ condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
90
+ position_ids: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>>;
91
+ slug: z.ZodString;
92
+ title: z.ZodString;
93
+ outcomes: z.ZodArray<z.ZodString>;
94
+ outcome_prices: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
95
+ image: z.ZodString;
96
+ volume: z.ZodNumber;
97
+ tags: z.ZodArray<z.ZodString>;
98
+ }, z.core.$strip>, z.ZodTransform<ComboMarket, {
99
+ id: MarketId;
100
+ condition_id: CtfConditionId;
101
+ position_ids: PositionId[];
102
+ slug: string;
103
+ title: string;
104
+ outcomes: string[];
105
+ outcome_prices: DecimalString[];
106
+ image: string;
107
+ volume: number;
108
+ tags: string[];
109
+ }>>;
110
+ declare const ListComboMarketsResponseSchema: z.ZodPipe<z.ZodObject<{
111
+ markets: z.ZodArray<z.ZodPipe<z.ZodObject<{
112
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<MarketId, string>>;
113
+ condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
114
+ position_ids: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>>;
115
+ slug: z.ZodString;
116
+ title: z.ZodString;
117
+ outcomes: z.ZodArray<z.ZodString>;
118
+ outcome_prices: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
119
+ image: z.ZodString;
120
+ volume: z.ZodNumber;
121
+ tags: z.ZodArray<z.ZodString>;
122
+ }, z.core.$strip>, z.ZodTransform<ComboMarket, {
123
+ id: MarketId;
124
+ condition_id: CtfConditionId;
125
+ position_ids: PositionId[];
126
+ slug: string;
127
+ title: string;
128
+ outcomes: string[];
129
+ outcome_prices: DecimalString[];
130
+ image: string;
131
+ volume: number;
132
+ tags: string[];
133
+ }>>>;
134
+ next_cursor: z.ZodOptional<z.ZodNullable<z.ZodCustom<PaginationCursor, PaginationCursor>>>;
135
+ }, z.core.$strip>, z.ZodTransform<{
136
+ markets: ComboMarket[];
137
+ nextCursor: PaginationCursor | undefined;
138
+ }, {
139
+ markets: ComboMarket[];
140
+ next_cursor?: PaginationCursor | null | undefined;
141
+ }>>;
142
+ type ListComboMarketsResponse = z.infer<typeof ListComboMarketsResponseSchema>;
143
+ type RfqRequestedSize = {
144
+ unit: RfqRequestedSizeUnit.Notional;
145
+ value: DecimalString;
146
+ } | {
147
+ unit: RfqRequestedSizeUnit.Shares;
148
+ value: DecimalString;
149
+ };
150
+ type RfqSignedOrder = {
151
+ salt: string;
152
+ maker: EvmAddress;
153
+ signer: EvmAddress;
154
+ tokenId: PositionId | TokenId;
155
+ makerAmount: BaseUnits;
156
+ takerAmount: BaseUnits;
157
+ side: RfqOrderSide;
158
+ signatureType: SignatureType;
159
+ timestamp: string;
160
+ builder?: HexString;
161
+ expiration?: string;
162
+ metadata?: HexString;
163
+ signature: EvmSignature | Erc1271Signature;
164
+ };
165
+ type RfqOrderSide = OrderSide | 0 | 1;
166
+ type RfqAuthMessage = {
167
+ type: 'auth';
168
+ auth: {
169
+ apiKey: string;
170
+ passphrase: string;
171
+ secret: string;
172
+ };
173
+ identity: {
174
+ signer_address: EvmAddress;
175
+ maker_address: EvmAddress;
176
+ signature_type: SignatureType;
177
+ };
178
+ };
179
+ declare enum RfqKnownInboundType {
180
+ Auth = "auth",
181
+ QuoteRequest = "RFQ_REQUEST",
182
+ QuoteAck = "ACK_RFQ_QUOTE",
183
+ QuoteCancelAck = "ACK_RFQ_QUOTE_CANCEL",
184
+ ConfirmationRequest = "RFQ_CONFIRMATION_REQUEST",
185
+ ConfirmationAck = "ACK_RFQ_CONFIRMATION_RESPONSE",
186
+ ExecutionUpdate = "RFQ_EXECUTION_UPDATE",
187
+ Trade = "RFQ_TRADE",
188
+ Error = "RFQ_ERROR"
189
+ }
190
+ declare const RfqKnownInboundMessageSchema: z.ZodObject<{
191
+ type: z.ZodEnum<typeof RfqKnownInboundType>;
192
+ }, z.core.$strip>;
193
+ declare const RfqAuthResponseMessageSchema: z.ZodObject<{
194
+ type: z.ZodLiteral<RfqKnownInboundType.Auth>;
195
+ success: z.ZodBoolean;
196
+ address: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress, string>>>;
197
+ role: z.ZodOptional<z.ZodString>;
198
+ error: z.ZodOptional<z.ZodString>;
199
+ }, z.core.$strip>;
200
+ type RfqAuthResponseMessage = z.infer<typeof RfqAuthResponseMessageSchema>;
201
+ declare const RfqQuoteRequestSchema: z.ZodPipe<z.ZodObject<{
202
+ type: z.ZodLiteral<RfqKnownInboundType.QuoteRequest>;
203
+ rfq_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>;
204
+ requestor_public_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqRequestorPublicId, string>>;
205
+ leg_position_ids: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>>;
206
+ condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<ComboConditionId, string>>;
207
+ yes_position_id: z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>;
208
+ no_position_id: z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>;
209
+ direction: z.ZodEnum<typeof RfqDirection>;
210
+ side: z.ZodLiteral<RfqSide.Yes>;
211
+ requested_size: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject<{
212
+ unit: z.ZodLiteral<RfqRequestedSizeUnit.Notional>;
213
+ value_e6: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
214
+ }, z.core.$strip>, z.ZodObject<{
215
+ unit: z.ZodLiteral<RfqRequestedSizeUnit.Shares>;
216
+ value_e6: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
217
+ }, z.core.$strip>], "unit">, z.ZodTransform<{
218
+ unit: RfqRequestedSizeUnit.Notional;
219
+ value: DecimalString;
220
+ } | {
221
+ unit: RfqRequestedSizeUnit.Shares;
222
+ value: DecimalString;
223
+ }, {
224
+ unit: RfqRequestedSizeUnit.Notional;
225
+ value_e6: DecimalString;
226
+ } | {
227
+ unit: RfqRequestedSizeUnit.Shares;
228
+ value_e6: DecimalString;
229
+ }>>;
230
+ submission_deadline: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
231
+ }, z.core.$strip>, z.ZodTransform<{
232
+ conditionId: ComboConditionId;
233
+ direction: RfqDirection;
234
+ legPositionIds: PositionId[];
235
+ noPositionId: PositionId;
236
+ requestorPublicId: RfqRequestorPublicId;
237
+ requestedSize: {
238
+ unit: RfqRequestedSizeUnit.Notional;
239
+ value: DecimalString;
240
+ } | {
241
+ unit: RfqRequestedSizeUnit.Shares;
242
+ value: DecimalString;
243
+ };
244
+ rfqId: RfqId;
245
+ side: RfqSide.Yes;
246
+ submissionDeadline: EpochMilliseconds;
247
+ type: "quote_request";
248
+ yesPositionId: PositionId;
249
+ }, {
250
+ type: RfqKnownInboundType.QuoteRequest;
251
+ rfq_id: RfqId;
252
+ requestor_public_id: RfqRequestorPublicId;
253
+ leg_position_ids: PositionId[];
254
+ condition_id: ComboConditionId;
255
+ yes_position_id: PositionId;
256
+ no_position_id: PositionId;
257
+ direction: RfqDirection;
258
+ side: RfqSide.Yes;
259
+ requested_size: {
260
+ unit: RfqRequestedSizeUnit.Notional;
261
+ value: DecimalString;
262
+ } | {
263
+ unit: RfqRequestedSizeUnit.Shares;
264
+ value: DecimalString;
265
+ };
266
+ submission_deadline: EpochMilliseconds;
267
+ }>>;
268
+ type RfqQuoteRequest = z.infer<typeof RfqQuoteRequestSchema>;
269
+ type RfqQuoteMessage = {
270
+ type: 'RFQ_QUOTE';
271
+ rfq_id: RfqId;
272
+ price_e6: string;
273
+ size_e6: string;
274
+ signed_order: RfqSignedOrder;
275
+ };
276
+ type RfqQuoteCancelMessage = {
277
+ type: 'RFQ_QUOTE_CANCEL';
278
+ rfq_id: RfqId;
279
+ quote_id: RfqQuoteId;
280
+ signer_address: EvmAddress;
281
+ maker_address: EvmAddress;
282
+ };
283
+ declare const RfqQuoteAckSchema: z.ZodPipe<z.ZodObject<{
284
+ type: z.ZodLiteral<RfqKnownInboundType.QuoteAck>;
285
+ rfq_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>;
286
+ quote_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqQuoteId, string>>;
287
+ }, z.core.$strip>, z.ZodTransform<{
288
+ quoteId: RfqQuoteId;
289
+ rfqId: RfqId;
290
+ type: "quote_ack";
291
+ }, {
292
+ type: RfqKnownInboundType.QuoteAck;
293
+ rfq_id: RfqId;
294
+ quote_id: RfqQuoteId;
295
+ }>>;
296
+ type RfqQuoteAck = z.infer<typeof RfqQuoteAckSchema>;
297
+ declare const RfqQuoteCancelAckSchema: z.ZodPipe<z.ZodObject<{
298
+ type: z.ZodLiteral<RfqKnownInboundType.QuoteCancelAck>;
299
+ rfq_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>;
300
+ quote_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqQuoteId, string>>;
301
+ }, z.core.$strip>, z.ZodTransform<{
302
+ quoteId: RfqQuoteId;
303
+ rfqId: RfqId;
304
+ type: "quote_cancel_ack";
305
+ }, {
306
+ type: RfqKnownInboundType.QuoteCancelAck;
307
+ rfq_id: RfqId;
308
+ quote_id: RfqQuoteId;
309
+ }>>;
310
+ type RfqQuoteCancelAck = z.infer<typeof RfqQuoteCancelAckSchema>;
311
+ declare const RfqConfirmationRequestSchema: z.ZodPipe<z.ZodObject<{
312
+ type: z.ZodLiteral<RfqKnownInboundType.ConfirmationRequest>;
313
+ rfq_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>;
314
+ quote_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqQuoteId, string>>;
315
+ signer_address: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress, string>>;
316
+ maker_address: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress, string>>;
317
+ signature_type: z.ZodEnum<typeof SignatureType>;
318
+ leg_position_ids: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>>;
319
+ condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<ComboConditionId, string>>;
320
+ yes_position_id: z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>;
321
+ no_position_id: z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>;
322
+ direction: z.ZodEnum<typeof RfqDirection>;
323
+ side: z.ZodLiteral<RfqSide.Yes>;
324
+ fill_size_e6: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
325
+ price_e6: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
326
+ confirm_by: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
327
+ }, z.core.$strip>, z.ZodTransform<{
328
+ conditionId: ComboConditionId;
329
+ confirmBy: EpochMilliseconds;
330
+ direction: RfqDirection;
331
+ fillSize: DecimalString;
332
+ legPositionIds: PositionId[];
333
+ makerAddress: EvmAddress;
334
+ noPositionId: PositionId;
335
+ price: DecimalString;
336
+ quoteId: RfqQuoteId;
337
+ rfqId: RfqId;
338
+ side: RfqSide.Yes;
339
+ signatureType: SignatureType;
340
+ signerAddress: EvmAddress;
341
+ type: "confirmation_request";
342
+ yesPositionId: PositionId;
343
+ }, {
344
+ type: RfqKnownInboundType.ConfirmationRequest;
345
+ rfq_id: RfqId;
346
+ quote_id: RfqQuoteId;
347
+ signer_address: EvmAddress;
348
+ maker_address: EvmAddress;
349
+ signature_type: SignatureType;
350
+ leg_position_ids: PositionId[];
351
+ condition_id: ComboConditionId;
352
+ yes_position_id: PositionId;
353
+ no_position_id: PositionId;
354
+ direction: RfqDirection;
355
+ side: RfqSide.Yes;
356
+ fill_size_e6: DecimalString;
357
+ price_e6: DecimalString;
358
+ confirm_by: EpochMilliseconds;
359
+ }>>;
360
+ type RfqConfirmationRequest = z.infer<typeof RfqConfirmationRequestSchema>;
361
+ type RfqConfirmationResponseMessage = {
362
+ type: 'RFQ_CONFIRMATION_RESPONSE';
363
+ rfq_id: RfqId;
364
+ quote_id: RfqQuoteId;
365
+ decision: RfqConfirmationDecision;
366
+ };
367
+ declare const RfqConfirmationAckSchema: z.ZodPipe<z.ZodObject<{
368
+ type: z.ZodLiteral<RfqKnownInboundType.ConfirmationAck>;
369
+ rfq_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>;
370
+ quote_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqQuoteId, string>>;
371
+ decision: z.ZodEnum<typeof RfqConfirmationDecision>;
372
+ }, z.core.$strip>, z.ZodTransform<{
373
+ decision: RfqConfirmationDecision;
374
+ quoteId: RfqQuoteId;
375
+ rfqId: RfqId;
376
+ type: "confirmation_ack";
377
+ }, {
378
+ type: RfqKnownInboundType.ConfirmationAck;
379
+ rfq_id: RfqId;
380
+ quote_id: RfqQuoteId;
381
+ decision: RfqConfirmationDecision;
382
+ }>>;
383
+ type RfqConfirmationAck = z.infer<typeof RfqConfirmationAckSchema>;
384
+ declare const RfqExecutionUpdateSchema: z.ZodPipe<z.ZodObject<{
385
+ type: z.ZodLiteral<RfqKnownInboundType.ExecutionUpdate>;
386
+ rfq_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>;
387
+ status: z.ZodEnum<typeof RfqExecutionStatus>;
388
+ tx_hash: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>;
389
+ }, z.core.$strip>, z.ZodTransform<{
390
+ type: "execution_update";
391
+ txHash?: _polymarket_types.TxHash | undefined;
392
+ rfqId: RfqId;
393
+ status: RfqExecutionStatus;
394
+ }, {
395
+ type: RfqKnownInboundType.ExecutionUpdate;
396
+ rfq_id: RfqId;
397
+ status: RfqExecutionStatus;
398
+ tx_hash?: _polymarket_types.TxHash | undefined;
399
+ }>>;
400
+ type RfqExecutionUpdate = z.infer<typeof RfqExecutionUpdateSchema>;
401
+ declare const RfqTradeSchema: z.ZodPipe<z.ZodObject<{
402
+ type: z.ZodLiteral<RfqKnownInboundType.Trade>;
403
+ rfq_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>;
404
+ requester_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqRequestorPublicId, string>>;
405
+ condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<ComboConditionId, string>>;
406
+ leg_position_ids: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>>;
407
+ direction: z.ZodEnum<typeof RfqDirection>;
408
+ side: z.ZodLiteral<RfqSide.Yes>;
409
+ price_e6: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
410
+ size_e6: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
411
+ executed_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
412
+ }, z.core.$strip>, z.ZodTransform<{
413
+ conditionId: ComboConditionId;
414
+ direction: RfqDirection;
415
+ executedAt: EpochMilliseconds;
416
+ legPositionIds: PositionId[];
417
+ price: DecimalString;
418
+ requesterId: RfqRequestorPublicId;
419
+ rfqId: RfqId;
420
+ side: RfqSide.Yes;
421
+ size: DecimalString;
422
+ type: "trade";
423
+ }, {
424
+ type: RfqKnownInboundType.Trade;
425
+ rfq_id: RfqId;
426
+ requester_id: RfqRequestorPublicId;
427
+ condition_id: ComboConditionId;
428
+ leg_position_ids: PositionId[];
429
+ direction: RfqDirection;
430
+ side: RfqSide.Yes;
431
+ price_e6: DecimalString;
432
+ size_e6: DecimalString;
433
+ executed_at: EpochMilliseconds;
434
+ }>>;
435
+ type RfqTrade = z.infer<typeof RfqTradeSchema>;
436
+ declare const RfqErrorMessageSchema: z.ZodPipe<z.ZodObject<{
437
+ type: z.ZodLiteral<RfqKnownInboundType.Error>;
438
+ error_id: z.ZodOptional<z.ZodString>;
439
+ request_type: z.ZodOptional<z.ZodString>;
440
+ rfq_id: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>>;
441
+ quote_id: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<RfqQuoteId, string>>>;
442
+ code: z.ZodEnum<typeof RfqErrorCode>;
443
+ error: z.ZodString;
444
+ request: z.ZodOptional<z.ZodUnknown>;
445
+ }, z.core.$strip>, z.ZodTransform<{
446
+ code: RfqErrorCode;
447
+ errorId: string | undefined;
448
+ message: string;
449
+ quoteId: RfqQuoteId | undefined;
450
+ requestType: string | undefined;
451
+ rfqId: RfqId | undefined;
452
+ type: "rfq_error";
453
+ }, {
454
+ type: RfqKnownInboundType.Error;
455
+ code: RfqErrorCode;
456
+ error: string;
457
+ error_id?: string | undefined;
458
+ request_type?: string | undefined;
459
+ rfq_id?: RfqId | undefined;
460
+ quote_id?: RfqQuoteId | undefined;
461
+ request?: unknown;
462
+ }>>;
463
+ type RfqErrorMessage = z.infer<typeof RfqErrorMessageSchema>;
464
+ declare const RfqQuoterInboundMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
465
+ type: z.ZodLiteral<RfqKnownInboundType.Auth>;
466
+ success: z.ZodBoolean;
467
+ address: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress, string>>>;
468
+ role: z.ZodOptional<z.ZodString>;
469
+ error: z.ZodOptional<z.ZodString>;
470
+ }, z.core.$strip>, z.ZodPipe<z.ZodObject<{
471
+ type: z.ZodLiteral<RfqKnownInboundType.QuoteRequest>;
472
+ rfq_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>;
473
+ requestor_public_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqRequestorPublicId, string>>;
474
+ leg_position_ids: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>>;
475
+ condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<ComboConditionId, string>>;
476
+ yes_position_id: z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>;
477
+ no_position_id: z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>;
478
+ direction: z.ZodEnum<typeof RfqDirection>;
479
+ side: z.ZodLiteral<RfqSide.Yes>;
480
+ requested_size: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject<{
481
+ unit: z.ZodLiteral<RfqRequestedSizeUnit.Notional>;
482
+ value_e6: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
483
+ }, z.core.$strip>, z.ZodObject<{
484
+ unit: z.ZodLiteral<RfqRequestedSizeUnit.Shares>;
485
+ value_e6: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
486
+ }, z.core.$strip>], "unit">, z.ZodTransform<{
487
+ unit: RfqRequestedSizeUnit.Notional;
488
+ value: DecimalString;
489
+ } | {
490
+ unit: RfqRequestedSizeUnit.Shares;
491
+ value: DecimalString;
492
+ }, {
493
+ unit: RfqRequestedSizeUnit.Notional;
494
+ value_e6: DecimalString;
495
+ } | {
496
+ unit: RfqRequestedSizeUnit.Shares;
497
+ value_e6: DecimalString;
498
+ }>>;
499
+ submission_deadline: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
500
+ }, z.core.$strip>, z.ZodTransform<{
501
+ conditionId: ComboConditionId;
502
+ direction: RfqDirection;
503
+ legPositionIds: PositionId[];
504
+ noPositionId: PositionId;
505
+ requestorPublicId: RfqRequestorPublicId;
506
+ requestedSize: {
507
+ unit: RfqRequestedSizeUnit.Notional;
508
+ value: DecimalString;
509
+ } | {
510
+ unit: RfqRequestedSizeUnit.Shares;
511
+ value: DecimalString;
512
+ };
513
+ rfqId: RfqId;
514
+ side: RfqSide.Yes;
515
+ submissionDeadline: EpochMilliseconds;
516
+ type: "quote_request";
517
+ yesPositionId: PositionId;
518
+ }, {
519
+ type: RfqKnownInboundType.QuoteRequest;
520
+ rfq_id: RfqId;
521
+ requestor_public_id: RfqRequestorPublicId;
522
+ leg_position_ids: PositionId[];
523
+ condition_id: ComboConditionId;
524
+ yes_position_id: PositionId;
525
+ no_position_id: PositionId;
526
+ direction: RfqDirection;
527
+ side: RfqSide.Yes;
528
+ requested_size: {
529
+ unit: RfqRequestedSizeUnit.Notional;
530
+ value: DecimalString;
531
+ } | {
532
+ unit: RfqRequestedSizeUnit.Shares;
533
+ value: DecimalString;
534
+ };
535
+ submission_deadline: EpochMilliseconds;
536
+ }>>, z.ZodPipe<z.ZodObject<{
537
+ type: z.ZodLiteral<RfqKnownInboundType.QuoteAck>;
538
+ rfq_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>;
539
+ quote_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqQuoteId, string>>;
540
+ }, z.core.$strip>, z.ZodTransform<{
541
+ quoteId: RfqQuoteId;
542
+ rfqId: RfqId;
543
+ type: "quote_ack";
544
+ }, {
545
+ type: RfqKnownInboundType.QuoteAck;
546
+ rfq_id: RfqId;
547
+ quote_id: RfqQuoteId;
548
+ }>>, z.ZodPipe<z.ZodObject<{
549
+ type: z.ZodLiteral<RfqKnownInboundType.QuoteCancelAck>;
550
+ rfq_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>;
551
+ quote_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqQuoteId, string>>;
552
+ }, z.core.$strip>, z.ZodTransform<{
553
+ quoteId: RfqQuoteId;
554
+ rfqId: RfqId;
555
+ type: "quote_cancel_ack";
556
+ }, {
557
+ type: RfqKnownInboundType.QuoteCancelAck;
558
+ rfq_id: RfqId;
559
+ quote_id: RfqQuoteId;
560
+ }>>, z.ZodPipe<z.ZodObject<{
561
+ type: z.ZodLiteral<RfqKnownInboundType.ConfirmationRequest>;
562
+ rfq_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>;
563
+ quote_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqQuoteId, string>>;
564
+ signer_address: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress, string>>;
565
+ maker_address: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress, string>>;
566
+ signature_type: z.ZodEnum<typeof SignatureType>;
567
+ leg_position_ids: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>>;
568
+ condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<ComboConditionId, string>>;
569
+ yes_position_id: z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>;
570
+ no_position_id: z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>;
571
+ direction: z.ZodEnum<typeof RfqDirection>;
572
+ side: z.ZodLiteral<RfqSide.Yes>;
573
+ fill_size_e6: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
574
+ price_e6: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
575
+ confirm_by: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
576
+ }, z.core.$strip>, z.ZodTransform<{
577
+ conditionId: ComboConditionId;
578
+ confirmBy: EpochMilliseconds;
579
+ direction: RfqDirection;
580
+ fillSize: DecimalString;
581
+ legPositionIds: PositionId[];
582
+ makerAddress: EvmAddress;
583
+ noPositionId: PositionId;
584
+ price: DecimalString;
585
+ quoteId: RfqQuoteId;
586
+ rfqId: RfqId;
587
+ side: RfqSide.Yes;
588
+ signatureType: SignatureType;
589
+ signerAddress: EvmAddress;
590
+ type: "confirmation_request";
591
+ yesPositionId: PositionId;
592
+ }, {
593
+ type: RfqKnownInboundType.ConfirmationRequest;
594
+ rfq_id: RfqId;
595
+ quote_id: RfqQuoteId;
596
+ signer_address: EvmAddress;
597
+ maker_address: EvmAddress;
598
+ signature_type: SignatureType;
599
+ leg_position_ids: PositionId[];
600
+ condition_id: ComboConditionId;
601
+ yes_position_id: PositionId;
602
+ no_position_id: PositionId;
603
+ direction: RfqDirection;
604
+ side: RfqSide.Yes;
605
+ fill_size_e6: DecimalString;
606
+ price_e6: DecimalString;
607
+ confirm_by: EpochMilliseconds;
608
+ }>>, z.ZodPipe<z.ZodObject<{
609
+ type: z.ZodLiteral<RfqKnownInboundType.ConfirmationAck>;
610
+ rfq_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>;
611
+ quote_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqQuoteId, string>>;
612
+ decision: z.ZodEnum<typeof RfqConfirmationDecision>;
613
+ }, z.core.$strip>, z.ZodTransform<{
614
+ decision: RfqConfirmationDecision;
615
+ quoteId: RfqQuoteId;
616
+ rfqId: RfqId;
617
+ type: "confirmation_ack";
618
+ }, {
619
+ type: RfqKnownInboundType.ConfirmationAck;
620
+ rfq_id: RfqId;
621
+ quote_id: RfqQuoteId;
622
+ decision: RfqConfirmationDecision;
623
+ }>>, z.ZodPipe<z.ZodObject<{
624
+ type: z.ZodLiteral<RfqKnownInboundType.ExecutionUpdate>;
625
+ rfq_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>;
626
+ status: z.ZodEnum<typeof RfqExecutionStatus>;
627
+ tx_hash: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_types.TxHash, string>>>;
628
+ }, z.core.$strip>, z.ZodTransform<{
629
+ type: "execution_update";
630
+ txHash?: _polymarket_types.TxHash | undefined;
631
+ rfqId: RfqId;
632
+ status: RfqExecutionStatus;
633
+ }, {
634
+ type: RfqKnownInboundType.ExecutionUpdate;
635
+ rfq_id: RfqId;
636
+ status: RfqExecutionStatus;
637
+ tx_hash?: _polymarket_types.TxHash | undefined;
638
+ }>>, z.ZodPipe<z.ZodObject<{
639
+ type: z.ZodLiteral<RfqKnownInboundType.Trade>;
640
+ rfq_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>;
641
+ requester_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqRequestorPublicId, string>>;
642
+ condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<ComboConditionId, string>>;
643
+ leg_position_ids: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>>;
644
+ direction: z.ZodEnum<typeof RfqDirection>;
645
+ side: z.ZodLiteral<RfqSide.Yes>;
646
+ price_e6: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
647
+ size_e6: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
648
+ executed_at: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
649
+ }, z.core.$strip>, z.ZodTransform<{
650
+ conditionId: ComboConditionId;
651
+ direction: RfqDirection;
652
+ executedAt: EpochMilliseconds;
653
+ legPositionIds: PositionId[];
654
+ price: DecimalString;
655
+ requesterId: RfqRequestorPublicId;
656
+ rfqId: RfqId;
657
+ side: RfqSide.Yes;
658
+ size: DecimalString;
659
+ type: "trade";
660
+ }, {
661
+ type: RfqKnownInboundType.Trade;
662
+ rfq_id: RfqId;
663
+ requester_id: RfqRequestorPublicId;
664
+ condition_id: ComboConditionId;
665
+ leg_position_ids: PositionId[];
666
+ direction: RfqDirection;
667
+ side: RfqSide.Yes;
668
+ price_e6: DecimalString;
669
+ size_e6: DecimalString;
670
+ executed_at: EpochMilliseconds;
671
+ }>>, z.ZodPipe<z.ZodObject<{
672
+ type: z.ZodLiteral<RfqKnownInboundType.Error>;
673
+ error_id: z.ZodOptional<z.ZodString>;
674
+ request_type: z.ZodOptional<z.ZodString>;
675
+ rfq_id: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>>;
676
+ quote_id: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<RfqQuoteId, string>>>;
677
+ code: z.ZodEnum<typeof RfqErrorCode>;
678
+ error: z.ZodString;
679
+ request: z.ZodOptional<z.ZodUnknown>;
680
+ }, z.core.$strip>, z.ZodTransform<{
681
+ code: RfqErrorCode;
682
+ errorId: string | undefined;
683
+ message: string;
684
+ quoteId: RfqQuoteId | undefined;
685
+ requestType: string | undefined;
686
+ rfqId: RfqId | undefined;
687
+ type: "rfq_error";
688
+ }, {
689
+ type: RfqKnownInboundType.Error;
690
+ code: RfqErrorCode;
691
+ error: string;
692
+ error_id?: string | undefined;
693
+ request_type?: string | undefined;
694
+ rfq_id?: RfqId | undefined;
695
+ quote_id?: RfqQuoteId | undefined;
696
+ request?: unknown;
697
+ }>>], "type">;
698
+ type RfqQuoterInboundMessage = z.infer<typeof RfqQuoterInboundMessageSchema>;
699
+ type RfqQuoterOutboundMessage = RfqQuoteMessage | RfqQuoteCancelMessage | RfqConfirmationResponseMessage;
700
+
701
+ export { type ComboMarket, type ComboMarketOutcome, type ComboMarketOutcomes, ComboMarketSchema, type ListComboMarketsResponse, ListComboMarketsResponseSchema, type RfqAuthMessage, type RfqAuthResponseMessage, RfqAuthResponseMessageSchema, type RfqConfirmationAck, RfqConfirmationAckSchema, RfqConfirmationDecision, RfqConfirmationDecisionSchema, type RfqConfirmationRequest, RfqConfirmationRequestSchema, type RfqConfirmationResponseMessage, RfqDirection, RfqDirectionSchema, RfqErrorCode, RfqErrorCodeSchema, type RfqErrorMessage, RfqErrorMessageSchema, RfqExecutionStatus, RfqExecutionStatusSchema, type RfqExecutionUpdate, RfqExecutionUpdateSchema, RfqId, RfqKnownInboundMessageSchema, RfqKnownInboundType, type RfqOrderSide, type RfqQuoteAck, RfqQuoteAckSchema, type RfqQuoteCancelAck, RfqQuoteCancelAckSchema, type RfqQuoteCancelMessage, RfqQuoteId, type RfqQuoteMessage, type RfqQuoteRequest, RfqQuoteRequestSchema, type RfqQuoterInboundMessage, RfqQuoterInboundMessageSchema, type RfqQuoterOutboundMessage, type RfqRequestedSize, RfqRequestedSizeUnit, RfqRequestedSizeUnitSchema, RfqRequestorPublicId, RfqSide, RfqSideSchema, type RfqSignedOrder, type RfqTrade, RfqTradeSchema };