@varla/polymarket 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +78 -0
- package/dist/abi/ctf-exchange.d.ts +302 -0
- package/dist/abi/ctf-exchange.d.ts.map +1 -0
- package/dist/abi/erc20.d.ts +152 -0
- package/dist/abi/erc20.d.ts.map +1 -0
- package/dist/abi/index.d.ts +8 -0
- package/dist/abi/index.d.ts.map +1 -0
- package/dist/bridge-client.d.ts +76 -0
- package/dist/bridge-client.d.ts.map +1 -0
- package/dist/clob-auth.d.ts +106 -0
- package/dist/clob-auth.d.ts.map +1 -0
- package/dist/clob-client.d.ts +83 -0
- package/dist/clob-client.d.ts.map +1 -0
- package/dist/clob-errors.d.ts +74 -0
- package/dist/clob-errors.d.ts.map +1 -0
- package/dist/clob-orders.d.ts +81 -0
- package/dist/clob-orders.d.ts.map +1 -0
- package/dist/clob-persistence.d.ts +83 -0
- package/dist/clob-persistence.d.ts.map +1 -0
- package/dist/clob-trading-client.d.ts +259 -0
- package/dist/clob-trading-client.d.ts.map +1 -0
- package/dist/clob-trading-types.d.ts +522 -0
- package/dist/clob-trading-types.d.ts.map +1 -0
- package/dist/clob-ws.d.ts +111 -0
- package/dist/clob-ws.d.ts.map +1 -0
- package/dist/clob.d.ts +22 -0
- package/dist/clob.d.ts.map +1 -0
- package/dist/config/contracts.d.ts +36 -0
- package/dist/config/contracts.d.ts.map +1 -0
- package/dist/config/endpoints.d.ts +135 -0
- package/dist/config/endpoints.d.ts.map +1 -0
- package/dist/config/index.d.ts +9 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/rounding.d.ts +109 -0
- package/dist/config/rounding.d.ts.map +1 -0
- package/dist/data-api-client.d.ts +157 -0
- package/dist/data-api-client.d.ts.map +1 -0
- package/dist/endpoints.d.ts +7 -0
- package/dist/endpoints.d.ts.map +1 -0
- package/dist/gamma-client.d.ts +211 -0
- package/dist/gamma-client.d.ts.map +1 -0
- package/dist/http.d.ts +26 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/resolver.d.ts +26 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/sdk/client.d.ts +109 -0
- package/dist/sdk/client.d.ts.map +1 -0
- package/dist/sdk/constants.d.ts +2 -0
- package/dist/sdk/constants.d.ts.map +1 -0
- package/dist/sdk/errors.d.ts +5 -0
- package/dist/sdk/errors.d.ts.map +1 -0
- package/dist/sdk/headers.d.ts +6 -0
- package/dist/sdk/headers.d.ts.map +1 -0
- package/dist/sdk/http-helpers.d.ts +21 -0
- package/dist/sdk/http-helpers.d.ts.map +1 -0
- package/dist/sdk/index.d.ts +9 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/market-price.d.ts +13 -0
- package/dist/sdk/market-price.d.ts.map +1 -0
- package/dist/sdk/order-builder.d.ts +19 -0
- package/dist/sdk/order-builder.d.ts.map +1 -0
- package/dist/sdk/rfq-client.d.ts +19 -0
- package/dist/sdk/rfq-client.d.ts.map +1 -0
- package/dist/sdk/rfq-deps.d.ts +33 -0
- package/dist/sdk/rfq-deps.d.ts.map +1 -0
- package/dist/sdk/types.d.ts +261 -0
- package/dist/sdk/types.d.ts.map +1 -0
- package/dist/sdk/utilities.d.ts +8 -0
- package/dist/sdk/utilities.d.ts.map +1 -0
- package/dist/signing/clob-auth-eip712.d.ts +30 -0
- package/dist/signing/clob-auth-eip712.d.ts.map +1 -0
- package/dist/signing/ctf-order-eip712.d.ts +27 -0
- package/dist/signing/ctf-order-eip712.d.ts.map +1 -0
- package/dist/signing/hmac.d.ts +14 -0
- package/dist/signing/hmac.d.ts.map +1 -0
- package/dist/types.d.ts +624 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/concurrency.d.ts +10 -0
- package/dist/utils/concurrency.d.ts.map +1 -0
- package/dist/utils/retry.d.ts +24 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/package.json +8 -3
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polymarket contract addresses per chain.
|
|
3
|
+
*
|
|
4
|
+
* Addresses sourced from official @polymarket/clob-client SDK.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/Polymarket/clob-client/blob/main/src/config.ts
|
|
7
|
+
*/
|
|
8
|
+
export type ContractConfig = {
|
|
9
|
+
/** CTF Exchange contract (standard markets) */
|
|
10
|
+
exchange: `0x${string}`;
|
|
11
|
+
/** Neg Risk Adapter contract */
|
|
12
|
+
negRiskAdapter: `0x${string}`;
|
|
13
|
+
/** Neg Risk Exchange contract (for neg-risk markets) */
|
|
14
|
+
negRiskExchange: `0x${string}`;
|
|
15
|
+
/** USDC collateral token */
|
|
16
|
+
collateral: `0x${string}`;
|
|
17
|
+
/** Conditional Tokens Framework (ERC1155) */
|
|
18
|
+
conditionalTokens: `0x${string}`;
|
|
19
|
+
};
|
|
20
|
+
/** USDC and CT both use 6 decimals */
|
|
21
|
+
export declare const COLLATERAL_TOKEN_DECIMALS = 6;
|
|
22
|
+
export declare const CONDITIONAL_TOKEN_DECIMALS = 6;
|
|
23
|
+
/** Supported chain IDs */
|
|
24
|
+
export type SupportedChainId = 137 | 80002;
|
|
25
|
+
/**
|
|
26
|
+
* Get contract configuration for a given chain ID.
|
|
27
|
+
*
|
|
28
|
+
* @param chainId - Polygon mainnet (137) or Amoy testnet (80002)
|
|
29
|
+
* @throws If chainId is not supported
|
|
30
|
+
*/
|
|
31
|
+
export declare function getContractConfig(chainId: SupportedChainId): ContractConfig;
|
|
32
|
+
/**
|
|
33
|
+
* Get the appropriate exchange address based on market type.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getExchangeAddress(chainId: SupportedChainId, negRisk: boolean): `0x${string}`;
|
|
36
|
+
//# sourceMappingURL=contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/config/contracts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,cAAc,GAAG;IAC3B,+CAA+C;IAC/C,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;IACxB,gCAAgC;IAChC,cAAc,EAAE,KAAK,MAAM,EAAE,CAAC;IAC9B,wDAAwD;IACxD,eAAe,EAAE,KAAK,MAAM,EAAE,CAAC;IAC/B,4BAA4B;IAC5B,UAAU,EAAE,KAAK,MAAM,EAAE,CAAC;IAC1B,6CAA6C;IAC7C,iBAAiB,EAAE,KAAK,MAAM,EAAE,CAAC;CAClC,CAAC;AAwBF,sCAAsC;AACtC,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAC3C,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C,0BAA0B;AAC1B,MAAM,MAAM,gBAAgB,GAAG,GAAG,GAAG,KAAK,CAAC;AAE3C;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,GAAG,cAAc,CAS3E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,GAAG,KAAK,MAAM,EAAE,CAG7F"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polymarket CLOB API endpoints.
|
|
3
|
+
*
|
|
4
|
+
* All paths are relative to the CLOB host (e.g., https://clob.polymarket.com).
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/Polymarket/clob-client/blob/main/src/endpoints.ts
|
|
7
|
+
*/
|
|
8
|
+
/** Server time */
|
|
9
|
+
export declare const TIME = "/time";
|
|
10
|
+
/** Create new API key (POST, L1 auth) */
|
|
11
|
+
export declare const CREATE_API_KEY = "/auth/api-key";
|
|
12
|
+
/** Derive existing API key (GET, L1 auth) */
|
|
13
|
+
export declare const DERIVE_API_KEY = "/auth/derive-api-key";
|
|
14
|
+
/** Get all API keys (GET, L2 auth) */
|
|
15
|
+
export declare const GET_API_KEYS = "/auth/api-keys";
|
|
16
|
+
/** Delete API key (DELETE, L2 auth) */
|
|
17
|
+
export declare const DELETE_API_KEY = "/auth/api-key";
|
|
18
|
+
/** Get ban/closed-only status (GET, L2 auth) */
|
|
19
|
+
export declare const CLOSED_ONLY = "/auth/ban-status/closed-only";
|
|
20
|
+
/** Create readonly API key (POST, L2 auth) */
|
|
21
|
+
export declare const CREATE_READONLY_API_KEY = "/auth/readonly-api-key";
|
|
22
|
+
/** Get readonly API keys (GET, L2 auth) */
|
|
23
|
+
export declare const GET_READONLY_API_KEYS = "/auth/readonly-api-keys";
|
|
24
|
+
/** Delete readonly API key (DELETE, L2 auth) */
|
|
25
|
+
export declare const DELETE_READONLY_API_KEY = "/auth/readonly-api-key";
|
|
26
|
+
/** Validate readonly API key (GET, public) */
|
|
27
|
+
export declare const VALIDATE_READONLY_API_KEY = "/auth/validate-readonly-api-key";
|
|
28
|
+
/** Create builder API key (POST, L2 auth) */
|
|
29
|
+
export declare const CREATE_BUILDER_API_KEY = "/auth/builder-api-key";
|
|
30
|
+
/** Get builder API keys (GET, L2 auth) */
|
|
31
|
+
export declare const GET_BUILDER_API_KEYS = "/auth/builder-api-key";
|
|
32
|
+
/** Revoke builder API key (DELETE, builder auth) */
|
|
33
|
+
export declare const REVOKE_BUILDER_API_KEY = "/auth/builder-api-key";
|
|
34
|
+
/** Get paginated simplified markets */
|
|
35
|
+
export declare const GET_SAMPLING_SIMPLIFIED_MARKETS = "/sampling-simplified-markets";
|
|
36
|
+
/** Get paginated markets with full data */
|
|
37
|
+
export declare const GET_SAMPLING_MARKETS = "/sampling-markets";
|
|
38
|
+
/** Get simplified markets */
|
|
39
|
+
export declare const GET_SIMPLIFIED_MARKETS = "/simplified-markets";
|
|
40
|
+
/** Get all markets */
|
|
41
|
+
export declare const GET_MARKETS = "/markets";
|
|
42
|
+
/** Get single market by condition ID */
|
|
43
|
+
export declare const GET_MARKET = "/markets/";
|
|
44
|
+
/** Get order book for a token (GET, params: token_id) */
|
|
45
|
+
export declare const GET_ORDER_BOOK = "/book";
|
|
46
|
+
/** Get multiple order books (POST, body: BookParams[]) */
|
|
47
|
+
export declare const GET_ORDER_BOOKS = "/books";
|
|
48
|
+
/** Get midpoint price (GET, params: token_id) */
|
|
49
|
+
export declare const GET_MIDPOINT = "/midpoint";
|
|
50
|
+
/** Get multiple midpoints (POST, body: BookParams[]) */
|
|
51
|
+
export declare const GET_MIDPOINTS = "/midpoints";
|
|
52
|
+
/** Get best price (GET, params: token_id, side) */
|
|
53
|
+
export declare const GET_PRICE = "/price";
|
|
54
|
+
/** Get multiple prices (POST, body: BookParams[]) */
|
|
55
|
+
export declare const GET_PRICES = "/prices";
|
|
56
|
+
/** Get spread (GET, params: token_id) */
|
|
57
|
+
export declare const GET_SPREAD = "/spread";
|
|
58
|
+
/** Get multiple spreads (POST, body: BookParams[]) */
|
|
59
|
+
export declare const GET_SPREADS = "/spreads";
|
|
60
|
+
/** Get last trade price (GET, params: token_id) */
|
|
61
|
+
export declare const GET_LAST_TRADE_PRICE = "/last-trade-price";
|
|
62
|
+
/** Get multiple last trade prices (POST, body: BookParams[]) */
|
|
63
|
+
export declare const GET_LAST_TRADES_PRICES = "/last-trades-prices";
|
|
64
|
+
/** Get tick size for a token (GET, params: token_id) */
|
|
65
|
+
export declare const GET_TICK_SIZE = "/tick-size";
|
|
66
|
+
/** Check if market is neg-risk (GET, params: token_id) */
|
|
67
|
+
export declare const GET_NEG_RISK = "/neg-risk";
|
|
68
|
+
/** Get fee rate for a token (GET, params: token_id) */
|
|
69
|
+
export declare const GET_FEE_RATE = "/fee-rate";
|
|
70
|
+
/** Post a single order (POST, L2 auth) */
|
|
71
|
+
export declare const POST_ORDER = "/order";
|
|
72
|
+
/** Post multiple orders (POST, L2 auth) */
|
|
73
|
+
export declare const POST_ORDERS = "/orders";
|
|
74
|
+
/** Cancel a single order (DELETE, L2 auth) */
|
|
75
|
+
export declare const CANCEL_ORDER = "/order";
|
|
76
|
+
/** Cancel multiple orders by hash (DELETE, L2 auth) */
|
|
77
|
+
export declare const CANCEL_ORDERS = "/orders";
|
|
78
|
+
/** Cancel all open orders (DELETE, L2 auth) */
|
|
79
|
+
export declare const CANCEL_ALL = "/cancel-all";
|
|
80
|
+
/** Cancel orders by market (DELETE, L2 auth) */
|
|
81
|
+
export declare const CANCEL_MARKET_ORDERS = "/cancel-market-orders";
|
|
82
|
+
/** Get order by ID (GET, L2 auth) */
|
|
83
|
+
export declare const GET_ORDER = "/data/order/";
|
|
84
|
+
/** Get open orders (GET, L2 auth) */
|
|
85
|
+
export declare const GET_OPEN_ORDERS = "/data/orders";
|
|
86
|
+
/** Get trade history (GET, L2 auth) */
|
|
87
|
+
export declare const GET_TRADES = "/data/trades";
|
|
88
|
+
/** Check if single order is scoring (GET, L2 auth) */
|
|
89
|
+
export declare const IS_ORDER_SCORING = "/order-scoring";
|
|
90
|
+
/** Check if multiple orders are scoring (POST, L2 auth) */
|
|
91
|
+
export declare const ARE_ORDERS_SCORING = "/orders-scoring";
|
|
92
|
+
/** Get builder trades (GET, builder auth) */
|
|
93
|
+
export declare const GET_BUILDER_TRADES = "/builder/trades";
|
|
94
|
+
/** Get historical prices (GET, params: PriceHistoryFilterParams) */
|
|
95
|
+
export declare const GET_PRICES_HISTORY = "/prices-history";
|
|
96
|
+
/** Get notifications (GET, L2 auth) */
|
|
97
|
+
export declare const GET_NOTIFICATIONS = "/notifications";
|
|
98
|
+
/** Drop/dismiss notifications (DELETE, L2 auth) */
|
|
99
|
+
export declare const DROP_NOTIFICATIONS = "/notifications";
|
|
100
|
+
/** Get balance and allowance (GET, L2 auth) */
|
|
101
|
+
export declare const GET_BALANCE_ALLOWANCE = "/balance-allowance";
|
|
102
|
+
/** Update/refresh balance allowance cache (GET, L2 auth) */
|
|
103
|
+
export declare const UPDATE_BALANCE_ALLOWANCE = "/balance-allowance/update";
|
|
104
|
+
/** Get market trade events by condition ID */
|
|
105
|
+
export declare const GET_MARKET_TRADES_EVENTS = "/live-activity/events/";
|
|
106
|
+
/** Get earnings for user for a specific day */
|
|
107
|
+
export declare const GET_EARNINGS_FOR_USER_FOR_DAY = "/rewards/user";
|
|
108
|
+
/** Get total earnings for user for a specific day */
|
|
109
|
+
export declare const GET_TOTAL_EARNINGS_FOR_USER_FOR_DAY = "/rewards/user/total";
|
|
110
|
+
/** Get liquidity reward percentages */
|
|
111
|
+
export declare const GET_LIQUIDITY_REWARD_PERCENTAGES = "/rewards/user/percentages";
|
|
112
|
+
/** Get current reward markets */
|
|
113
|
+
export declare const GET_REWARDS_MARKETS_CURRENT = "/rewards/markets/current";
|
|
114
|
+
/** Get rewards for specific market */
|
|
115
|
+
export declare const GET_REWARDS_MARKETS = "/rewards/markets/";
|
|
116
|
+
/** Get user's earnings and market config */
|
|
117
|
+
export declare const GET_REWARDS_EARNINGS_PERCENTAGES = "/rewards/user/markets";
|
|
118
|
+
/** Post heartbeat to keep session alive (POST, L2 auth) */
|
|
119
|
+
export declare const POST_HEARTBEAT = "/v1/heartbeats";
|
|
120
|
+
export declare const CREATE_RFQ_REQUEST = "/rfq/request";
|
|
121
|
+
export declare const CANCEL_RFQ_REQUEST = "/rfq/request";
|
|
122
|
+
export declare const GET_RFQ_REQUESTS = "/rfq/data/requests";
|
|
123
|
+
export declare const CREATE_RFQ_QUOTE = "/rfq/quote";
|
|
124
|
+
export declare const CANCEL_RFQ_QUOTE = "/rfq/quote";
|
|
125
|
+
export declare const RFQ_REQUESTS_ACCEPT = "/rfq/request/accept";
|
|
126
|
+
export declare const RFQ_QUOTE_APPROVE = "/rfq/quote/approve";
|
|
127
|
+
export declare const GET_RFQ_REQUESTER_QUOTES = "/rfq/data/requester/quotes";
|
|
128
|
+
export declare const GET_RFQ_QUOTER_QUOTES = "/rfq/data/quoter/quotes";
|
|
129
|
+
export declare const GET_RFQ_BEST_QUOTE = "/rfq/data/best-quote";
|
|
130
|
+
export declare const RFQ_CONFIG = "/rfq/config";
|
|
131
|
+
/** Initial cursor for paginated requests */
|
|
132
|
+
export declare const INITIAL_CURSOR = "MA==";
|
|
133
|
+
/** End cursor indicating no more pages */
|
|
134
|
+
export declare const END_CURSOR = "LTE=";
|
|
135
|
+
//# sourceMappingURL=endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../src/config/endpoints.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,kBAAkB;AAClB,eAAO,MAAM,IAAI,UAAU,CAAC;AAM5B,yCAAyC;AACzC,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAE9C,6CAA6C;AAC7C,eAAO,MAAM,cAAc,yBAAyB,CAAC;AAErD,sCAAsC;AACtC,eAAO,MAAM,YAAY,mBAAmB,CAAC;AAE7C,uCAAuC;AACvC,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAE9C,gDAAgD;AAChD,eAAO,MAAM,WAAW,iCAAiC,CAAC;AAM1D,8CAA8C;AAC9C,eAAO,MAAM,uBAAuB,2BAA2B,CAAC;AAEhE,2CAA2C;AAC3C,eAAO,MAAM,qBAAqB,4BAA4B,CAAC;AAE/D,gDAAgD;AAChD,eAAO,MAAM,uBAAuB,2BAA2B,CAAC;AAEhE,8CAA8C;AAC9C,eAAO,MAAM,yBAAyB,oCAAoC,CAAC;AAM3E,6CAA6C;AAC7C,eAAO,MAAM,sBAAsB,0BAA0B,CAAC;AAE9D,0CAA0C;AAC1C,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAE5D,oDAAoD;AACpD,eAAO,MAAM,sBAAsB,0BAA0B,CAAC;AAM9D,uCAAuC;AACvC,eAAO,MAAM,+BAA+B,iCAAiC,CAAC;AAE9E,2CAA2C;AAC3C,eAAO,MAAM,oBAAoB,sBAAsB,CAAC;AAExD,6BAA6B;AAC7B,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAE5D,sBAAsB;AACtB,eAAO,MAAM,WAAW,aAAa,CAAC;AAEt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AqB,4BAA4B,CAAC;AAC/D,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AACzD,eAAO,MAAM,UAAU,gBAAgB,CAAC;AAMxC,4CAA4C;AAC5C,eAAO,MAAM,cAAc,SAAS,CAAC;AAErC,0CAA0C;AAC1C,eAAO,MAAM,UAAU,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polymarket configuration exports.
|
|
3
|
+
*
|
|
4
|
+
* @module @varla/polymarket/config
|
|
5
|
+
*/
|
|
6
|
+
export { type ContractConfig, type SupportedChainId, COLLATERAL_TOKEN_DECIMALS, CONDITIONAL_TOKEN_DECIMALS, getContractConfig, getExchangeAddress, } from "./contracts.js";
|
|
7
|
+
export * from "./endpoints.js";
|
|
8
|
+
export { type TickSize, type RoundConfig, type RawOrderAmounts, ROUNDING_CONFIG, decimalPlaces, roundNormal, roundDown, roundUp, priceValid, isTickSizeSmaller, getRoundConfig, getOrderRawAmounts, getMarketOrderRawAmounts, toTokenUnits, fromTokenUnits, } from "./rounding.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAGxB,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,eAAe,EACf,aAAa,EACb,WAAW,EACX,SAAS,EACT,OAAO,EACP,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,YAAY,EACZ,cAAc,GACf,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tick-size aware rounding for Polymarket orders.
|
|
3
|
+
*
|
|
4
|
+
* Different markets have different minimum tick sizes (price increments).
|
|
5
|
+
* This module provides rounding utilities that ensure order amounts
|
|
6
|
+
* are properly formatted for each tick size.
|
|
7
|
+
*
|
|
8
|
+
* @see https://github.com/Polymarket/clob-client/blob/main/src/order-builder/helpers.ts
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Supported tick sizes on Polymarket.
|
|
12
|
+
* Markets with higher liquidity tend to have smaller tick sizes.
|
|
13
|
+
*/
|
|
14
|
+
export type TickSize = "0.1" | "0.01" | "0.001" | "0.0001";
|
|
15
|
+
/**
|
|
16
|
+
* Rounding configuration for each tick size.
|
|
17
|
+
*
|
|
18
|
+
* - price: decimal places for price
|
|
19
|
+
* - size: decimal places for size (always 2)
|
|
20
|
+
* - amount: decimal places for USDC amount (makerAmount/takerAmount)
|
|
21
|
+
*/
|
|
22
|
+
export type RoundConfig = {
|
|
23
|
+
price: number;
|
|
24
|
+
size: number;
|
|
25
|
+
amount: number;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Rounding configuration per tick size.
|
|
29
|
+
* Ported from official SDK.
|
|
30
|
+
*/
|
|
31
|
+
export declare const ROUNDING_CONFIG: Record<TickSize, RoundConfig>;
|
|
32
|
+
/**
|
|
33
|
+
* Count decimal places in a number.
|
|
34
|
+
*/
|
|
35
|
+
export declare function decimalPlaces(num: number): number;
|
|
36
|
+
/**
|
|
37
|
+
* Round number to specified decimal places (standard rounding).
|
|
38
|
+
*/
|
|
39
|
+
export declare function roundNormal(num: number, decimals: number): number;
|
|
40
|
+
/**
|
|
41
|
+
* Round number down (floor) to specified decimal places.
|
|
42
|
+
*/
|
|
43
|
+
export declare function roundDown(num: number, decimals: number): number;
|
|
44
|
+
/**
|
|
45
|
+
* Round number up (ceil) to specified decimal places.
|
|
46
|
+
*/
|
|
47
|
+
export declare function roundUp(num: number, decimals: number): number;
|
|
48
|
+
/**
|
|
49
|
+
* Validate that a price is valid for the given tick size.
|
|
50
|
+
* Price must be between tick_size and (1 - tick_size).
|
|
51
|
+
*/
|
|
52
|
+
export declare function priceValid(price: number, tickSize: TickSize): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Check if tick size A is smaller than tick size B.
|
|
55
|
+
*/
|
|
56
|
+
export declare function isTickSizeSmaller(a: TickSize, b: TickSize): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Get rounding config for a tick size.
|
|
59
|
+
*/
|
|
60
|
+
export declare function getRoundConfig(tickSize: TickSize): RoundConfig;
|
|
61
|
+
/**
|
|
62
|
+
* Raw amounts for a limit order (BUY or SELL).
|
|
63
|
+
*
|
|
64
|
+
* For BUY orders:
|
|
65
|
+
* - makerAmount = USDC being offered
|
|
66
|
+
* - takerAmount = shares being requested
|
|
67
|
+
*
|
|
68
|
+
* For SELL orders:
|
|
69
|
+
* - makerAmount = shares being offered
|
|
70
|
+
* - takerAmount = USDC being requested
|
|
71
|
+
*/
|
|
72
|
+
export type RawOrderAmounts = {
|
|
73
|
+
side: "BUY" | "SELL";
|
|
74
|
+
rawMakerAmt: number;
|
|
75
|
+
rawTakerAmt: number;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Calculate raw order amounts for a limit order.
|
|
79
|
+
*
|
|
80
|
+
* This implements the official SDK's sophisticated rounding logic
|
|
81
|
+
* that ensures amounts are properly formatted for the tick size.
|
|
82
|
+
*
|
|
83
|
+
* @param side - BUY or SELL
|
|
84
|
+
* @param size - Number of shares
|
|
85
|
+
* @param price - Price per share (0 < price < 1)
|
|
86
|
+
* @param roundConfig - Rounding configuration for the market's tick size
|
|
87
|
+
*/
|
|
88
|
+
export declare function getOrderRawAmounts(side: "BUY" | "SELL", size: number, price: number, roundConfig: RoundConfig): RawOrderAmounts;
|
|
89
|
+
/**
|
|
90
|
+
* Calculate raw order amounts for a market order.
|
|
91
|
+
*
|
|
92
|
+
* Market orders specify an AMOUNT (USDC for buy, shares for sell)
|
|
93
|
+
* rather than a SIZE.
|
|
94
|
+
*
|
|
95
|
+
* @param side - BUY or SELL
|
|
96
|
+
* @param amount - USDC amount (buy) or share amount (sell)
|
|
97
|
+
* @param price - Price calculated from orderbook
|
|
98
|
+
* @param roundConfig - Rounding configuration
|
|
99
|
+
*/
|
|
100
|
+
export declare function getMarketOrderRawAmounts(side: "BUY" | "SELL", amount: number, price: number, roundConfig: RoundConfig): RawOrderAmounts;
|
|
101
|
+
/**
|
|
102
|
+
* Convert a raw decimal amount to token units (6 decimals).
|
|
103
|
+
*/
|
|
104
|
+
export declare function toTokenUnits(amount: number): bigint;
|
|
105
|
+
/**
|
|
106
|
+
* Convert token units back to decimal amount.
|
|
107
|
+
*/
|
|
108
|
+
export declare function fromTokenUnits(units: bigint): number;
|
|
109
|
+
//# sourceMappingURL=rounding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rounding.d.ts","sourceRoot":"","sources":["../../src/config/rounding.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,WAAW,CAqBzD,CAAC;AAEF;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMjD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGjE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,E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
+
*
|
|
6
|
+
* @see https://docs.polymarket.com/api-reference/core/get-current-positions-for-a-user
|
|
7
|
+
*/
|
|
8
|
+
import type { DataActivity, DataClosedPosition, DataLeaderboardEntry, DataMarketsTraded, DataOpenInterest, DataOrderBookSummary, DataPosition, DataPositionValue, DataPriceHistory, DataSpread, DataTopHolder, DataTrade, DataVolume } from "./types.js";
|
|
9
|
+
export type DataApiClientOpts = {
|
|
10
|
+
/** Optional override for Data API base URL. */
|
|
11
|
+
baseUrl?: string;
|
|
12
|
+
timeoutMs?: number;
|
|
13
|
+
maxAttempts?: number;
|
|
14
|
+
fetchFn?: typeof fetch;
|
|
15
|
+
retry?: {
|
|
16
|
+
baseBackoffMs?: number;
|
|
17
|
+
maxBackoffMs?: number;
|
|
18
|
+
multiplier?: number;
|
|
19
|
+
jitterFactor?: number;
|
|
20
|
+
};
|
|
21
|
+
log?: (level: "debug" | "info" | "warn" | "error", msg: string, fields?: Record<string, unknown>) => void;
|
|
22
|
+
};
|
|
23
|
+
export declare class DataApiClient {
|
|
24
|
+
readonly baseUrl: string;
|
|
25
|
+
readonly timeoutMs: number;
|
|
26
|
+
readonly maxAttempts: number;
|
|
27
|
+
readonly fetchFn: typeof fetch;
|
|
28
|
+
readonly retry: Required<NonNullable<DataApiClientOpts["retry"]>>;
|
|
29
|
+
readonly log?: DataApiClientOpts["log"];
|
|
30
|
+
constructor(opts?: DataApiClientOpts);
|
|
31
|
+
private isRetryable;
|
|
32
|
+
private request;
|
|
33
|
+
/**
|
|
34
|
+
* Get current positions for a user.
|
|
35
|
+
* @see https://docs.polymarket.com/api-reference/core/get-current-positions-for-a-user
|
|
36
|
+
*/
|
|
37
|
+
getCurrentPositions(params: {
|
|
38
|
+
address: string;
|
|
39
|
+
conditionId?: string;
|
|
40
|
+
limit?: number;
|
|
41
|
+
offset?: number;
|
|
42
|
+
}): Promise<DataPosition[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Get closed positions for a user.
|
|
45
|
+
* @see https://docs.polymarket.com/api-reference/core/get-closed-positions-for-a-user
|
|
46
|
+
*/
|
|
47
|
+
getClosedPositions(params: {
|
|
48
|
+
address: string;
|
|
49
|
+
limit?: number;
|
|
50
|
+
offset?: number;
|
|
51
|
+
}): Promise<DataClosedPosition[]>;
|
|
52
|
+
/**
|
|
53
|
+
* Get total value of a user's positions.
|
|
54
|
+
* @see https://docs.polymarket.com/api-reference/core/get-total-value-of-a-users-positions
|
|
55
|
+
*/
|
|
56
|
+
getTotalPositionValue(address: string): Promise<DataPositionValue>;
|
|
57
|
+
/**
|
|
58
|
+
* Get trades for a user or market.
|
|
59
|
+
* @see https://docs.polymarket.com/api-reference/core/get-trades-for-a-user-or-markets
|
|
60
|
+
*/
|
|
61
|
+
getTrades(params: {
|
|
62
|
+
address?: string;
|
|
63
|
+
conditionId?: string;
|
|
64
|
+
limit?: number;
|
|
65
|
+
offset?: number;
|
|
66
|
+
}): Promise<DataTrade[]>;
|
|
67
|
+
/**
|
|
68
|
+
* Get on-chain activity for a user.
|
|
69
|
+
* @see https://docs.polymarket.com/api-reference/core/get-user-activity
|
|
70
|
+
*/
|
|
71
|
+
getUserActivity(params: {
|
|
72
|
+
address: string;
|
|
73
|
+
limit?: number;
|
|
74
|
+
offset?: number;
|
|
75
|
+
}): Promise<DataActivity[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Get top holders for a market.
|
|
78
|
+
* @see https://docs.polymarket.com/api-reference/core/get-top-holders-for-markets
|
|
79
|
+
*/
|
|
80
|
+
getTopHolders(params: {
|
|
81
|
+
conditionId: string;
|
|
82
|
+
outcomeIndex?: number;
|
|
83
|
+
limit?: number;
|
|
84
|
+
}): Promise<DataTopHolder[]>;
|
|
85
|
+
/**
|
|
86
|
+
* Get trader leaderboard rankings.
|
|
87
|
+
* @see https://docs.polymarket.com/api-reference/core/get-trader-leaderboard-rankings
|
|
88
|
+
*/
|
|
89
|
+
getTraderLeaderboard(params?: {
|
|
90
|
+
period?: "day" | "week" | "month" | "all";
|
|
91
|
+
category?: string;
|
|
92
|
+
order?: "pnl" | "volume";
|
|
93
|
+
limit?: number;
|
|
94
|
+
offset?: number;
|
|
95
|
+
}): Promise<DataLeaderboardEntry[]>;
|
|
96
|
+
/**
|
|
97
|
+
* Get open interest for a market or globally.
|
|
98
|
+
* @see https://docs.polymarket.com/api-reference/misc/get-open-interest
|
|
99
|
+
*/
|
|
100
|
+
getOpenInterest(params?: {
|
|
101
|
+
conditionId?: string;
|
|
102
|
+
asset?: string;
|
|
103
|
+
}): Promise<DataOpenInterest>;
|
|
104
|
+
/**
|
|
105
|
+
* Get live volume for an event.
|
|
106
|
+
* @see https://docs.polymarket.com/api-reference/misc/get-live-volume-for-an-event
|
|
107
|
+
*/
|
|
108
|
+
getLiveVolume(params: {
|
|
109
|
+
eventId?: string;
|
|
110
|
+
conditionId?: string;
|
|
111
|
+
}): Promise<DataVolume>;
|
|
112
|
+
/**
|
|
113
|
+
* Get price history for a token.
|
|
114
|
+
* @see https://docs.polymarket.com/api-reference/pricing/get-price-history-for-a-traded-token
|
|
115
|
+
*/
|
|
116
|
+
getPriceHistory(params: {
|
|
117
|
+
tokenId: string;
|
|
118
|
+
interval?: string;
|
|
119
|
+
startTs?: number;
|
|
120
|
+
endTs?: number;
|
|
121
|
+
fidelity?: number;
|
|
122
|
+
}): Promise<DataPriceHistory>;
|
|
123
|
+
/**
|
|
124
|
+
* Get order book summary for a token.
|
|
125
|
+
* @see https://docs.polymarket.com/api-reference/orderbook/get-order-book-summary
|
|
126
|
+
*/
|
|
127
|
+
getOrderBookSummary(tokenId: string): Promise<DataOrderBookSummary>;
|
|
128
|
+
/**
|
|
129
|
+
* Get order book summaries for multiple tokens.
|
|
130
|
+
* @see https://docs.polymarket.com/api-reference/orderbook/get-multiple-order-books-summaries-by-request
|
|
131
|
+
*/
|
|
132
|
+
getOrderBookSummaries(tokenIds: string[]): Promise<DataOrderBookSummary[]>;
|
|
133
|
+
/**
|
|
134
|
+
* Get bid-ask spreads for multiple tokens.
|
|
135
|
+
* @see https://docs.polymarket.com/api-reference/spreads/get-bid-ask-spreads
|
|
136
|
+
*/
|
|
137
|
+
getSpreads(tokenIds: string[]): Promise<DataSpread[]>;
|
|
138
|
+
/**
|
|
139
|
+
* Get total markets a user has traded.
|
|
140
|
+
* @see https://docs.polymarket.com/api-reference/misc/get-total-markets-a-user-has-traded
|
|
141
|
+
*/
|
|
142
|
+
getTotalMarketsTraded(address: string): Promise<DataMarketsTraded>;
|
|
143
|
+
/**
|
|
144
|
+
* Download accounting snapshot as ZIP.
|
|
145
|
+
* Returns raw Response for binary data handling.
|
|
146
|
+
* @see https://docs.polymarket.com/api-reference/misc/download-an-accounting-snapshot-zip-of-csvs
|
|
147
|
+
*/
|
|
148
|
+
getAccountingSnapshot(address: string): Promise<Response>;
|
|
149
|
+
/**
|
|
150
|
+
* Check Data API health.
|
|
151
|
+
* @see https://docs.polymarket.com/api-reference/data-api-status/data-api-health-check
|
|
152
|
+
*/
|
|
153
|
+
healthCheck(): Promise<{
|
|
154
|
+
status: string;
|
|
155
|
+
}>;
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=data-api-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-api-client.d.ts","sourceRoot":"","sources":["../src/data-api-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,SAAS,EACT,UAAU,EACX,MAAM,YAAY,CAAC;AAapB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,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OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,GAAG,OAAO,CAAC,UAAU,CAAC;IAYvB;;;OAGG;IACG,eAAe,CAAC,MAAM,EAAE;QAC5B,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAW7B;;;OAGG;IACG,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAKzE;;;OAGG;IACG,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAehF;;;OAGG;IACG,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAU3D;;;OAGG;IACG,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAKxE;;;;OAIG;IACG,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAe/D;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAIjD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const POLYMARKET_ENDPOINTS: {
|
|
2
|
+
readonly gammaBaseUrl: "https://gamma-api.polymarket.com";
|
|
3
|
+
readonly clobBaseUrl: "https://clob.polymarket.com";
|
|
4
|
+
readonly dataApiBaseUrl: "https://data-api.polymarket.com";
|
|
5
|
+
readonly bridgeBaseUrl: "https://relay.polymarket.com";
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../src/endpoints.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB;;;;;CAKvB,CAAC"}
|