@polymarket/bindings 0.1.0-beta.2 → 0.1.0-beta.4
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/chunk-HOD4LKZU.js +2 -0
- package/dist/chunk-HOD4LKZU.js.map +1 -0
- package/dist/chunk-IHJYHHWK.js +2 -0
- package/dist/chunk-IHJYHHWK.js.map +1 -0
- package/dist/chunk-YJ7M6UHS.js +2 -0
- package/dist/chunk-YJ7M6UHS.js.map +1 -0
- package/dist/clob/index.d.ts +85 -83
- package/dist/clob/index.js +1 -1
- package/dist/clob/index.js.map +1 -1
- package/dist/data/index.d.ts +818 -44
- package/dist/data/index.js +1 -1
- package/dist/data/index.js.map +1 -1
- package/dist/gamma/index.d.ts +113 -156
- package/dist/gamma/index.js +1 -1
- package/dist/gamma/index.js.map +1 -1
- package/dist/index.d.ts +29 -5
- package/dist/index.js +1 -1
- package/dist/relayer/index.js +1 -1
- package/dist/relayer/index.js.map +1 -1
- package/dist/rfq.d.ts +546 -0
- package/dist/rfq.js +2 -0
- package/dist/rfq.js.map +1 -0
- package/dist/signature-type-CrLAA9AN.d.ts +23 -0
- package/dist/subscriptions/index.d.ts +10 -10
- package/dist/subscriptions/index.js +1 -1
- package/dist/subscriptions/index.js.map +1 -1
- package/package.json +17 -2
- package/dist/chunk-6WCDEPBE.js +0 -2
- package/dist/chunk-6WCDEPBE.js.map +0 -1
- package/dist/chunk-TM2ZY32Q.js +0 -2
- package/dist/chunk-TM2ZY32Q.js.map +0 -1
package/dist/clob/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as _polymarket_types from '@polymarket/types';
|
|
2
2
|
import { TxHash } from '@polymarket/types';
|
|
3
|
-
import { BaseUnits, TokenId, DecimalString, IsoDateTimeString, NotificationId, EpochMilliseconds,
|
|
3
|
+
import { BaseUnits, TokenId, DecimalString, IsoDateTimeString, NotificationId, EpochMilliseconds, CtfConditionId, ApiKey, OrderSide } from '../index.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
+
export { S as SignatureType, a as SignatureTypeSchema } from '../signature-type-CrLAA9AN.js';
|
|
5
6
|
|
|
6
7
|
declare const ClosedOnlyModeSchema: z.ZodPipe<z.ZodObject<{
|
|
7
8
|
closed_only: z.ZodBoolean;
|
|
@@ -581,21 +582,21 @@ type OrdersScoringResponse = z.infer<typeof OrdersScoringResponseSchema>;
|
|
|
581
582
|
declare const UserEarningSchema: z.ZodPipe<z.ZodObject<{
|
|
582
583
|
asset_address: z.ZodString;
|
|
583
584
|
asset_rate: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
|
|
584
|
-
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
585
|
+
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
585
586
|
date: z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>;
|
|
586
587
|
earnings: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
|
|
587
588
|
maker_address: z.ZodString;
|
|
588
589
|
}, z.core.$strip>, z.ZodTransform<{
|
|
589
590
|
assetAddress: string;
|
|
590
591
|
assetRate: DecimalString;
|
|
591
|
-
conditionId:
|
|
592
|
+
conditionId: CtfConditionId;
|
|
592
593
|
makerAddress: string;
|
|
593
594
|
date: IsoDateTimeString;
|
|
594
595
|
earnings: DecimalString;
|
|
595
596
|
}, {
|
|
596
597
|
asset_address: string;
|
|
597
598
|
asset_rate: DecimalString;
|
|
598
|
-
condition_id:
|
|
599
|
+
condition_id: CtfConditionId;
|
|
599
600
|
date: IsoDateTimeString;
|
|
600
601
|
earnings: DecimalString;
|
|
601
602
|
maker_address: string;
|
|
@@ -606,21 +607,21 @@ declare const UserEarningsPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
606
607
|
data: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
607
608
|
asset_address: z.ZodString;
|
|
608
609
|
asset_rate: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
|
|
609
|
-
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
610
|
+
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
610
611
|
date: z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>;
|
|
611
612
|
earnings: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
|
|
612
613
|
maker_address: z.ZodString;
|
|
613
614
|
}, z.core.$strip>, z.ZodTransform<{
|
|
614
615
|
assetAddress: string;
|
|
615
616
|
assetRate: DecimalString;
|
|
616
|
-
conditionId:
|
|
617
|
+
conditionId: CtfConditionId;
|
|
617
618
|
makerAddress: string;
|
|
618
619
|
date: IsoDateTimeString;
|
|
619
620
|
earnings: DecimalString;
|
|
620
621
|
}, {
|
|
621
622
|
asset_address: string;
|
|
622
623
|
asset_rate: DecimalString;
|
|
623
|
-
condition_id:
|
|
624
|
+
condition_id: CtfConditionId;
|
|
624
625
|
date: IsoDateTimeString;
|
|
625
626
|
earnings: DecimalString;
|
|
626
627
|
maker_address: string;
|
|
@@ -633,7 +634,7 @@ declare const UserEarningsPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
633
634
|
data: {
|
|
634
635
|
assetAddress: string;
|
|
635
636
|
assetRate: DecimalString;
|
|
636
|
-
conditionId:
|
|
637
|
+
conditionId: CtfConditionId;
|
|
637
638
|
makerAddress: string;
|
|
638
639
|
date: IsoDateTimeString;
|
|
639
640
|
earnings: DecimalString;
|
|
@@ -644,7 +645,7 @@ declare const UserEarningsPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
644
645
|
data: {
|
|
645
646
|
assetAddress: string;
|
|
646
647
|
assetRate: DecimalString;
|
|
647
|
-
conditionId:
|
|
648
|
+
conditionId: CtfConditionId;
|
|
648
649
|
makerAddress: string;
|
|
649
650
|
date: IsoDateTimeString;
|
|
650
651
|
earnings: DecimalString;
|
|
@@ -693,7 +694,7 @@ declare const TotalUserEarningsResponseSchema: z.ZodArray<z.ZodPipe<z.ZodObject<
|
|
|
693
694
|
maker_address: string;
|
|
694
695
|
}>>>;
|
|
695
696
|
type TotalUserEarningsResponse = z.infer<typeof TotalUserEarningsResponseSchema>;
|
|
696
|
-
declare const RewardsPercentagesSchema: z.ZodRecord<z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
697
|
+
declare const RewardsPercentagesSchema: z.ZodRecord<z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>, z.ZodNumber>;
|
|
697
698
|
type RewardsPercentages = z.infer<typeof RewardsPercentagesSchema>;
|
|
698
699
|
declare const TokenSchema: z.ZodPipe<z.ZodObject<{
|
|
699
700
|
outcome: z.ZodString;
|
|
@@ -741,7 +742,7 @@ declare const EarningSchema: z.ZodPipe<z.ZodObject<{
|
|
|
741
742
|
earnings: DecimalString;
|
|
742
743
|
}>>;
|
|
743
744
|
declare const UserRewardsEarningSchema: z.ZodPipe<z.ZodObject<{
|
|
744
|
-
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
745
|
+
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
745
746
|
earning_percentage: z.ZodNumber;
|
|
746
747
|
earnings: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
747
748
|
asset_address: z.ZodString;
|
|
@@ -797,7 +798,7 @@ declare const UserRewardsEarningSchema: z.ZodPipe<z.ZodObject<{
|
|
|
797
798
|
token_id: TokenId;
|
|
798
799
|
}>>>;
|
|
799
800
|
}, z.core.$strip>, z.ZodTransform<{
|
|
800
|
-
conditionId:
|
|
801
|
+
conditionId: CtfConditionId;
|
|
801
802
|
earningPercentage: number;
|
|
802
803
|
eventSlug: string;
|
|
803
804
|
makerAddress: string;
|
|
@@ -825,7 +826,7 @@ declare const UserRewardsEarningSchema: z.ZodPipe<z.ZodObject<{
|
|
|
825
826
|
price: DecimalString;
|
|
826
827
|
}[];
|
|
827
828
|
}, {
|
|
828
|
-
condition_id:
|
|
829
|
+
condition_id: CtfConditionId;
|
|
829
830
|
earning_percentage: number;
|
|
830
831
|
earnings: {
|
|
831
832
|
assetAddress: string;
|
|
@@ -857,7 +858,7 @@ type UserRewardsEarning = z.infer<typeof UserRewardsEarningSchema>;
|
|
|
857
858
|
declare const UserRewardsEarningsPageSchema: z.ZodPipe<z.ZodObject<{
|
|
858
859
|
count: z.ZodNumber;
|
|
859
860
|
data: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
860
|
-
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
861
|
+
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
861
862
|
earning_percentage: z.ZodNumber;
|
|
862
863
|
earnings: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
863
864
|
asset_address: z.ZodString;
|
|
@@ -913,7 +914,7 @@ declare const UserRewardsEarningsPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
913
914
|
token_id: TokenId;
|
|
914
915
|
}>>>;
|
|
915
916
|
}, z.core.$strip>, z.ZodTransform<{
|
|
916
|
-
conditionId:
|
|
917
|
+
conditionId: CtfConditionId;
|
|
917
918
|
earningPercentage: number;
|
|
918
919
|
eventSlug: string;
|
|
919
920
|
makerAddress: string;
|
|
@@ -941,7 +942,7 @@ declare const UserRewardsEarningsPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
941
942
|
price: DecimalString;
|
|
942
943
|
}[];
|
|
943
944
|
}, {
|
|
944
|
-
condition_id:
|
|
945
|
+
condition_id: CtfConditionId;
|
|
945
946
|
earning_percentage: number;
|
|
946
947
|
earnings: {
|
|
947
948
|
assetAddress: string;
|
|
@@ -975,7 +976,7 @@ declare const UserRewardsEarningsPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
975
976
|
nextCursor: string;
|
|
976
977
|
count: number;
|
|
977
978
|
data: {
|
|
978
|
-
conditionId:
|
|
979
|
+
conditionId: CtfConditionId;
|
|
979
980
|
earningPercentage: number;
|
|
980
981
|
eventSlug: string;
|
|
981
982
|
makerAddress: string;
|
|
@@ -1007,7 +1008,7 @@ declare const UserRewardsEarningsPageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1007
1008
|
}, {
|
|
1008
1009
|
count: number;
|
|
1009
1010
|
data: {
|
|
1010
|
-
conditionId:
|
|
1011
|
+
conditionId: CtfConditionId;
|
|
1011
1012
|
earningPercentage: number;
|
|
1012
1013
|
eventSlug: string;
|
|
1013
1014
|
makerAddress: string;
|
|
@@ -1420,14 +1421,14 @@ declare const PriceHistorySchema: z.ZodObject<{
|
|
|
1420
1421
|
}, z.core.$strip>;
|
|
1421
1422
|
type PriceHistory = z.infer<typeof PriceHistorySchema>;
|
|
1422
1423
|
declare const ConditionByTokenSchema: z.ZodPipe<z.ZodObject<{
|
|
1423
|
-
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
1424
|
-
}, z.core.$strip>, z.ZodTransform<
|
|
1425
|
-
condition_id:
|
|
1424
|
+
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
1425
|
+
}, z.core.$strip>, z.ZodTransform<CtfConditionId, {
|
|
1426
|
+
condition_id: CtfConditionId;
|
|
1426
1427
|
}>>;
|
|
1427
1428
|
declare const ResolveConditionByTokenResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
1428
|
-
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
1429
|
-
}, z.core.$strip>, z.ZodTransform<
|
|
1430
|
-
condition_id:
|
|
1429
|
+
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
1430
|
+
}, z.core.$strip>, z.ZodTransform<CtfConditionId, {
|
|
1431
|
+
condition_id: CtfConditionId;
|
|
1431
1432
|
}>>;
|
|
1432
1433
|
type ConditionByToken = z.infer<typeof ConditionByTokenSchema>;
|
|
1433
1434
|
type ResolveConditionByTokenResponse = z.infer<typeof ResolveConditionByTokenResponseSchema>;
|
|
@@ -1553,12 +1554,35 @@ declare const FetchNegRiskResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1553
1554
|
type NegRisk = z.infer<typeof NegRiskSchema>;
|
|
1554
1555
|
type FetchNegRiskResponse = z.infer<typeof FetchNegRiskResponseSchema>;
|
|
1555
1556
|
|
|
1557
|
+
type OrderBookLevel = {
|
|
1558
|
+
price: DecimalString;
|
|
1559
|
+
size: DecimalString;
|
|
1560
|
+
};
|
|
1561
|
+
/** SHA-1 hash of the serialized order book summary, encoded as bare lowercase hex. */
|
|
1562
|
+
type OrderBookHash = string & {
|
|
1563
|
+
readonly __tag: 'OrderBookHash';
|
|
1564
|
+
};
|
|
1565
|
+
type OrderBook = {
|
|
1566
|
+
market: CtfConditionId;
|
|
1567
|
+
tokenId: TokenId;
|
|
1568
|
+
timestamp?: EpochMilliseconds | null;
|
|
1569
|
+
/** Bid levels in ascending price order, lowest bid first. */
|
|
1570
|
+
bids: OrderBookLevel[];
|
|
1571
|
+
/** Ask levels in descending price order, highest ask first. */
|
|
1572
|
+
asks: OrderBookLevel[];
|
|
1573
|
+
minOrderSize: DecimalString;
|
|
1574
|
+
tickSize: DecimalString;
|
|
1575
|
+
negRisk: boolean;
|
|
1576
|
+
lastTradePrice?: DecimalString | null;
|
|
1577
|
+
hash: OrderBookHash;
|
|
1578
|
+
};
|
|
1556
1579
|
declare const OrderBookLevelSchema: z.ZodObject<{
|
|
1557
1580
|
price: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1558
1581
|
size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1559
1582
|
}, z.core.$strip>;
|
|
1583
|
+
declare const OrderBookHashSchema: z.ZodPipe<z.ZodString, z.ZodTransform<OrderBookHash, string>>;
|
|
1560
1584
|
declare const OrderBookSchema: z.ZodPipe<z.ZodObject<{
|
|
1561
|
-
market: z.ZodString
|
|
1585
|
+
market: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
1562
1586
|
asset_id: z.ZodPipe<z.ZodString, z.ZodTransform<TokenId, string>>;
|
|
1563
1587
|
timestamp: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<EpochMilliseconds, string>>>>;
|
|
1564
1588
|
bids: z.ZodArray<z.ZodObject<{
|
|
@@ -1573,14 +1597,14 @@ declare const OrderBookSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1573
1597
|
tick_size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1574
1598
|
neg_risk: z.ZodBoolean;
|
|
1575
1599
|
last_trade_price: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
|
|
1576
|
-
hash: z.ZodString
|
|
1600
|
+
hash: z.ZodPipe<z.ZodString, z.ZodTransform<OrderBookHash, string>>;
|
|
1577
1601
|
}, z.core.$strip>, z.ZodTransform<{
|
|
1578
1602
|
tokenId: TokenId;
|
|
1579
1603
|
minOrderSize: DecimalString;
|
|
1580
1604
|
tickSize: DecimalString;
|
|
1581
1605
|
negRisk: boolean;
|
|
1582
1606
|
lastTradePrice: DecimalString | null | undefined;
|
|
1583
|
-
market:
|
|
1607
|
+
market: CtfConditionId;
|
|
1584
1608
|
bids: {
|
|
1585
1609
|
price: DecimalString;
|
|
1586
1610
|
size: DecimalString;
|
|
@@ -1589,10 +1613,10 @@ declare const OrderBookSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1589
1613
|
price: DecimalString;
|
|
1590
1614
|
size: DecimalString;
|
|
1591
1615
|
}[];
|
|
1592
|
-
hash:
|
|
1616
|
+
hash: OrderBookHash;
|
|
1593
1617
|
timestamp?: EpochMilliseconds | null | undefined;
|
|
1594
1618
|
}, {
|
|
1595
|
-
market:
|
|
1619
|
+
market: CtfConditionId;
|
|
1596
1620
|
asset_id: TokenId;
|
|
1597
1621
|
bids: {
|
|
1598
1622
|
price: DecimalString;
|
|
@@ -1605,12 +1629,12 @@ declare const OrderBookSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1605
1629
|
min_order_size: DecimalString;
|
|
1606
1630
|
tick_size: DecimalString;
|
|
1607
1631
|
neg_risk: boolean;
|
|
1608
|
-
hash:
|
|
1632
|
+
hash: OrderBookHash;
|
|
1609
1633
|
timestamp?: EpochMilliseconds | null | undefined;
|
|
1610
1634
|
last_trade_price?: DecimalString | null | undefined;
|
|
1611
1635
|
}>>;
|
|
1612
1636
|
declare const FetchOrderBookResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
1613
|
-
market: z.ZodString
|
|
1637
|
+
market: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
1614
1638
|
asset_id: z.ZodPipe<z.ZodString, z.ZodTransform<TokenId, string>>;
|
|
1615
1639
|
timestamp: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<EpochMilliseconds, string>>>>;
|
|
1616
1640
|
bids: z.ZodArray<z.ZodObject<{
|
|
@@ -1625,14 +1649,14 @@ declare const FetchOrderBookResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1625
1649
|
tick_size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1626
1650
|
neg_risk: z.ZodBoolean;
|
|
1627
1651
|
last_trade_price: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
|
|
1628
|
-
hash: z.ZodString
|
|
1652
|
+
hash: z.ZodPipe<z.ZodString, z.ZodTransform<OrderBookHash, string>>;
|
|
1629
1653
|
}, z.core.$strip>, z.ZodTransform<{
|
|
1630
1654
|
tokenId: TokenId;
|
|
1631
1655
|
minOrderSize: DecimalString;
|
|
1632
1656
|
tickSize: DecimalString;
|
|
1633
1657
|
negRisk: boolean;
|
|
1634
1658
|
lastTradePrice: DecimalString | null | undefined;
|
|
1635
|
-
market:
|
|
1659
|
+
market: CtfConditionId;
|
|
1636
1660
|
bids: {
|
|
1637
1661
|
price: DecimalString;
|
|
1638
1662
|
size: DecimalString;
|
|
@@ -1641,10 +1665,10 @@ declare const FetchOrderBookResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1641
1665
|
price: DecimalString;
|
|
1642
1666
|
size: DecimalString;
|
|
1643
1667
|
}[];
|
|
1644
|
-
hash:
|
|
1668
|
+
hash: OrderBookHash;
|
|
1645
1669
|
timestamp?: EpochMilliseconds | null | undefined;
|
|
1646
1670
|
}, {
|
|
1647
|
-
market:
|
|
1671
|
+
market: CtfConditionId;
|
|
1648
1672
|
asset_id: TokenId;
|
|
1649
1673
|
bids: {
|
|
1650
1674
|
price: DecimalString;
|
|
@@ -1657,12 +1681,12 @@ declare const FetchOrderBookResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1657
1681
|
min_order_size: DecimalString;
|
|
1658
1682
|
tick_size: DecimalString;
|
|
1659
1683
|
neg_risk: boolean;
|
|
1660
|
-
hash:
|
|
1684
|
+
hash: OrderBookHash;
|
|
1661
1685
|
timestamp?: EpochMilliseconds | null | undefined;
|
|
1662
1686
|
last_trade_price?: DecimalString | null | undefined;
|
|
1663
1687
|
}>>;
|
|
1664
1688
|
declare const OrderBooksSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
1665
|
-
market: z.ZodString
|
|
1689
|
+
market: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
1666
1690
|
asset_id: z.ZodPipe<z.ZodString, z.ZodTransform<TokenId, string>>;
|
|
1667
1691
|
timestamp: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<EpochMilliseconds, string>>>>;
|
|
1668
1692
|
bids: z.ZodArray<z.ZodObject<{
|
|
@@ -1677,14 +1701,14 @@ declare const OrderBooksSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
|
1677
1701
|
tick_size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1678
1702
|
neg_risk: z.ZodBoolean;
|
|
1679
1703
|
last_trade_price: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
|
|
1680
|
-
hash: z.ZodString
|
|
1704
|
+
hash: z.ZodPipe<z.ZodString, z.ZodTransform<OrderBookHash, string>>;
|
|
1681
1705
|
}, z.core.$strip>, z.ZodTransform<{
|
|
1682
1706
|
tokenId: TokenId;
|
|
1683
1707
|
minOrderSize: DecimalString;
|
|
1684
1708
|
tickSize: DecimalString;
|
|
1685
1709
|
negRisk: boolean;
|
|
1686
1710
|
lastTradePrice: DecimalString | null | undefined;
|
|
1687
|
-
market:
|
|
1711
|
+
market: CtfConditionId;
|
|
1688
1712
|
bids: {
|
|
1689
1713
|
price: DecimalString;
|
|
1690
1714
|
size: DecimalString;
|
|
@@ -1693,10 +1717,10 @@ declare const OrderBooksSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
|
1693
1717
|
price: DecimalString;
|
|
1694
1718
|
size: DecimalString;
|
|
1695
1719
|
}[];
|
|
1696
|
-
hash:
|
|
1720
|
+
hash: OrderBookHash;
|
|
1697
1721
|
timestamp?: EpochMilliseconds | null | undefined;
|
|
1698
1722
|
}, {
|
|
1699
|
-
market:
|
|
1723
|
+
market: CtfConditionId;
|
|
1700
1724
|
asset_id: TokenId;
|
|
1701
1725
|
bids: {
|
|
1702
1726
|
price: DecimalString;
|
|
@@ -1709,14 +1733,12 @@ declare const OrderBooksSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
|
1709
1733
|
min_order_size: DecimalString;
|
|
1710
1734
|
tick_size: DecimalString;
|
|
1711
1735
|
neg_risk: boolean;
|
|
1712
|
-
hash:
|
|
1736
|
+
hash: OrderBookHash;
|
|
1713
1737
|
timestamp?: EpochMilliseconds | null | undefined;
|
|
1714
1738
|
last_trade_price?: DecimalString | null | undefined;
|
|
1715
1739
|
}>>>;
|
|
1716
|
-
type
|
|
1717
|
-
type
|
|
1718
|
-
type OrderBooks = z.infer<typeof OrderBooksSchema>;
|
|
1719
|
-
type FetchOrderBookResponse = z.infer<typeof FetchOrderBookResponseSchema>;
|
|
1740
|
+
type OrderBooks = OrderBook[];
|
|
1741
|
+
type FetchOrderBookResponse = OrderBook;
|
|
1720
1742
|
|
|
1721
1743
|
declare const RawOrderResponseSchema: z.ZodObject<{
|
|
1722
1744
|
errorMsg: z.ZodString;
|
|
@@ -1853,7 +1875,7 @@ declare const CurrentRewardConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1853
1875
|
}>>;
|
|
1854
1876
|
type CurrentRewardConfig = z.infer<typeof CurrentRewardConfigSchema>;
|
|
1855
1877
|
declare const CurrentRewardSchema: z.ZodPipe<z.ZodObject<{
|
|
1856
|
-
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
1878
|
+
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
1857
1879
|
rewards_max_spread: z.ZodOptional<z.ZodNumber>;
|
|
1858
1880
|
rewards_min_size: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>>;
|
|
1859
1881
|
rewards_config: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
@@ -1883,7 +1905,7 @@ declare const CurrentRewardSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1883
1905
|
native_daily_rate: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>>;
|
|
1884
1906
|
total_daily_rate: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>>;
|
|
1885
1907
|
}, z.core.$strip>, z.ZodTransform<{
|
|
1886
|
-
conditionId:
|
|
1908
|
+
conditionId: CtfConditionId;
|
|
1887
1909
|
rewardsMaxSpread: number | undefined;
|
|
1888
1910
|
rewardsMinSize: DecimalString | undefined;
|
|
1889
1911
|
rewardsConfig: {
|
|
@@ -1899,7 +1921,7 @@ declare const CurrentRewardSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1899
1921
|
nativeDailyRate: DecimalString | undefined;
|
|
1900
1922
|
totalDailyRate: DecimalString | undefined;
|
|
1901
1923
|
}, {
|
|
1902
|
-
condition_id:
|
|
1924
|
+
condition_id: CtfConditionId;
|
|
1903
1925
|
rewards_max_spread?: number | undefined;
|
|
1904
1926
|
rewards_min_size?: DecimalString | undefined;
|
|
1905
1927
|
rewards_config?: {
|
|
@@ -1921,7 +1943,7 @@ declare const PaginatedCurrentRewardsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1921
1943
|
count: z.ZodNumber;
|
|
1922
1944
|
next_cursor: z.ZodString;
|
|
1923
1945
|
data: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
1924
|
-
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
1946
|
+
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
1925
1947
|
rewards_max_spread: z.ZodOptional<z.ZodNumber>;
|
|
1926
1948
|
rewards_min_size: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>>;
|
|
1927
1949
|
rewards_config: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
@@ -1951,7 +1973,7 @@ declare const PaginatedCurrentRewardsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1951
1973
|
native_daily_rate: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>>;
|
|
1952
1974
|
total_daily_rate: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>>;
|
|
1953
1975
|
}, z.core.$strip>, z.ZodTransform<{
|
|
1954
|
-
conditionId:
|
|
1976
|
+
conditionId: CtfConditionId;
|
|
1955
1977
|
rewardsMaxSpread: number | undefined;
|
|
1956
1978
|
rewardsMinSize: DecimalString | undefined;
|
|
1957
1979
|
rewardsConfig: {
|
|
@@ -1967,7 +1989,7 @@ declare const PaginatedCurrentRewardsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1967
1989
|
nativeDailyRate: DecimalString | undefined;
|
|
1968
1990
|
totalDailyRate: DecimalString | undefined;
|
|
1969
1991
|
}, {
|
|
1970
|
-
condition_id:
|
|
1992
|
+
condition_id: CtfConditionId;
|
|
1971
1993
|
rewards_max_spread?: number | undefined;
|
|
1972
1994
|
rewards_min_size?: DecimalString | undefined;
|
|
1973
1995
|
rewards_config?: {
|
|
@@ -1988,7 +2010,7 @@ declare const PaginatedCurrentRewardsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1988
2010
|
limit: number;
|
|
1989
2011
|
count: number;
|
|
1990
2012
|
data: {
|
|
1991
|
-
conditionId:
|
|
2013
|
+
conditionId: CtfConditionId;
|
|
1992
2014
|
rewardsMaxSpread: number | undefined;
|
|
1993
2015
|
rewardsMinSize: DecimalString | undefined;
|
|
1994
2016
|
rewardsConfig: {
|
|
@@ -2009,7 +2031,7 @@ declare const PaginatedCurrentRewardsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
2009
2031
|
count: number;
|
|
2010
2032
|
next_cursor: string;
|
|
2011
2033
|
data: {
|
|
2012
|
-
conditionId:
|
|
2034
|
+
conditionId: CtfConditionId;
|
|
2013
2035
|
rewardsMaxSpread: number | undefined;
|
|
2014
2036
|
rewardsMinSize: DecimalString | undefined;
|
|
2015
2037
|
rewardsConfig: {
|
|
@@ -2062,7 +2084,7 @@ declare const RewardConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
2062
2084
|
}>>;
|
|
2063
2085
|
type RewardConfig = z.infer<typeof RewardConfigSchema>;
|
|
2064
2086
|
declare const MarketRewardSchema: z.ZodPipe<z.ZodObject<{
|
|
2065
|
-
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
2087
|
+
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
2066
2088
|
question: z.ZodString;
|
|
2067
2089
|
market_slug: z.ZodOptional<z.ZodString>;
|
|
2068
2090
|
event_slug: z.ZodOptional<z.ZodString>;
|
|
@@ -2103,7 +2125,7 @@ declare const MarketRewardSchema: z.ZodPipe<z.ZodObject<{
|
|
|
2103
2125
|
total_rewards?: DecimalString | undefined;
|
|
2104
2126
|
}>>>>;
|
|
2105
2127
|
}, z.core.$strip>, z.ZodTransform<{
|
|
2106
|
-
conditionId:
|
|
2128
|
+
conditionId: CtfConditionId;
|
|
2107
2129
|
marketSlug: string | undefined;
|
|
2108
2130
|
eventSlug: string | undefined;
|
|
2109
2131
|
rewardsMaxSpread: number | undefined;
|
|
@@ -2124,7 +2146,7 @@ declare const MarketRewardSchema: z.ZodPipe<z.ZodObject<{
|
|
|
2124
2146
|
}[];
|
|
2125
2147
|
image?: string | undefined;
|
|
2126
2148
|
}, {
|
|
2127
|
-
condition_id:
|
|
2149
|
+
condition_id: CtfConditionId;
|
|
2128
2150
|
question: string;
|
|
2129
2151
|
tokens: {
|
|
2130
2152
|
tokenId: TokenId;
|
|
@@ -2151,7 +2173,7 @@ declare const PaginatedMarketRewardsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
2151
2173
|
count: z.ZodNumber;
|
|
2152
2174
|
next_cursor: z.ZodString;
|
|
2153
2175
|
data: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
2154
|
-
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
2176
|
+
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
2155
2177
|
question: z.ZodString;
|
|
2156
2178
|
market_slug: z.ZodOptional<z.ZodString>;
|
|
2157
2179
|
event_slug: z.ZodOptional<z.ZodString>;
|
|
@@ -2192,7 +2214,7 @@ declare const PaginatedMarketRewardsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
2192
2214
|
total_rewards?: DecimalString | undefined;
|
|
2193
2215
|
}>>>>;
|
|
2194
2216
|
}, z.core.$strip>, z.ZodTransform<{
|
|
2195
|
-
conditionId:
|
|
2217
|
+
conditionId: CtfConditionId;
|
|
2196
2218
|
marketSlug: string | undefined;
|
|
2197
2219
|
eventSlug: string | undefined;
|
|
2198
2220
|
rewardsMaxSpread: number | undefined;
|
|
@@ -2213,7 +2235,7 @@ declare const PaginatedMarketRewardsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
2213
2235
|
}[];
|
|
2214
2236
|
image?: string | undefined;
|
|
2215
2237
|
}, {
|
|
2216
|
-
condition_id:
|
|
2238
|
+
condition_id: CtfConditionId;
|
|
2217
2239
|
question: string;
|
|
2218
2240
|
tokens: {
|
|
2219
2241
|
tokenId: TokenId;
|
|
@@ -2239,7 +2261,7 @@ declare const PaginatedMarketRewardsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
2239
2261
|
limit: number;
|
|
2240
2262
|
count: number;
|
|
2241
2263
|
data: {
|
|
2242
|
-
conditionId:
|
|
2264
|
+
conditionId: CtfConditionId;
|
|
2243
2265
|
marketSlug: string | undefined;
|
|
2244
2266
|
eventSlug: string | undefined;
|
|
2245
2267
|
rewardsMaxSpread: number | undefined;
|
|
@@ -2265,7 +2287,7 @@ declare const PaginatedMarketRewardsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
2265
2287
|
count: number;
|
|
2266
2288
|
next_cursor: string;
|
|
2267
2289
|
data: {
|
|
2268
|
-
conditionId:
|
|
2290
|
+
conditionId: CtfConditionId;
|
|
2269
2291
|
marketSlug: string | undefined;
|
|
2270
2292
|
eventSlug: string | undefined;
|
|
2271
2293
|
rewardsMaxSpread: number | undefined;
|
|
@@ -2289,26 +2311,6 @@ declare const PaginatedMarketRewardsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
2289
2311
|
}>>;
|
|
2290
2312
|
type PaginatedMarketRewards = z.infer<typeof PaginatedMarketRewardsSchema>;
|
|
2291
2313
|
|
|
2292
|
-
declare enum SignatureType {
|
|
2293
|
-
/**
|
|
2294
|
-
* ECDSA EIP712 signatures signed by EOAs
|
|
2295
|
-
*/
|
|
2296
|
-
EOA = 0,
|
|
2297
|
-
/**
|
|
2298
|
-
* EIP712 signatures signed by EOAs that own Polymarket Proxy wallets
|
|
2299
|
-
*/
|
|
2300
|
-
POLY_PROXY = 1,
|
|
2301
|
-
/**
|
|
2302
|
-
* EIP712 signatures signed by EOAs that own Polymarket Gnosis safes
|
|
2303
|
-
*/
|
|
2304
|
-
POLY_GNOSIS_SAFE = 2,
|
|
2305
|
-
/**
|
|
2306
|
-
* EIP1271 signatures signed by smart contracts
|
|
2307
|
-
*/
|
|
2308
|
-
POLY_1271 = 3
|
|
2309
|
-
}
|
|
2310
|
-
declare const SignatureTypeSchema: z.ZodEnum<typeof SignatureType>;
|
|
2311
|
-
|
|
2312
2314
|
declare const TickSizeSchema: z.ZodPipe<z.ZodObject<{
|
|
2313
2315
|
minimum_tick_size: z.ZodUnion<readonly [z.ZodLiteral<0.1>, z.ZodLiteral<0.01>, z.ZodLiteral<0.001>, z.ZodLiteral<0.0001>]>;
|
|
2314
2316
|
}, z.core.$strip>, z.ZodTransform<{
|
|
@@ -2326,4 +2328,4 @@ declare const FetchTickSizeResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
2326
2328
|
type TickSize = z.infer<typeof TickSizeSchema>;
|
|
2327
2329
|
type FetchTickSizeResponse = z.infer<typeof FetchTickSizeResponseSchema>;
|
|
2328
2330
|
|
|
2329
|
-
export { type AcceptedOrderResponse, AcceptedOrderResponseSchema, type ApiKeyCreds, ApiKeyCredsSchema, type ApiKeysResponse, ApiKeysResponseSchema, AssetType, AssetTypeSchema, type BalanceAllowanceResponse, BalanceAllowanceResponseSchema, type BuilderApiKey, type BuilderApiKeyCreds, BuilderApiKeyCredsSchema, BuilderApiKeySchema, type BuilderApiKeysResponse, BuilderApiKeysResponseSchema, type BuilderFeeRates, BuilderFeeRatesSchema, type BuilderTrade, BuilderTradeSchema, type CancelOrdersResponse, CancelOrdersResponseSchema, type ClobTrade, ClobTradeSchema, type ClobTradesPage, ClobTradesPageSchema, type ClosedOnlyMode, ClosedOnlyModeSchema, type ConditionByToken, ConditionByTokenSchema, type CurrentReward, type CurrentRewardConfig, CurrentRewardSchema, END_CURSOR, EarningSchema, type FetchBuilderFeeRatesResponse, FetchBuilderFeeRatesResponseSchema, type FetchMarketInfoResponse, FetchMarketInfoResponseSchema, type FetchNegRiskResponse, FetchNegRiskResponseSchema, type FetchOrderBookResponse, FetchOrderBookResponseSchema, type FetchTickSizeResponse, FetchTickSizeResponseSchema, type LastTradePrice, type LastTradePriceForToken, type LastTradePriceForTokenResponse, LastTradePriceSchema, type LastTradePrices, LastTradePricesSchema, MakerOrderSchema, type MarketFeeInfo, MarketFeeInfoSchema, type MarketInfo, MarketInfoSchema, type MarketReward, MarketRewardSchema, type MarketToken, MarketTokenSchema, type Midpoint, MidpointSchema, type Midpoints, MidpointsSchema, type NegRisk, NegRiskSchema, type Notification, NotificationSchema, type NotificationsResponse, NotificationsResponseSchema, type OpenOrder, OpenOrderSchema, type OpenOrdersPage, OpenOrdersPageSchema, type OrderBook, type OrderBookLevel, OrderBookLevelSchema, OrderBookSchema, type OrderBooks, OrderBooksSchema, OrderPostStatus, OrderPostStatusSchema, type OrderResponse, OrderResponseErrorCode, OrderResponseErrorCodeSchema, OrderResponseSchema, type OrderResponses, OrderResponsesSchema, type OrderScoringResponse, OrderScoringResponseSchema, type OrdersScoringResponse, OrdersScoringResponseSchema, type PaginatedBuilderTrades, PaginatedBuilderTradesSchema, type PaginatedCurrentRewards, PaginatedCurrentRewardsSchema, type PaginatedMarketRewards, PaginatedMarketRewardsSchema, type Price, type PriceHistory, PriceHistoryInterval, PriceHistoryIntervalSchema, type PriceHistoryPoint, PriceHistorySchema, PriceSchema, type Prices, type PricesBySide, PricesSchema, RawApiKeyCredsSchema, type RawOrderResponse, RawOrderResponseSchema, type RawOrderResponses, RawOrderResponsesSchema, type RejectedOrderResponse, RejectedOrderResponseSchema, type ResolveConditionByTokenResponse, ResolveConditionByTokenResponseSchema, type RewardConfig, type RewardToken, RewardsConfigSchema, type RewardsPercentages, RewardsPercentagesSchema,
|
|
2331
|
+
export { type AcceptedOrderResponse, AcceptedOrderResponseSchema, type ApiKeyCreds, ApiKeyCredsSchema, type ApiKeysResponse, ApiKeysResponseSchema, AssetType, AssetTypeSchema, type BalanceAllowanceResponse, BalanceAllowanceResponseSchema, type BuilderApiKey, type BuilderApiKeyCreds, BuilderApiKeyCredsSchema, BuilderApiKeySchema, type BuilderApiKeysResponse, BuilderApiKeysResponseSchema, type BuilderFeeRates, BuilderFeeRatesSchema, type BuilderTrade, BuilderTradeSchema, type CancelOrdersResponse, CancelOrdersResponseSchema, type ClobTrade, ClobTradeSchema, type ClobTradesPage, ClobTradesPageSchema, type ClosedOnlyMode, ClosedOnlyModeSchema, type ConditionByToken, ConditionByTokenSchema, type CurrentReward, type CurrentRewardConfig, CurrentRewardSchema, END_CURSOR, EarningSchema, type FetchBuilderFeeRatesResponse, FetchBuilderFeeRatesResponseSchema, type FetchMarketInfoResponse, FetchMarketInfoResponseSchema, type FetchNegRiskResponse, FetchNegRiskResponseSchema, type FetchOrderBookResponse, FetchOrderBookResponseSchema, type FetchTickSizeResponse, FetchTickSizeResponseSchema, type LastTradePrice, type LastTradePriceForToken, type LastTradePriceForTokenResponse, LastTradePriceSchema, type LastTradePrices, LastTradePricesSchema, MakerOrderSchema, type MarketFeeInfo, MarketFeeInfoSchema, type MarketInfo, MarketInfoSchema, type MarketReward, MarketRewardSchema, type MarketToken, MarketTokenSchema, type Midpoint, MidpointSchema, type Midpoints, MidpointsSchema, type NegRisk, NegRiskSchema, type Notification, NotificationSchema, type NotificationsResponse, NotificationsResponseSchema, type OpenOrder, OpenOrderSchema, type OpenOrdersPage, OpenOrdersPageSchema, type OrderBook, type OrderBookHash, OrderBookHashSchema, type OrderBookLevel, OrderBookLevelSchema, OrderBookSchema, type OrderBooks, OrderBooksSchema, OrderPostStatus, OrderPostStatusSchema, type OrderResponse, OrderResponseErrorCode, OrderResponseErrorCodeSchema, OrderResponseSchema, type OrderResponses, OrderResponsesSchema, type OrderScoringResponse, OrderScoringResponseSchema, type OrdersScoringResponse, OrdersScoringResponseSchema, type PaginatedBuilderTrades, PaginatedBuilderTradesSchema, type PaginatedCurrentRewards, PaginatedCurrentRewardsSchema, type PaginatedMarketRewards, PaginatedMarketRewardsSchema, type Price, type PriceHistory, PriceHistoryInterval, PriceHistoryIntervalSchema, type PriceHistoryPoint, PriceHistorySchema, PriceSchema, type Prices, type PricesBySide, PricesSchema, RawApiKeyCredsSchema, type RawOrderResponse, RawOrderResponseSchema, type RawOrderResponses, RawOrderResponsesSchema, type RejectedOrderResponse, RejectedOrderResponseSchema, type ResolveConditionByTokenResponse, ResolveConditionByTokenResponseSchema, type RewardConfig, type RewardToken, RewardsConfigSchema, type RewardsPercentages, RewardsPercentagesSchema, type Spread, SpreadSchema, type Spreads, SpreadsSchema, type TickSize, TickSizeSchema, TokenSchema, type TotalUserEarning, TotalUserEarningSchema, type TotalUserEarningsResponse, TotalUserEarningsResponseSchema, type UserEarning, UserEarningSchema, type UserEarningsPage, UserEarningsPageSchema, type UserRewardsEarning, UserRewardsEarningSchema, type UserRewardsEarningsPage, UserRewardsEarningsPageSchema };
|
package/dist/clob/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {ta,Z as Z$1,Y as Y$1,qa,T as T$1,ia,wa,S,ua,Q as Q$1,M,u,ka,V as V$1,sa,$ as $$1}from'../chunk-TM2ZY32Q.js';import {z}from'zod';import {never}from'@polymarket/types';function T(e){return z.object({count:z.number(),data:z.array(e),limit:z.number(),next_cursor:z.string()}).transform(({next_cursor:t,...a})=>({...a,nextCursor:t}))}var Be=z.object({closed_only:z.boolean()}).transform(({closed_only:e})=>({closedOnly:e})),X=z.object({asset_id:qa,associate_trades:z.array(z.string()),created_at:Y$1,expiration:Z$1,id:z.string(),maker_address:z.string(),market:z.string(),order_type:z.string(),original_size:ta,outcome:z.string(),owner:z.string(),price:ta,side:z.string(),size_matched:ta,status:z.string()}).transform(({asset_id:e,associate_trades:t,created_at:a,expiration:s,maker_address:n,order_type:d,original_size:l,size_matched:u,...R})=>{let h={...R,tokenId:e,associateTrades:t,createdAt:a,makerAddress:n,orderType:d,originalSize:l,sizeMatched:u};return s===void 0?h:{...h,expiresAt:s}}),je=T(X),$=z.object({asset_id:qa,fee_rate_bps:ta,maker_address:z.string(),matched_amount:ta,order_id:z.string(),outcome:z.string(),owner:z.string(),price:ta,side:z.string()}).transform(({asset_id:e,fee_rate_bps:t,maker_address:a,matched_amount:s,order_id:n,...d})=>({...d,tokenId:e,feeRateBps:t,makerAddress:a,matchedAmount:s,orderId:n})),q=z.object({asset_id:qa,bucket_index:z.number(),fee_rate_bps:ta,id:z.string(),last_update:Y$1,maker_address:z.string(),maker_orders:z.array($),market:z.string(),match_time:Y$1,outcome:z.string(),owner:z.string(),price:ta,side:z.string(),size:ta,status:z.string(),taker_order_id:z.string(),trader_side:z.enum(["TAKER","MAKER"]),transaction_hash:z.string()}).transform(({asset_id:e,bucket_index:t,fee_rate_bps:a,last_update:s,maker_address:n,maker_orders:d,match_time:l,taker_order_id:u,trader_side:R,transaction_hash:h,...W})=>({...W,tokenId:e,bucketIndex:t,feeRateBps:a,updatedAt:s,makerAddress:n,makerOrders:d,matchedAt:l,takerOrderId:u,traderSide:R,transactionHash:h})),Fe=T(q),G=z.preprocess(e=>typeof e!="string"?e:/^\d+$/.test(e)?Number(e):Date.parse(e),T$1),Z=z.object({id:ia,owner:z.string(),payload:z.unknown(),timestamp:G,type:z.number()}),Ue=z.array(Z),N=(a=>(a.COLLATERAL="COLLATERAL",a.CONDITIONAL="CONDITIONAL",a))(N||{}),Ke=z.enum(N),He=z.object({allowances:z.record(S,z.string().transform(BigInt)),balance:wa}),ve=z.object({scoring:z.boolean()}),Ye=z.record(z.string(),z.boolean()),J=z.object({asset_address:z.string(),asset_rate:ua,condition_id:Q$1,date:Y$1,earnings:ua,maker_address:z.string()}).transform(({asset_address:e,asset_rate:t,condition_id:a,maker_address:s,...n})=>({...n,assetAddress:e,assetRate:t,conditionId:a,makerAddress:s})),Ve=T(J),Q=z.object({asset_address:z.string(),asset_rate:ua,date:Y$1,earnings:ua,maker_address:z.string()}).transform(({asset_address:e,asset_rate:t,maker_address:a,...s})=>({...s,assetAddress:e,assetRate:t,makerAddress:a})),We=z.array(Q),Xe=z.record(Q$1,z.number()),ee=z.object({outcome:z.string(),price:ua,token_id:qa}).transform(({token_id:e,...t})=>({...t,tokenId:e})),re=z.object({asset_address:z.string(),end_date:Y$1,rate_per_day:ua,start_date:Y$1,total_rewards:ua}).transform(({asset_address:e,end_date:t,rate_per_day:a,start_date:s,total_rewards:n})=>({assetAddress:e,endDate:t,ratePerDay:a,startDate:s,totalRewards:n})),te=z.object({asset_address:z.string(),asset_rate:ua,earnings:ua}).transform(({asset_address:e,asset_rate:t,...a})=>({...a,assetAddress:e,assetRate:t})),oe=z.object({condition_id:Q$1,earning_percentage:z.number(),earnings:z.array(te),event_slug:z.string(),image:z.string(),maker_address:z.string(),market_competitiveness:z.number(),market_slug:z.string(),question:z.string(),rewards_config:z.array(re),rewards_max_spread:z.number(),rewards_min_size:ua,tokens:z.array(ee)}).transform(({condition_id:e,earning_percentage:t,event_slug:a,maker_address:s,market_competitiveness:n,market_slug:d,rewards_config:l,rewards_max_spread:u,rewards_min_size:R,...h})=>({...h,conditionId:e,earningPercentage:t,eventSlug:a,makerAddress:s,marketCompetitiveness:n,marketSlug:d,rewardsConfig:l,rewardsMaxSpread:u,rewardsMinSize:R})),$e=T(oe);var ae=z.object({apiKey:M,secret:z.string(),passphrase:z.string()}),Je=ae.transform(e=>({key:e.apiKey,passphrase:e.passphrase,secret:e.secret})),Qe=z.object({apiKeys:z.array(M)}),er=z.object({key:M,secret:z.string(),passphrase:z.string()}),L=z.object({key:M,createdAt:Y$1.optional(),revokedAt:Y$1.nullable().optional()}),rr=z.array(z.union([M.transform(e=>({key:e})),L])).transform(e=>e.map(t=>L.parse(t)));var se=z.union([z.union([z.number().int(),z.string().regex(/^\d+$/).transform(Number)]).transform(e=>u(new Date(e<1e12?e*1e3:e).toISOString())),z.string().transform(u)]),ne=z.object({id:z.string(),tradeType:z.string(),takerOrderHash:z.string(),builder:z.string(),market:z.string(),assetId:qa,side:ka,size:ta,sizeUsdc:ta,price:ta,status:z.string(),outcome:z.string(),outcomeIndex:z.number().int(),owner:z.string(),maker:z.string(),transactionHash:z.string(),matchTime:se,bucketIndex:z.number().int(),fee:ta,feeUsdc:ta,err_msg:z.string().nullable().optional(),createdAt:Y$1.optional(),updatedAt:Y$1.optional()}).transform(({err_msg:e,assetId:t,matchTime:a,...s})=>({...s,tokenId:t,errMsg:e,matchedAt:a})),sr=z.object({limit:z.number().int(),count:z.number().int(),next_cursor:z.string(),data:z.array(ne)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e})),B=1e4,ie=z.object({builder_maker_fee_rate_bps:z.number(),builder_taker_fee_rate_bps:z.number()}).transform(({builder_maker_fee_rate_bps:e,builder_taker_fee_rate_bps:t})=>({maker:e/B,taker:t/B})),nr=ie;var pr=z.object({canceled:z.array(z.string()),not_canceled:z.record(z.string(),z.string())}).transform(({canceled:e,not_canceled:t})=>({canceled:e,notCanceled:t}));var j=(d=>(d.MAX="max",d.ONE_WEEK="1w",d.ONE_DAY="1d",d.SIX_HOURS="6h",d.ONE_HOUR="1h",d))(j||{}),Sr=z.enum(j),hr=z.object({mid:ta}),yr=z.record(z.string(),ta),gr=z.object({price:ta}),ce=z.record(ka,ta.optional()),lr=z.record(z.string(),ce),ur=z.object({spread:ta}),xr=z.record(z.string(),ta),_r=z.object({price:ta,side:ka}),pe=z.object({price:ta,side:ka,token_id:qa}).transform(({token_id:e,price:t,side:a})=>({tokenId:e,price:t,side:a}));z.object({tokenId:qa,price:ta,side:ka});var kr=z.array(pe),de=z.object({t:z.number().int(),p:z.number()}),Or=z.object({history:z.array(de)}),me=z.object({condition_id:Q$1}).transform(({condition_id:e})=>e),br=me,fe=z.object({r:z.number().default(0),e:z.number().default(0)}).transform(({r:e,e:t})=>({rate:e,exponent:t})),Se=z.object({t:qa,o:z.string()}).transform(({t:e,o:t})=>({tokenId:e,outcome:t})),he=z.object({fd:fe.nullish(),t:z.array(Se)}).transform(({fd:e,t})=>({feeInfo:e??{rate:0,exponent:0},tokens:t})),Tr=he;var ye=z.object({neg_risk:z.boolean()}).transform(({neg_risk:e,...t})=>({...t,negRisk:e})),Ir=ye;var U=z.object({price:ta,size:ta}),K=z.object({market:z.string(),asset_id:qa,timestamp:V$1.nullish(),bids:z.array(U),asks:z.array(U),min_order_size:ta,tick_size:ta,neg_risk:z.boolean(),last_trade_price:ta.nullish(),hash:z.string()}).transform(({asset_id:e,min_order_size:t,tick_size:a,neg_risk:s,last_trade_price:n,...d})=>({...d,tokenId:e,minOrderSize:t,tickSize:a,negRisk:s,lastTradePrice:n})),Pr=K,Dr=z.array(K);var H=z.object({errorMsg:z.string(),makingAmount:ta,orderID:z.string(),status:z.string(),success:z.boolean(),takingAmount:ta,tradeIDs:z.array(z.string()).default([]),transactionsHashes:z.array(z.string()).default([])}),jr=z.array(H),v=(s=>(s.LIVE="live",s.MATCHED="matched",s.DELAYED="delayed",s))(v||{}),le=z.nativeEnum(v),Y=(h=>(h.UNMATCHED="unmatched",h.MARKET_NOT_READY="market_not_ready",h.INSUFFICIENT_BALANCE_OR_ALLOWANCE="insufficient_balance_or_allowance",h.INVALID_NONCE="invalid_nonce",h.INVALID_EXPIRATION="invalid_expiration",h.POST_ONLY_WOULD_CROSS="post_only_would_cross",h.FOK_NOT_FILLED="fok_not_filled",h.FAK_NOT_FILLED="fak_not_filled",h.UNKNOWN="unknown",h))(Y||{}),ue=z.nativeEnum(Y),xe=z.object({ok:z.literal(true),orderId:z.string().min(1),status:le,makingAmount:ta,takingAmount:ta,tradeIds:z.array(z.string()),transactionsHashes:z.array(sa)}),_e=z.object({ok:z.literal(false),code:ue,message:z.string().min(1)}),Re=H.transform(be),Fr=z.array(Re);function ke(e){return e.success&&e.errorMsg===""&&e.orderID!==""&&ze(e.status)}function Oe(e){switch(e){case "live":return "live";case "matched":return "matched";case "delayed":return "delayed";default:never(`Unexpected order post status: ${e}`);}}function be(e){return ke(e)?xe.parse({makingAmount:e.makingAmount,ok:true,orderId:e.orderID,status:Oe(e.status),takingAmount:e.takingAmount,tradeIds:e.tradeIDs,transactionsHashes:e.transactionsHashes}):_e.parse({code:Te(e),message:e.errorMsg||"Unknown order failure",ok:false})}function Te(e){if(e.status==="unmatched")return "unmatched";switch(e.errorMsg){case "the market is not yet ready to process new orders":return "market_not_ready";case "invalid nonce":return "invalid_nonce";case "invalid expiration":return "invalid_expiration";case "invalid post-only order: order crosses book":return "post_only_would_cross";case "order couldn't be fully filled. FOK orders are fully filled or killed.":return "fok_not_filled";case "no orders found to match with FAK order. FAK orders are partially filled or killed if no match is found.":return "fak_not_filled"}return e.errorMsg.includes("not enough balance / allowance")?"insufficient_balance_or_allowance":"unknown"}function ze(e){return e==="live"||e==="matched"||e==="delayed"}var Kr="LTE=";var Ae=z.object({id:z.number().int().optional(),asset_address:z.string(),start_date:Y$1,end_date:Y$1.optional(),rate_per_day:ua,total_rewards:ua.optional()}).transform(({asset_address:e,start_date:t,end_date:a,rate_per_day:s,total_rewards:n,...d})=>({...d,assetAddress:e,startDate:t,endDate:a,ratePerDay:s,totalRewards:n})),Ie=z.object({condition_id:Q$1,rewards_max_spread:z.number().optional(),rewards_min_size:ua.optional(),rewards_config:z.array(Ae).optional(),sponsored_daily_rate:ua.optional(),sponsors_count:z.number().int().optional(),native_daily_rate:ua.optional(),total_daily_rate:ua.optional()}).transform(({condition_id:e,rewards_max_spread:t,rewards_min_size:a,rewards_config:s,sponsored_daily_rate:n,sponsors_count:d,native_daily_rate:l,total_daily_rate:u,...R})=>({...R,conditionId:e,rewardsMaxSpread:t,rewardsMinSize:a,rewardsConfig:s,sponsoredDailyRate:n,sponsorsCount:d,nativeDailyRate:l,totalDailyRate:u})),Vr=z.object({limit:z.number().int(),count:z.number().int(),next_cursor:z.string(),data:z.array(Ie)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e})),we=z.object({token_id:qa,outcome:z.string(),price:ua}).transform(({token_id:e,...t})=>({...t,tokenId:e})),Ee=z.object({asset_address:z.string(),start_date:Y$1,end_date:Y$1.optional(),rate_per_day:ua,total_rewards:ua.optional()}).transform(({asset_address:e,start_date:t,end_date:a,rate_per_day:s,total_rewards:n,...d})=>({...d,assetAddress:e,startDate:t,endDate:a,ratePerDay:s,totalRewards:n})),Ce=z.object({condition_id:Q$1,question:z.string(),market_slug:z.string().optional(),event_slug:z.string().optional(),image:z.string().optional(),rewards_max_spread:z.number().optional(),rewards_min_size:ua.optional(),market_competitiveness:z.number().optional(),tokens:z.array(we),rewards_config:z.array(Ee).optional()}).transform(({condition_id:e,market_slug:t,event_slug:a,rewards_max_spread:s,rewards_min_size:n,market_competitiveness:d,rewards_config:l,...u})=>({...u,conditionId:e,marketSlug:t,eventSlug:a,rewardsMaxSpread:s,rewardsMinSize:n,marketCompetitiveness:d,rewardsConfig:l})),Wr=z.object({limit:z.number().int(),count:z.number().int(),next_cursor:z.string(),data:z.array(Ce)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e}));var V=(n=>(n[n.EOA=0]="EOA",n[n.POLY_PROXY=1]="POLY_PROXY",n[n.POLY_GNOSIS_SAFE=2]="POLY_GNOSIS_SAFE",n[n.POLY_1271=3]="POLY_1271",n))(V||{}),qr=z.enum(V);var Me=z.object({minimum_tick_size:$$1}).transform(({minimum_tick_size:e,...t})=>({...t,minimumTickSize:e})),Qr=Me;export{xe as AcceptedOrderResponseSchema,Je as ApiKeyCredsSchema,Qe as ApiKeysResponseSchema,N as AssetType,Ke as AssetTypeSchema,He as BalanceAllowanceResponseSchema,er as BuilderApiKeyCredsSchema,L as BuilderApiKeySchema,rr as BuilderApiKeysResponseSchema,ie as BuilderFeeRatesSchema,ne as BuilderTradeSchema,pr as CancelOrdersResponseSchema,q as ClobTradeSchema,Fe as ClobTradesPageSchema,Be as ClosedOnlyModeSchema,me as ConditionByTokenSchema,Ie as CurrentRewardSchema,Kr as END_CURSOR,te as EarningSchema,nr as FetchBuilderFeeRatesResponseSchema,Tr as FetchMarketInfoResponseSchema,Ir as FetchNegRiskResponseSchema,Pr as FetchOrderBookResponseSchema,Qr as FetchTickSizeResponseSchema,_r as LastTradePriceSchema,kr as LastTradePricesSchema,$ as MakerOrderSchema,fe as MarketFeeInfoSchema,he as MarketInfoSchema,Ce as MarketRewardSchema,Se as MarketTokenSchema,hr as MidpointSchema,yr as MidpointsSchema,ye as NegRiskSchema,Z as NotificationSchema,Ue as NotificationsResponseSchema,X as OpenOrderSchema,je as OpenOrdersPageSchema,U as OrderBookLevelSchema,K as OrderBookSchema,Dr as OrderBooksSchema,v as OrderPostStatus,le as OrderPostStatusSchema,Y as OrderResponseErrorCode,ue as OrderResponseErrorCodeSchema,Re as OrderResponseSchema,Fr as OrderResponsesSchema,ve as OrderScoringResponseSchema,Ye as OrdersScoringResponseSchema,sr as PaginatedBuilderTradesSchema,Vr as PaginatedCurrentRewardsSchema,Wr as PaginatedMarketRewardsSchema,j as PriceHistoryInterval,Sr as PriceHistoryIntervalSchema,Or as PriceHistorySchema,gr as PriceSchema,lr as PricesSchema,ae as RawApiKeyCredsSchema,H as RawOrderResponseSchema,jr as RawOrderResponsesSchema,_e as RejectedOrderResponseSchema,br as ResolveConditionByTokenResponseSchema,re as RewardsConfigSchema,Xe as RewardsPercentagesSchema,V as SignatureType,qr as SignatureTypeSchema,ur as SpreadSchema,xr as SpreadsSchema,Me as TickSizeSchema,ee as TokenSchema,Q as TotalUserEarningSchema,We as TotalUserEarningsResponseSchema,J as UserEarningSchema,Ve as UserEarningsPageSchema,oe as UserRewardsEarningSchema,$e as UserRewardsEarningsPageSchema};//# sourceMappingURL=index.js.map
|
|
1
|
+
export{a as SignatureType,b as SignatureTypeSchema}from'../chunk-HOD4LKZU.js';import {Ha,ha,ga,Ea,ea,aa,sa,Ka,$ as $$1,Ia,X as X$1,S,ua,ca,Ga,ja}from'../chunk-IHJYHHWK.js';import {z as z$1}from'zod';import {never}from'@polymarket/types';function z(e){return z$1.object({count:z$1.number(),data:z$1.array(e),limit:z$1.number(),next_cursor:z$1.string()}).transform(({next_cursor:t,...a})=>({...a,nextCursor:t}))}var Ne=z$1.object({closed_only:z$1.boolean()}).transform(({closed_only:e})=>({closedOnly:e})),W=z$1.object({asset_id:Ea,associate_trades:z$1.array(z$1.string()),created_at:ga,expiration:ha,id:z$1.string(),maker_address:z$1.string(),market:z$1.string(),order_type:z$1.string(),original_size:Ha,outcome:z$1.string(),owner:z$1.string(),price:Ha,side:z$1.string(),size_matched:Ha,status:z$1.string()}).transform(({asset_id:e,associate_trades:t,created_at:a,expiration:s,maker_address:f,order_type:c,original_size:u,size_matched:x,...k})=>{let h={...k,tokenId:e,associateTrades:t,createdAt:a,makerAddress:f,orderType:c,originalSize:u,sizeMatched:x};return s===void 0?h:{...h,expiresAt:s}}),je=z(W),X=z$1.object({asset_id:Ea,fee_rate_bps:Ha,maker_address:z$1.string(),matched_amount:Ha,order_id:z$1.string(),outcome:z$1.string(),owner:z$1.string(),price:Ha,side:z$1.string()}).transform(({asset_id:e,fee_rate_bps:t,maker_address:a,matched_amount:s,order_id:f,...c})=>({...c,tokenId:e,feeRateBps:t,makerAddress:a,matchedAmount:s,orderId:f})),Z=z$1.object({asset_id:Ea,bucket_index:z$1.number(),fee_rate_bps:Ha,id:z$1.string(),last_update:ea,maker_address:z$1.string(),maker_orders:z$1.array(X),market:z$1.string(),match_time:ea,outcome:z$1.string(),owner:z$1.string(),price:Ha,side:z$1.string(),size:Ha,status:z$1.string(),taker_order_id:z$1.string(),trader_side:z$1.enum(["TAKER","MAKER"]),transaction_hash:z$1.string()}).transform(({asset_id:e,bucket_index:t,fee_rate_bps:a,last_update:s,maker_address:f,maker_orders:c,match_time:u,taker_order_id:x,trader_side:k,transaction_hash:h,...Y})=>({...Y,tokenId:e,bucketIndex:t,feeRateBps:a,updatedAt:s,makerAddress:f,makerOrders:c,matchedAt:u,takerOrderId:x,traderSide:k,transactionHash:h})),Fe=z(Z),$=z$1.preprocess(e=>typeof e!="string"?e:/^\d+$/.test(e)?Number(e):Date.parse(e),aa),q=z$1.object({id:sa,owner:z$1.string(),payload:z$1.unknown(),timestamp:$,type:z$1.number()}),Ue=z$1.array(q),M=(a=>(a.COLLATERAL="COLLATERAL",a.CONDITIONAL="CONDITIONAL",a))(M||{}),Ke=z$1.enum(M),He=z$1.object({allowances:z$1.record($$1,z$1.string().transform(BigInt)),balance:Ka}),ve=z$1.object({scoring:z$1.boolean()}),Ve=z$1.record(z$1.string(),z$1.boolean()),G=z$1.object({asset_address:z$1.string(),asset_rate:Ia,condition_id:X$1,date:ga,earnings:Ia,maker_address:z$1.string()}).transform(({asset_address:e,asset_rate:t,condition_id:a,maker_address:s,...f})=>({...f,assetAddress:e,assetRate:t,conditionId:a,makerAddress:s})),Ye=z(G),J=z$1.object({asset_address:z$1.string(),asset_rate:Ia,date:ga,earnings:Ia,maker_address:z$1.string()}).transform(({asset_address:e,asset_rate:t,maker_address:a,...s})=>({...s,assetAddress:e,assetRate:t,makerAddress:a})),We=z$1.array(J),Xe=z$1.record(X$1,z$1.number()),Q=z$1.object({outcome:z$1.string(),price:Ia,token_id:Ea}).transform(({token_id:e,...t})=>({...t,tokenId:e})),ee=z$1.object({asset_address:z$1.string(),end_date:ga,rate_per_day:Ia,start_date:ga,total_rewards:Ia}).transform(({asset_address:e,end_date:t,rate_per_day:a,start_date:s,total_rewards:f})=>({assetAddress:e,endDate:t,ratePerDay:a,startDate:s,totalRewards:f})),re=z$1.object({asset_address:z$1.string(),asset_rate:Ia,earnings:Ia}).transform(({asset_address:e,asset_rate:t,...a})=>({...a,assetAddress:e,assetRate:t})),te=z$1.object({condition_id:X$1,earning_percentage:z$1.number(),earnings:z$1.array(re),event_slug:z$1.string(),image:z$1.string(),maker_address:z$1.string(),market_competitiveness:z$1.number(),market_slug:z$1.string(),question:z$1.string(),rewards_config:z$1.array(ee),rewards_max_spread:z$1.number(),rewards_min_size:Ia,tokens:z$1.array(Q)}).transform(({condition_id:e,earning_percentage:t,event_slug:a,maker_address:s,market_competitiveness:f,market_slug:c,rewards_config:u,rewards_max_spread:x,rewards_min_size:k,...h})=>({...h,conditionId:e,earningPercentage:t,eventSlug:a,makerAddress:s,marketCompetitiveness:f,marketSlug:c,rewardsConfig:u,rewardsMaxSpread:x,rewardsMinSize:k})),Ze=z(te);var oe=z$1.object({apiKey:S,secret:z$1.string(),passphrase:z$1.string()}),Je=oe.transform(e=>({key:e.apiKey,passphrase:e.passphrase,secret:e.secret})),Qe=z$1.object({apiKeys:z$1.array(S)}),er=z$1.object({key:S,secret:z$1.string(),passphrase:z$1.string()}),L=z$1.object({key:S,createdAt:ga.optional(),revokedAt:ga.nullable().optional()}),rr=z$1.array(z$1.union([S.transform(e=>({key:e})),L])).transform(e=>e.map(t=>L.parse(t)));var ae=z$1.object({id:z$1.string(),tradeType:z$1.string(),takerOrderHash:z$1.string(),builder:z$1.string(),market:z$1.string(),assetId:Ea,side:ua,size:Ha,sizeUsdc:Ha,price:Ha,status:z$1.string(),outcome:z$1.string(),outcomeIndex:z$1.number().int(),owner:z$1.string(),maker:z$1.string(),transactionHash:z$1.string(),matchTime:ea,bucketIndex:z$1.number().int(),fee:Ha,feeUsdc:Ha,err_msg:z$1.string().nullable().optional(),createdAt:ga.optional(),updatedAt:ga.optional()}).transform(({err_msg:e,assetId:t,matchTime:a,...s})=>({...s,tokenId:t,errMsg:e,matchedAt:a})),sr=z$1.object({limit:z$1.number().int(),count:z$1.number().int(),next_cursor:z$1.string(),data:z$1.array(ae)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e})),N=1e4,se=z$1.object({builder_maker_fee_rate_bps:z$1.number(),builder_taker_fee_rate_bps:z$1.number()}).transform(({builder_maker_fee_rate_bps:e,builder_taker_fee_rate_bps:t})=>({maker:e/N,taker:t/N})),nr=se;var dr=z$1.object({canceled:z$1.array(z$1.string()),not_canceled:z$1.record(z$1.string(),z$1.string())}).transform(({canceled:e,not_canceled:t})=>({canceled:e,notCanceled:t}));var j=(c=>(c.MAX="max",c.ONE_WEEK="1w",c.ONE_DAY="1d",c.SIX_HOURS="6h",c.ONE_HOUR="1h",c))(j||{}),Sr=z$1.enum(j),hr=z$1.object({mid:Ha}),lr=z$1.record(z$1.string(),Ha),yr=z$1.object({price:Ha}),ne=z$1.record(ua,Ha.optional()),gr=z$1.record(z$1.string(),ne),ur=z$1.object({spread:Ha}),xr=z$1.record(z$1.string(),Ha),kr=z$1.object({price:Ha,side:ua}),ie=z$1.object({price:Ha,side:ua,token_id:Ea}).transform(({token_id:e,price:t,side:a})=>({tokenId:e,price:t,side:a}));z$1.object({tokenId:Ea,price:Ha,side:ua});var Rr=z$1.array(ie),ce=z$1.object({t:z$1.number().int(),p:z$1.number()}),Or=z$1.object({history:z$1.array(ce)}),de=z$1.object({condition_id:X$1}).transform(({condition_id:e})=>e),Tr=de,pe=z$1.object({r:z$1.number().default(0),e:z$1.number().default(0)}).transform(({r:e,e:t})=>({rate:e,exponent:t})),me=z$1.object({t:Ea,o:z$1.string()}).transform(({t:e,o:t})=>({tokenId:e,outcome:t})),fe=z$1.object({fd:pe.nullish(),t:z$1.array(me)}).transform(({fd:e,t})=>({feeInfo:e??{rate:0,exponent:0},tokens:t})),br=fe;var Se=z$1.object({neg_risk:z$1.boolean()}).transform(({neg_risk:e,...t})=>({...t,negRisk:e})),Ir=Se;var U=z$1.object({price:Ha,size:Ha}),he=z$1.string().regex(/^[a-f0-9]{40}$/).transform(e=>e),K=z$1.object({market:X$1,asset_id:Ea,timestamp:ca.nullish(),bids:z$1.array(U),asks:z$1.array(U),min_order_size:Ha,tick_size:Ha,neg_risk:z$1.boolean(),last_trade_price:Ha.nullish(),hash:he}).transform(({asset_id:e,min_order_size:t,tick_size:a,neg_risk:s,last_trade_price:f,...c})=>({...c,tokenId:e,minOrderSize:t,tickSize:a,negRisk:s,lastTradePrice:f})),Pr=K,Dr=z$1.array(K);var H=z$1.object({errorMsg:z$1.string(),makingAmount:Ha,orderID:z$1.string(),status:z$1.string(),success:z$1.boolean(),takingAmount:Ha,tradeIDs:z$1.array(z$1.string()).default([]),transactionsHashes:z$1.array(z$1.string()).default([])}),jr=z$1.array(H),v=(s=>(s.LIVE="live",s.MATCHED="matched",s.DELAYED="delayed",s))(v||{}),ye=z$1.nativeEnum(v),V=(h=>(h.UNMATCHED="unmatched",h.MARKET_NOT_READY="market_not_ready",h.INSUFFICIENT_BALANCE_OR_ALLOWANCE="insufficient_balance_or_allowance",h.INVALID_NONCE="invalid_nonce",h.INVALID_EXPIRATION="invalid_expiration",h.POST_ONLY_WOULD_CROSS="post_only_would_cross",h.FOK_NOT_FILLED="fok_not_filled",h.FAK_NOT_FILLED="fak_not_filled",h.UNKNOWN="unknown",h))(V||{}),ge=z$1.nativeEnum(V),ue=z$1.object({ok:z$1.literal(true),orderId:z$1.string().min(1),status:ye,makingAmount:Ha,takingAmount:Ha,tradeIds:z$1.array(z$1.string()),transactionsHashes:z$1.array(Ga)}),xe=z$1.object({ok:z$1.literal(false),code:ge,message:z$1.string().min(1)}),ke=H.transform(Oe),Fr=z$1.array(ke);function _e(e){return e.success&&e.errorMsg===""&&e.orderID!==""&&be(e.status)}function Re(e){switch(e){case "live":return "live";case "matched":return "matched";case "delayed":return "delayed";default:never(`Unexpected order post status: ${e}`);}}function Oe(e){return _e(e)?ue.parse({makingAmount:e.makingAmount,ok:true,orderId:e.orderID,status:Re(e.status),takingAmount:e.takingAmount,tradeIds:e.tradeIDs,transactionsHashes:e.transactionsHashes}):xe.parse({code:Te(e),message:e.errorMsg||"Unknown order failure",ok:false})}function Te(e){if(e.status==="unmatched")return "unmatched";switch(e.errorMsg){case "the market is not yet ready to process new orders":return "market_not_ready";case "invalid nonce":return "invalid_nonce";case "invalid expiration":return "invalid_expiration";case "invalid post-only order: order crosses book":return "post_only_would_cross";case "order couldn't be fully filled. FOK orders are fully filled or killed.":return "fok_not_filled";case "no orders found to match with FAK order. FAK orders are partially filled or killed if no match is found.":return "fak_not_filled"}return e.errorMsg.includes("not enough balance / allowance")?"insufficient_balance_or_allowance":"unknown"}function be(e){return e==="live"||e==="matched"||e==="delayed"}var Kr="LTE=";var ze=z$1.object({id:z$1.number().int().optional(),asset_address:z$1.string(),start_date:ga,end_date:ga.optional(),rate_per_day:Ia,total_rewards:Ia.optional()}).transform(({asset_address:e,start_date:t,end_date:a,rate_per_day:s,total_rewards:f,...c})=>({...c,assetAddress:e,startDate:t,endDate:a,ratePerDay:s,totalRewards:f})),Ae=z$1.object({condition_id:X$1,rewards_max_spread:z$1.number().optional(),rewards_min_size:Ia.optional(),rewards_config:z$1.array(ze).optional(),sponsored_daily_rate:Ia.optional(),sponsors_count:z$1.number().int().optional(),native_daily_rate:Ia.optional(),total_daily_rate:Ia.optional()}).transform(({condition_id:e,rewards_max_spread:t,rewards_min_size:a,rewards_config:s,sponsored_daily_rate:f,sponsors_count:c,native_daily_rate:u,total_daily_rate:x,...k})=>({...k,conditionId:e,rewardsMaxSpread:t,rewardsMinSize:a,rewardsConfig:s,sponsoredDailyRate:f,sponsorsCount:c,nativeDailyRate:u,totalDailyRate:x})),Yr=z$1.object({limit:z$1.number().int(),count:z$1.number().int(),next_cursor:z$1.string(),data:z$1.array(Ae)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e})),Ie=z$1.object({token_id:Ea,outcome:z$1.string(),price:Ia}).transform(({token_id:e,...t})=>({...t,tokenId:e})),Ce=z$1.object({asset_address:z$1.string(),start_date:ga,end_date:ga.optional(),rate_per_day:Ia,total_rewards:Ia.optional()}).transform(({asset_address:e,start_date:t,end_date:a,rate_per_day:s,total_rewards:f,...c})=>({...c,assetAddress:e,startDate:t,endDate:a,ratePerDay:s,totalRewards:f})),Ee=z$1.object({condition_id:X$1,question:z$1.string(),market_slug:z$1.string().optional(),event_slug:z$1.string().optional(),image:z$1.string().optional(),rewards_max_spread:z$1.number().optional(),rewards_min_size:Ia.optional(),market_competitiveness:z$1.number().optional(),tokens:z$1.array(Ie),rewards_config:z$1.array(Ce).optional()}).transform(({condition_id:e,market_slug:t,event_slug:a,rewards_max_spread:s,rewards_min_size:f,market_competitiveness:c,rewards_config:u,...x})=>({...x,conditionId:e,marketSlug:t,eventSlug:a,rewardsMaxSpread:s,rewardsMinSize:f,marketCompetitiveness:c,rewardsConfig:u})),Wr=z$1.object({limit:z$1.number().int(),count:z$1.number().int(),next_cursor:z$1.string(),data:z$1.array(Ee)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e}));var Pe=z$1.object({minimum_tick_size:ja}).transform(({minimum_tick_size:e,...t})=>({...t,minimumTickSize:e})),qr=Pe;export{ue as AcceptedOrderResponseSchema,Je as ApiKeyCredsSchema,Qe as ApiKeysResponseSchema,M as AssetType,Ke as AssetTypeSchema,He as BalanceAllowanceResponseSchema,er as BuilderApiKeyCredsSchema,L as BuilderApiKeySchema,rr as BuilderApiKeysResponseSchema,se as BuilderFeeRatesSchema,ae as BuilderTradeSchema,dr as CancelOrdersResponseSchema,Z as ClobTradeSchema,Fe as ClobTradesPageSchema,Ne as ClosedOnlyModeSchema,de as ConditionByTokenSchema,Ae as CurrentRewardSchema,Kr as END_CURSOR,re as EarningSchema,nr as FetchBuilderFeeRatesResponseSchema,br as FetchMarketInfoResponseSchema,Ir as FetchNegRiskResponseSchema,Pr as FetchOrderBookResponseSchema,qr as FetchTickSizeResponseSchema,kr as LastTradePriceSchema,Rr as LastTradePricesSchema,X as MakerOrderSchema,pe as MarketFeeInfoSchema,fe as MarketInfoSchema,Ee as MarketRewardSchema,me as MarketTokenSchema,hr as MidpointSchema,lr as MidpointsSchema,Se as NegRiskSchema,q as NotificationSchema,Ue as NotificationsResponseSchema,W as OpenOrderSchema,je as OpenOrdersPageSchema,he as OrderBookHashSchema,U as OrderBookLevelSchema,K as OrderBookSchema,Dr as OrderBooksSchema,v as OrderPostStatus,ye as OrderPostStatusSchema,V as OrderResponseErrorCode,ge as OrderResponseErrorCodeSchema,ke as OrderResponseSchema,Fr as OrderResponsesSchema,ve as OrderScoringResponseSchema,Ve as OrdersScoringResponseSchema,sr as PaginatedBuilderTradesSchema,Yr as PaginatedCurrentRewardsSchema,Wr as PaginatedMarketRewardsSchema,j as PriceHistoryInterval,Sr as PriceHistoryIntervalSchema,Or as PriceHistorySchema,yr as PriceSchema,gr as PricesSchema,oe as RawApiKeyCredsSchema,H as RawOrderResponseSchema,jr as RawOrderResponsesSchema,xe as RejectedOrderResponseSchema,Tr as ResolveConditionByTokenResponseSchema,ee as RewardsConfigSchema,Xe as RewardsPercentagesSchema,ur as SpreadSchema,xr as SpreadsSchema,Pe as TickSizeSchema,Q as TokenSchema,J as TotalUserEarningSchema,We as TotalUserEarningsResponseSchema,G as UserEarningSchema,Ye as UserEarningsPageSchema,te as UserRewardsEarningSchema,Ze as UserRewardsEarningsPageSchema};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|