@symmio/trading-core 4.2.0 → 4.3.0
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/dist/solvers/estimated-price/get-estimated-price.d.ts +3 -1
- package/dist/solvers/estimated-price/get-estimated-price.d.ts.map +1 -1
- package/dist/solvers/estimated-price/get-estimated-price.js.map +1 -1
- package/dist/solvers/estimated-price/to-estimated-price.d.ts +2 -1
- package/dist/solvers/estimated-price/to-estimated-price.d.ts.map +1 -1
- package/dist/solvers/estimated-price/to-estimated-price.js +4 -1
- package/dist/solvers/estimated-price/to-estimated-price.js.map +1 -1
- package/dist/solvers/types/generated/enigma-solver.d.ts +1 -0
- package/dist/solvers/types/generated/enigma-solver.d.ts.map +1 -1
- package/dist/solvers/types/generated/enigma-solver.js.map +1 -1
- package/dist/tpsl/assert-tpsl-acceptance.d.ts +3 -0
- package/dist/tpsl/assert-tpsl-acceptance.d.ts.map +1 -0
- package/dist/tpsl/assert-tpsl-acceptance.js +14 -0
- package/dist/tpsl/assert-tpsl-acceptance.js.map +1 -0
- package/dist/tpsl/delete-quote-tpsl/delete-quote-tpsl.d.ts +4 -3
- package/dist/tpsl/delete-quote-tpsl/delete-quote-tpsl.d.ts.map +1 -1
- package/dist/tpsl/delete-quote-tpsl/delete-quote-tpsl.js +9 -11
- package/dist/tpsl/delete-quote-tpsl/delete-quote-tpsl.js.map +1 -1
- package/dist/tpsl/delete-quote-tpsl/query.d.ts +4 -0
- package/dist/tpsl/delete-quote-tpsl/query.d.ts.map +1 -1
- package/dist/tpsl/delete-quote-tpsl/query.js +1 -0
- package/dist/tpsl/delete-quote-tpsl/query.js.map +1 -1
- package/dist/tpsl/search-tpsl-orders/search-tpsl-orders.d.ts.map +1 -1
- package/dist/tpsl/search-tpsl-orders/search-tpsl-orders.js +31 -28
- package/dist/tpsl/search-tpsl-orders/search-tpsl-orders.js.map +1 -1
- package/dist/tpsl/set-quote-tpsl/build-conditional-order-leg.d.ts +1 -1
- package/dist/tpsl/set-quote-tpsl/build-conditional-order-leg.d.ts.map +1 -1
- package/dist/tpsl/set-quote-tpsl/build-conditional-order-leg.js +9 -7
- package/dist/tpsl/set-quote-tpsl/build-conditional-order-leg.js.map +1 -1
- package/dist/tpsl/set-quote-tpsl/query.d.ts +4 -0
- package/dist/tpsl/set-quote-tpsl/query.d.ts.map +1 -1
- package/dist/tpsl/set-quote-tpsl/query.js +1 -0
- package/dist/tpsl/set-quote-tpsl/query.js.map +1 -1
- package/dist/tpsl/set-quote-tpsl/set-quote-tpsl.d.ts +3 -3
- package/dist/tpsl/set-quote-tpsl/set-quote-tpsl.d.ts.map +1 -1
- package/dist/tpsl/set-quote-tpsl/set-quote-tpsl.js +42 -40
- package/dist/tpsl/set-quote-tpsl/set-quote-tpsl.js.map +1 -1
- package/package.json +1 -1
|
@@ -28,8 +28,10 @@ export type GetEstimatedPriceParameters = Compute<ReadSolverParameter & {
|
|
|
28
28
|
* Return type of {@link getEstimatedPrice}.
|
|
29
29
|
*/
|
|
30
30
|
export interface GetEstimatedPriceReturnType {
|
|
31
|
-
/**
|
|
31
|
+
/** Shadow-inclusive execution price (decimal string); `"0"` when the solver omits it. Use for all trading calculations. */
|
|
32
32
|
estimatedPrice: string;
|
|
33
|
+
/** Execution price without shadow, when supplied by the solver. Diagnostic only; never a trading-price fallback. */
|
|
34
|
+
estimatedPriceWithoutShadow?: string;
|
|
33
35
|
}
|
|
34
36
|
/**
|
|
35
37
|
* Ask the solver what price an open or close would actually fill at — a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-estimated-price.d.ts","sourceRoot":"","sources":["../../../src/solvers/estimated-price/get-estimated-price.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAKnE,6EAA6E;AAC7E,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAC/C,mBAAmB,GAAG;IACpB,wBAAwB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB;IACrB,YAAY,EAAE,YAAY,CAAC;IAC3B,uDAAuD;IACvD,KAAK,EAAE,mBAAmB,CAAC;IAC3B;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CACF,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,
|
|
1
|
+
{"version":3,"file":"get-estimated-price.d.ts","sourceRoot":"","sources":["../../../src/solvers/estimated-price/get-estimated-price.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAKnE,6EAA6E;AAC7E,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,OAAO,CAC/C,mBAAmB,GAAG;IACpB,wBAAwB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB;IACrB,YAAY,EAAE,YAAY,CAAC;IAC3B,uDAAuD;IACvD,KAAK,EAAE,mBAAmB,CAAC;IAC3B;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CACF,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,2HAA2H;IAC3H,cAAc,EAAE,MAAM,CAAC;IACvB,oHAAoH;IACpH,2BAA2B,CAAC,EAAE,MAAM,CAAC;CACtC;AAOD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,2BAA2B,GACtC,OAAO,CAAC,2BAA2B,CAAC,CA2BtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-estimated-price.js","names":[],"sources":["../../../src/solvers/estimated-price/get-estimated-price.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError, SymmError } from \"../../shared/errors/symm-error\";\nimport type { Compute, ReadSolverParameter } from \"../../shared/types/properties\";\nimport { PositionType } from \"../../symmio-contracts/symmio/types\";\nimport { assertSolverKind } from \"../assert-solver-kind\";\nimport { getEstimatedPrice as requestEstimatedPrice } from \"../types/generated/enigma-solver\";\nimport { toEstimatedPrice } from \"./to-estimated-price\";\n\n/** Whether a price estimate is for **opening** or **closing** a position. */\nexport type EstimatedPriceEntry = \"open\" | \"close\";\n\n/**\n * Parameters for {@link getEstimatedPrice}.\n */\nexport type GetEstimatedPriceParameters = Compute<\n ReadSolverParameter & {\n /** Solver market id. */\n symbolId: number;\n /** Order quantity (decimal string). */\n quantity: string;\n /** Long or short. */\n positionType: PositionType;\n /** Whether this estimate is for an open or a close. */\n entry: EstimatedPriceEntry;\n /**\n * The price **sent to the solver** — the slippage-adjusted request price the\n * caller computed for the open/close, **not** the raw mark price. The solver\n * prices the fill relative to it.\n */\n price: string;\n /** Cancels the underlying HTTP request; no timeout is imposed by default. */\n signal?: AbortSignal;\n }\n>;\n\n/**\n * Return type of {@link getEstimatedPrice}.\n */\nexport interface GetEstimatedPriceReturnType {\n /**
|
|
1
|
+
{"version":3,"file":"get-estimated-price.js","names":[],"sources":["../../../src/solvers/estimated-price/get-estimated-price.ts"],"sourcesContent":["import { isAxiosError } from \"axios\";\nimport type { Config } from \"../../core/config\";\nimport { SymmApiError, SymmError } from \"../../shared/errors/symm-error\";\nimport type { Compute, ReadSolverParameter } from \"../../shared/types/properties\";\nimport { PositionType } from \"../../symmio-contracts/symmio/types\";\nimport { assertSolverKind } from \"../assert-solver-kind\";\nimport { getEstimatedPrice as requestEstimatedPrice } from \"../types/generated/enigma-solver\";\nimport { toEstimatedPrice } from \"./to-estimated-price\";\n\n/** Whether a price estimate is for **opening** or **closing** a position. */\nexport type EstimatedPriceEntry = \"open\" | \"close\";\n\n/**\n * Parameters for {@link getEstimatedPrice}.\n */\nexport type GetEstimatedPriceParameters = Compute<\n ReadSolverParameter & {\n /** Solver market id. */\n symbolId: number;\n /** Order quantity (decimal string). */\n quantity: string;\n /** Long or short. */\n positionType: PositionType;\n /** Whether this estimate is for an open or a close. */\n entry: EstimatedPriceEntry;\n /**\n * The price **sent to the solver** — the slippage-adjusted request price the\n * caller computed for the open/close, **not** the raw mark price. The solver\n * prices the fill relative to it.\n */\n price: string;\n /** Cancels the underlying HTTP request; no timeout is imposed by default. */\n signal?: AbortSignal;\n }\n>;\n\n/**\n * Return type of {@link getEstimatedPrice}.\n */\nexport interface GetEstimatedPriceReturnType {\n /** Shadow-inclusive execution price (decimal string); `\"0\"` when the solver omits it. Use for all trading calculations. */\n estimatedPrice: string;\n /** Execution price without shadow, when supplied by the solver. Diagnostic only; never a trading-price fallback. */\n estimatedPriceWithoutShadow?: string;\n}\n\n/** Solver wire value for a position side (`\"long\"` / `\"short\"`). */\nfunction positionTypeToWire(positionType: PositionType): string {\n return positionType === PositionType.SHORT ? \"short\" : \"long\";\n}\n\n/**\n * Ask the solver what price an open or close would actually fill at — a\n * read-only simulation of the trade (`GET /estimated-price`; nothing is\n * submitted). Pass the order `quantity`, the side, whether it's an open or\n * close, and the slippage-adjusted request `price`; the solver returns the price\n * it would fill at, from which the UI derives price impact (see\n * {@link calculatePriceImpact}) and — for a close — an estimated PnL.\n *\n * @param config - The SDK config.\n * @param parameters - Market, quantity, side, entry (open/close), and request price.\n * @returns The estimated execution price.\n * @throws {SymmApiError} when the solver request fails.\n * @throws {SymmError} when the chain is unsupported.\n *\n * @example\n * ```ts\n * const { estimatedPrice } = await getEstimatedPrice(config, {\n * symbolId: 1,\n * quantity: \"1000\",\n * positionType: PositionType.LONG,\n * entry: \"open\",\n * price: requestPrice, // slippage-adjusted, from calculateTradeParams\n * });\n * ```\n */\nexport async function getEstimatedPrice(\n config: Config,\n parameters: GetEstimatedPriceParameters,\n): Promise<GetEstimatedPriceReturnType> {\n const solver = config.getSolver({ chainId: parameters.chainId, solverId: parameters.solverId });\n assertSolverKind(solver, \"enigma\", \"getEstimatedPrice\");\n try {\n const response = await requestEstimatedPrice(\n {\n symbol_id: parameters.symbolId,\n quantity: parameters.quantity,\n position_type: positionTypeToWire(parameters.positionType),\n entry: parameters.entry,\n price: parameters.price,\n },\n { baseURL: solver.url, signal: parameters.signal },\n );\n return toEstimatedPrice(response.data);\n } catch (err) {\n if (err instanceof SymmError) throw err;\n if (isAxiosError(err)) {\n throw SymmApiError.fromAxios(err, { code: \"FETCH_ESTIMATED_PRICE_FAILED\", baseURL: solver.url });\n }\n throw new SymmError(\n \"api\",\n \"FETCH_ESTIMATED_PRICE_FAILED\",\n `Failed to fetch estimated price: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err instanceof Error ? err : undefined },\n );\n }\n}\n"],"mappings":";;;;;;;AA+CA,SAAS,EAAmB,GAAoC;CAC9D,OAAO,MAAiB,EAAa,QAAQ,UAAU;AACzD;AA2BA,eAAsB,EACpB,GACA,GACsC;CACtC,IAAM,IAAS,EAAO,UAAU;EAAE,SAAS,EAAW;EAAS,UAAU,EAAW;CAAS,CAAC;CAC9F,EAAiB,GAAQ,UAAU,mBAAmB;CACtD,IAAI;EAWF,OAAO,GAAiB,MAVD,EACrB;GACE,WAAW,EAAW;GACtB,UAAU,EAAW;GACrB,eAAe,EAAmB,EAAW,YAAY;GACzD,OAAO,EAAW;GAClB,OAAO,EAAW;EACpB,GACA;GAAE,SAAS,EAAO;GAAK,QAAQ,EAAW;EAAO,CACnD,GACiC,IAAI;CACvC,SAAS,GAAK;EAKZ,MAJI,aAAe,IAAiB,IAChC,EAAa,CAAG,IACZ,EAAa,UAAU,GAAK;GAAE,MAAM;GAAgC,SAAS,EAAO;EAAI,CAAC,IAE3F,IAAI,EACR,OACA,gCACA,oCAAoC,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG,KACnF,EAAE,OAAO,aAAe,QAAQ,IAAM,KAAA,EAAU,CAClD;CACF;AACF"}
|
|
@@ -3,7 +3,8 @@ import { GetEstimatedPriceReturnType } from './get-estimated-price.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Map the generated `ApiGetEstimatedPriceResponse` into the SDK's
|
|
5
5
|
* {@link GetEstimatedPriceReturnType}. A missing / empty `price` defaults to
|
|
6
|
-
* `"0"`.
|
|
6
|
+
* `"0"`. The optional no-shadow price is diagnostic data and is never invented
|
|
7
|
+
* or substituted for the execution price.
|
|
7
8
|
*/
|
|
8
9
|
export declare function toEstimatedPrice(raw: ApiGetEstimatedPriceResponse): GetEstimatedPriceReturnType;
|
|
9
10
|
//# sourceMappingURL=to-estimated-price.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-estimated-price.d.ts","sourceRoot":"","sources":["../../../src/solvers/estimated-price/to-estimated-price.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AACrF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEzE
|
|
1
|
+
{"version":3,"file":"to-estimated-price.d.ts","sourceRoot":"","sources":["../../../src/solvers/estimated-price/to-estimated-price.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AACrF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEzE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,4BAA4B,GAAG,2BAA2B,CAO/F"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
//#region src/solvers/estimated-price/to-estimated-price.ts
|
|
2
2
|
function e(e) {
|
|
3
|
-
return {
|
|
3
|
+
return {
|
|
4
|
+
estimatedPrice: typeof e.price == "string" && e.price.length > 0 ? e.price : "0",
|
|
5
|
+
...typeof e.price_without_shadow == "string" && e.price_without_shadow.length > 0 ? { estimatedPriceWithoutShadow: e.price_without_shadow } : {}
|
|
6
|
+
};
|
|
4
7
|
}
|
|
5
8
|
//#endregion
|
|
6
9
|
export { e as toEstimatedPrice };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-estimated-price.js","names":[],"sources":["../../../src/solvers/estimated-price/to-estimated-price.ts"],"sourcesContent":["import type { ApiGetEstimatedPriceResponse } from \"../types/generated/enigma-solver\";\nimport type { GetEstimatedPriceReturnType } from \"./get-estimated-price\";\n\n/**\n * Map the generated `ApiGetEstimatedPriceResponse` into the SDK's\n * {@link GetEstimatedPriceReturnType}. A missing / empty `price` defaults to\n * `\"0\"
|
|
1
|
+
{"version":3,"file":"to-estimated-price.js","names":[],"sources":["../../../src/solvers/estimated-price/to-estimated-price.ts"],"sourcesContent":["import type { ApiGetEstimatedPriceResponse } from \"../types/generated/enigma-solver\";\nimport type { GetEstimatedPriceReturnType } from \"./get-estimated-price\";\n\n/**\n * Map the generated `ApiGetEstimatedPriceResponse` into the SDK's\n * {@link GetEstimatedPriceReturnType}. A missing / empty `price` defaults to\n * `\"0\"`. The optional no-shadow price is diagnostic data and is never invented\n * or substituted for the execution price.\n */\nexport function toEstimatedPrice(raw: ApiGetEstimatedPriceResponse): GetEstimatedPriceReturnType {\n return {\n estimatedPrice: typeof raw.price === \"string\" && raw.price.length > 0 ? raw.price : \"0\",\n ...(typeof raw.price_without_shadow === \"string\" && raw.price_without_shadow.length > 0\n ? { estimatedPriceWithoutShadow: raw.price_without_shadow }\n : {}),\n };\n}\n"],"mappings":";AASA,SAAgB,EAAiB,GAAgE;CAC/F,OAAO;EACL,gBAAgB,OAAO,EAAI,SAAU,YAAY,EAAI,MAAM,SAAS,IAAI,EAAI,QAAQ;EACpF,GAAI,OAAO,EAAI,wBAAyB,YAAY,EAAI,qBAAqB,SAAS,IAClF,EAAE,6BAA6B,EAAI,qBAAqB,IACxD,CAAC;CACP;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enigma-solver.d.ts","sourceRoot":"","sources":["../../../../src/solvers/types/generated/enigma-solver.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG/D,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,gCAAgC,CAAC,EAAE,MAAM,CAAC;IAC1C,mCAAmC,CAAC,EAAE,MAAM,CAAC;IAC7C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,kBAAkB,CA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B,GAAG,aAAa,CAAC,kBAAkB,CAAC,CAAC;AACzE,MAAM,MAAM,cAAc,GAAG,aAAa,CAAC,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC,kBAAkB,CAAC,CAAC;AACjE,MAAM,MAAM,mCAAmC,GAAG,aAAa,CAAC,6BAA6B,CAAC,CAAC;AAC/F,MAAM,MAAM,4BAA4B,GAAG,aAAa,CAAC,2BAA2B,EAAE,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enigma-solver.js","names":[],"sources":["../../../../src/solvers/types/generated/enigma-solver.ts"],"sourcesContent":["/**\n * Generated by orval v8.14.0 🍺\n * Do not edit manually.\n * Low Cap Solver API\n * API for Low Cap Solver trading system\n * OpenAPI spec version: 1.0\n */\nimport type { AxiosRequestConfig, AxiosResponse } from \"axios\";\nimport axios from \"axios\";\n\nexport interface ApiContractSymbol {\n asset?: string;\n funding_rate_epoch_duration?: string;\n funding_rate_window_time?: string;\n hedger_fee_close?: string;\n hedger_fee_close_early_rate?: string;\n hedger_fee_close_early_threshold?: string;\n hedger_fee_close_standard_threshold?: string;\n hedger_fee_open?: string;\n is_valid?: boolean;\n lot_size?: string;\n max_funding_rate?: string;\n max_leverage?: string;\n max_notional_value?: number;\n max_quantity?: string;\n min_acceptable_portion_lf?: string;\n min_acceptable_quote_value?: string;\n min_close_solver_fee_cap?: string;\n min_notional_value?: string;\n min_open_solver_fee_cap?: string;\n name?: string;\n price_precision?: number;\n quantity_precision?: number;\n rfq_allowed?: boolean;\n /** \"all\", \"long\", or \"short\" */\n side?: string;\n /** 0: Disabled, 1: Close only, 2: Open only, 3: Fully enabled */\n state?: number;\n symbol?: string;\n symbol_id?: number;\n /** From price service GetSymbolsInfo */\n token_address?: string;\n trading_fee?: string;\n}\n\nexport interface ApiContractSymbolsResponse {\n count?: number;\n symbols?: ApiContractSymbol[];\n}\n\nexport type ApiCustomTableDataItem = { [key: string]: unknown };\n\nexport interface ApiCustomTableHeader {\n key?: string;\n label?: string;\n}\n\nexport interface ApiCustomTable {\n data?: ApiCustomTableDataItem[];\n headers?: ApiCustomTableHeader[];\n title?: string;\n}\n\nexport interface ApiDailyTradeVolumeResponse {\n timestamp?: string;\n volume?: string;\n}\n\nexport interface ApiFundingInfoItem {\n funding_rate_epoch_duration?: number;\n next_funding_rate_long?: string;\n next_funding_rate_short?: string;\n next_funding_time?: number;\n}\n\nexport interface ApiFundingInfoBySymbolsResponse {\n [key: string]: ApiFundingInfoItem;\n}\n\nexport interface ApiFundingInfoResponse {\n [key: string]: ApiFundingInfoItem;\n}\n\nexport interface ApiGetEstimatedPriceResponse {\n price?: string;\n}\n\nexport interface ApiGetInstantCloseResponse {\n close_price?: string;\n quantity_to_close?: string;\n quote_id?: number;\n}\n\nexport interface ApiGetInstantOpenResponse {\n cva?: string;\n lf?: string;\n order_type?: number;\n partyAmm?: string;\n partyBmm?: string;\n party_a_address?: string;\n position_type?: number;\n quantity?: string;\n requested_open_price?: string;\n symbol_id?: number;\n temp_quote_id?: number;\n /** UUID is the frontend-provided UUID from the V2 sendQuote metadata */\n uuid?: string;\n}\n\nexport interface ApiGetQuoteIdResponse {\n quote_id?: number;\n}\n\nexport interface ApiQuoteInfo {\n affiliate?: string;\n avg_closed_price?: string;\n block_number?: number;\n closed_amount?: string;\n create_timestamp?: string;\n cva?: string;\n deadline?: string;\n id?: string;\n initial_cva?: string;\n initial_lf?: string;\n initial_opened_price?: string;\n initial_party_amm?: string;\n initial_party_bmm?: string;\n last_funding_payment_timestamp?: string;\n lf?: string;\n market_price?: string;\n max_funding_rate?: string;\n opened_price?: string;\n order_type?: number;\n parent_id?: string;\n party_a?: string;\n party_amm?: string;\n party_b?: string;\n party_bmm?: string;\n position_type?: number;\n quantity?: string;\n quantity_to_close?: string;\n quote_status?: number;\n requested_close_price?: string;\n requested_open_price?: string;\n status_modify_timestamp?: string;\n symbol_id?: string;\n trading_fee?: string;\n}\n\nexport interface ApiGetQuotesResponse {\n count?: number;\n quotes?: ApiQuoteInfo[];\n}\n\nexport interface ApiGetSolverInfoResponse {\n /** Configured USD amount per instant close, including each partial close, before signed fee-cap adjustments. */\n static_solver_fee_close?: string;\n /** Configured USD amount per instant open, before signed fee-cap adjustments. */\n static_solver_fee_open?: string;\n}\n\nexport interface ApiPeriodStats {\n \"1h\"?: number;\n \"1w\"?: number;\n \"24h\"?: number;\n \"5m\"?: number;\n}\n\nexport interface ApiStatsMetrics {\n \"Completed Closes\"?: ApiPeriodStats;\n \"Completed Opens\"?: ApiPeriodStats;\n \"Instant Closes\"?: ApiPeriodStats;\n \"Instant Opens\"?: ApiPeriodStats;\n}\n\nexport interface ApiGetStatsResponse {\n custom_tables?: ApiCustomTable[];\n periodic_stats?: ApiStatsMetrics;\n}\n\nexport interface ApiGetTempQuoteStatusResponse {\n completion_source?: string;\n cva?: string;\n error_category?: string;\n /** Populated only when State is \"Failed\" or \"Cancelled\". ErrorCode mirrors\n * the synchronous /instant_trade contract; ErrorCategory is the stable\n * bucket the frontend maps to user-facing copy. See\n * docs/reference/instant-trade-errors.md. */\n error_code?: number;\n error_detail?: string;\n error_message?: string;\n lf?: string;\n margin?: string;\n max_funding_rate?: string;\n opened_price?: string;\n order_type?: number;\n party_a_account?: string;\n party_amm?: string;\n position_type?: number;\n price?: string;\n quantity?: string;\n quote_id?: number;\n recovered_at?: string;\n recovery_log_index?: number;\n recovery_reason?: string;\n recovery_tx_hash?: string;\n state?: string;\n sub_account?: string;\n symbol_id?: number;\n}\n\nexport interface ApiLockedParamsBySymbolIdResponse {\n cva?: string;\n leverage?: string;\n lf?: string;\n partyAmm?: string;\n partyBmm?: string;\n}\n\nexport interface ApiNotionalCapBySymbolResponse {\n available_to_long?: number;\n available_to_short?: number;\n error?: string;\n open_interest?: number;\n price?: number;\n symbol?: string;\n symbol_id?: number;\n token_balance?: number;\n total_cap?: number;\n usdc_balance?: number;\n used?: number;\n used_tokens?: number;\n}\n\nexport interface ApiNotionalCapAllSymbolsResponse {\n count?: number;\n symbols?: ApiNotionalCapBySymbolResponse[];\n total_open_interest?: number;\n total_used?: number;\n}\n\nexport interface ApiPostInstantOpenResponse {\n partyBmm?: string;\n temp_quote_id?: number;\n}\n\nexport interface ApiRevenueRecordItem {\n amount?: string;\n created_at?: string;\n id?: number;\n symbol_id?: number;\n}\n\nexport interface ApiRevenueRecordsResponse {\n count?: number;\n records?: ApiRevenueRecordItem[];\n}\n\nexport interface ApiRevenueResponse {\n funding_revenue?: string;\n hedger_fee_revenue?: string;\n record_count?: number;\n total_revenue?: string;\n}\n\nexport interface ApiSymbolResponse {\n asset?: string;\n funding_rate_epoch_duration?: string;\n funding_rate_window_time?: string;\n hedger_fee_close?: string;\n hedger_fee_close_early_rate?: string;\n hedger_fee_close_early_threshold?: string;\n hedger_fee_close_standard_threshold?: string;\n hedger_fee_open?: string;\n is_valid?: boolean;\n lot_size?: string;\n max_funding_rate?: string;\n max_leverage?: string;\n max_notional_value?: number;\n max_quantity?: string;\n min_acceptable_portion_lf?: string;\n min_acceptable_quote_value?: string;\n min_close_solver_fee_cap?: string;\n min_notional_value?: string;\n min_open_solver_fee_cap?: string;\n name?: string;\n price_precision?: number;\n quantity_precision?: number;\n rfq_allowed?: boolean;\n state_long?: number;\n state_short?: number;\n symbol?: string;\n symbol_id?: number;\n token_address?: string;\n trading_fee?: string;\n}\n\nexport interface ApiSymbolsResponse {\n count?: number;\n symbols?: ApiSymbolResponse[];\n}\n\nexport interface Eip712FlexFieldJSON {\n authorizedFlexFiller?: string;\n length?: number;\n offset?: number;\n}\n\nexport interface Eip712ReplayHeaderJSON {\n deadline: number;\n nonce?: number;\n salt: string;\n}\n\nexport interface Eip712AccountJSON {\n addr: string;\n isPartyB?: boolean;\n}\n\nexport interface Eip712SignedOperationJSON {\n callData: string;\n flexFields?: Eip712FlexFieldJSON[];\n maxUses?: number;\n replayAttackHeader: Eip712ReplayHeaderJSON;\n signer: string;\n signerAccount: Eip712AccountJSON;\n target: string;\n}\n\nexport interface Eip712OperationWithSigJSON {\n signature: string;\n signedOperation: Eip712SignedOperationJSON;\n}\n\nexport interface ApiV2InstantCloseRequest {\n /**\n * @minItems 1\n * @maxItems 100\n */\n operations: Eip712OperationWithSigJSON[];\n}\n\nexport interface ApiV2InstantOpenRequest {\n addMargin?: Eip712OperationWithSigJSON;\n sendQuote: Eip712OperationWithSigJSON;\n}\n\nexport enum ClientErrorCategory {\n CategoryValidation = \"validation\",\n CategoryAuthentication = \"authentication\",\n CategoryAuthorization = \"authorization\",\n CategorySlippage = \"slippage\",\n CategoryLiquidity = \"liquidity\",\n CategoryAccountState = \"account_state\",\n CategorySymbolState = \"symbol_state\",\n CategoryRateLimit = \"rate_limit\",\n CategoryTimeout = \"timeout\",\n CategoryInternal = \"internal\",\n CategoryUnavailable = \"unavailable\",\n}\nexport interface ClientErrorCodeInfo {\n category?: ClientErrorCategory;\n code?: number;\n http_status?: number;\n message?: string;\n}\n\nexport interface XfiberErrorResponse {\n code?: number;\n error_detail?: string;\n error_message?: string;\n}\n\nexport type GetErrorCodes200 = { [key: string]: string };\n\nexport type GetEstimatedPriceParams = {\n /**\n * Symbol ID\n */\n symbol_id: number;\n /**\n * Order quantity\n */\n quantity: string;\n /**\n * Position type (long/short)\n */\n position_type: string;\n /**\n * Entry type (open/close)\n */\n entry: string;\n /**\n * Price\n */\n price: string;\n};\n\nexport type GetFundingInfoParams = {\n /**\n * Symbol IDs (omit for all)\n */\n symbol_ids?: number[];\n};\n\nexport type GetGetFundingInfoParams = {\n /**\n * Symbol names (omit for all)\n */\n symbols?: string[];\n};\n\nexport type GetGetLockedParamsSymbolParams = {\n /**\n * Leverage\n */\n leverage: number;\n};\n\nexport type GetGetMarketInfo200 = { [key: string]: unknown };\n\nexport type GetInstantTradeEip712Config200 = { [key: string]: unknown };\n\nexport type GetMarketInfo200 = { [key: string]: unknown };\n\nexport type GetNotionalCapParams = {\n /**\n * Limit results (max 500, default 100)\n */\n limit?: number;\n /**\n * Offset for pagination (default 0)\n */\n offset?: number;\n};\n\nexport type GetNotionalCapBatchParams = {\n /**\n * Symbol IDs (max 100)\n */\n symbol_ids: number[];\n};\n\nexport type GetQuotesParams = {\n /**\n * Symbol ID filter\n */\n symbol_id?: number;\n /**\n * Party A address filter\n */\n party_a?: string;\n /**\n * Quote status filter (1-7)\n */\n status?: number;\n /**\n * Limit results (max 500, default 100)\n */\n limit?: number;\n /**\n * Offset for pagination (default 0)\n */\n offset?: number;\n};\n\nexport type GetRevenueRecordsParams = {\n /**\n * Last seen income-history record ID\n */\n id?: number;\n /**\n * Optional symbol IDs (max 100)\n */\n symbolIds?: number[];\n /**\n * Offset for pagination (default 0)\n */\n offset?: number;\n /**\n * Limit results (max 500, default 100)\n */\n limit?: number;\n};\n\nexport type GetRevenueSymbolIdParams = {\n /**\n * Preset range (1h, 24h, 7d, 30d, lifetime)\n */\n time_range?: string;\n /**\n * Revenue type filter (HedgerFee, FundingRate)\n */\n type?: string;\n /**\n * Unix timestamp start (overrides time_range)\n */\n start_time?: number;\n /**\n * Unix timestamp end\n */\n end_time?: number;\n};\n\nexport type GetStatsParams = {\n /**\n * Filter response to specific stat types (periodic_stats, single_metrics, custom_tables, alerts)\n */\n include?: string[];\n};\n\nexport type GetSymbolsParams = {\n /**\n * Limit results (max 500, default 100)\n */\n limit?: number;\n /**\n * Offset for pagination (default 0)\n */\n offset?: number;\n /**\n * Symbol ID\n */\n symbol_id?: number;\n /**\n * Case-insensitive match on symbol name\n */\n search?: string;\n /**\n * Asset exact match\n */\n asset?: string;\n /**\n * Token address exact match\n */\n token_address?: string;\n /**\n * Validity filter: true, false, any (default true)\n */\n is_valid?: string;\n /**\n * Long-side state filter: disabled, close_only, open_only, enabled\n */\n state_long?: string;\n /**\n * Short-side state filter: disabled, close_only, open_only, enabled\n */\n state_short?: string;\n};\n\n/**\n * @summary Get contract symbols\n */\nexport const getContractSymbols = (\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiContractSymbolsResponse>> => {\n return axios.get(`/contract-symbols`, options);\n};\n\n/**\n * @summary Get API error codes\n */\nexport const getErrorCodes = (options?: AxiosRequestConfig): Promise<AxiosResponse<GetErrorCodes200>> => {\n return axios.get(`/error_codes`, options);\n};\n\n/**\n * Returns solver-registered error codes (>= 3000) with message, category, and http_status. Use the flat /error_codes endpoint for backward-compatible code→message lookups.\n * @summary Get detailed API error codes\n */\nexport const getErrorCodesDetailed = (options?: AxiosRequestConfig): Promise<AxiosResponse<ClientErrorCodeInfo[]>> => {\n return axios.get(`/error_codes/detailed`, options);\n};\n\n/**\n * Get estimated execution price from inventory service (dry-run mode)\n * @summary Get estimated price for order\n */\nexport const getEstimatedPrice = (\n params: GetEstimatedPriceParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiGetEstimatedPriceResponse>> => {\n return axios.get(`/estimated-price`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * @summary Get funding info by symbol ID\n */\nexport const getFundingInfo = (\n params?: GetFundingInfoParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiFundingInfoResponse>> => {\n return axios.get(`/funding-info`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * @deprecated\n * @summary Get funding info by symbol name\n */\nexport const getGetFundingInfo = (\n params?: GetGetFundingInfoParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiFundingInfoBySymbolsResponse>> => {\n return axios.get(`/get_funding_info`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * @summary Get locked params by symbol\n */\nexport const getGetLockedParamsSymbol = (\n symbol: string,\n params: GetGetLockedParamsSymbolParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiLockedParamsBySymbolIdResponse>> => {\n return axios.get(`/get_locked_params/${symbol}`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * Returns a JSON object whose keys are symbol names (dynamic — sourced from contract-symbol data) mapping to {trading_volume, lifetime_value}, plus top-level aggregate fields total_value_24h and total_lifetime_value.\n * @deprecated\n * @summary Get 24h market info by symbol name\n */\nexport const getGetMarketInfo = (options?: AxiosRequestConfig): Promise<AxiosResponse<GetGetMarketInfo200>> => {\n return axios.get(`/get_market_info`, options);\n};\n\n/**\n * Returns configured static solver fees as exact USD decimal strings; zero disables a fee.\n * The close amount applies to each partial close. Actual charges remain subject to signed fee caps.\n * @summary Get solver general information\n */\nexport const getInfo = (options?: AxiosRequestConfig): Promise<AxiosResponse<ApiGetSolverInfoResponse>> => {\n return axios.get(`/info`, options);\n};\n\n/**\n * Returns all pending instant close orders for a given SubAccount address.\n * @summary Get pending instant close orders\n */\nexport const getInstantCloseAccountAddress = (\n accountAddress: string,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiGetInstantCloseResponse[]>> => {\n return axios.get(`/instant_close/${accountAddress}`, options);\n};\n\n/**\n * Returns all pending instant open orders for a given SubAccount address.\n * @summary Get pending instant open orders\n */\nexport const getInstantOpenAccountAddress = (\n accountAddress: string,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiGetInstantOpenResponse[]>> => {\n return axios.get(`/instant_open/${accountAddress}`, options);\n};\n\n/**\n * @summary Get quote ID by temp ID\n */\nexport const getInstantQuoteIdTempQuoteId = (\n tempQuoteId: number,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiGetQuoteIdResponse>> => {\n return axios.get(`/instant_quote_id/${tempQuoteId}`, options);\n};\n\n/**\n * Returns the EIP-712 domain, domain separator, type hashes, and full type definitions that clients must use when constructing signatures for V2 instant open/close operations. No authentication required.\n * @summary Get V2 EIP-712 signing config\n */\nexport const getInstantTradeEip712Config = (\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<GetInstantTradeEip712Config200>> => {\n return axios.get(`/instant_trade/eip712-config`, options);\n};\n\n/**\n * Submit one or more V2 close operations (requestToClosePosition), one per quote. No JWT required — identity is proven by EIP-712 signature recovery. Each signedOperation.maxUses must explicitly equal 1. A previously submitted signature is rejected in every record state (case and optional 0x prefix are ignored), including concurrent replays. Operations commit individually; earlier operations remain accepted if a later operation fails. Processing happens asynchronously.\n * @summary Submit V2 instant close\n */\nexport const postInstantTradeInstantClose = (\n apiV2InstantCloseRequest: ApiV2InstantCloseRequest,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<void>> => {\n return axios.post(`/instant_trade/instant_close`, apiV2InstantCloseRequest, options);\n};\n\n/**\n * Submit a V2 instant open request with pre-signed EIP-712 PartyA operations (addMargin + sendQuote). No JWT required — identity is proven by EIP-712 signature recovery. Processing (hedge, muon sigs, symmio-api call) happens asynchronously.\n * PartyBsWhiteList must contain exactly the configured PartyB proxy. The signed open cap must cover the complete dynamic plus static solver fee at the fresh market price. Admission requires collateral for both solver fees while preserving margin and the protocol trading fee, using local VA balances with RPC fallback only for missing account rows.\n * @summary Submit V2 instant open\n */\nexport const postInstantTradeInstantOpen = (\n apiV2InstantOpenRequest: ApiV2InstantOpenRequest,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiPostInstantOpenResponse>> => {\n return axios.post(`/instant_trade/instant_open`, apiV2InstantOpenRequest, options);\n};\n\n/**\n * Returns a JSON object whose keys are symbol IDs mapping to {trading_volume, lifetime_value}, plus top-level aggregate fields total_value_24h and total_lifetime_value.\n * @summary Get 24h market info by symbol ID\n */\nexport const getMarketInfo = (options?: AxiosRequestConfig): Promise<AxiosResponse<GetMarketInfo200>> => {\n return axios.get(`/market-info`, options);\n};\n\n/**\n * Fetches all inventory availability pages without caching notional-cap results. Missing markets have per-symbol errors; inventory fetch failures return 503.\n * @summary Get notional caps for all symbols\n */\nexport const getNotionalCap = (\n params?: GetNotionalCapParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiNotionalCapAllSymbolsResponse>> => {\n return axios.get(`/notional_cap`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * @summary Get notional caps for multiple symbols\n */\nexport const getNotionalCapBatch = (\n params: GetNotionalCapBatchParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiNotionalCapAllSymbolsResponse>> => {\n return axios.get(`/notional_cap/batch`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * @summary Get notional cap by symbol\n */\nexport const getNotionalCapSymbolId = (\n symbolId: number,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiNotionalCapBySymbolResponse>> => {\n return axios.get(`/notional_cap/${symbolId}`, options);\n};\n\n/**\n * Get quotes from the event listener database with optional filters\n * @summary Get quotes from event listener\n */\nexport const getQuotes = (\n params?: GetQuotesParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiGetQuotesResponse>> => {\n return axios.get(`/quotes`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * Returns revenue-bearing income-history rows with id greater than the supplied last-seen income_history id. Results use block time as created_at and are ordered by id ascending before offset/limit pagination. `count` is the total matching record count before pagination. Pass symbolIds as a comma-separated list or repeated query params to filter by symbol; omit it or pass it empty to disable symbol filtering.\n * @summary Get incremental revenue records\n */\nexport const getRevenueRecords = (\n params?: GetRevenueRecordsParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiRevenueRecordsResponse>> => {\n return axios.get(`/revenue/records`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * Returns income-history open/close solver fees and funding fees for one symbol using block timestamps. Filterable by time_range or custom timestamps.\n * @summary Get aggregated revenue for a specific symbol\n */\nexport const getRevenueSymbolId = (\n symbolId: number,\n params?: GetRevenueSymbolIdParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiRevenueResponse>> => {\n return axios.get(`/revenue/${symbolId}`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * Get instant trading statistics for different time periods (5m, 1h, 24h, 1w) grouped by metric type\n * @summary Get trading statistics\n */\nexport const getStats = (\n params?: GetStatsParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiGetStatsResponse>> => {\n return axios.get(`/stats`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * Returns paginated symbols with optional filters. is_valid defaults to true; pass is_valid=any to include valid and invalid symbols.\n * @summary Get symbols\n */\nexport const getSymbols = (\n params?: GetSymbolsParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiSymbolsResponse>> => {\n return axios.get(`/symbols`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * @summary Get temp quote status\n */\nexport const getTempQuoteStatusTempQuoteId = (\n tempQuoteId: number,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiGetTempQuoteStatusResponse>> => {\n return axios.get(`/temp_quote_status/${tempQuoteId}`, options);\n};\n\n/**\n * Returns configured last N daily trade volume rows for one symbol, ordered by day ascending.\n * @summary Get daily trade volume for one market\n */\nexport const getTradeVolumeSymbolId = (\n symbolId: number,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiDailyTradeVolumeResponse[]>> => {\n return axios.get(`/trade-volume/${symbolId}`, options);\n};\n\nexport type GetContractSymbolsResult = AxiosResponse<ApiContractSymbolsResponse>;\nexport type GetErrorCodesResult = AxiosResponse<GetErrorCodes200>;\nexport type GetErrorCodesDetailedResult = AxiosResponse<ClientErrorCodeInfo[]>;\nexport type GetEstimatedPriceResult = AxiosResponse<ApiGetEstimatedPriceResponse>;\nexport type GetFundingInfoResult = AxiosResponse<ApiFundingInfoResponse>;\nexport type GetGetFundingInfoResult = AxiosResponse<ApiFundingInfoBySymbolsResponse>;\nexport type GetGetLockedParamsSymbolResult = AxiosResponse<ApiLockedParamsBySymbolIdResponse>;\nexport type GetGetMarketInfoResult = AxiosResponse<GetGetMarketInfo200>;\nexport type GetInfoResult = AxiosResponse<ApiGetSolverInfoResponse>;\nexport type GetInstantCloseAccountAddressResult = AxiosResponse<ApiGetInstantCloseResponse[]>;\nexport type GetInstantOpenAccountAddressResult = AxiosResponse<ApiGetInstantOpenResponse[]>;\nexport type GetInstantQuoteIdTempQuoteIdResult = AxiosResponse<ApiGetQuoteIdResponse>;\nexport type GetInstantTradeEip712ConfigResult = AxiosResponse<GetInstantTradeEip712Config200>;\nexport type PostInstantTradeInstantCloseResult = AxiosResponse<void>;\nexport type PostInstantTradeInstantOpenResult = AxiosResponse<ApiPostInstantOpenResponse>;\nexport type GetMarketInfoResult = AxiosResponse<GetMarketInfo200>;\nexport type GetNotionalCapResult = AxiosResponse<ApiNotionalCapAllSymbolsResponse>;\nexport type GetNotionalCapBatchResult = AxiosResponse<ApiNotionalCapAllSymbolsResponse>;\nexport type GetNotionalCapSymbolIdResult = AxiosResponse<ApiNotionalCapBySymbolResponse>;\nexport type GetQuotesResult = AxiosResponse<ApiGetQuotesResponse>;\nexport type GetRevenueRecordsResult = AxiosResponse<ApiRevenueRecordsResponse>;\nexport type GetRevenueSymbolIdResult = AxiosResponse<ApiRevenueResponse>;\nexport type GetStatsResult = AxiosResponse<ApiGetStatsResponse>;\nexport type GetSymbolsResult = AxiosResponse<ApiSymbolsResponse>;\nexport type GetTempQuoteStatusTempQuoteIdResult = AxiosResponse<ApiGetTempQuoteStatusResponse>;\nexport type GetTradeVolumeSymbolIdResult = AxiosResponse<ApiDailyTradeVolumeResponse[]>;\n"],"mappings":";;AAyiBA,IAAa,KACX,MAEO,EAAM,IAAI,qBAAqB,CAAO,GAMlC,KAAiB,MACrB,EAAM,IAAI,gBAAgB,CAAO,GAe7B,KACX,GACA,MAEO,EAAM,IAAI,oBAAoB;CACnC,GAAG;CACH,QAAQ;EAAE,GAAG;EAAQ,GAAG,GAAS;CAAO;AAC1C,CAAC,GAMU,KACX,GACA,MAEO,EAAM,IAAI,iBAAiB;CAChC,GAAG;CACH,QAAQ;EAAE,GAAG;EAAQ,GAAG,GAAS;CAAO;AAC1C,CAAC,GAoBU,KACX,GACA,GACA,MAEO,EAAM,IAAI,sBAAsB,KAAU;CAC/C,GAAG;CACH,QAAQ;EAAE,GAAG;EAAQ,GAAG,GAAS;CAAO;AAC1C,CAAC,GAiBU,KAAW,MACf,EAAM,IAAI,SAAS,CAAO,GAOtB,KACX,GACA,MAEO,EAAM,IAAI,kBAAkB,KAAkB,CAAO,GAOjD,KACX,GACA,MAEO,EAAM,IAAI,iBAAiB,KAAkB,CAAO,GAMhD,KACX,GACA,MAEO,EAAM,IAAI,qBAAqB,KAAe,CAAO,GAiBjD,KACX,GACA,MAEO,EAAM,KAAK,gCAAgC,GAA0B,CAAO,GAQxE,KACX,GACA,MAEO,EAAM,KAAK,+BAA+B,GAAyB,CAAO,GAOtE,KAAiB,MACrB,EAAM,IAAI,gBAAgB,CAAO,GAO7B,KACX,GACA,MAEO,EAAM,IAAI,iBAAiB;CAChC,GAAG;CACH,QAAQ;EAAE,GAAG;EAAQ,GAAG,GAAS;CAAO;AAC1C,CAAC,GAmBU,KACX,GACA,MAEO,EAAM,IAAI,iBAAiB,KAAY,CAAO,GAqB1C,KACX,GACA,MAEO,EAAM,IAAI,oBAAoB;CACnC,GAAG;CACH,QAAQ;EAAE,GAAG;EAAQ,GAAG,GAAS;CAAO;AAC1C,CAAC,GAOU,KACX,GACA,GACA,MAEO,EAAM,IAAI,YAAY,KAAY;CACvC,GAAG;CACH,QAAQ;EAAE,GAAG;EAAQ,GAAG,GAAS;CAAO;AAC1C,CAAC,GAqBU,KACX,GACA,MAEO,EAAM,IAAI,YAAY;CAC3B,GAAG;CACH,QAAQ;EAAE,GAAG;EAAQ,GAAG,GAAS;CAAO;AAC1C,CAAC,GAiBU,KACX,GACA,MAEO,EAAM,IAAI,iBAAiB,KAAY,CAAO"}
|
|
1
|
+
{"version":3,"file":"enigma-solver.js","names":[],"sources":["../../../../src/solvers/types/generated/enigma-solver.ts"],"sourcesContent":["/**\n * Generated by orval v8.14.0 🍺\n * Do not edit manually.\n * Low Cap Solver API\n * API for Low Cap Solver trading system\n * OpenAPI spec version: 1.0\n */\nimport type { AxiosRequestConfig, AxiosResponse } from \"axios\";\nimport axios from \"axios\";\n\nexport interface ApiContractSymbol {\n asset?: string;\n funding_rate_epoch_duration?: string;\n funding_rate_window_time?: string;\n hedger_fee_close?: string;\n hedger_fee_close_early_rate?: string;\n hedger_fee_close_early_threshold?: string;\n hedger_fee_close_standard_threshold?: string;\n hedger_fee_open?: string;\n is_valid?: boolean;\n lot_size?: string;\n max_funding_rate?: string;\n max_leverage?: string;\n max_notional_value?: number;\n max_quantity?: string;\n min_acceptable_portion_lf?: string;\n min_acceptable_quote_value?: string;\n min_close_solver_fee_cap?: string;\n min_notional_value?: string;\n min_open_solver_fee_cap?: string;\n name?: string;\n price_precision?: number;\n quantity_precision?: number;\n rfq_allowed?: boolean;\n /** \"all\", \"long\", or \"short\" */\n side?: string;\n /** 0: Disabled, 1: Close only, 2: Open only, 3: Fully enabled */\n state?: number;\n symbol?: string;\n symbol_id?: number;\n /** From price service GetSymbolsInfo */\n token_address?: string;\n trading_fee?: string;\n}\n\nexport interface ApiContractSymbolsResponse {\n count?: number;\n symbols?: ApiContractSymbol[];\n}\n\nexport type ApiCustomTableDataItem = { [key: string]: unknown };\n\nexport interface ApiCustomTableHeader {\n key?: string;\n label?: string;\n}\n\nexport interface ApiCustomTable {\n data?: ApiCustomTableDataItem[];\n headers?: ApiCustomTableHeader[];\n title?: string;\n}\n\nexport interface ApiDailyTradeVolumeResponse {\n timestamp?: string;\n volume?: string;\n}\n\nexport interface ApiFundingInfoItem {\n funding_rate_epoch_duration?: number;\n next_funding_rate_long?: string;\n next_funding_rate_short?: string;\n next_funding_time?: number;\n}\n\nexport interface ApiFundingInfoBySymbolsResponse {\n [key: string]: ApiFundingInfoItem;\n}\n\nexport interface ApiFundingInfoResponse {\n [key: string]: ApiFundingInfoItem;\n}\n\nexport interface ApiGetEstimatedPriceResponse {\n price?: string;\n price_without_shadow?: string;\n}\n\nexport interface ApiGetInstantCloseResponse {\n close_price?: string;\n quantity_to_close?: string;\n quote_id?: number;\n}\n\nexport interface ApiGetInstantOpenResponse {\n cva?: string;\n lf?: string;\n order_type?: number;\n partyAmm?: string;\n partyBmm?: string;\n party_a_address?: string;\n position_type?: number;\n quantity?: string;\n requested_open_price?: string;\n symbol_id?: number;\n temp_quote_id?: number;\n /** UUID is the frontend-provided UUID from the V2 sendQuote metadata */\n uuid?: string;\n}\n\nexport interface ApiGetQuoteIdResponse {\n quote_id?: number;\n}\n\nexport interface ApiQuoteInfo {\n affiliate?: string;\n avg_closed_price?: string;\n block_number?: number;\n closed_amount?: string;\n create_timestamp?: string;\n cva?: string;\n deadline?: string;\n id?: string;\n initial_cva?: string;\n initial_lf?: string;\n initial_opened_price?: string;\n initial_party_amm?: string;\n initial_party_bmm?: string;\n last_funding_payment_timestamp?: string;\n lf?: string;\n market_price?: string;\n max_funding_rate?: string;\n opened_price?: string;\n order_type?: number;\n parent_id?: string;\n party_a?: string;\n party_amm?: string;\n party_b?: string;\n party_bmm?: string;\n position_type?: number;\n quantity?: string;\n quantity_to_close?: string;\n quote_status?: number;\n requested_close_price?: string;\n requested_open_price?: string;\n status_modify_timestamp?: string;\n symbol_id?: string;\n trading_fee?: string;\n}\n\nexport interface ApiGetQuotesResponse {\n count?: number;\n quotes?: ApiQuoteInfo[];\n}\n\nexport interface ApiGetSolverInfoResponse {\n /** Configured USD amount per instant close, including each partial close, before signed fee-cap adjustments. */\n static_solver_fee_close?: string;\n /** Configured USD amount per instant open, before signed fee-cap adjustments. */\n static_solver_fee_open?: string;\n}\n\nexport interface ApiPeriodStats {\n \"1h\"?: number;\n \"1w\"?: number;\n \"24h\"?: number;\n \"5m\"?: number;\n}\n\nexport interface ApiStatsMetrics {\n \"Completed Closes\"?: ApiPeriodStats;\n \"Completed Opens\"?: ApiPeriodStats;\n \"Instant Closes\"?: ApiPeriodStats;\n \"Instant Opens\"?: ApiPeriodStats;\n}\n\nexport interface ApiGetStatsResponse {\n custom_tables?: ApiCustomTable[];\n periodic_stats?: ApiStatsMetrics;\n}\n\nexport interface ApiGetTempQuoteStatusResponse {\n completion_source?: string;\n cva?: string;\n error_category?: string;\n /** Populated only when State is \"Failed\" or \"Cancelled\". ErrorCode mirrors\n * the synchronous /instant_trade contract; ErrorCategory is the stable\n * bucket the frontend maps to user-facing copy. See\n * docs/reference/instant-trade-errors.md. */\n error_code?: number;\n error_detail?: string;\n error_message?: string;\n lf?: string;\n margin?: string;\n max_funding_rate?: string;\n opened_price?: string;\n order_type?: number;\n party_a_account?: string;\n party_amm?: string;\n position_type?: number;\n price?: string;\n quantity?: string;\n quote_id?: number;\n recovered_at?: string;\n recovery_log_index?: number;\n recovery_reason?: string;\n recovery_tx_hash?: string;\n state?: string;\n sub_account?: string;\n symbol_id?: number;\n}\n\nexport interface ApiLockedParamsBySymbolIdResponse {\n cva?: string;\n leverage?: string;\n lf?: string;\n partyAmm?: string;\n partyBmm?: string;\n}\n\nexport interface ApiNotionalCapBySymbolResponse {\n available_to_long?: number;\n available_to_short?: number;\n error?: string;\n open_interest?: number;\n price?: number;\n symbol?: string;\n symbol_id?: number;\n token_balance?: number;\n total_cap?: number;\n usdc_balance?: number;\n used?: number;\n used_tokens?: number;\n}\n\nexport interface ApiNotionalCapAllSymbolsResponse {\n count?: number;\n symbols?: ApiNotionalCapBySymbolResponse[];\n total_open_interest?: number;\n total_used?: number;\n}\n\nexport interface ApiPostInstantOpenResponse {\n partyBmm?: string;\n temp_quote_id?: number;\n}\n\nexport interface ApiRevenueRecordItem {\n amount?: string;\n created_at?: string;\n id?: number;\n symbol_id?: number;\n}\n\nexport interface ApiRevenueRecordsResponse {\n count?: number;\n records?: ApiRevenueRecordItem[];\n}\n\nexport interface ApiRevenueResponse {\n funding_revenue?: string;\n hedger_fee_revenue?: string;\n record_count?: number;\n total_revenue?: string;\n}\n\nexport interface ApiSymbolResponse {\n asset?: string;\n funding_rate_epoch_duration?: string;\n funding_rate_window_time?: string;\n hedger_fee_close?: string;\n hedger_fee_close_early_rate?: string;\n hedger_fee_close_early_threshold?: string;\n hedger_fee_close_standard_threshold?: string;\n hedger_fee_open?: string;\n is_valid?: boolean;\n lot_size?: string;\n max_funding_rate?: string;\n max_leverage?: string;\n max_notional_value?: number;\n max_quantity?: string;\n min_acceptable_portion_lf?: string;\n min_acceptable_quote_value?: string;\n min_close_solver_fee_cap?: string;\n min_notional_value?: string;\n min_open_solver_fee_cap?: string;\n name?: string;\n price_precision?: number;\n quantity_precision?: number;\n rfq_allowed?: boolean;\n state_long?: number;\n state_short?: number;\n symbol?: string;\n symbol_id?: number;\n token_address?: string;\n trading_fee?: string;\n}\n\nexport interface ApiSymbolsResponse {\n count?: number;\n symbols?: ApiSymbolResponse[];\n}\n\nexport interface Eip712FlexFieldJSON {\n authorizedFlexFiller?: string;\n length?: number;\n offset?: number;\n}\n\nexport interface Eip712ReplayHeaderJSON {\n deadline: number;\n nonce?: number;\n salt: string;\n}\n\nexport interface Eip712AccountJSON {\n addr: string;\n isPartyB?: boolean;\n}\n\nexport interface Eip712SignedOperationJSON {\n callData: string;\n flexFields?: Eip712FlexFieldJSON[];\n maxUses?: number;\n replayAttackHeader: Eip712ReplayHeaderJSON;\n signer: string;\n signerAccount: Eip712AccountJSON;\n target: string;\n}\n\nexport interface Eip712OperationWithSigJSON {\n signature: string;\n signedOperation: Eip712SignedOperationJSON;\n}\n\nexport interface ApiV2InstantCloseRequest {\n /**\n * @minItems 1\n * @maxItems 100\n */\n operations: Eip712OperationWithSigJSON[];\n}\n\nexport interface ApiV2InstantOpenRequest {\n addMargin?: Eip712OperationWithSigJSON;\n sendQuote: Eip712OperationWithSigJSON;\n}\n\nexport enum ClientErrorCategory {\n CategoryValidation = \"validation\",\n CategoryAuthentication = \"authentication\",\n CategoryAuthorization = \"authorization\",\n CategorySlippage = \"slippage\",\n CategoryLiquidity = \"liquidity\",\n CategoryAccountState = \"account_state\",\n CategorySymbolState = \"symbol_state\",\n CategoryRateLimit = \"rate_limit\",\n CategoryTimeout = \"timeout\",\n CategoryInternal = \"internal\",\n CategoryUnavailable = \"unavailable\",\n}\nexport interface ClientErrorCodeInfo {\n category?: ClientErrorCategory;\n code?: number;\n http_status?: number;\n message?: string;\n}\n\nexport interface XfiberErrorResponse {\n code?: number;\n error_detail?: string;\n error_message?: string;\n}\n\nexport type GetErrorCodes200 = { [key: string]: string };\n\nexport type GetEstimatedPriceParams = {\n /**\n * Symbol ID\n */\n symbol_id: number;\n /**\n * Order quantity\n */\n quantity: string;\n /**\n * Position type (long/short)\n */\n position_type: string;\n /**\n * Entry type (open/close)\n */\n entry: string;\n /**\n * Price\n */\n price: string;\n};\n\nexport type GetFundingInfoParams = {\n /**\n * Symbol IDs (omit for all)\n */\n symbol_ids?: number[];\n};\n\nexport type GetGetFundingInfoParams = {\n /**\n * Symbol names (omit for all)\n */\n symbols?: string[];\n};\n\nexport type GetGetLockedParamsSymbolParams = {\n /**\n * Leverage\n */\n leverage: number;\n};\n\nexport type GetGetMarketInfo200 = { [key: string]: unknown };\n\nexport type GetInstantTradeEip712Config200 = { [key: string]: unknown };\n\nexport type GetMarketInfo200 = { [key: string]: unknown };\n\nexport type GetNotionalCapParams = {\n /**\n * Limit results (max 500, default 100)\n */\n limit?: number;\n /**\n * Offset for pagination (default 0)\n */\n offset?: number;\n};\n\nexport type GetNotionalCapBatchParams = {\n /**\n * Symbol IDs (max 100)\n */\n symbol_ids: number[];\n};\n\nexport type GetQuotesParams = {\n /**\n * Symbol ID filter\n */\n symbol_id?: number;\n /**\n * Party A address filter\n */\n party_a?: string;\n /**\n * Quote status filter (1-7)\n */\n status?: number;\n /**\n * Limit results (max 500, default 100)\n */\n limit?: number;\n /**\n * Offset for pagination (default 0)\n */\n offset?: number;\n};\n\nexport type GetRevenueRecordsParams = {\n /**\n * Last seen income-history record ID\n */\n id?: number;\n /**\n * Optional symbol IDs (max 100)\n */\n symbolIds?: number[];\n /**\n * Offset for pagination (default 0)\n */\n offset?: number;\n /**\n * Limit results (max 500, default 100)\n */\n limit?: number;\n};\n\nexport type GetRevenueSymbolIdParams = {\n /**\n * Preset range (1h, 24h, 7d, 30d, lifetime)\n */\n time_range?: string;\n /**\n * Revenue type filter (HedgerFee, FundingRate)\n */\n type?: string;\n /**\n * Unix timestamp start (overrides time_range)\n */\n start_time?: number;\n /**\n * Unix timestamp end\n */\n end_time?: number;\n};\n\nexport type GetStatsParams = {\n /**\n * Filter response to specific stat types (periodic_stats, single_metrics, custom_tables, alerts)\n */\n include?: string[];\n};\n\nexport type GetSymbolsParams = {\n /**\n * Limit results (max 500, default 100)\n */\n limit?: number;\n /**\n * Offset for pagination (default 0)\n */\n offset?: number;\n /**\n * Symbol ID\n */\n symbol_id?: number;\n /**\n * Case-insensitive match on symbol name\n */\n search?: string;\n /**\n * Asset exact match\n */\n asset?: string;\n /**\n * Token address exact match\n */\n token_address?: string;\n /**\n * Validity filter: true, false, any (default true)\n */\n is_valid?: string;\n /**\n * Long-side state filter: disabled, close_only, open_only, enabled\n */\n state_long?: string;\n /**\n * Short-side state filter: disabled, close_only, open_only, enabled\n */\n state_short?: string;\n};\n\n/**\n * @summary Get contract symbols\n */\nexport const getContractSymbols = (\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiContractSymbolsResponse>> => {\n return axios.get(`/contract-symbols`, options);\n};\n\n/**\n * @summary Get API error codes\n */\nexport const getErrorCodes = (options?: AxiosRequestConfig): Promise<AxiosResponse<GetErrorCodes200>> => {\n return axios.get(`/error_codes`, options);\n};\n\n/**\n * Returns solver-registered error codes (>= 3000) with message, category, and http_status. Use the flat /error_codes endpoint for backward-compatible code→message lookups.\n * @summary Get detailed API error codes\n */\nexport const getErrorCodesDetailed = (options?: AxiosRequestConfig): Promise<AxiosResponse<ClientErrorCodeInfo[]>> => {\n return axios.get(`/error_codes/detailed`, options);\n};\n\n/**\n * Get estimated execution price from inventory service (dry-run mode)\n * @summary Get estimated price for order\n */\nexport const getEstimatedPrice = (\n params: GetEstimatedPriceParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiGetEstimatedPriceResponse>> => {\n return axios.get(`/estimated-price`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * @summary Get funding info by symbol ID\n */\nexport const getFundingInfo = (\n params?: GetFundingInfoParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiFundingInfoResponse>> => {\n return axios.get(`/funding-info`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * @deprecated\n * @summary Get funding info by symbol name\n */\nexport const getGetFundingInfo = (\n params?: GetGetFundingInfoParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiFundingInfoBySymbolsResponse>> => {\n return axios.get(`/get_funding_info`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * @summary Get locked params by symbol\n */\nexport const getGetLockedParamsSymbol = (\n symbol: string,\n params: GetGetLockedParamsSymbolParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiLockedParamsBySymbolIdResponse>> => {\n return axios.get(`/get_locked_params/${symbol}`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * Returns a JSON object whose keys are symbol names (dynamic — sourced from contract-symbol data) mapping to {trading_volume, lifetime_value}, plus top-level aggregate fields total_value_24h and total_lifetime_value.\n * @deprecated\n * @summary Get 24h market info by symbol name\n */\nexport const getGetMarketInfo = (options?: AxiosRequestConfig): Promise<AxiosResponse<GetGetMarketInfo200>> => {\n return axios.get(`/get_market_info`, options);\n};\n\n/**\n * Returns configured static solver fees as exact USD decimal strings; zero disables a fee.\n * The close amount applies to each partial close. Actual charges remain subject to signed fee caps.\n * @summary Get solver general information\n */\nexport const getInfo = (options?: AxiosRequestConfig): Promise<AxiosResponse<ApiGetSolverInfoResponse>> => {\n return axios.get(`/info`, options);\n};\n\n/**\n * Returns all pending instant close orders for a given SubAccount address.\n * @summary Get pending instant close orders\n */\nexport const getInstantCloseAccountAddress = (\n accountAddress: string,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiGetInstantCloseResponse[]>> => {\n return axios.get(`/instant_close/${accountAddress}`, options);\n};\n\n/**\n * Returns all pending instant open orders for a given SubAccount address.\n * @summary Get pending instant open orders\n */\nexport const getInstantOpenAccountAddress = (\n accountAddress: string,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiGetInstantOpenResponse[]>> => {\n return axios.get(`/instant_open/${accountAddress}`, options);\n};\n\n/**\n * @summary Get quote ID by temp ID\n */\nexport const getInstantQuoteIdTempQuoteId = (\n tempQuoteId: number,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiGetQuoteIdResponse>> => {\n return axios.get(`/instant_quote_id/${tempQuoteId}`, options);\n};\n\n/**\n * Returns the EIP-712 domain, domain separator, type hashes, and full type definitions that clients must use when constructing signatures for V2 instant open/close operations. No authentication required.\n * @summary Get V2 EIP-712 signing config\n */\nexport const getInstantTradeEip712Config = (\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<GetInstantTradeEip712Config200>> => {\n return axios.get(`/instant_trade/eip712-config`, options);\n};\n\n/**\n * Submit one or more V2 close operations (requestToClosePosition), one per quote. No JWT required — identity is proven by EIP-712 signature recovery. Each signedOperation.maxUses must explicitly equal 1. A previously submitted signature is rejected in every record state (case and optional 0x prefix are ignored), including concurrent replays. Operations commit individually; earlier operations remain accepted if a later operation fails. Processing happens asynchronously.\n * @summary Submit V2 instant close\n */\nexport const postInstantTradeInstantClose = (\n apiV2InstantCloseRequest: ApiV2InstantCloseRequest,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<void>> => {\n return axios.post(`/instant_trade/instant_close`, apiV2InstantCloseRequest, options);\n};\n\n/**\n * Submit a V2 instant open request with pre-signed EIP-712 PartyA operations (addMargin + sendQuote). No JWT required — identity is proven by EIP-712 signature recovery. Processing (hedge, muon sigs, symmio-api call) happens asynchronously.\n * PartyBsWhiteList must contain exactly the configured PartyB proxy. The signed open cap must cover the complete dynamic plus static solver fee at the fresh market price. Admission requires collateral for both solver fees while preserving margin and the protocol trading fee, using local VA balances with RPC fallback only for missing account rows.\n * @summary Submit V2 instant open\n */\nexport const postInstantTradeInstantOpen = (\n apiV2InstantOpenRequest: ApiV2InstantOpenRequest,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiPostInstantOpenResponse>> => {\n return axios.post(`/instant_trade/instant_open`, apiV2InstantOpenRequest, options);\n};\n\n/**\n * Returns a JSON object whose keys are symbol IDs mapping to {trading_volume, lifetime_value}, plus top-level aggregate fields total_value_24h and total_lifetime_value.\n * @summary Get 24h market info by symbol ID\n */\nexport const getMarketInfo = (options?: AxiosRequestConfig): Promise<AxiosResponse<GetMarketInfo200>> => {\n return axios.get(`/market-info`, options);\n};\n\n/**\n * Fetches all inventory availability pages without caching notional-cap results. Missing markets have per-symbol errors; inventory fetch failures return 503.\n * @summary Get notional caps for all symbols\n */\nexport const getNotionalCap = (\n params?: GetNotionalCapParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiNotionalCapAllSymbolsResponse>> => {\n return axios.get(`/notional_cap`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * @summary Get notional caps for multiple symbols\n */\nexport const getNotionalCapBatch = (\n params: GetNotionalCapBatchParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiNotionalCapAllSymbolsResponse>> => {\n return axios.get(`/notional_cap/batch`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * @summary Get notional cap by symbol\n */\nexport const getNotionalCapSymbolId = (\n symbolId: number,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiNotionalCapBySymbolResponse>> => {\n return axios.get(`/notional_cap/${symbolId}`, options);\n};\n\n/**\n * Get quotes from the event listener database with optional filters\n * @summary Get quotes from event listener\n */\nexport const getQuotes = (\n params?: GetQuotesParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiGetQuotesResponse>> => {\n return axios.get(`/quotes`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * Returns revenue-bearing income-history rows with id greater than the supplied last-seen income_history id. Results use block time as created_at and are ordered by id ascending before offset/limit pagination. `count` is the total matching record count before pagination. Pass symbolIds as a comma-separated list or repeated query params to filter by symbol; omit it or pass it empty to disable symbol filtering.\n * @summary Get incremental revenue records\n */\nexport const getRevenueRecords = (\n params?: GetRevenueRecordsParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiRevenueRecordsResponse>> => {\n return axios.get(`/revenue/records`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * Returns income-history open/close solver fees and funding fees for one symbol using block timestamps. Filterable by time_range or custom timestamps.\n * @summary Get aggregated revenue for a specific symbol\n */\nexport const getRevenueSymbolId = (\n symbolId: number,\n params?: GetRevenueSymbolIdParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiRevenueResponse>> => {\n return axios.get(`/revenue/${symbolId}`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * Get instant trading statistics for different time periods (5m, 1h, 24h, 1w) grouped by metric type\n * @summary Get trading statistics\n */\nexport const getStats = (\n params?: GetStatsParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiGetStatsResponse>> => {\n return axios.get(`/stats`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * Returns paginated symbols with optional filters. is_valid defaults to true; pass is_valid=any to include valid and invalid symbols.\n * @summary Get symbols\n */\nexport const getSymbols = (\n params?: GetSymbolsParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiSymbolsResponse>> => {\n return axios.get(`/symbols`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * @summary Get temp quote status\n */\nexport const getTempQuoteStatusTempQuoteId = (\n tempQuoteId: number,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiGetTempQuoteStatusResponse>> => {\n return axios.get(`/temp_quote_status/${tempQuoteId}`, options);\n};\n\n/**\n * Returns configured last N daily trade volume rows for one symbol, ordered by day ascending.\n * @summary Get daily trade volume for one market\n */\nexport const getTradeVolumeSymbolId = (\n symbolId: number,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ApiDailyTradeVolumeResponse[]>> => {\n return axios.get(`/trade-volume/${symbolId}`, options);\n};\n\nexport type GetContractSymbolsResult = AxiosResponse<ApiContractSymbolsResponse>;\nexport type GetErrorCodesResult = AxiosResponse<GetErrorCodes200>;\nexport type GetErrorCodesDetailedResult = AxiosResponse<ClientErrorCodeInfo[]>;\nexport type GetEstimatedPriceResult = AxiosResponse<ApiGetEstimatedPriceResponse>;\nexport type GetFundingInfoResult = AxiosResponse<ApiFundingInfoResponse>;\nexport type GetGetFundingInfoResult = AxiosResponse<ApiFundingInfoBySymbolsResponse>;\nexport type GetGetLockedParamsSymbolResult = AxiosResponse<ApiLockedParamsBySymbolIdResponse>;\nexport type GetGetMarketInfoResult = AxiosResponse<GetGetMarketInfo200>;\nexport type GetInfoResult = AxiosResponse<ApiGetSolverInfoResponse>;\nexport type GetInstantCloseAccountAddressResult = AxiosResponse<ApiGetInstantCloseResponse[]>;\nexport type GetInstantOpenAccountAddressResult = AxiosResponse<ApiGetInstantOpenResponse[]>;\nexport type GetInstantQuoteIdTempQuoteIdResult = AxiosResponse<ApiGetQuoteIdResponse>;\nexport type GetInstantTradeEip712ConfigResult = AxiosResponse<GetInstantTradeEip712Config200>;\nexport type PostInstantTradeInstantCloseResult = AxiosResponse<void>;\nexport type PostInstantTradeInstantOpenResult = AxiosResponse<ApiPostInstantOpenResponse>;\nexport type GetMarketInfoResult = AxiosResponse<GetMarketInfo200>;\nexport type GetNotionalCapResult = AxiosResponse<ApiNotionalCapAllSymbolsResponse>;\nexport type GetNotionalCapBatchResult = AxiosResponse<ApiNotionalCapAllSymbolsResponse>;\nexport type GetNotionalCapSymbolIdResult = AxiosResponse<ApiNotionalCapBySymbolResponse>;\nexport type GetQuotesResult = AxiosResponse<ApiGetQuotesResponse>;\nexport type GetRevenueRecordsResult = AxiosResponse<ApiRevenueRecordsResponse>;\nexport type GetRevenueSymbolIdResult = AxiosResponse<ApiRevenueResponse>;\nexport type GetStatsResult = AxiosResponse<ApiGetStatsResponse>;\nexport type GetSymbolsResult = AxiosResponse<ApiSymbolsResponse>;\nexport type GetTempQuoteStatusTempQuoteIdResult = AxiosResponse<ApiGetTempQuoteStatusResponse>;\nexport type GetTradeVolumeSymbolIdResult = AxiosResponse<ApiDailyTradeVolumeResponse[]>;\n"],"mappings":";;AA0iBA,IAAa,KACX,MAEO,EAAM,IAAI,qBAAqB,CAAO,GAMlC,KAAiB,MACrB,EAAM,IAAI,gBAAgB,CAAO,GAe7B,KACX,GACA,MAEO,EAAM,IAAI,oBAAoB;CACnC,GAAG;CACH,QAAQ;EAAE,GAAG;EAAQ,GAAG,GAAS;CAAO;AAC1C,CAAC,GAMU,KACX,GACA,MAEO,EAAM,IAAI,iBAAiB;CAChC,GAAG;CACH,QAAQ;EAAE,GAAG;EAAQ,GAAG,GAAS;CAAO;AAC1C,CAAC,GAoBU,KACX,GACA,GACA,MAEO,EAAM,IAAI,sBAAsB,KAAU;CAC/C,GAAG;CACH,QAAQ;EAAE,GAAG;EAAQ,GAAG,GAAS;CAAO;AAC1C,CAAC,GAiBU,KAAW,MACf,EAAM,IAAI,SAAS,CAAO,GAOtB,KACX,GACA,MAEO,EAAM,IAAI,kBAAkB,KAAkB,CAAO,GAOjD,KACX,GACA,MAEO,EAAM,IAAI,iBAAiB,KAAkB,CAAO,GAMhD,KACX,GACA,MAEO,EAAM,IAAI,qBAAqB,KAAe,CAAO,GAiBjD,KACX,GACA,MAEO,EAAM,KAAK,gCAAgC,GAA0B,CAAO,GAQxE,KACX,GACA,MAEO,EAAM,KAAK,+BAA+B,GAAyB,CAAO,GAOtE,KAAiB,MACrB,EAAM,IAAI,gBAAgB,CAAO,GAO7B,KACX,GACA,MAEO,EAAM,IAAI,iBAAiB;CAChC,GAAG;CACH,QAAQ;EAAE,GAAG;EAAQ,GAAG,GAAS;CAAO;AAC1C,CAAC,GAmBU,KACX,GACA,MAEO,EAAM,IAAI,iBAAiB,KAAY,CAAO,GAqB1C,KACX,GACA,MAEO,EAAM,IAAI,oBAAoB;CACnC,GAAG;CACH,QAAQ;EAAE,GAAG;EAAQ,GAAG,GAAS;CAAO;AAC1C,CAAC,GAOU,KACX,GACA,GACA,MAEO,EAAM,IAAI,YAAY,KAAY;CACvC,GAAG;CACH,QAAQ;EAAE,GAAG;EAAQ,GAAG,GAAS;CAAO;AAC1C,CAAC,GAqBU,KACX,GACA,MAEO,EAAM,IAAI,YAAY;CAC3B,GAAG;CACH,QAAQ;EAAE,GAAG;EAAQ,GAAG,GAAS;CAAO;AAC1C,CAAC,GAiBU,KACX,GACA,MAEO,EAAM,IAAI,iBAAiB,KAAY,CAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-tpsl-acceptance.d.ts","sourceRoot":"","sources":["../../src/tpsl/assert-tpsl-acceptance.ts"],"names":[],"mappings":"AAEA,kFAAkF;AAClF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,IAAI,CA2BrF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SymmError as e } from "../shared/errors/symm-error.js";
|
|
2
|
+
//#region src/tpsl/assert-tpsl-acceptance.ts
|
|
3
|
+
function t(t, n) {
|
|
4
|
+
let r = t && typeof t == "object" ? t : {};
|
|
5
|
+
if (r.successful === !1 || r.successful === "false") {
|
|
6
|
+
let t = typeof r.message == "string" ? r.message : r.error_message;
|
|
7
|
+
throw new e("api", `${n}_TPSL_REJECTED`, typeof t == "string" ? t : n === "SET" ? "Handler rejected TP/SL submission." : "Handler rejected TP/SL delete.");
|
|
8
|
+
}
|
|
9
|
+
if (r.successful !== !0 && r.successful !== "true") throw new e("api", `${n}_TPSL_INVALID_RESPONSE`, n === "SET" ? "Handler did not explicitly acknowledge TP/SL submission; outcome is unknown." : "Handler did not explicitly acknowledge TP/SL removal; outcome is unknown.");
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { t as assertTpSlAcceptance };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=assert-tpsl-acceptance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-tpsl-acceptance.js","names":[],"sources":["../../src/tpsl/assert-tpsl-acceptance.ts"],"sourcesContent":["import { SymmError } from \"../shared/errors/symm-error\";\n\n/** Shared acknowledgment validation; acceptance does not establish completion. */\nexport function assertTpSlAcceptance(body: unknown, operation: \"SET\" | \"DELETE\"): void {\n const response = (body && typeof body === \"object\" ? body : {}) as {\n successful?: unknown;\n message?: unknown;\n error_message?: unknown;\n };\n if (response.successful === false || response.successful === \"false\") {\n const message = typeof response.message === \"string\" ? response.message : response.error_message;\n throw new SymmError(\n \"api\",\n `${operation}_TPSL_REJECTED`,\n typeof message === \"string\"\n ? message\n : operation === \"SET\"\n ? \"Handler rejected TP/SL submission.\"\n : \"Handler rejected TP/SL delete.\",\n );\n }\n if (response.successful !== true && response.successful !== \"true\") {\n throw new SymmError(\n \"api\",\n `${operation}_TPSL_INVALID_RESPONSE`,\n operation === \"SET\"\n ? \"Handler did not explicitly acknowledge TP/SL submission; outcome is unknown.\"\n : \"Handler did not explicitly acknowledge TP/SL removal; outcome is unknown.\",\n );\n }\n}\n"],"mappings":";;AAGA,SAAgB,EAAqB,GAAe,GAAmC;CACrF,IAAM,IAAY,KAAQ,OAAO,KAAS,WAAW,IAAO,CAAC;CAK7D,IAAI,EAAS,eAAe,MAAS,EAAS,eAAe,SAAS;EACpE,IAAM,IAAU,OAAO,EAAS,WAAY,WAAW,EAAS,UAAU,EAAS;EACnF,MAAM,IAAI,EACR,OACA,GAAG,EAAU,iBACb,OAAO,KAAY,WACf,IACA,MAAc,QACZ,uCACA,gCACR;CACF;CACA,IAAI,EAAS,eAAe,MAAQ,EAAS,eAAe,QAC1D,MAAM,IAAI,EACR,OACA,GAAG,EAAU,yBACb,MAAc,QACV,iFACA,2EACN;AAEJ"}
|
|
@@ -26,9 +26,10 @@ export interface DeleteQuoteTpSlReturnType {
|
|
|
26
26
|
* 3. Sign with the session-key wallet.
|
|
27
27
|
* 4. DELETE `/api/v5/` with `{ typedData, signature, signer }`.
|
|
28
28
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* An explicit successful response acknowledges submission, not completion.
|
|
30
|
+
* Notifications are refresh signals; reconcile with a complete live-order read
|
|
31
|
+
* before treating the requested order as removed. Notifications do not identify
|
|
32
|
+
* a particular mutation or carry an order version.
|
|
32
33
|
*
|
|
33
34
|
* @throws {SymmError} when the chain has no `tpsl` config or signing fails.
|
|
34
35
|
* @throws {SymmApiError} when the handler request fails.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-quote-tpsl.d.ts","sourceRoot":"","sources":["../../../src/tpsl/delete-quote-tpsl/delete-quote-tpsl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"delete-quote-tpsl.d.ts","sourceRoot":"","sources":["../../../src/tpsl/delete-quote-tpsl/delete-quote-tpsl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAOnF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAGzD,8CAA8C;AAC9C,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,oBAAoB,GAAG;IACrB,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,cAAc,EAAE,OAAO,CAAC;IACxB,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,oBAAoB,EAAE,wBAAwB,CAAC;CAChD,CACF,CAAC;AAEF,8CAA8C;AAC9C,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,IAAI,CAAC;CACf;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,yBAAyB,GACpC,OAAO,CAAC,yBAAyB,CAAC,CAwBpC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { rethrowTpSlError as e } from "../internal/axios.js";
|
|
2
|
+
import { resolveTpSlConfig as t } from "../internal/resolve-tpsl-config.js";
|
|
3
|
+
import { deleteConditionalOrderV5ApiV5Delete as n } from "../types/generated/tpsl-handler.js";
|
|
4
|
+
import { assertTpSlAcceptance as r } from "../assert-tpsl-acceptance.js";
|
|
5
5
|
import { buildTpSlDeleteMessage as i } from "../set-quote-tpsl/build-conditional-order-message.js";
|
|
6
6
|
import { signTpSlRequest as a } from "../set-quote-tpsl/sign-tpsl-request.js";
|
|
7
7
|
import { getTpSlDeleteSigningSpec as o } from "../signing-spec/get-tpsl-delete-signing-spec.js";
|
|
8
8
|
//#region src/tpsl/delete-quote-tpsl/delete-quote-tpsl.ts
|
|
9
9
|
async function s(s, c) {
|
|
10
|
-
let l =
|
|
10
|
+
let l = t(s, c.chainId), u = await a({
|
|
11
11
|
signingSpec: await o(s, { chainId: c.chainId }),
|
|
12
12
|
message: i({
|
|
13
13
|
virtualAccount: c.virtualAccount,
|
|
@@ -20,18 +20,16 @@ async function s(s, c) {
|
|
|
20
20
|
})
|
|
21
21
|
});
|
|
22
22
|
try {
|
|
23
|
-
|
|
23
|
+
return r((await n(u, {
|
|
24
24
|
baseURL: l.url,
|
|
25
25
|
headers: {
|
|
26
26
|
"App-Name": l.appName,
|
|
27
27
|
"Content-Type": "application/json",
|
|
28
28
|
Accept: "application/json"
|
|
29
29
|
}
|
|
30
|
-
})).data ?? {};
|
|
31
|
-
|
|
32
|
-
return {
|
|
33
|
-
} catch (e) {
|
|
34
|
-
return t(e, {
|
|
30
|
+
})).data ?? {}, "DELETE"), { success: !0 };
|
|
31
|
+
} catch (t) {
|
|
32
|
+
return e(t, {
|
|
35
33
|
code: "DELETE_TPSL_FAILED",
|
|
36
34
|
baseURL: l.url
|
|
37
35
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-quote-tpsl.js","names":[],"sources":["../../../src/tpsl/delete-quote-tpsl/delete-quote-tpsl.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport {
|
|
1
|
+
{"version":3,"file":"delete-quote-tpsl.js","names":[],"sources":["../../../src/tpsl/delete-quote-tpsl/delete-quote-tpsl.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { Compute, WriteSolverParameter } from \"../../shared/types/properties\";\nimport { assertTpSlAcceptance } from \"../assert-tpsl-acceptance\";\nimport { rethrowTpSlError } from \"../internal/axios\";\nimport { resolveTpSlConfig } from \"../internal/resolve-tpsl-config\";\nimport { buildTpSlDeleteMessage } from \"../set-quote-tpsl/build-conditional-order-message\";\nimport { signTpSlRequest } from \"../set-quote-tpsl/sign-tpsl-request\";\nimport { getTpSlDeleteSigningSpec } from \"../signing-spec/get-tpsl-delete-signing-spec\";\nimport type { TpSlConditionalOrderType } from \"../types\";\nimport { deleteConditionalOrderV5ApiV5Delete, type ConditionalOrderOperationV5 } from \"../types/generated/tpsl-handler\";\n\n/** Parameters for {@link deleteQuoteTpSl}. */\nexport type DeleteQuoteTpSlParameters = Compute<\n WriteSolverParameter & {\n /** On-chain quote id the order belongs to (used for cache invalidation). */\n quoteId: bigint;\n /** PartyA (the VA address) that owns the quote. */\n virtualAccount: Address;\n /** Handler-issued conditional-order id targeted by the delete. */\n cohQuoteId: string;\n /** Which side is being canceled. */\n conditionalOrderType: TpSlConditionalOrderType;\n }\n>;\n\n/** Return type of {@link deleteQuoteTpSl}. */\nexport interface DeleteQuoteTpSlReturnType {\n success: true;\n}\n\n/**\n * Cancel a live TP or SL order by its handler-issued `cohQuoteId`.\n *\n * Steps:\n * 1. Resolve the TP/SL handler URL + DELETE signing spec.\n * 2. Build a {@link TpSlDeleteMessage} bound to the target cohQuoteId + side.\n * 3. Sign with the session-key wallet.\n * 4. DELETE `/api/v5/` with `{ typedData, signature, signer }`.\n *\n * An explicit successful response acknowledges submission, not completion.\n * Notifications are refresh signals; reconcile with a complete live-order read\n * before treating the requested order as removed. Notifications do not identify\n * a particular mutation or carry an order version.\n *\n * @throws {SymmError} when the chain has no `tpsl` config or signing fails.\n * @throws {SymmApiError} when the handler request fails.\n */\nexport async function deleteQuoteTpSl(\n config: Config,\n parameters: DeleteQuoteTpSlParameters,\n): Promise<DeleteQuoteTpSlReturnType> {\n const tpsl = resolveTpSlConfig(config, parameters.chainId);\n const signingSpec = await getTpSlDeleteSigningSpec(config, { chainId: parameters.chainId });\n\n const message = buildTpSlDeleteMessage({\n virtualAccount: parameters.virtualAccount,\n cohQuoteId: parameters.cohQuoteId,\n conditionalOrderType: parameters.conditionalOrderType,\n });\n\n const walletClient = await config.getWalletClient({ chainId: parameters.chainId, from: parameters.from });\n const signed = await signTpSlRequest({ signingSpec, message, walletClient });\n\n try {\n const response = await deleteConditionalOrderV5ApiV5Delete(signed as unknown as ConditionalOrderOperationV5, {\n baseURL: tpsl.url,\n headers: { \"App-Name\": tpsl.appName, \"Content-Type\": \"application/json\", Accept: \"application/json\" },\n });\n const body = response.data ?? {};\n assertTpSlAcceptance(body, \"DELETE\");\n return { success: true };\n } catch (err) {\n return rethrowTpSlError(err, { code: \"DELETE_TPSL_FAILED\", baseURL: tpsl.url });\n }\n}\n"],"mappings":";;;;;;;;AAgDA,eAAsB,EACpB,GACA,GACoC;CACpC,IAAM,IAAO,EAAkB,GAAQ,EAAW,OAAO,GAUnD,IAAS,MAAM,EAAgB;EAAE,aAAA,MATb,EAAyB,GAAQ,EAAE,SAAS,EAAW,QAAQ,CAAC;EAStC,SAPpC,EAAuB;GACrC,gBAAgB,EAAW;GAC3B,YAAY,EAAW;GACvB,sBAAsB,EAAW;EACnC,CAGoD;EAAS,cAAA,MADlC,EAAO,gBAAgB;GAAE,SAAS,EAAW;GAAS,MAAM,EAAW;EAAK,CAAC;CAC9B,CAAC;CAE3E,IAAI;EAOF,OADA,GADa,MAJU,EAAoC,GAAkD;GAC3G,SAAS,EAAK;GACd,SAAS;IAAE,YAAY,EAAK;IAAS,gBAAgB;IAAoB,QAAQ;GAAmB;EACtG,CAAC,GACqB,QAAQ,CAAC,GACJ,QAAQ,GAC5B,EAAE,SAAS,GAAK;CACzB,SAAS,GAAK;EACZ,OAAO,EAAiB,GAAK;GAAE,MAAM;GAAsB,SAAS,EAAK;EAAI,CAAC;CAChF;AACF"}
|
|
@@ -3,12 +3,16 @@ import { DeleteQuoteTpSlParameters } from './delete-quote-tpsl.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Build TanStack Mutation options for {@link deleteQuoteTpSl}.
|
|
5
5
|
*
|
|
6
|
+
* Automatic retries are disabled: a failed response may follow an accepted write.
|
|
7
|
+
* Reconcile state before explicitly submitting again.
|
|
8
|
+
*
|
|
6
9
|
* @example
|
|
7
10
|
* ```ts
|
|
8
11
|
* useMutation(deleteQuoteTpSlMutationOptions(config));
|
|
9
12
|
* ```
|
|
10
13
|
*/
|
|
11
14
|
export declare function deleteQuoteTpSlMutationOptions(config: Config): {
|
|
15
|
+
retry: boolean;
|
|
12
16
|
mutationKey: readonly ["deleteQuoteTpSl"];
|
|
13
17
|
mutationFn: (variables: DeleteQuoteTpSlParameters) => Promise<import('./delete-quote-tpsl.js').DeleteQuoteTpSlReturnType>;
|
|
14
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/tpsl/delete-quote-tpsl/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAmB,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEtF
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/tpsl/delete-quote-tpsl/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAmB,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEtF;;;;;;;;;;GAUG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,MAAM;;;4BAIjC,yBAAyB;EAEpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","names":[],"sources":["../../../src/tpsl/delete-quote-tpsl/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport { deleteQuoteTpSl, type DeleteQuoteTpSlParameters } from \"./delete-quote-tpsl\";\n\n/**\n * Build TanStack Mutation options for {@link deleteQuoteTpSl}.\n *\n * @example\n * ```ts\n * useMutation(deleteQuoteTpSlMutationOptions(config));\n * ```\n */\nexport function deleteQuoteTpSlMutationOptions(config: Config) {\n return {\n mutationKey: [\"deleteQuoteTpSl\"] as const,\n mutationFn: (variables: DeleteQuoteTpSlParameters) => deleteQuoteTpSl(config, variables),\n };\n}\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"query.js","names":[],"sources":["../../../src/tpsl/delete-quote-tpsl/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport { deleteQuoteTpSl, type DeleteQuoteTpSlParameters } from \"./delete-quote-tpsl\";\n\n/**\n * Build TanStack Mutation options for {@link deleteQuoteTpSl}.\n *\n * Automatic retries are disabled: a failed response may follow an accepted write.\n * Reconcile state before explicitly submitting again.\n *\n * @example\n * ```ts\n * useMutation(deleteQuoteTpSlMutationOptions(config));\n * ```\n */\nexport function deleteQuoteTpSlMutationOptions(config: Config) {\n return {\n retry: false,\n mutationKey: [\"deleteQuoteTpSl\"] as const,\n mutationFn: (variables: DeleteQuoteTpSlParameters) => deleteQuoteTpSl(config, variables),\n };\n}\n"],"mappings":";;AAcA,SAAgB,EAA+B,GAAgB;CAC7D,OAAO;EACL,OAAO;EACP,aAAa,CAAC,iBAAiB;EAC/B,aAAa,MAAyC,EAAgB,GAAQ,CAAS;CACzF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-tpsl-orders.d.ts","sourceRoot":"","sources":["../../../src/tpsl/search-tpsl-orders/search-tpsl-orders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"search-tpsl-orders.d.ts","sourceRoot":"","sources":["../../../src/tpsl/search-tpsl-orders/search-tpsl-orders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EACL,sBAAsB,EAEtB,KAAK,qCAAqC,EAE1C,KAAK,eAAe,EACrB,MAAM,iCAAiC,CAAC;AAEzC;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,mJAKzB,CAAC;AAKX,+CAA+C;AAC/C,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAC9C,gBAAgB,GAAG;IACjB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yEAAyE;IACzE,KAAK,CAAC,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAC3C,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,oBAAoB,CAAC,EAAE,mBAAmB,CAAC;IAC3C,4CAA4C;IAC5C,oBAAoB,CAAC,EAAE,eAAe,CAAC;IACvC,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CACF,CAAC;AAEF,6CAA6C;AAC7C,KAAK,uBAAuB,GAAG,qCAAqC,CAAC,OAAO,CAAC,SACzE,CAAC,MAAM,MAAM,CAAC,EAAE,GAChB,IAAI,GACJ,SAAS,GACT,MAAM,GACN,KAAK,CAAC;AAEV,+CAA+C;AAC/C,MAAM,WAAW,0BAA0B;IACzC,yCAAyC;IACzC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;OAQG;IACH,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,0BAA0B,GACrC,OAAO,CAAC,0BAA0B,CAAC,CA8BrC"}
|
|
@@ -1,47 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { SymmError as e } from "../../shared/errors/symm-error.js";
|
|
2
|
+
import { rethrowTpSlError as t } from "../internal/axios.js";
|
|
3
|
+
import { resolveTpSlConfig as n } from "../internal/resolve-tpsl-config.js";
|
|
4
|
+
import { ConditionalOrdersState as r, searchConditionalOrdersV5ApiV5SearchPost as i } from "../types/generated/tpsl-handler.js";
|
|
4
5
|
//#region src/tpsl/search-tpsl-orders/search-tpsl-orders.ts
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
],
|
|
11
|
-
async function
|
|
12
|
-
let
|
|
13
|
-
...
|
|
14
|
-
state: [...
|
|
15
|
-
start:
|
|
6
|
+
var a = [
|
|
7
|
+
r.pending,
|
|
8
|
+
r.new,
|
|
9
|
+
r.triggered,
|
|
10
|
+
r.triggered_pending
|
|
11
|
+
], o = 200;
|
|
12
|
+
async function s(e, r) {
|
|
13
|
+
let s = n(e, r.chainId), l = r.size ?? o, u = {
|
|
14
|
+
...r.account === void 0 ? {} : { party_a_address: r.account },
|
|
15
|
+
state: [...r.state ?? a],
|
|
16
|
+
start: r.start ?? 0,
|
|
16
17
|
size: l
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
+
r.symbolId !== void 0 && (u.symbol_id = r.symbolId), r.conditionalOrderType !== void 0 && (u.conditional_order_type = r.conditionalOrderType), r.conditionalPriceType !== void 0 && (u.conditional_price_type = r.conditionalPriceType);
|
|
19
20
|
try {
|
|
20
|
-
return
|
|
21
|
-
baseURL:
|
|
21
|
+
return c((await i(u, {
|
|
22
|
+
baseURL: s.url,
|
|
22
23
|
headers: {
|
|
23
|
-
"App-Name":
|
|
24
|
+
"App-Name": s.appName,
|
|
24
25
|
"Content-Type": "application/json",
|
|
25
26
|
Accept: "application/json"
|
|
26
27
|
},
|
|
27
|
-
...
|
|
28
|
+
...r.timeoutMs === void 0 ? {} : { timeout: r.timeoutMs }
|
|
28
29
|
})).data, l);
|
|
29
|
-
} catch (
|
|
30
|
-
return e
|
|
30
|
+
} catch (e) {
|
|
31
|
+
return t(e, {
|
|
31
32
|
code: "SEARCH_TPSL_FAILED",
|
|
32
|
-
baseURL:
|
|
33
|
+
baseURL: s.url
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
-
let
|
|
37
|
+
function c(t, n) {
|
|
38
|
+
let r = Array.isArray(t) ? t : t?.data;
|
|
39
|
+
if (!Array.isArray(r)) throw new e("api", "SEARCH_TPSL_INVALID_RESPONSE", "Handler returned an invalid conditional-order page.");
|
|
40
|
+
let i = r, a = Array.isArray(t) ? void 0 : t?.count;
|
|
38
41
|
return {
|
|
39
|
-
orders:
|
|
40
|
-
count: typeof
|
|
41
|
-
isComplete:
|
|
42
|
+
orders: i,
|
|
43
|
+
count: typeof a == "number" ? a : i.length,
|
|
44
|
+
isComplete: i.length < n
|
|
42
45
|
};
|
|
43
46
|
}
|
|
44
47
|
//#endregion
|
|
45
|
-
export {
|
|
48
|
+
export { a as TPSL_LIVE_ORDER_STATES, s as searchTpSlOrders };
|
|
46
49
|
|
|
47
50
|
//# sourceMappingURL=search-tpsl-orders.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-tpsl-orders.js","names":[],"sources":["../../../src/tpsl/search-tpsl-orders/search-tpsl-orders.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport type { QuoteTpSlRow } from \"../get-quote-tpsl\";\nimport { rethrowTpSlError } from \"../internal/axios\";\nimport { resolveTpSlConfig } from \"../internal/resolve-tpsl-config\";\nimport { TpSlSearchOrderType } from \"../types\";\nimport {\n ConditionalOrdersState,\n searchConditionalOrdersV5ApiV5SearchPost,\n type ConditionalOrderSearchRequestSchemaV3,\n type ConditionalOrderType,\n type PriceActionType,\n} from \"../types/generated/tpsl-handler\";\n\n/**\n * The row states that represent an order the handler still holds.\n *\n * Exactly the set {@link QuoteTpSlRow} consumers treat as actionable —\n * `canceled` and `killed` are terminal and carry no live order. Passing this as\n * the search filter keeps \"absent from the result\" equivalent to \"no live\n * order\", which is what makes a cancel confirmable from a search response.\n */\nexport const TPSL_LIVE_ORDER_STATES = [\n ConditionalOrdersState.pending,\n ConditionalOrdersState.new,\n ConditionalOrdersState.triggered,\n ConditionalOrdersState.triggered_pending,\n] as const;\n\n/** Default page size. The handler's own default is 100; a position's legs fit well inside this. */\nconst DEFAULT_SEARCH_SIZE = 200;\n\n/** Parameters for {@link searchTpSlOrders}. */\nexport type SearchTpSlOrdersParameters = Compute<\n ChainIdParameter & {\n /**\n * Account whose conditional orders to search — the Virtual Account that\n * owns them, which is what the handler stores as `party_a_address`.\n *\n * **Omit to search across every account.** The handler treats the field as\n * an optional filter, so leaving it out returns all matching orders — which\n * is how a pool's own order book is read (`symbolId` + `conditionalOrderType`,\n * no account). Verified against the live handler.\n */\n account?: Address;\n /** Row states to include. Defaults to {@link TPSL_LIVE_ORDER_STATES}. */\n state?: readonly QuoteTpSlRowStateFilter[];\n /** Restrict to one market. */\n symbolId?: number;\n /** Restrict to one side. */\n conditionalOrderType?: TpSlSearchOrderType;\n /** Restrict to one trigger-price source. */\n conditionalPriceType?: PriceActionType;\n /** Page offset. Defaults to `0`. */\n start?: number;\n /** Page size. Defaults to `200`. */\n size?: number;\n /**\n * Abort the request after this many milliseconds. Unset means axios's\n * default of \"wait forever\" — pass one when the call is on a repeating\n * schedule, so a stalled connection fails the attempt instead of hanging it.\n */\n timeoutMs?: number;\n }\n>;\n\n/** A state accepted by the search filter. */\ntype QuoteTpSlRowStateFilter = ConditionalOrderSearchRequestSchemaV3[\"state\"] extends\n | (infer TState)[]\n | null\n | undefined\n ? TState\n : never;\n\n/** Return type of {@link searchTpSlOrders}. */\nexport interface SearchTpSlOrdersReturnType {\n /** The page's rows, in handler order. */\n orders: QuoteTpSlRow[];\n /** The handler's reported total for the filter. Advisory — see `isComplete`. */\n count: number;\n /**\n * `true` when this page provably exhausted the filtered result set, i.e.\n * fewer rows came back than were asked for.\n *\n * Derived from the page length rather than from `count`, whose meaning on\n * this endpoint is unverified and whose sibling `GET` already contradicts its\n * own spec. A caller may only read \"this order is absent, therefore it is\n * gone\" from a complete page; on an incomplete one, absence means nothing.\n */\n isComplete: boolean;\n}\n\n/**\n * Search conditional orders at the TP/SL handler.\n *\n * Hits `POST /api/v5/search/`. Unlike {@link getQuoteTpSl}, which reads one\n * quote, this returns every matching order in a single request — so a merged\n * position's legs cost one call rather than one call per leg.\n *\n * Every filter is optional, including `account`. Pass one to read a single\n * account's orders; omit it to read **across accounts**, which is how a pool's\n * order book is read — filter by `symbolId` and\n * `conditionalOrderType: \"send_quote\"` and the rows come back for every trader\n * on that market.\n *\n * Returns the raw rows; framework layers fold them into UI-facing snapshots.\n *\n * @param config - The SDK config.\n * @param parameters - Optional account, filters and paging.\n * @returns The page's rows, the handler's count, and whether the page is complete.\n *\n * @throws {SymmError} when the chain has no `tpsl` config.\n * @throws {SymmApiError} when the HTTP request fails.\n *\n * @example\n * ```ts\n * // One account's live legs.\n * const { orders } = await searchTpSlOrders(config, { account: virtualAccount });\n *\n * // A pool's pending trigger-to-open orders, across every trader.\n * const book = await searchTpSlOrders(config, {\n * symbolId,\n * conditionalOrderType: TpSlSearchOrderType.SEND_QUOTE,\n * });\n * ```\n */\nexport async function searchTpSlOrders(\n config: Config,\n parameters: SearchTpSlOrdersParameters,\n): Promise<SearchTpSlOrdersReturnType> {\n const tpsl = resolveTpSlConfig(config, parameters.chainId);\n const size = parameters.size ?? DEFAULT_SEARCH_SIZE;\n const body: ConditionalOrderSearchRequestSchemaV3 = {\n /**\n * Omitted entirely when absent rather than sent as `undefined`: the handler\n * treats a present-but-empty filter differently from a missing one.\n */\n ...(parameters.account === undefined ? {} : { party_a_address: parameters.account }),\n state: [...(parameters.state ?? TPSL_LIVE_ORDER_STATES)],\n start: parameters.start ?? 0,\n size,\n };\n if (parameters.symbolId !== undefined) body.symbol_id = parameters.symbolId;\n if (parameters.conditionalOrderType !== undefined) {\n /** Same string values as the generated enum; cast at the wire boundary so the generated type stays internal. */\n body.conditional_order_type = parameters.conditionalOrderType as unknown as ConditionalOrderType;\n }\n if (parameters.conditionalPriceType !== undefined) body.conditional_price_type = parameters.conditionalPriceType;\n\n try {\n const response = await searchConditionalOrdersV5ApiV5SearchPost(body, {\n baseURL: tpsl.url,\n headers: { \"App-Name\": tpsl.appName, \"Content-Type\": \"application/json\", Accept: \"application/json\" },\n ...(parameters.timeoutMs === undefined ? {} : { timeout: parameters.timeoutMs }),\n });\n return toSearchResult(response.data, size);\n } catch (err) {\n return rethrowTpSlError(err, { code: \"SEARCH_TPSL_FAILED\", baseURL: tpsl.url });\n }\n}\n\n/**\n * Normalize the response body.\n *\n * The live endpoint answers `{ data, count }`, but its sibling `GET` returns a\n * bare array against the same spec, so both shapes are accepted rather than\n * assumed — reading the wrong one would silently yield an empty page, which a\n * caller cannot distinguish from \"this account has no orders\".\n */\nfunction toSearchResult(body: unknown, size: number): SearchTpSlOrdersReturnType {\n const
|
|
1
|
+
{"version":3,"file":"search-tpsl-orders.js","names":[],"sources":["../../../src/tpsl/search-tpsl-orders/search-tpsl-orders.ts"],"sourcesContent":["import type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport { SymmError } from \"../../shared/errors/symm-error\";\nimport type { ChainIdParameter, Compute } from \"../../shared/types/properties\";\nimport type { QuoteTpSlRow } from \"../get-quote-tpsl\";\nimport { rethrowTpSlError } from \"../internal/axios\";\nimport { resolveTpSlConfig } from \"../internal/resolve-tpsl-config\";\nimport { TpSlSearchOrderType } from \"../types\";\nimport {\n ConditionalOrdersState,\n searchConditionalOrdersV5ApiV5SearchPost,\n type ConditionalOrderSearchRequestSchemaV3,\n type ConditionalOrderType,\n type PriceActionType,\n} from \"../types/generated/tpsl-handler\";\n\n/**\n * The row states that represent an order the handler still holds.\n *\n * Exactly the set {@link QuoteTpSlRow} consumers treat as actionable —\n * `canceled` and `killed` are terminal and carry no live order. Passing this as\n * the search filter keeps \"absent from the result\" equivalent to \"no live\n * order\", which is what makes a cancel confirmable from a search response.\n */\nexport const TPSL_LIVE_ORDER_STATES = [\n ConditionalOrdersState.pending,\n ConditionalOrdersState.new,\n ConditionalOrdersState.triggered,\n ConditionalOrdersState.triggered_pending,\n] as const;\n\n/** Default page size. The handler's own default is 100; a position's legs fit well inside this. */\nconst DEFAULT_SEARCH_SIZE = 200;\n\n/** Parameters for {@link searchTpSlOrders}. */\nexport type SearchTpSlOrdersParameters = Compute<\n ChainIdParameter & {\n /**\n * Account whose conditional orders to search — the Virtual Account that\n * owns them, which is what the handler stores as `party_a_address`.\n *\n * **Omit to search across every account.** The handler treats the field as\n * an optional filter, so leaving it out returns all matching orders — which\n * is how a pool's own order book is read (`symbolId` + `conditionalOrderType`,\n * no account). Verified against the live handler.\n */\n account?: Address;\n /** Row states to include. Defaults to {@link TPSL_LIVE_ORDER_STATES}. */\n state?: readonly QuoteTpSlRowStateFilter[];\n /** Restrict to one market. */\n symbolId?: number;\n /** Restrict to one side. */\n conditionalOrderType?: TpSlSearchOrderType;\n /** Restrict to one trigger-price source. */\n conditionalPriceType?: PriceActionType;\n /** Page offset. Defaults to `0`. */\n start?: number;\n /** Page size. Defaults to `200`. */\n size?: number;\n /**\n * Abort the request after this many milliseconds. Unset means axios's\n * default of \"wait forever\" — pass one when the call is on a repeating\n * schedule, so a stalled connection fails the attempt instead of hanging it.\n */\n timeoutMs?: number;\n }\n>;\n\n/** A state accepted by the search filter. */\ntype QuoteTpSlRowStateFilter = ConditionalOrderSearchRequestSchemaV3[\"state\"] extends\n | (infer TState)[]\n | null\n | undefined\n ? TState\n : never;\n\n/** Return type of {@link searchTpSlOrders}. */\nexport interface SearchTpSlOrdersReturnType {\n /** The page's rows, in handler order. */\n orders: QuoteTpSlRow[];\n /** The handler's reported total for the filter. Advisory — see `isComplete`. */\n count: number;\n /**\n * `true` when this page provably exhausted the filtered result set, i.e.\n * fewer rows came back than were asked for.\n *\n * Derived from the page length rather than from `count`, whose meaning on\n * this endpoint is unverified and whose sibling `GET` already contradicts its\n * own spec. A caller may only read \"this order is absent, therefore it is\n * gone\" from a complete page; on an incomplete one, absence means nothing.\n */\n isComplete: boolean;\n}\n\n/**\n * Search conditional orders at the TP/SL handler.\n *\n * Hits `POST /api/v5/search/`. Unlike {@link getQuoteTpSl}, which reads one\n * quote, this returns every matching order in a single request — so a merged\n * position's legs cost one call rather than one call per leg.\n *\n * Every filter is optional, including `account`. Pass one to read a single\n * account's orders; omit it to read **across accounts**, which is how a pool's\n * order book is read — filter by `symbolId` and\n * `conditionalOrderType: \"send_quote\"` and the rows come back for every trader\n * on that market.\n *\n * Returns the raw rows; framework layers fold them into UI-facing snapshots.\n *\n * @param config - The SDK config.\n * @param parameters - Optional account, filters and paging.\n * @returns The page's rows, the handler's count, and whether the page is complete.\n *\n * @throws {SymmError} when the chain has no `tpsl` config.\n * @throws {SymmApiError} when the HTTP request fails.\n *\n * @example\n * ```ts\n * // One account's live legs.\n * const { orders } = await searchTpSlOrders(config, { account: virtualAccount });\n *\n * // A pool's pending trigger-to-open orders, across every trader.\n * const book = await searchTpSlOrders(config, {\n * symbolId,\n * conditionalOrderType: TpSlSearchOrderType.SEND_QUOTE,\n * });\n * ```\n */\nexport async function searchTpSlOrders(\n config: Config,\n parameters: SearchTpSlOrdersParameters,\n): Promise<SearchTpSlOrdersReturnType> {\n const tpsl = resolveTpSlConfig(config, parameters.chainId);\n const size = parameters.size ?? DEFAULT_SEARCH_SIZE;\n const body: ConditionalOrderSearchRequestSchemaV3 = {\n /**\n * Omitted entirely when absent rather than sent as `undefined`: the handler\n * treats a present-but-empty filter differently from a missing one.\n */\n ...(parameters.account === undefined ? {} : { party_a_address: parameters.account }),\n state: [...(parameters.state ?? TPSL_LIVE_ORDER_STATES)],\n start: parameters.start ?? 0,\n size,\n };\n if (parameters.symbolId !== undefined) body.symbol_id = parameters.symbolId;\n if (parameters.conditionalOrderType !== undefined) {\n /** Same string values as the generated enum; cast at the wire boundary so the generated type stays internal. */\n body.conditional_order_type = parameters.conditionalOrderType as unknown as ConditionalOrderType;\n }\n if (parameters.conditionalPriceType !== undefined) body.conditional_price_type = parameters.conditionalPriceType;\n\n try {\n const response = await searchConditionalOrdersV5ApiV5SearchPost(body, {\n baseURL: tpsl.url,\n headers: { \"App-Name\": tpsl.appName, \"Content-Type\": \"application/json\", Accept: \"application/json\" },\n ...(parameters.timeoutMs === undefined ? {} : { timeout: parameters.timeoutMs }),\n });\n return toSearchResult(response.data, size);\n } catch (err) {\n return rethrowTpSlError(err, { code: \"SEARCH_TPSL_FAILED\", baseURL: tpsl.url });\n }\n}\n\n/**\n * Normalize the response body.\n *\n * The live endpoint answers `{ data, count }`, but its sibling `GET` returns a\n * bare array against the same spec, so both shapes are accepted rather than\n * assumed — reading the wrong one would silently yield an empty page, which a\n * caller cannot distinguish from \"this account has no orders\".\n */\nfunction toSearchResult(body: unknown, size: number): SearchTpSlOrdersReturnType {\n const rows: unknown = Array.isArray(body) ? body : (body as { data?: unknown })?.data;\n if (!Array.isArray(rows)) {\n throw new SymmError(\"api\", \"SEARCH_TPSL_INVALID_RESPONSE\", \"Handler returned an invalid conditional-order page.\");\n }\n const orders = rows as QuoteTpSlRow[];\n const reported = Array.isArray(body) ? undefined : (body as { count?: unknown })?.count;\n return {\n orders,\n count: typeof reported === \"number\" ? reported : orders.length,\n isComplete: orders.length < size,\n };\n}\n"],"mappings":";;;;;AAwBA,IAAa,IAAyB;CACpC,EAAuB;CACvB,EAAuB;CACvB,EAAuB;CACvB,EAAuB;AACzB,GAGM,IAAsB;AAgG5B,eAAsB,EACpB,GACA,GACqC;CACrC,IAAM,IAAO,EAAkB,GAAQ,EAAW,OAAO,GACnD,IAAO,EAAW,QAAQ,GAC1B,IAA8C;EAKlD,GAAI,EAAW,YAAY,KAAA,IAAY,CAAC,IAAI,EAAE,iBAAiB,EAAW,QAAQ;EAClF,OAAO,CAAC,GAAI,EAAW,SAAS,CAAuB;EACvD,OAAO,EAAW,SAAS;EAC3B;CACF;CAMA,AALI,EAAW,aAAa,KAAA,MAAW,EAAK,YAAY,EAAW,WAC/D,EAAW,yBAAyB,KAAA,MAEtC,EAAK,yBAAyB,EAAW,uBAEvC,EAAW,yBAAyB,KAAA,MAAW,EAAK,yBAAyB,EAAW;CAE5F,IAAI;EAMF,OAAO,GAAe,MALC,EAAyC,GAAM;GACpE,SAAS,EAAK;GACd,SAAS;IAAE,YAAY,EAAK;IAAS,gBAAgB;IAAoB,QAAQ;GAAmB;GACpG,GAAI,EAAW,cAAc,KAAA,IAAY,CAAC,IAAI,EAAE,SAAS,EAAW,UAAU;EAChF,CAAC,GAC8B,MAAM,CAAI;CAC3C,SAAS,GAAK;EACZ,OAAO,EAAiB,GAAK;GAAE,MAAM;GAAsB,SAAS,EAAK;EAAI,CAAC;CAChF;AACF;AAUA,SAAS,EAAe,GAAe,GAA0C;CAC/E,IAAM,IAAgB,MAAM,QAAQ,CAAI,IAAI,IAAQ,GAA6B;CACjF,IAAI,CAAC,MAAM,QAAQ,CAAI,GACrB,MAAM,IAAI,EAAU,OAAO,gCAAgC,qDAAqD;CAElH,IAAM,IAAS,GACT,IAAW,MAAM,QAAQ,CAAI,IAAI,KAAA,IAAa,GAA8B;CAClF,OAAO;EACL;EACA,OAAO,OAAO,KAAa,WAAW,IAAW,EAAO;EACxD,YAAY,EAAO,SAAS;CAC9B;AACF"}
|
|
@@ -14,7 +14,7 @@ export declare function buildConditionalOrderLeg(parameters: {
|
|
|
14
14
|
/** Trigger price (decimal string, rounded to market precision). */
|
|
15
15
|
conditionalPrice: string;
|
|
16
16
|
priceType: TpSlPriceType;
|
|
17
|
-
/** Defaults to `
|
|
17
|
+
/** Defaults to `OrderType.MARKET_BEST_EFFORT` (2), a close-only order type. */
|
|
18
18
|
orderType?: number;
|
|
19
19
|
}): TpSlConditionalOrderLeg;
|
|
20
20
|
//# sourceMappingURL=build-conditional-order-leg.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-conditional-order-leg.d.ts","sourceRoot":"","sources":["../../../src/tpsl/set-quote-tpsl/build-conditional-order-leg.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-conditional-order-leg.d.ts","sourceRoot":"","sources":["../../../src/tpsl/set-quote-tpsl/build-conditional-order-leg.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEvE,yCAAyC;AACzC,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE;IACnD,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,qFAAqF;IACrF,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,aAAa,CAAC;IACzB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,uBAAuB,CAQ1B"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import { OrderType as e } from "../../symmio-contracts/symmio/types.js";
|
|
2
|
+
//#region src/tpsl/set-quote-tpsl/build-conditional-order-leg.ts
|
|
3
|
+
function t(t) {
|
|
2
4
|
return {
|
|
3
|
-
quantity:
|
|
4
|
-
price:
|
|
5
|
-
orderType:
|
|
6
|
-
conditionalPrice:
|
|
7
|
-
conditionalPriceType:
|
|
5
|
+
quantity: t.quantity,
|
|
6
|
+
price: t.price,
|
|
7
|
+
orderType: t.orderType ?? e.MARKET_BEST_EFFORT,
|
|
8
|
+
conditionalPrice: t.conditionalPrice,
|
|
9
|
+
conditionalPriceType: t.priceType === "lastPrice" ? "last_close" : "market"
|
|
8
10
|
};
|
|
9
11
|
}
|
|
10
12
|
//#endregion
|
|
11
|
-
export {
|
|
13
|
+
export { t as buildConditionalOrderLeg };
|
|
12
14
|
|
|
13
15
|
//# sourceMappingURL=build-conditional-order-leg.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-conditional-order-leg.js","names":[],"sources":["../../../src/tpsl/set-quote-tpsl/build-conditional-order-leg.ts"],"sourcesContent":["import type { TpSlConditionalOrderLeg, TpSlPriceType } from \"../types\";\n\n/** `order_type` field — `1` = market. */\nexport const TPSL_LEG_ORDER_TYPE_MARKET = 1;\n\n/**\n * Build one conditional-order leg (TP or SL). Mirrors the reference frontend's\n * `buildConditionalOrderLeg` exactly so the signed payload matches what the\n * handler expects.\n */\nexport function buildConditionalOrderLeg(parameters: {\n /** Quote quantity (decimal string). */\n quantity: string;\n /** Slippage-shifted \"opened\" price (decimal string, rounded to market precision). */\n price: string;\n /** Trigger price (decimal string, rounded to market precision). */\n conditionalPrice: string;\n priceType: TpSlPriceType;\n /** Defaults to `
|
|
1
|
+
{"version":3,"file":"build-conditional-order-leg.js","names":[],"sources":["../../../src/tpsl/set-quote-tpsl/build-conditional-order-leg.ts"],"sourcesContent":["import { OrderType } from \"../../symmio-contracts/symmio/types\";\nimport type { TpSlConditionalOrderLeg, TpSlPriceType } from \"../types\";\n\n/** `order_type` field — `1` = market. */\nexport const TPSL_LEG_ORDER_TYPE_MARKET = 1;\n\n/**\n * Build one conditional-order leg (TP or SL). Mirrors the reference frontend's\n * `buildConditionalOrderLeg` exactly so the signed payload matches what the\n * handler expects.\n */\nexport function buildConditionalOrderLeg(parameters: {\n /** Quote quantity (decimal string). */\n quantity: string;\n /** Slippage-shifted \"opened\" price (decimal string, rounded to market precision). */\n price: string;\n /** Trigger price (decimal string, rounded to market precision). */\n conditionalPrice: string;\n priceType: TpSlPriceType;\n /** Defaults to `OrderType.MARKET_BEST_EFFORT` (2), a close-only order type. */\n orderType?: number;\n}): TpSlConditionalOrderLeg {\n return {\n quantity: parameters.quantity,\n price: parameters.price,\n orderType: parameters.orderType ?? OrderType.MARKET_BEST_EFFORT,\n conditionalPrice: parameters.conditionalPrice,\n conditionalPriceType: parameters.priceType === \"lastPrice\" ? \"last_close\" : \"market\",\n };\n}\n"],"mappings":";;AAWA,SAAgB,EAAyB,GAUb;CAC1B,OAAO;EACL,UAAU,EAAW;EACrB,OAAO,EAAW;EAClB,WAAW,EAAW,aAAa,EAAU;EAC7C,kBAAkB,EAAW;EAC7B,sBAAsB,EAAW,cAAc,cAAc,eAAe;CAC9E;AACF"}
|
|
@@ -3,12 +3,16 @@ import { SetQuoteTpSlParameters } from './set-quote-tpsl.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Build TanStack Mutation options for {@link setQuoteTpSl}.
|
|
5
5
|
*
|
|
6
|
+
* Automatic retries are disabled: a failed response may follow an accepted write.
|
|
7
|
+
* Reconcile state before explicitly submitting again.
|
|
8
|
+
*
|
|
6
9
|
* @example
|
|
7
10
|
* ```ts
|
|
8
11
|
* useMutation(setQuoteTpSlMutationOptions(config));
|
|
9
12
|
* ```
|
|
10
13
|
*/
|
|
11
14
|
export declare function setQuoteTpSlMutationOptions(config: Config): {
|
|
15
|
+
retry: boolean;
|
|
12
16
|
mutationKey: readonly ["setQuoteTpSl"];
|
|
13
17
|
mutationFn: (variables: SetQuoteTpSlParameters) => Promise<import('./set-quote-tpsl.js').SetQuoteTpSlReturnType>;
|
|
14
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/tpsl/set-quote-tpsl/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAgB,KAAK,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE7E
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/tpsl/set-quote-tpsl/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAgB,KAAK,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE7E;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM;;;4BAI9B,sBAAsB;EAEjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","names":[],"sources":["../../../src/tpsl/set-quote-tpsl/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport { setQuoteTpSl, type SetQuoteTpSlParameters } from \"./set-quote-tpsl\";\n\n/**\n * Build TanStack Mutation options for {@link setQuoteTpSl}.\n *\n * @example\n * ```ts\n * useMutation(setQuoteTpSlMutationOptions(config));\n * ```\n */\nexport function setQuoteTpSlMutationOptions(config: Config) {\n return {\n mutationKey: [\"setQuoteTpSl\"] as const,\n mutationFn: (variables: SetQuoteTpSlParameters) => setQuoteTpSl(config, variables),\n };\n}\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"query.js","names":[],"sources":["../../../src/tpsl/set-quote-tpsl/query.ts"],"sourcesContent":["import type { Config } from \"../../core/config\";\nimport { setQuoteTpSl, type SetQuoteTpSlParameters } from \"./set-quote-tpsl\";\n\n/**\n * Build TanStack Mutation options for {@link setQuoteTpSl}.\n *\n * Automatic retries are disabled: a failed response may follow an accepted write.\n * Reconcile state before explicitly submitting again.\n *\n * @example\n * ```ts\n * useMutation(setQuoteTpSlMutationOptions(config));\n * ```\n */\nexport function setQuoteTpSlMutationOptions(config: Config) {\n return {\n retry: false,\n mutationKey: [\"setQuoteTpSl\"] as const,\n mutationFn: (variables: SetQuoteTpSlParameters) => setQuoteTpSl(config, variables),\n };\n}\n"],"mappings":";;AAcA,SAAgB,EAA4B,GAAgB;CAC1D,OAAO;EACL,OAAO;EACP,aAAa,CAAC,cAAc;EAC5B,aAAa,MAAsC,EAAa,GAAQ,CAAS;CACnF;AACF"}
|
|
@@ -62,9 +62,9 @@ export interface SetQuoteTpSlReturnType {
|
|
|
62
62
|
* 4. Sign it with the session-key wallet client (`config.getWalletClient`).
|
|
63
63
|
* 5. POST `{ typedData, signature, signer }` to the handler.
|
|
64
64
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
65
|
+
* An explicit successful response establishes acceptance. Subscribe with
|
|
66
|
+
* `watchTpSlNotifications` for refresh hints and reconcile live order state;
|
|
67
|
+
* notifications do not correlate successive mutations or supply order versions.
|
|
68
68
|
*
|
|
69
69
|
* @throws {SymmError} when the chain has no `tpsl` config, both `tp` and `sl`
|
|
70
70
|
* are omitted, or signing fails.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-quote-tpsl.d.ts","sourceRoot":"","sources":["../../../src/tpsl/set-quote-tpsl/set-quote-tpsl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"set-quote-tpsl.d.ts","sourceRoot":"","sources":["../../../src/tpsl/set-quote-tpsl/set-quote-tpsl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAMnE,OAAO,KAAK,EAA2B,aAAa,EAAE,MAAM,UAAU,CAAC;AAMvE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,sCAAsC;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,0BAA0B;IAC1B,SAAS,EAAE,aAAa,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAC1C,oBAAoB,GAAG;IACrB,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,cAAc,EAAE,OAAO,CAAC;IACxB,mCAAmC;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,wBAAwB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,uBAAuB;IACvB,YAAY,EAAE,YAAY,CAAC;IAC3B,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,uCAAuC;IACvC,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB,CACF,CAAC;AAEF,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,IAAI,CAAC;IACd,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,sBAAsB,GACjC,OAAO,CAAC,sBAAsB,CAAC,CAmFjC"}
|
|
@@ -3,65 +3,67 @@ import { PositionType as t } from "../../symmio-contracts/symmio/types.js";
|
|
|
3
3
|
import { rethrowTpSlError as n } from "../internal/axios.js";
|
|
4
4
|
import { resolveTpSlConfig as r } from "../internal/resolve-tpsl-config.js";
|
|
5
5
|
import { conditionalOrderRequestV5ApiV5Post as i } from "../types/generated/tpsl-handler.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
6
|
+
import { assertTpSlAcceptance as a } from "../assert-tpsl-acceptance.js";
|
|
7
|
+
import { buildConditionalOrderMessage as o } from "./build-conditional-order-message.js";
|
|
8
|
+
import { signTpSlRequest as s } from "./sign-tpsl-request.js";
|
|
9
|
+
import { buildConditionalOrderLeg as c } from "./build-conditional-order-leg.js";
|
|
10
|
+
import { getTpSlSigningSpec as l } from "../signing-spec/get-tpsl-signing-spec.js";
|
|
11
|
+
import { priceSlippageCalculation as u } from "../slippage.js";
|
|
12
|
+
import { toDecimal as d } from "@symmio/utils/decimal";
|
|
12
13
|
//#region src/tpsl/set-quote-tpsl/set-quote-tpsl.ts
|
|
13
|
-
async function
|
|
14
|
-
if (!
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
14
|
+
async function f(f, p) {
|
|
15
|
+
if (!p.tp && !p.sl) throw new e("validation", "SET_TPSL_NOTHING_TO_SUBMIT", "setQuoteTpSl: at least one of `tp` or `sl` must be provided.");
|
|
16
|
+
if (!Number.isSafeInteger(Number(p.quoteId)) || p.quoteId === 0n || !Number.isSafeInteger(Number(p.symbolId)) || p.symbolId <= 0n) throw new e("validation", "SET_TPSL_INVALID_ID", "TP/SL quote and symbol IDs must be safe nonzero integers.");
|
|
17
|
+
let m = f.getChainConfig(p.chainId), h = r(f, p.chainId), g = p.affiliate ?? m.addresses.affiliatesAddress, _ = p.slippage ?? 90, v = await l(f, { chainId: p.chainId }), y = p.tp ? c({
|
|
18
|
+
quantity: p.quantity,
|
|
19
|
+
price: u(p.tp.triggerPrice, _, p.positionType, p.pricePrecision),
|
|
20
|
+
conditionalPrice: d(p.tp.triggerPrice).toFixed(p.pricePrecision),
|
|
21
|
+
priceType: p.tp.priceType
|
|
22
|
+
}) : null, b = p.sl ? c({
|
|
23
|
+
quantity: p.quantity,
|
|
24
|
+
price: u(p.sl.triggerPrice, _, p.positionType, p.pricePrecision),
|
|
25
|
+
conditionalPrice: d(p.sl.triggerPrice).toFixed(p.pricePrecision),
|
|
26
|
+
priceType: p.sl.priceType
|
|
27
|
+
}) : null, x = await s({
|
|
28
|
+
signingSpec: v,
|
|
29
|
+
message: o({
|
|
30
|
+
virtualAccount: p.virtualAccount,
|
|
31
|
+
subAccount: p.subAccount,
|
|
32
|
+
quoteId: Number(p.quoteId),
|
|
33
|
+
symbolId: Number(p.symbolId),
|
|
34
|
+
positionType: p.positionType === t.LONG ? 0 : 1,
|
|
35
|
+
affiliate: g,
|
|
36
|
+
takeProfit: y,
|
|
37
|
+
stopLoss: b
|
|
36
38
|
}),
|
|
37
|
-
walletClient: await
|
|
38
|
-
chainId:
|
|
39
|
-
from:
|
|
39
|
+
walletClient: await f.getWalletClient({
|
|
40
|
+
chainId: p.chainId,
|
|
41
|
+
from: p.from
|
|
40
42
|
})
|
|
41
43
|
});
|
|
42
44
|
try {
|
|
43
|
-
let
|
|
44
|
-
baseURL:
|
|
45
|
+
let e = (await i(x, {
|
|
46
|
+
baseURL: h.url,
|
|
45
47
|
headers: {
|
|
46
|
-
"App-Name":
|
|
48
|
+
"App-Name": h.appName,
|
|
47
49
|
"Content-Type": "application/json",
|
|
48
50
|
Accept: "application/json"
|
|
49
51
|
}
|
|
50
52
|
})).data ?? {};
|
|
51
|
-
|
|
52
|
-
let
|
|
53
|
+
a(e, "SET");
|
|
54
|
+
let t = e;
|
|
53
55
|
return {
|
|
54
56
|
success: !0,
|
|
55
|
-
cohQuoteId:
|
|
57
|
+
cohQuoteId: t.coh_quote_id ?? t.cohQuoteId
|
|
56
58
|
};
|
|
57
59
|
} catch (e) {
|
|
58
60
|
return n(e, {
|
|
59
61
|
code: "SET_TPSL_FAILED",
|
|
60
|
-
baseURL:
|
|
62
|
+
baseURL: h.url
|
|
61
63
|
});
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
66
|
//#endregion
|
|
65
|
-
export {
|
|
67
|
+
export { f as setQuoteTpSl };
|
|
66
68
|
|
|
67
69
|
//# sourceMappingURL=set-quote-tpsl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-quote-tpsl.js","names":[],"sources":["../../../src/tpsl/set-quote-tpsl/set-quote-tpsl.ts"],"sourcesContent":["import { toDecimal } from \"@symmio/utils/decimal\";\nimport type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport { SymmError } from \"../../shared/errors/symm-error\";\nimport type { Compute, WriteSolverParameter } from \"../../shared/types/properties\";\nimport { PositionType } from \"../../symmio-contracts/symmio/types\";\nimport { rethrowTpSlError } from \"../internal/axios\";\nimport { resolveTpSlConfig } from \"../internal/resolve-tpsl-config\";\nimport { getTpSlSigningSpec } from \"../signing-spec/get-tpsl-signing-spec\";\nimport { DEFAULT_TPSL_SLIPPAGE_LOWCAPS, priceSlippageCalculation } from \"../slippage\";\nimport type { TpSlConditionalOrderLeg, TpSlPriceType } from \"../types\";\nimport { conditionalOrderRequestV5ApiV5Post, type ConditionalOrderOperationV5 } from \"../types/generated/tpsl-handler\";\nimport { buildConditionalOrderLeg } from \"./build-conditional-order-leg\";\nimport { buildConditionalOrderMessage } from \"./build-conditional-order-message\";\nimport { signTpSlRequest } from \"./sign-tpsl-request\";\n\n/**\n * One side (TP or SL) of a {@link setQuoteTpSl} call.\n */\nexport interface SetTpSlSide {\n /** Trigger price (decimal string). */\n triggerPrice: string;\n /** Mark vs last-close. */\n priceType: TpSlPriceType;\n}\n\n/**\n * Parameters for {@link setQuoteTpSl}.\n */\nexport type SetQuoteTpSlParameters = Compute<\n WriteSolverParameter & {\n /** On-chain quote id. */\n quoteId: bigint;\n /** PartyA (the VA address) that owns the quote. */\n virtualAccount: Address;\n /** SubAccount that owns the VA. */\n subAccount: Address;\n /** Solver market id. */\n symbolId: bigint;\n /** Quote direction. */\n positionType: PositionType;\n /** Quote quantity (decimal string). */\n quantity: string;\n /** Market price precision (rounds prices to N decimals). */\n pricePrecision: number;\n /**\n * Affiliate to bind to the order. Defaults to\n * `chainConfig.addresses.affiliatesAddress`.\n */\n affiliate?: Address;\n /**\n * Slippage percent applied when deriving each leg's `price`. Defaults to\n * {@link DEFAULT_TPSL_SLIPPAGE_LOWCAPS}.\n */\n slippage?: number;\n /** Take-profit side. Omit to skip TP. */\n tp?: SetTpSlSide;\n /** Stop-loss side. Omit to skip SL. */\n sl?: SetTpSlSide;\n }\n>;\n\n/** Return type of {@link setQuoteTpSl}. */\nexport interface SetQuoteTpSlReturnType {\n success: true;\n /** Handler-issued conditional-order id (when reported on the response). */\n cohQuoteId?: string;\n}\n\n/**\n * Submit a TP and/or SL order to the handler.\n *\n * Steps:\n * 1. Resolve the TP/SL handler URL + signing spec for the chain.\n * 2. Round trigger prices and compute slippage-shifted \"opened\" prices via\n * {@link priceSlippageCalculation}.\n * 3. Build a {@link TpSlConditionalOrderMessage} with non-null legs only.\n * 4. Sign it with the session-key wallet client (`config.getWalletClient`).\n * 5. POST `{ typedData, signature, signer }` to the handler.\n *\n *
|
|
1
|
+
{"version":3,"file":"set-quote-tpsl.js","names":[],"sources":["../../../src/tpsl/set-quote-tpsl/set-quote-tpsl.ts"],"sourcesContent":["import { toDecimal } from \"@symmio/utils/decimal\";\nimport type { Address } from \"viem\";\nimport type { Config } from \"../../core/config\";\nimport { SymmError } from \"../../shared/errors/symm-error\";\nimport type { Compute, WriteSolverParameter } from \"../../shared/types/properties\";\nimport { PositionType } from \"../../symmio-contracts/symmio/types\";\nimport { assertTpSlAcceptance } from \"../assert-tpsl-acceptance\";\nimport { rethrowTpSlError } from \"../internal/axios\";\nimport { resolveTpSlConfig } from \"../internal/resolve-tpsl-config\";\nimport { getTpSlSigningSpec } from \"../signing-spec/get-tpsl-signing-spec\";\nimport { DEFAULT_TPSL_SLIPPAGE_LOWCAPS, priceSlippageCalculation } from \"../slippage\";\nimport type { TpSlConditionalOrderLeg, TpSlPriceType } from \"../types\";\nimport { conditionalOrderRequestV5ApiV5Post, type ConditionalOrderOperationV5 } from \"../types/generated/tpsl-handler\";\nimport { buildConditionalOrderLeg } from \"./build-conditional-order-leg\";\nimport { buildConditionalOrderMessage } from \"./build-conditional-order-message\";\nimport { signTpSlRequest } from \"./sign-tpsl-request\";\n\n/**\n * One side (TP or SL) of a {@link setQuoteTpSl} call.\n */\nexport interface SetTpSlSide {\n /** Trigger price (decimal string). */\n triggerPrice: string;\n /** Mark vs last-close. */\n priceType: TpSlPriceType;\n}\n\n/**\n * Parameters for {@link setQuoteTpSl}.\n */\nexport type SetQuoteTpSlParameters = Compute<\n WriteSolverParameter & {\n /** On-chain quote id. */\n quoteId: bigint;\n /** PartyA (the VA address) that owns the quote. */\n virtualAccount: Address;\n /** SubAccount that owns the VA. */\n subAccount: Address;\n /** Solver market id. */\n symbolId: bigint;\n /** Quote direction. */\n positionType: PositionType;\n /** Quote quantity (decimal string). */\n quantity: string;\n /** Market price precision (rounds prices to N decimals). */\n pricePrecision: number;\n /**\n * Affiliate to bind to the order. Defaults to\n * `chainConfig.addresses.affiliatesAddress`.\n */\n affiliate?: Address;\n /**\n * Slippage percent applied when deriving each leg's `price`. Defaults to\n * {@link DEFAULT_TPSL_SLIPPAGE_LOWCAPS}.\n */\n slippage?: number;\n /** Take-profit side. Omit to skip TP. */\n tp?: SetTpSlSide;\n /** Stop-loss side. Omit to skip SL. */\n sl?: SetTpSlSide;\n }\n>;\n\n/** Return type of {@link setQuoteTpSl}. */\nexport interface SetQuoteTpSlReturnType {\n success: true;\n /** Handler-issued conditional-order id (when reported on the response). */\n cohQuoteId?: string;\n}\n\n/**\n * Submit a TP and/or SL order to the handler.\n *\n * Steps:\n * 1. Resolve the TP/SL handler URL + signing spec for the chain.\n * 2. Round trigger prices and compute slippage-shifted \"opened\" prices via\n * {@link priceSlippageCalculation}.\n * 3. Build a {@link TpSlConditionalOrderMessage} with non-null legs only.\n * 4. Sign it with the session-key wallet client (`config.getWalletClient`).\n * 5. POST `{ typedData, signature, signer }` to the handler.\n *\n * An explicit successful response establishes acceptance. Subscribe with\n * `watchTpSlNotifications` for refresh hints and reconcile live order state;\n * notifications do not correlate successive mutations or supply order versions.\n *\n * @throws {SymmError} when the chain has no `tpsl` config, both `tp` and `sl`\n * are omitted, or signing fails.\n * @throws {SymmApiError} when the handler request fails.\n */\nexport async function setQuoteTpSl(\n config: Config,\n parameters: SetQuoteTpSlParameters,\n): Promise<SetQuoteTpSlReturnType> {\n if (!parameters.tp && !parameters.sl) {\n throw new SymmError(\n \"validation\",\n \"SET_TPSL_NOTHING_TO_SUBMIT\",\n \"setQuoteTpSl: at least one of `tp` or `sl` must be provided.\",\n );\n }\n\n if (\n !Number.isSafeInteger(Number(parameters.quoteId)) ||\n parameters.quoteId === 0n ||\n !Number.isSafeInteger(Number(parameters.symbolId)) ||\n parameters.symbolId <= 0n\n ) {\n throw new SymmError(\n \"validation\",\n \"SET_TPSL_INVALID_ID\",\n \"TP/SL quote and symbol IDs must be safe nonzero integers.\",\n );\n }\n\n const chainConfig = config.getChainConfig(parameters.chainId);\n const tpsl = resolveTpSlConfig(config, parameters.chainId);\n const affiliate = parameters.affiliate ?? chainConfig.addresses.affiliatesAddress;\n const slippage = parameters.slippage ?? DEFAULT_TPSL_SLIPPAGE_LOWCAPS;\n\n const signingSpec = await getTpSlSigningSpec(config, { chainId: parameters.chainId });\n\n const tpLeg: TpSlConditionalOrderLeg | null = parameters.tp\n ? buildConditionalOrderLeg({\n quantity: parameters.quantity,\n price: priceSlippageCalculation(\n parameters.tp.triggerPrice,\n slippage,\n parameters.positionType,\n parameters.pricePrecision,\n ),\n conditionalPrice: toDecimal(parameters.tp.triggerPrice).toFixed(parameters.pricePrecision),\n priceType: parameters.tp.priceType,\n })\n : null;\n\n const slLeg: TpSlConditionalOrderLeg | null = parameters.sl\n ? buildConditionalOrderLeg({\n quantity: parameters.quantity,\n price: priceSlippageCalculation(\n parameters.sl.triggerPrice,\n slippage,\n parameters.positionType,\n parameters.pricePrecision,\n ),\n conditionalPrice: toDecimal(parameters.sl.triggerPrice).toFixed(parameters.pricePrecision),\n priceType: parameters.sl.priceType,\n })\n : null;\n\n const message = buildConditionalOrderMessage({\n virtualAccount: parameters.virtualAccount,\n subAccount: parameters.subAccount,\n quoteId: Number(parameters.quoteId),\n symbolId: Number(parameters.symbolId),\n positionType: parameters.positionType === PositionType.LONG ? 0 : 1,\n affiliate,\n takeProfit: tpLeg,\n stopLoss: slLeg,\n });\n\n const walletClient = await config.getWalletClient({ chainId: parameters.chainId, from: parameters.from });\n const signed = await signTpSlRequest({ signingSpec, message, walletClient });\n\n try {\n const response = await conditionalOrderRequestV5ApiV5Post(signed as unknown as ConditionalOrderOperationV5, {\n baseURL: tpsl.url,\n headers: { \"App-Name\": tpsl.appName, \"Content-Type\": \"application/json\", Accept: \"application/json\" },\n });\n const body = response.data ?? {};\n assertTpSlAcceptance(body, \"SET\");\n const extra = body as { coh_quote_id?: string; cohQuoteId?: string };\n return { success: true, cohQuoteId: extra.coh_quote_id ?? extra.cohQuoteId };\n } catch (err) {\n return rethrowTpSlError(err, { code: \"SET_TPSL_FAILED\", baseURL: tpsl.url });\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAyFA,eAAsB,EACpB,GACA,GACiC;CACjC,IAAI,CAAC,EAAW,MAAM,CAAC,EAAW,IAChC,MAAM,IAAI,EACR,cACA,8BACA,8DACF;CAGF,IACE,CAAC,OAAO,cAAc,OAAO,EAAW,OAAO,CAAC,KAChD,EAAW,YAAY,MACvB,CAAC,OAAO,cAAc,OAAO,EAAW,QAAQ,CAAC,KACjD,EAAW,YAAY,IAEvB,MAAM,IAAI,EACR,cACA,uBACA,2DACF;CAGF,IAAM,IAAc,EAAO,eAAe,EAAW,OAAO,GACtD,IAAO,EAAkB,GAAQ,EAAW,OAAO,GACnD,IAAY,EAAW,aAAa,EAAY,UAAU,mBAC1D,IAAW,EAAW,YAAA,IAEtB,IAAc,MAAM,EAAmB,GAAQ,EAAE,SAAS,EAAW,QAAQ,CAAC,GAE9E,IAAwC,EAAW,KACrD,EAAyB;EACvB,UAAU,EAAW;EACrB,OAAO,EACL,EAAW,GAAG,cACd,GACA,EAAW,cACX,EAAW,cACb;EACA,kBAAkB,EAAU,EAAW,GAAG,YAAY,EAAE,QAAQ,EAAW,cAAc;EACzF,WAAW,EAAW,GAAG;CAC3B,CAAC,IACD,MAEE,IAAwC,EAAW,KACrD,EAAyB;EACvB,UAAU,EAAW;EACrB,OAAO,EACL,EAAW,GAAG,cACd,GACA,EAAW,cACX,EAAW,cACb;EACA,kBAAkB,EAAU,EAAW,GAAG,YAAY,EAAE,QAAQ,EAAW,cAAc;EACzF,WAAW,EAAW,GAAG;CAC3B,CAAC,IACD,MAcE,IAAS,MAAM,EAAgB;EAAE;EAAa,SAZpC,EAA6B;GAC3C,gBAAgB,EAAW;GAC3B,YAAY,EAAW;GACvB,SAAS,OAAO,EAAW,OAAO;GAClC,UAAU,OAAO,EAAW,QAAQ;GACpC,cAAc,EAAW,iBAAiB,EAAa,OAAO,IAAI;GAClE;GACA,YAAY;GACZ,UAAU;EACZ,CAGoD;EAAS,cAAA,MADlC,EAAO,gBAAgB;GAAE,SAAS,EAAW;GAAS,MAAM,EAAW;EAAK,CAAC;CAC9B,CAAC;CAE3E,IAAI;EAKF,IAAM,KAAO,MAJU,EAAmC,GAAkD;GAC1G,SAAS,EAAK;GACd,SAAS;IAAE,YAAY,EAAK;IAAS,gBAAgB;IAAoB,QAAQ;GAAmB;EACtG,CAAC,GACqB,QAAQ,CAAC;EAC/B,EAAqB,GAAM,KAAK;EAChC,IAAM,IAAQ;EACd,OAAO;GAAE,SAAS;GAAM,YAAY,EAAM,gBAAgB,EAAM;EAAW;CAC7E,SAAS,GAAK;EACZ,OAAO,EAAiB,GAAK;GAAE,MAAM;GAAmB,SAAS,EAAK;EAAI,CAAC;CAC7E;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symmio/trading-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "Framework-agnostic SYMMIO SDK. Contract calls, calculations, and transformations with no framework assumptions.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/SYMM-IO/Trading-SDK/tree/main/packages/trading-core#readme",
|