@polymarket/clob-client 5.1.0 → 5.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/client.d.ts +141 -0
  2. package/dist/client.js +853 -0
  3. package/dist/client.js.map +1 -0
  4. package/dist/config.d.ts +12 -0
  5. package/dist/config.js +28 -0
  6. package/dist/config.js.map +1 -0
  7. package/dist/constants.d.ts +3 -0
  8. package/dist/constants.js +7 -0
  9. package/dist/constants.js.map +1 -0
  10. package/dist/endpoints.d.ts +65 -0
  11. package/dist/endpoints.js +79 -0
  12. package/dist/endpoints.js.map +1 -0
  13. package/dist/errors.d.ts +4 -0
  14. package/dist/errors.js +5 -0
  15. package/dist/errors.js.map +1 -0
  16. package/dist/headers/index.d.ts +7 -0
  17. package/dist/headers/index.js +41 -0
  18. package/dist/headers/index.js.map +1 -0
  19. package/dist/http-helpers/index.d.ts +21 -0
  20. package/dist/http-helpers/index.js +149 -0
  21. package/dist/http-helpers/index.js.map +1 -0
  22. package/dist/index.d.ts +7 -0
  23. package/dist/index.js +8 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/order-builder/builder.d.ts +30 -0
  26. package/dist/order-builder/builder.js +52 -0
  27. package/dist/order-builder/builder.js.map +1 -0
  28. package/dist/order-builder/helpers.d.ts +51 -0
  29. package/dist/order-builder/helpers.js +279 -0
  30. package/dist/order-builder/helpers.js.map +1 -0
  31. package/dist/order-builder/index.d.ts +1 -0
  32. package/dist/order-builder/index.js +2 -0
  33. package/dist/order-builder/index.js.map +1 -0
  34. package/dist/rfq-client.d.ts +58 -0
  35. package/dist/rfq-client.js +350 -0
  36. package/dist/rfq-client.js.map +1 -0
  37. package/dist/rfq-deps.d.ts +44 -0
  38. package/dist/rfq-deps.js +2 -0
  39. package/dist/rfq-deps.js.map +1 -0
  40. package/dist/signing/constants.d.ts +14 -0
  41. package/dist/signing/constants.js +16 -0
  42. package/dist/signing/constants.js.map +1 -0
  43. package/dist/signing/eip712.d.ts +10 -0
  44. package/dist/signing/eip712.js +34 -0
  45. package/dist/signing/eip712.js.map +1 -0
  46. package/dist/signing/hmac.d.ts +9 -0
  47. package/dist/signing/hmac.js +58 -0
  48. package/dist/signing/hmac.js.map +1 -0
  49. package/dist/signing/index.d.ts +2 -0
  50. package/dist/signing/index.js +3 -0
  51. package/dist/signing/index.js.map +1 -0
  52. package/dist/types.d.ts +589 -0
  53. package/dist/types.js +37 -0
  54. package/dist/types.js.map +1 -0
  55. package/dist/utilities.d.ts +16 -0
  56. package/dist/utilities.js +89 -0
  57. package/dist/utilities.js.map +1 -0
  58. package/package.json +1 -1
@@ -0,0 +1,589 @@
1
+ import type { SignatureType, SignedOrder } from "@polymarket/order-utils";
2
+ export interface ApiKeyCreds {
3
+ key: string;
4
+ secret: string;
5
+ passphrase: string;
6
+ }
7
+ export interface ApiKeyRaw {
8
+ apiKey: string;
9
+ secret: string;
10
+ passphrase: string;
11
+ }
12
+ export interface ReadonlyApiKeyResponse {
13
+ apiKey: string;
14
+ }
15
+ export interface L2HeaderArgs {
16
+ method: string;
17
+ requestPath: string;
18
+ body?: string;
19
+ }
20
+ export type SimpleHeaders = Record<string, string | number | boolean>;
21
+ export interface L1PolyHeader extends SimpleHeaders {
22
+ POLY_ADDRESS: string;
23
+ POLY_SIGNATURE: string;
24
+ POLY_TIMESTAMP: string;
25
+ POLY_NONCE: string;
26
+ }
27
+ export interface L2PolyHeader extends SimpleHeaders {
28
+ POLY_ADDRESS: string;
29
+ POLY_SIGNATURE: string;
30
+ POLY_TIMESTAMP: string;
31
+ POLY_API_KEY: string;
32
+ POLY_PASSPHRASE: string;
33
+ }
34
+ export interface L2WithBuilderHeader extends L2PolyHeader {
35
+ POLY_BUILDER_API_KEY: string;
36
+ POLY_BUILDER_TIMESTAMP: string;
37
+ POLY_BUILDER_PASSPHRASE: string;
38
+ POLY_BUILDER_SIGNATURE: string;
39
+ }
40
+ export declare enum Side {
41
+ BUY = "BUY",
42
+ SELL = "SELL"
43
+ }
44
+ export declare enum OrderType {
45
+ GTC = "GTC",
46
+ FOK = "FOK",
47
+ GTD = "GTD",
48
+ FAK = "FAK"
49
+ }
50
+ export interface PostOrdersArgs {
51
+ order: SignedOrder;
52
+ orderType: OrderType;
53
+ }
54
+ export interface NewOrder<T extends OrderType> {
55
+ readonly order: {
56
+ readonly salt: number;
57
+ readonly maker: string;
58
+ readonly signer: string;
59
+ readonly taker: string;
60
+ readonly tokenId: string;
61
+ readonly makerAmount: string;
62
+ readonly takerAmount: string;
63
+ readonly expiration: string;
64
+ readonly nonce: string;
65
+ readonly feeRateBps: string;
66
+ readonly side: Side;
67
+ readonly signatureType: SignatureType;
68
+ readonly signature: string;
69
+ };
70
+ readonly owner: string;
71
+ readonly orderType: T;
72
+ readonly deferExec: boolean;
73
+ }
74
+ export interface UserOrder {
75
+ /**
76
+ * TokenID of the Conditional token asset being traded
77
+ */
78
+ tokenID: string;
79
+ /**
80
+ * Price used to create the order
81
+ */
82
+ price: number;
83
+ /**
84
+ * Size in terms of the ConditionalToken
85
+ */
86
+ size: number;
87
+ /**
88
+ * Side of the order
89
+ */
90
+ side: Side;
91
+ /**
92
+ * Fee rate, in basis points, charged to the order maker, charged on proceeds
93
+ */
94
+ feeRateBps?: number;
95
+ /**
96
+ * Nonce used for onchain cancellations
97
+ */
98
+ nonce?: number;
99
+ /**
100
+ * Timestamp after which the order is expired.
101
+ */
102
+ expiration?: number;
103
+ /**
104
+ * Address of the order taker. The zero address is used to indicate a public order
105
+ */
106
+ taker?: string;
107
+ }
108
+ export interface UserMarketOrder {
109
+ /**
110
+ * TokenID of the Conditional token asset being traded
111
+ */
112
+ tokenID: string;
113
+ /**
114
+ * Price used to create the order
115
+ * If it is not present the market price will be used.
116
+ */
117
+ price?: number;
118
+ /**
119
+ * BUY orders: $$$ Amount to buy
120
+ * SELL orders: Shares to sell
121
+ */
122
+ amount: number;
123
+ /**
124
+ * Side of the order
125
+ */
126
+ side: Side;
127
+ /**
128
+ * Fee rate, in basis points, charged to the order maker, charged on proceeds
129
+ */
130
+ feeRateBps?: number;
131
+ /**
132
+ * Nonce used for onchain cancellations
133
+ */
134
+ nonce?: number;
135
+ /**
136
+ * Address of the order taker. The zero address is used to indicate a public order
137
+ */
138
+ taker?: string;
139
+ /**
140
+ * Specifies the type of order execution:
141
+ * - FOK (Fill or Kill): The order must be filled entirely or not at all.
142
+ * - FAK (Fill and Kill): The order can be partially filled, and any unfilled portion is canceled.
143
+ */
144
+ orderType?: OrderType.FOK | OrderType.FAK;
145
+ }
146
+ export interface OrderPayload {
147
+ orderID: string;
148
+ }
149
+ export interface ApiKeysResponse {
150
+ apiKeys: ApiKeyCreds[];
151
+ }
152
+ export interface BanStatus {
153
+ closed_only: boolean;
154
+ }
155
+ export interface OrderResponse {
156
+ success: boolean;
157
+ errorMsg: string;
158
+ orderID: string;
159
+ transactionsHashes: string[];
160
+ status: string;
161
+ takingAmount: string;
162
+ makingAmount: string;
163
+ }
164
+ export interface OpenOrder {
165
+ id: string;
166
+ status: string;
167
+ owner: string;
168
+ maker_address: string;
169
+ market: string;
170
+ asset_id: string;
171
+ side: string;
172
+ original_size: string;
173
+ size_matched: string;
174
+ price: string;
175
+ associate_trades: string[];
176
+ outcome: string;
177
+ created_at: number;
178
+ expiration: string;
179
+ order_type: string;
180
+ }
181
+ export type OpenOrdersResponse = OpenOrder[];
182
+ export interface TradeParams {
183
+ id?: string;
184
+ maker_address?: string;
185
+ market?: string;
186
+ asset_id?: string;
187
+ before?: string;
188
+ after?: string;
189
+ }
190
+ export interface OpenOrderParams {
191
+ id?: string;
192
+ market?: string;
193
+ asset_id?: string;
194
+ }
195
+ export interface MakerOrder {
196
+ order_id: string;
197
+ owner: string;
198
+ maker_address: string;
199
+ matched_amount: string;
200
+ price: string;
201
+ fee_rate_bps: string;
202
+ asset_id: string;
203
+ outcome: string;
204
+ side: Side;
205
+ }
206
+ export interface Trade {
207
+ id: string;
208
+ taker_order_id: string;
209
+ market: string;
210
+ asset_id: string;
211
+ side: Side;
212
+ size: string;
213
+ fee_rate_bps: string;
214
+ price: string;
215
+ status: string;
216
+ match_time: string;
217
+ last_update: string;
218
+ outcome: string;
219
+ bucket_index: number;
220
+ owner: string;
221
+ maker_address: string;
222
+ maker_orders: MakerOrder[];
223
+ transaction_hash: string;
224
+ trader_side: "TAKER" | "MAKER";
225
+ }
226
+ export declare enum Chain {
227
+ POLYGON = 137,
228
+ AMOY = 80002
229
+ }
230
+ export interface MarketPrice {
231
+ t: number;
232
+ p: number;
233
+ }
234
+ export interface PriceHistoryFilterParams {
235
+ market?: string;
236
+ startTs?: number;
237
+ endTs?: number;
238
+ fidelity?: number;
239
+ interval?: PriceHistoryInterval;
240
+ }
241
+ export declare enum PriceHistoryInterval {
242
+ MAX = "max",
243
+ ONE_WEEK = "1w",
244
+ ONE_DAY = "1d",
245
+ SIX_HOURS = "6h",
246
+ ONE_HOUR = "1h"
247
+ }
248
+ export interface DropNotificationParams {
249
+ ids: string[];
250
+ }
251
+ export interface Notification {
252
+ type: number;
253
+ owner: string;
254
+ payload: any;
255
+ }
256
+ export interface OrderMarketCancelParams {
257
+ market?: string;
258
+ asset_id?: string;
259
+ }
260
+ export interface OrderBookSummary {
261
+ market: string;
262
+ asset_id: string;
263
+ timestamp: string;
264
+ bids: OrderSummary[];
265
+ asks: OrderSummary[];
266
+ min_order_size: string;
267
+ tick_size: string;
268
+ neg_risk: boolean;
269
+ hash: string;
270
+ }
271
+ export interface OrderSummary {
272
+ price: string;
273
+ size: string;
274
+ }
275
+ export declare enum AssetType {
276
+ COLLATERAL = "COLLATERAL",
277
+ CONDITIONAL = "CONDITIONAL"
278
+ }
279
+ export interface BalanceAllowanceParams {
280
+ asset_type: AssetType;
281
+ token_id?: string;
282
+ }
283
+ export interface BalanceAllowanceResponse {
284
+ balance: string;
285
+ allowance: string;
286
+ }
287
+ export interface OrderScoringParams {
288
+ order_id: string;
289
+ }
290
+ export interface OrderScoring {
291
+ scoring: boolean;
292
+ }
293
+ export interface OrdersScoringParams {
294
+ orderIds: string[];
295
+ }
296
+ export type OrdersScoring = {
297
+ [orderId in string]: boolean;
298
+ };
299
+ export type CreateOrderOptions = {
300
+ tickSize: TickSize;
301
+ negRisk?: boolean;
302
+ };
303
+ export type TickSize = "0.1" | "0.01" | "0.001" | "0.0001";
304
+ export interface RoundConfig {
305
+ readonly price: number;
306
+ readonly size: number;
307
+ readonly amount: number;
308
+ }
309
+ export interface TickSizes {
310
+ [tokenId: string]: TickSize;
311
+ }
312
+ export interface NegRisk {
313
+ [tokenId: string]: boolean;
314
+ }
315
+ export interface FeeRates {
316
+ [tokenId: string]: number;
317
+ }
318
+ export interface PaginationPayload {
319
+ readonly limit: number;
320
+ readonly count: number;
321
+ readonly next_cursor: string;
322
+ readonly data: any[];
323
+ }
324
+ export interface MarketTradeEvent {
325
+ event_type: string;
326
+ market: {
327
+ condition_id: string;
328
+ asset_id: string;
329
+ question: string;
330
+ icon: string;
331
+ slug: string;
332
+ };
333
+ user: {
334
+ address: string;
335
+ username: string;
336
+ profile_picture: string;
337
+ optimized_profile_picture: string;
338
+ pseudonym: string;
339
+ };
340
+ side: Side;
341
+ size: string;
342
+ fee_rate_bps: string;
343
+ price: string;
344
+ outcome: string;
345
+ outcome_index: number;
346
+ transaction_hash: string;
347
+ timestamp: string;
348
+ }
349
+ export interface BookParams {
350
+ token_id: string;
351
+ side: Side;
352
+ }
353
+ export interface UserEarning {
354
+ date: string;
355
+ condition_id: string;
356
+ asset_address: string;
357
+ maker_address: string;
358
+ earnings: number;
359
+ asset_rate: number;
360
+ }
361
+ export interface TotalUserEarning {
362
+ date: string;
363
+ asset_address: string;
364
+ maker_address: string;
365
+ earnings: number;
366
+ asset_rate: number;
367
+ }
368
+ export interface RewardsPercentages {
369
+ [market: string]: number;
370
+ }
371
+ export interface Token {
372
+ token_id: string;
373
+ outcome: string;
374
+ price: number;
375
+ }
376
+ export interface RewardsConfig {
377
+ asset_address: string;
378
+ start_date: string;
379
+ end_date: string;
380
+ rate_per_day: number;
381
+ total_rewards: number;
382
+ }
383
+ export interface MarketReward {
384
+ condition_id: string;
385
+ question: string;
386
+ market_slug: string;
387
+ event_slug: string;
388
+ image: string;
389
+ rewards_max_spread: number;
390
+ rewards_min_size: number;
391
+ tokens: Token[];
392
+ rewards_config: RewardsConfig[];
393
+ }
394
+ export interface Earning {
395
+ asset_address: string;
396
+ earnings: number;
397
+ asset_rate: number;
398
+ }
399
+ export interface BuilderApiKey {
400
+ key: string;
401
+ secret: string;
402
+ passphrase: string;
403
+ }
404
+ export interface BuilderApiKeyResponse {
405
+ key: string;
406
+ createdAt?: string;
407
+ revokedAt?: string;
408
+ }
409
+ export interface UserRewardsEarning {
410
+ condition_id: string;
411
+ question: string;
412
+ market_slug: string;
413
+ event_slug: string;
414
+ image: string;
415
+ rewards_max_spread: number;
416
+ rewards_min_size: number;
417
+ market_competitiveness: number;
418
+ tokens: Token[];
419
+ rewards_config: RewardsConfig[];
420
+ maker_address: string;
421
+ earning_percentage: number;
422
+ earnings: Earning[];
423
+ }
424
+ export interface BuilderTrade {
425
+ id: string;
426
+ tradeType: string;
427
+ takerOrderHash: string;
428
+ builder: string;
429
+ market: string;
430
+ assetId: string;
431
+ side: string;
432
+ size: string;
433
+ sizeUsdc: string;
434
+ price: string;
435
+ status: string;
436
+ outcome: string;
437
+ outcomeIndex: number;
438
+ owner: string;
439
+ maker: string;
440
+ transactionHash: string;
441
+ matchTime: string;
442
+ bucketIndex: number;
443
+ fee: string;
444
+ feeUsdc: string;
445
+ err_msg?: string | null;
446
+ createdAt: string | null;
447
+ updatedAt: string | null;
448
+ }
449
+ export interface CancelRfqRequestParams {
450
+ requestId: string;
451
+ }
452
+ export interface CreateRfqRequestParams {
453
+ assetIn: string;
454
+ assetOut: string;
455
+ amountIn: string;
456
+ amountOut: string;
457
+ userType: number;
458
+ }
459
+ export interface RfqQuoteParams {
460
+ requestId: string;
461
+ assetIn: string;
462
+ assetOut: string;
463
+ amountIn: string;
464
+ amountOut: string;
465
+ userType: number;
466
+ }
467
+ export interface CreateRfqQuoteParams {
468
+ requestId: string;
469
+ assetIn: string;
470
+ assetOut: string;
471
+ amountIn: string;
472
+ amountOut: string;
473
+ }
474
+ export interface CancelRfqQuoteParams {
475
+ quoteId: string;
476
+ }
477
+ export interface AcceptQuoteParams {
478
+ requestId: string;
479
+ quoteId: string;
480
+ expiration: number;
481
+ }
482
+ export interface ApproveOrderParams {
483
+ requestId: string;
484
+ quoteId: string;
485
+ expiration: number;
486
+ }
487
+ export interface GetRfqQuotesParams {
488
+ quoteIds?: string[];
489
+ states?: string[];
490
+ userAddress?: string;
491
+ state?: string;
492
+ markets?: string[];
493
+ requestIds?: string[];
494
+ sizeMin?: number;
495
+ sizeMax?: number;
496
+ sizeUsdcMin?: number;
497
+ sizeUsdcMax?: number;
498
+ priceMin?: number;
499
+ priceMax?: number;
500
+ sortBy?: string;
501
+ sortDir?: string;
502
+ limit?: number;
503
+ offset?: string;
504
+ }
505
+ export interface GetRfqBestQuoteParams {
506
+ requestId?: string;
507
+ }
508
+ export type RfqUserOrder = Pick<UserOrder, "price" | "size" | "side" | "tokenID">;
509
+ export type RfqUserQuote = RfqUserOrder & {
510
+ requestId: string;
511
+ };
512
+ export interface GetRfqRequestsParams {
513
+ requestIds?: string[];
514
+ states?: string[];
515
+ state?: string;
516
+ markets?: string[];
517
+ sizeMin?: number;
518
+ sizeMax?: number;
519
+ sizeUsdcMin?: number;
520
+ sizeUsdcMax?: number;
521
+ priceMin?: number;
522
+ priceMax?: number;
523
+ sortBy?: string;
524
+ sortDir?: string;
525
+ limit?: number;
526
+ offset?: string;
527
+ }
528
+ export interface RfqPaginatedResponse<T> {
529
+ readonly data: T[];
530
+ readonly next_cursor: string;
531
+ readonly limit: number;
532
+ readonly count: number;
533
+ readonly total_count?: number;
534
+ }
535
+ export interface RfqRequest {
536
+ readonly requestId: string;
537
+ readonly userAddress: string;
538
+ readonly proxyAddress: string;
539
+ readonly token: string;
540
+ readonly complement: string;
541
+ readonly condition: string;
542
+ readonly side: string;
543
+ readonly sizeIn: string;
544
+ readonly sizeOut: string;
545
+ readonly price: number;
546
+ readonly acceptedQuoteId: string;
547
+ readonly state: string;
548
+ readonly expiry: Date;
549
+ readonly createdAt: Date;
550
+ readonly updatedAt: Date;
551
+ }
552
+ export declare enum RfqMatchType {
553
+ COMPLEMENTARY = "COMPLEMENTARY",
554
+ MERGE = "MERGE",
555
+ MINT = "MINT"
556
+ }
557
+ export interface RfqQuote {
558
+ readonly quoteId: string;
559
+ readonly requestId: string;
560
+ readonly userAddress: string;
561
+ readonly proxyAddress: string;
562
+ readonly complement: string;
563
+ readonly condition: string;
564
+ readonly token: string;
565
+ readonly side: string;
566
+ readonly sizeIn: string;
567
+ readonly sizeOut: string;
568
+ readonly price: number;
569
+ readonly state: string;
570
+ readonly expiry: Date;
571
+ readonly matchType: string;
572
+ readonly createdAt: Date;
573
+ readonly updatedAt: Date;
574
+ }
575
+ export type RfqRequestsResponse = RfqPaginatedResponse<RfqRequest>;
576
+ export type RfqQuotesResponse = RfqPaginatedResponse<RfqQuote>;
577
+ export interface RfqRequestResponse {
578
+ readonly requestId: string;
579
+ readonly error?: string;
580
+ }
581
+ export interface RfqQuoteResponse {
582
+ readonly quoteId: string;
583
+ readonly error?: string;
584
+ }
585
+ export interface RfqRequestOrderCreationPayload {
586
+ readonly token: string;
587
+ readonly side: Side;
588
+ readonly size: string;
589
+ }
package/dist/types.js ADDED
@@ -0,0 +1,37 @@
1
+ export var Side;
2
+ (function (Side) {
3
+ Side["BUY"] = "BUY";
4
+ Side["SELL"] = "SELL";
5
+ })(Side || (Side = {}));
6
+ export var OrderType;
7
+ (function (OrderType) {
8
+ OrderType["GTC"] = "GTC";
9
+ OrderType["FOK"] = "FOK";
10
+ OrderType["GTD"] = "GTD";
11
+ OrderType["FAK"] = "FAK";
12
+ })(OrderType || (OrderType = {}));
13
+ export var Chain;
14
+ (function (Chain) {
15
+ Chain[Chain["POLYGON"] = 137] = "POLYGON";
16
+ Chain[Chain["AMOY"] = 80002] = "AMOY";
17
+ })(Chain || (Chain = {}));
18
+ export var PriceHistoryInterval;
19
+ (function (PriceHistoryInterval) {
20
+ PriceHistoryInterval["MAX"] = "max";
21
+ PriceHistoryInterval["ONE_WEEK"] = "1w";
22
+ PriceHistoryInterval["ONE_DAY"] = "1d";
23
+ PriceHistoryInterval["SIX_HOURS"] = "6h";
24
+ PriceHistoryInterval["ONE_HOUR"] = "1h";
25
+ })(PriceHistoryInterval || (PriceHistoryInterval = {}));
26
+ export var AssetType;
27
+ (function (AssetType) {
28
+ AssetType["COLLATERAL"] = "COLLATERAL";
29
+ AssetType["CONDITIONAL"] = "CONDITIONAL";
30
+ })(AssetType || (AssetType = {}));
31
+ export var RfqMatchType;
32
+ (function (RfqMatchType) {
33
+ RfqMatchType["COMPLEMENTARY"] = "COMPLEMENTARY";
34
+ RfqMatchType["MERGE"] = "MERGE";
35
+ RfqMatchType["MINT"] = "MINT";
36
+ })(RfqMatchType || (RfqMatchType = {}));
37
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAoDA,MAAM,CAAN,IAAY,IAGX;AAHD,WAAY,IAAI;IACZ,mBAAW,CAAA;IACX,qBAAa,CAAA;AACjB,CAAC,EAHW,IAAI,KAAJ,IAAI,QAGf;AAED,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACjB,wBAAW,CAAA;IACX,wBAAW,CAAA;IACX,wBAAW,CAAA;IACX,wBAAW,CAAA;AACf,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAkND,MAAM,CAAN,IAAY,KAGX;AAHD,WAAY,KAAK;IACb,yCAAa,CAAA;IACb,qCAAY,CAAA;AAChB,CAAC,EAHW,KAAK,KAAL,KAAK,QAGhB;AAeD,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC5B,mCAAW,CAAA;IACX,uCAAe,CAAA;IACf,sCAAc,CAAA;IACd,wCAAgB,CAAA;IAChB,uCAAe,CAAA;AACnB,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B;AAmCD,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,sCAAyB,CAAA;IACzB,wCAA2B,CAAA;AAC/B,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AA8TD,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,+CAA+B,CAAA;IAC/B,+BAAe,CAAA;IACf,6BAAa,CAAA;AACjB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB"}
@@ -0,0 +1,16 @@
1
+ import type { SignedOrder } from "@polymarket/order-utils";
2
+ import { OrderType } from "./types.ts";
3
+ import type { NewOrder, OrderBookSummary, TickSize } from "./types.ts";
4
+ export declare function orderToJson<T extends OrderType>(order: SignedOrder, owner: string, orderType: T, deferExec?: boolean): NewOrder<T>;
5
+ export declare const roundNormal: (num: number, decimals: number) => number;
6
+ export declare const roundDown: (num: number, decimals: number) => number;
7
+ export declare const roundUp: (num: number, decimals: number) => number;
8
+ export declare const decimalPlaces: (num: number) => number;
9
+ /**
10
+ * Calculates the hash for the given orderbook
11
+ * @param orderbook
12
+ * @returns
13
+ */
14
+ export declare const generateOrderBookSummaryHash: (orderbook: OrderBookSummary) => Promise<string>;
15
+ export declare const isTickSizeSmaller: (a: TickSize, b: TickSize) => boolean;
16
+ export declare const priceValid: (price: number, tickSize: TickSize) => boolean;