@liberfi.io/react-predict 0.3.39 → 0.3.40

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 CHANGED
@@ -96,7 +96,7 @@ Key methods:
96
96
  | `listOrders(params)` | `GET /api/v1/orders` |
97
97
  | `getOrder(id, source)` | `GET /api/v1/orders/:id` |
98
98
  | `cancelOrder(id, source)` | `DELETE /api/v1/orders/:id` |
99
- | `createPolymarketOrder(input, headers)` | `POST /api/v1/orders/polymarket` |
99
+ | `executePolymarketOrder(req)` | `POST /api/v1/orders/polymarket/execute` |
100
100
  | `createDFlowQuote(body)` | `POST /api/v1/orders/dflow/quote` |
101
101
  | `submitDFlowTransaction(body)` | `POST /api/v1/orders/dflow/submit` |
102
102
  | `listTrades(params)` | `GET /api/v1/trades` |
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PredictClient, a as PredictWsClient, L as ListEventsParams, b as PredictPage, c as PredictEvent, d as ProviderSource, E as EventStats, e as EventStatus, f as EventSortField, S as SimilarEventsParams, g as PredictMarket, O as OrderbookOutcome, h as Orderbook, i as ListMarketTradesParams, j as PredictTrade, k as PriceHistoryRange, l as PriceHistoryResponse, m as ListCandlesticksParams, C as Candlestick, n as ListCommentsParams, o as PredictComment, p as PositionsResponse, A as AvailableSharesResponse, B as BalanceResponse, q as ListOrdersParams, r as PredictOrder, s as ListOrdersMultiParams, t as PredictOrdersResponse, u as CancelOrderResult, M as MatchesParams, v as MatchGroupPage, w as MatchGroup, x as MatchMarketParams, y as MatchMarketPage, z as ListTradesParams, D as ListTradesMultiParams, F as DFlowQuoteRequest, G as DFlowQuoteResponse, H as DFlowSubmitResponse, I as DFlowSubmitRequest, J as DFlowKYCStatus, K as PolymarketSetupStatus, N as PolymarketDepositWalletDeployResponse, W as WithdrawBuildResponse, Q as WithdrawBuildRequest, R as WithdrawSubmitResponse, T as WithdrawSubmitRequest, U as WithdrawStatusResponse, V as PolymarketDepositAddresses, X as PolymarketSupportedAsset, Y as PolymarketWithdrawResponse, Z as PolymarketWithdrawRequest, _ as PolymarketRedeemResponse, $ as TickSizeResponse, a0 as FeeRateResponse, a1 as RebateConfig, a2 as WsConnectionStatus, a3 as WsDataMessage, a4 as WsPriceEvent, a5 as WsOrderbookEvent, a6 as WsTradeEvent, a7 as CreateOrderInput } from './server-Da_gQzNk.mjs';
2
- export { bm as BuildClobAuthMessageInput, bA as BuildOrderMessageInput, bd as CLOB_AUTH_DOMAIN, be as CLOB_AUTH_TYPES, bn as CTF_EXCHANGE_ADDRESS, bs as CTF_ORDER_TYPES, bz as ClobOrderPayload, aq as DFlowOrderContext, au as DepositBuildRequest, av as DepositBuildResponse, ay as DepositStatusResponse, aw as DepositSubmitRequest, ax as DepositSubmitResponse, aj as EventSummary, bj as HttpMethod, ag as MarketOutcome, af as MarketResult, ae as MarketStatus, ak as MarketSummary, aJ as MatchConfidenceTier, aF as MatchGroupEntry, aG as MatchGroupMarket, aL as MatchLeg, aM as MatchMarketFlat, aH as MatchSortField, aE as MatchStatus, aI as MatchesStats, bo as NEG_RISK_CTF_EXCHANGE_ADDRESS, bt as ORDER_TYPE, bB as OrderMessage, ap as OrderSide, ao as OrderStatus, ah as OrderbookLevel, bq as POLYGON_CHAIN_ID, aA as PolymarketBridgeToken, at as PolymarketDepositWalletDeployRequest, bl as PolymarketL2Headers, bk as PolymarketL2HeadersInput, ar as PolymarketOrderType, aZ as PolymarketRedeemInput, aX as PolymarketRedeemPrepareInput, aY as PolymarketRedeemPrepareResponse, aB as PolymarketSupportedAssetsResponse, as as PolymarketWalletKind, aC as PolymarketWithdrawPrepareRequest, aD as PolymarketWithdrawPrepareResponse, al as PredictCommentProfile, an as PredictPosition, ac as PredictTag, aa as PredictWsClientConfig, am as PricePoint, ab as ProviderMeta, b4 as ResolveEventsParamsInput, bu as SIDE, ad as SettlementSource, aK as SignalTag, bC as SignedOrder, b5 as TagSlugSelection, ai as TradeType, bp as USDC_ADDRESS, az as UnsignedTx, aN as WsChannel, aO as WsChannelEvent, aP as WsClientMessage, aV as WsErrorCode, aW as WsErrorMessage, aR as WsPingMessage, aT as WsPongMessage, aS as WsServerMessage, aQ as WsSubscribeMessage, aU as WsSubscribedMessage, bf as buildClobAuthMessage, bx as buildClobPayload, br as buildCtfExchangeDomain, bv as buildOrderMessage, bh as buildPolymarketL2Headers, bw as buildSignedOrder, a8 as createPredictClient, a9 as createPredictWsClient, bi as derivePolymarketApiKey, a_ as eventQueryKey, a$ as fetchEvent, b3 as fetchEventsPage, b7 as fetchMarket, bc as fetchMatchMarketsPage, ba as fetchMatchesPage, by as getPolymarketSharesPrecision, bg as hmacSha256Base64, b2 as infiniteEventsQueryKey, b6 as marketQueryKey, bb as matchMarketsQueryKey, b9 as matchQueryKey, b8 as matchesQueryKey, b1 as resolveEventsParams, b0 as resolveTagSlug } from './server-Da_gQzNk.mjs';
1
+ import { P as PredictClient, a as PredictWsClient, L as ListEventsParams, b as PredictPage, c as PredictEvent, d as ProviderSource, E as EventStats, e as EventStatus, f as EventSortField, S as SimilarEventsParams, g as PredictMarket, O as OrderbookOutcome, h as Orderbook, i as ListMarketTradesParams, j as PredictTrade, k as PriceHistoryRange, l as PriceHistoryResponse, m as ListCandlesticksParams, C as Candlestick, n as ListCommentsParams, o as PredictComment, p as PositionsResponse, A as AvailableSharesResponse, B as BalanceResponse, q as ListOrdersParams, r as PredictOrder, s as ListOrdersMultiParams, t as PredictOrdersResponse, u as CancelOrderResult, M as MatchesParams, v as MatchGroupPage, w as MatchGroup, x as MatchMarketParams, y as MatchMarketPage, z as ListTradesParams, D as ListTradesMultiParams, F as DFlowQuoteRequest, G as DFlowQuoteResponse, H as DFlowSubmitResponse, I as DFlowSubmitRequest, J as DFlowKYCStatus, K as PolymarketSetupStatus, N as PolymarketDepositWalletDeployResponse, W as WithdrawBuildResponse, Q as WithdrawBuildRequest, R as WithdrawSubmitResponse, T as WithdrawSubmitRequest, U as WithdrawStatusResponse, V as PolymarketDepositAddresses, X as PolymarketSupportedAsset, Y as PolymarketWithdrawResponse, Z as PolymarketWithdrawRequest, _ as PolymarketRedeemResponse, $ as TickSizeResponse, a0 as FeeRateResponse, a1 as RebateConfig, a2 as WsConnectionStatus, a3 as WsDataMessage, a4 as WsPriceEvent, a5 as WsOrderbookEvent, a6 as WsTradeEvent, a7 as CreateOrderInput } from './server-DYdQCzYz.mjs';
2
+ export { bm as BuildClobAuthMessageInput, bA as BuildOrderMessageInput, bd as CLOB_AUTH_DOMAIN, be as CLOB_AUTH_TYPES, bn as CTF_EXCHANGE_ADDRESS, bs as CTF_ORDER_TYPES, bz as ClobOrderPayload, aq as DFlowOrderContext, au as DepositBuildRequest, av as DepositBuildResponse, ay as DepositStatusResponse, aw as DepositSubmitRequest, ax as DepositSubmitResponse, aj as EventSummary, bj as HttpMethod, ag as MarketOutcome, af as MarketResult, ae as MarketStatus, ak as MarketSummary, aJ as MatchConfidenceTier, aF as MatchGroupEntry, aG as MatchGroupMarket, aL as MatchLeg, aM as MatchMarketFlat, aH as MatchSortField, aE as MatchStatus, aI as MatchesStats, bo as NEG_RISK_CTF_EXCHANGE_ADDRESS, bt as ORDER_TYPE, bB as OrderMessage, ap as OrderSide, ao as OrderStatus, ah as OrderbookLevel, bq as POLYGON_CHAIN_ID, aA as PolymarketBridgeToken, at as PolymarketDepositWalletDeployRequest, bl as PolymarketL2Headers, bk as PolymarketL2HeadersInput, ar as PolymarketOrderType, aZ as PolymarketRedeemInput, aX as PolymarketRedeemPrepareInput, aY as PolymarketRedeemPrepareResponse, aB as PolymarketSupportedAssetsResponse, as as PolymarketWalletKind, aC as PolymarketWithdrawPrepareRequest, aD as PolymarketWithdrawPrepareResponse, al as PredictCommentProfile, an as PredictPosition, ac as PredictTag, aa as PredictWsClientConfig, am as PricePoint, ab as ProviderMeta, b4 as ResolveEventsParamsInput, bu as SIDE, ad as SettlementSource, aK as SignalTag, bC as SignedOrder, b5 as TagSlugSelection, ai as TradeType, bp as USDC_ADDRESS, az as UnsignedTx, aN as WsChannel, aO as WsChannelEvent, aP as WsClientMessage, aV as WsErrorCode, aW as WsErrorMessage, aR as WsPingMessage, aT as WsPongMessage, aS as WsServerMessage, aQ as WsSubscribeMessage, aU as WsSubscribedMessage, bf as buildClobAuthMessage, bx as buildClobPayload, br as buildCtfExchangeDomain, bv as buildOrderMessage, bh as buildPolymarketL2Headers, bw as buildSignedOrder, a8 as createPredictClient, a9 as createPredictWsClient, bi as derivePolymarketApiKey, a_ as eventQueryKey, a$ as fetchEvent, b3 as fetchEventsPage, b7 as fetchMarket, bc as fetchMatchMarketsPage, ba as fetchMatchesPage, by as getPolymarketSharesPrecision, bg as hmacSha256Base64, b2 as infiniteEventsQueryKey, b6 as marketQueryKey, bb as matchMarketsQueryKey, b9 as matchQueryKey, b8 as matchesQueryKey, b1 as resolveEventsParams, b0 as resolveTagSlug } from './server-DYdQCzYz.mjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { PropsWithChildren } from 'react';
@@ -938,8 +938,9 @@ interface CreatePolymarketOrderVariables {
938
938
  * - If shortfall > 0, signs and submits approve + swap transactions.
939
939
  * - Polls until the swap is confirmed on-chain.
940
940
  * 3. Builds the EIP-712 `Order` typed data and prompts the wallet for a signature.
941
- * 4. Constructs HMAC L2 auth headers from the stored credentials.
942
- * 5. Submits the signed order via `POST /api/v1/orders/polymarket`.
941
+ * 4. Submits the signed order and L2 credentials via
942
+ * `POST /api/v1/orders/polymarket/execute`.
943
+ * 5. The server forwards the raw CLOB payload and records rebate identity maps.
943
944
  * 6. Invalidates `orders` and `positions` queries on success.
944
945
  *
945
946
  * @example
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PredictClient, a as PredictWsClient, L as ListEventsParams, b as PredictPage, c as PredictEvent, d as ProviderSource, E as EventStats, e as EventStatus, f as EventSortField, S as SimilarEventsParams, g as PredictMarket, O as OrderbookOutcome, h as Orderbook, i as ListMarketTradesParams, j as PredictTrade, k as PriceHistoryRange, l as PriceHistoryResponse, m as ListCandlesticksParams, C as Candlestick, n as ListCommentsParams, o as PredictComment, p as PositionsResponse, A as AvailableSharesResponse, B as BalanceResponse, q as ListOrdersParams, r as PredictOrder, s as ListOrdersMultiParams, t as PredictOrdersResponse, u as CancelOrderResult, M as MatchesParams, v as MatchGroupPage, w as MatchGroup, x as MatchMarketParams, y as MatchMarketPage, z as ListTradesParams, D as ListTradesMultiParams, F as DFlowQuoteRequest, G as DFlowQuoteResponse, H as DFlowSubmitResponse, I as DFlowSubmitRequest, J as DFlowKYCStatus, K as PolymarketSetupStatus, N as PolymarketDepositWalletDeployResponse, W as WithdrawBuildResponse, Q as WithdrawBuildRequest, R as WithdrawSubmitResponse, T as WithdrawSubmitRequest, U as WithdrawStatusResponse, V as PolymarketDepositAddresses, X as PolymarketSupportedAsset, Y as PolymarketWithdrawResponse, Z as PolymarketWithdrawRequest, _ as PolymarketRedeemResponse, $ as TickSizeResponse, a0 as FeeRateResponse, a1 as RebateConfig, a2 as WsConnectionStatus, a3 as WsDataMessage, a4 as WsPriceEvent, a5 as WsOrderbookEvent, a6 as WsTradeEvent, a7 as CreateOrderInput } from './server-Da_gQzNk.js';
2
- export { bm as BuildClobAuthMessageInput, bA as BuildOrderMessageInput, bd as CLOB_AUTH_DOMAIN, be as CLOB_AUTH_TYPES, bn as CTF_EXCHANGE_ADDRESS, bs as CTF_ORDER_TYPES, bz as ClobOrderPayload, aq as DFlowOrderContext, au as DepositBuildRequest, av as DepositBuildResponse, ay as DepositStatusResponse, aw as DepositSubmitRequest, ax as DepositSubmitResponse, aj as EventSummary, bj as HttpMethod, ag as MarketOutcome, af as MarketResult, ae as MarketStatus, ak as MarketSummary, aJ as MatchConfidenceTier, aF as MatchGroupEntry, aG as MatchGroupMarket, aL as MatchLeg, aM as MatchMarketFlat, aH as MatchSortField, aE as MatchStatus, aI as MatchesStats, bo as NEG_RISK_CTF_EXCHANGE_ADDRESS, bt as ORDER_TYPE, bB as OrderMessage, ap as OrderSide, ao as OrderStatus, ah as OrderbookLevel, bq as POLYGON_CHAIN_ID, aA as PolymarketBridgeToken, at as PolymarketDepositWalletDeployRequest, bl as PolymarketL2Headers, bk as PolymarketL2HeadersInput, ar as PolymarketOrderType, aZ as PolymarketRedeemInput, aX as PolymarketRedeemPrepareInput, aY as PolymarketRedeemPrepareResponse, aB as PolymarketSupportedAssetsResponse, as as PolymarketWalletKind, aC as PolymarketWithdrawPrepareRequest, aD as PolymarketWithdrawPrepareResponse, al as PredictCommentProfile, an as PredictPosition, ac as PredictTag, aa as PredictWsClientConfig, am as PricePoint, ab as ProviderMeta, b4 as ResolveEventsParamsInput, bu as SIDE, ad as SettlementSource, aK as SignalTag, bC as SignedOrder, b5 as TagSlugSelection, ai as TradeType, bp as USDC_ADDRESS, az as UnsignedTx, aN as WsChannel, aO as WsChannelEvent, aP as WsClientMessage, aV as WsErrorCode, aW as WsErrorMessage, aR as WsPingMessage, aT as WsPongMessage, aS as WsServerMessage, aQ as WsSubscribeMessage, aU as WsSubscribedMessage, bf as buildClobAuthMessage, bx as buildClobPayload, br as buildCtfExchangeDomain, bv as buildOrderMessage, bh as buildPolymarketL2Headers, bw as buildSignedOrder, a8 as createPredictClient, a9 as createPredictWsClient, bi as derivePolymarketApiKey, a_ as eventQueryKey, a$ as fetchEvent, b3 as fetchEventsPage, b7 as fetchMarket, bc as fetchMatchMarketsPage, ba as fetchMatchesPage, by as getPolymarketSharesPrecision, bg as hmacSha256Base64, b2 as infiniteEventsQueryKey, b6 as marketQueryKey, bb as matchMarketsQueryKey, b9 as matchQueryKey, b8 as matchesQueryKey, b1 as resolveEventsParams, b0 as resolveTagSlug } from './server-Da_gQzNk.js';
1
+ import { P as PredictClient, a as PredictWsClient, L as ListEventsParams, b as PredictPage, c as PredictEvent, d as ProviderSource, E as EventStats, e as EventStatus, f as EventSortField, S as SimilarEventsParams, g as PredictMarket, O as OrderbookOutcome, h as Orderbook, i as ListMarketTradesParams, j as PredictTrade, k as PriceHistoryRange, l as PriceHistoryResponse, m as ListCandlesticksParams, C as Candlestick, n as ListCommentsParams, o as PredictComment, p as PositionsResponse, A as AvailableSharesResponse, B as BalanceResponse, q as ListOrdersParams, r as PredictOrder, s as ListOrdersMultiParams, t as PredictOrdersResponse, u as CancelOrderResult, M as MatchesParams, v as MatchGroupPage, w as MatchGroup, x as MatchMarketParams, y as MatchMarketPage, z as ListTradesParams, D as ListTradesMultiParams, F as DFlowQuoteRequest, G as DFlowQuoteResponse, H as DFlowSubmitResponse, I as DFlowSubmitRequest, J as DFlowKYCStatus, K as PolymarketSetupStatus, N as PolymarketDepositWalletDeployResponse, W as WithdrawBuildResponse, Q as WithdrawBuildRequest, R as WithdrawSubmitResponse, T as WithdrawSubmitRequest, U as WithdrawStatusResponse, V as PolymarketDepositAddresses, X as PolymarketSupportedAsset, Y as PolymarketWithdrawResponse, Z as PolymarketWithdrawRequest, _ as PolymarketRedeemResponse, $ as TickSizeResponse, a0 as FeeRateResponse, a1 as RebateConfig, a2 as WsConnectionStatus, a3 as WsDataMessage, a4 as WsPriceEvent, a5 as WsOrderbookEvent, a6 as WsTradeEvent, a7 as CreateOrderInput } from './server-DYdQCzYz.js';
2
+ export { bm as BuildClobAuthMessageInput, bA as BuildOrderMessageInput, bd as CLOB_AUTH_DOMAIN, be as CLOB_AUTH_TYPES, bn as CTF_EXCHANGE_ADDRESS, bs as CTF_ORDER_TYPES, bz as ClobOrderPayload, aq as DFlowOrderContext, au as DepositBuildRequest, av as DepositBuildResponse, ay as DepositStatusResponse, aw as DepositSubmitRequest, ax as DepositSubmitResponse, aj as EventSummary, bj as HttpMethod, ag as MarketOutcome, af as MarketResult, ae as MarketStatus, ak as MarketSummary, aJ as MatchConfidenceTier, aF as MatchGroupEntry, aG as MatchGroupMarket, aL as MatchLeg, aM as MatchMarketFlat, aH as MatchSortField, aE as MatchStatus, aI as MatchesStats, bo as NEG_RISK_CTF_EXCHANGE_ADDRESS, bt as ORDER_TYPE, bB as OrderMessage, ap as OrderSide, ao as OrderStatus, ah as OrderbookLevel, bq as POLYGON_CHAIN_ID, aA as PolymarketBridgeToken, at as PolymarketDepositWalletDeployRequest, bl as PolymarketL2Headers, bk as PolymarketL2HeadersInput, ar as PolymarketOrderType, aZ as PolymarketRedeemInput, aX as PolymarketRedeemPrepareInput, aY as PolymarketRedeemPrepareResponse, aB as PolymarketSupportedAssetsResponse, as as PolymarketWalletKind, aC as PolymarketWithdrawPrepareRequest, aD as PolymarketWithdrawPrepareResponse, al as PredictCommentProfile, an as PredictPosition, ac as PredictTag, aa as PredictWsClientConfig, am as PricePoint, ab as ProviderMeta, b4 as ResolveEventsParamsInput, bu as SIDE, ad as SettlementSource, aK as SignalTag, bC as SignedOrder, b5 as TagSlugSelection, ai as TradeType, bp as USDC_ADDRESS, az as UnsignedTx, aN as WsChannel, aO as WsChannelEvent, aP as WsClientMessage, aV as WsErrorCode, aW as WsErrorMessage, aR as WsPingMessage, aT as WsPongMessage, aS as WsServerMessage, aQ as WsSubscribeMessage, aU as WsSubscribedMessage, bf as buildClobAuthMessage, bx as buildClobPayload, br as buildCtfExchangeDomain, bv as buildOrderMessage, bh as buildPolymarketL2Headers, bw as buildSignedOrder, a8 as createPredictClient, a9 as createPredictWsClient, bi as derivePolymarketApiKey, a_ as eventQueryKey, a$ as fetchEvent, b3 as fetchEventsPage, b7 as fetchMarket, bc as fetchMatchMarketsPage, ba as fetchMatchesPage, by as getPolymarketSharesPrecision, bg as hmacSha256Base64, b2 as infiniteEventsQueryKey, b6 as marketQueryKey, bb as matchMarketsQueryKey, b9 as matchQueryKey, b8 as matchesQueryKey, b1 as resolveEventsParams, b0 as resolveTagSlug } from './server-DYdQCzYz.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { PropsWithChildren } from 'react';
@@ -938,8 +938,9 @@ interface CreatePolymarketOrderVariables {
938
938
  * - If shortfall > 0, signs and submits approve + swap transactions.
939
939
  * - Polls until the swap is confirmed on-chain.
940
940
  * 3. Builds the EIP-712 `Order` typed data and prompts the wallet for a signature.
941
- * 4. Constructs HMAC L2 auth headers from the stored credentials.
942
- * 5. Submits the signed order via `POST /api/v1/orders/polymarket`.
941
+ * 4. Submits the signed order and L2 credentials via
942
+ * `POST /api/v1/orders/polymarket/execute`.
943
+ * 5. The server forwards the raw CLOB payload and records rebate identity maps.
943
944
  * 6. Invalidates `orders` and `positions` queries on success.
944
945
  *
945
946
  * @example
package/dist/index.js CHANGED
@@ -255,22 +255,15 @@ var PredictClient = class {
255
255
  // Polymarket trading
256
256
  // -------------------------------------------------------------------------
257
257
  /**
258
- * Create a Polymarket limit order via the prediction-server proxy.
258
+ * Execute an already signed Polymarket CLOB order through prediction-server.
259
259
  *
260
- * Maps to `POST /api/v1/orders/polymarket`.
261
- *
262
- * The caller must attach Polymarket CLOB authentication headers:
263
- * - `POLY_ADDRESS` — the EVM wallet address.
264
- * - `POLY_SIGNATURE` — L1 signature or L2 API key.
265
- * - `POLY_TIMESTAMP` — Unix milliseconds string.
266
- * - `POLY_NONCE` — credential nonce (use `"0"` for in-session derived creds).
267
- *
268
- * @param input - Order parameters.
269
- * @param headers - Polymarket CLOB auth headers (`POLY_*`).
260
+ * Maps to `POST /api/v1/orders/polymarket/execute`. The server builds the
261
+ * CLOB HMAC headers from the provided L2 credentials, forwards `payload`
262
+ * unchanged to `/order`, and records rebate identity mappings.
270
263
  */
271
- async createPolymarketOrder(input, headers) {
272
- const url = `${this.endpoint}/api/v1/orders/polymarket`;
273
- return await utils.httpPost(url, input, { headers });
264
+ async executePolymarketOrder(req) {
265
+ const url = `${this.endpoint}/api/v1/orders/polymarket/execute`;
266
+ return await utils.httpPost(url, req);
274
267
  }
275
268
  /** Maps to `GET /api/v1/polymarket/tick-size?token_id=xxx`. */
276
269
  async getPolymarketTickSize(tokenId) {
@@ -2404,19 +2397,15 @@ function useCreatePolymarketOrder(mutationOptions = {}) {
2404
2397
  input,
2405
2398
  owner: creds.apiKey
2406
2399
  });
2407
- const body2 = JSON.stringify(v2Payload);
2408
- const headers2 = await buildPolymarketL2Headers(creds.address, {
2409
- apiKey: creds.apiKey,
2410
- secret: creds.secret,
2411
- passphrase: creds.passphrase,
2412
- method: "POST",
2413
- requestPath: "/order",
2414
- body: body2
2400
+ const result2 = await client.executePolymarketOrder({
2401
+ payload: v2Payload,
2402
+ l2_api_key: creds.apiKey,
2403
+ l2_secret: creds.secret,
2404
+ l2_passphrase: creds.passphrase,
2405
+ signer_address: creds.address,
2406
+ owner: creds.apiKey
2415
2407
  });
2416
- return client.createPolymarketOrder(
2417
- v2Payload,
2418
- headers2
2419
- );
2408
+ return result2.raw;
2420
2409
  }
2421
2410
  if (signer.signTransaction && input.funderAddress) {
2422
2411
  const orderCost = computeOrderCost(input);
@@ -2458,19 +2447,15 @@ function useCreatePolymarketOrder(mutationOptions = {}) {
2458
2447
  input.orderType
2459
2448
  );
2460
2449
  const clobPayload = buildClobPayload(signedOrder, creds.apiKey);
2461
- const body = JSON.stringify(clobPayload);
2462
- const headers = await buildPolymarketL2Headers(creds.address, {
2463
- apiKey: creds.apiKey,
2464
- secret: creds.secret,
2465
- passphrase: creds.passphrase,
2466
- method: "POST",
2467
- requestPath: "/order",
2468
- body
2450
+ const result = await client.executePolymarketOrder({
2451
+ payload: clobPayload,
2452
+ l2_api_key: creds.apiKey,
2453
+ l2_secret: creds.secret,
2454
+ l2_passphrase: creds.passphrase,
2455
+ signer_address: creds.address,
2456
+ owner: creds.apiKey
2469
2457
  });
2470
- return client.createPolymarketOrder(
2471
- clobPayload,
2472
- headers
2473
- );
2458
+ return result.raw;
2474
2459
  },
2475
2460
  onSuccess: () => {
2476
2461
  queryClient.invalidateQueries({ queryKey: ["predict", "orders"] });