@illalabs/interfaces 0.19.0 → 0.20.0-canary-beta-bcc83bb2

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.
Files changed (49) hide show
  1. package/dist/interfaces/hyperliquid/exchange.d.ts +3248 -0
  2. package/dist/interfaces/hyperliquid/exchange.d.ts.map +1 -0
  3. package/dist/interfaces/hyperliquid/exchange.js +61 -0
  4. package/dist/interfaces/hyperliquid/exchange.js.map +1 -0
  5. package/dist/interfaces/hyperliquid/index.d.ts +2 -0
  6. package/dist/interfaces/hyperliquid/index.d.ts.map +1 -0
  7. package/dist/interfaces/hyperliquid/index.js +2 -0
  8. package/dist/interfaces/hyperliquid/index.js.map +1 -0
  9. package/dist/interfaces/index.d.ts +1 -0
  10. package/dist/interfaces/index.d.ts.map +1 -1
  11. package/dist/interfaces/index.js +1 -0
  12. package/dist/interfaces/index.js.map +1 -1
  13. package/dist/schemas/messages.d.ts +2300 -0
  14. package/dist/schemas/messages.d.ts.map +1 -1
  15. package/dist/schemas/messages.js +53 -0
  16. package/dist/schemas/messages.js.map +1 -1
  17. package/dist/schemas/telemetryEvents.d.ts +5412 -0
  18. package/dist/schemas/telemetryEvents.d.ts.map +1 -1
  19. package/dist/types/actions/inputs.d.ts +7 -2
  20. package/dist/types/actions/inputs.d.ts.map +1 -1
  21. package/dist/types/actions/outputs.d.ts +9 -0
  22. package/dist/types/actions/outputs.d.ts.map +1 -1
  23. package/dist/types/actions/tools/hyperliquidClosePositionAction.d.ts +23 -0
  24. package/dist/types/actions/tools/hyperliquidClosePositionAction.d.ts.map +1 -0
  25. package/dist/types/actions/tools/hyperliquidClosePositionAction.js +2 -0
  26. package/dist/types/actions/tools/hyperliquidClosePositionAction.js.map +1 -0
  27. package/dist/types/actions/tools/hyperliquidGetAccountSummaryAction.d.ts +16 -0
  28. package/dist/types/actions/tools/hyperliquidGetAccountSummaryAction.d.ts.map +1 -0
  29. package/dist/types/actions/tools/hyperliquidGetAccountSummaryAction.js +2 -0
  30. package/dist/types/actions/tools/hyperliquidGetAccountSummaryAction.js.map +1 -0
  31. package/dist/types/actions/tools/hyperliquidGetPositionsAction.d.ts +16 -0
  32. package/dist/types/actions/tools/hyperliquidGetPositionsAction.d.ts.map +1 -0
  33. package/dist/types/actions/tools/hyperliquidGetPositionsAction.js +2 -0
  34. package/dist/types/actions/tools/hyperliquidGetPositionsAction.js.map +1 -0
  35. package/dist/types/actions/tools/hyperliquidPlaceOrderAction.d.ts +33 -0
  36. package/dist/types/actions/tools/hyperliquidPlaceOrderAction.d.ts.map +1 -0
  37. package/dist/types/actions/tools/hyperliquidPlaceOrderAction.js +2 -0
  38. package/dist/types/actions/tools/hyperliquidPlaceOrderAction.js.map +1 -0
  39. package/dist/types/actions/tools/hyperliquidUpdateLeverageAction.d.ts +25 -0
  40. package/dist/types/actions/tools/hyperliquidUpdateLeverageAction.d.ts.map +1 -0
  41. package/dist/types/actions/tools/hyperliquidUpdateLeverageAction.js +2 -0
  42. package/dist/types/actions/tools/hyperliquidUpdateLeverageAction.js.map +1 -0
  43. package/dist/types/actions/tools/index.d.ts +15 -0
  44. package/dist/types/actions/tools/index.d.ts.map +1 -1
  45. package/dist/utils/constants.d.ts +1 -1
  46. package/dist/utils/constants.d.ts.map +1 -1
  47. package/dist/utils/constants.js +5 -0
  48. package/dist/utils/constants.js.map +1 -1
  49. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exchange.d.ts","sourceRoot":"","sources":["../../../src/interfaces/hyperliquid/exchange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;;GAQG;AAEH,iFAAiF;AACjF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;EAIrC,CAAC;AAEH,eAAO,MAAM,sCAAsC;IAC/C,kFAAkF;;IAElF,kDAAkD;;;;;;;;;;;;;;;IAGlD,oEAAoE;;;IAGpE,6EAA6E;;IAE7E;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiB3C,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACpF,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,sCAAsC,CAChD,CAAC;AACF,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,uCAAuC,CACjD,CAAC"}
@@ -0,0 +1,61 @@
1
+ import { z } from "zod";
2
+ import { SignatureRequestSchema } from "../../schemas/messages.js";
3
+ /**
4
+ * Request/response contract for the Hyperliquid submission relay
5
+ * (`POST /api/v1/hyperliquid/exchange`).
6
+ *
7
+ * The relay forwards an ALREADY-SIGNED Hyperliquid action to Hyperliquid's
8
+ * `/exchange` endpoint and maps the response — it never signs. These are the
9
+ * same shapes the api-server controller validates, so the contract is
10
+ * single-sourced between the SDK and the API.
11
+ */
12
+ /** ECDSA signature split, as Hyperliquid expects it in the exchange envelope. */
13
+ export const HyperliquidSignatureSchema = z.object({
14
+ r: z.string(),
15
+ s: z.string(),
16
+ v: z.number(),
17
+ });
18
+ export const HyperliquidExchangeSubmitRequestSchema = z.object({
19
+ /** The unsigned action verbatim from the tool's actionMetadata.unsignedAction. */
20
+ action: z.record(z.unknown()),
21
+ /** Millisecond nonce the signature commits to. */
22
+ nonce: z.number(),
23
+ signature: HyperliquidSignatureSchema,
24
+ /** Sub-account / vault address. Unused in v1 (always undefined). */
25
+ vaultAddress: z.string().optional(),
26
+ network: z.enum(["mainnet", "testnet"]),
27
+ /** Integrity HMAC issued with the original signature request, if present. */
28
+ hmac: z.string().optional(),
29
+ /**
30
+ * When true, the relay does NOT submit. Instead it re-derives a fresh
31
+ * order from `action` using current market data (new markPx → recomputed
32
+ * IOC price) and a new nonce, and returns it under `rebuilt` for the client
33
+ * to re-sign and resubmit with `rebuildOrder: false`. Defaults to false
34
+ * (submit the already-signed action verbatim). The relay never signs and
35
+ * never holds keys in either mode. Treated as false when omitted.
36
+ */
37
+ rebuildOrder: z.boolean().optional(),
38
+ });
39
+ /** A freshly rebuilt, unsigned order returned when `rebuildOrder: true`. */
40
+ export const HyperliquidRebuiltOrderSchema = z.object({
41
+ action: z.record(z.unknown()),
42
+ nonce: z.number(),
43
+ network: z.enum(["mainnet", "testnet"]),
44
+ /** The EIP-712 typed data to re-sign. */
45
+ signatureRequest: SignatureRequestSchema,
46
+ });
47
+ export const HyperliquidExchangeSubmitResponseSchema = z.object({
48
+ success: z.boolean(),
49
+ status: z.enum(["filled", "resting", "error", "rebuilt"]),
50
+ /** Order id (filled or resting). */
51
+ oid: z.number().optional(),
52
+ /** Average fill price (filled). */
53
+ avgPx: z.string().optional(),
54
+ /** Filled size. */
55
+ totalSz: z.string().optional(),
56
+ /** Mapped, user-facing message on failure. */
57
+ error: z.string().optional(),
58
+ /** Present only when status === "rebuilt" (rebuildOrder was true). */
59
+ rebuilt: HyperliquidRebuiltOrderSchema.optional(),
60
+ });
61
+ //# sourceMappingURL=exchange.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exchange.js","sourceRoot":"","sources":["../../../src/interfaces/hyperliquid/exchange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,2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AE,CAAC,CAAC,OAAO,EAAE;IACpB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IACzD,oCAAoC;IACpC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,mCAAmC;IACnC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,mBAAmB;IACnB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,8CAA8C;IAC9C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,sEAAsE;IACtE,OAAO,EAAE,6BAA6B,CAAC,QAAQ,EAAE;CACpD,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./exchange.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interfaces/hyperliquid/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./exchange.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/hyperliquid/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,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 "./hyperliquid/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,wBAAwB,CAAC;AACvC,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 "./hyperliquid/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,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}