@liberfi.io/react-predict 0.3.39 → 0.3.41
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/README.md +1 -1
- package/dist/index.d.mts +16 -5
- package/dist/index.d.ts +16 -5
- package/dist/index.js +93 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +88 -39
- package/dist/index.mjs.map +1 -1
- package/dist/{server-Da_gQzNk.d.mts → server-BYvRRFCr.d.mts} +109 -15
- package/dist/{server-Da_gQzNk.d.ts → server-BYvRRFCr.d.ts} +109 -15
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +28 -14
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +28 -14
- package/dist/server.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -663,12 +663,20 @@ interface PolymarketSupportedAssetsResponse {
|
|
|
663
663
|
}
|
|
664
664
|
/** Request body for `POST /api/v1/withdraw/polymarket/prepare`. */
|
|
665
665
|
interface PolymarketWithdrawPrepareRequest {
|
|
666
|
-
safe_address
|
|
667
|
-
to
|
|
666
|
+
safe_address?: string;
|
|
667
|
+
to?: string;
|
|
668
|
+
wallet_address?: string;
|
|
669
|
+
to_chain_id?: string;
|
|
670
|
+
to_token_address?: string;
|
|
671
|
+
recipient_address?: string;
|
|
672
|
+
quote_id?: string;
|
|
668
673
|
}
|
|
669
674
|
/** Response from `POST /api/v1/withdraw/polymarket/prepare`. */
|
|
670
675
|
interface PolymarketWithdrawPrepareResponse {
|
|
671
676
|
deposit_address: string;
|
|
677
|
+
bridge_address?: string;
|
|
678
|
+
address_type?: "evm" | "svm" | "tron" | "btc" | string;
|
|
679
|
+
quote_id?: string;
|
|
672
680
|
}
|
|
673
681
|
/** Request body for `POST /api/v1/withdraw/polymarket/execute`. */
|
|
674
682
|
interface PolymarketWithdrawRequest {
|
|
@@ -683,6 +691,69 @@ interface PolymarketWithdrawResponse {
|
|
|
683
691
|
transaction_id: string;
|
|
684
692
|
status: string;
|
|
685
693
|
}
|
|
694
|
+
interface PolymarketWithdrawQuoteRequest {
|
|
695
|
+
wallet_address: string;
|
|
696
|
+
amount: string;
|
|
697
|
+
to_chain_id: string;
|
|
698
|
+
to_token_address: string;
|
|
699
|
+
recipient_address: string;
|
|
700
|
+
}
|
|
701
|
+
interface PolymarketWithdrawQuoteResponse {
|
|
702
|
+
quote_id: string;
|
|
703
|
+
from_amount_base_unit: string;
|
|
704
|
+
est_checkout_time_ms: number;
|
|
705
|
+
est_input_usd: number;
|
|
706
|
+
est_output_usd: number;
|
|
707
|
+
est_to_token_base_unit: string;
|
|
708
|
+
to_token_decimals: number;
|
|
709
|
+
to_token_symbol: string;
|
|
710
|
+
min_checkout_usd: number;
|
|
711
|
+
est_fee_breakdown?: Record<string, unknown>;
|
|
712
|
+
raw_bridge_quote?: Record<string, unknown>;
|
|
713
|
+
}
|
|
714
|
+
interface PolymarketTypedDataArg {
|
|
715
|
+
name: string;
|
|
716
|
+
type: string;
|
|
717
|
+
}
|
|
718
|
+
interface PolymarketTypedData {
|
|
719
|
+
domain: Record<string, unknown>;
|
|
720
|
+
types: Record<string, PolymarketTypedDataArg[]>;
|
|
721
|
+
primaryType: string;
|
|
722
|
+
message: Record<string, unknown>;
|
|
723
|
+
}
|
|
724
|
+
interface PolymarketWithdrawRelayBuildRequest {
|
|
725
|
+
owner_address: string;
|
|
726
|
+
wallet_address: string;
|
|
727
|
+
bridge_address: string;
|
|
728
|
+
amount: string;
|
|
729
|
+
}
|
|
730
|
+
interface PolymarketWithdrawRelayBuildResponse {
|
|
731
|
+
typed_data: PolymarketTypedData;
|
|
732
|
+
nonce: string;
|
|
733
|
+
deadline: string;
|
|
734
|
+
}
|
|
735
|
+
interface PolymarketWithdrawRelaySubmitRequest {
|
|
736
|
+
owner_address: string;
|
|
737
|
+
wallet_address: string;
|
|
738
|
+
bridge_address: string;
|
|
739
|
+
amount: string;
|
|
740
|
+
nonce: string;
|
|
741
|
+
deadline: string;
|
|
742
|
+
signature: string;
|
|
743
|
+
}
|
|
744
|
+
interface PolymarketWithdrawRelaySubmitResponse {
|
|
745
|
+
transaction_id: string;
|
|
746
|
+
status: string;
|
|
747
|
+
bridge_address: string;
|
|
748
|
+
}
|
|
749
|
+
interface PolymarketWithdrawBridgeStatusResponse {
|
|
750
|
+
bridge_address: string;
|
|
751
|
+
transaction_id?: string;
|
|
752
|
+
relayer_status?: string;
|
|
753
|
+
transaction_hash?: string;
|
|
754
|
+
bridge_status?: string;
|
|
755
|
+
raw_bridge_status?: Record<string, unknown>;
|
|
756
|
+
}
|
|
686
757
|
/** Lifecycle status of a user order. */
|
|
687
758
|
type OrderStatus = "live" | "matched" | "cancelled" | "invalid" | "submitted" | "pending" | "open" | "pending_close" | "closed" | "failed" | "expired";
|
|
688
759
|
/** Order direction. */
|
|
@@ -812,6 +883,25 @@ interface CreateOrderInput {
|
|
|
812
883
|
*/
|
|
813
884
|
builderCode?: string;
|
|
814
885
|
}
|
|
886
|
+
/** Request body for `POST /api/v1/orders/polymarket/execute`. */
|
|
887
|
+
interface PolymarketOrderExecuteRequest {
|
|
888
|
+
/** Already signed Polymarket CLOB `/order` payload. */
|
|
889
|
+
payload: unknown;
|
|
890
|
+
/** L2 API key used as the CLOB order owner. */
|
|
891
|
+
l2_api_key: string;
|
|
892
|
+
/** L2 HMAC secret. */
|
|
893
|
+
l2_secret: string;
|
|
894
|
+
/** L2 HMAC passphrase. */
|
|
895
|
+
l2_passphrase: string;
|
|
896
|
+
/** L1 EVM signer address that owns the L2 credentials. */
|
|
897
|
+
signer_address: string;
|
|
898
|
+
/** Optional explicit owner override; defaults to l2_api_key server-side. */
|
|
899
|
+
owner?: string;
|
|
900
|
+
}
|
|
901
|
+
/** Response from `POST /api/v1/orders/polymarket/execute`. */
|
|
902
|
+
interface PolymarketOrderExecuteResponse {
|
|
903
|
+
raw: Record<string, unknown>;
|
|
904
|
+
}
|
|
815
905
|
/** Response from `GET /api/v1/kyc/kalshi?wallet_address=...`. */
|
|
816
906
|
interface DFlowKYCStatus {
|
|
817
907
|
wallet_address: string;
|
|
@@ -1142,20 +1232,13 @@ declare class PredictClient {
|
|
|
1142
1232
|
*/
|
|
1143
1233
|
cancelOrder(id: string, source: ProviderSource, headers?: Record<string, string>): Promise<CancelOrderResult>;
|
|
1144
1234
|
/**
|
|
1145
|
-
*
|
|
1146
|
-
*
|
|
1147
|
-
* Maps to `POST /api/v1/orders/polymarket`.
|
|
1148
|
-
*
|
|
1149
|
-
* The caller must attach Polymarket CLOB authentication headers:
|
|
1150
|
-
* - `POLY_ADDRESS` — the EVM wallet address.
|
|
1151
|
-
* - `POLY_SIGNATURE` — L1 signature or L2 API key.
|
|
1152
|
-
* - `POLY_TIMESTAMP` — Unix milliseconds string.
|
|
1153
|
-
* - `POLY_NONCE` — credential nonce (use `"0"` for in-session derived creds).
|
|
1235
|
+
* Execute an already signed Polymarket CLOB order through prediction-server.
|
|
1154
1236
|
*
|
|
1155
|
-
*
|
|
1156
|
-
*
|
|
1237
|
+
* Maps to `POST /api/v1/orders/polymarket/execute`. The server builds the
|
|
1238
|
+
* CLOB HMAC headers from the provided L2 credentials, forwards `payload`
|
|
1239
|
+
* unchanged to `/order`, and records rebate identity mappings.
|
|
1157
1240
|
*/
|
|
1158
|
-
|
|
1241
|
+
executePolymarketOrder(req: PolymarketOrderExecuteRequest): Promise<PolymarketOrderExecuteResponse>;
|
|
1159
1242
|
/** Maps to `GET /api/v1/polymarket/tick-size?token_id=xxx`. */
|
|
1160
1243
|
getPolymarketTickSize(tokenId: string): Promise<TickSizeResponse>;
|
|
1161
1244
|
/** Maps to `GET /api/v1/polymarket/fee-rate?token_id=xxx`. */
|
|
@@ -1254,12 +1337,23 @@ declare class PredictClient {
|
|
|
1254
1337
|
* Maps to `GET /api/v1/deposit/polymarket/supported-assets`.
|
|
1255
1338
|
*/
|
|
1256
1339
|
getPolymarketSupportedAssets(): Promise<PolymarketSupportedAsset[]>;
|
|
1340
|
+
/** Maps to `POST /api/v1/withdraw/polymarket/quote`. */
|
|
1341
|
+
quotePolymarketWithdraw(body: PolymarketWithdrawQuoteRequest): Promise<PolymarketWithdrawQuoteResponse>;
|
|
1257
1342
|
/**
|
|
1258
1343
|
* Prepare a Polymarket withdrawal by obtaining a Bridge deposit address.
|
|
1259
1344
|
*
|
|
1260
1345
|
* Maps to `POST /api/v1/withdraw/polymarket/prepare`.
|
|
1261
1346
|
*/
|
|
1262
1347
|
preparePolymarketWithdraw(body: PolymarketWithdrawPrepareRequest): Promise<PolymarketWithdrawPrepareResponse>;
|
|
1348
|
+
/** Maps to `POST /api/v1/withdraw/polymarket/build-relay`. */
|
|
1349
|
+
buildPolymarketWithdrawRelay(body: PolymarketWithdrawRelayBuildRequest): Promise<PolymarketWithdrawRelayBuildResponse>;
|
|
1350
|
+
/** Maps to `POST /api/v1/withdraw/polymarket/submit-relay`. */
|
|
1351
|
+
submitPolymarketWithdrawRelay(body: PolymarketWithdrawRelaySubmitRequest): Promise<PolymarketWithdrawRelaySubmitResponse>;
|
|
1352
|
+
/** Maps to `GET /api/v1/withdraw/polymarket/status`. */
|
|
1353
|
+
getPolymarketWithdrawStatus(params: {
|
|
1354
|
+
bridge_address?: string;
|
|
1355
|
+
transaction_id?: string;
|
|
1356
|
+
}): Promise<PolymarketWithdrawBridgeStatusResponse>;
|
|
1263
1357
|
/**
|
|
1264
1358
|
* Execute a gasless USDC.e withdrawal from a Polymarket Safe wallet via Relayer.
|
|
1265
1359
|
*
|
|
@@ -1864,4 +1958,4 @@ declare function buildClobPayload(signedOrder: SignedOrder, owner: string): Clob
|
|
|
1864
1958
|
*/
|
|
1865
1959
|
declare function getPolymarketSharesPrecision(tickSize: string): number;
|
|
1866
1960
|
|
|
1867
|
-
export { type
|
|
1961
|
+
export { type PolymarketWithdrawPrepareRequest as $, type AvailableSharesResponse as A, type BalanceResponse as B, type Candlestick as C, type ListTradesMultiParams as D, type EventStats as E, type DFlowQuoteRequest as F, type DFlowQuoteResponse as G, type DFlowSubmitResponse as H, type DFlowSubmitRequest as I, type DFlowKYCStatus as J, type PolymarketSetupStatus as K, type ListEventsParams as L, type MatchesParams as M, type PolymarketDepositWalletDeployResponse as N, type OrderbookOutcome as O, PredictClient as P, type WithdrawBuildRequest as Q, type WithdrawSubmitResponse as R, type SimilarEventsParams as S, type WithdrawSubmitRequest as T, type WithdrawStatusResponse as U, type PolymarketDepositAddresses as V, type WithdrawBuildResponse as W, type PolymarketSupportedAsset as X, type PolymarketWithdrawResponse as Y, type PolymarketWithdrawRequest as Z, type PolymarketWithdrawPrepareResponse as _, PredictWsClient as a, type WsServerMessage as a$, type PolymarketWithdrawQuoteResponse as a0, type PolymarketWithdrawQuoteRequest as a1, type PolymarketWithdrawRelayBuildResponse as a2, type PolymarketWithdrawRelayBuildRequest as a3, type PolymarketWithdrawRelaySubmitResponse as a4, type PolymarketWithdrawRelaySubmitRequest as a5, type PolymarketWithdrawBridgeStatusResponse as a6, type PolymarketRedeemResponse as a7, type TickSizeResponse as a8, type FeeRateResponse as a9, type PolymarketOrderType as aA, type PolymarketWalletKind as aB, type PolymarketDepositWalletDeployRequest as aC, type DepositBuildRequest as aD, type DepositBuildResponse as aE, type DepositSubmitRequest as aF, type DepositSubmitResponse as aG, type DepositStatusResponse as aH, type UnsignedTx as aI, type PolymarketBridgeToken as aJ, type PolymarketSupportedAssetsResponse as aK, type PolymarketTypedData as aL, type PolymarketTypedDataArg as aM, type MatchStatus as aN, type MatchGroupEntry as aO, type MatchGroupMarket as aP, type MatchSortField as aQ, type MatchesStats as aR, type MatchConfidenceTier as aS, type SignalTag as aT, type MatchLeg as aU, type MatchMarketFlat as aV, type WsChannel as aW, type WsChannelEvent as aX, type WsClientMessage as aY, type WsSubscribeMessage as aZ, type WsPingMessage as a_, type RebateConfig as aa, type WsConnectionStatus as ab, type WsDataMessage as ac, type WsPriceEvent as ad, type WsOrderbookEvent as ae, type WsTradeEvent as af, type CreateOrderInput as ag, createPredictClient as ah, createPredictWsClient as ai, type PredictWsClientConfig as aj, type ProviderMeta as ak, type PredictTag as al, type SettlementSource as am, type MarketStatus as an, type MarketResult as ao, type MarketOutcome as ap, type OrderbookLevel as aq, type TradeType as ar, type EventSummary as as, type MarketSummary as at, type PredictCommentProfile as au, type PricePoint as av, type PredictPosition as aw, type OrderStatus as ax, type OrderSide as ay, type DFlowOrderContext as az, type PredictPage as b, type WsPongMessage as b0, type WsSubscribedMessage as b1, type WsErrorCode as b2, type WsErrorMessage as b3, type PolymarketRedeemPrepareInput as b4, type PolymarketRedeemPrepareResponse as b5, type PolymarketRedeemInput as b6, eventQueryKey as b7, fetchEvent as b8, resolveTagSlug 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, resolveEventsParams as ba, infiniteEventsQueryKey as bb, fetchEventsPage as bc, type ResolveEventsParamsInput as bd, type TagSlugSelection as be, marketQueryKey as bf, fetchMarket as bg, matchesQueryKey as bh, matchQueryKey as bi, fetchMatchesPage as bj, matchMarketsQueryKey as bk, fetchMatchMarketsPage as bl, CLOB_AUTH_DOMAIN as bm, CLOB_AUTH_TYPES as bn, buildClobAuthMessage as bo, hmacSha256Base64 as bp, buildPolymarketL2Headers as bq, derivePolymarketApiKey as br, type HttpMethod as bs, type PolymarketL2HeadersInput as bt, type PolymarketL2Headers as bu, type BuildClobAuthMessageInput as bv, CTF_EXCHANGE_ADDRESS as bw, NEG_RISK_CTF_EXCHANGE_ADDRESS as bx, USDC_ADDRESS as by, POLYGON_CHAIN_ID as bz, type PredictEvent as c, type ProviderSource as d, type EventStatus as e, type EventSortField as f, type PredictMarket as g, type Orderbook as h, type ListMarketTradesParams as i, type PredictTrade as j, type PriceHistoryRange as k, type PriceHistoryResponse as l, type ListCandlesticksParams as m, type ListCommentsParams as n, type PredictComment as o, type PositionsResponse as p, type ListOrdersParams as q, type PredictOrder as r, type ListOrdersMultiParams as s, type PredictOrdersResponse as t, type CancelOrderResult as u, type MatchGroupPage as v, type MatchGroup as w, type MatchMarketParams as x, type MatchMarketPage as y, type ListTradesParams as z };
|
|
@@ -663,12 +663,20 @@ interface PolymarketSupportedAssetsResponse {
|
|
|
663
663
|
}
|
|
664
664
|
/** Request body for `POST /api/v1/withdraw/polymarket/prepare`. */
|
|
665
665
|
interface PolymarketWithdrawPrepareRequest {
|
|
666
|
-
safe_address
|
|
667
|
-
to
|
|
666
|
+
safe_address?: string;
|
|
667
|
+
to?: string;
|
|
668
|
+
wallet_address?: string;
|
|
669
|
+
to_chain_id?: string;
|
|
670
|
+
to_token_address?: string;
|
|
671
|
+
recipient_address?: string;
|
|
672
|
+
quote_id?: string;
|
|
668
673
|
}
|
|
669
674
|
/** Response from `POST /api/v1/withdraw/polymarket/prepare`. */
|
|
670
675
|
interface PolymarketWithdrawPrepareResponse {
|
|
671
676
|
deposit_address: string;
|
|
677
|
+
bridge_address?: string;
|
|
678
|
+
address_type?: "evm" | "svm" | "tron" | "btc" | string;
|
|
679
|
+
quote_id?: string;
|
|
672
680
|
}
|
|
673
681
|
/** Request body for `POST /api/v1/withdraw/polymarket/execute`. */
|
|
674
682
|
interface PolymarketWithdrawRequest {
|
|
@@ -683,6 +691,69 @@ interface PolymarketWithdrawResponse {
|
|
|
683
691
|
transaction_id: string;
|
|
684
692
|
status: string;
|
|
685
693
|
}
|
|
694
|
+
interface PolymarketWithdrawQuoteRequest {
|
|
695
|
+
wallet_address: string;
|
|
696
|
+
amount: string;
|
|
697
|
+
to_chain_id: string;
|
|
698
|
+
to_token_address: string;
|
|
699
|
+
recipient_address: string;
|
|
700
|
+
}
|
|
701
|
+
interface PolymarketWithdrawQuoteResponse {
|
|
702
|
+
quote_id: string;
|
|
703
|
+
from_amount_base_unit: string;
|
|
704
|
+
est_checkout_time_ms: number;
|
|
705
|
+
est_input_usd: number;
|
|
706
|
+
est_output_usd: number;
|
|
707
|
+
est_to_token_base_unit: string;
|
|
708
|
+
to_token_decimals: number;
|
|
709
|
+
to_token_symbol: string;
|
|
710
|
+
min_checkout_usd: number;
|
|
711
|
+
est_fee_breakdown?: Record<string, unknown>;
|
|
712
|
+
raw_bridge_quote?: Record<string, unknown>;
|
|
713
|
+
}
|
|
714
|
+
interface PolymarketTypedDataArg {
|
|
715
|
+
name: string;
|
|
716
|
+
type: string;
|
|
717
|
+
}
|
|
718
|
+
interface PolymarketTypedData {
|
|
719
|
+
domain: Record<string, unknown>;
|
|
720
|
+
types: Record<string, PolymarketTypedDataArg[]>;
|
|
721
|
+
primaryType: string;
|
|
722
|
+
message: Record<string, unknown>;
|
|
723
|
+
}
|
|
724
|
+
interface PolymarketWithdrawRelayBuildRequest {
|
|
725
|
+
owner_address: string;
|
|
726
|
+
wallet_address: string;
|
|
727
|
+
bridge_address: string;
|
|
728
|
+
amount: string;
|
|
729
|
+
}
|
|
730
|
+
interface PolymarketWithdrawRelayBuildResponse {
|
|
731
|
+
typed_data: PolymarketTypedData;
|
|
732
|
+
nonce: string;
|
|
733
|
+
deadline: string;
|
|
734
|
+
}
|
|
735
|
+
interface PolymarketWithdrawRelaySubmitRequest {
|
|
736
|
+
owner_address: string;
|
|
737
|
+
wallet_address: string;
|
|
738
|
+
bridge_address: string;
|
|
739
|
+
amount: string;
|
|
740
|
+
nonce: string;
|
|
741
|
+
deadline: string;
|
|
742
|
+
signature: string;
|
|
743
|
+
}
|
|
744
|
+
interface PolymarketWithdrawRelaySubmitResponse {
|
|
745
|
+
transaction_id: string;
|
|
746
|
+
status: string;
|
|
747
|
+
bridge_address: string;
|
|
748
|
+
}
|
|
749
|
+
interface PolymarketWithdrawBridgeStatusResponse {
|
|
750
|
+
bridge_address: string;
|
|
751
|
+
transaction_id?: string;
|
|
752
|
+
relayer_status?: string;
|
|
753
|
+
transaction_hash?: string;
|
|
754
|
+
bridge_status?: string;
|
|
755
|
+
raw_bridge_status?: Record<string, unknown>;
|
|
756
|
+
}
|
|
686
757
|
/** Lifecycle status of a user order. */
|
|
687
758
|
type OrderStatus = "live" | "matched" | "cancelled" | "invalid" | "submitted" | "pending" | "open" | "pending_close" | "closed" | "failed" | "expired";
|
|
688
759
|
/** Order direction. */
|
|
@@ -812,6 +883,25 @@ interface CreateOrderInput {
|
|
|
812
883
|
*/
|
|
813
884
|
builderCode?: string;
|
|
814
885
|
}
|
|
886
|
+
/** Request body for `POST /api/v1/orders/polymarket/execute`. */
|
|
887
|
+
interface PolymarketOrderExecuteRequest {
|
|
888
|
+
/** Already signed Polymarket CLOB `/order` payload. */
|
|
889
|
+
payload: unknown;
|
|
890
|
+
/** L2 API key used as the CLOB order owner. */
|
|
891
|
+
l2_api_key: string;
|
|
892
|
+
/** L2 HMAC secret. */
|
|
893
|
+
l2_secret: string;
|
|
894
|
+
/** L2 HMAC passphrase. */
|
|
895
|
+
l2_passphrase: string;
|
|
896
|
+
/** L1 EVM signer address that owns the L2 credentials. */
|
|
897
|
+
signer_address: string;
|
|
898
|
+
/** Optional explicit owner override; defaults to l2_api_key server-side. */
|
|
899
|
+
owner?: string;
|
|
900
|
+
}
|
|
901
|
+
/** Response from `POST /api/v1/orders/polymarket/execute`. */
|
|
902
|
+
interface PolymarketOrderExecuteResponse {
|
|
903
|
+
raw: Record<string, unknown>;
|
|
904
|
+
}
|
|
815
905
|
/** Response from `GET /api/v1/kyc/kalshi?wallet_address=...`. */
|
|
816
906
|
interface DFlowKYCStatus {
|
|
817
907
|
wallet_address: string;
|
|
@@ -1142,20 +1232,13 @@ declare class PredictClient {
|
|
|
1142
1232
|
*/
|
|
1143
1233
|
cancelOrder(id: string, source: ProviderSource, headers?: Record<string, string>): Promise<CancelOrderResult>;
|
|
1144
1234
|
/**
|
|
1145
|
-
*
|
|
1146
|
-
*
|
|
1147
|
-
* Maps to `POST /api/v1/orders/polymarket`.
|
|
1148
|
-
*
|
|
1149
|
-
* The caller must attach Polymarket CLOB authentication headers:
|
|
1150
|
-
* - `POLY_ADDRESS` — the EVM wallet address.
|
|
1151
|
-
* - `POLY_SIGNATURE` — L1 signature or L2 API key.
|
|
1152
|
-
* - `POLY_TIMESTAMP` — Unix milliseconds string.
|
|
1153
|
-
* - `POLY_NONCE` — credential nonce (use `"0"` for in-session derived creds).
|
|
1235
|
+
* Execute an already signed Polymarket CLOB order through prediction-server.
|
|
1154
1236
|
*
|
|
1155
|
-
*
|
|
1156
|
-
*
|
|
1237
|
+
* Maps to `POST /api/v1/orders/polymarket/execute`. The server builds the
|
|
1238
|
+
* CLOB HMAC headers from the provided L2 credentials, forwards `payload`
|
|
1239
|
+
* unchanged to `/order`, and records rebate identity mappings.
|
|
1157
1240
|
*/
|
|
1158
|
-
|
|
1241
|
+
executePolymarketOrder(req: PolymarketOrderExecuteRequest): Promise<PolymarketOrderExecuteResponse>;
|
|
1159
1242
|
/** Maps to `GET /api/v1/polymarket/tick-size?token_id=xxx`. */
|
|
1160
1243
|
getPolymarketTickSize(tokenId: string): Promise<TickSizeResponse>;
|
|
1161
1244
|
/** Maps to `GET /api/v1/polymarket/fee-rate?token_id=xxx`. */
|
|
@@ -1254,12 +1337,23 @@ declare class PredictClient {
|
|
|
1254
1337
|
* Maps to `GET /api/v1/deposit/polymarket/supported-assets`.
|
|
1255
1338
|
*/
|
|
1256
1339
|
getPolymarketSupportedAssets(): Promise<PolymarketSupportedAsset[]>;
|
|
1340
|
+
/** Maps to `POST /api/v1/withdraw/polymarket/quote`. */
|
|
1341
|
+
quotePolymarketWithdraw(body: PolymarketWithdrawQuoteRequest): Promise<PolymarketWithdrawQuoteResponse>;
|
|
1257
1342
|
/**
|
|
1258
1343
|
* Prepare a Polymarket withdrawal by obtaining a Bridge deposit address.
|
|
1259
1344
|
*
|
|
1260
1345
|
* Maps to `POST /api/v1/withdraw/polymarket/prepare`.
|
|
1261
1346
|
*/
|
|
1262
1347
|
preparePolymarketWithdraw(body: PolymarketWithdrawPrepareRequest): Promise<PolymarketWithdrawPrepareResponse>;
|
|
1348
|
+
/** Maps to `POST /api/v1/withdraw/polymarket/build-relay`. */
|
|
1349
|
+
buildPolymarketWithdrawRelay(body: PolymarketWithdrawRelayBuildRequest): Promise<PolymarketWithdrawRelayBuildResponse>;
|
|
1350
|
+
/** Maps to `POST /api/v1/withdraw/polymarket/submit-relay`. */
|
|
1351
|
+
submitPolymarketWithdrawRelay(body: PolymarketWithdrawRelaySubmitRequest): Promise<PolymarketWithdrawRelaySubmitResponse>;
|
|
1352
|
+
/** Maps to `GET /api/v1/withdraw/polymarket/status`. */
|
|
1353
|
+
getPolymarketWithdrawStatus(params: {
|
|
1354
|
+
bridge_address?: string;
|
|
1355
|
+
transaction_id?: string;
|
|
1356
|
+
}): Promise<PolymarketWithdrawBridgeStatusResponse>;
|
|
1263
1357
|
/**
|
|
1264
1358
|
* Execute a gasless USDC.e withdrawal from a Polymarket Safe wallet via Relayer.
|
|
1265
1359
|
*
|
|
@@ -1864,4 +1958,4 @@ declare function buildClobPayload(signedOrder: SignedOrder, owner: string): Clob
|
|
|
1864
1958
|
*/
|
|
1865
1959
|
declare function getPolymarketSharesPrecision(tickSize: string): number;
|
|
1866
1960
|
|
|
1867
|
-
export { type
|
|
1961
|
+
export { type PolymarketWithdrawPrepareRequest as $, type AvailableSharesResponse as A, type BalanceResponse as B, type Candlestick as C, type ListTradesMultiParams as D, type EventStats as E, type DFlowQuoteRequest as F, type DFlowQuoteResponse as G, type DFlowSubmitResponse as H, type DFlowSubmitRequest as I, type DFlowKYCStatus as J, type PolymarketSetupStatus as K, type ListEventsParams as L, type MatchesParams as M, type PolymarketDepositWalletDeployResponse as N, type OrderbookOutcome as O, PredictClient as P, type WithdrawBuildRequest as Q, type WithdrawSubmitResponse as R, type SimilarEventsParams as S, type WithdrawSubmitRequest as T, type WithdrawStatusResponse as U, type PolymarketDepositAddresses as V, type WithdrawBuildResponse as W, type PolymarketSupportedAsset as X, type PolymarketWithdrawResponse as Y, type PolymarketWithdrawRequest as Z, type PolymarketWithdrawPrepareResponse as _, PredictWsClient as a, type WsServerMessage as a$, type PolymarketWithdrawQuoteResponse as a0, type PolymarketWithdrawQuoteRequest as a1, type PolymarketWithdrawRelayBuildResponse as a2, type PolymarketWithdrawRelayBuildRequest as a3, type PolymarketWithdrawRelaySubmitResponse as a4, type PolymarketWithdrawRelaySubmitRequest as a5, type PolymarketWithdrawBridgeStatusResponse as a6, type PolymarketRedeemResponse as a7, type TickSizeResponse as a8, type FeeRateResponse as a9, type PolymarketOrderType as aA, type PolymarketWalletKind as aB, type PolymarketDepositWalletDeployRequest as aC, type DepositBuildRequest as aD, type DepositBuildResponse as aE, type DepositSubmitRequest as aF, type DepositSubmitResponse as aG, type DepositStatusResponse as aH, type UnsignedTx as aI, type PolymarketBridgeToken as aJ, type PolymarketSupportedAssetsResponse as aK, type PolymarketTypedData as aL, type PolymarketTypedDataArg as aM, type MatchStatus as aN, type MatchGroupEntry as aO, type MatchGroupMarket as aP, type MatchSortField as aQ, type MatchesStats as aR, type MatchConfidenceTier as aS, type SignalTag as aT, type MatchLeg as aU, type MatchMarketFlat as aV, type WsChannel as aW, type WsChannelEvent as aX, type WsClientMessage as aY, type WsSubscribeMessage as aZ, type WsPingMessage as a_, type RebateConfig as aa, type WsConnectionStatus as ab, type WsDataMessage as ac, type WsPriceEvent as ad, type WsOrderbookEvent as ae, type WsTradeEvent as af, type CreateOrderInput as ag, createPredictClient as ah, createPredictWsClient as ai, type PredictWsClientConfig as aj, type ProviderMeta as ak, type PredictTag as al, type SettlementSource as am, type MarketStatus as an, type MarketResult as ao, type MarketOutcome as ap, type OrderbookLevel as aq, type TradeType as ar, type EventSummary as as, type MarketSummary as at, type PredictCommentProfile as au, type PricePoint as av, type PredictPosition as aw, type OrderStatus as ax, type OrderSide as ay, type DFlowOrderContext as az, type PredictPage as b, type WsPongMessage as b0, type WsSubscribedMessage as b1, type WsErrorCode as b2, type WsErrorMessage as b3, type PolymarketRedeemPrepareInput as b4, type PolymarketRedeemPrepareResponse as b5, type PolymarketRedeemInput as b6, eventQueryKey as b7, fetchEvent as b8, resolveTagSlug 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, resolveEventsParams as ba, infiniteEventsQueryKey as bb, fetchEventsPage as bc, type ResolveEventsParamsInput as bd, type TagSlugSelection as be, marketQueryKey as bf, fetchMarket as bg, matchesQueryKey as bh, matchQueryKey as bi, fetchMatchesPage as bj, matchMarketsQueryKey as bk, fetchMatchMarketsPage as bl, CLOB_AUTH_DOMAIN as bm, CLOB_AUTH_TYPES as bn, buildClobAuthMessage as bo, hmacSha256Base64 as bp, buildPolymarketL2Headers as bq, derivePolymarketApiKey as br, type HttpMethod as bs, type PolymarketL2HeadersInput as bt, type PolymarketL2Headers as bu, type BuildClobAuthMessageInput as bv, CTF_EXCHANGE_ADDRESS as bw, NEG_RISK_CTF_EXCHANGE_ADDRESS as bx, USDC_ADDRESS as by, POLYGON_CHAIN_ID as bz, type PredictEvent as c, type ProviderSource as d, type EventStatus as e, type EventSortField as f, type PredictMarket as g, type Orderbook as h, type ListMarketTradesParams as i, type PredictTrade as j, type PriceHistoryRange as k, type PriceHistoryResponse as l, type ListCandlesticksParams as m, type ListCommentsParams as n, type PredictComment as o, type PositionsResponse as p, type ListOrdersParams as q, type PredictOrder as r, type ListOrdersMultiParams as s, type PredictOrdersResponse as t, type CancelOrderResult as u, type MatchGroupPage as v, type MatchGroup as w, type MatchMarketParams as x, type MatchMarketPage as y, type ListTradesParams as z };
|
package/dist/server.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { B as BalanceResponse,
|
|
1
|
+
export { B as BalanceResponse, bv as BuildClobAuthMessageInput, bJ as BuildOrderMessageInput, bm as CLOB_AUTH_DOMAIN, bn as CLOB_AUTH_TYPES, bw as CTF_EXCHANGE_ADDRESS, bB as CTF_ORDER_TYPES, u as CancelOrderResult, C as Candlestick, bI as ClobOrderPayload, ag as CreateOrderInput, bM as DEFAULT_PAGE_SIZE, az as DFlowOrderContext, F as DFlowQuoteRequest, G as DFlowQuoteResponse, I as DFlowSubmitRequest, H as DFlowSubmitResponse, aD as DepositBuildRequest, aE as DepositBuildResponse, aH as DepositStatusResponse, aF as DepositSubmitRequest, aG as DepositSubmitResponse, f as EventSortField, e as EventStatus, as as EventSummary, bs as HttpMethod, m as ListCandlesticksParams, L as ListEventsParams, i as ListMarketTradesParams, q as ListOrdersParams, z as ListTradesParams, ap as MarketOutcome, ao as MarketResult, an as MarketStatus, at as MarketSummary, aS as MatchConfidenceTier, w as MatchGroup, aO as MatchGroupEntry, aP as MatchGroupMarket, v as MatchGroupPage, aU as MatchLeg, aV as MatchMarketFlat, y as MatchMarketPage, x as MatchMarketParams, aQ as MatchSortField, aN as MatchStatus, M as MatchesParams, aR as MatchesStats, bx as NEG_RISK_CTF_EXCHANGE_ADDRESS, bC as ORDER_TYPE, bK as OrderMessage, ay as OrderSide, ax as OrderStatus, h as Orderbook, aq as OrderbookLevel, bz as POLYGON_CHAIN_ID, bu as PolymarketL2Headers, bt as PolymarketL2HeadersInput, aA as PolymarketOrderType, p as PositionsResponse, P as PredictClient, c as PredictEvent, g as PredictMarket, r as PredictOrder, b as PredictPage, aw as PredictPosition, al as PredictTag, j as PredictTrade, a as PredictWsClient, aj as PredictWsClientConfig, k as PriceHistoryRange, l as PriceHistoryResponse, av as PricePoint, ak as ProviderMeta, d as ProviderSource, bd as ResolveEventsParamsInput, bD as SIDE, am as SettlementSource, aT as SignalTag, bL as SignedOrder, S as SimilarEventsParams, be as TagSlugSelection, ar as TradeType, by as USDC_ADDRESS, aI as UnsignedTx, aW as WsChannel, aX as WsChannelEvent, aY as WsClientMessage, ab as WsConnectionStatus, ac as WsDataMessage, b2 as WsErrorCode, b3 as WsErrorMessage, ae as WsOrderbookEvent, a_ as WsPingMessage, b0 as WsPongMessage, ad as WsPriceEvent, a$ as WsServerMessage, aZ as WsSubscribeMessage, b1 as WsSubscribedMessage, af as WsTradeEvent, bo as buildClobAuthMessage, bG as buildClobPayload, bA as buildCtfExchangeDomain, bE as buildOrderMessage, bq as buildPolymarketL2Headers, bF as buildSignedOrder, ah as createPredictClient, ai as createPredictWsClient, br as derivePolymarketApiKey, b7 as eventQueryKey, b8 as fetchEvent, bc as fetchEventsPage, bg as fetchMarket, bl as fetchMatchMarketsPage, bj as fetchMatchesPage, bp as hmacSha256Base64, bb as infiniteEventsQueryKey, bf as marketQueryKey, bk as matchMarketsQueryKey, bi as matchQueryKey, bh as matchesQueryKey, ba as resolveEventsParams, b9 as resolveTagSlug } from './server-BYvRRFCr.mjs';
|
package/dist/server.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { B as BalanceResponse,
|
|
1
|
+
export { B as BalanceResponse, bv as BuildClobAuthMessageInput, bJ as BuildOrderMessageInput, bm as CLOB_AUTH_DOMAIN, bn as CLOB_AUTH_TYPES, bw as CTF_EXCHANGE_ADDRESS, bB as CTF_ORDER_TYPES, u as CancelOrderResult, C as Candlestick, bI as ClobOrderPayload, ag as CreateOrderInput, bM as DEFAULT_PAGE_SIZE, az as DFlowOrderContext, F as DFlowQuoteRequest, G as DFlowQuoteResponse, I as DFlowSubmitRequest, H as DFlowSubmitResponse, aD as DepositBuildRequest, aE as DepositBuildResponse, aH as DepositStatusResponse, aF as DepositSubmitRequest, aG as DepositSubmitResponse, f as EventSortField, e as EventStatus, as as EventSummary, bs as HttpMethod, m as ListCandlesticksParams, L as ListEventsParams, i as ListMarketTradesParams, q as ListOrdersParams, z as ListTradesParams, ap as MarketOutcome, ao as MarketResult, an as MarketStatus, at as MarketSummary, aS as MatchConfidenceTier, w as MatchGroup, aO as MatchGroupEntry, aP as MatchGroupMarket, v as MatchGroupPage, aU as MatchLeg, aV as MatchMarketFlat, y as MatchMarketPage, x as MatchMarketParams, aQ as MatchSortField, aN as MatchStatus, M as MatchesParams, aR as MatchesStats, bx as NEG_RISK_CTF_EXCHANGE_ADDRESS, bC as ORDER_TYPE, bK as OrderMessage, ay as OrderSide, ax as OrderStatus, h as Orderbook, aq as OrderbookLevel, bz as POLYGON_CHAIN_ID, bu as PolymarketL2Headers, bt as PolymarketL2HeadersInput, aA as PolymarketOrderType, p as PositionsResponse, P as PredictClient, c as PredictEvent, g as PredictMarket, r as PredictOrder, b as PredictPage, aw as PredictPosition, al as PredictTag, j as PredictTrade, a as PredictWsClient, aj as PredictWsClientConfig, k as PriceHistoryRange, l as PriceHistoryResponse, av as PricePoint, ak as ProviderMeta, d as ProviderSource, bd as ResolveEventsParamsInput, bD as SIDE, am as SettlementSource, aT as SignalTag, bL as SignedOrder, S as SimilarEventsParams, be as TagSlugSelection, ar as TradeType, by as USDC_ADDRESS, aI as UnsignedTx, aW as WsChannel, aX as WsChannelEvent, aY as WsClientMessage, ab as WsConnectionStatus, ac as WsDataMessage, b2 as WsErrorCode, b3 as WsErrorMessage, ae as WsOrderbookEvent, a_ as WsPingMessage, b0 as WsPongMessage, ad as WsPriceEvent, a$ as WsServerMessage, aZ as WsSubscribeMessage, b1 as WsSubscribedMessage, af as WsTradeEvent, bo as buildClobAuthMessage, bG as buildClobPayload, bA as buildCtfExchangeDomain, bE as buildOrderMessage, bq as buildPolymarketL2Headers, bF as buildSignedOrder, ah as createPredictClient, ai as createPredictWsClient, br as derivePolymarketApiKey, b7 as eventQueryKey, b8 as fetchEvent, bc as fetchEventsPage, bg as fetchMarket, bl as fetchMatchMarketsPage, bj as fetchMatchesPage, bp as hmacSha256Base64, bb as infiniteEventsQueryKey, bf as marketQueryKey, bk as matchMarketsQueryKey, bi as matchQueryKey, bh as matchesQueryKey, ba as resolveEventsParams, b9 as resolveTagSlug } from './server-BYvRRFCr.js';
|
package/dist/server.js
CHANGED
|
@@ -332,22 +332,15 @@ var PredictClient = class {
|
|
|
332
332
|
// Polymarket trading
|
|
333
333
|
// -------------------------------------------------------------------------
|
|
334
334
|
/**
|
|
335
|
-
*
|
|
335
|
+
* Execute an already signed Polymarket CLOB order through prediction-server.
|
|
336
336
|
*
|
|
337
|
-
* Maps to `POST /api/v1/orders/polymarket`.
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
* - `POLY_ADDRESS` — the EVM wallet address.
|
|
341
|
-
* - `POLY_SIGNATURE` — L1 signature or L2 API key.
|
|
342
|
-
* - `POLY_TIMESTAMP` — Unix milliseconds string.
|
|
343
|
-
* - `POLY_NONCE` — credential nonce (use `"0"` for in-session derived creds).
|
|
344
|
-
*
|
|
345
|
-
* @param input - Order parameters.
|
|
346
|
-
* @param headers - Polymarket CLOB auth headers (`POLY_*`).
|
|
337
|
+
* Maps to `POST /api/v1/orders/polymarket/execute`. The server builds the
|
|
338
|
+
* CLOB HMAC headers from the provided L2 credentials, forwards `payload`
|
|
339
|
+
* unchanged to `/order`, and records rebate identity mappings.
|
|
347
340
|
*/
|
|
348
|
-
async
|
|
349
|
-
const url = `${this.endpoint}/api/v1/orders/polymarket`;
|
|
350
|
-
return await utils.httpPost(url,
|
|
341
|
+
async executePolymarketOrder(req) {
|
|
342
|
+
const url = `${this.endpoint}/api/v1/orders/polymarket/execute`;
|
|
343
|
+
return await utils.httpPost(url, req);
|
|
351
344
|
}
|
|
352
345
|
/** Maps to `GET /api/v1/polymarket/tick-size?token_id=xxx`. */
|
|
353
346
|
async getPolymarketTickSize(tokenId) {
|
|
@@ -551,6 +544,11 @@ var PredictClient = class {
|
|
|
551
544
|
// -------------------------------------------------------------------------
|
|
552
545
|
// Polymarket Relayer Withdraw
|
|
553
546
|
// -------------------------------------------------------------------------
|
|
547
|
+
/** Maps to `POST /api/v1/withdraw/polymarket/quote`. */
|
|
548
|
+
async quotePolymarketWithdraw(body) {
|
|
549
|
+
const url = `${this.endpoint}/api/v1/withdraw/polymarket/quote`;
|
|
550
|
+
return await utils.httpPost(url, body);
|
|
551
|
+
}
|
|
554
552
|
/**
|
|
555
553
|
* Prepare a Polymarket withdrawal by obtaining a Bridge deposit address.
|
|
556
554
|
*
|
|
@@ -560,6 +558,22 @@ var PredictClient = class {
|
|
|
560
558
|
const url = `${this.endpoint}/api/v1/withdraw/polymarket/prepare`;
|
|
561
559
|
return await utils.httpPost(url, body);
|
|
562
560
|
}
|
|
561
|
+
/** Maps to `POST /api/v1/withdraw/polymarket/build-relay`. */
|
|
562
|
+
async buildPolymarketWithdrawRelay(body) {
|
|
563
|
+
const url = `${this.endpoint}/api/v1/withdraw/polymarket/build-relay`;
|
|
564
|
+
return await utils.httpPost(url, body);
|
|
565
|
+
}
|
|
566
|
+
/** Maps to `POST /api/v1/withdraw/polymarket/submit-relay`. */
|
|
567
|
+
async submitPolymarketWithdrawRelay(body) {
|
|
568
|
+
const url = `${this.endpoint}/api/v1/withdraw/polymarket/submit-relay`;
|
|
569
|
+
return await utils.httpPost(url, body);
|
|
570
|
+
}
|
|
571
|
+
/** Maps to `GET /api/v1/withdraw/polymarket/status`. */
|
|
572
|
+
async getPolymarketWithdrawStatus(params) {
|
|
573
|
+
const query = buildQuery(params);
|
|
574
|
+
const url = `${this.endpoint}/api/v1/withdraw/polymarket/status${query}`;
|
|
575
|
+
return await utils.httpGet(url);
|
|
576
|
+
}
|
|
563
577
|
/**
|
|
564
578
|
* Execute a gasless USDC.e withdrawal from a Polymarket Safe wallet via Relayer.
|
|
565
579
|
*
|