@polymarket/bindings 0.3.0-beta.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/clob/index.d.ts +25 -13
- package/dist/clob/index.js +1 -1
- package/dist/clob/index.js.map +1 -1
- package/package.json +1 -1
package/dist/clob/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _polymarket_types from '@polymarket/types';
|
|
2
2
|
import { TxHash } from '@polymarket/types';
|
|
3
|
-
import { BaseUnits, CtfConditionId, TokenId, DecimalString, IsoDateTimeString, TradeStatus, NotificationId, EpochMilliseconds, ApiKey, OrderSide, OrderId } from '../index.js';
|
|
3
|
+
import { BaseUnits, CtfConditionId, TokenId, DecimalString, IsoDateTimeString, TradeStatus, NotificationId, EpochMilliseconds, ApiKey, OrderSide, OrderId, TickSizeValue } from '../index.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
export { S as SignatureType, a as SignatureTypeSchema } from '../signature-type-CrLAA9AN.js';
|
|
6
6
|
|
|
@@ -1521,6 +1521,8 @@ declare const MarketInfoSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1521
1521
|
r: number;
|
|
1522
1522
|
e: number;
|
|
1523
1523
|
}>>>>;
|
|
1524
|
+
mts: z.ZodUnion<readonly [z.ZodLiteral<0.1>, z.ZodLiteral<0.01>, z.ZodLiteral<0.005>, z.ZodLiteral<0.0025>, z.ZodLiteral<0.001>, z.ZodLiteral<0.0001>]>;
|
|
1525
|
+
nr: z.ZodOptional<z.ZodBoolean>;
|
|
1524
1526
|
t: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
1525
1527
|
t: z.ZodPipe<z.ZodString, z.ZodTransform<TokenId, string>>;
|
|
1526
1528
|
o: z.ZodString;
|
|
@@ -1536,11 +1538,14 @@ declare const MarketInfoSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1536
1538
|
rate: number;
|
|
1537
1539
|
exponent: number;
|
|
1538
1540
|
};
|
|
1541
|
+
negRisk: boolean;
|
|
1542
|
+
tickSize: 0.1 | 0.01 | 0.005 | 0.0025 | 0.001 | 0.0001;
|
|
1539
1543
|
tokens: {
|
|
1540
1544
|
tokenId: TokenId;
|
|
1541
1545
|
outcome: string;
|
|
1542
1546
|
}[];
|
|
1543
1547
|
}, {
|
|
1548
|
+
mts: 0.1 | 0.01 | 0.005 | 0.0025 | 0.001 | 0.0001;
|
|
1544
1549
|
t: {
|
|
1545
1550
|
tokenId: TokenId;
|
|
1546
1551
|
outcome: string;
|
|
@@ -1549,6 +1554,7 @@ declare const MarketInfoSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1549
1554
|
rate: number;
|
|
1550
1555
|
exponent: number;
|
|
1551
1556
|
} | null | undefined;
|
|
1557
|
+
nr?: boolean | undefined;
|
|
1552
1558
|
}>>;
|
|
1553
1559
|
declare const FetchMarketInfoResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
1554
1560
|
fd: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
|
|
@@ -1561,6 +1567,8 @@ declare const FetchMarketInfoResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1561
1567
|
r: number;
|
|
1562
1568
|
e: number;
|
|
1563
1569
|
}>>>>;
|
|
1570
|
+
mts: z.ZodUnion<readonly [z.ZodLiteral<0.1>, z.ZodLiteral<0.01>, z.ZodLiteral<0.005>, z.ZodLiteral<0.0025>, z.ZodLiteral<0.001>, z.ZodLiteral<0.0001>]>;
|
|
1571
|
+
nr: z.ZodOptional<z.ZodBoolean>;
|
|
1564
1572
|
t: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
1565
1573
|
t: z.ZodPipe<z.ZodString, z.ZodTransform<TokenId, string>>;
|
|
1566
1574
|
o: z.ZodString;
|
|
@@ -1576,11 +1584,14 @@ declare const FetchMarketInfoResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1576
1584
|
rate: number;
|
|
1577
1585
|
exponent: number;
|
|
1578
1586
|
};
|
|
1587
|
+
negRisk: boolean;
|
|
1588
|
+
tickSize: 0.1 | 0.01 | 0.005 | 0.0025 | 0.001 | 0.0001;
|
|
1579
1589
|
tokens: {
|
|
1580
1590
|
tokenId: TokenId;
|
|
1581
1591
|
outcome: string;
|
|
1582
1592
|
}[];
|
|
1583
1593
|
}, {
|
|
1594
|
+
mts: 0.1 | 0.01 | 0.005 | 0.0025 | 0.001 | 0.0001;
|
|
1584
1595
|
t: {
|
|
1585
1596
|
tokenId: TokenId;
|
|
1586
1597
|
outcome: string;
|
|
@@ -1589,6 +1600,7 @@ declare const FetchMarketInfoResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1589
1600
|
rate: number;
|
|
1590
1601
|
exponent: number;
|
|
1591
1602
|
} | null | undefined;
|
|
1603
|
+
nr?: boolean | undefined;
|
|
1592
1604
|
}>>;
|
|
1593
1605
|
type MarketFeeInfo = z.infer<typeof MarketFeeInfoSchema>;
|
|
1594
1606
|
type MarketToken = z.infer<typeof MarketTokenSchema>;
|
|
@@ -1630,7 +1642,7 @@ type OrderBook = {
|
|
|
1630
1642
|
/** Ask levels in descending price order, highest ask first. */
|
|
1631
1643
|
asks: OrderBookLevel[];
|
|
1632
1644
|
minOrderSize: DecimalString;
|
|
1633
|
-
tickSize:
|
|
1645
|
+
tickSize: TickSizeValue;
|
|
1634
1646
|
negRisk: boolean;
|
|
1635
1647
|
lastTradePrice?: DecimalString | null;
|
|
1636
1648
|
hash: OrderBookHash;
|
|
@@ -1653,7 +1665,7 @@ declare const OrderBookSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1653
1665
|
size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1654
1666
|
}, z.core.$strip>>;
|
|
1655
1667
|
min_order_size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1656
|
-
tick_size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1668
|
+
tick_size: z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodTransform<number, DecimalString>>, z.ZodUnion<readonly [z.ZodLiteral<0.1>, z.ZodLiteral<0.01>, z.ZodLiteral<0.005>, z.ZodLiteral<0.0025>, z.ZodLiteral<0.001>, z.ZodLiteral<0.0001>]>>;
|
|
1657
1669
|
neg_risk: z.ZodBoolean;
|
|
1658
1670
|
last_trade_price: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
|
|
1659
1671
|
hash: z.ZodPipe<z.ZodString, z.ZodTransform<OrderBookHash, string>>;
|
|
@@ -1661,7 +1673,7 @@ declare const OrderBookSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1661
1673
|
conditionId: CtfConditionId;
|
|
1662
1674
|
tokenId: TokenId;
|
|
1663
1675
|
minOrderSize: DecimalString;
|
|
1664
|
-
tickSize:
|
|
1676
|
+
tickSize: 0.1 | 0.01 | 0.005 | 0.0025 | 0.001 | 0.0001;
|
|
1665
1677
|
negRisk: boolean;
|
|
1666
1678
|
lastTradePrice: DecimalString | null | undefined;
|
|
1667
1679
|
bids: {
|
|
@@ -1686,7 +1698,7 @@ declare const OrderBookSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1686
1698
|
size: DecimalString;
|
|
1687
1699
|
}[];
|
|
1688
1700
|
min_order_size: DecimalString;
|
|
1689
|
-
tick_size:
|
|
1701
|
+
tick_size: 0.1 | 0.01 | 0.005 | 0.0025 | 0.001 | 0.0001;
|
|
1690
1702
|
neg_risk: boolean;
|
|
1691
1703
|
hash: OrderBookHash;
|
|
1692
1704
|
timestamp?: EpochMilliseconds | null | undefined;
|
|
@@ -1705,7 +1717,7 @@ declare const FetchOrderBookResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1705
1717
|
size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1706
1718
|
}, z.core.$strip>>;
|
|
1707
1719
|
min_order_size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1708
|
-
tick_size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1720
|
+
tick_size: z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodTransform<number, DecimalString>>, z.ZodUnion<readonly [z.ZodLiteral<0.1>, z.ZodLiteral<0.01>, z.ZodLiteral<0.005>, z.ZodLiteral<0.0025>, z.ZodLiteral<0.001>, z.ZodLiteral<0.0001>]>>;
|
|
1709
1721
|
neg_risk: z.ZodBoolean;
|
|
1710
1722
|
last_trade_price: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
|
|
1711
1723
|
hash: z.ZodPipe<z.ZodString, z.ZodTransform<OrderBookHash, string>>;
|
|
@@ -1713,7 +1725,7 @@ declare const FetchOrderBookResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1713
1725
|
conditionId: CtfConditionId;
|
|
1714
1726
|
tokenId: TokenId;
|
|
1715
1727
|
minOrderSize: DecimalString;
|
|
1716
|
-
tickSize:
|
|
1728
|
+
tickSize: 0.1 | 0.01 | 0.005 | 0.0025 | 0.001 | 0.0001;
|
|
1717
1729
|
negRisk: boolean;
|
|
1718
1730
|
lastTradePrice: DecimalString | null | undefined;
|
|
1719
1731
|
bids: {
|
|
@@ -1738,7 +1750,7 @@ declare const FetchOrderBookResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1738
1750
|
size: DecimalString;
|
|
1739
1751
|
}[];
|
|
1740
1752
|
min_order_size: DecimalString;
|
|
1741
|
-
tick_size:
|
|
1753
|
+
tick_size: 0.1 | 0.01 | 0.005 | 0.0025 | 0.001 | 0.0001;
|
|
1742
1754
|
neg_risk: boolean;
|
|
1743
1755
|
hash: OrderBookHash;
|
|
1744
1756
|
timestamp?: EpochMilliseconds | null | undefined;
|
|
@@ -1757,7 +1769,7 @@ declare const OrderBooksSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
|
1757
1769
|
size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1758
1770
|
}, z.core.$strip>>;
|
|
1759
1771
|
min_order_size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1760
|
-
tick_size: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1772
|
+
tick_size: z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodTransform<number, DecimalString>>, z.ZodUnion<readonly [z.ZodLiteral<0.1>, z.ZodLiteral<0.01>, z.ZodLiteral<0.005>, z.ZodLiteral<0.0025>, z.ZodLiteral<0.001>, z.ZodLiteral<0.0001>]>>;
|
|
1761
1773
|
neg_risk: z.ZodBoolean;
|
|
1762
1774
|
last_trade_price: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>;
|
|
1763
1775
|
hash: z.ZodPipe<z.ZodString, z.ZodTransform<OrderBookHash, string>>;
|
|
@@ -1765,7 +1777,7 @@ declare const OrderBooksSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
|
1765
1777
|
conditionId: CtfConditionId;
|
|
1766
1778
|
tokenId: TokenId;
|
|
1767
1779
|
minOrderSize: DecimalString;
|
|
1768
|
-
tickSize:
|
|
1780
|
+
tickSize: 0.1 | 0.01 | 0.005 | 0.0025 | 0.001 | 0.0001;
|
|
1769
1781
|
negRisk: boolean;
|
|
1770
1782
|
lastTradePrice: DecimalString | null | undefined;
|
|
1771
1783
|
bids: {
|
|
@@ -1790,7 +1802,7 @@ declare const OrderBooksSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
|
1790
1802
|
size: DecimalString;
|
|
1791
1803
|
}[];
|
|
1792
1804
|
min_order_size: DecimalString;
|
|
1793
|
-
tick_size:
|
|
1805
|
+
tick_size: 0.1 | 0.01 | 0.005 | 0.0025 | 0.001 | 0.0001;
|
|
1794
1806
|
neg_risk: boolean;
|
|
1795
1807
|
hash: OrderBookHash;
|
|
1796
1808
|
timestamp?: EpochMilliseconds | null | undefined;
|
|
@@ -1829,7 +1841,7 @@ declare const OrderResponseErrorCodeSchema: z.ZodEnum<typeof OrderResponseErrorC
|
|
|
1829
1841
|
type AcceptedOrderResponse = {
|
|
1830
1842
|
ok: true;
|
|
1831
1843
|
/** Unique identifier of the placed order. */
|
|
1832
|
-
orderId:
|
|
1844
|
+
orderId: OrderId;
|
|
1833
1845
|
/** Placement outcome. Fills only exist when the status is `matched`. */
|
|
1834
1846
|
status: OrderPostStatus;
|
|
1835
1847
|
/** Amount of the maker asset committed by fills at placement. `'0'` when the order did not match. */
|
|
@@ -1870,7 +1882,7 @@ type OrderResponse = AcceptedOrderResponse | RejectedOrderResponse;
|
|
|
1870
1882
|
type OrderResponses = OrderResponse[];
|
|
1871
1883
|
declare const AcceptedOrderResponseSchema: z.ZodObject<{
|
|
1872
1884
|
ok: z.ZodLiteral<true>;
|
|
1873
|
-
orderId: z.ZodString
|
|
1885
|
+
orderId: z.ZodPipe<z.ZodString, z.ZodTransform<OrderId, string>>;
|
|
1874
1886
|
status: z.ZodEnum<typeof OrderPostStatus>;
|
|
1875
1887
|
makingAmount: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
1876
1888
|
takingAmount: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
package/dist/clob/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as SignatureType,b as SignatureTypeSchema}from'../chunk-HOD4LKZU.js';import {La,_,ha,fa,Ia,Qa,za,ba,ua,Pa,aa,Na,ia,U as U$1,xa,wa,da,Ka,la}from'../chunk-6TO35A2S.js';import {z}from'zod';import {never}from'@polymarket/types';function b(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 Ke=z.object({closed_only:z.boolean()}).transform(({closed_only:e})=>({closedOnly:e})),q=z.object({asset_id:Ia,associate_trades:z.array(z.string()),created_at:fa,expiration:ha,id:z.string(),maker_address:z.string(),market:_,order_type:z.string(),original_size:La,outcome:z.string(),owner:z.string(),price:La,side:z.string(),size_matched:La,status:z.string()}).transform(({asset_id:e,associate_trades:t,created_at:a,expiration:n,maker_address:d,market:c,order_type:y,original_size:k,size_matched:x,...l})=>{let I={...l,conditionId:c,tokenId:e,associateTrades:t,createdAt:a,makerAddress:d,orderType:y,originalSize:k,sizeMatched:x};return n===void 0?I:{...I,expiresAt:n}}),He=b(q),G=z.object({asset_id:Ia,fee_rate_bps:z.preprocess(Qa,La.nullable()),maker_address:z.string(),matched_amount:La,order_id:z.string(),outcome:z.string(),owner:z.string(),price:La,side:z.string()}).transform(({asset_id:e,fee_rate_bps:t,maker_address:a,matched_amount:n,order_id:d,...c})=>({...c,tokenId:e,feeRateBps:t,makerAddress:a,matchedAmount:n,orderId:d})),J=z.object({asset_id:Ia,bucket_index:z.number(),fee_rate_bps:La,id:z.string(),last_update:fa,maker_address:z.string(),maker_orders:z.array(G),market:_,match_time:fa,outcome:z.string(),owner:z.string(),price:La,side:z.string(),size:La,status:za,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:n,maker_address:d,maker_orders:c,market:y,match_time:k,taker_order_id:x,trader_side:l,transaction_hash:I,...$})=>({...$,conditionId:y,tokenId:e,bucketIndex:t,feeRateBps:a,updatedAt:n,makerAddress:d,makerOrders:c,matchedAt:k,takerOrderId:x,traderSide:l,transactionHash:I})),ve=b(J),Q=z.preprocess(e=>typeof e!="string"?e:/^\d+$/.test(e)?Number(e):Date.parse(e),ba),ee=z.object({id:ua,owner:z.string(),payload:z.unknown(),timestamp:Q,type:z.number()}),Ve=z.array(ee),F=(a=>(a.COLLATERAL="COLLATERAL",a.CONDITIONAL="CONDITIONAL",a))(F||{}),Ye=z.enum(F),We=z.object({allowances:z.record(aa,z.string().transform(BigInt)),balance:Pa}),Ze=z.object({scoring:z.boolean()}),Xe=z.record(z.string(),z.boolean()),re=z.object({asset_address:z.string(),asset_rate:Na,condition_id:_,date:ia,earnings:Na,maker_address:z.string()}).transform(({asset_address:e,asset_rate:t,condition_id:a,maker_address:n,...d})=>({...d,assetAddress:e,assetRate:t,conditionId:a,makerAddress:n})),$e=b(re),te=z.object({asset_address:z.string(),asset_rate:Na,date:ia,earnings:Na,maker_address:z.string()}).transform(({asset_address:e,asset_rate:t,maker_address:a,...n})=>({...n,assetAddress:e,assetRate:t,makerAddress:a})),qe=z.array(te),Ge=z.record(_,z.number()),oe=z.object({outcome:z.string(),price:Na,token_id:Ia}).transform(({token_id:e,...t})=>({...t,tokenId:e})),ae=z.object({asset_address:z.string(),end_date:ia,rate_per_day:Na,start_date:ia,total_rewards:Na}).transform(({asset_address:e,end_date:t,rate_per_day:a,start_date:n,total_rewards:d})=>({assetAddress:e,endDate:t,ratePerDay:a,startDate:n,totalRewards:d})),ne=z.object({asset_address:z.string(),asset_rate:Na,earnings:Na}).transform(({asset_address:e,asset_rate:t,...a})=>({...a,assetAddress:e,assetRate:t})),se=z.object({condition_id:_,earning_percentage:z.number(),earnings:z.array(ne),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(ae),rewards_max_spread:z.number(),rewards_min_size:Na,tokens:z.array(oe)}).transform(({condition_id:e,earning_percentage:t,event_slug:a,maker_address:n,market_competitiveness:d,market_slug:c,rewards_config:y,rewards_max_spread:k,rewards_min_size:x,...l})=>({...l,conditionId:e,earningPercentage:t,eventSlug:a,makerAddress:n,marketCompetitiveness:d,marketSlug:c,rewardsConfig:y,rewardsMaxSpread:k,rewardsMinSize:x})),Je=b(se);var tr=z.object({apiKey:U$1,secret:z.string(),passphrase:z.string()}).transform(e=>({key:e.apiKey,passphrase:e.passphrase,secret:e.secret})),or=z.object({apiKeys:z.array(U$1)}),ar=z.object({key:U$1,secret:z.string(),passphrase:z.string()}),U=z.object({key:U$1,createdAt:ia.optional(),revokedAt:ia.nullable().optional()}),nr=z.array(z.union([U$1.transform(e=>({key:e})),U])).transform(e=>e.map(t=>U.parse(t)));var ie=z.object({id:z.string(),tradeType:z.string(),takerOrderHash:z.string(),builder:z.string(),market:_,assetId:Ia,side:xa,size:La,sizeUsdc:La,price:La,status:z.string(),outcome:z.string(),outcomeIndex:z.number().int(),owner:z.string(),maker:z.string(),transactionHash:z.string(),matchTime:fa,bucketIndex:z.number().int(),fee:La,feeUsdc:La,err_msg:z.string().nullable().optional(),createdAt:ia.optional(),updatedAt:ia.optional()}).transform(({err_msg:e,assetId:t,market:a,matchTime:n,...d})=>({...d,conditionId:a,tokenId:t,errMsg:e,matchedAt:n})),cr=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})),K=1e4,de=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/K,taker:t/K})),pr=de;var gr=z.object({canceled:z.array(wa),not_canceled:z.record(wa,z.string())}).transform(({canceled:e,not_canceled:t})=>({canceled:e,notCanceled:t}));var H=(c=>(c.MAX="max",c.ONE_WEEK="1w",c.ONE_DAY="1d",c.SIX_HOURS="6h",c.ONE_HOUR="1h",c))(H||{}),ur=z.enum(H),kr=z.object({mid:La}),xr=z.record(Ia,La),_r=z.object({price:La}),ce=z.partialRecord(xa,La),Rr=z.record(Ia,ce),Tr=z.object({spread:La}),Or=z.record(Ia,La),Ir=z.object({price:La,side:xa}),pe=z.object({price:La,side:xa,token_id:Ia}).transform(({token_id:e,price:t,side:a})=>({tokenId:e,price:t,side:a}));z.object({tokenId:Ia,price:La,side:xa});var Ar=z.array(pe),me=z.object({t:z.number().int(),p:z.number()}),zr=z.object({history:z.array(me)}),Se=z.object({condition_id:_}).transform(({condition_id:e})=>e),Cr=Se,fe=z.object({r:z.number().default(0),e:z.number().default(0)}).transform(({r:e,e:t})=>({rate:e,exponent:t})),ge=z.object({t:Ia,o:z.string()}).transform(({t:e,o:t})=>({tokenId:e,outcome:t})),le=z.object({fd:fe.nullish(),t:z.array(ge)}).transform(({fd:e,t})=>({feeInfo:e??{rate:0,exponent:0},tokens:t})),Dr=le;var he=z.object({neg_risk:z.boolean()}).transform(({neg_risk:e,...t})=>({...t,negRisk:e})),wr=he;var V=z.object({price:La,size:La}),ye=z.string().regex(/^[a-f0-9]{40}$/).transform(e=>e),Y=z.object({market:_,asset_id:Ia,timestamp:da.nullish(),bids:z.array(V),asks:z.array(V),min_order_size:La,tick_size:La,neg_risk:z.boolean(),last_trade_price:La.nullish(),hash:ye}).transform(({market:e,asset_id:t,min_order_size:a,tick_size:n,neg_risk:d,last_trade_price:c,...y})=>({...y,conditionId:e,tokenId:t,minOrderSize:a,tickSize:n,negRisk:d,lastTradePrice:c})),Nr=Y,jr=z.array(Y);var W=z.preprocess(e=>e===""?"0":e,La),ke=z.object({errorMsg:z.string(),makingAmount:W,orderID:z.string(),status:z.string(),success:z.boolean(),takingAmount:W,tradeIDs:z.array(z.string()).default([]),transactionsHashes:z.array(z.string()).default([])}),Z=(n=>(n.LIVE="live",n.MATCHED="matched",n.DELAYED="delayed",n))(Z||{}),xe=z.nativeEnum(Z),X=(l=>(l.UNMATCHED="unmatched",l.MARKET_NOT_READY="market_not_ready",l.INSUFFICIENT_BALANCE_OR_ALLOWANCE="insufficient_balance_or_allowance",l.INVALID_NONCE="invalid_nonce",l.INVALID_EXPIRATION="invalid_expiration",l.POST_ONLY_WOULD_CROSS="post_only_would_cross",l.FOK_NOT_FILLED="fok_not_filled",l.FAK_NOT_FILLED="fak_not_filled",l.UNKNOWN="unknown",l))(X||{}),_e=z.nativeEnum(X),Re=z.object({ok:z.literal(true),orderId:z.string().min(1),status:xe,makingAmount:La,takingAmount:La,tradeIds:z.array(z.string()),transactionsHashes:z.array(Ka)}),Te=z.object({ok:z.literal(false),code:_e,message:z.string().min(1)}),Oe=ke.transform(Ae),vr=z.array(Oe);function Ie(e){return e.success&&e.errorMsg===""&&e.orderID!==""&&Ce(e.status)}function be(e){switch(e){case "live":return "live";case "matched":return "matched";case "delayed":return "delayed";default:never(`Unexpected order post status: ${e}`);}}function Ae(e){return Ie(e)?Re.parse({makingAmount:e.makingAmount,ok:true,orderId:e.orderID,status:be(e.status),takingAmount:e.takingAmount,tradeIds:e.tradeIDs,transactionsHashes:e.transactionsHashes}):Te.parse({code:ze(e),message:e.errorMsg||"Unknown order failure",ok:false})}function ze(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 Ce(e){return e==="live"||e==="matched"||e==="delayed"}var Yr="LTE=";var De=z.object({id:z.number().int().optional(),asset_address:z.string(),start_date:ia,end_date:ia.optional(),rate_per_day:Na,total_rewards:Na.optional()}).transform(({asset_address:e,start_date:t,end_date:a,rate_per_day:n,total_rewards:d,...c})=>({...c,assetAddress:e,startDate:t,endDate:a,ratePerDay:n,totalRewards:d})),Ee=z.object({condition_id:_,rewards_max_spread:z.number().optional(),rewards_min_size:Na.optional(),rewards_config:z.array(De).optional(),sponsored_daily_rate:Na.optional(),sponsors_count:z.number().int().optional(),native_daily_rate:Na.optional(),total_daily_rate:Na.optional()}).transform(({condition_id:e,rewards_max_spread:t,rewards_min_size:a,rewards_config:n,sponsored_daily_rate:d,sponsors_count:c,native_daily_rate:y,total_daily_rate:k,...x})=>({...x,conditionId:e,rewardsMaxSpread:t,rewardsMinSize:a,rewardsConfig:n,sponsoredDailyRate:d,sponsorsCount:c,nativeDailyRate:y,totalDailyRate:k})),$r=z.object({limit:z.number().int(),count:z.number().int(),next_cursor:z.string(),data:z.array(Ee)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e})),Pe=z.object({token_id:Ia,outcome:z.string(),price:Na}).transform(({token_id:e,...t})=>({...t,tokenId:e})),we=z.object({asset_address:z.string(),start_date:ia,end_date:ia.optional(),rate_per_day:Na,total_rewards:Na.optional()}).transform(({asset_address:e,start_date:t,end_date:a,rate_per_day:n,total_rewards:d,...c})=>({...c,assetAddress:e,startDate:t,endDate:a,ratePerDay:n,totalRewards:d})),Me=z.object({condition_id:_,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:Na.optional(),market_competitiveness:z.number().optional(),tokens:z.array(Pe),rewards_config:z.array(we).optional()}).transform(({condition_id:e,market_slug:t,event_slug:a,rewards_max_spread:n,rewards_min_size:d,market_competitiveness:c,rewards_config:y,...k})=>({...k,conditionId:e,marketSlug:t,eventSlug:a,rewardsMaxSpread:n,rewardsMinSize:d,marketCompetitiveness:c,rewardsConfig:y})),qr=z.object({limit:z.number().int(),count:z.number().int(),next_cursor:z.string(),data:z.array(Me)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e}));var Le=z.object({minimum_tick_size:la}).transform(({minimum_tick_size:e,...t})=>({...t,minimumTickSize:e})),et=Le;export{Re as AcceptedOrderResponseSchema,tr as ApiKeyCredsSchema,or as ApiKeysResponseSchema,F as AssetType,Ye as AssetTypeSchema,We as BalanceAllowanceResponseSchema,ar as BuilderApiKeyCredsSchema,U as BuilderApiKeySchema,nr as BuilderApiKeysResponseSchema,de as BuilderFeeRatesSchema,ie as BuilderTradeSchema,gr as CancelOrdersResponseSchema,J as ClobTradeSchema,ve as ClobTradesPageSchema,Ke as ClosedOnlyModeSchema,Se as ConditionByTokenSchema,Ee as CurrentRewardSchema,Yr as END_CURSOR,ne as EarningSchema,pr as FetchBuilderFeeRatesResponseSchema,Dr as FetchMarketInfoResponseSchema,wr as FetchNegRiskResponseSchema,Nr as FetchOrderBookResponseSchema,et as FetchTickSizeResponseSchema,Ir as LastTradePriceSchema,Ar as LastTradePricesSchema,G as MakerOrderSchema,fe as MarketFeeInfoSchema,le as MarketInfoSchema,Me as MarketRewardSchema,ge as MarketTokenSchema,kr as MidpointSchema,xr as MidpointsSchema,he as NegRiskSchema,ee as NotificationSchema,Ve as NotificationsResponseSchema,q as OpenOrderSchema,He as OpenOrdersPageSchema,ye as OrderBookHashSchema,V as OrderBookLevelSchema,Y as OrderBookSchema,jr as OrderBooksSchema,Z as OrderPostStatus,xe as OrderPostStatusSchema,X as OrderResponseErrorCode,_e as OrderResponseErrorCodeSchema,Oe as OrderResponseSchema,vr as OrderResponsesSchema,Ze as OrderScoringResponseSchema,Xe as OrdersScoringResponseSchema,cr as PaginatedBuilderTradesSchema,$r as PaginatedCurrentRewardsSchema,qr as PaginatedMarketRewardsSchema,H as PriceHistoryInterval,ur as PriceHistoryIntervalSchema,zr as PriceHistorySchema,_r as PriceSchema,Rr as PricesSchema,Te as RejectedOrderResponseSchema,Cr as ResolveConditionByTokenResponseSchema,ae as RewardsConfigSchema,Ge as RewardsPercentagesSchema,Tr as SpreadSchema,Or as SpreadsSchema,Le as TickSizeSchema,oe as TokenSchema,te as TotalUserEarningSchema,qe as TotalUserEarningsResponseSchema,re as UserEarningSchema,$e as UserEarningsPageSchema,se as UserRewardsEarningSchema,Je as UserRewardsEarningsPageSchema};//# sourceMappingURL=index.js.map
|
|
1
|
+
export{a as SignatureType,b as SignatureTypeSchema}from'../chunk-HOD4LKZU.js';import {La,_,ha,fa,Ia,Qa,za,ba,ua,Pa,aa,Na,ia,U as U$1,xa,wa,la,da,Ka}from'../chunk-6TO35A2S.js';import {z}from'zod';import {never}from'@polymarket/types';function A(e){return z.object({count:z.number(),data:z.array(e),limit:z.number(),next_cursor:z.string()}).transform(({next_cursor:t,...o})=>({...o,nextCursor:t}))}var He=z.object({closed_only:z.boolean()}).transform(({closed_only:e})=>({closedOnly:e})),q=z.object({asset_id:Ia,associate_trades:z.array(z.string()),created_at:fa,expiration:ha,id:z.string(),maker_address:z.string(),market:_,order_type:z.string(),original_size:La,outcome:z.string(),owner:z.string(),price:La,side:z.string(),size_matched:La,status:z.string()}).transform(({asset_id:e,associate_trades:t,created_at:o,expiration:n,maker_address:d,market:c,order_type:y,original_size:k,size_matched:x,...l})=>{let z={...l,conditionId:c,tokenId:e,associateTrades:t,createdAt:o,makerAddress:d,orderType:y,originalSize:k,sizeMatched:x};return n===void 0?z:{...z,expiresAt:n}}),ve=A(q),G=z.object({asset_id:Ia,fee_rate_bps:z.preprocess(Qa,La.nullable()),maker_address:z.string(),matched_amount:La,order_id:z.string(),outcome:z.string(),owner:z.string(),price:La,side:z.string()}).transform(({asset_id:e,fee_rate_bps:t,maker_address:o,matched_amount:n,order_id:d,...c})=>({...c,tokenId:e,feeRateBps:t,makerAddress:o,matchedAmount:n,orderId:d})),J=z.object({asset_id:Ia,bucket_index:z.number(),fee_rate_bps:La,id:z.string(),last_update:fa,maker_address:z.string(),maker_orders:z.array(G),market:_,match_time:fa,outcome:z.string(),owner:z.string(),price:La,side:z.string(),size:La,status:za,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:o,last_update:n,maker_address:d,maker_orders:c,market:y,match_time:k,taker_order_id:x,trader_side:l,transaction_hash:z,...$})=>({...$,conditionId:y,tokenId:e,bucketIndex:t,feeRateBps:o,updatedAt:n,makerAddress:d,makerOrders:c,matchedAt:k,takerOrderId:x,traderSide:l,transactionHash:z})),Ve=A(J),Q=z.preprocess(e=>typeof e!="string"?e:/^\d+$/.test(e)?Number(e):Date.parse(e),ba),ee=z.object({id:ua,owner:z.string(),payload:z.unknown(),timestamp:Q,type:z.number()}),Ye=z.array(ee),F=(o=>(o.COLLATERAL="COLLATERAL",o.CONDITIONAL="CONDITIONAL",o))(F||{}),We=z.enum(F),Ze=z.object({allowances:z.record(aa,z.string().transform(BigInt)),balance:Pa}),Xe=z.object({scoring:z.boolean()}),$e=z.record(z.string(),z.boolean()),re=z.object({asset_address:z.string(),asset_rate:Na,condition_id:_,date:ia,earnings:Na,maker_address:z.string()}).transform(({asset_address:e,asset_rate:t,condition_id:o,maker_address:n,...d})=>({...d,assetAddress:e,assetRate:t,conditionId:o,makerAddress:n})),qe=A(re),te=z.object({asset_address:z.string(),asset_rate:Na,date:ia,earnings:Na,maker_address:z.string()}).transform(({asset_address:e,asset_rate:t,maker_address:o,...n})=>({...n,assetAddress:e,assetRate:t,makerAddress:o})),Ge=z.array(te),Je=z.record(_,z.number()),oe=z.object({outcome:z.string(),price:Na,token_id:Ia}).transform(({token_id:e,...t})=>({...t,tokenId:e})),ae=z.object({asset_address:z.string(),end_date:ia,rate_per_day:Na,start_date:ia,total_rewards:Na}).transform(({asset_address:e,end_date:t,rate_per_day:o,start_date:n,total_rewards:d})=>({assetAddress:e,endDate:t,ratePerDay:o,startDate:n,totalRewards:d})),ne=z.object({asset_address:z.string(),asset_rate:Na,earnings:Na}).transform(({asset_address:e,asset_rate:t,...o})=>({...o,assetAddress:e,assetRate:t})),se=z.object({condition_id:_,earning_percentage:z.number(),earnings:z.array(ne),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(ae),rewards_max_spread:z.number(),rewards_min_size:Na,tokens:z.array(oe)}).transform(({condition_id:e,earning_percentage:t,event_slug:o,maker_address:n,market_competitiveness:d,market_slug:c,rewards_config:y,rewards_max_spread:k,rewards_min_size:x,...l})=>({...l,conditionId:e,earningPercentage:t,eventSlug:o,makerAddress:n,marketCompetitiveness:d,marketSlug:c,rewardsConfig:y,rewardsMaxSpread:k,rewardsMinSize:x})),Qe=A(se);var or=z.object({apiKey:U$1,secret:z.string(),passphrase:z.string()}).transform(e=>({key:e.apiKey,passphrase:e.passphrase,secret:e.secret})),ar=z.object({apiKeys:z.array(U$1)}),nr=z.object({key:U$1,secret:z.string(),passphrase:z.string()}),U=z.object({key:U$1,createdAt:ia.optional(),revokedAt:ia.nullable().optional()}),sr=z.array(z.union([U$1.transform(e=>({key:e})),U])).transform(e=>e.map(t=>U.parse(t)));var ie=z.object({id:z.string(),tradeType:z.string(),takerOrderHash:z.string(),builder:z.string(),market:_,assetId:Ia,side:xa,size:La,sizeUsdc:La,price:La,status:z.string(),outcome:z.string(),outcomeIndex:z.number().int(),owner:z.string(),maker:z.string(),transactionHash:z.string(),matchTime:fa,bucketIndex:z.number().int(),fee:La,feeUsdc:La,err_msg:z.string().nullable().optional(),createdAt:ia.optional(),updatedAt:ia.optional()}).transform(({err_msg:e,assetId:t,market:o,matchTime:n,...d})=>({...d,conditionId:o,tokenId:t,errMsg:e,matchedAt:n})),pr=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})),K=1e4,de=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/K,taker:t/K})),mr=de;var lr=z.object({canceled:z.array(wa),not_canceled:z.record(wa,z.string())}).transform(({canceled:e,not_canceled:t})=>({canceled:e,notCanceled:t}));var H=(c=>(c.MAX="max",c.ONE_WEEK="1w",c.ONE_DAY="1d",c.SIX_HOURS="6h",c.ONE_HOUR="1h",c))(H||{}),kr=z.enum(H),xr=z.object({mid:La}),_r=z.record(Ia,La),Rr=z.object({price:La}),ce=z.partialRecord(xa,La),Tr=z.record(Ia,ce),Or=z.object({spread:La}),Ir=z.record(Ia,La),br=z.object({price:La,side:xa}),pe=z.object({price:La,side:xa,token_id:Ia}).transform(({token_id:e,price:t,side:o})=>({tokenId:e,price:t,side:o}));z.object({tokenId:Ia,price:La,side:xa});var Ar=z.array(pe),me=z.object({t:z.number().int(),p:z.number()}),Cr=z.object({history:z.array(me)}),Se=z.object({condition_id:_}).transform(({condition_id:e})=>e),Dr=Se,fe=z.object({r:z.number().default(0),e:z.number().default(0)}).transform(({r:e,e:t})=>({rate:e,exponent:t})),ge=z.object({t:Ia,o:z.string()}).transform(({t:e,o:t})=>({tokenId:e,outcome:t})),le=z.object({fd:fe.nullish(),mts:la,nr:z.boolean().optional(),t:z.array(ge)}).transform(({fd:e,mts:t,nr:o,t:n})=>({feeInfo:e??{rate:0,exponent:0},negRisk:o??false,tickSize:t,tokens:n})),Er=le;var he=z.object({neg_risk:z.boolean()}).transform(({neg_risk:e,...t})=>({...t,negRisk:e})),Mr=he;var V=z.object({price:La,size:La}),ye=z.string().regex(/^[a-f0-9]{40}$/).transform(e=>e),ue=La.transform(Number).pipe(la),Y=z.object({market:_,asset_id:Ia,timestamp:da.nullish(),bids:z.array(V),asks:z.array(V),min_order_size:La,tick_size:ue,neg_risk:z.boolean(),last_trade_price:La.nullish(),hash:ye}).transform(({market:e,asset_id:t,min_order_size:o,tick_size:n,neg_risk:d,last_trade_price:c,...y})=>({...y,conditionId:e,tokenId:t,minOrderSize:o,tickSize:n,negRisk:d,lastTradePrice:c})),jr=Y,Fr=z.array(Y);var W=z.preprocess(e=>e===""?"0":e,La),xe=z.object({errorMsg:z.string(),makingAmount:W,orderID:z.string(),status:z.string(),success:z.boolean(),takingAmount:W,tradeIDs:z.array(z.string()).default([]),transactionsHashes:z.array(z.string()).default([])}),Z=(n=>(n.LIVE="live",n.MATCHED="matched",n.DELAYED="delayed",n))(Z||{}),_e=z.nativeEnum(Z),X=(l=>(l.UNMATCHED="unmatched",l.MARKET_NOT_READY="market_not_ready",l.INSUFFICIENT_BALANCE_OR_ALLOWANCE="insufficient_balance_or_allowance",l.INVALID_NONCE="invalid_nonce",l.INVALID_EXPIRATION="invalid_expiration",l.POST_ONLY_WOULD_CROSS="post_only_would_cross",l.FOK_NOT_FILLED="fok_not_filled",l.FAK_NOT_FILLED="fak_not_filled",l.UNKNOWN="unknown",l))(X||{}),Re=z.nativeEnum(X),Te=z.object({ok:z.literal(true),orderId:wa.refine(e=>e.length>0),status:_e,makingAmount:La,takingAmount:La,tradeIds:z.array(z.string()),transactionsHashes:z.array(Ka)}),Oe=z.object({ok:z.literal(false),code:Re,message:z.string().min(1)}),Ie=xe.transform(Ae),Vr=z.array(Ie);function be(e){return e.success&&e.errorMsg===""&&e.orderID!==""&&De(e.status)}function ze(e){switch(e){case "live":return "live";case "matched":return "matched";case "delayed":return "delayed";default:never(`Unexpected order post status: ${e}`);}}function Ae(e){return be(e)?Te.parse({makingAmount:e.makingAmount,ok:true,orderId:e.orderID,status:ze(e.status),takingAmount:e.takingAmount,tradeIds:e.tradeIDs,transactionsHashes:e.transactionsHashes}):Oe.parse({code:Ce(e),message:e.errorMsg||"Unknown order failure",ok:false})}function Ce(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 De(e){return e==="live"||e==="matched"||e==="delayed"}var Wr="LTE=";var Ee=z.object({id:z.number().int().optional(),asset_address:z.string(),start_date:ia,end_date:ia.optional(),rate_per_day:Na,total_rewards:Na.optional()}).transform(({asset_address:e,start_date:t,end_date:o,rate_per_day:n,total_rewards:d,...c})=>({...c,assetAddress:e,startDate:t,endDate:o,ratePerDay:n,totalRewards:d})),Pe=z.object({condition_id:_,rewards_max_spread:z.number().optional(),rewards_min_size:Na.optional(),rewards_config:z.array(Ee).optional(),sponsored_daily_rate:Na.optional(),sponsors_count:z.number().int().optional(),native_daily_rate:Na.optional(),total_daily_rate:Na.optional()}).transform(({condition_id:e,rewards_max_spread:t,rewards_min_size:o,rewards_config:n,sponsored_daily_rate:d,sponsors_count:c,native_daily_rate:y,total_daily_rate:k,...x})=>({...x,conditionId:e,rewardsMaxSpread:t,rewardsMinSize:o,rewardsConfig:n,sponsoredDailyRate:d,sponsorsCount:c,nativeDailyRate:y,totalDailyRate:k})),qr=z.object({limit:z.number().int(),count:z.number().int(),next_cursor:z.string(),data:z.array(Pe)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e})),we=z.object({token_id:Ia,outcome:z.string(),price:Na}).transform(({token_id:e,...t})=>({...t,tokenId:e})),Me=z.object({asset_address:z.string(),start_date:ia,end_date:ia.optional(),rate_per_day:Na,total_rewards:Na.optional()}).transform(({asset_address:e,start_date:t,end_date:o,rate_per_day:n,total_rewards:d,...c})=>({...c,assetAddress:e,startDate:t,endDate:o,ratePerDay:n,totalRewards:d})),Be=z.object({condition_id:_,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:Na.optional(),market_competitiveness:z.number().optional(),tokens:z.array(we),rewards_config:z.array(Me).optional()}).transform(({condition_id:e,market_slug:t,event_slug:o,rewards_max_spread:n,rewards_min_size:d,market_competitiveness:c,rewards_config:y,...k})=>({...k,conditionId:e,marketSlug:t,eventSlug:o,rewardsMaxSpread:n,rewardsMinSize:d,marketCompetitiveness:c,rewardsConfig:y})),Gr=z.object({limit:z.number().int(),count:z.number().int(),next_cursor:z.string(),data:z.array(Be)}).transform(({next_cursor:e,...t})=>({...t,nextCursor:e}));var Ne=z.object({minimum_tick_size:la}).transform(({minimum_tick_size:e,...t})=>({...t,minimumTickSize:e})),rt=Ne;export{Te as AcceptedOrderResponseSchema,or as ApiKeyCredsSchema,ar as ApiKeysResponseSchema,F as AssetType,We as AssetTypeSchema,Ze as BalanceAllowanceResponseSchema,nr as BuilderApiKeyCredsSchema,U as BuilderApiKeySchema,sr as BuilderApiKeysResponseSchema,de as BuilderFeeRatesSchema,ie as BuilderTradeSchema,lr as CancelOrdersResponseSchema,J as ClobTradeSchema,Ve as ClobTradesPageSchema,He as ClosedOnlyModeSchema,Se as ConditionByTokenSchema,Pe as CurrentRewardSchema,Wr as END_CURSOR,ne as EarningSchema,mr as FetchBuilderFeeRatesResponseSchema,Er as FetchMarketInfoResponseSchema,Mr as FetchNegRiskResponseSchema,jr as FetchOrderBookResponseSchema,rt as FetchTickSizeResponseSchema,br as LastTradePriceSchema,Ar as LastTradePricesSchema,G as MakerOrderSchema,fe as MarketFeeInfoSchema,le as MarketInfoSchema,Be as MarketRewardSchema,ge as MarketTokenSchema,xr as MidpointSchema,_r as MidpointsSchema,he as NegRiskSchema,ee as NotificationSchema,Ye as NotificationsResponseSchema,q as OpenOrderSchema,ve as OpenOrdersPageSchema,ye as OrderBookHashSchema,V as OrderBookLevelSchema,Y as OrderBookSchema,Fr as OrderBooksSchema,Z as OrderPostStatus,_e as OrderPostStatusSchema,X as OrderResponseErrorCode,Re as OrderResponseErrorCodeSchema,Ie as OrderResponseSchema,Vr as OrderResponsesSchema,Xe as OrderScoringResponseSchema,$e as OrdersScoringResponseSchema,pr as PaginatedBuilderTradesSchema,qr as PaginatedCurrentRewardsSchema,Gr as PaginatedMarketRewardsSchema,H as PriceHistoryInterval,kr as PriceHistoryIntervalSchema,Cr as PriceHistorySchema,Rr as PriceSchema,Tr as PricesSchema,Oe as RejectedOrderResponseSchema,Dr as ResolveConditionByTokenResponseSchema,ae as RewardsConfigSchema,Je as RewardsPercentagesSchema,Or as SpreadSchema,Ir as SpreadsSchema,Ne as TickSizeSchema,oe as TokenSchema,te as TotalUserEarningSchema,Ge as TotalUserEarningsResponseSchema,re as UserEarningSchema,qe as UserEarningsPageSchema,se as UserRewardsEarningSchema,Qe as UserRewardsEarningsPageSchema};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/clob/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/clob/account.ts","../../src/clob/api-key.ts","../../src/clob/builder.ts","../../src/clob/cancel.ts","../../src/clob/market-data.ts","../../src/clob/neg-risk.ts","../../src/clob/order-book.ts","../../src/clob/order-response.ts","../../src/clob/pagination.ts","../../src/clob/rewards.ts","../../src/clob/tick-size.ts"],"names":["createCursorPageSchema","item","z","next_cursor","rest","ClosedOnlyModeSchema","closed_only","OpenOrderSchema","TokenIdSchema","EpochLikeToIsoDateTimeStringSchema","OptionalEpochLikeToIsoDateTimeStringSchema","CtfConditionIdSchema","DecimalStringSchema","asset_id","associate_trades","created_at","expiration","maker_address","market","order_type","original_size","size_matched","transformed","OpenOrdersPageSchema","MakerOrderSchema","emptyStringToNull","fee_rate_bps","matched_amount","order_id","ClobTradeSchema","TradeStatusSchema","bucket_index","last_update","maker_orders","match_time","taker_order_id","trader_side","transaction_hash","ClobTradesPageSchema","NotificationTimestampSchema","value","EpochMillisecondsSchema","NotificationSchema","NotificationIdSchema","NotificationsResponseSchema","AssetType","AssetTypeSchema","BalanceAllowanceResponseSchema","EvmAddressSchema","BaseUnitsSchema","OrderScoringResponseSchema","OrdersScoringResponseSchema","UserEarningSchema","DecimalishSchema","EpochMillisecondsToIsoDateTimeStringSchema","asset_address","asset_rate","condition_id","UserEarningsPageSchema","TotalUserEarningSchema","TotalUserEarningsResponseSchema","RewardsPercentagesSchema","TokenSchema","token_id","RewardsConfigSchema","end_date","rate_per_day","start_date","total_rewards","EarningSchema","UserRewardsEarningSchema","earning_percentage","event_slug","market_competitiveness","market_slug","rewards_config","rewards_max_spread","rewards_min_size","UserRewardsEarningsPageSchema","ApiKeyCredsSchema","ApiKeySchema","creds","ApiKeysResponseSchema","BuilderApiKeyCredsSchema","BuilderApiKeySchema","BuilderApiKeysResponseSchema","key","apiKeys","apiKey","BuilderTradeSchema","OrderSideSchema","err_msg","assetId","matchTime","PaginatedBuilderTradesSchema","BUILDER_FEES_BPS","BuilderFeeRatesSchema","builder_maker_fee_rate_bps","builder_taker_fee_rate_bps","FetchBuilderFeeRatesResponseSchema","CancelOrdersResponseSchema","OrderIdSchema","canceled","not_canceled","PriceHistoryInterval","PriceHistoryIntervalSchema","MidpointSchema","MidpointsSchema","PriceSchema","PricesBySideSchema","PricesSchema","SpreadSchema","SpreadsSchema","LastTradePriceSchema","LastTradePriceForTokenResponseSchema","price","side","LastTradePricesSchema","PriceHistoryPointSchema","PriceHistorySchema","ConditionByTokenSchema","ResolveConditionByTokenResponseSchema","MarketFeeInfoSchema","r","e","MarketTokenSchema","t","o","MarketInfoSchema","fd","FetchMarketInfoResponseSchema","NegRiskSchema","neg_risk","FetchNegRiskResponseSchema","OrderBookLevelSchema","OrderBookHashSchema","OrderBookSchema","EpochMillisecondsStringSchema","min_order_size","tick_size","last_trade_price","FetchOrderBookResponseSchema","OrderBooksSchema","OrderResponseAmountSchema","OrderResponsePayloadSchema","OrderPostStatus","OrderPostStatusSchema","OrderResponseErrorCode","OrderResponseErrorCodeSchema","AcceptedOrderResponseSchema","TxHashSchema","RejectedOrderResponseSchema","OrderResponseSchema","normalizeOrderResponse","OrderResponsesSchema","isAcceptedOrderResponse","response","isOrderPostStatus","parseOrderPostStatus","status","never","inferOrderResponseErrorCode","END_CURSOR","CurrentRewardConfigSchema","CurrentRewardSchema","sponsored_daily_rate","sponsors_count","native_daily_rate","total_daily_rate","PaginatedCurrentRewardsSchema","RewardTokenSchema","RewardConfigSchema","MarketRewardSchema","PaginatedMarketRewardsSchema","TickSizeSchema","TickSizeValueSchema","minimum_tick_size","FetchTickSizeResponseSchema"],"mappings":"yOAqBA,SAASA,EAAmDC,CAAAA,CAAa,CACvE,OAAOC,CAAAA,CACJ,MAAA,CAAO,CACN,KAAA,CAAOA,CAAAA,CAAE,QAAO,CAChB,IAAA,CAAMA,CAAAA,CAAE,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,GAAGA,CAAAA,CACH,WAAA,CAAaqD,EACb,UAAA,CAAYiB,CAAAA,CACZ,SAAA,CAAWF,CAAAA,CACX,iBAAkBI,CAAAA,CAClB,cAAA,CAAgBC,CAAAA,CAChB,qBAAA,CAAuBJ,EACvB,aAAA,CAAeE,CACjB,CAAA,CACF,CAAA,CAGWkG,EAAAA,CAA+B3K,CAAAA,CACzC,MAAA,CAAO,CACN,MAAOA,CAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,EAAI,CACtB,KAAA,CAAOA,CAAAA,CAAE,MAAA,GAAS,GAAA,EAAI,CACtB,WAAA,CAAaA,CAAAA,CAAE,MAAA,EAAO,CACtB,IAAA,CAAMA,CAAAA,CAAE,MAAM0K,EAAkB,CAClC,CAAC,CAAA,CACA,UAAU,CAAC,CAAE,WAAA,CAAAzK,CAAAA,CAAa,GAAGC,CAAK,CAAA,IAAO,CACxC,GAAGA,CAAAA,CACH,UAAA,CAAYD,CACd,CAAA,CAAE,ECzKG,IAAM2K,EAAAA,CAAiB5K,CAAAA,CAC3B,MAAA,CAAO,CACN,iBAAA,CAAmB6K,EACrB,CAAC,CAAA,CACA,SAAA,CAAU,CAAC,CAAE,iBAAA,CAAAC,EAAmB,GAAG5K,CAAK,CAAA,IAAO,CAC9C,GAAGA,CAAAA,CACH,eAAA,CAAiB4K,CACnB,CAAA,CAAE,EAESC,EAAAA,CAA8BH","file":"index.js","sourcesContent":["import { z } from 'zod';\nimport {\n BaseUnitsSchema,\n type CtfConditionId,\n CtfConditionIdSchema,\n DecimalishSchema,\n type DecimalString,\n DecimalStringSchema,\n EpochLikeToIsoDateTimeStringSchema,\n EpochMillisecondsSchema,\n EpochMillisecondsToIsoDateTimeStringSchema,\n EvmAddressSchema,\n emptyStringToNull,\n type IsoDateTimeString,\n NotificationIdSchema,\n OptionalEpochLikeToIsoDateTimeStringSchema,\n type TokenId,\n TokenIdSchema,\n TradeStatusSchema,\n} from '../shared';\n\nfunction createCursorPageSchema<TItem extends z.ZodTypeAny>(item: TItem) {\n return z\n .object({\n count: z.number(),\n data: z.array(item),\n limit: z.number(),\n next_cursor: z.string(),\n })\n .transform(({ next_cursor, ...rest }) => ({\n ...rest,\n nextCursor: next_cursor,\n }));\n}\n\nexport const ClosedOnlyModeSchema = z\n .object({\n closed_only: z.boolean(),\n })\n .transform(({ closed_only }) => ({\n closedOnly: closed_only,\n }));\n\nexport type ClosedOnlyMode = z.infer<typeof ClosedOnlyModeSchema>;\n\nexport type OpenOrder = {\n id: string;\n /** CTF condition id for the market associated with this order. */\n conditionId: CtfConditionId;\n tokenId: TokenId;\n owner: string;\n makerAddress: string;\n side: string;\n price: DecimalString;\n originalSize: DecimalString;\n sizeMatched: DecimalString;\n outcome: string;\n orderType: string;\n status: string;\n associateTrades: string[];\n createdAt: IsoDateTimeString;\n expiresAt?: IsoDateTimeString;\n};\n\nexport const OpenOrderSchema = z\n .object({\n asset_id: TokenIdSchema,\n associate_trades: z.array(z.string()),\n created_at: EpochLikeToIsoDateTimeStringSchema,\n expiration: OptionalEpochLikeToIsoDateTimeStringSchema,\n id: z.string(),\n maker_address: z.string(),\n market: CtfConditionIdSchema,\n order_type: z.string(),\n original_size: DecimalStringSchema,\n outcome: z.string(),\n owner: z.string(),\n price: DecimalStringSchema,\n side: z.string(),\n size_matched: DecimalStringSchema,\n status: z.string(),\n })\n .transform(\n ({\n asset_id,\n associate_trades,\n created_at,\n expiration,\n maker_address,\n market,\n order_type,\n original_size,\n size_matched,\n ...rest\n }) => {\n const transformed = {\n ...rest,\n conditionId: market,\n tokenId: asset_id,\n associateTrades: associate_trades,\n createdAt: created_at,\n makerAddress: maker_address,\n orderType: order_type,\n originalSize: original_size,\n sizeMatched: size_matched,\n };\n\n return expiration === undefined\n ? transformed\n : { ...transformed, expiresAt: expiration };\n },\n ) satisfies z.ZodType<OpenOrder>;\n\nexport const OpenOrdersPageSchema = createCursorPageSchema(OpenOrderSchema);\n\nexport type OpenOrdersPage = z.infer<typeof OpenOrdersPageSchema>;\n\nexport const MakerOrderSchema = z\n .object({\n asset_id: TokenIdSchema,\n // The API serializes a missing maker fee rate as an empty string.\n // Normalize to null so consumers never see '' as a DecimalString. This\n // matches py-sdk, where MakerOrder.fee_rate_bps is nullable.\n fee_rate_bps: z.preprocess(\n emptyStringToNull,\n DecimalStringSchema.nullable(),\n ),\n maker_address: z.string(),\n matched_amount: DecimalStringSchema,\n order_id: z.string(),\n outcome: z.string(),\n owner: z.string(),\n price: DecimalStringSchema,\n side: z.string(),\n })\n .transform(\n ({\n asset_id,\n fee_rate_bps,\n maker_address,\n matched_amount,\n order_id,\n ...rest\n }) => ({\n ...rest,\n tokenId: asset_id,\n feeRateBps: fee_rate_bps,\n makerAddress: maker_address,\n matchedAmount: matched_amount,\n orderId: order_id,\n }),\n );\n\ntype MakerOrder = z.output<typeof MakerOrderSchema>;\n\nexport type ClobTrade = {\n id: string;\n /** CTF condition id for the market associated with this trade. */\n conditionId: CtfConditionId;\n tokenId: TokenId;\n owner: string;\n makerAddress: string;\n takerOrderId: string;\n side: string;\n traderSide: 'TAKER' | 'MAKER';\n price: DecimalString;\n size: DecimalString;\n outcome: string;\n status: string;\n feeRateBps: DecimalString;\n bucketIndex: number;\n transactionHash: string;\n makerOrders: MakerOrder[];\n matchedAt: IsoDateTimeString;\n updatedAt: IsoDateTimeString;\n};\n\nexport const ClobTradeSchema = z\n .object({\n asset_id: TokenIdSchema,\n bucket_index: z.number(),\n fee_rate_bps: DecimalStringSchema,\n id: z.string(),\n last_update: EpochLikeToIsoDateTimeStringSchema,\n maker_address: z.string(),\n maker_orders: z.array(MakerOrderSchema),\n market: CtfConditionIdSchema,\n match_time: EpochLikeToIsoDateTimeStringSchema,\n outcome: z.string(),\n owner: z.string(),\n price: DecimalStringSchema,\n side: z.string(),\n size: DecimalStringSchema,\n status: TradeStatusSchema,\n taker_order_id: z.string(),\n trader_side: z.enum(['TAKER', 'MAKER']),\n transaction_hash: z.string(),\n })\n .transform(\n ({\n asset_id,\n bucket_index,\n fee_rate_bps,\n last_update,\n maker_address,\n maker_orders,\n market,\n match_time,\n taker_order_id,\n trader_side,\n transaction_hash,\n ...rest\n }) => ({\n ...rest,\n conditionId: market,\n tokenId: asset_id,\n bucketIndex: bucket_index,\n feeRateBps: fee_rate_bps,\n updatedAt: last_update,\n makerAddress: maker_address,\n makerOrders: maker_orders,\n matchedAt: match_time,\n takerOrderId: taker_order_id,\n traderSide: trader_side,\n transactionHash: transaction_hash,\n }),\n ) satisfies z.ZodType<ClobTrade>;\n\nexport const ClobTradesPageSchema = createCursorPageSchema(ClobTradeSchema);\n\nexport type ClobTradesPage = z.infer<typeof ClobTradesPageSchema>;\n\nconst NotificationTimestampSchema = z.preprocess((value) => {\n if (typeof value !== 'string') {\n return value;\n }\n\n return /^\\d+$/.test(value) ? Number(value) : Date.parse(value);\n}, EpochMillisecondsSchema);\n\nexport const NotificationSchema = z.object({\n id: NotificationIdSchema,\n owner: z.string(),\n payload: z.unknown(),\n timestamp: NotificationTimestampSchema,\n type: z.number(),\n});\n\nexport type Notification = z.infer<typeof NotificationSchema>;\n\nexport const NotificationsResponseSchema = z.array(NotificationSchema);\n\nexport type NotificationsResponse = z.infer<typeof NotificationsResponseSchema>;\n\nexport enum AssetType {\n COLLATERAL = 'COLLATERAL',\n CONDITIONAL = 'CONDITIONAL',\n}\n\nexport const AssetTypeSchema = z.enum(AssetType);\n\nexport const BalanceAllowanceResponseSchema = z.object({\n allowances: z.record(EvmAddressSchema, z.string().transform(BigInt)),\n balance: BaseUnitsSchema,\n});\n\nexport type BalanceAllowanceResponse = z.infer<\n typeof BalanceAllowanceResponseSchema\n>;\n\nexport const OrderScoringResponseSchema = z.object({\n scoring: z.boolean(),\n});\n\nexport type OrderScoringResponse = z.infer<typeof OrderScoringResponseSchema>;\n\nexport const OrdersScoringResponseSchema = z.record(z.string(), z.boolean());\n\nexport type OrdersScoringResponse = z.infer<typeof OrdersScoringResponseSchema>;\n\nexport const UserEarningSchema = z\n .object({\n asset_address: z.string(),\n asset_rate: DecimalishSchema,\n condition_id: CtfConditionIdSchema,\n date: EpochMillisecondsToIsoDateTimeStringSchema,\n earnings: DecimalishSchema,\n maker_address: z.string(),\n })\n .transform(\n ({ asset_address, asset_rate, condition_id, maker_address, ...rest }) => ({\n ...rest,\n assetAddress: asset_address,\n assetRate: asset_rate,\n conditionId: condition_id,\n makerAddress: maker_address,\n }),\n );\n\nexport type UserEarning = z.infer<typeof UserEarningSchema>;\n\nexport const UserEarningsPageSchema = createCursorPageSchema(UserEarningSchema);\n\nexport type UserEarningsPage = z.infer<typeof UserEarningsPageSchema>;\n\nexport const TotalUserEarningSchema = z\n .object({\n asset_address: z.string(),\n asset_rate: DecimalishSchema,\n date: EpochMillisecondsToIsoDateTimeStringSchema,\n earnings: DecimalishSchema,\n maker_address: z.string(),\n })\n .transform(({ asset_address, asset_rate, maker_address, ...rest }) => ({\n ...rest,\n assetAddress: asset_address,\n assetRate: asset_rate,\n makerAddress: maker_address,\n }));\n\nexport type TotalUserEarning = z.infer<typeof TotalUserEarningSchema>;\n\nexport const TotalUserEarningsResponseSchema = z.array(TotalUserEarningSchema);\n\nexport type TotalUserEarningsResponse = z.infer<\n typeof TotalUserEarningsResponseSchema\n>;\n\nexport const RewardsPercentagesSchema = z.record(\n CtfConditionIdSchema,\n z.number(),\n);\n\nexport type RewardsPercentages = z.infer<typeof RewardsPercentagesSchema>;\n\nexport const TokenSchema = z\n .object({\n outcome: z.string(),\n price: DecimalishSchema,\n token_id: TokenIdSchema,\n })\n .transform(({ token_id, ...rest }) => ({\n ...rest,\n tokenId: token_id,\n }));\n\nexport const RewardsConfigSchema = z\n .object({\n asset_address: z.string(),\n end_date: EpochMillisecondsToIsoDateTimeStringSchema,\n rate_per_day: DecimalishSchema,\n start_date: EpochMillisecondsToIsoDateTimeStringSchema,\n total_rewards: DecimalishSchema,\n })\n .transform(\n ({ asset_address, end_date, rate_per_day, start_date, total_rewards }) => ({\n assetAddress: asset_address,\n endDate: end_date,\n ratePerDay: rate_per_day,\n startDate: start_date,\n totalRewards: total_rewards,\n }),\n );\n\nexport const EarningSchema = z\n .object({\n asset_address: z.string(),\n asset_rate: DecimalishSchema,\n earnings: DecimalishSchema,\n })\n .transform(({ asset_address, asset_rate, ...rest }) => ({\n ...rest,\n assetAddress: asset_address,\n assetRate: asset_rate,\n }));\n\nexport const UserRewardsEarningSchema = z\n .object({\n condition_id: CtfConditionIdSchema,\n earning_percentage: z.number(),\n earnings: z.array(EarningSchema),\n event_slug: z.string(),\n image: z.string(),\n maker_address: z.string(),\n market_competitiveness: z.number(),\n market_slug: z.string(),\n question: z.string(),\n rewards_config: z.array(RewardsConfigSchema),\n rewards_max_spread: z.number(),\n rewards_min_size: DecimalishSchema,\n tokens: z.array(TokenSchema),\n })\n .transform(\n ({\n condition_id,\n earning_percentage,\n event_slug,\n maker_address,\n market_competitiveness,\n market_slug,\n rewards_config,\n rewards_max_spread,\n rewards_min_size,\n ...rest\n }) => ({\n ...rest,\n conditionId: condition_id,\n earningPercentage: earning_percentage,\n eventSlug: event_slug,\n makerAddress: maker_address,\n marketCompetitiveness: market_competitiveness,\n marketSlug: market_slug,\n rewardsConfig: rewards_config,\n rewardsMaxSpread: rewards_max_spread,\n rewardsMinSize: rewards_min_size,\n }),\n );\n\nexport type UserRewardsEarning = z.infer<typeof UserRewardsEarningSchema>;\n\nexport const UserRewardsEarningsPageSchema = createCursorPageSchema(\n UserRewardsEarningSchema,\n);\n\nexport type UserRewardsEarningsPage = z.infer<\n typeof UserRewardsEarningsPageSchema\n>;\n","import { z } from 'zod';\nimport {\n ApiKeySchema,\n EpochMillisecondsToIsoDateTimeStringSchema,\n} from '../shared';\n\nexport const ApiKeyCredsSchema = z\n .object({\n apiKey: ApiKeySchema,\n secret: z.string(),\n passphrase: z.string(),\n })\n .transform((creds) => ({\n key: creds.apiKey,\n passphrase: creds.passphrase,\n secret: creds.secret,\n }));\n\nexport type ApiKeyCreds = z.infer<typeof ApiKeyCredsSchema>;\n\nexport const ApiKeysResponseSchema = z.object({\n apiKeys: z.array(ApiKeySchema),\n});\n\nexport type ApiKeysResponse = z.infer<typeof ApiKeysResponseSchema>;\n\nexport const BuilderApiKeyCredsSchema = z.object({\n key: ApiKeySchema,\n secret: z.string(),\n passphrase: z.string(),\n});\n\nexport type BuilderApiKeyCreds = z.infer<typeof BuilderApiKeyCredsSchema>;\n\nexport const BuilderApiKeySchema = z.object({\n key: ApiKeySchema,\n createdAt: EpochMillisecondsToIsoDateTimeStringSchema.optional(),\n revokedAt: EpochMillisecondsToIsoDateTimeStringSchema.nullable().optional(),\n});\n\nexport type BuilderApiKey = z.infer<typeof BuilderApiKeySchema>;\n\nexport const BuilderApiKeysResponseSchema = z\n .array(\n z.union([ApiKeySchema.transform((key) => ({ key })), BuilderApiKeySchema]),\n )\n .transform((apiKeys) =>\n apiKeys.map((apiKey) => BuilderApiKeySchema.parse(apiKey)),\n );\n\nexport type BuilderApiKeysResponse = z.infer<\n typeof BuilderApiKeysResponseSchema\n>;\n","import { z } from 'zod';\nimport {\n type CtfConditionId,\n CtfConditionIdSchema,\n type DecimalString,\n DecimalStringSchema,\n EpochLikeToIsoDateTimeStringSchema,\n EpochMillisecondsToIsoDateTimeStringSchema,\n type IsoDateTimeString,\n type OrderSide,\n OrderSideSchema,\n type TokenId,\n TokenIdSchema,\n} from '../shared';\n\nexport type BuilderTrade = {\n id: string;\n tradeType: string;\n takerOrderHash: string;\n builder: string;\n /** CTF condition id for the market associated with this trade. */\n conditionId: CtfConditionId;\n tokenId: TokenId;\n side: OrderSide;\n size: DecimalString;\n sizeUsdc: DecimalString;\n price: DecimalString;\n status: string;\n outcome: string;\n outcomeIndex: number;\n owner: string;\n maker: string;\n transactionHash: string;\n matchedAt: IsoDateTimeString;\n bucketIndex: number;\n fee: DecimalString;\n feeUsdc: DecimalString;\n errMsg: string | null | undefined;\n createdAt?: IsoDateTimeString;\n updatedAt?: IsoDateTimeString;\n};\n\nexport const BuilderTradeSchema = z\n .object({\n id: z.string(),\n tradeType: z.string(),\n takerOrderHash: z.string(),\n builder: z.string(),\n market: CtfConditionIdSchema,\n assetId: TokenIdSchema,\n side: OrderSideSchema,\n size: DecimalStringSchema,\n sizeUsdc: DecimalStringSchema,\n price: DecimalStringSchema,\n status: z.string(),\n outcome: z.string(),\n outcomeIndex: z.number().int(),\n owner: z.string(),\n maker: z.string(),\n transactionHash: z.string(),\n matchTime: EpochLikeToIsoDateTimeStringSchema,\n bucketIndex: z.number().int(),\n fee: DecimalStringSchema,\n feeUsdc: DecimalStringSchema,\n err_msg: z.string().nullable().optional(),\n createdAt: EpochMillisecondsToIsoDateTimeStringSchema.optional(),\n updatedAt: EpochMillisecondsToIsoDateTimeStringSchema.optional(),\n })\n .transform(({ err_msg, assetId, market, matchTime, ...rest }) => ({\n ...rest,\n conditionId: market,\n tokenId: assetId,\n errMsg: err_msg,\n matchedAt: matchTime,\n })) satisfies z.ZodType<BuilderTrade>;\n\nexport const PaginatedBuilderTradesSchema = z\n .object({\n limit: z.number().int(),\n count: z.number().int(),\n next_cursor: z.string(),\n data: z.array(BuilderTradeSchema),\n })\n .transform(({ next_cursor, ...rest }) => ({\n ...rest,\n nextCursor: next_cursor,\n }));\nexport type PaginatedBuilderTrades = z.infer<\n typeof PaginatedBuilderTradesSchema\n>;\n\nconst BUILDER_FEES_BPS = 10_000;\n\nexport const BuilderFeeRatesSchema = z\n .object({\n builder_maker_fee_rate_bps: z.number(),\n builder_taker_fee_rate_bps: z.number(),\n })\n .transform(({ builder_maker_fee_rate_bps, builder_taker_fee_rate_bps }) => ({\n maker: builder_maker_fee_rate_bps / BUILDER_FEES_BPS,\n taker: builder_taker_fee_rate_bps / BUILDER_FEES_BPS,\n }));\n\nexport const FetchBuilderFeeRatesResponseSchema = BuilderFeeRatesSchema;\n\nexport type BuilderFeeRates = z.infer<typeof BuilderFeeRatesSchema>;\nexport type FetchBuilderFeeRatesResponse = z.infer<\n typeof FetchBuilderFeeRatesResponseSchema\n>;\n","import { z } from 'zod';\nimport { OrderIdSchema } from '../shared';\n\nexport const CancelOrdersResponseSchema = z\n .object({\n canceled: z.array(OrderIdSchema),\n not_canceled: z.record(OrderIdSchema, z.string()),\n })\n .transform(({ canceled, not_canceled }) => ({\n canceled,\n notCanceled: not_canceled,\n }));\n\nexport type CancelOrdersResponse = z.infer<typeof CancelOrdersResponseSchema>;\n","import { z } from 'zod';\nimport {\n CtfConditionIdSchema,\n DecimalStringSchema,\n OrderSideSchema,\n TokenIdSchema,\n} from '../shared';\n\nexport enum PriceHistoryInterval {\n MAX = 'max',\n ONE_WEEK = '1w',\n ONE_DAY = '1d',\n SIX_HOURS = '6h',\n ONE_HOUR = '1h',\n}\n\nexport const PriceHistoryIntervalSchema = z.enum(PriceHistoryInterval);\n\nexport const MidpointSchema = z.object({\n mid: DecimalStringSchema,\n});\nexport type Midpoint = z.infer<typeof MidpointSchema>;\n\nexport const MidpointsSchema = z.record(TokenIdSchema, DecimalStringSchema);\nexport type Midpoints = z.infer<typeof MidpointsSchema>;\n\nexport const PriceSchema = z.object({\n price: DecimalStringSchema,\n});\nexport type Price = z.infer<typeof PriceSchema>;\n\nconst PricesBySideSchema = z.partialRecord(\n OrderSideSchema,\n DecimalStringSchema,\n);\nexport type PricesBySide = z.infer<typeof PricesBySideSchema>;\n\nexport const PricesSchema = z.record(TokenIdSchema, PricesBySideSchema);\nexport type Prices = z.infer<typeof PricesSchema>;\n\nexport const SpreadSchema = z.object({\n spread: DecimalStringSchema,\n});\nexport type Spread = z.infer<typeof SpreadSchema>;\n\nexport const SpreadsSchema = z.record(TokenIdSchema, DecimalStringSchema);\nexport type Spreads = z.infer<typeof SpreadsSchema>;\n\nexport const LastTradePriceSchema = z.object({\n price: DecimalStringSchema,\n side: OrderSideSchema,\n});\nexport type LastTradePrice = z.infer<typeof LastTradePriceSchema>;\n\nconst LastTradePriceForTokenResponseSchema = z\n .object({\n price: DecimalStringSchema,\n side: OrderSideSchema,\n token_id: TokenIdSchema,\n })\n .transform(({ token_id, price, side }) => ({\n tokenId: token_id,\n price,\n side,\n }));\nexport type LastTradePriceForTokenResponse = z.infer<\n typeof LastTradePriceForTokenResponseSchema\n>;\n\nconst LastTradePriceForTokenSchema = z.object({\n tokenId: TokenIdSchema,\n price: DecimalStringSchema,\n side: OrderSideSchema,\n});\nexport type LastTradePriceForToken = z.infer<\n typeof LastTradePriceForTokenSchema\n>;\n\nexport const LastTradePricesSchema = z.array(\n LastTradePriceForTokenResponseSchema,\n);\nexport type LastTradePrices = z.infer<typeof LastTradePricesSchema>;\n\nconst PriceHistoryPointSchema = z.object({\n t: z.number().int(),\n // CLOB price history is intentionally approximate and emitted as JSON numbers.\n p: z.number(),\n});\nexport type PriceHistoryPoint = z.infer<typeof PriceHistoryPointSchema>;\n\nexport const PriceHistorySchema = z.object({\n history: z.array(PriceHistoryPointSchema),\n});\nexport type PriceHistory = z.infer<typeof PriceHistorySchema>;\n\nexport const ConditionByTokenSchema = z\n .object({\n condition_id: CtfConditionIdSchema,\n })\n .transform(({ condition_id }) => condition_id);\n\nexport const ResolveConditionByTokenResponseSchema = ConditionByTokenSchema;\n\nexport type ConditionByToken = z.infer<typeof ConditionByTokenSchema>;\nexport type ResolveConditionByTokenResponse = z.infer<\n typeof ResolveConditionByTokenResponseSchema\n>;\n\nexport const MarketFeeInfoSchema = z\n .object({\n r: z.number().default(0),\n e: z.number().default(0),\n })\n .transform(({ r, e }) => ({\n rate: r,\n exponent: e,\n }));\n\nexport const MarketTokenSchema = z\n .object({\n t: TokenIdSchema,\n o: z.string(),\n })\n .transform(({ t, o }) => ({\n tokenId: t,\n outcome: o,\n }));\n\nexport const MarketInfoSchema = z\n .object({\n fd: MarketFeeInfoSchema.nullish(),\n t: z.array(MarketTokenSchema),\n })\n .transform(({ fd, t }) => ({\n feeInfo: fd ?? { rate: 0, exponent: 0 },\n tokens: t,\n }));\n\nexport const FetchMarketInfoResponseSchema = MarketInfoSchema;\n\nexport type MarketFeeInfo = z.infer<typeof MarketFeeInfoSchema>;\nexport type MarketToken = z.infer<typeof MarketTokenSchema>;\nexport type MarketInfo = z.infer<typeof MarketInfoSchema>;\nexport type FetchMarketInfoResponse = z.infer<\n typeof FetchMarketInfoResponseSchema\n>;\n","import { z } from 'zod';\n\nexport const NegRiskSchema = z\n .object({\n neg_risk: z.boolean(),\n })\n .transform(({ neg_risk, ...rest }) => ({\n ...rest,\n negRisk: neg_risk,\n }));\n\nexport const FetchNegRiskResponseSchema = NegRiskSchema;\n\nexport type NegRisk = z.infer<typeof NegRiskSchema>;\nexport type FetchNegRiskResponse = z.infer<typeof FetchNegRiskResponseSchema>;\n","import { z } from 'zod';\nimport {\n type CtfConditionId,\n CtfConditionIdSchema,\n type DecimalString,\n DecimalStringSchema,\n type EpochMilliseconds,\n EpochMillisecondsStringSchema,\n type TokenId,\n TokenIdSchema,\n} from '../shared';\n\nexport type OrderBookLevel = {\n price: DecimalString;\n size: DecimalString;\n};\n\n/** SHA-1 hash of the serialized order book summary, encoded as bare lowercase hex. */\nexport type OrderBookHash = string & { readonly __tag: 'OrderBookHash' };\n\nexport type OrderBook = {\n /** CTF condition id for the market this book belongs to. */\n conditionId: CtfConditionId;\n tokenId: TokenId;\n timestamp?: EpochMilliseconds | null;\n\n /** Bid levels in ascending price order, lowest bid first. */\n bids: OrderBookLevel[];\n\n /** Ask levels in descending price order, highest ask first. */\n asks: OrderBookLevel[];\n\n minOrderSize: DecimalString;\n tickSize: DecimalString;\n negRisk: boolean;\n lastTradePrice?: DecimalString | null;\n hash: OrderBookHash;\n};\n\nexport const OrderBookLevelSchema = z.object({\n price: DecimalStringSchema,\n size: DecimalStringSchema,\n}) satisfies z.ZodType<OrderBookLevel>;\n\nexport const OrderBookHashSchema = z\n .string()\n .regex(/^[a-f0-9]{40}$/)\n .transform((value) => value as OrderBookHash);\n\nexport const OrderBookSchema = z\n .object({\n market: CtfConditionIdSchema,\n asset_id: TokenIdSchema,\n timestamp: EpochMillisecondsStringSchema.nullish(),\n bids: z.array(OrderBookLevelSchema),\n asks: z.array(OrderBookLevelSchema),\n min_order_size: DecimalStringSchema,\n tick_size: DecimalStringSchema,\n neg_risk: z.boolean(),\n last_trade_price: DecimalStringSchema.nullish(),\n hash: OrderBookHashSchema,\n })\n .transform(\n ({\n market,\n asset_id,\n min_order_size,\n tick_size,\n neg_risk,\n last_trade_price,\n ...rest\n }) => ({\n ...rest,\n conditionId: market,\n tokenId: asset_id,\n minOrderSize: min_order_size,\n tickSize: tick_size,\n negRisk: neg_risk,\n lastTradePrice: last_trade_price,\n }),\n ) satisfies z.ZodType<OrderBook>;\n\nexport const FetchOrderBookResponseSchema = OrderBookSchema;\nexport const OrderBooksSchema = z.array(OrderBookSchema);\n\nexport type OrderBooks = OrderBook[];\nexport type FetchOrderBookResponse = OrderBook;\n","import { never, type TxHash } from '@polymarket/types';\nimport { z } from 'zod';\nimport {\n type DecimalString,\n DecimalStringSchema,\n TxHashSchema,\n} from '../shared';\n\n// The API serializes unset decimal fields as empty strings, e.g. the\n// making/taking amounts on an order that rests on the book without matching.\n// Normalize to '0' so consumers never see '' as a DecimalString.\nconst OrderResponseAmountSchema = z.preprocess(\n (value) => (value === '' ? '0' : value),\n DecimalStringSchema,\n);\n\nconst OrderResponsePayloadSchema = z.object({\n errorMsg: z.string(),\n makingAmount: OrderResponseAmountSchema,\n orderID: z.string(),\n status: z.string(),\n success: z.boolean(),\n takingAmount: OrderResponseAmountSchema,\n tradeIDs: z.array(z.string()).default([]),\n transactionsHashes: z.array(z.string()).default([]),\n});\n\ntype OrderResponsePayload = z.infer<typeof OrderResponsePayloadSchema>;\n\n/**\n * Placement outcome of an accepted order.\n */\nexport enum OrderPostStatus {\n /** The order rests on the book without matching. */\n LIVE = 'live',\n /** The order matched, fully or partially, at placement. */\n MATCHED = 'matched',\n /** The market imposes a matching delay; the order is queued. */\n DELAYED = 'delayed',\n}\n\nexport const OrderPostStatusSchema = z.nativeEnum(OrderPostStatus);\n\nexport enum OrderResponseErrorCode {\n UNMATCHED = 'unmatched',\n MARKET_NOT_READY = 'market_not_ready',\n INSUFFICIENT_BALANCE_OR_ALLOWANCE = 'insufficient_balance_or_allowance',\n INVALID_NONCE = 'invalid_nonce',\n INVALID_EXPIRATION = 'invalid_expiration',\n POST_ONLY_WOULD_CROSS = 'post_only_would_cross',\n FOK_NOT_FILLED = 'fok_not_filled',\n FAK_NOT_FILLED = 'fak_not_filled',\n UNKNOWN = 'unknown',\n}\n\nexport const OrderResponseErrorCodeSchema = z.nativeEnum(\n OrderResponseErrorCode,\n);\n\n/**\n * A successfully placed order.\n */\nexport type AcceptedOrderResponse = {\n ok: true;\n /** Unique identifier of the placed order. */\n orderId: string;\n /** Placement outcome. Fills only exist when the status is `matched`. */\n status: OrderPostStatus;\n /** Amount of the maker asset committed by fills at placement. `'0'` when the order did not match. */\n makingAmount: DecimalString;\n /** Amount of the taker asset received by fills at placement. `'0'` when the order did not match. */\n takingAmount: DecimalString;\n /**\n * Settlement transaction hashes for fills that occurred at placement.\n * Populated on a best-effort basis: settlement happens asynchronously, so\n * this can be empty even when the order matched. Follow the order's trades\n * to obtain hashes reliably.\n */\n transactionsHashes: TxHash[];\n /**\n * Identifiers of the trades created by fills at placement. Empty when the\n * order did not match. Later fills of a resting order create new trades\n * that are not listed here.\n */\n tradeIds: string[];\n};\n\n/**\n * An order the venue refused to place.\n */\nexport type RejectedOrderResponse = {\n ok: false;\n /** Machine-readable rejection reason. */\n code: OrderResponseErrorCode;\n /** Human-readable rejection message. */\n message: string;\n};\n\n/**\n * Result of posting an order, discriminated on `ok`.\n */\nexport type OrderResponse = AcceptedOrderResponse | RejectedOrderResponse;\n\n/**\n * Results of posting a batch of orders, in request order.\n */\nexport type OrderResponses = OrderResponse[];\n\nexport const AcceptedOrderResponseSchema = z.object({\n ok: z.literal(true),\n orderId: z.string().min(1),\n status: OrderPostStatusSchema,\n makingAmount: DecimalStringSchema,\n takingAmount: DecimalStringSchema,\n tradeIds: z.array(z.string()),\n transactionsHashes: z.array(TxHashSchema),\n});\n\nexport const RejectedOrderResponseSchema = z.object({\n ok: z.literal(false),\n code: OrderResponseErrorCodeSchema,\n message: z.string().min(1),\n});\n\nexport const OrderResponseSchema = OrderResponsePayloadSchema.transform(\n normalizeOrderResponse,\n);\n\nexport const OrderResponsesSchema = z.array(OrderResponseSchema);\n\nfunction isAcceptedOrderResponse(response: OrderResponsePayload): boolean {\n return (\n response.success &&\n response.errorMsg === '' &&\n response.orderID !== '' &&\n isOrderPostStatus(response.status)\n );\n}\n\nfunction parseOrderPostStatus(status: string): OrderPostStatus {\n switch (status) {\n case OrderPostStatus.LIVE:\n return OrderPostStatus.LIVE;\n case OrderPostStatus.MATCHED:\n return OrderPostStatus.MATCHED;\n case OrderPostStatus.DELAYED:\n return OrderPostStatus.DELAYED;\n default:\n never(`Unexpected order post status: ${status}`);\n }\n}\n\nfunction normalizeOrderResponse(response: OrderResponsePayload): OrderResponse {\n if (isAcceptedOrderResponse(response)) {\n return AcceptedOrderResponseSchema.parse({\n makingAmount: response.makingAmount,\n ok: true,\n orderId: response.orderID,\n status: parseOrderPostStatus(response.status),\n takingAmount: response.takingAmount,\n tradeIds: response.tradeIDs,\n transactionsHashes: response.transactionsHashes,\n });\n }\n\n return RejectedOrderResponseSchema.parse({\n code: inferOrderResponseErrorCode(response),\n message: response.errorMsg || 'Unknown order failure',\n ok: false,\n });\n}\n\nfunction inferOrderResponseErrorCode(\n response: OrderResponsePayload,\n): OrderResponseErrorCode {\n // This is a boundary heuristic over legacy mixed `success`/`status`/`errorMsg`\n // fields. It is intentionally temporary and should be removed once the API\n // exposes structured success and error variants directly.\n if (response.status === 'unmatched') {\n return OrderResponseErrorCode.UNMATCHED;\n }\n\n switch (response.errorMsg) {\n case 'the market is not yet ready to process new orders':\n return OrderResponseErrorCode.MARKET_NOT_READY;\n case 'invalid nonce':\n return OrderResponseErrorCode.INVALID_NONCE;\n case 'invalid expiration':\n return OrderResponseErrorCode.INVALID_EXPIRATION;\n case 'invalid post-only order: order crosses book':\n return OrderResponseErrorCode.POST_ONLY_WOULD_CROSS;\n case \"order couldn't be fully filled. FOK orders are fully filled or killed.\":\n return OrderResponseErrorCode.FOK_NOT_FILLED;\n case 'no orders found to match with FAK order. FAK orders are partially filled or killed if no match is found.':\n return OrderResponseErrorCode.FAK_NOT_FILLED;\n }\n\n // CLOB currently returns one legacy text bucket for both balance and\n // allowance failures, so expose a combined structured code here.\n if (response.errorMsg.includes('not enough balance / allowance')) {\n return OrderResponseErrorCode.INSUFFICIENT_BALANCE_OR_ALLOWANCE;\n }\n\n return OrderResponseErrorCode.UNKNOWN;\n}\n\nfunction isOrderPostStatus(status: string): status is OrderPostStatus {\n return (\n status === OrderPostStatus.LIVE ||\n status === OrderPostStatus.MATCHED ||\n status === OrderPostStatus.DELAYED\n );\n}\n","export const END_CURSOR = 'LTE=';\n","import { z } from 'zod';\nimport {\n CtfConditionIdSchema,\n DecimalishSchema,\n EpochMillisecondsToIsoDateTimeStringSchema,\n TokenIdSchema,\n} from '../shared';\n\nconst CurrentRewardConfigSchema = z\n .object({\n id: z.number().int().optional(),\n asset_address: z.string(),\n start_date: EpochMillisecondsToIsoDateTimeStringSchema,\n end_date: EpochMillisecondsToIsoDateTimeStringSchema.optional(),\n rate_per_day: DecimalishSchema,\n total_rewards: DecimalishSchema.optional(),\n })\n .transform(\n ({\n asset_address,\n start_date,\n end_date,\n rate_per_day,\n total_rewards,\n ...rest\n }) => ({\n ...rest,\n assetAddress: asset_address,\n startDate: start_date,\n endDate: end_date,\n ratePerDay: rate_per_day,\n totalRewards: total_rewards,\n }),\n );\nexport type CurrentRewardConfig = z.infer<typeof CurrentRewardConfigSchema>;\n\nexport const CurrentRewardSchema = z\n .object({\n condition_id: CtfConditionIdSchema,\n rewards_max_spread: z.number().optional(),\n rewards_min_size: DecimalishSchema.optional(),\n rewards_config: z.array(CurrentRewardConfigSchema).optional(),\n sponsored_daily_rate: DecimalishSchema.optional(),\n sponsors_count: z.number().int().optional(),\n native_daily_rate: DecimalishSchema.optional(),\n total_daily_rate: DecimalishSchema.optional(),\n })\n .transform(\n ({\n condition_id,\n rewards_max_spread,\n rewards_min_size,\n rewards_config,\n sponsored_daily_rate,\n sponsors_count,\n native_daily_rate,\n total_daily_rate,\n ...rest\n }) => ({\n ...rest,\n conditionId: condition_id,\n rewardsMaxSpread: rewards_max_spread,\n rewardsMinSize: rewards_min_size,\n rewardsConfig: rewards_config,\n sponsoredDailyRate: sponsored_daily_rate,\n sponsorsCount: sponsors_count,\n nativeDailyRate: native_daily_rate,\n totalDailyRate: total_daily_rate,\n }),\n );\nexport type CurrentReward = z.infer<typeof CurrentRewardSchema>;\n\nexport const PaginatedCurrentRewardsSchema = z\n .object({\n limit: z.number().int(),\n count: z.number().int(),\n next_cursor: z.string(),\n data: z.array(CurrentRewardSchema),\n })\n .transform(({ next_cursor, ...rest }) => ({\n ...rest,\n nextCursor: next_cursor,\n }));\nexport type PaginatedCurrentRewards = z.infer<\n typeof PaginatedCurrentRewardsSchema\n>;\n\nconst RewardTokenSchema = z\n .object({\n token_id: TokenIdSchema,\n outcome: z.string(),\n price: DecimalishSchema,\n })\n .transform(({ token_id, ...rest }) => ({\n ...rest,\n tokenId: token_id,\n }));\nexport type RewardToken = z.infer<typeof RewardTokenSchema>;\n\nconst RewardConfigSchema = z\n .object({\n asset_address: z.string(),\n start_date: EpochMillisecondsToIsoDateTimeStringSchema,\n end_date: EpochMillisecondsToIsoDateTimeStringSchema.optional(),\n rate_per_day: DecimalishSchema,\n total_rewards: DecimalishSchema.optional(),\n })\n .transform(\n ({\n asset_address,\n start_date,\n end_date,\n rate_per_day,\n total_rewards,\n ...rest\n }) => ({\n ...rest,\n assetAddress: asset_address,\n startDate: start_date,\n endDate: end_date,\n ratePerDay: rate_per_day,\n totalRewards: total_rewards,\n }),\n );\nexport type RewardConfig = z.infer<typeof RewardConfigSchema>;\n\nexport const MarketRewardSchema = z\n .object({\n condition_id: CtfConditionIdSchema,\n question: z.string(),\n market_slug: z.string().optional(),\n event_slug: z.string().optional(),\n image: z.string().optional(),\n rewards_max_spread: z.number().optional(),\n rewards_min_size: DecimalishSchema.optional(),\n market_competitiveness: z.number().optional(),\n tokens: z.array(RewardTokenSchema),\n rewards_config: z.array(RewardConfigSchema).optional(),\n })\n .transform(\n ({\n condition_id,\n market_slug,\n event_slug,\n rewards_max_spread,\n rewards_min_size,\n market_competitiveness,\n rewards_config,\n ...rest\n }) => ({\n ...rest,\n conditionId: condition_id,\n marketSlug: market_slug,\n eventSlug: event_slug,\n rewardsMaxSpread: rewards_max_spread,\n rewardsMinSize: rewards_min_size,\n marketCompetitiveness: market_competitiveness,\n rewardsConfig: rewards_config,\n }),\n );\nexport type MarketReward = z.infer<typeof MarketRewardSchema>;\n\nexport const PaginatedMarketRewardsSchema = z\n .object({\n limit: z.number().int(),\n count: z.number().int(),\n next_cursor: z.string(),\n data: z.array(MarketRewardSchema),\n })\n .transform(({ next_cursor, ...rest }) => ({\n ...rest,\n nextCursor: next_cursor,\n }));\nexport type PaginatedMarketRewards = z.infer<\n typeof PaginatedMarketRewardsSchema\n>;\n","import { z } from 'zod';\nimport { TickSizeValueSchema } from '../shared';\n\nexport const TickSizeSchema = z\n .object({\n minimum_tick_size: TickSizeValueSchema,\n })\n .transform(({ minimum_tick_size, ...rest }) => ({\n ...rest,\n minimumTickSize: minimum_tick_size,\n }));\n\nexport const FetchTickSizeResponseSchema = TickSizeSchema;\n\nexport type TickSize = z.infer<typeof TickSizeSchema>;\nexport type FetchTickSizeResponse = z.infer<typeof FetchTickSizeResponseSchema>;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/clob/account.ts","../../src/clob/api-key.ts","../../src/clob/builder.ts","../../src/clob/cancel.ts","../../src/clob/market-data.ts","../../src/clob/neg-risk.ts","../../src/clob/order-book.ts","../../src/clob/order-response.ts","../../src/clob/pagination.ts","../../src/clob/rewards.ts","../../src/clob/tick-size.ts"],"names":["createCursorPageSchema","item","z","next_cursor","rest","ClosedOnlyModeSchema","closed_only","OpenOrderSchema","TokenIdSchema","EpochLikeToIsoDateTimeStringSchema","OptionalEpochLikeToIsoDateTimeStringSchema","CtfConditionIdSchema","DecimalStringSchema","asset_id","associate_trades","created_at","expiration","maker_address","market","order_type","original_size","size_matched","transformed","OpenOrdersPageSchema","MakerOrderSchema","emptyStringToNull","fee_rate_bps","matched_amount","order_id","ClobTradeSchema","TradeStatusSchema","bucket_index","last_update","maker_orders","match_time","taker_order_id","trader_side","transaction_hash","ClobTradesPageSchema","NotificationTimestampSchema","value","EpochMillisecondsSchema","NotificationSchema","NotificationIdSchema","NotificationsResponseSchema","AssetType","AssetTypeSchema","BalanceAllowanceResponseSchema","EvmAddressSchema","BaseUnitsSchema","OrderScoringResponseSchema","OrdersScoringResponseSchema","UserEarningSchema","DecimalishSchema","EpochMillisecondsToIsoDateTimeStringSchema","asset_address","asset_rate","condition_id","UserEarningsPageSchema","TotalUserEarningSchema","TotalUserEarningsResponseSchema","RewardsPercentagesSchema","TokenSchema","token_id","RewardsConfigSchema","end_date","rate_per_day","start_date","total_rewards","EarningSchema","UserRewardsEarningSchema","earning_percentage","event_slug","market_competitiveness","market_slug","rewards_config","rewards_max_spread","rewards_min_size","UserRewardsEarningsPageSchema","ApiKeyCredsSchema","ApiKeySchema","creds","ApiKeysResponseSchema","BuilderApiKeyCredsSchema","BuilderApiKeySchema","BuilderApiKeysResponseSchema","key","apiKeys","apiKey","BuilderTradeSchema","OrderSideSchema","err_msg","assetId","matchTime","PaginatedBuilderTradesSchema","BUILDER_FEES_BPS","BuilderFeeRatesSchema","builder_maker_fee_rate_bps","builder_taker_fee_rate_bps","FetchBuilderFeeRatesResponseSchema","CancelOrdersResponseSchema","OrderIdSchema","canceled","not_canceled","PriceHistoryInterval","PriceHistoryIntervalSchema","MidpointSchema","MidpointsSchema","PriceSchema","PricesBySideSchema","PricesSchema","SpreadSchema","SpreadsSchema","LastTradePriceSchema","LastTradePriceForTokenResponseSchema","price","side","LastTradePricesSchema","PriceHistoryPointSchema","PriceHistorySchema","ConditionByTokenSchema","ResolveConditionByTokenResponseSchema","MarketFeeInfoSchema","r","e","MarketTokenSchema","t","o","MarketInfoSchema","TickSizeValueSchema","fd","mts","nr","FetchMarketInfoResponseSchema","NegRiskSchema","neg_risk","FetchNegRiskResponseSchema","OrderBookLevelSchema","OrderBookHashSchema","OrderBookTickSizeSchema","OrderBookSchema","EpochMillisecondsStringSchema","min_order_size","tick_size","last_trade_price","FetchOrderBookResponseSchema","OrderBooksSchema","OrderResponseAmountSchema","OrderResponsePayloadSchema","OrderPostStatus","OrderPostStatusSchema","OrderResponseErrorCode","OrderResponseErrorCodeSchema","AcceptedOrderResponseSchema","orderId","TxHashSchema","RejectedOrderResponseSchema","OrderResponseSchema","normalizeOrderResponse","OrderResponsesSchema","isAcceptedOrderResponse","response","isOrderPostStatus","parseOrderPostStatus","status","never","inferOrderResponseErrorCode","END_CURSOR","CurrentRewardConfigSchema","CurrentRewardSchema","sponsored_daily_rate","sponsors_count","native_daily_rate","total_daily_rate","PaginatedCurrentRewardsSchema","RewardTokenSchema","RewardConfigSchema","MarketRewardSchema","PaginatedMarketRewardsSchema","TickSizeSchema","minimum_tick_size","FetchTickSizeResponseSchema"],"mappings":"yOAqBA,SAASA,EAAmDC,CAAAA,CAAa,CACvE,OAAOC,CAAAA,CACJ,MAAA,CAAO,CACN,KAAA,CAAOA,CAAAA,CAAE,QAAO,CAChB,IAAA,CAAMA,CAAAA,CAAE,KAAA,CAAMD,CAAI,CAAA,CAClB,KAAA,CAAOC,CAAAA,CAAE,QAAO,CAChB,WAAA,CAAaA,CAAAA,CAAE,MAAA,EACjB,CAAC,CAAA,CACA,SAAA,CAAU,CAAC,CAAE,WAAA,CAAAC,CAAAA,CAAa,GAAGC,CAAK,CAAA,IAAO,CACxC,GAAGA,CAAAA,CACH,WAAYD,CACd,CAAA,CAAE,CACN,CAEO,IAAME,EAAAA,CAAuBH,CAAAA,CACjC,MAAA,CAAO,CACN,WAAA,CAAaA,CAAAA,CAAE,OAAA,EACjB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AAA,CAAWF,EACX,gBAAA,CAAkBI,CAAAA,CAClB,cAAA,CAAgBC,CAAAA,CAChB,sBAAuBJ,CAAAA,CACvB,aAAA,CAAeE,CACjB,CAAA,CACF,CAAA,CAGWuG,EAAAA,CAA+BhL,CAAAA,CACzC,MAAA,CAAO,CACN,KAAA,CAAOA,CAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,EAAI,CACtB,KAAA,CAAOA,CAAAA,CAAE,QAAO,CAAE,GAAA,EAAI,CACtB,WAAA,CAAaA,CAAAA,CAAE,MAAA,EAAO,CACtB,IAAA,CAAMA,EAAE,KAAA,CAAM+K,EAAkB,CAClC,CAAC,EACA,SAAA,CAAU,CAAC,CAAE,WAAA,CAAA9K,EAAa,GAAGC,CAAK,CAAA,IAAO,CACxC,GAAGA,CAAAA,CACH,UAAA,CAAYD,CACd,EAAE,ECzKG,IAAMgL,EAAAA,CAAiBjL,CAAAA,CAC3B,MAAA,CAAO,CACN,iBAAA,CAAmB+H,EACrB,CAAC,CAAA,CACA,SAAA,CAAU,CAAC,CAAE,iBAAA,CAAAmD,EAAmB,GAAGhL,CAAK,CAAA,IAAO,CAC9C,GAAGA,CAAAA,CACH,eAAA,CAAiBgL,CACnB,CAAA,CAAE,EAESC,EAAAA,CAA8BF","file":"index.js","sourcesContent":["import { z } from 'zod';\nimport {\n BaseUnitsSchema,\n type CtfConditionId,\n CtfConditionIdSchema,\n DecimalishSchema,\n type DecimalString,\n DecimalStringSchema,\n EpochLikeToIsoDateTimeStringSchema,\n EpochMillisecondsSchema,\n EpochMillisecondsToIsoDateTimeStringSchema,\n EvmAddressSchema,\n emptyStringToNull,\n type IsoDateTimeString,\n NotificationIdSchema,\n OptionalEpochLikeToIsoDateTimeStringSchema,\n type TokenId,\n TokenIdSchema,\n TradeStatusSchema,\n} from '../shared';\n\nfunction createCursorPageSchema<TItem extends z.ZodTypeAny>(item: TItem) {\n return z\n .object({\n count: z.number(),\n data: z.array(item),\n limit: z.number(),\n next_cursor: z.string(),\n })\n .transform(({ next_cursor, ...rest }) => ({\n ...rest,\n nextCursor: next_cursor,\n }));\n}\n\nexport const ClosedOnlyModeSchema = z\n .object({\n closed_only: z.boolean(),\n })\n .transform(({ closed_only }) => ({\n closedOnly: closed_only,\n }));\n\nexport type ClosedOnlyMode = z.infer<typeof ClosedOnlyModeSchema>;\n\nexport type OpenOrder = {\n id: string;\n /** CTF condition id for the market associated with this order. */\n conditionId: CtfConditionId;\n tokenId: TokenId;\n owner: string;\n makerAddress: string;\n side: string;\n price: DecimalString;\n originalSize: DecimalString;\n sizeMatched: DecimalString;\n outcome: string;\n orderType: string;\n status: string;\n associateTrades: string[];\n createdAt: IsoDateTimeString;\n expiresAt?: IsoDateTimeString;\n};\n\nexport const OpenOrderSchema = z\n .object({\n asset_id: TokenIdSchema,\n associate_trades: z.array(z.string()),\n created_at: EpochLikeToIsoDateTimeStringSchema,\n expiration: OptionalEpochLikeToIsoDateTimeStringSchema,\n id: z.string(),\n maker_address: z.string(),\n market: CtfConditionIdSchema,\n order_type: z.string(),\n original_size: DecimalStringSchema,\n outcome: z.string(),\n owner: z.string(),\n price: DecimalStringSchema,\n side: z.string(),\n size_matched: DecimalStringSchema,\n status: z.string(),\n })\n .transform(\n ({\n asset_id,\n associate_trades,\n created_at,\n expiration,\n maker_address,\n market,\n order_type,\n original_size,\n size_matched,\n ...rest\n }) => {\n const transformed = {\n ...rest,\n conditionId: market,\n tokenId: asset_id,\n associateTrades: associate_trades,\n createdAt: created_at,\n makerAddress: maker_address,\n orderType: order_type,\n originalSize: original_size,\n sizeMatched: size_matched,\n };\n\n return expiration === undefined\n ? transformed\n : { ...transformed, expiresAt: expiration };\n },\n ) satisfies z.ZodType<OpenOrder>;\n\nexport const OpenOrdersPageSchema = createCursorPageSchema(OpenOrderSchema);\n\nexport type OpenOrdersPage = z.infer<typeof OpenOrdersPageSchema>;\n\nexport const MakerOrderSchema = z\n .object({\n asset_id: TokenIdSchema,\n // The API serializes a missing maker fee rate as an empty string.\n // Normalize to null so consumers never see '' as a DecimalString. This\n // matches py-sdk, where MakerOrder.fee_rate_bps is nullable.\n fee_rate_bps: z.preprocess(\n emptyStringToNull,\n DecimalStringSchema.nullable(),\n ),\n maker_address: z.string(),\n matched_amount: DecimalStringSchema,\n order_id: z.string(),\n outcome: z.string(),\n owner: z.string(),\n price: DecimalStringSchema,\n side: z.string(),\n })\n .transform(\n ({\n asset_id,\n fee_rate_bps,\n maker_address,\n matched_amount,\n order_id,\n ...rest\n }) => ({\n ...rest,\n tokenId: asset_id,\n feeRateBps: fee_rate_bps,\n makerAddress: maker_address,\n matchedAmount: matched_amount,\n orderId: order_id,\n }),\n );\n\ntype MakerOrder = z.output<typeof MakerOrderSchema>;\n\nexport type ClobTrade = {\n id: string;\n /** CTF condition id for the market associated with this trade. */\n conditionId: CtfConditionId;\n tokenId: TokenId;\n owner: string;\n makerAddress: string;\n takerOrderId: string;\n side: string;\n traderSide: 'TAKER' | 'MAKER';\n price: DecimalString;\n size: DecimalString;\n outcome: string;\n status: string;\n feeRateBps: DecimalString;\n bucketIndex: number;\n transactionHash: string;\n makerOrders: MakerOrder[];\n matchedAt: IsoDateTimeString;\n updatedAt: IsoDateTimeString;\n};\n\nexport const ClobTradeSchema = z\n .object({\n asset_id: TokenIdSchema,\n bucket_index: z.number(),\n fee_rate_bps: DecimalStringSchema,\n id: z.string(),\n last_update: EpochLikeToIsoDateTimeStringSchema,\n maker_address: z.string(),\n maker_orders: z.array(MakerOrderSchema),\n market: CtfConditionIdSchema,\n match_time: EpochLikeToIsoDateTimeStringSchema,\n outcome: z.string(),\n owner: z.string(),\n price: DecimalStringSchema,\n side: z.string(),\n size: DecimalStringSchema,\n status: TradeStatusSchema,\n taker_order_id: z.string(),\n trader_side: z.enum(['TAKER', 'MAKER']),\n transaction_hash: z.string(),\n })\n .transform(\n ({\n asset_id,\n bucket_index,\n fee_rate_bps,\n last_update,\n maker_address,\n maker_orders,\n market,\n match_time,\n taker_order_id,\n trader_side,\n transaction_hash,\n ...rest\n }) => ({\n ...rest,\n conditionId: market,\n tokenId: asset_id,\n bucketIndex: bucket_index,\n feeRateBps: fee_rate_bps,\n updatedAt: last_update,\n makerAddress: maker_address,\n makerOrders: maker_orders,\n matchedAt: match_time,\n takerOrderId: taker_order_id,\n traderSide: trader_side,\n transactionHash: transaction_hash,\n }),\n ) satisfies z.ZodType<ClobTrade>;\n\nexport const ClobTradesPageSchema = createCursorPageSchema(ClobTradeSchema);\n\nexport type ClobTradesPage = z.infer<typeof ClobTradesPageSchema>;\n\nconst NotificationTimestampSchema = z.preprocess((value) => {\n if (typeof value !== 'string') {\n return value;\n }\n\n return /^\\d+$/.test(value) ? Number(value) : Date.parse(value);\n}, EpochMillisecondsSchema);\n\nexport const NotificationSchema = z.object({\n id: NotificationIdSchema,\n owner: z.string(),\n payload: z.unknown(),\n timestamp: NotificationTimestampSchema,\n type: z.number(),\n});\n\nexport type Notification = z.infer<typeof NotificationSchema>;\n\nexport const NotificationsResponseSchema = z.array(NotificationSchema);\n\nexport type NotificationsResponse = z.infer<typeof NotificationsResponseSchema>;\n\nexport enum AssetType {\n COLLATERAL = 'COLLATERAL',\n CONDITIONAL = 'CONDITIONAL',\n}\n\nexport const AssetTypeSchema = z.enum(AssetType);\n\nexport const BalanceAllowanceResponseSchema = z.object({\n allowances: z.record(EvmAddressSchema, z.string().transform(BigInt)),\n balance: BaseUnitsSchema,\n});\n\nexport type BalanceAllowanceResponse = z.infer<\n typeof BalanceAllowanceResponseSchema\n>;\n\nexport const OrderScoringResponseSchema = z.object({\n scoring: z.boolean(),\n});\n\nexport type OrderScoringResponse = z.infer<typeof OrderScoringResponseSchema>;\n\nexport const OrdersScoringResponseSchema = z.record(z.string(), z.boolean());\n\nexport type OrdersScoringResponse = z.infer<typeof OrdersScoringResponseSchema>;\n\nexport const UserEarningSchema = z\n .object({\n asset_address: z.string(),\n asset_rate: DecimalishSchema,\n condition_id: CtfConditionIdSchema,\n date: EpochMillisecondsToIsoDateTimeStringSchema,\n earnings: DecimalishSchema,\n maker_address: z.string(),\n })\n .transform(\n ({ asset_address, asset_rate, condition_id, maker_address, ...rest }) => ({\n ...rest,\n assetAddress: asset_address,\n assetRate: asset_rate,\n conditionId: condition_id,\n makerAddress: maker_address,\n }),\n );\n\nexport type UserEarning = z.infer<typeof UserEarningSchema>;\n\nexport const UserEarningsPageSchema = createCursorPageSchema(UserEarningSchema);\n\nexport type UserEarningsPage = z.infer<typeof UserEarningsPageSchema>;\n\nexport const TotalUserEarningSchema = z\n .object({\n asset_address: z.string(),\n asset_rate: DecimalishSchema,\n date: EpochMillisecondsToIsoDateTimeStringSchema,\n earnings: DecimalishSchema,\n maker_address: z.string(),\n })\n .transform(({ asset_address, asset_rate, maker_address, ...rest }) => ({\n ...rest,\n assetAddress: asset_address,\n assetRate: asset_rate,\n makerAddress: maker_address,\n }));\n\nexport type TotalUserEarning = z.infer<typeof TotalUserEarningSchema>;\n\nexport const TotalUserEarningsResponseSchema = z.array(TotalUserEarningSchema);\n\nexport type TotalUserEarningsResponse = z.infer<\n typeof TotalUserEarningsResponseSchema\n>;\n\nexport const RewardsPercentagesSchema = z.record(\n CtfConditionIdSchema,\n z.number(),\n);\n\nexport type RewardsPercentages = z.infer<typeof RewardsPercentagesSchema>;\n\nexport const TokenSchema = z\n .object({\n outcome: z.string(),\n price: DecimalishSchema,\n token_id: TokenIdSchema,\n })\n .transform(({ token_id, ...rest }) => ({\n ...rest,\n tokenId: token_id,\n }));\n\nexport const RewardsConfigSchema = z\n .object({\n asset_address: z.string(),\n end_date: EpochMillisecondsToIsoDateTimeStringSchema,\n rate_per_day: DecimalishSchema,\n start_date: EpochMillisecondsToIsoDateTimeStringSchema,\n total_rewards: DecimalishSchema,\n })\n .transform(\n ({ asset_address, end_date, rate_per_day, start_date, total_rewards }) => ({\n assetAddress: asset_address,\n endDate: end_date,\n ratePerDay: rate_per_day,\n startDate: start_date,\n totalRewards: total_rewards,\n }),\n );\n\nexport const EarningSchema = z\n .object({\n asset_address: z.string(),\n asset_rate: DecimalishSchema,\n earnings: DecimalishSchema,\n })\n .transform(({ asset_address, asset_rate, ...rest }) => ({\n ...rest,\n assetAddress: asset_address,\n assetRate: asset_rate,\n }));\n\nexport const UserRewardsEarningSchema = z\n .object({\n condition_id: CtfConditionIdSchema,\n earning_percentage: z.number(),\n earnings: z.array(EarningSchema),\n event_slug: z.string(),\n image: z.string(),\n maker_address: z.string(),\n market_competitiveness: z.number(),\n market_slug: z.string(),\n question: z.string(),\n rewards_config: z.array(RewardsConfigSchema),\n rewards_max_spread: z.number(),\n rewards_min_size: DecimalishSchema,\n tokens: z.array(TokenSchema),\n })\n .transform(\n ({\n condition_id,\n earning_percentage,\n event_slug,\n maker_address,\n market_competitiveness,\n market_slug,\n rewards_config,\n rewards_max_spread,\n rewards_min_size,\n ...rest\n }) => ({\n ...rest,\n conditionId: condition_id,\n earningPercentage: earning_percentage,\n eventSlug: event_slug,\n makerAddress: maker_address,\n marketCompetitiveness: market_competitiveness,\n marketSlug: market_slug,\n rewardsConfig: rewards_config,\n rewardsMaxSpread: rewards_max_spread,\n rewardsMinSize: rewards_min_size,\n }),\n );\n\nexport type UserRewardsEarning = z.infer<typeof UserRewardsEarningSchema>;\n\nexport const UserRewardsEarningsPageSchema = createCursorPageSchema(\n UserRewardsEarningSchema,\n);\n\nexport type UserRewardsEarningsPage = z.infer<\n typeof UserRewardsEarningsPageSchema\n>;\n","import { z } from 'zod';\nimport {\n ApiKeySchema,\n EpochMillisecondsToIsoDateTimeStringSchema,\n} from '../shared';\n\nexport const ApiKeyCredsSchema = z\n .object({\n apiKey: ApiKeySchema,\n secret: z.string(),\n passphrase: z.string(),\n })\n .transform((creds) => ({\n key: creds.apiKey,\n passphrase: creds.passphrase,\n secret: creds.secret,\n }));\n\nexport type ApiKeyCreds = z.infer<typeof ApiKeyCredsSchema>;\n\nexport const ApiKeysResponseSchema = z.object({\n apiKeys: z.array(ApiKeySchema),\n});\n\nexport type ApiKeysResponse = z.infer<typeof ApiKeysResponseSchema>;\n\nexport const BuilderApiKeyCredsSchema = z.object({\n key: ApiKeySchema,\n secret: z.string(),\n passphrase: z.string(),\n});\n\nexport type BuilderApiKeyCreds = z.infer<typeof BuilderApiKeyCredsSchema>;\n\nexport const BuilderApiKeySchema = z.object({\n key: ApiKeySchema,\n createdAt: EpochMillisecondsToIsoDateTimeStringSchema.optional(),\n revokedAt: EpochMillisecondsToIsoDateTimeStringSchema.nullable().optional(),\n});\n\nexport type BuilderApiKey = z.infer<typeof BuilderApiKeySchema>;\n\nexport const BuilderApiKeysResponseSchema = z\n .array(\n z.union([ApiKeySchema.transform((key) => ({ key })), BuilderApiKeySchema]),\n )\n .transform((apiKeys) =>\n apiKeys.map((apiKey) => BuilderApiKeySchema.parse(apiKey)),\n );\n\nexport type BuilderApiKeysResponse = z.infer<\n typeof BuilderApiKeysResponseSchema\n>;\n","import { z } from 'zod';\nimport {\n type CtfConditionId,\n CtfConditionIdSchema,\n type DecimalString,\n DecimalStringSchema,\n EpochLikeToIsoDateTimeStringSchema,\n EpochMillisecondsToIsoDateTimeStringSchema,\n type IsoDateTimeString,\n type OrderSide,\n OrderSideSchema,\n type TokenId,\n TokenIdSchema,\n} from '../shared';\n\nexport type BuilderTrade = {\n id: string;\n tradeType: string;\n takerOrderHash: string;\n builder: string;\n /** CTF condition id for the market associated with this trade. */\n conditionId: CtfConditionId;\n tokenId: TokenId;\n side: OrderSide;\n size: DecimalString;\n sizeUsdc: DecimalString;\n price: DecimalString;\n status: string;\n outcome: string;\n outcomeIndex: number;\n owner: string;\n maker: string;\n transactionHash: string;\n matchedAt: IsoDateTimeString;\n bucketIndex: number;\n fee: DecimalString;\n feeUsdc: DecimalString;\n errMsg: string | null | undefined;\n createdAt?: IsoDateTimeString;\n updatedAt?: IsoDateTimeString;\n};\n\nexport const BuilderTradeSchema = z\n .object({\n id: z.string(),\n tradeType: z.string(),\n takerOrderHash: z.string(),\n builder: z.string(),\n market: CtfConditionIdSchema,\n assetId: TokenIdSchema,\n side: OrderSideSchema,\n size: DecimalStringSchema,\n sizeUsdc: DecimalStringSchema,\n price: DecimalStringSchema,\n status: z.string(),\n outcome: z.string(),\n outcomeIndex: z.number().int(),\n owner: z.string(),\n maker: z.string(),\n transactionHash: z.string(),\n matchTime: EpochLikeToIsoDateTimeStringSchema,\n bucketIndex: z.number().int(),\n fee: DecimalStringSchema,\n feeUsdc: DecimalStringSchema,\n err_msg: z.string().nullable().optional(),\n createdAt: EpochMillisecondsToIsoDateTimeStringSchema.optional(),\n updatedAt: EpochMillisecondsToIsoDateTimeStringSchema.optional(),\n })\n .transform(({ err_msg, assetId, market, matchTime, ...rest }) => ({\n ...rest,\n conditionId: market,\n tokenId: assetId,\n errMsg: err_msg,\n matchedAt: matchTime,\n })) satisfies z.ZodType<BuilderTrade>;\n\nexport const PaginatedBuilderTradesSchema = z\n .object({\n limit: z.number().int(),\n count: z.number().int(),\n next_cursor: z.string(),\n data: z.array(BuilderTradeSchema),\n })\n .transform(({ next_cursor, ...rest }) => ({\n ...rest,\n nextCursor: next_cursor,\n }));\nexport type PaginatedBuilderTrades = z.infer<\n typeof PaginatedBuilderTradesSchema\n>;\n\nconst BUILDER_FEES_BPS = 10_000;\n\nexport const BuilderFeeRatesSchema = z\n .object({\n builder_maker_fee_rate_bps: z.number(),\n builder_taker_fee_rate_bps: z.number(),\n })\n .transform(({ builder_maker_fee_rate_bps, builder_taker_fee_rate_bps }) => ({\n maker: builder_maker_fee_rate_bps / BUILDER_FEES_BPS,\n taker: builder_taker_fee_rate_bps / BUILDER_FEES_BPS,\n }));\n\nexport const FetchBuilderFeeRatesResponseSchema = BuilderFeeRatesSchema;\n\nexport type BuilderFeeRates = z.infer<typeof BuilderFeeRatesSchema>;\nexport type FetchBuilderFeeRatesResponse = z.infer<\n typeof FetchBuilderFeeRatesResponseSchema\n>;\n","import { z } from 'zod';\nimport { OrderIdSchema } from '../shared';\n\nexport const CancelOrdersResponseSchema = z\n .object({\n canceled: z.array(OrderIdSchema),\n not_canceled: z.record(OrderIdSchema, z.string()),\n })\n .transform(({ canceled, not_canceled }) => ({\n canceled,\n notCanceled: not_canceled,\n }));\n\nexport type CancelOrdersResponse = z.infer<typeof CancelOrdersResponseSchema>;\n","import { z } from 'zod';\nimport {\n CtfConditionIdSchema,\n DecimalStringSchema,\n OrderSideSchema,\n TickSizeValueSchema,\n TokenIdSchema,\n} from '../shared';\n\nexport enum PriceHistoryInterval {\n MAX = 'max',\n ONE_WEEK = '1w',\n ONE_DAY = '1d',\n SIX_HOURS = '6h',\n ONE_HOUR = '1h',\n}\n\nexport const PriceHistoryIntervalSchema = z.enum(PriceHistoryInterval);\n\nexport const MidpointSchema = z.object({\n mid: DecimalStringSchema,\n});\nexport type Midpoint = z.infer<typeof MidpointSchema>;\n\nexport const MidpointsSchema = z.record(TokenIdSchema, DecimalStringSchema);\nexport type Midpoints = z.infer<typeof MidpointsSchema>;\n\nexport const PriceSchema = z.object({\n price: DecimalStringSchema,\n});\nexport type Price = z.infer<typeof PriceSchema>;\n\nconst PricesBySideSchema = z.partialRecord(\n OrderSideSchema,\n DecimalStringSchema,\n);\nexport type PricesBySide = z.infer<typeof PricesBySideSchema>;\n\nexport const PricesSchema = z.record(TokenIdSchema, PricesBySideSchema);\nexport type Prices = z.infer<typeof PricesSchema>;\n\nexport const SpreadSchema = z.object({\n spread: DecimalStringSchema,\n});\nexport type Spread = z.infer<typeof SpreadSchema>;\n\nexport const SpreadsSchema = z.record(TokenIdSchema, DecimalStringSchema);\nexport type Spreads = z.infer<typeof SpreadsSchema>;\n\nexport const LastTradePriceSchema = z.object({\n price: DecimalStringSchema,\n side: OrderSideSchema,\n});\nexport type LastTradePrice = z.infer<typeof LastTradePriceSchema>;\n\nconst LastTradePriceForTokenResponseSchema = z\n .object({\n price: DecimalStringSchema,\n side: OrderSideSchema,\n token_id: TokenIdSchema,\n })\n .transform(({ token_id, price, side }) => ({\n tokenId: token_id,\n price,\n side,\n }));\nexport type LastTradePriceForTokenResponse = z.infer<\n typeof LastTradePriceForTokenResponseSchema\n>;\n\nconst LastTradePriceForTokenSchema = z.object({\n tokenId: TokenIdSchema,\n price: DecimalStringSchema,\n side: OrderSideSchema,\n});\nexport type LastTradePriceForToken = z.infer<\n typeof LastTradePriceForTokenSchema\n>;\n\nexport const LastTradePricesSchema = z.array(\n LastTradePriceForTokenResponseSchema,\n);\nexport type LastTradePrices = z.infer<typeof LastTradePricesSchema>;\n\nconst PriceHistoryPointSchema = z.object({\n t: z.number().int(),\n // CLOB price history is intentionally approximate and emitted as JSON numbers.\n p: z.number(),\n});\nexport type PriceHistoryPoint = z.infer<typeof PriceHistoryPointSchema>;\n\nexport const PriceHistorySchema = z.object({\n history: z.array(PriceHistoryPointSchema),\n});\nexport type PriceHistory = z.infer<typeof PriceHistorySchema>;\n\nexport const ConditionByTokenSchema = z\n .object({\n condition_id: CtfConditionIdSchema,\n })\n .transform(({ condition_id }) => condition_id);\n\nexport const ResolveConditionByTokenResponseSchema = ConditionByTokenSchema;\n\nexport type ConditionByToken = z.infer<typeof ConditionByTokenSchema>;\nexport type ResolveConditionByTokenResponse = z.infer<\n typeof ResolveConditionByTokenResponseSchema\n>;\n\nexport const MarketFeeInfoSchema = z\n .object({\n r: z.number().default(0),\n e: z.number().default(0),\n })\n .transform(({ r, e }) => ({\n rate: r,\n exponent: e,\n }));\n\nexport const MarketTokenSchema = z\n .object({\n t: TokenIdSchema,\n o: z.string(),\n })\n .transform(({ t, o }) => ({\n tokenId: t,\n outcome: o,\n }));\n\nexport const MarketInfoSchema = z\n .object({\n fd: MarketFeeInfoSchema.nullish(),\n mts: TickSizeValueSchema,\n nr: z.boolean().optional(),\n t: z.array(MarketTokenSchema),\n })\n .transform(({ fd, mts, nr, t }) => ({\n feeInfo: fd ?? { rate: 0, exponent: 0 },\n negRisk: nr ?? false,\n tickSize: mts,\n tokens: t,\n }));\n\nexport const FetchMarketInfoResponseSchema = MarketInfoSchema;\n\nexport type MarketFeeInfo = z.infer<typeof MarketFeeInfoSchema>;\nexport type MarketToken = z.infer<typeof MarketTokenSchema>;\nexport type MarketInfo = z.infer<typeof MarketInfoSchema>;\nexport type FetchMarketInfoResponse = z.infer<\n typeof FetchMarketInfoResponseSchema\n>;\n","import { z } from 'zod';\n\nexport const NegRiskSchema = z\n .object({\n neg_risk: z.boolean(),\n })\n .transform(({ neg_risk, ...rest }) => ({\n ...rest,\n negRisk: neg_risk,\n }));\n\nexport const FetchNegRiskResponseSchema = NegRiskSchema;\n\nexport type NegRisk = z.infer<typeof NegRiskSchema>;\nexport type FetchNegRiskResponse = z.infer<typeof FetchNegRiskResponseSchema>;\n","import { z } from 'zod';\nimport {\n type CtfConditionId,\n CtfConditionIdSchema,\n type DecimalString,\n DecimalStringSchema,\n type EpochMilliseconds,\n EpochMillisecondsStringSchema,\n type TickSizeValue,\n TickSizeValueSchema,\n type TokenId,\n TokenIdSchema,\n} from '../shared';\n\nexport type OrderBookLevel = {\n price: DecimalString;\n size: DecimalString;\n};\n\n/** SHA-1 hash of the serialized order book summary, encoded as bare lowercase hex. */\nexport type OrderBookHash = string & { readonly __tag: 'OrderBookHash' };\n\nexport type OrderBook = {\n /** CTF condition id for the market this book belongs to. */\n conditionId: CtfConditionId;\n tokenId: TokenId;\n timestamp?: EpochMilliseconds | null;\n\n /** Bid levels in ascending price order, lowest bid first. */\n bids: OrderBookLevel[];\n\n /** Ask levels in descending price order, highest ask first. */\n asks: OrderBookLevel[];\n\n minOrderSize: DecimalString;\n tickSize: TickSizeValue;\n negRisk: boolean;\n lastTradePrice?: DecimalString | null;\n hash: OrderBookHash;\n};\n\nexport const OrderBookLevelSchema = z.object({\n price: DecimalStringSchema,\n size: DecimalStringSchema,\n}) satisfies z.ZodType<OrderBookLevel>;\n\nexport const OrderBookHashSchema = z\n .string()\n .regex(/^[a-f0-9]{40}$/)\n .transform((value) => value as OrderBookHash);\n\nconst OrderBookTickSizeSchema =\n DecimalStringSchema.transform(Number).pipe(TickSizeValueSchema);\n\nexport const OrderBookSchema = z\n .object({\n market: CtfConditionIdSchema,\n asset_id: TokenIdSchema,\n timestamp: EpochMillisecondsStringSchema.nullish(),\n bids: z.array(OrderBookLevelSchema),\n asks: z.array(OrderBookLevelSchema),\n min_order_size: DecimalStringSchema,\n tick_size: OrderBookTickSizeSchema,\n neg_risk: z.boolean(),\n last_trade_price: DecimalStringSchema.nullish(),\n hash: OrderBookHashSchema,\n })\n .transform(\n ({\n market,\n asset_id,\n min_order_size,\n tick_size,\n neg_risk,\n last_trade_price,\n ...rest\n }) => ({\n ...rest,\n conditionId: market,\n tokenId: asset_id,\n minOrderSize: min_order_size,\n tickSize: tick_size,\n negRisk: neg_risk,\n lastTradePrice: last_trade_price,\n }),\n ) satisfies z.ZodType<OrderBook>;\n\nexport const FetchOrderBookResponseSchema = OrderBookSchema;\nexport const OrderBooksSchema = z.array(OrderBookSchema);\n\nexport type OrderBooks = OrderBook[];\nexport type FetchOrderBookResponse = OrderBook;\n","import { never, type TxHash } from '@polymarket/types';\nimport { z } from 'zod';\nimport {\n type DecimalString,\n DecimalStringSchema,\n type OrderId,\n OrderIdSchema,\n TxHashSchema,\n} from '../shared';\n\n// The API serializes unset decimal fields as empty strings, e.g. the\n// making/taking amounts on an order that rests on the book without matching.\n// Normalize to '0' so consumers never see '' as a DecimalString.\nconst OrderResponseAmountSchema = z.preprocess(\n (value) => (value === '' ? '0' : value),\n DecimalStringSchema,\n);\n\nconst OrderResponsePayloadSchema = z.object({\n errorMsg: z.string(),\n makingAmount: OrderResponseAmountSchema,\n orderID: z.string(),\n status: z.string(),\n success: z.boolean(),\n takingAmount: OrderResponseAmountSchema,\n tradeIDs: z.array(z.string()).default([]),\n transactionsHashes: z.array(z.string()).default([]),\n});\n\ntype OrderResponsePayload = z.infer<typeof OrderResponsePayloadSchema>;\n\n/**\n * Placement outcome of an accepted order.\n */\nexport enum OrderPostStatus {\n /** The order rests on the book without matching. */\n LIVE = 'live',\n /** The order matched, fully or partially, at placement. */\n MATCHED = 'matched',\n /** The market imposes a matching delay; the order is queued. */\n DELAYED = 'delayed',\n}\n\nexport const OrderPostStatusSchema = z.nativeEnum(OrderPostStatus);\n\nexport enum OrderResponseErrorCode {\n UNMATCHED = 'unmatched',\n MARKET_NOT_READY = 'market_not_ready',\n INSUFFICIENT_BALANCE_OR_ALLOWANCE = 'insufficient_balance_or_allowance',\n INVALID_NONCE = 'invalid_nonce',\n INVALID_EXPIRATION = 'invalid_expiration',\n POST_ONLY_WOULD_CROSS = 'post_only_would_cross',\n FOK_NOT_FILLED = 'fok_not_filled',\n FAK_NOT_FILLED = 'fak_not_filled',\n UNKNOWN = 'unknown',\n}\n\nexport const OrderResponseErrorCodeSchema = z.nativeEnum(\n OrderResponseErrorCode,\n);\n\n/**\n * A successfully placed order.\n */\nexport type AcceptedOrderResponse = {\n ok: true;\n /** Unique identifier of the placed order. */\n orderId: OrderId;\n /** Placement outcome. Fills only exist when the status is `matched`. */\n status: OrderPostStatus;\n /** Amount of the maker asset committed by fills at placement. `'0'` when the order did not match. */\n makingAmount: DecimalString;\n /** Amount of the taker asset received by fills at placement. `'0'` when the order did not match. */\n takingAmount: DecimalString;\n /**\n * Settlement transaction hashes for fills that occurred at placement.\n * Populated on a best-effort basis: settlement happens asynchronously, so\n * this can be empty even when the order matched. Follow the order's trades\n * to obtain hashes reliably.\n */\n transactionsHashes: TxHash[];\n /**\n * Identifiers of the trades created by fills at placement. Empty when the\n * order did not match. Later fills of a resting order create new trades\n * that are not listed here.\n */\n tradeIds: string[];\n};\n\n/**\n * An order the venue refused to place.\n */\nexport type RejectedOrderResponse = {\n ok: false;\n /** Machine-readable rejection reason. */\n code: OrderResponseErrorCode;\n /** Human-readable rejection message. */\n message: string;\n};\n\n/**\n * Result of posting an order, discriminated on `ok`.\n */\nexport type OrderResponse = AcceptedOrderResponse | RejectedOrderResponse;\n\n/**\n * Results of posting a batch of orders, in request order.\n */\nexport type OrderResponses = OrderResponse[];\n\nexport const AcceptedOrderResponseSchema = z.object({\n ok: z.literal(true),\n orderId: OrderIdSchema.refine((orderId) => orderId.length > 0),\n status: OrderPostStatusSchema,\n makingAmount: DecimalStringSchema,\n takingAmount: DecimalStringSchema,\n tradeIds: z.array(z.string()),\n transactionsHashes: z.array(TxHashSchema),\n});\n\nexport const RejectedOrderResponseSchema = z.object({\n ok: z.literal(false),\n code: OrderResponseErrorCodeSchema,\n message: z.string().min(1),\n});\n\nexport const OrderResponseSchema = OrderResponsePayloadSchema.transform(\n normalizeOrderResponse,\n);\n\nexport const OrderResponsesSchema = z.array(OrderResponseSchema);\n\nfunction isAcceptedOrderResponse(response: OrderResponsePayload): boolean {\n return (\n response.success &&\n response.errorMsg === '' &&\n response.orderID !== '' &&\n isOrderPostStatus(response.status)\n );\n}\n\nfunction parseOrderPostStatus(status: string): OrderPostStatus {\n switch (status) {\n case OrderPostStatus.LIVE:\n return OrderPostStatus.LIVE;\n case OrderPostStatus.MATCHED:\n return OrderPostStatus.MATCHED;\n case OrderPostStatus.DELAYED:\n return OrderPostStatus.DELAYED;\n default:\n never(`Unexpected order post status: ${status}`);\n }\n}\n\nfunction normalizeOrderResponse(response: OrderResponsePayload): OrderResponse {\n if (isAcceptedOrderResponse(response)) {\n return AcceptedOrderResponseSchema.parse({\n makingAmount: response.makingAmount,\n ok: true,\n orderId: response.orderID,\n status: parseOrderPostStatus(response.status),\n takingAmount: response.takingAmount,\n tradeIds: response.tradeIDs,\n transactionsHashes: response.transactionsHashes,\n });\n }\n\n return RejectedOrderResponseSchema.parse({\n code: inferOrderResponseErrorCode(response),\n message: response.errorMsg || 'Unknown order failure',\n ok: false,\n });\n}\n\nfunction inferOrderResponseErrorCode(\n response: OrderResponsePayload,\n): OrderResponseErrorCode {\n // This is a boundary heuristic over legacy mixed `success`/`status`/`errorMsg`\n // fields. It is intentionally temporary and should be removed once the API\n // exposes structured success and error variants directly.\n if (response.status === 'unmatched') {\n return OrderResponseErrorCode.UNMATCHED;\n }\n\n switch (response.errorMsg) {\n case 'the market is not yet ready to process new orders':\n return OrderResponseErrorCode.MARKET_NOT_READY;\n case 'invalid nonce':\n return OrderResponseErrorCode.INVALID_NONCE;\n case 'invalid expiration':\n return OrderResponseErrorCode.INVALID_EXPIRATION;\n case 'invalid post-only order: order crosses book':\n return OrderResponseErrorCode.POST_ONLY_WOULD_CROSS;\n case \"order couldn't be fully filled. FOK orders are fully filled or killed.\":\n return OrderResponseErrorCode.FOK_NOT_FILLED;\n case 'no orders found to match with FAK order. FAK orders are partially filled or killed if no match is found.':\n return OrderResponseErrorCode.FAK_NOT_FILLED;\n }\n\n // CLOB currently returns one legacy text bucket for both balance and\n // allowance failures, so expose a combined structured code here.\n if (response.errorMsg.includes('not enough balance / allowance')) {\n return OrderResponseErrorCode.INSUFFICIENT_BALANCE_OR_ALLOWANCE;\n }\n\n return OrderResponseErrorCode.UNKNOWN;\n}\n\nfunction isOrderPostStatus(status: string): status is OrderPostStatus {\n return (\n status === OrderPostStatus.LIVE ||\n status === OrderPostStatus.MATCHED ||\n status === OrderPostStatus.DELAYED\n );\n}\n","export const END_CURSOR = 'LTE=';\n","import { z } from 'zod';\nimport {\n CtfConditionIdSchema,\n DecimalishSchema,\n EpochMillisecondsToIsoDateTimeStringSchema,\n TokenIdSchema,\n} from '../shared';\n\nconst CurrentRewardConfigSchema = z\n .object({\n id: z.number().int().optional(),\n asset_address: z.string(),\n start_date: EpochMillisecondsToIsoDateTimeStringSchema,\n end_date: EpochMillisecondsToIsoDateTimeStringSchema.optional(),\n rate_per_day: DecimalishSchema,\n total_rewards: DecimalishSchema.optional(),\n })\n .transform(\n ({\n asset_address,\n start_date,\n end_date,\n rate_per_day,\n total_rewards,\n ...rest\n }) => ({\n ...rest,\n assetAddress: asset_address,\n startDate: start_date,\n endDate: end_date,\n ratePerDay: rate_per_day,\n totalRewards: total_rewards,\n }),\n );\nexport type CurrentRewardConfig = z.infer<typeof CurrentRewardConfigSchema>;\n\nexport const CurrentRewardSchema = z\n .object({\n condition_id: CtfConditionIdSchema,\n rewards_max_spread: z.number().optional(),\n rewards_min_size: DecimalishSchema.optional(),\n rewards_config: z.array(CurrentRewardConfigSchema).optional(),\n sponsored_daily_rate: DecimalishSchema.optional(),\n sponsors_count: z.number().int().optional(),\n native_daily_rate: DecimalishSchema.optional(),\n total_daily_rate: DecimalishSchema.optional(),\n })\n .transform(\n ({\n condition_id,\n rewards_max_spread,\n rewards_min_size,\n rewards_config,\n sponsored_daily_rate,\n sponsors_count,\n native_daily_rate,\n total_daily_rate,\n ...rest\n }) => ({\n ...rest,\n conditionId: condition_id,\n rewardsMaxSpread: rewards_max_spread,\n rewardsMinSize: rewards_min_size,\n rewardsConfig: rewards_config,\n sponsoredDailyRate: sponsored_daily_rate,\n sponsorsCount: sponsors_count,\n nativeDailyRate: native_daily_rate,\n totalDailyRate: total_daily_rate,\n }),\n );\nexport type CurrentReward = z.infer<typeof CurrentRewardSchema>;\n\nexport const PaginatedCurrentRewardsSchema = z\n .object({\n limit: z.number().int(),\n count: z.number().int(),\n next_cursor: z.string(),\n data: z.array(CurrentRewardSchema),\n })\n .transform(({ next_cursor, ...rest }) => ({\n ...rest,\n nextCursor: next_cursor,\n }));\nexport type PaginatedCurrentRewards = z.infer<\n typeof PaginatedCurrentRewardsSchema\n>;\n\nconst RewardTokenSchema = z\n .object({\n token_id: TokenIdSchema,\n outcome: z.string(),\n price: DecimalishSchema,\n })\n .transform(({ token_id, ...rest }) => ({\n ...rest,\n tokenId: token_id,\n }));\nexport type RewardToken = z.infer<typeof RewardTokenSchema>;\n\nconst RewardConfigSchema = z\n .object({\n asset_address: z.string(),\n start_date: EpochMillisecondsToIsoDateTimeStringSchema,\n end_date: EpochMillisecondsToIsoDateTimeStringSchema.optional(),\n rate_per_day: DecimalishSchema,\n total_rewards: DecimalishSchema.optional(),\n })\n .transform(\n ({\n asset_address,\n start_date,\n end_date,\n rate_per_day,\n total_rewards,\n ...rest\n }) => ({\n ...rest,\n assetAddress: asset_address,\n startDate: start_date,\n endDate: end_date,\n ratePerDay: rate_per_day,\n totalRewards: total_rewards,\n }),\n );\nexport type RewardConfig = z.infer<typeof RewardConfigSchema>;\n\nexport const MarketRewardSchema = z\n .object({\n condition_id: CtfConditionIdSchema,\n question: z.string(),\n market_slug: z.string().optional(),\n event_slug: z.string().optional(),\n image: z.string().optional(),\n rewards_max_spread: z.number().optional(),\n rewards_min_size: DecimalishSchema.optional(),\n market_competitiveness: z.number().optional(),\n tokens: z.array(RewardTokenSchema),\n rewards_config: z.array(RewardConfigSchema).optional(),\n })\n .transform(\n ({\n condition_id,\n market_slug,\n event_slug,\n rewards_max_spread,\n rewards_min_size,\n market_competitiveness,\n rewards_config,\n ...rest\n }) => ({\n ...rest,\n conditionId: condition_id,\n marketSlug: market_slug,\n eventSlug: event_slug,\n rewardsMaxSpread: rewards_max_spread,\n rewardsMinSize: rewards_min_size,\n marketCompetitiveness: market_competitiveness,\n rewardsConfig: rewards_config,\n }),\n );\nexport type MarketReward = z.infer<typeof MarketRewardSchema>;\n\nexport const PaginatedMarketRewardsSchema = z\n .object({\n limit: z.number().int(),\n count: z.number().int(),\n next_cursor: z.string(),\n data: z.array(MarketRewardSchema),\n })\n .transform(({ next_cursor, ...rest }) => ({\n ...rest,\n nextCursor: next_cursor,\n }));\nexport type PaginatedMarketRewards = z.infer<\n typeof PaginatedMarketRewardsSchema\n>;\n","import { z } from 'zod';\nimport { TickSizeValueSchema } from '../shared';\n\nexport const TickSizeSchema = z\n .object({\n minimum_tick_size: TickSizeValueSchema,\n })\n .transform(({ minimum_tick_size, ...rest }) => ({\n ...rest,\n minimumTickSize: minimum_tick_size,\n }));\n\nexport const FetchTickSizeResponseSchema = TickSizeSchema;\n\nexport type TickSize = z.infer<typeof TickSizeSchema>;\nexport type FetchTickSizeResponse = z.infer<typeof FetchTickSizeResponseSchema>;\n"]}
|
package/package.json
CHANGED