@illalabs/interfaces 0.19.0 → 0.19.1-canary-beta-acabdfae

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.
@@ -1,6 +1,7 @@
1
1
  export * from "./chat/index.js";
2
2
  export * from "./executionChecker/index.js";
3
3
  export * from "./planning/index.js";
4
+ export * from "./polymarket/index.js";
4
5
  export * from "./base.js";
5
6
  export * from "./autoRouter.js";
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}
@@ -1,6 +1,7 @@
1
1
  export * from "./chat/index.js";
2
2
  export * from "./executionChecker/index.js";
3
3
  export * from "./planning/index.js";
4
+ export * from "./polymarket/index.js";
4
5
  export * from "./base.js";
5
6
  export * from "./autoRouter.js";
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const POLYMARKET_ROUTES: {
2
+ readonly postOrder: "/api/v1/polymarket/post-order";
3
+ readonly postRedeem: "/api/v1/polymarket/post-redeem";
4
+ readonly postWithdraw: "/api/v1/polymarket/post-withdraw";
5
+ readonly getOrders: "/api/v1/polymarket/get-orders";
6
+ readonly cancelOrder: "/api/v1/polymarket/cancel-order";
7
+ };
8
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/interfaces/polymarket/constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB;;;;;;CAMpB,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Default route paths for the Polymarket API endpoints.
3
+ */
4
+ const POLYMARKET_BASE = "/api/v1/polymarket";
5
+ export const POLYMARKET_ROUTES = {
6
+ postOrder: `${POLYMARKET_BASE}/post-order`,
7
+ postRedeem: `${POLYMARKET_BASE}/post-redeem`,
8
+ postWithdraw: `${POLYMARKET_BASE}/post-withdraw`,
9
+ getOrders: `${POLYMARKET_BASE}/get-orders`,
10
+ cancelOrder: `${POLYMARKET_BASE}/cancel-order`,
11
+ };
12
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/interfaces/polymarket/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAE7C,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC7B,SAAS,EAAE,GAAG,eAAe,aAAa;IAC1C,UAAU,EAAE,GAAG,eAAe,cAAc;IAC5C,YAAY,EAAE,GAAG,eAAe,gBAAgB;IAChD,SAAS,EAAE,GAAG,eAAe,aAAa;IAC1C,WAAW,EAAE,GAAG,eAAe,eAAe;CACxC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export type * from "./request.js";
2
+ export type * from "./response.js";
3
+ export { POLYMARKET_ROUTES } from "./constants.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interfaces/polymarket/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,cAAc,CAAC;AAClC,mBAAmB,eAAe,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { POLYMARKET_ROUTES } from "./constants.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/polymarket/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,71 @@
1
+ import type { CancelOrderBody, GetOrdersBody, PostOrderBody, PostRedeemBody, PostWithdrawBody } from "../../schemas/polymarketBody.js";
2
+ /**
3
+ * Polymarket SDK request body types.
4
+ *
5
+ * These are thin aliases over the canonical Zod-inferred request types in
6
+ * {@link ../../schemas/polymarketBody.js}, which the api-server validates every
7
+ * request against. Sourcing the SDK types from those schemas guarantees the
8
+ * `.polymarket.{method}` facade stays in lockstep with the live contract
9
+ * (CLOB v2 order fields, the deposit-wallet `WALLET_BATCH`/`WALLET_CREATE`
10
+ * paths, the discriminated redeem/withdraw bodies, etc.).
11
+ */
12
+ /**
13
+ * Signed order data for Polymarket CLOB orders. Covers both v1 and v2 orders;
14
+ * v2 adds the optional `timestamp` / `metadata` / `builder` fields.
15
+ */
16
+ export type PolymarketSignedOrder = PostOrderBody["order"];
17
+ /**
18
+ * Auth data needed for authenticated Polymarket CLOB API calls.
19
+ * Obtained by signing via /api/v1/signatures/sign beforehand.
20
+ */
21
+ export type PolymarketAuthData = PostOrderBody["authData"];
22
+ /**
23
+ * Additional signed wallet operation submitted alongside an order — a Safe
24
+ * deploy/approval on the legacy path, or a deposit-wallet create/batch on the
25
+ * new ERC-1967 path.
26
+ */
27
+ export type PolymarketAdditionalSignature = NonNullable<PostOrderBody["additionalSignatures"]>[number];
28
+ /**
29
+ * Request body for POST /api/v1/polymarket/post-order.
30
+ * Posts a pre-signed order to the Polymarket CLOB API.
31
+ *
32
+ * `transactionsSucceeded` is optional here (clients may omit it) even though the
33
+ * inferred schema output marks it required — the api-server's Zod schema defaults
34
+ * it to `true` server-side.
35
+ */
36
+ export type PolymarketPostOrderBody = Omit<PostOrderBody, "transactionsSucceeded"> & {
37
+ transactionsSucceeded?: boolean;
38
+ };
39
+ /**
40
+ * The legacy Safe (`SAFE_EXECUTE`) variant of a redeem/withdraw request body.
41
+ */
42
+ export type PolymarketSafeExecuteBody = Extract<PostRedeemBody, {
43
+ type: "SAFE_EXECUTE";
44
+ }>;
45
+ /**
46
+ * The deposit-wallet (`WALLET_BATCH`) variant of a redeem/withdraw request body.
47
+ */
48
+ export type PolymarketWalletBatchBody = Extract<PostRedeemBody, {
49
+ type: "WALLET_BATCH";
50
+ }>;
51
+ /**
52
+ * Request body for POST /api/v1/polymarket/post-redeem.
53
+ * Discriminated on `type`: `SAFE_EXECUTE` (legacy Safe) | `WALLET_BATCH` (deposit wallet).
54
+ */
55
+ export type PolymarketPostRedeemBody = PostRedeemBody;
56
+ /**
57
+ * Request body for POST /api/v1/polymarket/post-withdraw.
58
+ * Discriminated on `type`: `SAFE_EXECUTE` (legacy Safe) | `WALLET_BATCH` (deposit wallet).
59
+ */
60
+ export type PolymarketPostWithdrawBody = PostWithdrawBody;
61
+ /**
62
+ * Request body for POST /api/v1/polymarket/get-orders.
63
+ * Fetches open orders from the Polymarket CLOB API.
64
+ */
65
+ export type PolymarketGetOrdersBody = GetOrdersBody;
66
+ /**
67
+ * Request body for POST /api/v1/polymarket/cancel-order.
68
+ * Cancels an order on the Polymarket CLOB API.
69
+ */
70
+ export type PolymarketCancelOrderBody = CancelOrderBody;
71
+ //# sourceMappingURL=request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/interfaces/polymarket/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,eAAe,EACf,aAAa,EACb,aAAa,EACb,cAAc,EACd,gBAAgB,EACnB,MAAM,iCAAiC,CAAC;AAEzC;;;;;;;;;GASG;AAEH;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;AAE3D;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;AAE3D;;;;GAIG;AACH,MAAM,MAAM,6BAA6B,GAAG,WAAW,CACnD,aAAa,CAAC,sBAAsB,CAAC,CACxC,CAAC,MAAM,CAAC,CAAC;AAEV;;;;;;;GAOG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,aAAa,EAAE,uBAAuB,CAAC,GAAG;IACjF,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC,CAAC;AAE1F;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC,CAAC;AAE1F;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC;AAEtD;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG,gBAAgB,CAAC;AAE1D;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,aAAa,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,eAAe,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/interfaces/polymarket/request.ts"],"names":[],"mappings":""}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Success response from POST /api/v1/polymarket/post-order.
3
+ */
4
+ export interface PolymarketPostOrderSuccessResponse {
5
+ readonly success: true;
6
+ readonly orderId: string;
7
+ readonly status: string;
8
+ readonly orderType: string;
9
+ readonly transactionsCount?: number;
10
+ readonly transactionsHashes?: readonly string[];
11
+ readonly takingAmount?: string;
12
+ readonly makingAmount?: string;
13
+ }
14
+ /**
15
+ * Success response from POST /api/v1/polymarket/post-redeem and POST /api/v1/polymarket/post-withdraw.
16
+ */
17
+ export interface PolymarketSafeExecuteSuccessResponse {
18
+ readonly success: true;
19
+ readonly status: string;
20
+ readonly message: string;
21
+ readonly transactionHash?: string;
22
+ }
23
+ /**
24
+ * Success response from POST /api/v1/polymarket/get-orders.
25
+ */
26
+ export interface PolymarketGetOrdersSuccessResponse<TOrder extends object = Record<string, unknown>> {
27
+ readonly success: true;
28
+ readonly orders: readonly TOrder[];
29
+ readonly orderCount: number;
30
+ readonly hasMore: boolean;
31
+ }
32
+ /**
33
+ * Success response from POST /api/v1/polymarket/cancel-order.
34
+ */
35
+ export interface PolymarketCancelOrderSuccessResponse {
36
+ readonly success: true;
37
+ readonly orderId: string;
38
+ readonly status: string;
39
+ }
40
+ /**
41
+ * Validation error response (PolymarketInvalidParams — 400).
42
+ */
43
+ export interface PolymarketValidationErrorResponse {
44
+ readonly name: "PolymarketInvalidParams";
45
+ readonly message: string;
46
+ readonly statusCode: 400;
47
+ readonly details: {
48
+ readonly validationErrors: readonly {
49
+ readonly field: string;
50
+ readonly message: string;
51
+ }[];
52
+ };
53
+ }
54
+ /**
55
+ * Action error response (ActionInputError / ActionExecutionError — 400, or Internal Server Error — 500).
56
+ */
57
+ export interface PolymarketActionErrorResponse {
58
+ readonly success: false;
59
+ readonly error: string;
60
+ }
61
+ /**
62
+ * Union of all Polymarket error response shapes.
63
+ */
64
+ export type PolymarketErrorResponse = PolymarketValidationErrorResponse | PolymarketActionErrorResponse;
65
+ //# sourceMappingURL=response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/interfaces/polymarket/response.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,kCAAkC;IAC/C,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACjD,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,kCAAkC,CAC/C,MAAM,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAE/C,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACjD,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAC9C,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE;QACd,QAAQ,CAAC,gBAAgB,EAAE,SAAS;YAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;YACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;SAC5B,EAAE,CAAC;KACP,CAAC;CACL;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC1C,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAC7B,iCAAiC,GACjC,6BAA6B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/interfaces/polymarket/response.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@illalabs/interfaces",
3
- "version": "0.19.0",
3
+ "version": "0.19.1-canary-beta-acabdfae",
4
4
  "description": "ILLA interfaces and types",
5
5
  "repository": {
6
6
  "type": "git",