@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 +1 -1
- package/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +23 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -38
- package/dist/index.mjs.map +1 -1
- package/dist/{server-Da_gQzNk.d.mts → server-DYdQCzYz.d.mts} +24 -12
- package/dist/{server-Da_gQzNk.d.ts → server-DYdQCzYz.d.ts} +24 -12
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +7 -14
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +7 -14
- package/dist/server.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -253,22 +253,15 @@ var PredictClient = class {
|
|
|
253
253
|
// Polymarket trading
|
|
254
254
|
// -------------------------------------------------------------------------
|
|
255
255
|
/**
|
|
256
|
-
*
|
|
256
|
+
* Execute an already signed Polymarket CLOB order through prediction-server.
|
|
257
257
|
*
|
|
258
|
-
* Maps to `POST /api/v1/orders/polymarket`.
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
* - `POLY_ADDRESS` — the EVM wallet address.
|
|
262
|
-
* - `POLY_SIGNATURE` — L1 signature or L2 API key.
|
|
263
|
-
* - `POLY_TIMESTAMP` — Unix milliseconds string.
|
|
264
|
-
* - `POLY_NONCE` — credential nonce (use `"0"` for in-session derived creds).
|
|
265
|
-
*
|
|
266
|
-
* @param input - Order parameters.
|
|
267
|
-
* @param headers - Polymarket CLOB auth headers (`POLY_*`).
|
|
258
|
+
* Maps to `POST /api/v1/orders/polymarket/execute`. The server builds the
|
|
259
|
+
* CLOB HMAC headers from the provided L2 credentials, forwards `payload`
|
|
260
|
+
* unchanged to `/order`, and records rebate identity mappings.
|
|
268
261
|
*/
|
|
269
|
-
async
|
|
270
|
-
const url = `${this.endpoint}/api/v1/orders/polymarket`;
|
|
271
|
-
return await httpPost(url,
|
|
262
|
+
async executePolymarketOrder(req) {
|
|
263
|
+
const url = `${this.endpoint}/api/v1/orders/polymarket/execute`;
|
|
264
|
+
return await httpPost(url, req);
|
|
272
265
|
}
|
|
273
266
|
/** Maps to `GET /api/v1/polymarket/tick-size?token_id=xxx`. */
|
|
274
267
|
async getPolymarketTickSize(tokenId) {
|
|
@@ -2402,19 +2395,15 @@ function useCreatePolymarketOrder(mutationOptions = {}) {
|
|
|
2402
2395
|
input,
|
|
2403
2396
|
owner: creds.apiKey
|
|
2404
2397
|
});
|
|
2405
|
-
const
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
body: body2
|
|
2398
|
+
const result2 = await client.executePolymarketOrder({
|
|
2399
|
+
payload: v2Payload,
|
|
2400
|
+
l2_api_key: creds.apiKey,
|
|
2401
|
+
l2_secret: creds.secret,
|
|
2402
|
+
l2_passphrase: creds.passphrase,
|
|
2403
|
+
signer_address: creds.address,
|
|
2404
|
+
owner: creds.apiKey
|
|
2413
2405
|
});
|
|
2414
|
-
return
|
|
2415
|
-
v2Payload,
|
|
2416
|
-
headers2
|
|
2417
|
-
);
|
|
2406
|
+
return result2.raw;
|
|
2418
2407
|
}
|
|
2419
2408
|
if (signer.signTransaction && input.funderAddress) {
|
|
2420
2409
|
const orderCost = computeOrderCost(input);
|
|
@@ -2456,19 +2445,15 @@ function useCreatePolymarketOrder(mutationOptions = {}) {
|
|
|
2456
2445
|
input.orderType
|
|
2457
2446
|
);
|
|
2458
2447
|
const clobPayload = buildClobPayload(signedOrder, creds.apiKey);
|
|
2459
|
-
const
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
body
|
|
2448
|
+
const result = await client.executePolymarketOrder({
|
|
2449
|
+
payload: clobPayload,
|
|
2450
|
+
l2_api_key: creds.apiKey,
|
|
2451
|
+
l2_secret: creds.secret,
|
|
2452
|
+
l2_passphrase: creds.passphrase,
|
|
2453
|
+
signer_address: creds.address,
|
|
2454
|
+
owner: creds.apiKey
|
|
2467
2455
|
});
|
|
2468
|
-
return
|
|
2469
|
-
clobPayload,
|
|
2470
|
-
headers
|
|
2471
|
-
);
|
|
2456
|
+
return result.raw;
|
|
2472
2457
|
},
|
|
2473
2458
|
onSuccess: () => {
|
|
2474
2459
|
queryClient.invalidateQueries({ queryKey: ["predict", "orders"] });
|