@liberfi.io/react-predict 0.1.63 → 0.1.65
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/index.d.mts +12 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.js +28 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -4
- package/dist/index.mjs.map +1 -1
- package/dist/{server-exUYV2o0.d.mts → server-DsjYCQiB.d.mts} +20 -3
- package/dist/{server-exUYV2o0.d.ts → server-DsjYCQiB.d.ts} +20 -3
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +8 -3
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +8 -3
- package/dist/server.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -734,6 +734,10 @@ type WsServerMessage = WsPongMessage | WsSubscribedMessage | WsErrorMessage | Ws
|
|
|
734
734
|
interface TickSizeResponse {
|
|
735
735
|
minimum_tick_size: number;
|
|
736
736
|
}
|
|
737
|
+
/** Response from the Polymarket fee-rate endpoint. */
|
|
738
|
+
interface FeeRateResponse {
|
|
739
|
+
base_fee: number;
|
|
740
|
+
}
|
|
737
741
|
/** Aggregate statistics for all open prediction events. */
|
|
738
742
|
interface EventStats {
|
|
739
743
|
total_events: number;
|
|
@@ -901,6 +905,8 @@ declare class PredictClient {
|
|
|
901
905
|
createPolymarketOrder(input: CreateOrderInput, headers: Record<string, string>): Promise<PredictOrder>;
|
|
902
906
|
/** Maps to `GET /api/v1/polymarket/tick-size?token_id=xxx`. */
|
|
903
907
|
getPolymarketTickSize(tokenId: string): Promise<TickSizeResponse>;
|
|
908
|
+
/** Maps to `GET /api/v1/polymarket/fee-rate?token_id=xxx`. */
|
|
909
|
+
getPolymarketFeeRate(tokenId: string): Promise<FeeRateResponse>;
|
|
904
910
|
/** Maps to `POST /api/v1/orders/kalshi/quote`. */
|
|
905
911
|
createDFlowQuote(body: DFlowQuoteRequest): Promise<DFlowQuoteResponse>;
|
|
906
912
|
/** Maps to `POST /api/v1/orders/kalshi/submit`. */
|
|
@@ -1451,6 +1457,8 @@ interface BuildOrderMessageInput extends CreateOrderInput {
|
|
|
1451
1457
|
signerAddress: string;
|
|
1452
1458
|
/** Signature type (0 = EOA, 1 = Magic, 2 = Poly Proxy). */
|
|
1453
1459
|
signatureType: 0 | 1 | 2;
|
|
1460
|
+
/** Fee rate in basis points from the CLOB fee-rate endpoint. Defaults to "0". */
|
|
1461
|
+
feeRateBps?: string;
|
|
1454
1462
|
}
|
|
1455
1463
|
interface OrderMessage {
|
|
1456
1464
|
salt: string;
|
|
@@ -1494,9 +1502,9 @@ interface OrderMessage {
|
|
|
1494
1502
|
* Limit BUY (GTC/GTD): size = number of shares to buy
|
|
1495
1503
|
* Limit SELL (GTC/GTD): size = number of shares to sell
|
|
1496
1504
|
*
|
|
1497
|
-
* Precision:
|
|
1505
|
+
* Precision (rc.size is always 2 in the official ROUNDING_CONFIG):
|
|
1498
1506
|
* Market orders → makerAmount ≤ 2 decimals, takerAmount ≤ 4 decimals
|
|
1499
|
-
* Limit orders →
|
|
1507
|
+
* Limit orders → makerAmount ≤ rc.size (2) decimals, takerAmount ≤ rc.amount
|
|
1500
1508
|
*
|
|
1501
1509
|
* Rounding direction:
|
|
1502
1510
|
* Market BUY: maker = floor (spend less), taker = floor (fewer shares)
|
|
@@ -1554,5 +1562,14 @@ interface ClobOrderPayload {
|
|
|
1554
1562
|
* CLOB API expects. Mirrors the official `orderToJson()` utility.
|
|
1555
1563
|
*/
|
|
1556
1564
|
declare function buildClobPayload(signedOrder: SignedOrder, owner: string): ClobOrderPayload;
|
|
1565
|
+
/**
|
|
1566
|
+
* Return the maximum number of decimal places allowed for share quantities
|
|
1567
|
+
* on Polymarket, given the market's tick size.
|
|
1568
|
+
*
|
|
1569
|
+
* In the official CLOB client, `ROUNDING_CONFIG[tickSize].size` is always 2.
|
|
1570
|
+
* This function encapsulates that lookup so UI layers don't need to know about
|
|
1571
|
+
* the internal rounding config.
|
|
1572
|
+
*/
|
|
1573
|
+
declare function getPolymarketSharesPrecision(tickSize: string): number;
|
|
1557
1574
|
|
|
1558
|
-
export { type
|
|
1575
|
+
export { type WsTradeEvent as $, type AvailableSharesResponse as A, type BalanceResponse as B, type Candlestick as C, type DFlowQuoteRequest as D, type EventStats as E, type DFlowSubmitRequest as F, type DFlowKYCStatus as G, type PolymarketSetupStatus as H, type WithdrawBuildRequest as I, type WithdrawSubmitResponse as J, type WithdrawSubmitRequest as K, type ListEventsParams as L, type MatchesParams as M, type WithdrawStatusResponse as N, type Orderbook as O, PredictClient as P, type PolymarketDepositAddresses as Q, type PolymarketWithdrawResponse as R, type SimilarEventsParams as S, type PolymarketWithdrawRequest as T, type TickSizeResponse as U, type FeeRateResponse as V, type WithdrawBuildResponse as W, type WsConnectionStatus as X, type WsDataMessage as Y, type WsPriceEvent as Z, type WsOrderbookEvent as _, PredictWsClient as a, hmacSha256Base64 as a$, type CreateOrderInput as a0, createPredictClient as a1, createPredictWsClient as a2, type PredictWsClientConfig as a3, type ProviderMeta as a4, type PredictTag as a5, type SettlementSource as a6, type MarketStatus as a7, type MarketResult as a8, type MarketOutcome as a9, type WsChannelEvent as aA, type WsClientMessage as aB, type WsSubscribeMessage as aC, type WsPingMessage as aD, type WsServerMessage as aE, type WsPongMessage as aF, type WsSubscribedMessage as aG, type WsErrorCode as aH, type WsErrorMessage as aI, eventQueryKey as aJ, fetchEvent as aK, resolveTagSlug as aL, resolveEventsParams as aM, infiniteEventsQueryKey as aN, fetchEventsPage as aO, type ResolveEventsParamsInput as aP, type TagSlugSelection as aQ, marketQueryKey as aR, fetchMarket as aS, matchesQueryKey as aT, matchQueryKey as aU, fetchMatchesPage as aV, matchMarketsQueryKey as aW, fetchMatchMarketsPage as aX, CLOB_AUTH_DOMAIN as aY, CLOB_AUTH_TYPES as aZ, buildClobAuthMessage as a_, type OrderbookLevel as aa, type TradeType as ab, type EventSummary as ac, type MarketSummary as ad, type PricePoint as ae, type PredictPosition as af, type OrderStatus as ag, type OrderSide as ah, type DFlowOrderContext as ai, type PolymarketOrderType as aj, type DepositBuildRequest as ak, type DepositBuildResponse as al, type DepositSubmitRequest as am, type DepositSubmitResponse as an, type DepositStatusResponse as ao, type UnsignedTx as ap, type PolymarketWithdrawPrepareRequest as aq, type PolymarketWithdrawPrepareResponse as ar, type MatchStatus as as, type MatchGroupEntry as at, type MatchGroupMarket as au, type MatchSortField as av, type MatchesStats as aw, type MatchConfidenceTier as ax, type MatchMarketFlat as ay, type WsChannel as az, type PredictPage as b, buildPolymarketL2Headers as b0, derivePolymarketApiKey as b1, type HttpMethod as b2, type PolymarketL2HeadersInput as b3, type PolymarketL2Headers as b4, type BuildClobAuthMessageInput as b5, CTF_EXCHANGE_ADDRESS as b6, NEG_RISK_CTF_EXCHANGE_ADDRESS as b7, USDC_ADDRESS as b8, POLYGON_CHAIN_ID as b9, buildCtfExchangeDomain as ba, CTF_ORDER_TYPES as bb, ORDER_TYPE as bc, SIDE as bd, buildOrderMessage as be, buildSignedOrder as bf, buildClobPayload as bg, getPolymarketSharesPrecision as bh, type ClobOrderPayload as bi, type BuildOrderMessageInput as bj, type OrderMessage as bk, type SignedOrder as bl, DEFAULT_PAGE_SIZE as bm, type PredictEvent as c, type ProviderSource as d, type EventStatus as e, type EventSortField as f, type PredictMarket as g, type ListMarketTradesParams as h, type PredictTrade as i, type PriceHistoryRange as j, type PriceHistoryResponse as k, type ListCandlesticksParams as l, type PositionsResponse as m, type ListOrdersParams as n, type PredictOrder as o, type ListOrdersMultiParams as p, type PredictOrdersResponse as q, type CancelOrderResult as r, type MatchGroupPage as s, type MatchGroup as t, type MatchMarketParams as u, type MatchMarketPage as v, type ListTradesParams as w, type ListTradesMultiParams as x, type DFlowQuoteResponse as y, type DFlowSubmitResponse as z };
|
|
@@ -734,6 +734,10 @@ type WsServerMessage = WsPongMessage | WsSubscribedMessage | WsErrorMessage | Ws
|
|
|
734
734
|
interface TickSizeResponse {
|
|
735
735
|
minimum_tick_size: number;
|
|
736
736
|
}
|
|
737
|
+
/** Response from the Polymarket fee-rate endpoint. */
|
|
738
|
+
interface FeeRateResponse {
|
|
739
|
+
base_fee: number;
|
|
740
|
+
}
|
|
737
741
|
/** Aggregate statistics for all open prediction events. */
|
|
738
742
|
interface EventStats {
|
|
739
743
|
total_events: number;
|
|
@@ -901,6 +905,8 @@ declare class PredictClient {
|
|
|
901
905
|
createPolymarketOrder(input: CreateOrderInput, headers: Record<string, string>): Promise<PredictOrder>;
|
|
902
906
|
/** Maps to `GET /api/v1/polymarket/tick-size?token_id=xxx`. */
|
|
903
907
|
getPolymarketTickSize(tokenId: string): Promise<TickSizeResponse>;
|
|
908
|
+
/** Maps to `GET /api/v1/polymarket/fee-rate?token_id=xxx`. */
|
|
909
|
+
getPolymarketFeeRate(tokenId: string): Promise<FeeRateResponse>;
|
|
904
910
|
/** Maps to `POST /api/v1/orders/kalshi/quote`. */
|
|
905
911
|
createDFlowQuote(body: DFlowQuoteRequest): Promise<DFlowQuoteResponse>;
|
|
906
912
|
/** Maps to `POST /api/v1/orders/kalshi/submit`. */
|
|
@@ -1451,6 +1457,8 @@ interface BuildOrderMessageInput extends CreateOrderInput {
|
|
|
1451
1457
|
signerAddress: string;
|
|
1452
1458
|
/** Signature type (0 = EOA, 1 = Magic, 2 = Poly Proxy). */
|
|
1453
1459
|
signatureType: 0 | 1 | 2;
|
|
1460
|
+
/** Fee rate in basis points from the CLOB fee-rate endpoint. Defaults to "0". */
|
|
1461
|
+
feeRateBps?: string;
|
|
1454
1462
|
}
|
|
1455
1463
|
interface OrderMessage {
|
|
1456
1464
|
salt: string;
|
|
@@ -1494,9 +1502,9 @@ interface OrderMessage {
|
|
|
1494
1502
|
* Limit BUY (GTC/GTD): size = number of shares to buy
|
|
1495
1503
|
* Limit SELL (GTC/GTD): size = number of shares to sell
|
|
1496
1504
|
*
|
|
1497
|
-
* Precision:
|
|
1505
|
+
* Precision (rc.size is always 2 in the official ROUNDING_CONFIG):
|
|
1498
1506
|
* Market orders → makerAmount ≤ 2 decimals, takerAmount ≤ 4 decimals
|
|
1499
|
-
* Limit orders →
|
|
1507
|
+
* Limit orders → makerAmount ≤ rc.size (2) decimals, takerAmount ≤ rc.amount
|
|
1500
1508
|
*
|
|
1501
1509
|
* Rounding direction:
|
|
1502
1510
|
* Market BUY: maker = floor (spend less), taker = floor (fewer shares)
|
|
@@ -1554,5 +1562,14 @@ interface ClobOrderPayload {
|
|
|
1554
1562
|
* CLOB API expects. Mirrors the official `orderToJson()` utility.
|
|
1555
1563
|
*/
|
|
1556
1564
|
declare function buildClobPayload(signedOrder: SignedOrder, owner: string): ClobOrderPayload;
|
|
1565
|
+
/**
|
|
1566
|
+
* Return the maximum number of decimal places allowed for share quantities
|
|
1567
|
+
* on Polymarket, given the market's tick size.
|
|
1568
|
+
*
|
|
1569
|
+
* In the official CLOB client, `ROUNDING_CONFIG[tickSize].size` is always 2.
|
|
1570
|
+
* This function encapsulates that lookup so UI layers don't need to know about
|
|
1571
|
+
* the internal rounding config.
|
|
1572
|
+
*/
|
|
1573
|
+
declare function getPolymarketSharesPrecision(tickSize: string): number;
|
|
1557
1574
|
|
|
1558
|
-
export { type
|
|
1575
|
+
export { type WsTradeEvent as $, type AvailableSharesResponse as A, type BalanceResponse as B, type Candlestick as C, type DFlowQuoteRequest as D, type EventStats as E, type DFlowSubmitRequest as F, type DFlowKYCStatus as G, type PolymarketSetupStatus as H, type WithdrawBuildRequest as I, type WithdrawSubmitResponse as J, type WithdrawSubmitRequest as K, type ListEventsParams as L, type MatchesParams as M, type WithdrawStatusResponse as N, type Orderbook as O, PredictClient as P, type PolymarketDepositAddresses as Q, type PolymarketWithdrawResponse as R, type SimilarEventsParams as S, type PolymarketWithdrawRequest as T, type TickSizeResponse as U, type FeeRateResponse as V, type WithdrawBuildResponse as W, type WsConnectionStatus as X, type WsDataMessage as Y, type WsPriceEvent as Z, type WsOrderbookEvent as _, PredictWsClient as a, hmacSha256Base64 as a$, type CreateOrderInput as a0, createPredictClient as a1, createPredictWsClient as a2, type PredictWsClientConfig as a3, type ProviderMeta as a4, type PredictTag as a5, type SettlementSource as a6, type MarketStatus as a7, type MarketResult as a8, type MarketOutcome as a9, type WsChannelEvent as aA, type WsClientMessage as aB, type WsSubscribeMessage as aC, type WsPingMessage as aD, type WsServerMessage as aE, type WsPongMessage as aF, type WsSubscribedMessage as aG, type WsErrorCode as aH, type WsErrorMessage as aI, eventQueryKey as aJ, fetchEvent as aK, resolveTagSlug as aL, resolveEventsParams as aM, infiniteEventsQueryKey as aN, fetchEventsPage as aO, type ResolveEventsParamsInput as aP, type TagSlugSelection as aQ, marketQueryKey as aR, fetchMarket as aS, matchesQueryKey as aT, matchQueryKey as aU, fetchMatchesPage as aV, matchMarketsQueryKey as aW, fetchMatchMarketsPage as aX, CLOB_AUTH_DOMAIN as aY, CLOB_AUTH_TYPES as aZ, buildClobAuthMessage as a_, type OrderbookLevel as aa, type TradeType as ab, type EventSummary as ac, type MarketSummary as ad, type PricePoint as ae, type PredictPosition as af, type OrderStatus as ag, type OrderSide as ah, type DFlowOrderContext as ai, type PolymarketOrderType as aj, type DepositBuildRequest as ak, type DepositBuildResponse as al, type DepositSubmitRequest as am, type DepositSubmitResponse as an, type DepositStatusResponse as ao, type UnsignedTx as ap, type PolymarketWithdrawPrepareRequest as aq, type PolymarketWithdrawPrepareResponse as ar, type MatchStatus as as, type MatchGroupEntry as at, type MatchGroupMarket as au, type MatchSortField as av, type MatchesStats as aw, type MatchConfidenceTier as ax, type MatchMarketFlat as ay, type WsChannel as az, type PredictPage as b, buildPolymarketL2Headers as b0, derivePolymarketApiKey as b1, type HttpMethod as b2, type PolymarketL2HeadersInput as b3, type PolymarketL2Headers as b4, type BuildClobAuthMessageInput as b5, CTF_EXCHANGE_ADDRESS as b6, NEG_RISK_CTF_EXCHANGE_ADDRESS as b7, USDC_ADDRESS as b8, POLYGON_CHAIN_ID as b9, buildCtfExchangeDomain as ba, CTF_ORDER_TYPES as bb, ORDER_TYPE as bc, SIDE as bd, buildOrderMessage as be, buildSignedOrder as bf, buildClobPayload as bg, getPolymarketSharesPrecision as bh, type ClobOrderPayload as bi, type BuildOrderMessageInput as bj, type OrderMessage as bk, type SignedOrder as bl, DEFAULT_PAGE_SIZE as bm, type PredictEvent as c, type ProviderSource as d, type EventStatus as e, type EventSortField as f, type PredictMarket as g, type ListMarketTradesParams as h, type PredictTrade as i, type PriceHistoryRange as j, type PriceHistoryResponse as k, type ListCandlesticksParams as l, type PositionsResponse as m, type ListOrdersParams as n, type PredictOrder as o, type ListOrdersMultiParams as p, type PredictOrdersResponse as q, type CancelOrderResult as r, type MatchGroupPage as s, type MatchGroup as t, type MatchMarketParams as u, type MatchMarketPage as v, type ListTradesParams as w, type ListTradesMultiParams as x, type DFlowQuoteResponse as y, type DFlowSubmitResponse as z };
|
package/dist/server.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { B as BalanceResponse,
|
|
1
|
+
export { B as BalanceResponse, b5 as BuildClobAuthMessageInput, bj as BuildOrderMessageInput, aY as CLOB_AUTH_DOMAIN, aZ as CLOB_AUTH_TYPES, b6 as CTF_EXCHANGE_ADDRESS, bb as CTF_ORDER_TYPES, r as CancelOrderResult, C as Candlestick, bi as ClobOrderPayload, a0 as CreateOrderInput, bm as DEFAULT_PAGE_SIZE, ai as DFlowOrderContext, D as DFlowQuoteRequest, y as DFlowQuoteResponse, F as DFlowSubmitRequest, z as DFlowSubmitResponse, ak as DepositBuildRequest, al as DepositBuildResponse, ao as DepositStatusResponse, am as DepositSubmitRequest, an as DepositSubmitResponse, f as EventSortField, e as EventStatus, ac as EventSummary, b2 as HttpMethod, l as ListCandlesticksParams, L as ListEventsParams, h as ListMarketTradesParams, n as ListOrdersParams, w as ListTradesParams, a9 as MarketOutcome, a8 as MarketResult, a7 as MarketStatus, ad as MarketSummary, ax as MatchConfidenceTier, t as MatchGroup, at as MatchGroupEntry, au as MatchGroupMarket, s as MatchGroupPage, ay as MatchMarketFlat, v as MatchMarketPage, u as MatchMarketParams, av as MatchSortField, as as MatchStatus, M as MatchesParams, aw as MatchesStats, b7 as NEG_RISK_CTF_EXCHANGE_ADDRESS, bc as ORDER_TYPE, bk as OrderMessage, ah as OrderSide, ag as OrderStatus, O as Orderbook, aa as OrderbookLevel, b9 as POLYGON_CHAIN_ID, b4 as PolymarketL2Headers, b3 as PolymarketL2HeadersInput, aj as PolymarketOrderType, m as PositionsResponse, P as PredictClient, c as PredictEvent, g as PredictMarket, o as PredictOrder, b as PredictPage, af as PredictPosition, a5 as PredictTag, i as PredictTrade, a as PredictWsClient, a3 as PredictWsClientConfig, j as PriceHistoryRange, k as PriceHistoryResponse, ae as PricePoint, a4 as ProviderMeta, d as ProviderSource, aP as ResolveEventsParamsInput, bd as SIDE, a6 as SettlementSource, bl as SignedOrder, S as SimilarEventsParams, aQ as TagSlugSelection, ab as TradeType, b8 as USDC_ADDRESS, ap as UnsignedTx, az as WsChannel, aA as WsChannelEvent, aB as WsClientMessage, X as WsConnectionStatus, Y as WsDataMessage, aH as WsErrorCode, aI as WsErrorMessage, _ as WsOrderbookEvent, aD as WsPingMessage, aF as WsPongMessage, Z as WsPriceEvent, aE as WsServerMessage, aC as WsSubscribeMessage, aG as WsSubscribedMessage, $ as WsTradeEvent, a_ as buildClobAuthMessage, bg as buildClobPayload, ba as buildCtfExchangeDomain, be as buildOrderMessage, b0 as buildPolymarketL2Headers, bf as buildSignedOrder, a1 as createPredictClient, a2 as createPredictWsClient, b1 as derivePolymarketApiKey, aJ as eventQueryKey, aK as fetchEvent, aO as fetchEventsPage, aS as fetchMarket, aX as fetchMatchMarketsPage, aV as fetchMatchesPage, a$ as hmacSha256Base64, aN as infiniteEventsQueryKey, aR as marketQueryKey, aW as matchMarketsQueryKey, aU as matchQueryKey, aT as matchesQueryKey, aM as resolveEventsParams, aL as resolveTagSlug } from './server-DsjYCQiB.mjs';
|
package/dist/server.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { B as BalanceResponse,
|
|
1
|
+
export { B as BalanceResponse, b5 as BuildClobAuthMessageInput, bj as BuildOrderMessageInput, aY as CLOB_AUTH_DOMAIN, aZ as CLOB_AUTH_TYPES, b6 as CTF_EXCHANGE_ADDRESS, bb as CTF_ORDER_TYPES, r as CancelOrderResult, C as Candlestick, bi as ClobOrderPayload, a0 as CreateOrderInput, bm as DEFAULT_PAGE_SIZE, ai as DFlowOrderContext, D as DFlowQuoteRequest, y as DFlowQuoteResponse, F as DFlowSubmitRequest, z as DFlowSubmitResponse, ak as DepositBuildRequest, al as DepositBuildResponse, ao as DepositStatusResponse, am as DepositSubmitRequest, an as DepositSubmitResponse, f as EventSortField, e as EventStatus, ac as EventSummary, b2 as HttpMethod, l as ListCandlesticksParams, L as ListEventsParams, h as ListMarketTradesParams, n as ListOrdersParams, w as ListTradesParams, a9 as MarketOutcome, a8 as MarketResult, a7 as MarketStatus, ad as MarketSummary, ax as MatchConfidenceTier, t as MatchGroup, at as MatchGroupEntry, au as MatchGroupMarket, s as MatchGroupPage, ay as MatchMarketFlat, v as MatchMarketPage, u as MatchMarketParams, av as MatchSortField, as as MatchStatus, M as MatchesParams, aw as MatchesStats, b7 as NEG_RISK_CTF_EXCHANGE_ADDRESS, bc as ORDER_TYPE, bk as OrderMessage, ah as OrderSide, ag as OrderStatus, O as Orderbook, aa as OrderbookLevel, b9 as POLYGON_CHAIN_ID, b4 as PolymarketL2Headers, b3 as PolymarketL2HeadersInput, aj as PolymarketOrderType, m as PositionsResponse, P as PredictClient, c as PredictEvent, g as PredictMarket, o as PredictOrder, b as PredictPage, af as PredictPosition, a5 as PredictTag, i as PredictTrade, a as PredictWsClient, a3 as PredictWsClientConfig, j as PriceHistoryRange, k as PriceHistoryResponse, ae as PricePoint, a4 as ProviderMeta, d as ProviderSource, aP as ResolveEventsParamsInput, bd as SIDE, a6 as SettlementSource, bl as SignedOrder, S as SimilarEventsParams, aQ as TagSlugSelection, ab as TradeType, b8 as USDC_ADDRESS, ap as UnsignedTx, az as WsChannel, aA as WsChannelEvent, aB as WsClientMessage, X as WsConnectionStatus, Y as WsDataMessage, aH as WsErrorCode, aI as WsErrorMessage, _ as WsOrderbookEvent, aD as WsPingMessage, aF as WsPongMessage, Z as WsPriceEvent, aE as WsServerMessage, aC as WsSubscribeMessage, aG as WsSubscribedMessage, $ as WsTradeEvent, a_ as buildClobAuthMessage, bg as buildClobPayload, ba as buildCtfExchangeDomain, be as buildOrderMessage, b0 as buildPolymarketL2Headers, bf as buildSignedOrder, a1 as createPredictClient, a2 as createPredictWsClient, b1 as derivePolymarketApiKey, aJ as eventQueryKey, aK as fetchEvent, aO as fetchEventsPage, aS as fetchMarket, aX as fetchMatchMarketsPage, aV as fetchMatchesPage, a$ as hmacSha256Base64, aN as infiniteEventsQueryKey, aR as marketQueryKey, aW as matchMarketsQueryKey, aU as matchQueryKey, aT as matchesQueryKey, aM as resolveEventsParams, aL as resolveTagSlug } from './server-DsjYCQiB.js';
|
package/dist/server.js
CHANGED
|
@@ -335,6 +335,11 @@ var PredictClient = class {
|
|
|
335
335
|
const url = `${this.endpoint}/api/v1/polymarket/tick-size?token_id=${encodeURIComponent(tokenId)}`;
|
|
336
336
|
return await utils.httpGet(url);
|
|
337
337
|
}
|
|
338
|
+
/** Maps to `GET /api/v1/polymarket/fee-rate?token_id=xxx`. */
|
|
339
|
+
async getPolymarketFeeRate(tokenId) {
|
|
340
|
+
const url = `${this.endpoint}/api/v1/polymarket/fee-rate?token_id=${encodeURIComponent(tokenId)}`;
|
|
341
|
+
return await utils.httpGet(url);
|
|
342
|
+
}
|
|
338
343
|
// -------------------------------------------------------------------------
|
|
339
344
|
// DFlow trading
|
|
340
345
|
// -------------------------------------------------------------------------
|
|
@@ -993,8 +998,8 @@ var SIDE = { BUY: 0, SELL: 1 };
|
|
|
993
998
|
var ROUNDING_CONFIG = {
|
|
994
999
|
"0.1": { size: 2, price: 1, amount: 3 },
|
|
995
1000
|
"0.01": { size: 2, price: 2, amount: 4 },
|
|
996
|
-
"0.001": { size:
|
|
997
|
-
"0.0001": { size:
|
|
1001
|
+
"0.001": { size: 2, price: 3, amount: 5 },
|
|
1002
|
+
"0.0001": { size: 2, price: 4, amount: 6 }
|
|
998
1003
|
};
|
|
999
1004
|
var DEFAULT_ROUNDING = { size: 2, price: 2, amount: 4 };
|
|
1000
1005
|
function decimalPlaces(n, d) {
|
|
@@ -1076,7 +1081,7 @@ function buildOrderMessage(input) {
|
|
|
1076
1081
|
takerAmount,
|
|
1077
1082
|
expiration: String(input.expiration ?? 0),
|
|
1078
1083
|
nonce: "0",
|
|
1079
|
-
feeRateBps: "0",
|
|
1084
|
+
feeRateBps: input.feeRateBps ?? "0",
|
|
1080
1085
|
side,
|
|
1081
1086
|
signatureType: input.signatureType
|
|
1082
1087
|
};
|