@symmio/trading-core 3.6.0 → 4.0.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/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +248 -246
- package/dist/pools/markets/get-listing-markets.d.ts +2 -0
- package/dist/pools/markets/get-listing-markets.d.ts.map +1 -1
- package/dist/pools/markets/get-listing-markets.js +1 -0
- package/dist/pools/markets/get-listing-markets.js.map +1 -1
- package/dist/pools/markets/query.d.ts.map +1 -1
- package/dist/pools/markets/query.js +1 -0
- package/dist/pools/markets/query.js.map +1 -1
- package/dist/pools/markets/to-search-params.d.ts +1 -0
- package/dist/pools/markets/to-search-params.d.ts.map +1 -1
- package/dist/pools/markets/to-search-params.js +1 -1
- package/dist/pools/markets/to-search-params.js.map +1 -1
- package/dist/solvers/estimated-price/get-estimated-price.d.ts +2 -0
- package/dist/solvers/estimated-price/get-estimated-price.d.ts.map +1 -1
- package/dist/solvers/estimated-price/get-estimated-price.js +4 -1
- package/dist/solvers/estimated-price/get-estimated-price.js.map +1 -1
- package/dist/solvers/estimated-price/query.d.ts +6 -2
- package/dist/solvers/estimated-price/query.d.ts.map +1 -1
- package/dist/solvers/estimated-price/query.js +3 -2
- package/dist/solvers/estimated-price/query.js.map +1 -1
- package/dist/solvers/funding-info/adapters/enigma-funding-info.d.ts +4 -0
- package/dist/solvers/funding-info/adapters/enigma-funding-info.d.ts.map +1 -0
- package/dist/solvers/funding-info/adapters/enigma-funding-info.js +17 -0
- package/dist/solvers/funding-info/adapters/enigma-funding-info.js.map +1 -0
- package/dist/solvers/funding-info/adapters/rasa-funding-info.d.ts +4 -0
- package/dist/solvers/funding-info/adapters/rasa-funding-info.d.ts.map +1 -0
- package/dist/solvers/funding-info/adapters/rasa-funding-info.js +21 -0
- package/dist/solvers/funding-info/adapters/rasa-funding-info.js.map +1 -0
- package/dist/solvers/funding-info/get-funding-info.d.ts +22 -13
- package/dist/solvers/funding-info/get-funding-info.d.ts.map +1 -1
- package/dist/solvers/funding-info/get-funding-info.js +24 -12
- package/dist/solvers/funding-info/get-funding-info.js.map +1 -1
- package/dist/solvers/funding-info/query.d.ts +14 -6
- package/dist/solvers/funding-info/query.d.ts.map +1 -1
- package/dist/solvers/funding-info/query.js +1 -0
- package/dist/solvers/funding-info/query.js.map +1 -1
- package/dist/solvers/funding-info/to-funding-info.d.ts +8 -4
- package/dist/solvers/funding-info/to-funding-info.d.ts.map +1 -1
- package/dist/solvers/funding-info/to-funding-info.js +2 -1
- package/dist/solvers/funding-info/to-funding-info.js.map +1 -1
- package/dist/solvers/funding-info/types.d.ts +26 -4
- package/dist/solvers/funding-info/types.d.ts.map +1 -1
- package/dist/solvers/market-info/adapters/enigma-market-info.d.ts +3 -3
- package/dist/solvers/market-info/adapters/enigma-market-info.d.ts.map +1 -1
- package/dist/solvers/market-info/adapters/enigma-market-info.js +7 -5
- package/dist/solvers/market-info/adapters/enigma-market-info.js.map +1 -1
- package/dist/solvers/market-info/get-market-info.d.ts +3 -2
- package/dist/solvers/market-info/get-market-info.d.ts.map +1 -1
- package/dist/solvers/market-info/get-market-info.js.map +1 -1
- package/dist/solvers/market-info/types.d.ts +4 -3
- package/dist/solvers/market-info/types.d.ts.map +1 -1
- package/dist/solvers/notional-cap/get-notional-cap-all.d.ts +10 -10
- package/dist/solvers/notional-cap/get-notional-cap-all.d.ts.map +1 -1
- package/dist/solvers/notional-cap/get-notional-cap-all.js +26 -23
- package/dist/solvers/notional-cap/get-notional-cap-all.js.map +1 -1
- package/dist/solvers/notional-cap/get-notional-cap-page.d.ts +49 -0
- package/dist/solvers/notional-cap/get-notional-cap-page.d.ts.map +1 -0
- package/dist/solvers/notional-cap/get-notional-cap-page.js +37 -0
- package/dist/solvers/notional-cap/get-notional-cap-page.js.map +1 -0
- package/dist/solvers/notional-cap/index.d.ts +2 -0
- package/dist/solvers/notional-cap/index.d.ts.map +1 -1
- package/dist/solvers/notional-cap/query-page.d.ts +45 -0
- package/dist/solvers/notional-cap/query-page.d.ts.map +1 -0
- package/dist/solvers/notional-cap/query-page.js +26 -0
- package/dist/solvers/notional-cap/query-page.js.map +1 -0
- package/dist/solvers/symbols/get-symbols.d.ts +3 -2
- package/dist/solvers/symbols/get-symbols.d.ts.map +1 -1
- package/dist/solvers/symbols/get-symbols.js +17 -3
- package/dist/solvers/symbols/get-symbols.js.map +1 -1
- package/dist/solvers/trade-volume/get-trade-volume.d.ts +2 -1
- package/dist/solvers/trade-volume/get-trade-volume.d.ts.map +1 -1
- package/dist/solvers/trade-volume/get-trade-volume.js +6 -1
- package/dist/solvers/trade-volume/get-trade-volume.js.map +1 -1
- package/dist/solvers/trade-volume/to-daily-volume.d.ts +6 -6
- package/dist/solvers/trade-volume/to-daily-volume.js.map +1 -1
- package/dist/solvers/trade-volume/types.d.ts +4 -3
- package/dist/solvers/trade-volume/types.d.ts.map +1 -1
- package/dist/solvers/types/generated/enigma-solver.js +3 -3
- package/dist/solvers/types/generated/enigma-solver.js.map +1 -1
- package/dist/solvers/types/generated/rasa-solver.js +8 -2
- package/dist/solvers/types/generated/rasa-solver.js.map +1 -1
- package/package.json +3 -3
|
@@ -5,7 +5,7 @@ import { SolverSymbol, SymbolStateFilter, SymbolValidityFilter } from './types.j
|
|
|
5
5
|
* Parameters for {@link getSymbols}.
|
|
6
6
|
*/
|
|
7
7
|
export type GetSymbolsParameters = Compute<ReadSolverParameter & {
|
|
8
|
-
/**
|
|
8
|
+
/** Explicit page size (solver max 500, default 100). Omit both limit and offset to read all pages. */
|
|
9
9
|
limit?: number;
|
|
10
10
|
/** Row offset for pagination (default 0). */
|
|
11
11
|
offset?: number;
|
|
@@ -30,7 +30,8 @@ export type GetSymbolsReturnType = SolverSymbol[];
|
|
|
30
30
|
* Fetch the tradable symbol catalogue from the chain's solver `/symbols`
|
|
31
31
|
* endpoint. Returns a normalized {@link SolverSymbol} per row — id, name,
|
|
32
32
|
* precisions, leverage, fees, and per-side trading state — filtered and paged by
|
|
33
|
-
* the given `parameters`.
|
|
33
|
+
* the given `parameters`. With neither `limit` nor `offset`, reads every page
|
|
34
|
+
* in server order. Supplying either retains explicit single-page behavior. The solver base URL is resolved from `config` per call,
|
|
34
35
|
* so multiple chains never clobber each other.
|
|
35
36
|
*
|
|
36
37
|
* `/symbols` is an **Enigma-only** endpoint; the action asserts the resolved
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-symbols.d.ts","sourceRoot":"","sources":["../../../src/solvers/symbols/get-symbols.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAIlF,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAErF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,CACxC,mBAAmB,GAAG;IACpB,
|
|
1
|
+
{"version":3,"file":"get-symbols.d.ts","sourceRoot":"","sources":["../../../src/solvers/symbols/get-symbols.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAIlF,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAErF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,CACxC,mBAAmB,GAAG;IACpB,sGAAsG;IACtG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,sCAAsC;IACtC,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,uCAAuC;IACvC,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC,CACF,CAAC;AAEF,+DAA+D;AAC/D,MAAM,MAAM,oBAAoB,GAAG,YAAY,EAAE,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,GAAE,oBAAyB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAcrH"}
|
|
@@ -9,11 +9,21 @@ async function o(e, t = {}) {
|
|
|
9
9
|
chainId: t.chainId,
|
|
10
10
|
solverId: t.solverId
|
|
11
11
|
});
|
|
12
|
-
|
|
12
|
+
if (r(n, "enigma", "getSymbols"), t.limit !== void 0 || t.offset !== void 0) return (await s(n.url, t)).symbols;
|
|
13
|
+
let i = [];
|
|
14
|
+
for (let e = 0;; e += 500) {
|
|
15
|
+
let r = await s(n.url, {
|
|
16
|
+
...t,
|
|
17
|
+
limit: 500,
|
|
18
|
+
offset: e
|
|
19
|
+
});
|
|
20
|
+
if (i.push(...r.symbols), r.rawCount < 500) break;
|
|
21
|
+
}
|
|
22
|
+
return i;
|
|
13
23
|
}
|
|
14
24
|
async function s(r, o) {
|
|
15
25
|
try {
|
|
16
|
-
|
|
26
|
+
let e = (await n({
|
|
17
27
|
limit: o.limit,
|
|
18
28
|
offset: o.offset,
|
|
19
29
|
symbol_id: o.symbolId,
|
|
@@ -23,7 +33,11 @@ async function s(r, o) {
|
|
|
23
33
|
is_valid: o.isValid,
|
|
24
34
|
state_long: o.stateLong,
|
|
25
35
|
state_short: o.stateShort
|
|
26
|
-
}, { baseURL: r })).data.symbols ?? []
|
|
36
|
+
}, { baseURL: r })).data.symbols ?? [];
|
|
37
|
+
return {
|
|
38
|
+
symbols: i(e),
|
|
39
|
+
rawCount: e.length
|
|
40
|
+
};
|
|
27
41
|
} catch (n) {
|
|
28
42
|
throw n instanceof t ? n : a(n) ? e.fromAxios(n, {
|
|
29
43
|
code: "FETCH_SYMBOLS_FAILED",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-symbols.js","names":[],"sources":["../../../src/solvers/symbols/get-symbols.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 { assertSolverKind } from \"../assert-solver-kind\";\nimport { getSymbols as requestSymbols } from \"../types/generated/enigma-solver\";\nimport { toSolverSymbols } from \"./to-solver-symbol\";\nimport type { SolverSymbol, SymbolStateFilter, SymbolValidityFilter } from \"./types\";\n\n/**\n * Parameters for {@link getSymbols}.\n */\nexport type GetSymbolsParameters = Compute<\n ReadSolverParameter & {\n /**
|
|
1
|
+
{"version":3,"file":"get-symbols.js","names":[],"sources":["../../../src/solvers/symbols/get-symbols.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 { assertSolverKind } from \"../assert-solver-kind\";\nimport { getSymbols as requestSymbols } from \"../types/generated/enigma-solver\";\nimport { toSolverSymbols } from \"./to-solver-symbol\";\nimport type { SolverSymbol, SymbolStateFilter, SymbolValidityFilter } from \"./types\";\n\n/**\n * Parameters for {@link getSymbols}.\n */\nexport type GetSymbolsParameters = Compute<\n ReadSolverParameter & {\n /** Explicit page size (solver max 500, default 100). Omit both limit and offset to read all pages. */\n limit?: number;\n /** Row offset for pagination (default 0). */\n offset?: number;\n /** Restrict to a single symbol by its numeric id. */\n symbolId?: number;\n /** Case-insensitive substring match on the symbol name. */\n search?: string;\n /** Exact-match filter on the base asset. */\n asset?: string;\n /** Exact-match filter on the collateral token address. */\n tokenAddress?: string;\n /** Validity filter; the solver defaults to `\"true\"` (valid symbols only). */\n isValid?: SymbolValidityFilter;\n /** Long-side trading-state filter. */\n stateLong?: SymbolStateFilter;\n /** Short-side trading-state filter. */\n stateShort?: SymbolStateFilter;\n }\n>;\n\n/** Return type of {@link getSymbols}: one entry per symbol. */\nexport type GetSymbolsReturnType = SolverSymbol[];\n\n/**\n * Fetch the tradable symbol catalogue from the chain's solver `/symbols`\n * endpoint. Returns a normalized {@link SolverSymbol} per row — id, name,\n * precisions, leverage, fees, and per-side trading state — filtered and paged by\n * the given `parameters`. With neither `limit` nor `offset`, reads every page\n * in server order. Supplying either retains explicit single-page behavior. The solver base URL is resolved from `config` per call,\n * so multiple chains never clobber each other.\n *\n * `/symbols` is an **Enigma-only** endpoint; the action asserts the resolved\n * solver is an `enigma` solver and throws before hitting the wire otherwise.\n *\n * @param config - The SDK config.\n * @param parameters - Optional chain id, solver id, and `/symbols` filters.\n * @returns Normalized symbols, one {@link SolverSymbol} per row.\n * @throws {SymmApiError} when the API request fails.\n * @throws {SymmError} `UNSUPPORTED_BY_SOLVER` when the resolved solver is not an `enigma` solver, or when the chain is unsupported.\n *\n * @example\n * ```ts\n * const symbols = await getSymbols(config, { search: \"BTC\" });\n * const btc = symbols.find((s) => s.name === \"BTCUSDT\");\n * console.log(btc?.maxLeverage);\n * ```\n */\nexport async function getSymbols(config: Config, parameters: GetSymbolsParameters = {}): Promise<GetSymbolsReturnType> {\n const solver = config.getSolver({ chainId: parameters.chainId, solverId: parameters.solverId });\n assertSolverKind(solver, \"enigma\", \"getSymbols\");\n if (parameters.limit !== undefined || parameters.offset !== undefined) {\n return (await fetchSymbols(solver.url, parameters)).symbols;\n }\n const result: SolverSymbol[] = [];\n const pageSize = 500;\n for (let offset = 0; ; offset += pageSize) {\n const page = await fetchSymbols(solver.url, { ...parameters, limit: pageSize, offset });\n result.push(...page.symbols);\n if (page.rawCount < pageSize) break;\n }\n return result;\n}\n\n/**\n * Call the solver's `/symbols` endpoint with a per-call base URL, mapping the\n * SDK's camelCase filters onto the generated snake_case query params, and\n * normalize the response rows into the SDK's stable array.\n *\n * @internal\n */\nasync function fetchSymbols(\n baseURL: string,\n parameters: GetSymbolsParameters,\n): Promise<{ symbols: SolverSymbol[]; rawCount: number }> {\n try {\n const response = await requestSymbols(\n {\n limit: parameters.limit,\n offset: parameters.offset,\n symbol_id: parameters.symbolId,\n search: parameters.search,\n asset: parameters.asset,\n token_address: parameters.tokenAddress,\n is_valid: parameters.isValid,\n state_long: parameters.stateLong,\n state_short: parameters.stateShort,\n },\n { baseURL },\n );\n const rows = response.data.symbols ?? [];\n return { symbols: toSolverSymbols(rows), rawCount: rows.length };\n } catch (err) {\n if (err instanceof SymmError) throw err;\n\n if (isAxiosError(err)) {\n throw SymmApiError.fromAxios(err, { code: \"FETCH_SYMBOLS_FAILED\", baseURL });\n }\n\n throw new SymmError(\n \"api\",\n \"FETCH_SYMBOLS_FAILED\",\n `Failed to fetch symbols: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err instanceof Error ? err : undefined },\n );\n }\n}\n"],"mappings":";;;;;;AA8DA,eAAsB,EAAW,GAAgB,IAAmC,CAAC,GAAkC;CACrH,IAAM,IAAS,EAAO,UAAU;EAAE,SAAS,EAAW;EAAS,UAAU,EAAW;CAAS,CAAC;CAE9F,IADA,EAAiB,GAAQ,UAAU,YAAY,GAC3C,EAAW,UAAU,KAAA,KAAa,EAAW,WAAW,KAAA,GAC1D,QAAQ,MAAM,EAAa,EAAO,KAAK,CAAU,GAAG;CAEtD,IAAM,IAAyB,CAAC;CAEhC,KAAK,IAAI,IAAS,IAAK,KAAU,KAAU;EACzC,IAAM,IAAO,MAAM,EAAa,EAAO,KAAK;GAAE,GAAG;GAAY,OAAO;GAAU;EAAO,CAAC;EAEtF,IADA,EAAO,KAAK,GAAG,EAAK,OAAO,GACvB,EAAK,WAAW,KAAU;CAChC;CACA,OAAO;AACT;AASA,eAAe,EACb,GACA,GACwD;CACxD,IAAI;EAeF,IAAM,KAAO,MAdU,EACrB;GACE,OAAO,EAAW;GAClB,QAAQ,EAAW;GACnB,WAAW,EAAW;GACtB,QAAQ,EAAW;GACnB,OAAO,EAAW;GAClB,eAAe,EAAW;GAC1B,UAAU,EAAW;GACrB,YAAY,EAAW;GACvB,aAAa,EAAW;EAC1B,GACA,EAAE,WAAQ,CACZ,GACsB,KAAK,WAAW,CAAC;EACvC,OAAO;GAAE,SAAS,EAAgB,CAAI;GAAG,UAAU,EAAK;EAAO;CACjE,SAAS,GAAK;EAOZ,MANI,aAAe,IAAiB,IAEhC,EAAa,CAAG,IACZ,EAAa,UAAU,GAAK;GAAE,MAAM;GAAwB;EAAQ,CAAC,IAGvE,IAAI,EACR,OACA,wBACA,4BAA4B,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG,KAC3E,EAAE,OAAO,aAAe,QAAQ,IAAM,KAAA,EAAU,CAClD;CACF;AACF"}
|
|
@@ -13,7 +13,8 @@ export type GetTradeVolumeReturnType = SolverDailyVolume[];
|
|
|
13
13
|
/**
|
|
14
14
|
* Fetch the last N daily trade-volume rows for one market from the chain's
|
|
15
15
|
* enigma solver `/trade-volume/{symbol_id}` endpoint. Rows are returned in
|
|
16
|
-
* ascending day order.
|
|
16
|
+
* ascending day order. Malformed rows (invalid timestamp or absent/non-numeric
|
|
17
|
+
* volume) are omitted, while genuine zero-volume observations are retained. The solver base URL is resolved from `config` per call,
|
|
17
18
|
* so multiple chains never clobber each other.
|
|
18
19
|
*
|
|
19
20
|
* `/trade-volume/{symbol_id}` is an **Enigma-only** endpoint; the action asserts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-trade-volume.d.ts","sourceRoot":"","sources":["../../../src/solvers/trade-volume/get-trade-volume.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAIlF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAC5C,mBAAmB,GAAG;IACpB,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;CAClB,CACF,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,EAAE,CAAC;AAE3D
|
|
1
|
+
{"version":3,"file":"get-trade-volume.d.ts","sourceRoot":"","sources":["../../../src/solvers/trade-volume/get-trade-volume.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAIlF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAC5C,mBAAmB,GAAG;IACpB,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;CAClB,CACF,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,EAAE,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,wBAAwB,GACnC,OAAO,CAAC,wBAAwB,CAAC,CAInC"}
|
|
@@ -13,7 +13,8 @@ async function o(e, t) {
|
|
|
13
13
|
}
|
|
14
14
|
async function s(r, o) {
|
|
15
15
|
try {
|
|
16
|
-
|
|
16
|
+
let e = await n(o, { baseURL: r });
|
|
17
|
+
return (Array.isArray(e.data) ? e.data : []).filter(c).map(i);
|
|
17
18
|
} catch (n) {
|
|
18
19
|
throw n instanceof t ? n : a(n) ? e.fromAxios(n, {
|
|
19
20
|
code: "FETCH_TRADE_VOLUME_FAILED",
|
|
@@ -21,6 +22,10 @@ async function s(r, o) {
|
|
|
21
22
|
}) : new t("api", "FETCH_TRADE_VOLUME_FAILED", `Failed to fetch trade volume: ${n instanceof Error ? n.message : String(n)}`, { cause: n instanceof Error ? n : void 0 });
|
|
22
23
|
}
|
|
23
24
|
}
|
|
25
|
+
function c(e) {
|
|
26
|
+
let t = e?.timestamp, n = e?.volume;
|
|
27
|
+
return typeof t == "string" && t.trim().length > 0 && Number.isFinite(Date.parse(t)) && typeof n == "string" && n.trim().length > 0 && Number.isFinite(Number(n));
|
|
28
|
+
}
|
|
24
29
|
//#endregion
|
|
25
30
|
export { o as getTradeVolume };
|
|
26
31
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-trade-volume.js","names":[],"sources":["../../../src/solvers/trade-volume/get-trade-volume.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 { assertSolverKind } from \"../assert-solver-kind\";\nimport { getTradeVolumeSymbolId } from \"../types/generated/enigma-solver\";\nimport { toSolverDailyVolume } from \"./to-daily-volume\";\nimport type { SolverDailyVolume } from \"./types\";\n\n/**\n * Parameters for {@link getTradeVolume}.\n */\nexport type GetTradeVolumeParameters = Compute<\n ReadSolverParameter & {\n /** Solver market id (`symbol_id`) to read daily trade volume for. Required. */\n symbolId: number;\n }\n>;\n\n/** Return type of {@link getTradeVolume}: one entry per day, ascending. */\nexport type GetTradeVolumeReturnType = SolverDailyVolume[];\n\n/**\n * Fetch the last N daily trade-volume rows for one market from the chain's\n * enigma solver `/trade-volume/{symbol_id}` endpoint. Rows are returned in\n * ascending day order. The solver base URL is resolved from `config` per call,\n * so multiple chains never clobber each other.\n *\n * `/trade-volume/{symbol_id}` is an **Enigma-only** endpoint; the action asserts\n * the resolved solver is an `enigma` solver and throws before hitting the wire\n * otherwise.\n *\n * @param config - The SDK config.\n * @param parameters - The required `symbolId` plus optional chain id / solver.\n * @returns Normalized daily volume, one {@link SolverDailyVolume} per day.\n * @throws {SymmApiError} when the API request fails.\n * @throws {SymmError} `UNSUPPORTED_BY_SOLVER` when the resolved solver is not an `enigma` solver, or when the chain is unsupported.\n *\n * @example\n * ```ts\n * const volume = await getTradeVolume(config, { symbolId: 1 });\n * const latest = volume.at(-1);\n * console.log(latest?.volume); // notional traded on the most recent day\n * ```\n */\nexport async function getTradeVolume(\n config: Config,\n parameters: GetTradeVolumeParameters,\n): Promise<GetTradeVolumeReturnType> {\n const solver = config.getSolver({ chainId: parameters.chainId, solverId: parameters.solverId });\n assertSolverKind(solver, \"enigma\", \"getTradeVolume\");\n return fetchTradeVolume(solver.url, parameters.symbolId);\n}\n\n/**\n * Call the solver's `/trade-volume/{symbol_id}` endpoint with a per-call base URL\n * and map each raw daily row into the SDK's normalized array.\n *\n * @internal\n */\nasync function fetchTradeVolume(baseURL: string, symbolId: number): Promise<SolverDailyVolume[]> {\n try {\n const response = await getTradeVolumeSymbolId(symbolId, { baseURL });\n
|
|
1
|
+
{"version":3,"file":"get-trade-volume.js","names":[],"sources":["../../../src/solvers/trade-volume/get-trade-volume.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 { assertSolverKind } from \"../assert-solver-kind\";\nimport { getTradeVolumeSymbolId, type ApiDailyTradeVolumeResponse } from \"../types/generated/enigma-solver\";\nimport { toSolverDailyVolume } from \"./to-daily-volume\";\nimport type { SolverDailyVolume } from \"./types\";\n\n/**\n * Parameters for {@link getTradeVolume}.\n */\nexport type GetTradeVolumeParameters = Compute<\n ReadSolverParameter & {\n /** Solver market id (`symbol_id`) to read daily trade volume for. Required. */\n symbolId: number;\n }\n>;\n\n/** Return type of {@link getTradeVolume}: one entry per day, ascending. */\nexport type GetTradeVolumeReturnType = SolverDailyVolume[];\n\n/**\n * Fetch the last N daily trade-volume rows for one market from the chain's\n * enigma solver `/trade-volume/{symbol_id}` endpoint. Rows are returned in\n * ascending day order. Malformed rows (invalid timestamp or absent/non-numeric\n * volume) are omitted, while genuine zero-volume observations are retained. The solver base URL is resolved from `config` per call,\n * so multiple chains never clobber each other.\n *\n * `/trade-volume/{symbol_id}` is an **Enigma-only** endpoint; the action asserts\n * the resolved solver is an `enigma` solver and throws before hitting the wire\n * otherwise.\n *\n * @param config - The SDK config.\n * @param parameters - The required `symbolId` plus optional chain id / solver.\n * @returns Normalized daily volume, one {@link SolverDailyVolume} per day.\n * @throws {SymmApiError} when the API request fails.\n * @throws {SymmError} `UNSUPPORTED_BY_SOLVER` when the resolved solver is not an `enigma` solver, or when the chain is unsupported.\n *\n * @example\n * ```ts\n * const volume = await getTradeVolume(config, { symbolId: 1 });\n * const latest = volume.at(-1);\n * console.log(latest?.volume); // notional traded on the most recent day\n * ```\n */\nexport async function getTradeVolume(\n config: Config,\n parameters: GetTradeVolumeParameters,\n): Promise<GetTradeVolumeReturnType> {\n const solver = config.getSolver({ chainId: parameters.chainId, solverId: parameters.solverId });\n assertSolverKind(solver, \"enigma\", \"getTradeVolume\");\n return fetchTradeVolume(solver.url, parameters.symbolId);\n}\n\n/**\n * Call the solver's `/trade-volume/{symbol_id}` endpoint with a per-call base URL\n * and map each raw daily row into the SDK's normalized array.\n *\n * @internal\n */\nasync function fetchTradeVolume(baseURL: string, symbolId: number): Promise<SolverDailyVolume[]> {\n try {\n const response = await getTradeVolumeSymbolId(symbolId, { baseURL });\n const rows = Array.isArray(response.data) ? response.data : [];\n return rows.filter(isValidDailyVolume).map(toSolverDailyVolume);\n } catch (err) {\n if (err instanceof SymmError) throw err;\n\n if (isAxiosError(err)) {\n throw SymmApiError.fromAxios(err, { code: \"FETCH_TRADE_VOLUME_FAILED\", baseURL });\n }\n\n throw new SymmError(\n \"api\",\n \"FETCH_TRADE_VOLUME_FAILED\",\n `Failed to fetch trade volume: ${err instanceof Error ? err.message : String(err)}`,\n { cause: err instanceof Error ? err : undefined },\n );\n }\n}\n\n/** Validate wire observations before the public mapper applies its legacy defaults. */\nfunction isValidDailyVolume(raw: ApiDailyTradeVolumeResponse | null | undefined): raw is SolverDailyVolume {\n const timestamp = raw?.timestamp;\n const volume = raw?.volume;\n return (\n typeof timestamp === \"string\" &&\n timestamp.trim().length > 0 &&\n Number.isFinite(Date.parse(timestamp)) &&\n typeof volume === \"string\" &&\n volume.trim().length > 0 &&\n Number.isFinite(Number(volume))\n );\n}\n"],"mappings":";;;;;;AA8CA,eAAsB,EACpB,GACA,GACmC;CACnC,IAAM,IAAS,EAAO,UAAU;EAAE,SAAS,EAAW;EAAS,UAAU,EAAW;CAAS,CAAC;CAE9F,OADA,EAAiB,GAAQ,UAAU,gBAAgB,GAC5C,EAAiB,EAAO,KAAK,EAAW,QAAQ;AACzD;AAQA,eAAe,EAAiB,GAAiB,GAAgD;CAC/F,IAAI;EACF,IAAM,IAAW,MAAM,EAAuB,GAAU,EAAE,WAAQ,CAAC;EAEnE,QADa,MAAM,QAAQ,EAAS,IAAI,IAAI,EAAS,OAAO,CAAC,GACjD,OAAO,CAAkB,EAAE,IAAI,CAAmB;CAChE,SAAS,GAAK;EAOZ,MANI,aAAe,IAAiB,IAEhC,EAAa,CAAG,IACZ,EAAa,UAAU,GAAK;GAAE,MAAM;GAA6B;EAAQ,CAAC,IAG5E,IAAI,EACR,OACA,6BACA,iCAAiC,aAAe,QAAQ,EAAI,UAAU,OAAO,CAAG,KAChF,EAAE,OAAO,aAAe,QAAQ,IAAM,KAAA,EAAU,CAClD;CACF;AACF;AAGA,SAAS,EAAmB,GAA+E;CACzG,IAAM,IAAY,GAAK,WACjB,IAAS,GAAK;CACpB,OACE,OAAO,KAAc,YACrB,EAAU,KAAK,EAAE,SAAS,KAC1B,OAAO,SAAS,KAAK,MAAM,CAAS,CAAC,KACrC,OAAO,KAAW,YAClB,EAAO,KAAK,EAAE,SAAS,KACvB,OAAO,SAAS,OAAO,CAAM,CAAC;AAElC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ApiDailyTradeVolumeResponse } from '../types/generated/enigma-solver.js';
|
|
2
2
|
import { SolverDailyVolume } from './types.js';
|
|
3
3
|
/**
|
|
4
|
-
* Map one
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
4
|
+
* Map one daily observation, preserving the existing missing-field defaults.
|
|
5
|
+
* This mapper does not validate rows; getTradeVolume filters malformed input first.
|
|
6
|
+
* @param raw - One raw daily-volume object from the solver.
|
|
7
|
+
* @returns A row with unchanged strings; missing timestamp/volume default to ""/"0".
|
|
8
|
+
* @throws Does not throw for inputs matching the declared type.
|
|
9
|
+
* @example toSolverDailyVolume({ timestamp: "2026-10-17T00:00:00Z", volume: "0" });
|
|
10
10
|
*/
|
|
11
11
|
export declare function toSolverDailyVolume(raw: ApiDailyTradeVolumeResponse): SolverDailyVolume;
|
|
12
12
|
//# sourceMappingURL=to-daily-volume.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-daily-volume.js","names":[],"sources":["../../../src/solvers/trade-volume/to-daily-volume.ts"],"sourcesContent":["import type { ApiDailyTradeVolumeResponse } from \"../types/generated/enigma-solver\";\nimport type { SolverDailyVolume } from \"./types\";\n\n/**\n * Map one
|
|
1
|
+
{"version":3,"file":"to-daily-volume.js","names":[],"sources":["../../../src/solvers/trade-volume/to-daily-volume.ts"],"sourcesContent":["import type { ApiDailyTradeVolumeResponse } from \"../types/generated/enigma-solver\";\nimport type { SolverDailyVolume } from \"./types\";\n\n/**\n * Map one daily observation, preserving the existing missing-field defaults.\n * This mapper does not validate rows; getTradeVolume filters malformed input first.\n * @param raw - One raw daily-volume object from the solver.\n * @returns A row with unchanged strings; missing timestamp/volume default to \"\"/\"0\".\n * @throws Does not throw for inputs matching the declared type.\n * @example toSolverDailyVolume({ timestamp: \"2026-10-17T00:00:00Z\", volume: \"0\" });\n */\nexport function toSolverDailyVolume(raw: ApiDailyTradeVolumeResponse): SolverDailyVolume {\n return {\n timestamp: raw.timestamp ?? \"\",\n volume: raw.volume ?? \"0\",\n };\n}\n"],"mappings":";AAWA,SAAgB,EAAoB,GAAqD;CACvF,OAAO;EACL,WAAW,EAAI,aAAa;EAC5B,QAAQ,EAAI,UAAU;CACxB;AACF"}
|
|
@@ -9,12 +9,13 @@
|
|
|
9
9
|
export interface SolverDailyVolume {
|
|
10
10
|
/**
|
|
11
11
|
* The day bucket, as the ISO 8601 datetime string the solver reports (e.g.
|
|
12
|
-
* `"2026-07-09T00:00:00Z"`, midnight UTC on the bucket's day).
|
|
13
|
-
*
|
|
12
|
+
* `"2026-07-09T00:00:00Z"`, midnight UTC on the bucket's day). getTradeVolume
|
|
13
|
+
* omits rows with missing or invalid timestamps; direct toSolverDailyVolume
|
|
14
|
+
* calls retain the empty-string fallback. Parse with `new Date(timestamp)` to render;
|
|
14
15
|
* ISO 8601 also sorts correctly as a plain string.
|
|
15
16
|
*/
|
|
16
17
|
timestamp: string;
|
|
17
|
-
/**
|
|
18
|
+
/** Decimal volume, unchanged. getTradeVolume omits missing values; direct mapper calls default them to "0". */
|
|
18
19
|
volume: string;
|
|
19
20
|
}
|
|
20
21
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/solvers/trade-volume/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/solvers/trade-volume/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,+GAA+G;IAC/G,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -6,7 +6,7 @@ var t = (t) => e.get("/contract-symbols", t), n = (t) => e.get("/error_codes", t
|
|
|
6
6
|
...t,
|
|
7
7
|
...n?.params
|
|
8
8
|
}
|
|
9
|
-
}), i = (t, n) => e.get("/
|
|
9
|
+
}), i = (t, n) => e.get("/funding-info", {
|
|
10
10
|
...n,
|
|
11
11
|
params: {
|
|
12
12
|
...t,
|
|
@@ -18,7 +18,7 @@ var t = (t) => e.get("/contract-symbols", t), n = (t) => e.get("/error_codes", t
|
|
|
18
18
|
...n,
|
|
19
19
|
...r?.params
|
|
20
20
|
}
|
|
21
|
-
}), o = (t) => e.get("/
|
|
21
|
+
}), o = (t) => e.get("/info", t), s = (t, n) => e.get(`/instant_close/${t}`, n), c = (t, n) => e.get(`/instant_open/${t}`, n), l = (t, n) => e.get(`/instant_quote_id/${t}`, n), u = (t, n) => e.post("/instant_trade/instant_close", t, n), d = (t, n) => e.post("/instant_trade/instant_open", t, n), f = (t) => e.get("/market-info", t), p = (t, n) => e.get("/notional_cap", {
|
|
22
22
|
...n,
|
|
23
23
|
params: {
|
|
24
24
|
...t,
|
|
@@ -44,6 +44,6 @@ var t = (t) => e.get("/contract-symbols", t), n = (t) => e.get("/error_codes", t
|
|
|
44
44
|
}
|
|
45
45
|
}), v = (t, n) => e.get(`/trade-volume/${t}`, n);
|
|
46
46
|
//#endregion
|
|
47
|
-
export { t as getContractSymbols, n as getErrorCodes, r as getEstimatedPrice, i as
|
|
47
|
+
export { t as getContractSymbols, n as getErrorCodes, r as getEstimatedPrice, i as getFundingInfo, a as getGetLockedParamsSymbol, o as getInfo, s as getInstantCloseAccountAddress, c as getInstantOpenAccountAddress, l as getInstantQuoteIdTempQuoteId, f as getMarketInfo, p as getNotionalCap, m as getNotionalCapSymbolId, h as getRevenueRecords, g as getRevenueSymbolId, _ as getSymbols, v as getTradeVolumeSymbolId, u as postInstantTradeInstantClose, d as postInstantTradeInstantOpen };
|
|
48
48
|
|
|
49
49
|
//# sourceMappingURL=enigma-solver.js.map
|
|
@@ -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,GAoBU,KACX,GACA,MAEO,EAAM,IAAI,qBAAqB;CACpC,GAAG;CACH,QAAQ;EAAE,GAAG;EAAQ,GAAG,GAAS;CAAO;AAC1C,CAAC,GAMU,KACX,GACA,GACA,MAEO,EAAM,IAAI,sBAAsB,KAAU;CAC/C,GAAG;CACH,QAAQ;EAAE,GAAG;EAAQ,GAAG,GAAS;CAAO;AAC1C,CAAC,GAQU,KAAoB,MACxB,EAAM,IAAI,oBAAoB,CAAO,GAQjC,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,GAetE,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}\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,7 +1,13 @@
|
|
|
1
1
|
import e from "axios";
|
|
2
2
|
//#region src/solvers/types/generated/rasa-solver.ts
|
|
3
|
-
var t = (t) => e.get("/contract-symbols", t), n = (t) => e.get("/open-interest", t), r = (t, n, r, i) => e.post(`/position-state/${t}/${n}`, r, i), i = (t, n) => e.get(`/notional_cap/${t}`, n), a = (t, n) => e.get(`/price-range/${t}`, n), o = (t, n) => e.get(`/error_codes/${t}`, n), s = (t) => e.get("/get_market_info", t), c = (t, n) => e.get(`/partyA_upnl/${t}`, { ...n }), l = (t, n, r) => e.get(`/get_balance_info/${t}/${n}`, r), u = (t
|
|
3
|
+
var t = (t) => e.get("/contract-symbols", t), n = (t) => e.get("/open-interest", t), r = (t, n, r, i) => e.post(`/position-state/${t}/${n}`, r, i), i = (t, n) => e.get(`/notional_cap/${t}`, n), a = (t, n) => e.get(`/price-range/${t}`, n), o = (t, n) => e.get(`/error_codes/${t}`, n), s = (t) => e.get("/get_market_info", t), c = (t, n) => e.get(`/partyA_upnl/${t}`, { ...n }), l = (t, n, r) => e.get(`/get_balance_info/${t}/${n}`, r), u = (t, n) => e.get("/get_funding_info", {
|
|
4
|
+
...n,
|
|
5
|
+
params: {
|
|
6
|
+
...t,
|
|
7
|
+
...n?.params
|
|
8
|
+
}
|
|
9
|
+
}), d = (t) => e.get("/readyz", t), f = (t, n) => e.get(`/instant_open/${t}`, n), p = (t, n) => e.post("/instant_trade/open", t, n), m = (t, n) => e.post("/instant_trade/close", t, n);
|
|
4
10
|
//#endregion
|
|
5
|
-
export { l as getBalanceInfoGetBalanceInfoAddressMultiAccountAddressGet, t as getContractSymbolsContractSymbolsGet, c as getCounterpartyUpnlPartyAUpnlAddressGet, o as getErrorMessageErrorCodesErrorCodeGet,
|
|
11
|
+
export { l as getBalanceInfoGetBalanceInfoAddressMultiAccountAddressGet, t as getContractSymbolsContractSymbolsGet, c as getCounterpartyUpnlPartyAUpnlAddressGet, o as getErrorMessageErrorCodesErrorCodeGet, u as getFundingInfoGetFundingInfoGet, f as getInstantRequestForQuotesInstantOpenAccountAddressGet, s as getMarketInfoGetMarketInfoGet, i as getNotionalCapNotionalCapSymbolIdGet, n as getOpenInterestOpenInterestGet, a as getSymbolPriceRangePriceRangeSymbolGet, p as instantRequestForQuoteWithSignatureInstantTradeOpenPost, m as instantRequestToCloseWithSignatureInstantTradeClosePost, d as readyCheckReadyzGet, r as searchPositionStatePositionStateStartSizePost };
|
|
6
12
|
|
|
7
13
|
//# sourceMappingURL=rasa-solver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rasa-solver.js","names":[],"sources":["../../../../src/solvers/types/generated/rasa-solver.ts"],"sourcesContent":["/**\n * Generated by orval v8.14.0 🍺\n * Do not edit manually.\n * Hedger Parameters Web App\n * FastAPI project for setting hedger parameter\n * # WebSocket API Documentation\n *\n * This document describes the available WebSocket routes, parameters, and response formats for the market data services.\n *\n * ---\n *\n * ## WebSocket Routes\n *\n * ### 1. `/funding-rate`\n *\n * **Purpose**: Provides funding rate information for specified symbols.\n *\n * **Request Parameters (sent through WebSocket message)**:\n * - `symbol_ids`: List[int] (optional) - List of symbol IDs to subscribe.\n * - `symbols`: List[str] (optional) - List of symbol names to subscribe.\n *\n * **Response Payload**:\n * A dictionary keyed by symbol_id (if input was symbol_ids) or by symbol_title (if input was symbols). Each entry contains the following fields:\n * - `next_funding_time` (str, ISO 8601): Timestamp of the next funding event.\n * - `next_funding_rate_short` (str): Funding rate to be paid by short positions.\n * - `next_funding_rate_long` (str): Funding rate to be paid by long positions.\n * - `funding_rate_epoch_duration` (int): Interval in seconds between funding events (e.g., 28800 = 8 hours).\n *\n * Aggregated totals:\n * - `tc` (Decimal): Total cap\n * - `uc` (Decimal): Used cap\n *\n * **Notes**:\n * - Data is refreshed at 1-second intervals.\n * - Automatically handles disconnection cases.\n *\n * ---\n *\n * ### 2. `/available-quote`\n *\n * **Purpose**: Provides available quote (order book) information for a specified symbol.\n *\n * **Request Parameters (sent through WebSocket message)**:\n * - `symbol_id`: int (required) - Symbol ID to retrieve the quote for.\n * - `limit`: int (optional) - Number of data entries to limit (default 500).\n *\n * **Response Payload**:\n * - `timestamp` (int): Timestamp of the transaction\n * - `asks` (List[List[Decimal]]): List of asks (each entry: [price, quantity])\n * - `bids` (List[List[Decimal]]): List of bids (each entry: [price, quantity])\n *\n * **Validation**:\n * - Symbol ID must be valid; otherwise, an error message with error code `EC_310` `invalid symbol_id` is sent and the WebSocket connection is closed.\n *\n * **Notes**:\n * - Data is refreshed at 1-second intervals.\n * - Automatically handles disconnection and invalid input cases.\n *\n *\n * OpenAPI spec version: 0.1.0\n */\nimport type { AxiosRequestConfig, AxiosResponse } from \"axios\";\nimport axios from \"axios\";\n\nexport interface Account {\n /** @pattern 0x[0-9a-fA-F]{40} */\n addr: string;\n isPartyB?: boolean;\n}\n\nexport interface UpnlData {\n upnl: string | null;\n notional: string | null;\n timestamp: number;\n allocated_balance: string;\n cva: string;\n lf: string;\n party_a_mm: string;\n party_b_mm: string;\n pending_cva: string;\n pending_lf: string;\n pending_party_a_mm: string;\n pending_party_b_mm: string;\n}\n\nexport interface BothUpnlData {\n party_a: UpnlData | null;\n party_b: UpnlData | null;\n}\n\nexport type BalanceInfoResponseSchema = BothUpnlData[];\n\nexport interface ReplayAttackHeader {\n /** @minimum 0 */\n nonce: number;\n /** @minimum 0 */\n deadline: number;\n salt: string;\n}\n\nexport interface SignedOperation {\n /** @pattern 0x[0-9a-fA-F]{40} */\n signer: string;\n /** @pattern 0x[0-9a-fA-F]{40} */\n target: string;\n callData: string;\n signerAccount: Account;\n replayAttackHeader: ReplayAttackHeader;\n}\n\nexport interface InstantOperation {\n signedOperation: SignedOperation;\n signature: string;\n}\n\nexport interface BodyInstantRequestForQuoteWithSignatureInstantTradeOpenPost {\n sendQuote: InstantOperation;\n addMargin?: InstantOperation;\n}\n\nexport interface ErrorCodeResponseSchema {\n [key: string]: string;\n}\n\nexport interface ErrorResponseModel {\n error_code?: number;\n error_message?: string;\n error_detail?: unknown[] | null;\n}\n\nexport interface FailedNotificationData {\n action?: string | null;\n order_type?: number | null;\n error_code: number;\n failure_type?: string | null;\n action_status?: string;\n}\n\nexport interface FundingInfoResponseSchema {\n next_funding_time: number;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n next_funding_rate_short: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n next_funding_rate_long: string;\n funding_rate_epoch_duration: number;\n}\n\nexport interface GetInstantQuoteResponse {\n quote_id: number;\n}\n\nexport interface ValidationError {\n loc: (string | number)[];\n msg: string;\n type: string;\n}\n\nexport interface HTTPValidationError {\n detail?: ValidationError[];\n}\n\nexport interface InstantCloseSchema {\n quote_id: number;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n quantity_to_close: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n close_price: string;\n}\n\nexport enum PositionType {\n NUMBER_0 = 0,\n NUMBER_1 = 1,\n}\nexport enum OrderType {\n NUMBER_0 = 0,\n NUMBER_1 = 1,\n}\nexport interface InstantRFQResponse {\n position_type: PositionType;\n temp_quote_id: number;\n symbol_id: number;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n requested_open_price: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n quantity: string;\n party_a_address: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n cva: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n partyAmm: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n partyBmm: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n lf: string;\n order_type: OrderType;\n}\n\nexport interface InstantRequestForQuote {\n symbolId: number;\n positionType: PositionType;\n orderType: OrderType;\n price: number | string;\n quantity: number | string;\n cva: number | string;\n lf: number | string;\n partyAmm: number | string;\n partyBmm: number | string;\n maxFundingRate: number;\n deadline: number;\n}\n\nexport interface InstantRequestToClose {\n quote_id: number;\n quantity_to_close: number | string;\n close_price: number | string;\n deadline?: number | null;\n order_type?: OrderType | null;\n}\n\nexport interface LockedParamsResponseSchema {\n cva: string;\n partyAmm: string;\n lf: string;\n leverage: string;\n partyBmm: string;\n}\n\nexport interface Login {\n /** @pattern 0x[0-9a-fA-F]{40} */\n account_address: string;\n nonce: string;\n expiration_time: string;\n issued_at: string;\n signature: string;\n}\n\nexport interface MarketInfoResponseSchema {\n price: number;\n price_change_percent: number;\n trade_volume: number;\n notional_cap: number;\n}\n\nexport enum MultiAccountEnum {\n \"0x8Ab178C07184ffD44F0ADfF4eA2ce6cFc33F3b86\" = \"0x8Ab178C07184ffD44F0ADfF4eA2ce6cFc33F3b86\",\n \"0x1c03B6480a4efC2d4123ba90d7857f0e1878B780\" = \"0x1c03B6480a4efC2d4123ba90d7857f0e1878B780\",\n \"0x6D63921D8203044f6AbaD8F346d3AEa9A2719dDD\" = \"0x6D63921D8203044f6AbaD8F346d3AEa9A2719dDD\",\n \"0xF7F56d7E02D5c7bF33525AE2eecB049a17Ef4580\" = \"0xF7F56d7E02D5c7bF33525AE2eecB049a17Ef4580\",\n \"0x8a98f69139534Ef85775b473082CE4Af1373cd63\" = \"0x8a98f69139534Ef85775b473082CE4Af1373cd63\",\n \"0xc6Ecf3AB3D09ba6f1565Ad6E139B5D3ba30bB774\" = \"0xc6Ecf3AB3D09ba6f1565Ad6E139B5D3ba30bB774\",\n \"0x39EcC772f6073242d6FD1646d81FA2D87fe95314\" = \"0x39EcC772f6073242d6FD1646d81FA2D87fe95314\",\n \"0x95605c64356572eb5C076Cb9c027c88b527A2059\" = \"0x95605c64356572eb5C076Cb9c027c88b527A2059\",\n \"0xE43166cE17d3511B09438a359dAa53513225101D\" = \"0xE43166cE17d3511B09438a359dAa53513225101D\",\n \"0xA503Eb7714D4328f3D425F24954C6f5F00115E09\" = \"0xA503Eb7714D4328f3D425F24954C6f5F00115E09\",\n}\nexport interface NonceResponse {\n nonce: string;\n}\n\nexport enum NotificationType {\n report = \"report\",\n alert = \"alert\",\n warning = \"warning\",\n}\nexport interface NotificationsRequestSchema {\n counterparty_address?: string | null;\n quote_id?: number | null;\n timestamp_gte?: number | null;\n}\n\nexport interface SuccessNotificationData {\n action?: string | null;\n order_type?: number | null;\n filled_amount_open?: string | null;\n filled_amount_close?: string | null;\n avg_price_open?: string | null;\n avg_price_close?: string | null;\n action_status?: string | null;\n}\n\nexport interface SeenNotificationData {\n action?: string | null;\n order_type?: number | null;\n action_status?: string;\n}\n\nexport interface NotificationsResponseSchema {\n timestamp: number;\n counterparty_address: string;\n quote_id: number;\n temp_quote_id: number | null;\n type: NotificationType;\n data: SuccessNotificationData | SeenNotificationData | FailedNotificationData;\n}\n\nexport interface NotificationsSearchResponseSchema {\n count: number;\n notification_data: NotificationsResponseSchema[];\n}\n\nexport interface OpenInterestResponseSchema {\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n total_cap: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n used: string;\n}\n\nexport enum PositionStateType {\n report = \"report\",\n alert = \"alert\",\n}\nexport interface PositionStateResponseSchema {\n id: string;\n create_time: number;\n modify_time: number;\n quote_id: number;\n temp_quote_id?: number | null;\n counterparty_address: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n filled_amount_open?: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n filled_amount_close?: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n avg_price_open?: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n avg_price_close?: string;\n last_seen_action: string;\n action_status: string;\n failure_type?: string | null;\n error_code?: number | null;\n order_type: number;\n state_type: PositionStateType;\n}\n\nexport interface PositionsStateOutputSchema {\n count: number;\n position_state: PositionStateResponseSchema[];\n}\n\nexport interface PositionsStateRequestSchema {\n address?: string | null;\n quote_id?: number | null;\n create_time_gte?: number | null;\n modify_time_gte?: number | null;\n}\n\nexport interface ReadinessResponseSchema {\n /** Whether the service is ready to accept requests */\n isReady: boolean;\n}\n\nexport interface StatusResponse {\n successful: boolean;\n message?: string | null;\n}\n\nexport interface SymbolPriceRangeInputSchema {\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n min_price: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n max_price: string;\n}\n\nexport interface SymbolsContract {\n price_precision: number;\n quantity_precision: number;\n name: string;\n symbol: string;\n asset: string;\n symbol_id: number;\n is_valid: boolean;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n min_acceptable_quote_value: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n min_acceptable_portion_lf: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n trading_fee: string;\n max_leverage: number;\n max_notional_value: number;\n rfq_allowed: boolean;\n hedger_fee_open: string;\n hedger_fee_close: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n max_funding_rate: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n min_notional_value: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n max_quantity: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n lot_size: string;\n}\n\nexport interface SymbolsContractResponseSchema {\n count: number;\n symbols: SymbolsContract[];\n}\n\nexport interface TokenSchema {\n access_token: string;\n}\n\nexport type GetLockedParamsGetLockedParamsSymbolGetParams = {\n leverage: number;\n};\n\nexport type GetMarketInfoGetMarketInfoGet200 = { [key: string]: MarketInfoResponseSchema };\n\nexport type GetFundingInfoGetFundingInfoGetParams = {\n symbols?: string[];\n};\n\nexport type GetFundingInfoGetFundingInfoGet200 = { [key: string]: FundingInfoResponseSchema };\n\nexport type VerifyTokenAuthVerifyPostParams = {\n /**\n * @pattern 0x[0-9a-fA-F]{40}\n */\n party_a_address: string;\n};\n\n/**\n * @summary Get Contract Symbols\n */\nexport const getContractSymbolsContractSymbolsGet = (\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<SymbolsContractResponseSchema>> => {\n return axios.get(`/contract-symbols`, options);\n};\n\n/**\n * @summary Whitelist Check Sub Address\n */\nexport const whitelistCheckSubAddressAddSubAddressInWhitelistAddressMultiAccountAddressGet = (\n address: string,\n multiAccountAddress: MultiAccountEnum,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<StatusResponse>> => {\n return axios.get(`/add-sub-address-in-whitelist/${address}/${multiAccountAddress}`, options);\n};\n\n/**\n * @summary Get Open Interest\n */\nexport const getOpenInterestOpenInterestGet = (\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<OpenInterestResponseSchema>> => {\n return axios.get(`/open-interest`, options);\n};\n\n/**\n * @summary Search Position State\n */\nexport const searchPositionStatePositionStateStartSizePost = (\n start: number,\n size: number,\n positionsStateRequestSchema: PositionsStateRequestSchema,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<PositionsStateOutputSchema>> => {\n return axios.post(`/position-state/${start}/${size}`, positionsStateRequestSchema, options);\n};\n\n/**\n * @summary Search Notification\n */\nexport const searchNotificationNotificationsStartSizePost = (\n start: number,\n size: number,\n notificationsRequestSchema: NotificationsRequestSchema,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<NotificationsSearchResponseSchema>> => {\n return axios.post(`/notifications/${start}/${size}`, notificationsRequestSchema, options);\n};\n\n/**\n * @summary Get Notional Cap\n */\nexport const getNotionalCapNotionalCapSymbolIdGet = (\n symbolId: number,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<OpenInterestResponseSchema>> => {\n return axios.get(`/notional_cap/${symbolId}`, options);\n};\n\n/**\n * @summary Get Symbol Price Range\n */\nexport const getSymbolPriceRangePriceRangeSymbolGet = (\n symbol: string,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<SymbolPriceRangeInputSchema>> => {\n return axios.get(`/price-range/${symbol}`, options);\n};\n\n/**\n * @summary Check In White List\n */\nexport const checkInWhiteListCheckInWhitelistAddressMultiAccountAddressGet = (\n address: string,\n multiAccountAddress: MultiAccountEnum,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<boolean>> => {\n return axios.get(`/check_in-whitelist/${address}/${multiAccountAddress}`, options);\n};\n\n/**\n * @summary Get Error Codes\n */\nexport const getErrorCodesErrorCodesGet = (\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ErrorCodeResponseSchema>> => {\n return axios.get(`/error_codes`, options);\n};\n\n/**\n * @summary Get Error Message\n */\nexport const getErrorMessageErrorCodesErrorCodeGet = (\n errorCode: number,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ErrorCodeResponseSchema>> => {\n return axios.get(`/error_codes/${errorCode}`, options);\n};\n\n/**\n * @summary Get Locked Params\n */\nexport const getLockedParamsGetLockedParamsSymbolGet = (\n symbol: string,\n params: GetLockedParamsGetLockedParamsSymbolGetParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<LockedParamsResponseSchema>> => {\n return axios.get(`/get_locked_params/${symbol}`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * @summary Get Market Info\n */\nexport const getMarketInfoGetMarketInfoGet = (\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<GetMarketInfoGetMarketInfoGet200>> => {\n return axios.get(`/get_market_info`, options);\n};\n\n/**\n * @summary Get Counterparty Upnl\n */\nexport const getCounterpartyUpnlPartyAUpnlAddressGet = (\n address: string,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<string>> => {\n return axios.get(`/partyA_upnl/${address}`, {\n ...options,\n });\n};\n\n/**\n * @summary Get Balance Info\n */\nexport const getBalanceInfoGetBalanceInfoAddressMultiAccountAddressGet = (\n address: string,\n multiAccountAddress: MultiAccountEnum,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<BalanceInfoResponseSchema>> => {\n return axios.get(`/get_balance_info/${address}/${multiAccountAddress}`, options);\n};\n\n/**\n * @summary Get Funding Info\n */\nexport const getFundingInfoGetFundingInfoGet = (\n params?: GetFundingInfoGetFundingInfoGetParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<GetFundingInfoGetFundingInfoGet200>> => {\n return axios.get(`/get_funding_info`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * @summary Availability check\n */\nexport const readyCheckReadyzGet = (options?: AxiosRequestConfig): Promise<AxiosResponse<ReadinessResponseSchema>> => {\n return axios.get(`/readyz`, options);\n};\n\n/**\n * Verifies if the JWT token is valid and matches the provided `party_a_address`.\n *\n * Parameters:\n * party_a_address:\n * auth_data (dict): Authentication data extracted from the JWT token,\n * provided by the `get_current_user` dependency.\n *\n * Returns:\n * dict: A success message indicating that the token is valid.\n *\n * Raises:\n * ErrorCodeResponse: If the JWT token is invalid or the `sub` address does not match `party_a_address`.\n * @summary Verify Token\n */\nexport const verifyTokenAuthVerifyPost = (\n params: VerifyTokenAuthVerifyPostParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<StatusResponse>> => {\n return axios.post(`/auth/verify`, undefined, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * @summary Get Nonce\n */\nexport const getNonceNonceAccountAddressGet = (\n accountAddress: string,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<NonceResponse>> => {\n return axios.get(`/nonce/${accountAddress}`, options);\n};\n\n/**\n * @summary Login\n */\nexport const loginLoginPost = (login: Login, options?: AxiosRequestConfig): Promise<AxiosResponse<TokenSchema>> => {\n return axios.post(`/login`, login, options);\n};\n\n/**\n * @summary Get Instant Request For Quotes\n */\nexport const getInstantRequestForQuotesInstantOpenAccountAddressGet = (\n accountAddress: string,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<InstantRFQResponse[]>> => {\n return axios.get(`/instant_open/${accountAddress}`, options);\n};\n\n/**\n * @summary Instant Request For Quote\n */\nexport const instantRequestForQuoteInstantOpenPost = (\n instantRequestForQuote: InstantRequestForQuote,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<InstantRFQResponse>> => {\n return axios.post(`/instant_open`, instantRequestForQuote, options);\n};\n\n/**\n * @summary Instant Request For Quote With Signature\n */\nexport const instantRequestForQuoteWithSignatureInstantTradeOpenPost = (\n bodyInstantRequestForQuoteWithSignatureInstantTradeOpenPost: BodyInstantRequestForQuoteWithSignatureInstantTradeOpenPost,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<InstantRFQResponse>> => {\n return axios.post(`/instant_trade/open`, bodyInstantRequestForQuoteWithSignatureInstantTradeOpenPost, options);\n};\n\n/**\n * @summary Cancel Instant Request For Quote\n */\nexport const cancelInstantRequestForQuoteInstantOpenQuoteIdDelete = (\n quoteId: number,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<StatusResponse>> => {\n return axios.delete(`/instant_open/${quoteId}`, options);\n};\n\n/**\n * @summary Get Instant Request To Closes\n */\nexport const getInstantRequestToClosesInstantCloseAccountAddressGet = (\n accountAddress: string,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<InstantCloseSchema[]>> => {\n return axios.get(`/instant_close/${accountAddress}`, options);\n};\n\n/**\n * @summary Instant Request To Close\n */\nexport const instantRequestToCloseInstantClosePost = (\n instantRequestToClose: InstantRequestToClose,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<StatusResponse>> => {\n return axios.post(`/instant_close`, instantRequestToClose, options);\n};\n\n/**\n * @summary Instant Request To Close With Signature\n */\nexport const instantRequestToCloseWithSignatureInstantTradeClosePost = (\n instantOperation: InstantOperation[],\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<StatusResponse>> => {\n return axios.post(`/instant_trade/close`, instantOperation, options);\n};\n\n/**\n * @summary Cancel Instant Request To Close\n */\nexport const cancelInstantRequestToCloseInstantCloseQuoteIdDelete = (\n quoteId: number,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<StatusResponse>> => {\n return axios.delete(`/instant_close/${quoteId}`, options);\n};\n\n/**\n * @summary Get Quote Id\n */\nexport const getQuoteIdInstantQuoteIdTempQuoteIdGet = (\n tempQuoteId: number,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<GetInstantQuoteResponse>> => {\n return axios.get(`/instant_quote_id/${tempQuoteId}`, options);\n};\n\nexport type GetContractSymbolsContractSymbolsGetResult = AxiosResponse<SymbolsContractResponseSchema>;\nexport type WhitelistCheckSubAddressAddSubAddressInWhitelistAddressMultiAccountAddressGetResult =\n AxiosResponse<StatusResponse>;\nexport type GetOpenInterestOpenInterestGetResult = AxiosResponse<OpenInterestResponseSchema>;\nexport type SearchPositionStatePositionStateStartSizePostResult = AxiosResponse<PositionsStateOutputSchema>;\nexport type SearchNotificationNotificationsStartSizePostResult = AxiosResponse<NotificationsSearchResponseSchema>;\nexport type GetNotionalCapNotionalCapSymbolIdGetResult = AxiosResponse<OpenInterestResponseSchema>;\nexport type GetSymbolPriceRangePriceRangeSymbolGetResult = AxiosResponse<SymbolPriceRangeInputSchema>;\nexport type CheckInWhiteListCheckInWhitelistAddressMultiAccountAddressGetResult = AxiosResponse<boolean>;\nexport type GetErrorCodesErrorCodesGetResult = AxiosResponse<ErrorCodeResponseSchema>;\nexport type GetErrorMessageErrorCodesErrorCodeGetResult = AxiosResponse<ErrorCodeResponseSchema>;\nexport type GetLockedParamsGetLockedParamsSymbolGetResult = AxiosResponse<LockedParamsResponseSchema>;\nexport type GetMarketInfoGetMarketInfoGetResult = AxiosResponse<GetMarketInfoGetMarketInfoGet200>;\nexport type GetCounterpartyUpnlPartyAUpnlAddressGetResult = AxiosResponse<string>;\nexport type GetBalanceInfoGetBalanceInfoAddressMultiAccountAddressGetResult = AxiosResponse<BalanceInfoResponseSchema>;\nexport type GetFundingInfoGetFundingInfoGetResult = AxiosResponse<GetFundingInfoGetFundingInfoGet200>;\nexport type ReadyCheckReadyzGetResult = AxiosResponse<ReadinessResponseSchema>;\nexport type VerifyTokenAuthVerifyPostResult = AxiosResponse<StatusResponse>;\nexport type GetNonceNonceAccountAddressGetResult = AxiosResponse<NonceResponse>;\nexport type LoginLoginPostResult = AxiosResponse<TokenSchema>;\nexport type GetInstantRequestForQuotesInstantOpenAccountAddressGetResult = AxiosResponse<InstantRFQResponse[]>;\nexport type InstantRequestForQuoteInstantOpenPostResult = AxiosResponse<InstantRFQResponse>;\nexport type InstantRequestForQuoteWithSignatureInstantTradeOpenPostResult = AxiosResponse<InstantRFQResponse>;\nexport type CancelInstantRequestForQuoteInstantOpenQuoteIdDeleteResult = AxiosResponse<StatusResponse>;\nexport type GetInstantRequestToClosesInstantCloseAccountAddressGetResult = AxiosResponse<InstantCloseSchema[]>;\nexport type InstantRequestToCloseInstantClosePostResult = AxiosResponse<StatusResponse>;\nexport type InstantRequestToCloseWithSignatureInstantTradeClosePostResult = AxiosResponse<StatusResponse>;\nexport type CancelInstantRequestToCloseInstantCloseQuoteIdDeleteResult = AxiosResponse<StatusResponse>;\nexport type GetQuoteIdInstantQuoteIdTempQuoteIdGetResult = AxiosResponse<GetInstantQuoteResponse>;\n"],"mappings":";;AAuaA,IAAa,KACX,MAEO,EAAM,IAAI,qBAAqB,CAAO,GAiBlC,KACX,MAEO,EAAM,IAAI,kBAAkB,CAAO,GAM/B,KACX,GACA,GACA,GACA,MAEO,EAAM,KAAK,mBAAmB,EAAM,GAAG,KAAQ,GAA6B,CAAO,GAkB/E,KACX,GACA,MAEO,EAAM,IAAI,iBAAiB,KAAY,CAAO,GAM1C,KACX,GACA,MAEO,EAAM,IAAI,gBAAgB,KAAU,CAAO,GA0BvC,KACX,GACA,MAEO,EAAM,IAAI,gBAAgB,KAAa,CAAO,GAoB1C,KACX,MAEO,EAAM,IAAI,oBAAoB,CAAO,GAMjC,KACX,GACA,MAEO,EAAM,IAAI,gBAAgB,KAAW,EAC1C,GAAG,EACL,CAAC,GAMU,KACX,GACA,GACA,MAEO,EAAM,IAAI,qBAAqB,EAAQ,GAAG,KAAuB,CAAO,GAmBpE,KAAuB,MAC3B,EAAM,IAAI,WAAW,CAAO,GAgDxB,KACX,GACA,MAEO,EAAM,IAAI,iBAAiB,KAAkB,CAAO,GAgBhD,KACX,GACA,MAEO,EAAM,KAAK,uBAAuB,GAA6D,CAAO,GAoClG,KACX,GACA,MAEO,EAAM,KAAK,wBAAwB,GAAkB,CAAO"}
|
|
1
|
+
{"version":3,"file":"rasa-solver.js","names":[],"sources":["../../../../src/solvers/types/generated/rasa-solver.ts"],"sourcesContent":["/**\n * Generated by orval v8.14.0 🍺\n * Do not edit manually.\n * Hedger Parameters Web App\n * FastAPI project for setting hedger parameter\n * # WebSocket API Documentation\n *\n * This document describes the available WebSocket routes, parameters, and response formats for the market data services.\n *\n * ---\n *\n * ## WebSocket Routes\n *\n * ### 1. `/funding-rate`\n *\n * **Purpose**: Provides funding rate information for specified symbols.\n *\n * **Request Parameters (sent through WebSocket message)**:\n * - `symbol_ids`: List[int] (optional) - List of symbol IDs to subscribe.\n * - `symbols`: List[str] (optional) - List of symbol names to subscribe.\n *\n * **Response Payload**:\n * A dictionary keyed by symbol_id (if input was symbol_ids) or by symbol_title (if input was symbols). Each entry contains the following fields:\n * - `next_funding_time` (str, ISO 8601): Timestamp of the next funding event.\n * - `next_funding_rate_short` (str): Funding rate to be paid by short positions.\n * - `next_funding_rate_long` (str): Funding rate to be paid by long positions.\n * - `funding_rate_epoch_duration` (int): Interval in seconds between funding events (e.g., 28800 = 8 hours).\n *\n * Aggregated totals:\n * - `tc` (Decimal): Total cap\n * - `uc` (Decimal): Used cap\n *\n * **Notes**:\n * - Data is refreshed at 1-second intervals.\n * - Automatically handles disconnection cases.\n *\n * ---\n *\n * ### 2. `/available-quote`\n *\n * **Purpose**: Provides available quote (order book) information for a specified symbol.\n *\n * **Request Parameters (sent through WebSocket message)**:\n * - `symbol_id`: int (required) - Symbol ID to retrieve the quote for.\n * - `limit`: int (optional) - Number of data entries to limit (default 500).\n *\n * **Response Payload**:\n * - `timestamp` (int): Timestamp of the transaction\n * - `asks` (List[List[Decimal]]): List of asks (each entry: [price, quantity])\n * - `bids` (List[List[Decimal]]): List of bids (each entry: [price, quantity])\n *\n * **Validation**:\n * - Symbol ID must be valid; otherwise, an error message with error code `EC_310` `invalid symbol_id` is sent and the WebSocket connection is closed.\n *\n * **Notes**:\n * - Data is refreshed at 1-second intervals.\n * - Automatically handles disconnection and invalid input cases.\n *\n *\n * OpenAPI spec version: 0.1.0\n */\nimport type { AxiosRequestConfig, AxiosResponse } from \"axios\";\nimport axios from \"axios\";\n\nexport interface Account {\n /** @pattern 0x[0-9a-fA-F]{40} */\n addr: string;\n isPartyB?: boolean;\n}\n\nexport interface UpnlData {\n upnl: string | null;\n notional: string | null;\n timestamp: number;\n allocated_balance: string;\n cva: string;\n lf: string;\n party_a_mm: string;\n party_b_mm: string;\n pending_cva: string;\n pending_lf: string;\n pending_party_a_mm: string;\n pending_party_b_mm: string;\n}\n\nexport interface BothUpnlData {\n party_a: UpnlData | null;\n party_b: UpnlData | null;\n}\n\nexport type BalanceInfoResponseSchema = BothUpnlData[];\n\nexport interface ReplayAttackHeader {\n /** @minimum 0 */\n nonce: number;\n /** @minimum 0 */\n deadline: number;\n salt: string;\n}\n\nexport interface SignedOperation {\n /** @pattern 0x[0-9a-fA-F]{40} */\n signer: string;\n /** @pattern 0x[0-9a-fA-F]{40} */\n target: string;\n callData: string;\n signerAccount: Account;\n replayAttackHeader: ReplayAttackHeader;\n}\n\nexport interface InstantOperation {\n signedOperation: SignedOperation;\n signature: string;\n}\n\nexport interface BodyInstantRequestForQuoteWithSignatureInstantTradeOpenPost {\n sendQuote: InstantOperation;\n addMargin?: InstantOperation;\n}\n\nexport interface ErrorCodeResponseSchema {\n [key: string]: string;\n}\n\nexport interface ErrorResponseModel {\n error_code?: number;\n error_message?: string;\n error_detail?: unknown[] | null;\n}\n\nexport interface FailedNotificationData {\n action?: string | null;\n order_type?: number | null;\n error_code: number;\n failure_type?: string | null;\n action_status?: string;\n}\n\nexport interface FundingInfoResponseSchema {\n next_funding_time: number;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n next_funding_rate_short: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n next_funding_rate_long: string;\n funding_rate_epoch_duration: number;\n}\n\nexport interface GetInstantQuoteResponse {\n quote_id: number;\n}\n\nexport interface ValidationError {\n loc: (string | number)[];\n msg: string;\n type: string;\n}\n\nexport interface HTTPValidationError {\n detail?: ValidationError[];\n}\n\nexport interface InstantCloseSchema {\n quote_id: number;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n quantity_to_close: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n close_price: string;\n}\n\nexport enum PositionType {\n NUMBER_0 = 0,\n NUMBER_1 = 1,\n}\nexport enum OrderType {\n NUMBER_0 = 0,\n NUMBER_1 = 1,\n}\nexport interface InstantRFQResponse {\n position_type: PositionType;\n temp_quote_id: number;\n symbol_id: number;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n requested_open_price: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n quantity: string;\n party_a_address: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n cva: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n partyAmm: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n partyBmm: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n lf: string;\n order_type: OrderType;\n}\n\nexport interface InstantRequestForQuote {\n symbolId: number;\n positionType: PositionType;\n orderType: OrderType;\n price: number | string;\n quantity: number | string;\n cva: number | string;\n lf: number | string;\n partyAmm: number | string;\n partyBmm: number | string;\n maxFundingRate: number;\n deadline: number;\n}\n\nexport interface InstantRequestToClose {\n quote_id: number;\n quantity_to_close: number | string;\n close_price: number | string;\n deadline?: number | null;\n order_type?: OrderType | null;\n}\n\nexport interface LockedParamsResponseSchema {\n cva: string;\n partyAmm: string;\n lf: string;\n leverage: string;\n partyBmm: string;\n}\n\nexport interface Login {\n /** @pattern 0x[0-9a-fA-F]{40} */\n account_address: string;\n nonce: string;\n expiration_time: string;\n issued_at: string;\n signature: string;\n}\n\nexport interface MarketInfoResponseSchema {\n price: number;\n price_change_percent: number;\n trade_volume: number;\n notional_cap: number;\n}\n\nexport enum MultiAccountEnum {\n \"0x8Ab178C07184ffD44F0ADfF4eA2ce6cFc33F3b86\" = \"0x8Ab178C07184ffD44F0ADfF4eA2ce6cFc33F3b86\",\n \"0x1c03B6480a4efC2d4123ba90d7857f0e1878B780\" = \"0x1c03B6480a4efC2d4123ba90d7857f0e1878B780\",\n \"0x6D63921D8203044f6AbaD8F346d3AEa9A2719dDD\" = \"0x6D63921D8203044f6AbaD8F346d3AEa9A2719dDD\",\n \"0xF7F56d7E02D5c7bF33525AE2eecB049a17Ef4580\" = \"0xF7F56d7E02D5c7bF33525AE2eecB049a17Ef4580\",\n \"0x8a98f69139534Ef85775b473082CE4Af1373cd63\" = \"0x8a98f69139534Ef85775b473082CE4Af1373cd63\",\n \"0xc6Ecf3AB3D09ba6f1565Ad6E139B5D3ba30bB774\" = \"0xc6Ecf3AB3D09ba6f1565Ad6E139B5D3ba30bB774\",\n \"0x39EcC772f6073242d6FD1646d81FA2D87fe95314\" = \"0x39EcC772f6073242d6FD1646d81FA2D87fe95314\",\n \"0x95605c64356572eb5C076Cb9c027c88b527A2059\" = \"0x95605c64356572eb5C076Cb9c027c88b527A2059\",\n \"0xE43166cE17d3511B09438a359dAa53513225101D\" = \"0xE43166cE17d3511B09438a359dAa53513225101D\",\n \"0xA503Eb7714D4328f3D425F24954C6f5F00115E09\" = \"0xA503Eb7714D4328f3D425F24954C6f5F00115E09\",\n}\nexport interface NonceResponse {\n nonce: string;\n}\n\nexport enum NotificationType {\n report = \"report\",\n alert = \"alert\",\n warning = \"warning\",\n}\nexport interface NotificationsRequestSchema {\n counterparty_address?: string | null;\n quote_id?: number | null;\n timestamp_gte?: number | null;\n}\n\nexport interface SuccessNotificationData {\n action?: string | null;\n order_type?: number | null;\n filled_amount_open?: string | null;\n filled_amount_close?: string | null;\n avg_price_open?: string | null;\n avg_price_close?: string | null;\n action_status?: string | null;\n}\n\nexport interface SeenNotificationData {\n action?: string | null;\n order_type?: number | null;\n action_status?: string;\n}\n\nexport interface NotificationsResponseSchema {\n timestamp: number;\n counterparty_address: string;\n quote_id: number;\n temp_quote_id: number | null;\n type: NotificationType;\n data: SuccessNotificationData | SeenNotificationData | FailedNotificationData;\n}\n\nexport interface NotificationsSearchResponseSchema {\n count: number;\n notification_data: NotificationsResponseSchema[];\n}\n\nexport interface OpenInterestResponseSchema {\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n total_cap: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n used: string;\n}\n\nexport enum PositionStateType {\n report = \"report\",\n alert = \"alert\",\n}\nexport interface PositionStateResponseSchema {\n id: string;\n create_time: number;\n modify_time: number;\n quote_id: number;\n temp_quote_id?: number | null;\n counterparty_address: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n filled_amount_open?: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n filled_amount_close?: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n avg_price_open?: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n avg_price_close?: string;\n last_seen_action: string;\n action_status: string;\n failure_type?: string | null;\n error_code?: number | null;\n order_type: number;\n state_type: PositionStateType;\n}\n\nexport interface PositionsStateOutputSchema {\n count: number;\n position_state: PositionStateResponseSchema[];\n}\n\nexport interface PositionsStateRequestSchema {\n address?: string | null;\n quote_id?: number | null;\n create_time_gte?: number | null;\n modify_time_gte?: number | null;\n}\n\nexport interface ReadinessResponseSchema {\n /** Whether the service is ready to accept requests */\n isReady: boolean;\n}\n\nexport interface StatusResponse {\n successful: boolean;\n message?: string | null;\n}\n\nexport interface SymbolPriceRangeInputSchema {\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n min_price: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n max_price: string;\n}\n\nexport interface SymbolsContract {\n price_precision: number;\n quantity_precision: number;\n name: string;\n symbol: string;\n asset: string;\n symbol_id: number;\n is_valid: boolean;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n min_acceptable_quote_value: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n min_acceptable_portion_lf: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n trading_fee: string;\n max_leverage: number;\n max_notional_value: number;\n rfq_allowed: boolean;\n hedger_fee_open: string;\n hedger_fee_close: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n max_funding_rate: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n min_notional_value: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n max_quantity: string;\n /** @pattern ^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$ */\n lot_size: string;\n}\n\nexport interface SymbolsContractResponseSchema {\n count: number;\n symbols: SymbolsContract[];\n}\n\nexport interface TokenSchema {\n access_token: string;\n}\n\nexport type GetLockedParamsGetLockedParamsSymbolGetParams = {\n leverage: number;\n};\n\nexport type GetMarketInfoGetMarketInfoGet200 = { [key: string]: MarketInfoResponseSchema };\n\nexport type GetFundingInfoGetFundingInfoGetParams = {\n symbols?: string[];\n};\n\nexport type GetFundingInfoGetFundingInfoGet200 = { [key: string]: FundingInfoResponseSchema };\n\nexport type VerifyTokenAuthVerifyPostParams = {\n /**\n * @pattern 0x[0-9a-fA-F]{40}\n */\n party_a_address: string;\n};\n\n/**\n * @summary Get Contract Symbols\n */\nexport const getContractSymbolsContractSymbolsGet = (\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<SymbolsContractResponseSchema>> => {\n return axios.get(`/contract-symbols`, options);\n};\n\n/**\n * @summary Whitelist Check Sub Address\n */\nexport const whitelistCheckSubAddressAddSubAddressInWhitelistAddressMultiAccountAddressGet = (\n address: string,\n multiAccountAddress: MultiAccountEnum,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<StatusResponse>> => {\n return axios.get(`/add-sub-address-in-whitelist/${address}/${multiAccountAddress}`, options);\n};\n\n/**\n * @summary Get Open Interest\n */\nexport const getOpenInterestOpenInterestGet = (\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<OpenInterestResponseSchema>> => {\n return axios.get(`/open-interest`, options);\n};\n\n/**\n * @summary Search Position State\n */\nexport const searchPositionStatePositionStateStartSizePost = (\n start: number,\n size: number,\n positionsStateRequestSchema: PositionsStateRequestSchema,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<PositionsStateOutputSchema>> => {\n return axios.post(`/position-state/${start}/${size}`, positionsStateRequestSchema, options);\n};\n\n/**\n * @summary Search Notification\n */\nexport const searchNotificationNotificationsStartSizePost = (\n start: number,\n size: number,\n notificationsRequestSchema: NotificationsRequestSchema,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<NotificationsSearchResponseSchema>> => {\n return axios.post(`/notifications/${start}/${size}`, notificationsRequestSchema, options);\n};\n\n/**\n * @summary Get Notional Cap\n */\nexport const getNotionalCapNotionalCapSymbolIdGet = (\n symbolId: number,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<OpenInterestResponseSchema>> => {\n return axios.get(`/notional_cap/${symbolId}`, options);\n};\n\n/**\n * @summary Get Symbol Price Range\n */\nexport const getSymbolPriceRangePriceRangeSymbolGet = (\n symbol: string,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<SymbolPriceRangeInputSchema>> => {\n return axios.get(`/price-range/${symbol}`, options);\n};\n\n/**\n * @summary Check In White List\n */\nexport const checkInWhiteListCheckInWhitelistAddressMultiAccountAddressGet = (\n address: string,\n multiAccountAddress: MultiAccountEnum,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<boolean>> => {\n return axios.get(`/check_in-whitelist/${address}/${multiAccountAddress}`, options);\n};\n\n/**\n * @summary Get Error Codes\n */\nexport const getErrorCodesErrorCodesGet = (\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ErrorCodeResponseSchema>> => {\n return axios.get(`/error_codes`, options);\n};\n\n/**\n * @summary Get Error Message\n */\nexport const getErrorMessageErrorCodesErrorCodeGet = (\n errorCode: number,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<ErrorCodeResponseSchema>> => {\n return axios.get(`/error_codes/${errorCode}`, options);\n};\n\n/**\n * @summary Get Locked Params\n */\nexport const getLockedParamsGetLockedParamsSymbolGet = (\n symbol: string,\n params: GetLockedParamsGetLockedParamsSymbolGetParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<LockedParamsResponseSchema>> => {\n return axios.get(`/get_locked_params/${symbol}`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * @summary Get Market Info\n */\nexport const getMarketInfoGetMarketInfoGet = (\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<GetMarketInfoGetMarketInfoGet200>> => {\n return axios.get(`/get_market_info`, options);\n};\n\n/**\n * @summary Get Counterparty Upnl\n */\nexport const getCounterpartyUpnlPartyAUpnlAddressGet = (\n address: string,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<string>> => {\n return axios.get(`/partyA_upnl/${address}`, {\n ...options,\n });\n};\n\n/**\n * @summary Get Balance Info\n */\nexport const getBalanceInfoGetBalanceInfoAddressMultiAccountAddressGet = (\n address: string,\n multiAccountAddress: MultiAccountEnum,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<BalanceInfoResponseSchema>> => {\n return axios.get(`/get_balance_info/${address}/${multiAccountAddress}`, options);\n};\n\n/**\n * @summary Get Funding Info\n */\nexport const getFundingInfoGetFundingInfoGet = (\n params?: GetFundingInfoGetFundingInfoGetParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<GetFundingInfoGetFundingInfoGet200>> => {\n return axios.get(`/get_funding_info`, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * @summary Availability check\n */\nexport const readyCheckReadyzGet = (options?: AxiosRequestConfig): Promise<AxiosResponse<ReadinessResponseSchema>> => {\n return axios.get(`/readyz`, options);\n};\n\n/**\n * Verifies if the JWT token is valid and matches the provided `party_a_address`.\n *\n * Parameters:\n * party_a_address:\n * auth_data (dict): Authentication data extracted from the JWT token,\n * provided by the `get_current_user` dependency.\n *\n * Returns:\n * dict: A success message indicating that the token is valid.\n *\n * Raises:\n * ErrorCodeResponse: If the JWT token is invalid or the `sub` address does not match `party_a_address`.\n * @summary Verify Token\n */\nexport const verifyTokenAuthVerifyPost = (\n params: VerifyTokenAuthVerifyPostParams,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<StatusResponse>> => {\n return axios.post(`/auth/verify`, undefined, {\n ...options,\n params: { ...params, ...options?.params },\n });\n};\n\n/**\n * @summary Get Nonce\n */\nexport const getNonceNonceAccountAddressGet = (\n accountAddress: string,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<NonceResponse>> => {\n return axios.get(`/nonce/${accountAddress}`, options);\n};\n\n/**\n * @summary Login\n */\nexport const loginLoginPost = (login: Login, options?: AxiosRequestConfig): Promise<AxiosResponse<TokenSchema>> => {\n return axios.post(`/login`, login, options);\n};\n\n/**\n * @summary Get Instant Request For Quotes\n */\nexport const getInstantRequestForQuotesInstantOpenAccountAddressGet = (\n accountAddress: string,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<InstantRFQResponse[]>> => {\n return axios.get(`/instant_open/${accountAddress}`, options);\n};\n\n/**\n * @summary Instant Request For Quote\n */\nexport const instantRequestForQuoteInstantOpenPost = (\n instantRequestForQuote: InstantRequestForQuote,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<InstantRFQResponse>> => {\n return axios.post(`/instant_open`, instantRequestForQuote, options);\n};\n\n/**\n * @summary Instant Request For Quote With Signature\n */\nexport const instantRequestForQuoteWithSignatureInstantTradeOpenPost = (\n bodyInstantRequestForQuoteWithSignatureInstantTradeOpenPost: BodyInstantRequestForQuoteWithSignatureInstantTradeOpenPost,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<InstantRFQResponse>> => {\n return axios.post(`/instant_trade/open`, bodyInstantRequestForQuoteWithSignatureInstantTradeOpenPost, options);\n};\n\n/**\n * @summary Cancel Instant Request For Quote\n */\nexport const cancelInstantRequestForQuoteInstantOpenQuoteIdDelete = (\n quoteId: number,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<StatusResponse>> => {\n return axios.delete(`/instant_open/${quoteId}`, options);\n};\n\n/**\n * @summary Get Instant Request To Closes\n */\nexport const getInstantRequestToClosesInstantCloseAccountAddressGet = (\n accountAddress: string,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<InstantCloseSchema[]>> => {\n return axios.get(`/instant_close/${accountAddress}`, options);\n};\n\n/**\n * @summary Instant Request To Close\n */\nexport const instantRequestToCloseInstantClosePost = (\n instantRequestToClose: InstantRequestToClose,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<StatusResponse>> => {\n return axios.post(`/instant_close`, instantRequestToClose, options);\n};\n\n/**\n * @summary Instant Request To Close With Signature\n */\nexport const instantRequestToCloseWithSignatureInstantTradeClosePost = (\n instantOperation: InstantOperation[],\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<StatusResponse>> => {\n return axios.post(`/instant_trade/close`, instantOperation, options);\n};\n\n/**\n * @summary Cancel Instant Request To Close\n */\nexport const cancelInstantRequestToCloseInstantCloseQuoteIdDelete = (\n quoteId: number,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<StatusResponse>> => {\n return axios.delete(`/instant_close/${quoteId}`, options);\n};\n\n/**\n * @summary Get Quote Id\n */\nexport const getQuoteIdInstantQuoteIdTempQuoteIdGet = (\n tempQuoteId: number,\n options?: AxiosRequestConfig,\n): Promise<AxiosResponse<GetInstantQuoteResponse>> => {\n return axios.get(`/instant_quote_id/${tempQuoteId}`, options);\n};\n\nexport type GetContractSymbolsContractSymbolsGetResult = AxiosResponse<SymbolsContractResponseSchema>;\nexport type WhitelistCheckSubAddressAddSubAddressInWhitelistAddressMultiAccountAddressGetResult =\n AxiosResponse<StatusResponse>;\nexport type GetOpenInterestOpenInterestGetResult = AxiosResponse<OpenInterestResponseSchema>;\nexport type SearchPositionStatePositionStateStartSizePostResult = AxiosResponse<PositionsStateOutputSchema>;\nexport type SearchNotificationNotificationsStartSizePostResult = AxiosResponse<NotificationsSearchResponseSchema>;\nexport type GetNotionalCapNotionalCapSymbolIdGetResult = AxiosResponse<OpenInterestResponseSchema>;\nexport type GetSymbolPriceRangePriceRangeSymbolGetResult = AxiosResponse<SymbolPriceRangeInputSchema>;\nexport type CheckInWhiteListCheckInWhitelistAddressMultiAccountAddressGetResult = AxiosResponse<boolean>;\nexport type GetErrorCodesErrorCodesGetResult = AxiosResponse<ErrorCodeResponseSchema>;\nexport type GetErrorMessageErrorCodesErrorCodeGetResult = AxiosResponse<ErrorCodeResponseSchema>;\nexport type GetLockedParamsGetLockedParamsSymbolGetResult = AxiosResponse<LockedParamsResponseSchema>;\nexport type GetMarketInfoGetMarketInfoGetResult = AxiosResponse<GetMarketInfoGetMarketInfoGet200>;\nexport type GetCounterpartyUpnlPartyAUpnlAddressGetResult = AxiosResponse<string>;\nexport type GetBalanceInfoGetBalanceInfoAddressMultiAccountAddressGetResult = AxiosResponse<BalanceInfoResponseSchema>;\nexport type GetFundingInfoGetFundingInfoGetResult = AxiosResponse<GetFundingInfoGetFundingInfoGet200>;\nexport type ReadyCheckReadyzGetResult = AxiosResponse<ReadinessResponseSchema>;\nexport type VerifyTokenAuthVerifyPostResult = AxiosResponse<StatusResponse>;\nexport type GetNonceNonceAccountAddressGetResult = AxiosResponse<NonceResponse>;\nexport type LoginLoginPostResult = AxiosResponse<TokenSchema>;\nexport type GetInstantRequestForQuotesInstantOpenAccountAddressGetResult = AxiosResponse<InstantRFQResponse[]>;\nexport type InstantRequestForQuoteInstantOpenPostResult = AxiosResponse<InstantRFQResponse>;\nexport type InstantRequestForQuoteWithSignatureInstantTradeOpenPostResult = AxiosResponse<InstantRFQResponse>;\nexport type CancelInstantRequestForQuoteInstantOpenQuoteIdDeleteResult = AxiosResponse<StatusResponse>;\nexport type GetInstantRequestToClosesInstantCloseAccountAddressGetResult = AxiosResponse<InstantCloseSchema[]>;\nexport type InstantRequestToCloseInstantClosePostResult = AxiosResponse<StatusResponse>;\nexport type InstantRequestToCloseWithSignatureInstantTradeClosePostResult = AxiosResponse<StatusResponse>;\nexport type CancelInstantRequestToCloseInstantCloseQuoteIdDeleteResult = AxiosResponse<StatusResponse>;\nexport type GetQuoteIdInstantQuoteIdTempQuoteIdGetResult = AxiosResponse<GetInstantQuoteResponse>;\n"],"mappings":";;AAuaA,IAAa,KACX,MAEO,EAAM,IAAI,qBAAqB,CAAO,GAiBlC,KACX,MAEO,EAAM,IAAI,kBAAkB,CAAO,GAM/B,KACX,GACA,GACA,GACA,MAEO,EAAM,KAAK,mBAAmB,EAAM,GAAG,KAAQ,GAA6B,CAAO,GAkB/E,KACX,GACA,MAEO,EAAM,IAAI,iBAAiB,KAAY,CAAO,GAM1C,KACX,GACA,MAEO,EAAM,IAAI,gBAAgB,KAAU,CAAO,GA0BvC,KACX,GACA,MAEO,EAAM,IAAI,gBAAgB,KAAa,CAAO,GAoB1C,KACX,MAEO,EAAM,IAAI,oBAAoB,CAAO,GAMjC,KACX,GACA,MAEO,EAAM,IAAI,gBAAgB,KAAW,EAC1C,GAAG,EACL,CAAC,GAMU,KACX,GACA,GACA,MAEO,EAAM,IAAI,qBAAqB,EAAQ,GAAG,KAAuB,CAAO,GAMpE,KACX,GACA,MAEO,EAAM,IAAI,qBAAqB;CACpC,GAAG;CACH,QAAQ;EAAE,GAAG;EAAQ,GAAG,GAAS;CAAO;AAC1C,CAAC,GAMU,KAAuB,MAC3B,EAAM,IAAI,WAAW,CAAO,GAgDxB,KACX,GACA,MAEO,EAAM,IAAI,iBAAiB,KAAkB,CAAO,GAgBhD,KACX,GACA,MAEO,EAAM,KAAK,uBAAuB,GAA6D,CAAO,GAoClG,KACX,GACA,MAEO,EAAM,KAAK,wBAAwB,GAAkB,CAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symmio/trading-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.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",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"vite": "^8.0.13",
|
|
49
49
|
"vite-plugin-dts": "^5.0.0",
|
|
50
50
|
"vitest": "^4.1.10",
|
|
51
|
-
"@symmio/
|
|
52
|
-
"@symmio/
|
|
51
|
+
"@symmio/eslint-config": "^1.0.0",
|
|
52
|
+
"@symmio/typescript-config": "^1.0.0"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@tanstack/query-core": "^5.90.5",
|