@nadohq/otc-client 0.50.0 → 0.52.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/OtcClient.d.cts +2 -2
- package/dist/OtcClient.d.ts +2 -2
- package/dist/{clientTypes-B7w3RxqK.d.cts → clientTypes-CUoQYhxY.d.cts} +2 -2
- package/dist/{clientTypes-B7w3RxqK.d.cts.map → clientTypes-CUoQYhxY.d.cts.map} +1 -1
- package/dist/{clientTypes-DVAoYtGx.d.ts → clientTypes-CkwgQcEg.d.ts} +2 -2
- package/dist/{clientTypes-DVAoYtGx.d.ts.map → clientTypes-CkwgQcEg.d.ts.map} +1 -1
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +2 -1
- package/dist/otcErrorCodes-CsmoGjD_.d.cts +106 -0
- package/dist/otcErrorCodes-CsmoGjD_.d.cts.map +1 -0
- package/dist/otcErrorCodes-CsmoGjD_.d.ts +106 -0
- package/dist/otcErrorCodes-CsmoGjD_.d.ts.map +1 -0
- package/dist/rfqSubscription.d.cts +2 -2
- package/dist/rfqSubscription.d.ts +2 -2
- package/dist/{serverTypes-CZOJ78c_.d.cts → serverTypes-DpMJVX7i.d.cts} +2 -2
- package/dist/{serverTypes-CZOJ78c_.d.cts.map → serverTypes-DpMJVX7i.d.cts.map} +1 -1
- package/dist/{serverTypes-CZOJ78c_.d.ts → serverTypes-DpMJVX7i.d.ts} +2 -2
- package/dist/{serverTypes-CZOJ78c_.d.ts.map → serverTypes-DpMJVX7i.d.ts.map} +1 -1
- package/dist/types/clientTypes.d.cts +1 -1
- package/dist/types/clientTypes.d.ts +1 -1
- package/dist/types/index.cjs +3 -0
- package/dist/types/index.d.cts +4 -3
- package/dist/types/index.d.ts +4 -3
- package/dist/types/index.js +2 -1
- package/dist/types/otcErrorCodes.cjs +95 -0
- package/dist/types/otcErrorCodes.cjs.map +1 -0
- package/dist/types/otcErrorCodes.d.cts +2 -0
- package/dist/types/otcErrorCodes.d.ts +2 -0
- package/dist/types/otcErrorCodes.js +95 -0
- package/dist/types/otcErrorCodes.js.map +1 -0
- package/dist/types/serverTypes.d.cts +1 -1
- package/dist/types/serverTypes.d.ts +1 -1
- package/package.json +4 -4
- package/src/types/index.ts +1 -0
- package/src/types/otcErrorCodes.ts +109 -0
- package/src/types/serverTypes.ts +1 -1
package/dist/OtcClient.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as OtcServerExecutionResponse } from "./serverTypes-
|
|
2
|
-
import { a as OtcReadyResult, n as OtcGetExecutionStatusParams, r as OtcGetReadyParams, t as OtcExecuteParams } from "./clientTypes-
|
|
1
|
+
import { i as OtcServerExecutionResponse } from "./serverTypes-DpMJVX7i.cjs";
|
|
2
|
+
import { a as OtcReadyResult, n as OtcGetExecutionStatusParams, r as OtcGetReadyParams, t as OtcExecuteParams } from "./clientTypes-CUoQYhxY.cjs";
|
|
3
3
|
import { AxiosInstance } from "axios";
|
|
4
4
|
|
|
5
5
|
//#region src/OtcClient.d.ts
|
package/dist/OtcClient.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as OtcServerExecutionResponse } from "./serverTypes-
|
|
2
|
-
import { a as OtcReadyResult, n as OtcGetExecutionStatusParams, r as OtcGetReadyParams, t as OtcExecuteParams } from "./clientTypes-
|
|
1
|
+
import { i as OtcServerExecutionResponse } from "./serverTypes-DpMJVX7i.js";
|
|
2
|
+
import { a as OtcReadyResult, n as OtcGetExecutionStatusParams, r as OtcGetReadyParams, t as OtcExecuteParams } from "./clientTypes-CkwgQcEg.js";
|
|
3
3
|
import { AxiosInstance } from "axios";
|
|
4
4
|
|
|
5
5
|
//#region src/OtcClient.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as OtcQuoteSizeUnit } from "./serverTypes-
|
|
1
|
+
import { t as OtcQuoteSizeUnit } from "./serverTypes-DpMJVX7i.cjs";
|
|
2
2
|
import { EngineServerPlaceOrderParams } from "@nadohq/engine-client";
|
|
3
3
|
|
|
4
4
|
//#region src/types/clientTypes.d.ts
|
|
@@ -54,4 +54,4 @@ interface OtcRfqSubscriptionStreamsParams {
|
|
|
54
54
|
type OtcRfqSubscriptionParams = OtcRfqSubscriptionStreamParams | OtcRfqSubscriptionStreamsParams;
|
|
55
55
|
//#endregion
|
|
56
56
|
export { OtcReadyResult as a, OtcRfqSubscriptionStreamsParams as c, OtcQuoteStream as i, OtcServerTakerOrderParams as l, OtcGetExecutionStatusParams as n, OtcRfqSubscriptionParams as o, OtcGetReadyParams as r, OtcRfqSubscriptionStreamParams as s, OtcExecuteParams as t };
|
|
57
|
-
//# sourceMappingURL=clientTypes-
|
|
57
|
+
//# sourceMappingURL=clientTypes-CUoQYhxY.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientTypes-
|
|
1
|
+
{"version":3,"file":"clientTypes-CUoQYhxY.d.cts","names":[],"sources":["../src/types/src/types/clientTypes.ts"],"mappings":";;;;;;AAOA;;KAAY,yBAAA,GAA4B,IAAI,CAC1C,4BAAA;AAAA,UAIe,gBAAA;EAJa;EAM5B,MAAA;EACA,KAAA,EAAO,yBAAyB;;EAEhC,QAAA;AAAA;AAAA,UAGe,2BAAA;EACf,MAAA;EACA,WAAW;AAAA;AAAA,UAGI,iBAAA;EACf,QAAQ;AAAA;;;AAJG;AAGb;UAQiB,cAAA;EACf,UAAA;EACA,KAAK;AAAA;AAFP;;;;AAAA,UASiB,cAAA;EACf,IAAA;EACA,SAAA;EACA,MAAA;EACA,IAAA;EACA,QAAA,EAAU,gBAAgB;EAH1B;EAKA,QAAA;AAAA;AAAA,UAGe,8BAAA;EACf,EAAA;EACA,MAAA,EAAQ,cAAc;AAAA;AAAA,UAGP,+BAAA;EACf,EAAA;EACA,OAAA,EAAS,cAAc;AAAA;;KAIb,wBAAA,GACR,8BAAA,GACA,+BAA+B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as OtcQuoteSizeUnit } from "./serverTypes-
|
|
1
|
+
import { t as OtcQuoteSizeUnit } from "./serverTypes-DpMJVX7i.js";
|
|
2
2
|
import { EngineServerPlaceOrderParams } from "@nadohq/engine-client";
|
|
3
3
|
|
|
4
4
|
//#region src/types/clientTypes.d.ts
|
|
@@ -54,4 +54,4 @@ interface OtcRfqSubscriptionStreamsParams {
|
|
|
54
54
|
type OtcRfqSubscriptionParams = OtcRfqSubscriptionStreamParams | OtcRfqSubscriptionStreamsParams;
|
|
55
55
|
//#endregion
|
|
56
56
|
export { OtcReadyResult as a, OtcRfqSubscriptionStreamsParams as c, OtcQuoteStream as i, OtcServerTakerOrderParams as l, OtcGetExecutionStatusParams as n, OtcRfqSubscriptionParams as o, OtcGetReadyParams as r, OtcRfqSubscriptionStreamParams as s, OtcExecuteParams as t };
|
|
57
|
-
//# sourceMappingURL=clientTypes-
|
|
57
|
+
//# sourceMappingURL=clientTypes-CkwgQcEg.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientTypes-
|
|
1
|
+
{"version":3,"file":"clientTypes-CkwgQcEg.d.ts","names":[],"sources":["../src/types/src/types/clientTypes.ts"],"mappings":";;;;;;AAOA;;KAAY,yBAAA,GAA4B,IAAI,CAC1C,4BAAA;AAAA,UAIe,gBAAA;EAJa;EAM5B,MAAA;EACA,KAAA,EAAO,yBAAyB;;EAEhC,QAAA;AAAA;AAAA,UAGe,2BAAA;EACf,MAAA;EACA,WAAW;AAAA;AAAA,UAGI,iBAAA;EACf,QAAQ;AAAA;;;AAJG;AAGb;UAQiB,cAAA;EACf,UAAA;EACA,KAAK;AAAA;AAFP;;;;AAAA,UASiB,cAAA;EACf,IAAA;EACA,SAAA;EACA,MAAA;EACA,IAAA;EACA,QAAA,EAAU,gBAAgB;EAH1B;EAKA,QAAA;AAAA;AAAA,UAGe,8BAAA;EACf,EAAA;EACA,MAAA,EAAQ,cAAc;AAAA;AAAA,UAGP,+BAAA;EACf,EAAA;EACA,OAAA,EAAS,cAAc;AAAA;;KAIb,wBAAA,GACR,8BAAA,GACA,+BAA+B"}
|
package/dist/index.cjs
CHANGED
|
@@ -2,8 +2,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_OtcClient = require("./OtcClient-qUPYb1BP.cjs");
|
|
3
3
|
const require_endpoints = require("./endpoints.cjs");
|
|
4
4
|
const require_rfqSubscription = require("./rfqSubscription.cjs");
|
|
5
|
+
const require_types_otcErrorCodes = require("./types/otcErrorCodes.cjs");
|
|
5
6
|
require("./types/index.cjs");
|
|
6
7
|
exports.OTC_CLIENT_ENDPOINTS = require_endpoints.OTC_CLIENT_ENDPOINTS;
|
|
8
|
+
exports.OTC_ERROR_CODES = require_types_otcErrorCodes.OTC_ERROR_CODES;
|
|
7
9
|
exports.OTC_RFQ_WS_CLIENT_ENDPOINTS = require_endpoints.OTC_RFQ_WS_CLIENT_ENDPOINTS;
|
|
8
10
|
exports.OtcClient = require_OtcClient.OtcClient;
|
|
9
11
|
exports.buildOtcRfqSubscriptionMessage = require_rfqSubscription.buildOtcRfqSubscriptionMessage;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { a as OtcServerExecutionSuccess, c as OtcServerQuoteStream, d as OtcServerRfqSubscribeStreamRequest, f as OtcServerRfqSubscribeStreamsRequest, h as OtcServerRfqUnsubscribeStreamsRequest, i as OtcServerExecutionResponse, l as OtcServerRfqAck, m as OtcServerRfqUnsubscribeStreamRequest, n as OtcServerExecutionFailure, o as OtcServerQuote, p as OtcServerRfqSubscriptionRequest, r as OtcServerExecutionPendingResolution, s as OtcServerQuoteBatch, t as OtcQuoteSizeUnit, u as OtcServerRfqMessage } from "./serverTypes-
|
|
2
|
-
import { a as OtcReadyResult, c as OtcRfqSubscriptionStreamsParams, i as OtcQuoteStream, l as OtcServerTakerOrderParams, n as OtcGetExecutionStatusParams, o as OtcRfqSubscriptionParams, r as OtcGetReadyParams, s as OtcRfqSubscriptionStreamParams, t as OtcExecuteParams } from "./clientTypes-
|
|
1
|
+
import { a as OtcServerExecutionSuccess, c as OtcServerQuoteStream, d as OtcServerRfqSubscribeStreamRequest, f as OtcServerRfqSubscribeStreamsRequest, h as OtcServerRfqUnsubscribeStreamsRequest, i as OtcServerExecutionResponse, l as OtcServerRfqAck, m as OtcServerRfqUnsubscribeStreamRequest, n as OtcServerExecutionFailure, o as OtcServerQuote, p as OtcServerRfqSubscriptionRequest, r as OtcServerExecutionPendingResolution, s as OtcServerQuoteBatch, t as OtcQuoteSizeUnit, u as OtcServerRfqMessage } from "./serverTypes-DpMJVX7i.cjs";
|
|
2
|
+
import { a as OtcReadyResult, c as OtcRfqSubscriptionStreamsParams, i as OtcQuoteStream, l as OtcServerTakerOrderParams, n as OtcGetExecutionStatusParams, o as OtcRfqSubscriptionParams, r as OtcGetReadyParams, s as OtcRfqSubscriptionStreamParams, t as OtcExecuteParams } from "./clientTypes-CUoQYhxY.cjs";
|
|
3
3
|
import { OtcClient, OtcClientOpts } from "./OtcClient.cjs";
|
|
4
4
|
import { OTC_CLIENT_ENDPOINTS, OTC_RFQ_WS_CLIENT_ENDPOINTS } from "./endpoints.cjs";
|
|
5
5
|
import { buildOtcRfqSubscriptionMessage } from "./rfqSubscription.cjs";
|
|
6
|
-
|
|
6
|
+
import { n as OtcErrorCode, t as OTC_ERROR_CODES } from "./otcErrorCodes-CsmoGjD_.cjs";
|
|
7
|
+
export { OTC_CLIENT_ENDPOINTS, OTC_ERROR_CODES, OTC_RFQ_WS_CLIENT_ENDPOINTS, OtcClient, OtcClientOpts, OtcErrorCode, OtcExecuteParams, OtcGetExecutionStatusParams, OtcGetReadyParams, OtcQuoteSizeUnit, OtcQuoteStream, OtcReadyResult, OtcRfqSubscriptionParams, OtcRfqSubscriptionStreamParams, OtcRfqSubscriptionStreamsParams, OtcServerExecutionFailure, OtcServerExecutionPendingResolution, OtcServerExecutionResponse, OtcServerExecutionSuccess, OtcServerQuote, OtcServerQuoteBatch, OtcServerQuoteStream, OtcServerRfqAck, OtcServerRfqMessage, OtcServerRfqSubscribeStreamRequest, OtcServerRfqSubscribeStreamsRequest, OtcServerRfqSubscriptionRequest, OtcServerRfqUnsubscribeStreamRequest, OtcServerRfqUnsubscribeStreamsRequest, OtcServerTakerOrderParams, buildOtcRfqSubscriptionMessage };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { a as OtcServerExecutionSuccess, c as OtcServerQuoteStream, d as OtcServerRfqSubscribeStreamRequest, f as OtcServerRfqSubscribeStreamsRequest, h as OtcServerRfqUnsubscribeStreamsRequest, i as OtcServerExecutionResponse, l as OtcServerRfqAck, m as OtcServerRfqUnsubscribeStreamRequest, n as OtcServerExecutionFailure, o as OtcServerQuote, p as OtcServerRfqSubscriptionRequest, r as OtcServerExecutionPendingResolution, s as OtcServerQuoteBatch, t as OtcQuoteSizeUnit, u as OtcServerRfqMessage } from "./serverTypes-
|
|
2
|
-
import { a as OtcReadyResult, c as OtcRfqSubscriptionStreamsParams, i as OtcQuoteStream, l as OtcServerTakerOrderParams, n as OtcGetExecutionStatusParams, o as OtcRfqSubscriptionParams, r as OtcGetReadyParams, s as OtcRfqSubscriptionStreamParams, t as OtcExecuteParams } from "./clientTypes-
|
|
1
|
+
import { a as OtcServerExecutionSuccess, c as OtcServerQuoteStream, d as OtcServerRfqSubscribeStreamRequest, f as OtcServerRfqSubscribeStreamsRequest, h as OtcServerRfqUnsubscribeStreamsRequest, i as OtcServerExecutionResponse, l as OtcServerRfqAck, m as OtcServerRfqUnsubscribeStreamRequest, n as OtcServerExecutionFailure, o as OtcServerQuote, p as OtcServerRfqSubscriptionRequest, r as OtcServerExecutionPendingResolution, s as OtcServerQuoteBatch, t as OtcQuoteSizeUnit, u as OtcServerRfqMessage } from "./serverTypes-DpMJVX7i.js";
|
|
2
|
+
import { a as OtcReadyResult, c as OtcRfqSubscriptionStreamsParams, i as OtcQuoteStream, l as OtcServerTakerOrderParams, n as OtcGetExecutionStatusParams, o as OtcRfqSubscriptionParams, r as OtcGetReadyParams, s as OtcRfqSubscriptionStreamParams, t as OtcExecuteParams } from "./clientTypes-CkwgQcEg.js";
|
|
3
3
|
import { OtcClient, OtcClientOpts } from "./OtcClient.js";
|
|
4
4
|
import { OTC_CLIENT_ENDPOINTS, OTC_RFQ_WS_CLIENT_ENDPOINTS } from "./endpoints.js";
|
|
5
5
|
import { buildOtcRfqSubscriptionMessage } from "./rfqSubscription.js";
|
|
6
|
-
|
|
6
|
+
import { n as OtcErrorCode, t as OTC_ERROR_CODES } from "./otcErrorCodes-CsmoGjD_.js";
|
|
7
|
+
export { OTC_CLIENT_ENDPOINTS, OTC_ERROR_CODES, OTC_RFQ_WS_CLIENT_ENDPOINTS, OtcClient, OtcClientOpts, OtcErrorCode, OtcExecuteParams, OtcGetExecutionStatusParams, OtcGetReadyParams, OtcQuoteSizeUnit, OtcQuoteStream, OtcReadyResult, OtcRfqSubscriptionParams, OtcRfqSubscriptionStreamParams, OtcRfqSubscriptionStreamsParams, OtcServerExecutionFailure, OtcServerExecutionPendingResolution, OtcServerExecutionResponse, OtcServerExecutionSuccess, OtcServerQuote, OtcServerQuoteBatch, OtcServerQuoteStream, OtcServerRfqAck, OtcServerRfqMessage, OtcServerRfqSubscribeStreamRequest, OtcServerRfqSubscribeStreamsRequest, OtcServerRfqSubscriptionRequest, OtcServerRfqUnsubscribeStreamRequest, OtcServerRfqUnsubscribeStreamsRequest, OtcServerTakerOrderParams, buildOtcRfqSubscriptionMessage };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { OtcClient } from "./OtcClient.js";
|
|
2
2
|
import { OTC_CLIENT_ENDPOINTS, OTC_RFQ_WS_CLIENT_ENDPOINTS } from "./endpoints.js";
|
|
3
3
|
import { buildOtcRfqSubscriptionMessage } from "./rfqSubscription.js";
|
|
4
|
+
import { OTC_ERROR_CODES } from "./types/otcErrorCodes.js";
|
|
4
5
|
import "./types/index.js";
|
|
5
|
-
export { OTC_CLIENT_ENDPOINTS, OTC_RFQ_WS_CLIENT_ENDPOINTS, OtcClient, buildOtcRfqSubscriptionMessage };
|
|
6
|
+
export { OTC_CLIENT_ENDPOINTS, OTC_ERROR_CODES, OTC_RFQ_WS_CLIENT_ENDPOINTS, OtcClient, buildOtcRfqSubscriptionMessage };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
//#region src/types/otcErrorCodes.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Numeric error codes returned by the OTC service API. OTC-specific codes use the service-owned
|
|
4
|
+
* 70xxx range and mirror the backend's `execution_error_code` module; the remaining codes are
|
|
5
|
+
* shared cross-service codes from the backend's common error enum, inlined via spread from
|
|
6
|
+
* {@link NADO_ERROR_CODES}. A rejection returned directly by the Nado Gateway keeps its
|
|
7
|
+
* original Gateway code instead (see `ENGINE_ERROR_CODES` in `@nadohq/engine-client`).
|
|
8
|
+
*
|
|
9
|
+
* These codes are returned in the `error_code` field of execution responses — see
|
|
10
|
+
* {@link OtcServerExecutionFailure} and {@link OtcServerExecutionPendingResolution}. Branch on
|
|
11
|
+
* `recovery_action` first; a code never authorizes resending a signed order.
|
|
12
|
+
*/
|
|
13
|
+
declare const OTC_ERROR_CODES: {
|
|
14
|
+
readonly INVALID_EXECUTION_REQUEST: 70000;
|
|
15
|
+
readonly TAKER_ORDER_CONFLICT: 70020;
|
|
16
|
+
readonly DEAL_ID_CONFLICT: 70021; /** The deal is still executing, even when `status` is `failure`. Poll `getExecutionStatus` again after `retry_after_ms`. */
|
|
17
|
+
readonly EXECUTION_IN_PROGRESS: 70022; /** No execution record for this deal. Settlement is unknown: resolve the position from Nado and never resubmit. */
|
|
18
|
+
readonly EXECUTION_NOT_FOUND: 70023;
|
|
19
|
+
readonly OTC_CAPACITY_EXCEEDED: 70100;
|
|
20
|
+
readonly OTC_WORKER_UNAVAILABLE: 70101;
|
|
21
|
+
readonly EXECUTOR_SESSION_CAPACITY_EXCEEDED: 70102;
|
|
22
|
+
readonly EXECUTION_WORKER_FAILED: 70103;
|
|
23
|
+
readonly OTC_ADMISSION_LIMITED: 70104;
|
|
24
|
+
readonly OTC_EXECUTION_UNAVAILABLE: 70105;
|
|
25
|
+
readonly EXECUTION_EXPIRED: 70110;
|
|
26
|
+
readonly EXECUTION_WINDOW_TOO_SHORT: 70111;
|
|
27
|
+
readonly TAKER_INSUFFICIENT_CAPACITY: 70200;
|
|
28
|
+
readonly SPOT_QUOTE_CAPACITY_INSUFFICIENT: 70201;
|
|
29
|
+
readonly SPOT_BASE_CAPACITY_INSUFFICIENT: 70202;
|
|
30
|
+
readonly PERP_MARGIN_INSUFFICIENT: 70203;
|
|
31
|
+
readonly PRICER_UNAVAILABLE: 70300;
|
|
32
|
+
readonly PRICE_NOT_ACCEPTABLE: 70301;
|
|
33
|
+
readonly INSUFFICIENT_LIQUIDITY: 70302;
|
|
34
|
+
readonly PRICER_CAPACITY_EXCEEDED: 70303;
|
|
35
|
+
readonly PRICER_IDEMPOTENCY_CONFLICT: 70304;
|
|
36
|
+
readonly PRICER_REQUEST_AMOUNT_INVALID: 70305;
|
|
37
|
+
readonly PRICER_PLAN_DEADLINE_INVALID: 70306;
|
|
38
|
+
readonly PRICER_EMPTY_PLAN: 70310;
|
|
39
|
+
readonly PRICER_TOO_MANY_MAKERS: 70311;
|
|
40
|
+
readonly PRICER_MAKER_PRODUCT_MISMATCH: 70312;
|
|
41
|
+
readonly PRICER_MAKER_SENDER_INVALID: 70313;
|
|
42
|
+
readonly PRICER_MAKER_SIGNATURE_INVALID: 70314;
|
|
43
|
+
readonly PRICER_MAKER_AMOUNT_INVALID: 70315;
|
|
44
|
+
readonly PRICER_MAKER_PRICE_INVALID: 70316;
|
|
45
|
+
readonly PRICER_MAKER_EXPIRED: 70317;
|
|
46
|
+
readonly PRICER_MAKER_NONCE_INVALID: 70318;
|
|
47
|
+
readonly PRICER_MAKER_APPENDIX_INVALID: 70319;
|
|
48
|
+
readonly PRICER_MAKER_SIDE_MISMATCH: 70320;
|
|
49
|
+
readonly PRICER_MAKER_LEVERAGE_INVALID: 70321;
|
|
50
|
+
readonly PRICER_MAKER_BORROW_MARGIN_INVALID: 70322;
|
|
51
|
+
readonly PRICER_SELF_TRADE: 70323;
|
|
52
|
+
readonly PRICER_DUPLICATE_MAKER: 70324;
|
|
53
|
+
readonly PRICER_MAKER_RECV_TIME_INVALID: 70325;
|
|
54
|
+
readonly PRICER_MAKER_AMOUNT_OFF_INCREMENT: 70326;
|
|
55
|
+
readonly PRICER_MAKER_PRICE_OFF_INCREMENT: 70327;
|
|
56
|
+
readonly PRICER_MAKER_BELOW_MINIMUM_NOTIONAL: 70328;
|
|
57
|
+
readonly PRICER_AMOUNT_MISMATCH: 70329;
|
|
58
|
+
readonly PRICER_LIMIT_VIOLATED: 70330;
|
|
59
|
+
readonly PRICER_MAKER_DIGEST_INVALID: 70331;
|
|
60
|
+
readonly PRICER_HEDGE_CAPACITY_INSUFFICIENT: 70332;
|
|
61
|
+
readonly INVALID_ORDER_PRICE_INCREMENT: 70400;
|
|
62
|
+
readonly INVALID_ORDER_AMOUNT_INCREMENT: 70401;
|
|
63
|
+
readonly ORDER_BELOW_MINIMUM_NOTIONAL: 70402;
|
|
64
|
+
readonly ORDER_EXPIRED: 70403;
|
|
65
|
+
readonly ACCOUNT_INSUFFICIENT_HEALTH: 70404;
|
|
66
|
+
readonly ORDER_PRICE_OUTSIDE_ORACLE_RANGE: 70405;
|
|
67
|
+
readonly NADO_LATE_RECEIVE: 70406;
|
|
68
|
+
readonly NADO_EARLY_RECEIVE: 70407;
|
|
69
|
+
readonly INVALID_NONCE: 70408;
|
|
70
|
+
readonly INVALID_SIGNATURE: 70409;
|
|
71
|
+
readonly FOK_NOT_FILLED: 70410;
|
|
72
|
+
readonly ORDERS_CANNOT_BE_MATCHED: 70411;
|
|
73
|
+
readonly OTC_AMOUNT_MISMATCH: 70412;
|
|
74
|
+
readonly ORDERS_DO_NOT_CROSS: 70413;
|
|
75
|
+
readonly OTC_ORDER_TYPE_INVALID: 70414;
|
|
76
|
+
readonly OTC_SELF_TRADE: 70415;
|
|
77
|
+
readonly OTC_DUPLICATE_MAKER: 70416;
|
|
78
|
+
readonly NADO_INTERNAL_ERROR: 70417;
|
|
79
|
+
readonly NADO_PRECHECK_UNAVAILABLE: 70418;
|
|
80
|
+
readonly NADO_REJECTED: 70419;
|
|
81
|
+
readonly REDUCE_ONLY_INCREASES_POSITION: 70420;
|
|
82
|
+
readonly SIGNER_LOOKUP_UNAVAILABLE: 70421; /** Settlement outcome is unknown; returned with `status: "pending_resolution"`. Resolve the position from Nado and never resubmit. */
|
|
83
|
+
readonly SETTLEMENT_OUTCOME_UNKNOWN: 70500; /** Unclassified OTC error. */
|
|
84
|
+
readonly UNKNOWN: 70999;
|
|
85
|
+
readonly RATE_LIMIT: 1000;
|
|
86
|
+
readonly BLACKLISTED_ADDRESS: 1001;
|
|
87
|
+
readonly BLOCKED_LOCATION: 1002;
|
|
88
|
+
readonly BLOCKED_SUBDIVISION: 1003;
|
|
89
|
+
readonly MAINTENANCE: 1004;
|
|
90
|
+
readonly GATEWAY_INVALID_REQUEST: 1005;
|
|
91
|
+
readonly SERVICE_UNAVAILABLE: 1006;
|
|
92
|
+
readonly INVALID_SIGNER: 2028;
|
|
93
|
+
readonly PERP_TICK_FORMATTING: 4000;
|
|
94
|
+
readonly NOT_IMPLEMENTED: 4001;
|
|
95
|
+
readonly TEMPORARILY_DISABLED_MINT_LP: 4002;
|
|
96
|
+
readonly EVM_REVERT: 4003;
|
|
97
|
+
readonly WITHDRAW_RISK: 4004;
|
|
98
|
+
readonly INTERNAL_ERROR: 5000;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Union of all known OTC service API error codes.
|
|
102
|
+
*/
|
|
103
|
+
type OtcErrorCode = (typeof OTC_ERROR_CODES)[keyof typeof OTC_ERROR_CODES];
|
|
104
|
+
//#endregion
|
|
105
|
+
export { OtcErrorCode as n, OTC_ERROR_CODES as t };
|
|
106
|
+
//# sourceMappingURL=otcErrorCodes-CsmoGjD_.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otcErrorCodes-CsmoGjD_.d.cts","names":[],"sources":["../src/types/src/types/otcErrorCodes.ts"],"mappings":";;AAaA;;;;;;;;;;cAAa,eAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8FD,YAAA,WACF,eAAA,eAA8B,eAAe"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
//#region src/types/otcErrorCodes.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Numeric error codes returned by the OTC service API. OTC-specific codes use the service-owned
|
|
4
|
+
* 70xxx range and mirror the backend's `execution_error_code` module; the remaining codes are
|
|
5
|
+
* shared cross-service codes from the backend's common error enum, inlined via spread from
|
|
6
|
+
* {@link NADO_ERROR_CODES}. A rejection returned directly by the Nado Gateway keeps its
|
|
7
|
+
* original Gateway code instead (see `ENGINE_ERROR_CODES` in `@nadohq/engine-client`).
|
|
8
|
+
*
|
|
9
|
+
* These codes are returned in the `error_code` field of execution responses — see
|
|
10
|
+
* {@link OtcServerExecutionFailure} and {@link OtcServerExecutionPendingResolution}. Branch on
|
|
11
|
+
* `recovery_action` first; a code never authorizes resending a signed order.
|
|
12
|
+
*/
|
|
13
|
+
declare const OTC_ERROR_CODES: {
|
|
14
|
+
readonly INVALID_EXECUTION_REQUEST: 70000;
|
|
15
|
+
readonly TAKER_ORDER_CONFLICT: 70020;
|
|
16
|
+
readonly DEAL_ID_CONFLICT: 70021; /** The deal is still executing, even when `status` is `failure`. Poll `getExecutionStatus` again after `retry_after_ms`. */
|
|
17
|
+
readonly EXECUTION_IN_PROGRESS: 70022; /** No execution record for this deal. Settlement is unknown: resolve the position from Nado and never resubmit. */
|
|
18
|
+
readonly EXECUTION_NOT_FOUND: 70023;
|
|
19
|
+
readonly OTC_CAPACITY_EXCEEDED: 70100;
|
|
20
|
+
readonly OTC_WORKER_UNAVAILABLE: 70101;
|
|
21
|
+
readonly EXECUTOR_SESSION_CAPACITY_EXCEEDED: 70102;
|
|
22
|
+
readonly EXECUTION_WORKER_FAILED: 70103;
|
|
23
|
+
readonly OTC_ADMISSION_LIMITED: 70104;
|
|
24
|
+
readonly OTC_EXECUTION_UNAVAILABLE: 70105;
|
|
25
|
+
readonly EXECUTION_EXPIRED: 70110;
|
|
26
|
+
readonly EXECUTION_WINDOW_TOO_SHORT: 70111;
|
|
27
|
+
readonly TAKER_INSUFFICIENT_CAPACITY: 70200;
|
|
28
|
+
readonly SPOT_QUOTE_CAPACITY_INSUFFICIENT: 70201;
|
|
29
|
+
readonly SPOT_BASE_CAPACITY_INSUFFICIENT: 70202;
|
|
30
|
+
readonly PERP_MARGIN_INSUFFICIENT: 70203;
|
|
31
|
+
readonly PRICER_UNAVAILABLE: 70300;
|
|
32
|
+
readonly PRICE_NOT_ACCEPTABLE: 70301;
|
|
33
|
+
readonly INSUFFICIENT_LIQUIDITY: 70302;
|
|
34
|
+
readonly PRICER_CAPACITY_EXCEEDED: 70303;
|
|
35
|
+
readonly PRICER_IDEMPOTENCY_CONFLICT: 70304;
|
|
36
|
+
readonly PRICER_REQUEST_AMOUNT_INVALID: 70305;
|
|
37
|
+
readonly PRICER_PLAN_DEADLINE_INVALID: 70306;
|
|
38
|
+
readonly PRICER_EMPTY_PLAN: 70310;
|
|
39
|
+
readonly PRICER_TOO_MANY_MAKERS: 70311;
|
|
40
|
+
readonly PRICER_MAKER_PRODUCT_MISMATCH: 70312;
|
|
41
|
+
readonly PRICER_MAKER_SENDER_INVALID: 70313;
|
|
42
|
+
readonly PRICER_MAKER_SIGNATURE_INVALID: 70314;
|
|
43
|
+
readonly PRICER_MAKER_AMOUNT_INVALID: 70315;
|
|
44
|
+
readonly PRICER_MAKER_PRICE_INVALID: 70316;
|
|
45
|
+
readonly PRICER_MAKER_EXPIRED: 70317;
|
|
46
|
+
readonly PRICER_MAKER_NONCE_INVALID: 70318;
|
|
47
|
+
readonly PRICER_MAKER_APPENDIX_INVALID: 70319;
|
|
48
|
+
readonly PRICER_MAKER_SIDE_MISMATCH: 70320;
|
|
49
|
+
readonly PRICER_MAKER_LEVERAGE_INVALID: 70321;
|
|
50
|
+
readonly PRICER_MAKER_BORROW_MARGIN_INVALID: 70322;
|
|
51
|
+
readonly PRICER_SELF_TRADE: 70323;
|
|
52
|
+
readonly PRICER_DUPLICATE_MAKER: 70324;
|
|
53
|
+
readonly PRICER_MAKER_RECV_TIME_INVALID: 70325;
|
|
54
|
+
readonly PRICER_MAKER_AMOUNT_OFF_INCREMENT: 70326;
|
|
55
|
+
readonly PRICER_MAKER_PRICE_OFF_INCREMENT: 70327;
|
|
56
|
+
readonly PRICER_MAKER_BELOW_MINIMUM_NOTIONAL: 70328;
|
|
57
|
+
readonly PRICER_AMOUNT_MISMATCH: 70329;
|
|
58
|
+
readonly PRICER_LIMIT_VIOLATED: 70330;
|
|
59
|
+
readonly PRICER_MAKER_DIGEST_INVALID: 70331;
|
|
60
|
+
readonly PRICER_HEDGE_CAPACITY_INSUFFICIENT: 70332;
|
|
61
|
+
readonly INVALID_ORDER_PRICE_INCREMENT: 70400;
|
|
62
|
+
readonly INVALID_ORDER_AMOUNT_INCREMENT: 70401;
|
|
63
|
+
readonly ORDER_BELOW_MINIMUM_NOTIONAL: 70402;
|
|
64
|
+
readonly ORDER_EXPIRED: 70403;
|
|
65
|
+
readonly ACCOUNT_INSUFFICIENT_HEALTH: 70404;
|
|
66
|
+
readonly ORDER_PRICE_OUTSIDE_ORACLE_RANGE: 70405;
|
|
67
|
+
readonly NADO_LATE_RECEIVE: 70406;
|
|
68
|
+
readonly NADO_EARLY_RECEIVE: 70407;
|
|
69
|
+
readonly INVALID_NONCE: 70408;
|
|
70
|
+
readonly INVALID_SIGNATURE: 70409;
|
|
71
|
+
readonly FOK_NOT_FILLED: 70410;
|
|
72
|
+
readonly ORDERS_CANNOT_BE_MATCHED: 70411;
|
|
73
|
+
readonly OTC_AMOUNT_MISMATCH: 70412;
|
|
74
|
+
readonly ORDERS_DO_NOT_CROSS: 70413;
|
|
75
|
+
readonly OTC_ORDER_TYPE_INVALID: 70414;
|
|
76
|
+
readonly OTC_SELF_TRADE: 70415;
|
|
77
|
+
readonly OTC_DUPLICATE_MAKER: 70416;
|
|
78
|
+
readonly NADO_INTERNAL_ERROR: 70417;
|
|
79
|
+
readonly NADO_PRECHECK_UNAVAILABLE: 70418;
|
|
80
|
+
readonly NADO_REJECTED: 70419;
|
|
81
|
+
readonly REDUCE_ONLY_INCREASES_POSITION: 70420;
|
|
82
|
+
readonly SIGNER_LOOKUP_UNAVAILABLE: 70421; /** Settlement outcome is unknown; returned with `status: "pending_resolution"`. Resolve the position from Nado and never resubmit. */
|
|
83
|
+
readonly SETTLEMENT_OUTCOME_UNKNOWN: 70500; /** Unclassified OTC error. */
|
|
84
|
+
readonly UNKNOWN: 70999;
|
|
85
|
+
readonly RATE_LIMIT: 1000;
|
|
86
|
+
readonly BLACKLISTED_ADDRESS: 1001;
|
|
87
|
+
readonly BLOCKED_LOCATION: 1002;
|
|
88
|
+
readonly BLOCKED_SUBDIVISION: 1003;
|
|
89
|
+
readonly MAINTENANCE: 1004;
|
|
90
|
+
readonly GATEWAY_INVALID_REQUEST: 1005;
|
|
91
|
+
readonly SERVICE_UNAVAILABLE: 1006;
|
|
92
|
+
readonly INVALID_SIGNER: 2028;
|
|
93
|
+
readonly PERP_TICK_FORMATTING: 4000;
|
|
94
|
+
readonly NOT_IMPLEMENTED: 4001;
|
|
95
|
+
readonly TEMPORARILY_DISABLED_MINT_LP: 4002;
|
|
96
|
+
readonly EVM_REVERT: 4003;
|
|
97
|
+
readonly WITHDRAW_RISK: 4004;
|
|
98
|
+
readonly INTERNAL_ERROR: 5000;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Union of all known OTC service API error codes.
|
|
102
|
+
*/
|
|
103
|
+
type OtcErrorCode = (typeof OTC_ERROR_CODES)[keyof typeof OTC_ERROR_CODES];
|
|
104
|
+
//#endregion
|
|
105
|
+
export { OtcErrorCode as n, OTC_ERROR_CODES as t };
|
|
106
|
+
//# sourceMappingURL=otcErrorCodes-CsmoGjD_.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otcErrorCodes-CsmoGjD_.d.ts","names":[],"sources":["../src/types/src/types/otcErrorCodes.ts"],"mappings":";;AAaA;;;;;;;;;;cAAa,eAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8FD,YAAA,WACF,eAAA,eAA8B,eAAe"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as OtcServerRfqSubscriptionRequest } from "./serverTypes-
|
|
2
|
-
import { o as OtcRfqSubscriptionParams } from "./clientTypes-
|
|
1
|
+
import { p as OtcServerRfqSubscriptionRequest } from "./serverTypes-DpMJVX7i.cjs";
|
|
2
|
+
import { o as OtcRfqSubscriptionParams } from "./clientTypes-CUoQYhxY.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/rfqSubscription.d.ts
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as OtcServerRfqSubscriptionRequest } from "./serverTypes-
|
|
2
|
-
import { o as OtcRfqSubscriptionParams } from "./clientTypes-
|
|
1
|
+
import { p as OtcServerRfqSubscriptionRequest } from "./serverTypes-DpMJVX7i.js";
|
|
2
|
+
import { o as OtcRfqSubscriptionParams } from "./clientTypes-CkwgQcEg.js";
|
|
3
3
|
|
|
4
4
|
//#region src/rfqSubscription.d.ts
|
|
5
5
|
/**
|
|
@@ -3,7 +3,7 @@ type OtcQuoteSizeUnit = 'base' | 'quote';
|
|
|
3
3
|
interface OtcServerExecutionDiagnostics {
|
|
4
4
|
failure_source?: string;
|
|
5
5
|
failure_stage?: string;
|
|
6
|
-
upstream_error_code?:
|
|
6
|
+
upstream_error_code?: string;
|
|
7
7
|
retryable?: boolean;
|
|
8
8
|
/**
|
|
9
9
|
* Documented values are `retry_same_request`, `sign_new_order`, `reconcile`, `wait`, and
|
|
@@ -90,4 +90,4 @@ interface OtcServerRfqAck {
|
|
|
90
90
|
type OtcServerRfqMessage = OtcServerRfqAck | OtcServerQuoteBatch;
|
|
91
91
|
//#endregion
|
|
92
92
|
export { OtcServerExecutionSuccess as a, OtcServerQuoteStream as c, OtcServerRfqSubscribeStreamRequest as d, OtcServerRfqSubscribeStreamsRequest as f, OtcServerRfqUnsubscribeStreamsRequest as h, OtcServerExecutionResponse as i, OtcServerRfqAck as l, OtcServerRfqUnsubscribeStreamRequest as m, OtcServerExecutionFailure as n, OtcServerQuote as o, OtcServerRfqSubscriptionRequest as p, OtcServerExecutionPendingResolution as r, OtcServerQuoteBatch as s, OtcQuoteSizeUnit as t, OtcServerRfqMessage as u };
|
|
93
|
-
//# sourceMappingURL=serverTypes-
|
|
93
|
+
//# sourceMappingURL=serverTypes-DpMJVX7i.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverTypes-
|
|
1
|
+
{"version":3,"file":"serverTypes-DpMJVX7i.d.cts","names":[],"sources":["../src/types/src/types/serverTypes.ts"],"mappings":";KAAY,gBAAA;AAAA,UAEF,6BAAA;EACR,cAAA;EACA,aAAA;EACA,mBAAA;EACA,SAAA;EAJQ;;;;EASR,eAAA;EACA,cAAA;AAAA;AAAA,UAGe,yBAAA;EACf,MAAA;EACA,OAAA;EACA,YAAA;EACA,aAAA;AAAA;AAAA,UAGe,yBAAA,SAAkC,6BAA6B;EAC9E,MAAA;EACA,KAAA;EACA,UAAA;EACA,OAAA;EACA,YAAA;AAAA;AAAA,UAGe,mCAAA,SAA4C,6BAA6B;EACxF,MAAA;EACA,OAAA;EACA,YAAA;EACA,KAAA;EACA,UAAA;AAAA;;KAIU,0BAAA,GACR,yBAAA,GACA,yBAAA,GACA,mCAAA;AAAA,UAEa,oBAAA;EACf,IAAA;EACA,UAAA;EACA,MAAA;EACA,IAAA;EACA,SAAA,EAAW,gBAAgB;EAC3B,SAAA;AAAA;AAAA,UAGe,kCAAA;EACf,MAAA;EACA,EAAA;EACA,MAAA,EAAQ,oBAAoB;AAAA;AAAA,UAGb,mCAAA;EACf,MAAA;EACA,EAAA;EACA,OAAA,EAAS,oBAAoB;AAAA;AAAA,UAGd,oCAAA;EACf,MAAA;EACA,EAAA;EACA,MAAA,EAAQ,oBAAoB;AAAA;AAAA,UAGb,qCAAA;EACf,MAAA;EACA,EAAA;EACA,OAAA,EAAS,oBAAoB;AAAA;AAAA,KAGnB,+BAAA,GACR,kCAAA,GACA,mCAAA,GACA,oCAAA,GACA,qCAAA;AAvCmC;AAAA,UA0CtB,cAAA;EACf,UAAA;EACA,IAAA;EACA,SAAA,EAAW,gBAAgB;EAC3B,IAAA;EACA,MAAA;EACA,SAAA;EACA,MAAA;EACA,SAAA;EACA,cAAA;EACA,SAAA;AAAA;AAAA,UAGe,mBAAA;EACf,IAAA;EACA,IAAA;EACA,MAAA,EAAQ,cAAc;AAAA;AAAA,UAGP,eAAA;EACf,MAAA;EACA,EAAA;EAjDQ;EAmDR,KAAA;AAAA;AAAA,KAGU,mBAAA,GAAsB,eAAA,GAAkB,mBAAmB"}
|
|
@@ -3,7 +3,7 @@ type OtcQuoteSizeUnit = 'base' | 'quote';
|
|
|
3
3
|
interface OtcServerExecutionDiagnostics {
|
|
4
4
|
failure_source?: string;
|
|
5
5
|
failure_stage?: string;
|
|
6
|
-
upstream_error_code?:
|
|
6
|
+
upstream_error_code?: string;
|
|
7
7
|
retryable?: boolean;
|
|
8
8
|
/**
|
|
9
9
|
* Documented values are `retry_same_request`, `sign_new_order`, `reconcile`, `wait`, and
|
|
@@ -90,4 +90,4 @@ interface OtcServerRfqAck {
|
|
|
90
90
|
type OtcServerRfqMessage = OtcServerRfqAck | OtcServerQuoteBatch;
|
|
91
91
|
//#endregion
|
|
92
92
|
export { OtcServerExecutionSuccess as a, OtcServerQuoteStream as c, OtcServerRfqSubscribeStreamRequest as d, OtcServerRfqSubscribeStreamsRequest as f, OtcServerRfqUnsubscribeStreamsRequest as h, OtcServerExecutionResponse as i, OtcServerRfqAck as l, OtcServerRfqUnsubscribeStreamRequest as m, OtcServerExecutionFailure as n, OtcServerQuote as o, OtcServerRfqSubscriptionRequest as p, OtcServerExecutionPendingResolution as r, OtcServerQuoteBatch as s, OtcQuoteSizeUnit as t, OtcServerRfqMessage as u };
|
|
93
|
-
//# sourceMappingURL=serverTypes-
|
|
93
|
+
//# sourceMappingURL=serverTypes-DpMJVX7i.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverTypes-
|
|
1
|
+
{"version":3,"file":"serverTypes-DpMJVX7i.d.ts","names":[],"sources":["../src/types/src/types/serverTypes.ts"],"mappings":";KAAY,gBAAA;AAAA,UAEF,6BAAA;EACR,cAAA;EACA,aAAA;EACA,mBAAA;EACA,SAAA;EAJQ;;;;EASR,eAAA;EACA,cAAA;AAAA;AAAA,UAGe,yBAAA;EACf,MAAA;EACA,OAAA;EACA,YAAA;EACA,aAAA;AAAA;AAAA,UAGe,yBAAA,SAAkC,6BAA6B;EAC9E,MAAA;EACA,KAAA;EACA,UAAA;EACA,OAAA;EACA,YAAA;AAAA;AAAA,UAGe,mCAAA,SAA4C,6BAA6B;EACxF,MAAA;EACA,OAAA;EACA,YAAA;EACA,KAAA;EACA,UAAA;AAAA;;KAIU,0BAAA,GACR,yBAAA,GACA,yBAAA,GACA,mCAAA;AAAA,UAEa,oBAAA;EACf,IAAA;EACA,UAAA;EACA,MAAA;EACA,IAAA;EACA,SAAA,EAAW,gBAAgB;EAC3B,SAAA;AAAA;AAAA,UAGe,kCAAA;EACf,MAAA;EACA,EAAA;EACA,MAAA,EAAQ,oBAAoB;AAAA;AAAA,UAGb,mCAAA;EACf,MAAA;EACA,EAAA;EACA,OAAA,EAAS,oBAAoB;AAAA;AAAA,UAGd,oCAAA;EACf,MAAA;EACA,EAAA;EACA,MAAA,EAAQ,oBAAoB;AAAA;AAAA,UAGb,qCAAA;EACf,MAAA;EACA,EAAA;EACA,OAAA,EAAS,oBAAoB;AAAA;AAAA,KAGnB,+BAAA,GACR,kCAAA,GACA,mCAAA,GACA,oCAAA,GACA,qCAAA;AAvCmC;AAAA,UA0CtB,cAAA;EACf,UAAA;EACA,IAAA;EACA,SAAA,EAAW,gBAAgB;EAC3B,IAAA;EACA,MAAA;EACA,SAAA;EACA,MAAA;EACA,SAAA;EACA,cAAA;EACA,SAAA;AAAA;AAAA,UAGe,mBAAA;EACf,IAAA;EACA,IAAA;EACA,MAAA,EAAQ,cAAc;AAAA;AAAA,UAGP,eAAA;EACf,MAAA;EACA,EAAA;EAjDQ;EAmDR,KAAA;AAAA;AAAA,KAGU,mBAAA,GAAsB,eAAA,GAAkB,mBAAmB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OtcReadyResult, c as OtcRfqSubscriptionStreamsParams, i as OtcQuoteStream, l as OtcServerTakerOrderParams, n as OtcGetExecutionStatusParams, o as OtcRfqSubscriptionParams, r as OtcGetReadyParams, s as OtcRfqSubscriptionStreamParams, t as OtcExecuteParams } from "../clientTypes-
|
|
1
|
+
import { a as OtcReadyResult, c as OtcRfqSubscriptionStreamsParams, i as OtcQuoteStream, l as OtcServerTakerOrderParams, n as OtcGetExecutionStatusParams, o as OtcRfqSubscriptionParams, r as OtcGetReadyParams, s as OtcRfqSubscriptionStreamParams, t as OtcExecuteParams } from "../clientTypes-CUoQYhxY.cjs";
|
|
2
2
|
export { OtcExecuteParams, OtcGetExecutionStatusParams, OtcGetReadyParams, OtcQuoteStream, OtcReadyResult, OtcRfqSubscriptionParams, OtcRfqSubscriptionStreamParams, OtcRfqSubscriptionStreamsParams, OtcServerTakerOrderParams };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OtcReadyResult, c as OtcRfqSubscriptionStreamsParams, i as OtcQuoteStream, l as OtcServerTakerOrderParams, n as OtcGetExecutionStatusParams, o as OtcRfqSubscriptionParams, r as OtcGetReadyParams, s as OtcRfqSubscriptionStreamParams, t as OtcExecuteParams } from "../clientTypes-
|
|
1
|
+
import { a as OtcReadyResult, c as OtcRfqSubscriptionStreamsParams, i as OtcQuoteStream, l as OtcServerTakerOrderParams, n as OtcGetExecutionStatusParams, o as OtcRfqSubscriptionParams, r as OtcGetReadyParams, s as OtcRfqSubscriptionStreamParams, t as OtcExecuteParams } from "../clientTypes-CkwgQcEg.js";
|
|
2
2
|
export { OtcExecuteParams, OtcGetExecutionStatusParams, OtcGetReadyParams, OtcQuoteStream, OtcReadyResult, OtcRfqSubscriptionParams, OtcRfqSubscriptionStreamParams, OtcRfqSubscriptionStreamsParams, OtcServerTakerOrderParams };
|
package/dist/types/index.cjs
CHANGED
package/dist/types/index.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { a as OtcServerExecutionSuccess, c as OtcServerQuoteStream, d as OtcServerRfqSubscribeStreamRequest, f as OtcServerRfqSubscribeStreamsRequest, h as OtcServerRfqUnsubscribeStreamsRequest, i as OtcServerExecutionResponse, l as OtcServerRfqAck, m as OtcServerRfqUnsubscribeStreamRequest, n as OtcServerExecutionFailure, o as OtcServerQuote, p as OtcServerRfqSubscriptionRequest, r as OtcServerExecutionPendingResolution, s as OtcServerQuoteBatch, t as OtcQuoteSizeUnit, u as OtcServerRfqMessage } from "../serverTypes-
|
|
2
|
-
import { a as OtcReadyResult, c as OtcRfqSubscriptionStreamsParams, i as OtcQuoteStream, l as OtcServerTakerOrderParams, n as OtcGetExecutionStatusParams, o as OtcRfqSubscriptionParams, r as OtcGetReadyParams, s as OtcRfqSubscriptionStreamParams, t as OtcExecuteParams } from "../clientTypes-
|
|
3
|
-
|
|
1
|
+
import { a as OtcServerExecutionSuccess, c as OtcServerQuoteStream, d as OtcServerRfqSubscribeStreamRequest, f as OtcServerRfqSubscribeStreamsRequest, h as OtcServerRfqUnsubscribeStreamsRequest, i as OtcServerExecutionResponse, l as OtcServerRfqAck, m as OtcServerRfqUnsubscribeStreamRequest, n as OtcServerExecutionFailure, o as OtcServerQuote, p as OtcServerRfqSubscriptionRequest, r as OtcServerExecutionPendingResolution, s as OtcServerQuoteBatch, t as OtcQuoteSizeUnit, u as OtcServerRfqMessage } from "../serverTypes-DpMJVX7i.cjs";
|
|
2
|
+
import { a as OtcReadyResult, c as OtcRfqSubscriptionStreamsParams, i as OtcQuoteStream, l as OtcServerTakerOrderParams, n as OtcGetExecutionStatusParams, o as OtcRfqSubscriptionParams, r as OtcGetReadyParams, s as OtcRfqSubscriptionStreamParams, t as OtcExecuteParams } from "../clientTypes-CUoQYhxY.cjs";
|
|
3
|
+
import { n as OtcErrorCode, t as OTC_ERROR_CODES } from "../otcErrorCodes-CsmoGjD_.cjs";
|
|
4
|
+
export { OTC_ERROR_CODES, OtcErrorCode, OtcExecuteParams, OtcGetExecutionStatusParams, OtcGetReadyParams, OtcQuoteSizeUnit, OtcQuoteStream, OtcReadyResult, OtcRfqSubscriptionParams, OtcRfqSubscriptionStreamParams, OtcRfqSubscriptionStreamsParams, OtcServerExecutionFailure, OtcServerExecutionPendingResolution, OtcServerExecutionResponse, OtcServerExecutionSuccess, OtcServerQuote, OtcServerQuoteBatch, OtcServerQuoteStream, OtcServerRfqAck, OtcServerRfqMessage, OtcServerRfqSubscribeStreamRequest, OtcServerRfqSubscribeStreamsRequest, OtcServerRfqSubscriptionRequest, OtcServerRfqUnsubscribeStreamRequest, OtcServerRfqUnsubscribeStreamsRequest, OtcServerTakerOrderParams };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { a as OtcServerExecutionSuccess, c as OtcServerQuoteStream, d as OtcServerRfqSubscribeStreamRequest, f as OtcServerRfqSubscribeStreamsRequest, h as OtcServerRfqUnsubscribeStreamsRequest, i as OtcServerExecutionResponse, l as OtcServerRfqAck, m as OtcServerRfqUnsubscribeStreamRequest, n as OtcServerExecutionFailure, o as OtcServerQuote, p as OtcServerRfqSubscriptionRequest, r as OtcServerExecutionPendingResolution, s as OtcServerQuoteBatch, t as OtcQuoteSizeUnit, u as OtcServerRfqMessage } from "../serverTypes-
|
|
2
|
-
import { a as OtcReadyResult, c as OtcRfqSubscriptionStreamsParams, i as OtcQuoteStream, l as OtcServerTakerOrderParams, n as OtcGetExecutionStatusParams, o as OtcRfqSubscriptionParams, r as OtcGetReadyParams, s as OtcRfqSubscriptionStreamParams, t as OtcExecuteParams } from "../clientTypes-
|
|
3
|
-
|
|
1
|
+
import { a as OtcServerExecutionSuccess, c as OtcServerQuoteStream, d as OtcServerRfqSubscribeStreamRequest, f as OtcServerRfqSubscribeStreamsRequest, h as OtcServerRfqUnsubscribeStreamsRequest, i as OtcServerExecutionResponse, l as OtcServerRfqAck, m as OtcServerRfqUnsubscribeStreamRequest, n as OtcServerExecutionFailure, o as OtcServerQuote, p as OtcServerRfqSubscriptionRequest, r as OtcServerExecutionPendingResolution, s as OtcServerQuoteBatch, t as OtcQuoteSizeUnit, u as OtcServerRfqMessage } from "../serverTypes-DpMJVX7i.js";
|
|
2
|
+
import { a as OtcReadyResult, c as OtcRfqSubscriptionStreamsParams, i as OtcQuoteStream, l as OtcServerTakerOrderParams, n as OtcGetExecutionStatusParams, o as OtcRfqSubscriptionParams, r as OtcGetReadyParams, s as OtcRfqSubscriptionStreamParams, t as OtcExecuteParams } from "../clientTypes-CkwgQcEg.js";
|
|
3
|
+
import { n as OtcErrorCode, t as OTC_ERROR_CODES } from "../otcErrorCodes-CsmoGjD_.js";
|
|
4
|
+
export { OTC_ERROR_CODES, OtcErrorCode, OtcExecuteParams, OtcGetExecutionStatusParams, OtcGetReadyParams, OtcQuoteSizeUnit, OtcQuoteStream, OtcReadyResult, OtcRfqSubscriptionParams, OtcRfqSubscriptionStreamParams, OtcRfqSubscriptionStreamsParams, OtcServerExecutionFailure, OtcServerExecutionPendingResolution, OtcServerExecutionResponse, OtcServerExecutionSuccess, OtcServerQuote, OtcServerQuoteBatch, OtcServerQuoteStream, OtcServerRfqAck, OtcServerRfqMessage, OtcServerRfqSubscribeStreamRequest, OtcServerRfqSubscribeStreamsRequest, OtcServerRfqSubscriptionRequest, OtcServerRfqUnsubscribeStreamRequest, OtcServerRfqUnsubscribeStreamsRequest, OtcServerTakerOrderParams };
|
package/dist/types/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { OTC_ERROR_CODES } from "./otcErrorCodes.js";
|
|
2
|
+
export { OTC_ERROR_CODES };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/types/otcErrorCodes.ts
|
|
3
|
+
/**
|
|
4
|
+
* Numeric error codes returned by the OTC service API. OTC-specific codes use the service-owned
|
|
5
|
+
* 70xxx range and mirror the backend's `execution_error_code` module; the remaining codes are
|
|
6
|
+
* shared cross-service codes from the backend's common error enum, inlined via spread from
|
|
7
|
+
* {@link NADO_ERROR_CODES}. A rejection returned directly by the Nado Gateway keeps its
|
|
8
|
+
* original Gateway code instead (see `ENGINE_ERROR_CODES` in `@nadohq/engine-client`).
|
|
9
|
+
*
|
|
10
|
+
* These codes are returned in the `error_code` field of execution responses — see
|
|
11
|
+
* {@link OtcServerExecutionFailure} and {@link OtcServerExecutionPendingResolution}. Branch on
|
|
12
|
+
* `recovery_action` first; a code never authorizes resending a signed order.
|
|
13
|
+
*/
|
|
14
|
+
const OTC_ERROR_CODES = {
|
|
15
|
+
...require("@nadohq/shared").NADO_ERROR_CODES,
|
|
16
|
+
INVALID_EXECUTION_REQUEST: 7e4,
|
|
17
|
+
TAKER_ORDER_CONFLICT: 70020,
|
|
18
|
+
DEAL_ID_CONFLICT: 70021,
|
|
19
|
+
/** The deal is still executing, even when `status` is `failure`. Poll `getExecutionStatus` again after `retry_after_ms`. */
|
|
20
|
+
EXECUTION_IN_PROGRESS: 70022,
|
|
21
|
+
/** No execution record for this deal. Settlement is unknown: resolve the position from Nado and never resubmit. */
|
|
22
|
+
EXECUTION_NOT_FOUND: 70023,
|
|
23
|
+
OTC_CAPACITY_EXCEEDED: 70100,
|
|
24
|
+
OTC_WORKER_UNAVAILABLE: 70101,
|
|
25
|
+
EXECUTOR_SESSION_CAPACITY_EXCEEDED: 70102,
|
|
26
|
+
EXECUTION_WORKER_FAILED: 70103,
|
|
27
|
+
OTC_ADMISSION_LIMITED: 70104,
|
|
28
|
+
OTC_EXECUTION_UNAVAILABLE: 70105,
|
|
29
|
+
EXECUTION_EXPIRED: 70110,
|
|
30
|
+
EXECUTION_WINDOW_TOO_SHORT: 70111,
|
|
31
|
+
TAKER_INSUFFICIENT_CAPACITY: 70200,
|
|
32
|
+
SPOT_QUOTE_CAPACITY_INSUFFICIENT: 70201,
|
|
33
|
+
SPOT_BASE_CAPACITY_INSUFFICIENT: 70202,
|
|
34
|
+
PERP_MARGIN_INSUFFICIENT: 70203,
|
|
35
|
+
PRICER_UNAVAILABLE: 70300,
|
|
36
|
+
PRICE_NOT_ACCEPTABLE: 70301,
|
|
37
|
+
INSUFFICIENT_LIQUIDITY: 70302,
|
|
38
|
+
PRICER_CAPACITY_EXCEEDED: 70303,
|
|
39
|
+
PRICER_IDEMPOTENCY_CONFLICT: 70304,
|
|
40
|
+
PRICER_REQUEST_AMOUNT_INVALID: 70305,
|
|
41
|
+
PRICER_PLAN_DEADLINE_INVALID: 70306,
|
|
42
|
+
PRICER_EMPTY_PLAN: 70310,
|
|
43
|
+
PRICER_TOO_MANY_MAKERS: 70311,
|
|
44
|
+
PRICER_MAKER_PRODUCT_MISMATCH: 70312,
|
|
45
|
+
PRICER_MAKER_SENDER_INVALID: 70313,
|
|
46
|
+
PRICER_MAKER_SIGNATURE_INVALID: 70314,
|
|
47
|
+
PRICER_MAKER_AMOUNT_INVALID: 70315,
|
|
48
|
+
PRICER_MAKER_PRICE_INVALID: 70316,
|
|
49
|
+
PRICER_MAKER_EXPIRED: 70317,
|
|
50
|
+
PRICER_MAKER_NONCE_INVALID: 70318,
|
|
51
|
+
PRICER_MAKER_APPENDIX_INVALID: 70319,
|
|
52
|
+
PRICER_MAKER_SIDE_MISMATCH: 70320,
|
|
53
|
+
PRICER_MAKER_LEVERAGE_INVALID: 70321,
|
|
54
|
+
PRICER_MAKER_BORROW_MARGIN_INVALID: 70322,
|
|
55
|
+
PRICER_SELF_TRADE: 70323,
|
|
56
|
+
PRICER_DUPLICATE_MAKER: 70324,
|
|
57
|
+
PRICER_MAKER_RECV_TIME_INVALID: 70325,
|
|
58
|
+
PRICER_MAKER_AMOUNT_OFF_INCREMENT: 70326,
|
|
59
|
+
PRICER_MAKER_PRICE_OFF_INCREMENT: 70327,
|
|
60
|
+
PRICER_MAKER_BELOW_MINIMUM_NOTIONAL: 70328,
|
|
61
|
+
PRICER_AMOUNT_MISMATCH: 70329,
|
|
62
|
+
PRICER_LIMIT_VIOLATED: 70330,
|
|
63
|
+
PRICER_MAKER_DIGEST_INVALID: 70331,
|
|
64
|
+
PRICER_HEDGE_CAPACITY_INSUFFICIENT: 70332,
|
|
65
|
+
INVALID_ORDER_PRICE_INCREMENT: 70400,
|
|
66
|
+
INVALID_ORDER_AMOUNT_INCREMENT: 70401,
|
|
67
|
+
ORDER_BELOW_MINIMUM_NOTIONAL: 70402,
|
|
68
|
+
ORDER_EXPIRED: 70403,
|
|
69
|
+
ACCOUNT_INSUFFICIENT_HEALTH: 70404,
|
|
70
|
+
ORDER_PRICE_OUTSIDE_ORACLE_RANGE: 70405,
|
|
71
|
+
NADO_LATE_RECEIVE: 70406,
|
|
72
|
+
NADO_EARLY_RECEIVE: 70407,
|
|
73
|
+
INVALID_NONCE: 70408,
|
|
74
|
+
INVALID_SIGNATURE: 70409,
|
|
75
|
+
FOK_NOT_FILLED: 70410,
|
|
76
|
+
ORDERS_CANNOT_BE_MATCHED: 70411,
|
|
77
|
+
OTC_AMOUNT_MISMATCH: 70412,
|
|
78
|
+
ORDERS_DO_NOT_CROSS: 70413,
|
|
79
|
+
OTC_ORDER_TYPE_INVALID: 70414,
|
|
80
|
+
OTC_SELF_TRADE: 70415,
|
|
81
|
+
OTC_DUPLICATE_MAKER: 70416,
|
|
82
|
+
NADO_INTERNAL_ERROR: 70417,
|
|
83
|
+
NADO_PRECHECK_UNAVAILABLE: 70418,
|
|
84
|
+
NADO_REJECTED: 70419,
|
|
85
|
+
REDUCE_ONLY_INCREASES_POSITION: 70420,
|
|
86
|
+
SIGNER_LOOKUP_UNAVAILABLE: 70421,
|
|
87
|
+
/** Settlement outcome is unknown; returned with `status: "pending_resolution"`. Resolve the position from Nado and never resubmit. */
|
|
88
|
+
SETTLEMENT_OUTCOME_UNKNOWN: 70500,
|
|
89
|
+
/** Unclassified OTC error. */
|
|
90
|
+
UNKNOWN: 70999
|
|
91
|
+
};
|
|
92
|
+
//#endregion
|
|
93
|
+
exports.OTC_ERROR_CODES = OTC_ERROR_CODES;
|
|
94
|
+
|
|
95
|
+
//# sourceMappingURL=otcErrorCodes.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otcErrorCodes.cjs","names":["NADO_ERROR_CODES"],"sources":["../../src/types/otcErrorCodes.ts"],"sourcesContent":["import { NADO_ERROR_CODES } from '@nadohq/shared';\n\n/**\n * Numeric error codes returned by the OTC service API. OTC-specific codes use the service-owned\n * 70xxx range and mirror the backend's `execution_error_code` module; the remaining codes are\n * shared cross-service codes from the backend's common error enum, inlined via spread from\n * {@link NADO_ERROR_CODES}. A rejection returned directly by the Nado Gateway keeps its\n * original Gateway code instead (see `ENGINE_ERROR_CODES` in `@nadohq/engine-client`).\n *\n * These codes are returned in the `error_code` field of execution responses — see\n * {@link OtcServerExecutionFailure} and {@link OtcServerExecutionPendingResolution}. Branch on\n * `recovery_action` first; a code never authorizes resending a signed order.\n */\nexport const OTC_ERROR_CODES = {\n ...NADO_ERROR_CODES,\n\n // *** Request (700xx) ***\n INVALID_EXECUTION_REQUEST: 70000,\n TAKER_ORDER_CONFLICT: 70020,\n DEAL_ID_CONFLICT: 70021,\n /** The deal is still executing, even when `status` is `failure`. Poll `getExecutionStatus` again after `retry_after_ms`. */\n EXECUTION_IN_PROGRESS: 70022,\n /** No execution record for this deal. Settlement is unknown: resolve the position from Nado and never resubmit. */\n EXECUTION_NOT_FOUND: 70023,\n\n // *** OTC capacity and timing (701xx) ***\n OTC_CAPACITY_EXCEEDED: 70100,\n OTC_WORKER_UNAVAILABLE: 70101,\n EXECUTOR_SESSION_CAPACITY_EXCEEDED: 70102,\n EXECUTION_WORKER_FAILED: 70103,\n OTC_ADMISSION_LIMITED: 70104,\n OTC_EXECUTION_UNAVAILABLE: 70105,\n EXECUTION_EXPIRED: 70110,\n EXECUTION_WINDOW_TOO_SHORT: 70111,\n\n // *** Taker capacity (702xx) ***\n TAKER_INSUFFICIENT_CAPACITY: 70200,\n SPOT_QUOTE_CAPACITY_INSUFFICIENT: 70201,\n SPOT_BASE_CAPACITY_INSUFFICIENT: 70202,\n PERP_MARGIN_INSUFFICIENT: 70203,\n\n // *** Pricer and maker plan (703xx) ***\n PRICER_UNAVAILABLE: 70300,\n PRICE_NOT_ACCEPTABLE: 70301,\n INSUFFICIENT_LIQUIDITY: 70302,\n PRICER_CAPACITY_EXCEEDED: 70303,\n PRICER_IDEMPOTENCY_CONFLICT: 70304,\n PRICER_REQUEST_AMOUNT_INVALID: 70305,\n PRICER_PLAN_DEADLINE_INVALID: 70306,\n PRICER_EMPTY_PLAN: 70310,\n PRICER_TOO_MANY_MAKERS: 70311,\n PRICER_MAKER_PRODUCT_MISMATCH: 70312,\n PRICER_MAKER_SENDER_INVALID: 70313,\n PRICER_MAKER_SIGNATURE_INVALID: 70314,\n PRICER_MAKER_AMOUNT_INVALID: 70315,\n PRICER_MAKER_PRICE_INVALID: 70316,\n PRICER_MAKER_EXPIRED: 70317,\n PRICER_MAKER_NONCE_INVALID: 70318,\n PRICER_MAKER_APPENDIX_INVALID: 70319,\n PRICER_MAKER_SIDE_MISMATCH: 70320,\n PRICER_MAKER_LEVERAGE_INVALID: 70321,\n PRICER_MAKER_BORROW_MARGIN_INVALID: 70322,\n PRICER_SELF_TRADE: 70323,\n PRICER_DUPLICATE_MAKER: 70324,\n PRICER_MAKER_RECV_TIME_INVALID: 70325,\n PRICER_MAKER_AMOUNT_OFF_INCREMENT: 70326,\n PRICER_MAKER_PRICE_OFF_INCREMENT: 70327,\n PRICER_MAKER_BELOW_MINIMUM_NOTIONAL: 70328,\n PRICER_AMOUNT_MISMATCH: 70329,\n PRICER_LIMIT_VIOLATED: 70330,\n PRICER_MAKER_DIGEST_INVALID: 70331,\n PRICER_HEDGE_CAPACITY_INSUFFICIENT: 70332,\n\n // *** Order validation and Nado precheck (704xx) ***\n INVALID_ORDER_PRICE_INCREMENT: 70400,\n INVALID_ORDER_AMOUNT_INCREMENT: 70401,\n ORDER_BELOW_MINIMUM_NOTIONAL: 70402,\n ORDER_EXPIRED: 70403,\n ACCOUNT_INSUFFICIENT_HEALTH: 70404,\n ORDER_PRICE_OUTSIDE_ORACLE_RANGE: 70405,\n NADO_LATE_RECEIVE: 70406,\n NADO_EARLY_RECEIVE: 70407,\n INVALID_NONCE: 70408,\n INVALID_SIGNATURE: 70409,\n FOK_NOT_FILLED: 70410,\n ORDERS_CANNOT_BE_MATCHED: 70411,\n OTC_AMOUNT_MISMATCH: 70412,\n ORDERS_DO_NOT_CROSS: 70413,\n OTC_ORDER_TYPE_INVALID: 70414,\n OTC_SELF_TRADE: 70415,\n OTC_DUPLICATE_MAKER: 70416,\n NADO_INTERNAL_ERROR: 70417,\n NADO_PRECHECK_UNAVAILABLE: 70418,\n NADO_REJECTED: 70419,\n REDUCE_ONLY_INCREASES_POSITION: 70420,\n SIGNER_LOOKUP_UNAVAILABLE: 70421,\n\n // *** Settlement and unknown (705xx, 70999) ***\n /** Settlement outcome is unknown; returned with `status: \"pending_resolution\"`. Resolve the position from Nado and never resubmit. */\n SETTLEMENT_OUTCOME_UNKNOWN: 70500,\n /** Unclassified OTC error. */\n UNKNOWN: 70999,\n} as const;\n\n/**\n * Union of all known OTC service API error codes.\n */\nexport type OtcErrorCode =\n (typeof OTC_ERROR_CODES)[keyof typeof OTC_ERROR_CODES];\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,kBAAkB;CAC7B,2BAAGA,EAAAA;CAGH,2BAA2B;CAC3B,sBAAsB;CACtB,kBAAkB;;CAElB,uBAAuB;;CAEvB,qBAAqB;CAGrB,uBAAuB;CACvB,wBAAwB;CACxB,oCAAoC;CACpC,yBAAyB;CACzB,uBAAuB;CACvB,2BAA2B;CAC3B,mBAAmB;CACnB,4BAA4B;CAG5B,6BAA6B;CAC7B,kCAAkC;CAClC,iCAAiC;CACjC,0BAA0B;CAG1B,oBAAoB;CACpB,sBAAsB;CACtB,wBAAwB;CACxB,0BAA0B;CAC1B,6BAA6B;CAC7B,+BAA+B;CAC/B,8BAA8B;CAC9B,mBAAmB;CACnB,wBAAwB;CACxB,+BAA+B;CAC/B,6BAA6B;CAC7B,gCAAgC;CAChC,6BAA6B;CAC7B,4BAA4B;CAC5B,sBAAsB;CACtB,4BAA4B;CAC5B,+BAA+B;CAC/B,4BAA4B;CAC5B,+BAA+B;CAC/B,oCAAoC;CACpC,mBAAmB;CACnB,wBAAwB;CACxB,gCAAgC;CAChC,mCAAmC;CACnC,kCAAkC;CAClC,qCAAqC;CACrC,wBAAwB;CACxB,uBAAuB;CACvB,6BAA6B;CAC7B,oCAAoC;CAGpC,+BAA+B;CAC/B,gCAAgC;CAChC,8BAA8B;CAC9B,eAAe;CACf,6BAA6B;CAC7B,kCAAkC;CAClC,mBAAmB;CACnB,oBAAoB;CACpB,eAAe;CACf,mBAAmB;CACnB,gBAAgB;CAChB,0BAA0B;CAC1B,qBAAqB;CACrB,qBAAqB;CACrB,wBAAwB;CACxB,gBAAgB;CAChB,qBAAqB;CACrB,qBAAqB;CACrB,2BAA2B;CAC3B,eAAe;CACf,gCAAgC;CAChC,2BAA2B;;CAI3B,4BAA4B;;CAE5B,SAAS;AACX"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { NADO_ERROR_CODES } from "@nadohq/shared";
|
|
2
|
+
//#region src/types/otcErrorCodes.ts
|
|
3
|
+
/**
|
|
4
|
+
* Numeric error codes returned by the OTC service API. OTC-specific codes use the service-owned
|
|
5
|
+
* 70xxx range and mirror the backend's `execution_error_code` module; the remaining codes are
|
|
6
|
+
* shared cross-service codes from the backend's common error enum, inlined via spread from
|
|
7
|
+
* {@link NADO_ERROR_CODES}. A rejection returned directly by the Nado Gateway keeps its
|
|
8
|
+
* original Gateway code instead (see `ENGINE_ERROR_CODES` in `@nadohq/engine-client`).
|
|
9
|
+
*
|
|
10
|
+
* These codes are returned in the `error_code` field of execution responses — see
|
|
11
|
+
* {@link OtcServerExecutionFailure} and {@link OtcServerExecutionPendingResolution}. Branch on
|
|
12
|
+
* `recovery_action` first; a code never authorizes resending a signed order.
|
|
13
|
+
*/
|
|
14
|
+
const OTC_ERROR_CODES = {
|
|
15
|
+
...NADO_ERROR_CODES,
|
|
16
|
+
INVALID_EXECUTION_REQUEST: 7e4,
|
|
17
|
+
TAKER_ORDER_CONFLICT: 70020,
|
|
18
|
+
DEAL_ID_CONFLICT: 70021,
|
|
19
|
+
/** The deal is still executing, even when `status` is `failure`. Poll `getExecutionStatus` again after `retry_after_ms`. */
|
|
20
|
+
EXECUTION_IN_PROGRESS: 70022,
|
|
21
|
+
/** No execution record for this deal. Settlement is unknown: resolve the position from Nado and never resubmit. */
|
|
22
|
+
EXECUTION_NOT_FOUND: 70023,
|
|
23
|
+
OTC_CAPACITY_EXCEEDED: 70100,
|
|
24
|
+
OTC_WORKER_UNAVAILABLE: 70101,
|
|
25
|
+
EXECUTOR_SESSION_CAPACITY_EXCEEDED: 70102,
|
|
26
|
+
EXECUTION_WORKER_FAILED: 70103,
|
|
27
|
+
OTC_ADMISSION_LIMITED: 70104,
|
|
28
|
+
OTC_EXECUTION_UNAVAILABLE: 70105,
|
|
29
|
+
EXECUTION_EXPIRED: 70110,
|
|
30
|
+
EXECUTION_WINDOW_TOO_SHORT: 70111,
|
|
31
|
+
TAKER_INSUFFICIENT_CAPACITY: 70200,
|
|
32
|
+
SPOT_QUOTE_CAPACITY_INSUFFICIENT: 70201,
|
|
33
|
+
SPOT_BASE_CAPACITY_INSUFFICIENT: 70202,
|
|
34
|
+
PERP_MARGIN_INSUFFICIENT: 70203,
|
|
35
|
+
PRICER_UNAVAILABLE: 70300,
|
|
36
|
+
PRICE_NOT_ACCEPTABLE: 70301,
|
|
37
|
+
INSUFFICIENT_LIQUIDITY: 70302,
|
|
38
|
+
PRICER_CAPACITY_EXCEEDED: 70303,
|
|
39
|
+
PRICER_IDEMPOTENCY_CONFLICT: 70304,
|
|
40
|
+
PRICER_REQUEST_AMOUNT_INVALID: 70305,
|
|
41
|
+
PRICER_PLAN_DEADLINE_INVALID: 70306,
|
|
42
|
+
PRICER_EMPTY_PLAN: 70310,
|
|
43
|
+
PRICER_TOO_MANY_MAKERS: 70311,
|
|
44
|
+
PRICER_MAKER_PRODUCT_MISMATCH: 70312,
|
|
45
|
+
PRICER_MAKER_SENDER_INVALID: 70313,
|
|
46
|
+
PRICER_MAKER_SIGNATURE_INVALID: 70314,
|
|
47
|
+
PRICER_MAKER_AMOUNT_INVALID: 70315,
|
|
48
|
+
PRICER_MAKER_PRICE_INVALID: 70316,
|
|
49
|
+
PRICER_MAKER_EXPIRED: 70317,
|
|
50
|
+
PRICER_MAKER_NONCE_INVALID: 70318,
|
|
51
|
+
PRICER_MAKER_APPENDIX_INVALID: 70319,
|
|
52
|
+
PRICER_MAKER_SIDE_MISMATCH: 70320,
|
|
53
|
+
PRICER_MAKER_LEVERAGE_INVALID: 70321,
|
|
54
|
+
PRICER_MAKER_BORROW_MARGIN_INVALID: 70322,
|
|
55
|
+
PRICER_SELF_TRADE: 70323,
|
|
56
|
+
PRICER_DUPLICATE_MAKER: 70324,
|
|
57
|
+
PRICER_MAKER_RECV_TIME_INVALID: 70325,
|
|
58
|
+
PRICER_MAKER_AMOUNT_OFF_INCREMENT: 70326,
|
|
59
|
+
PRICER_MAKER_PRICE_OFF_INCREMENT: 70327,
|
|
60
|
+
PRICER_MAKER_BELOW_MINIMUM_NOTIONAL: 70328,
|
|
61
|
+
PRICER_AMOUNT_MISMATCH: 70329,
|
|
62
|
+
PRICER_LIMIT_VIOLATED: 70330,
|
|
63
|
+
PRICER_MAKER_DIGEST_INVALID: 70331,
|
|
64
|
+
PRICER_HEDGE_CAPACITY_INSUFFICIENT: 70332,
|
|
65
|
+
INVALID_ORDER_PRICE_INCREMENT: 70400,
|
|
66
|
+
INVALID_ORDER_AMOUNT_INCREMENT: 70401,
|
|
67
|
+
ORDER_BELOW_MINIMUM_NOTIONAL: 70402,
|
|
68
|
+
ORDER_EXPIRED: 70403,
|
|
69
|
+
ACCOUNT_INSUFFICIENT_HEALTH: 70404,
|
|
70
|
+
ORDER_PRICE_OUTSIDE_ORACLE_RANGE: 70405,
|
|
71
|
+
NADO_LATE_RECEIVE: 70406,
|
|
72
|
+
NADO_EARLY_RECEIVE: 70407,
|
|
73
|
+
INVALID_NONCE: 70408,
|
|
74
|
+
INVALID_SIGNATURE: 70409,
|
|
75
|
+
FOK_NOT_FILLED: 70410,
|
|
76
|
+
ORDERS_CANNOT_BE_MATCHED: 70411,
|
|
77
|
+
OTC_AMOUNT_MISMATCH: 70412,
|
|
78
|
+
ORDERS_DO_NOT_CROSS: 70413,
|
|
79
|
+
OTC_ORDER_TYPE_INVALID: 70414,
|
|
80
|
+
OTC_SELF_TRADE: 70415,
|
|
81
|
+
OTC_DUPLICATE_MAKER: 70416,
|
|
82
|
+
NADO_INTERNAL_ERROR: 70417,
|
|
83
|
+
NADO_PRECHECK_UNAVAILABLE: 70418,
|
|
84
|
+
NADO_REJECTED: 70419,
|
|
85
|
+
REDUCE_ONLY_INCREASES_POSITION: 70420,
|
|
86
|
+
SIGNER_LOOKUP_UNAVAILABLE: 70421,
|
|
87
|
+
/** Settlement outcome is unknown; returned with `status: "pending_resolution"`. Resolve the position from Nado and never resubmit. */
|
|
88
|
+
SETTLEMENT_OUTCOME_UNKNOWN: 70500,
|
|
89
|
+
/** Unclassified OTC error. */
|
|
90
|
+
UNKNOWN: 70999
|
|
91
|
+
};
|
|
92
|
+
//#endregion
|
|
93
|
+
export { OTC_ERROR_CODES };
|
|
94
|
+
|
|
95
|
+
//# sourceMappingURL=otcErrorCodes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otcErrorCodes.js","names":[],"sources":["../../src/types/otcErrorCodes.ts"],"sourcesContent":["import { NADO_ERROR_CODES } from '@nadohq/shared';\n\n/**\n * Numeric error codes returned by the OTC service API. OTC-specific codes use the service-owned\n * 70xxx range and mirror the backend's `execution_error_code` module; the remaining codes are\n * shared cross-service codes from the backend's common error enum, inlined via spread from\n * {@link NADO_ERROR_CODES}. A rejection returned directly by the Nado Gateway keeps its\n * original Gateway code instead (see `ENGINE_ERROR_CODES` in `@nadohq/engine-client`).\n *\n * These codes are returned in the `error_code` field of execution responses — see\n * {@link OtcServerExecutionFailure} and {@link OtcServerExecutionPendingResolution}. Branch on\n * `recovery_action` first; a code never authorizes resending a signed order.\n */\nexport const OTC_ERROR_CODES = {\n ...NADO_ERROR_CODES,\n\n // *** Request (700xx) ***\n INVALID_EXECUTION_REQUEST: 70000,\n TAKER_ORDER_CONFLICT: 70020,\n DEAL_ID_CONFLICT: 70021,\n /** The deal is still executing, even when `status` is `failure`. Poll `getExecutionStatus` again after `retry_after_ms`. */\n EXECUTION_IN_PROGRESS: 70022,\n /** No execution record for this deal. Settlement is unknown: resolve the position from Nado and never resubmit. */\n EXECUTION_NOT_FOUND: 70023,\n\n // *** OTC capacity and timing (701xx) ***\n OTC_CAPACITY_EXCEEDED: 70100,\n OTC_WORKER_UNAVAILABLE: 70101,\n EXECUTOR_SESSION_CAPACITY_EXCEEDED: 70102,\n EXECUTION_WORKER_FAILED: 70103,\n OTC_ADMISSION_LIMITED: 70104,\n OTC_EXECUTION_UNAVAILABLE: 70105,\n EXECUTION_EXPIRED: 70110,\n EXECUTION_WINDOW_TOO_SHORT: 70111,\n\n // *** Taker capacity (702xx) ***\n TAKER_INSUFFICIENT_CAPACITY: 70200,\n SPOT_QUOTE_CAPACITY_INSUFFICIENT: 70201,\n SPOT_BASE_CAPACITY_INSUFFICIENT: 70202,\n PERP_MARGIN_INSUFFICIENT: 70203,\n\n // *** Pricer and maker plan (703xx) ***\n PRICER_UNAVAILABLE: 70300,\n PRICE_NOT_ACCEPTABLE: 70301,\n INSUFFICIENT_LIQUIDITY: 70302,\n PRICER_CAPACITY_EXCEEDED: 70303,\n PRICER_IDEMPOTENCY_CONFLICT: 70304,\n PRICER_REQUEST_AMOUNT_INVALID: 70305,\n PRICER_PLAN_DEADLINE_INVALID: 70306,\n PRICER_EMPTY_PLAN: 70310,\n PRICER_TOO_MANY_MAKERS: 70311,\n PRICER_MAKER_PRODUCT_MISMATCH: 70312,\n PRICER_MAKER_SENDER_INVALID: 70313,\n PRICER_MAKER_SIGNATURE_INVALID: 70314,\n PRICER_MAKER_AMOUNT_INVALID: 70315,\n PRICER_MAKER_PRICE_INVALID: 70316,\n PRICER_MAKER_EXPIRED: 70317,\n PRICER_MAKER_NONCE_INVALID: 70318,\n PRICER_MAKER_APPENDIX_INVALID: 70319,\n PRICER_MAKER_SIDE_MISMATCH: 70320,\n PRICER_MAKER_LEVERAGE_INVALID: 70321,\n PRICER_MAKER_BORROW_MARGIN_INVALID: 70322,\n PRICER_SELF_TRADE: 70323,\n PRICER_DUPLICATE_MAKER: 70324,\n PRICER_MAKER_RECV_TIME_INVALID: 70325,\n PRICER_MAKER_AMOUNT_OFF_INCREMENT: 70326,\n PRICER_MAKER_PRICE_OFF_INCREMENT: 70327,\n PRICER_MAKER_BELOW_MINIMUM_NOTIONAL: 70328,\n PRICER_AMOUNT_MISMATCH: 70329,\n PRICER_LIMIT_VIOLATED: 70330,\n PRICER_MAKER_DIGEST_INVALID: 70331,\n PRICER_HEDGE_CAPACITY_INSUFFICIENT: 70332,\n\n // *** Order validation and Nado precheck (704xx) ***\n INVALID_ORDER_PRICE_INCREMENT: 70400,\n INVALID_ORDER_AMOUNT_INCREMENT: 70401,\n ORDER_BELOW_MINIMUM_NOTIONAL: 70402,\n ORDER_EXPIRED: 70403,\n ACCOUNT_INSUFFICIENT_HEALTH: 70404,\n ORDER_PRICE_OUTSIDE_ORACLE_RANGE: 70405,\n NADO_LATE_RECEIVE: 70406,\n NADO_EARLY_RECEIVE: 70407,\n INVALID_NONCE: 70408,\n INVALID_SIGNATURE: 70409,\n FOK_NOT_FILLED: 70410,\n ORDERS_CANNOT_BE_MATCHED: 70411,\n OTC_AMOUNT_MISMATCH: 70412,\n ORDERS_DO_NOT_CROSS: 70413,\n OTC_ORDER_TYPE_INVALID: 70414,\n OTC_SELF_TRADE: 70415,\n OTC_DUPLICATE_MAKER: 70416,\n NADO_INTERNAL_ERROR: 70417,\n NADO_PRECHECK_UNAVAILABLE: 70418,\n NADO_REJECTED: 70419,\n REDUCE_ONLY_INCREASES_POSITION: 70420,\n SIGNER_LOOKUP_UNAVAILABLE: 70421,\n\n // *** Settlement and unknown (705xx, 70999) ***\n /** Settlement outcome is unknown; returned with `status: \"pending_resolution\"`. Resolve the position from Nado and never resubmit. */\n SETTLEMENT_OUTCOME_UNKNOWN: 70500,\n /** Unclassified OTC error. */\n UNKNOWN: 70999,\n} as const;\n\n/**\n * Union of all known OTC service API error codes.\n */\nexport type OtcErrorCode =\n (typeof OTC_ERROR_CODES)[keyof typeof OTC_ERROR_CODES];\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,kBAAkB;CAC7B,GAAG;CAGH,2BAA2B;CAC3B,sBAAsB;CACtB,kBAAkB;;CAElB,uBAAuB;;CAEvB,qBAAqB;CAGrB,uBAAuB;CACvB,wBAAwB;CACxB,oCAAoC;CACpC,yBAAyB;CACzB,uBAAuB;CACvB,2BAA2B;CAC3B,mBAAmB;CACnB,4BAA4B;CAG5B,6BAA6B;CAC7B,kCAAkC;CAClC,iCAAiC;CACjC,0BAA0B;CAG1B,oBAAoB;CACpB,sBAAsB;CACtB,wBAAwB;CACxB,0BAA0B;CAC1B,6BAA6B;CAC7B,+BAA+B;CAC/B,8BAA8B;CAC9B,mBAAmB;CACnB,wBAAwB;CACxB,+BAA+B;CAC/B,6BAA6B;CAC7B,gCAAgC;CAChC,6BAA6B;CAC7B,4BAA4B;CAC5B,sBAAsB;CACtB,4BAA4B;CAC5B,+BAA+B;CAC/B,4BAA4B;CAC5B,+BAA+B;CAC/B,oCAAoC;CACpC,mBAAmB;CACnB,wBAAwB;CACxB,gCAAgC;CAChC,mCAAmC;CACnC,kCAAkC;CAClC,qCAAqC;CACrC,wBAAwB;CACxB,uBAAuB;CACvB,6BAA6B;CAC7B,oCAAoC;CAGpC,+BAA+B;CAC/B,gCAAgC;CAChC,8BAA8B;CAC9B,eAAe;CACf,6BAA6B;CAC7B,kCAAkC;CAClC,mBAAmB;CACnB,oBAAoB;CACpB,eAAe;CACf,mBAAmB;CACnB,gBAAgB;CAChB,0BAA0B;CAC1B,qBAAqB;CACrB,qBAAqB;CACrB,wBAAwB;CACxB,gBAAgB;CAChB,qBAAqB;CACrB,qBAAqB;CACrB,2BAA2B;CAC3B,eAAe;CACf,gCAAgC;CAChC,2BAA2B;;CAI3B,4BAA4B;;CAE5B,SAAS;AACX"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OtcServerExecutionSuccess, c as OtcServerQuoteStream, d as OtcServerRfqSubscribeStreamRequest, f as OtcServerRfqSubscribeStreamsRequest, h as OtcServerRfqUnsubscribeStreamsRequest, i as OtcServerExecutionResponse, l as OtcServerRfqAck, m as OtcServerRfqUnsubscribeStreamRequest, n as OtcServerExecutionFailure, o as OtcServerQuote, p as OtcServerRfqSubscriptionRequest, r as OtcServerExecutionPendingResolution, s as OtcServerQuoteBatch, t as OtcQuoteSizeUnit, u as OtcServerRfqMessage } from "../serverTypes-
|
|
1
|
+
import { a as OtcServerExecutionSuccess, c as OtcServerQuoteStream, d as OtcServerRfqSubscribeStreamRequest, f as OtcServerRfqSubscribeStreamsRequest, h as OtcServerRfqUnsubscribeStreamsRequest, i as OtcServerExecutionResponse, l as OtcServerRfqAck, m as OtcServerRfqUnsubscribeStreamRequest, n as OtcServerExecutionFailure, o as OtcServerQuote, p as OtcServerRfqSubscriptionRequest, r as OtcServerExecutionPendingResolution, s as OtcServerQuoteBatch, t as OtcQuoteSizeUnit, u as OtcServerRfqMessage } from "../serverTypes-DpMJVX7i.cjs";
|
|
2
2
|
export { OtcQuoteSizeUnit, OtcServerExecutionFailure, OtcServerExecutionPendingResolution, OtcServerExecutionResponse, OtcServerExecutionSuccess, OtcServerQuote, OtcServerQuoteBatch, OtcServerQuoteStream, OtcServerRfqAck, OtcServerRfqMessage, OtcServerRfqSubscribeStreamRequest, OtcServerRfqSubscribeStreamsRequest, OtcServerRfqSubscriptionRequest, OtcServerRfqUnsubscribeStreamRequest, OtcServerRfqUnsubscribeStreamsRequest };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OtcServerExecutionSuccess, c as OtcServerQuoteStream, d as OtcServerRfqSubscribeStreamRequest, f as OtcServerRfqSubscribeStreamsRequest, h as OtcServerRfqUnsubscribeStreamsRequest, i as OtcServerExecutionResponse, l as OtcServerRfqAck, m as OtcServerRfqUnsubscribeStreamRequest, n as OtcServerExecutionFailure, o as OtcServerQuote, p as OtcServerRfqSubscriptionRequest, r as OtcServerExecutionPendingResolution, s as OtcServerQuoteBatch, t as OtcQuoteSizeUnit, u as OtcServerRfqMessage } from "../serverTypes-
|
|
1
|
+
import { a as OtcServerExecutionSuccess, c as OtcServerQuoteStream, d as OtcServerRfqSubscribeStreamRequest, f as OtcServerRfqSubscribeStreamsRequest, h as OtcServerRfqUnsubscribeStreamsRequest, i as OtcServerExecutionResponse, l as OtcServerRfqAck, m as OtcServerRfqUnsubscribeStreamRequest, n as OtcServerExecutionFailure, o as OtcServerQuote, p as OtcServerRfqSubscriptionRequest, r as OtcServerExecutionPendingResolution, s as OtcServerQuoteBatch, t as OtcQuoteSizeUnit, u as OtcServerRfqMessage } from "../serverTypes-DpMJVX7i.js";
|
|
2
2
|
export { OtcQuoteSizeUnit, OtcServerExecutionFailure, OtcServerExecutionPendingResolution, OtcServerExecutionResponse, OtcServerExecutionSuccess, OtcServerQuote, OtcServerQuoteBatch, OtcServerQuoteStream, OtcServerRfqAck, OtcServerRfqMessage, OtcServerRfqSubscribeStreamRequest, OtcServerRfqSubscribeStreamsRequest, OtcServerRfqSubscriptionRequest, OtcServerRfqUnsubscribeStreamRequest, OtcServerRfqUnsubscribeStreamsRequest };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadohq/otc-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "HTTP client for the Nado OTC service - execute a signed fill-or-kill order, read its status, and build RFQ quote subscriptions",
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"module": "./dist/index.js",
|
|
42
42
|
"types": "./dist/index.d.ts",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@nadohq/engine-client": "^0.
|
|
45
|
-
"@nadohq/shared": "^0.
|
|
44
|
+
"@nadohq/engine-client": "^0.52.0",
|
|
45
|
+
"@nadohq/shared": "^0.52.0",
|
|
46
46
|
"axios": "1.16.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@jest/globals": "30.4.1"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "aa288c6e3f38a7a4cd823c7621860726d3733ebe"
|
|
52
52
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { NADO_ERROR_CODES } from '@nadohq/shared';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Numeric error codes returned by the OTC service API. OTC-specific codes use the service-owned
|
|
5
|
+
* 70xxx range and mirror the backend's `execution_error_code` module; the remaining codes are
|
|
6
|
+
* shared cross-service codes from the backend's common error enum, inlined via spread from
|
|
7
|
+
* {@link NADO_ERROR_CODES}. A rejection returned directly by the Nado Gateway keeps its
|
|
8
|
+
* original Gateway code instead (see `ENGINE_ERROR_CODES` in `@nadohq/engine-client`).
|
|
9
|
+
*
|
|
10
|
+
* These codes are returned in the `error_code` field of execution responses — see
|
|
11
|
+
* {@link OtcServerExecutionFailure} and {@link OtcServerExecutionPendingResolution}. Branch on
|
|
12
|
+
* `recovery_action` first; a code never authorizes resending a signed order.
|
|
13
|
+
*/
|
|
14
|
+
export const OTC_ERROR_CODES = {
|
|
15
|
+
...NADO_ERROR_CODES,
|
|
16
|
+
|
|
17
|
+
// *** Request (700xx) ***
|
|
18
|
+
INVALID_EXECUTION_REQUEST: 70000,
|
|
19
|
+
TAKER_ORDER_CONFLICT: 70020,
|
|
20
|
+
DEAL_ID_CONFLICT: 70021,
|
|
21
|
+
/** The deal is still executing, even when `status` is `failure`. Poll `getExecutionStatus` again after `retry_after_ms`. */
|
|
22
|
+
EXECUTION_IN_PROGRESS: 70022,
|
|
23
|
+
/** No execution record for this deal. Settlement is unknown: resolve the position from Nado and never resubmit. */
|
|
24
|
+
EXECUTION_NOT_FOUND: 70023,
|
|
25
|
+
|
|
26
|
+
// *** OTC capacity and timing (701xx) ***
|
|
27
|
+
OTC_CAPACITY_EXCEEDED: 70100,
|
|
28
|
+
OTC_WORKER_UNAVAILABLE: 70101,
|
|
29
|
+
EXECUTOR_SESSION_CAPACITY_EXCEEDED: 70102,
|
|
30
|
+
EXECUTION_WORKER_FAILED: 70103,
|
|
31
|
+
OTC_ADMISSION_LIMITED: 70104,
|
|
32
|
+
OTC_EXECUTION_UNAVAILABLE: 70105,
|
|
33
|
+
EXECUTION_EXPIRED: 70110,
|
|
34
|
+
EXECUTION_WINDOW_TOO_SHORT: 70111,
|
|
35
|
+
|
|
36
|
+
// *** Taker capacity (702xx) ***
|
|
37
|
+
TAKER_INSUFFICIENT_CAPACITY: 70200,
|
|
38
|
+
SPOT_QUOTE_CAPACITY_INSUFFICIENT: 70201,
|
|
39
|
+
SPOT_BASE_CAPACITY_INSUFFICIENT: 70202,
|
|
40
|
+
PERP_MARGIN_INSUFFICIENT: 70203,
|
|
41
|
+
|
|
42
|
+
// *** Pricer and maker plan (703xx) ***
|
|
43
|
+
PRICER_UNAVAILABLE: 70300,
|
|
44
|
+
PRICE_NOT_ACCEPTABLE: 70301,
|
|
45
|
+
INSUFFICIENT_LIQUIDITY: 70302,
|
|
46
|
+
PRICER_CAPACITY_EXCEEDED: 70303,
|
|
47
|
+
PRICER_IDEMPOTENCY_CONFLICT: 70304,
|
|
48
|
+
PRICER_REQUEST_AMOUNT_INVALID: 70305,
|
|
49
|
+
PRICER_PLAN_DEADLINE_INVALID: 70306,
|
|
50
|
+
PRICER_EMPTY_PLAN: 70310,
|
|
51
|
+
PRICER_TOO_MANY_MAKERS: 70311,
|
|
52
|
+
PRICER_MAKER_PRODUCT_MISMATCH: 70312,
|
|
53
|
+
PRICER_MAKER_SENDER_INVALID: 70313,
|
|
54
|
+
PRICER_MAKER_SIGNATURE_INVALID: 70314,
|
|
55
|
+
PRICER_MAKER_AMOUNT_INVALID: 70315,
|
|
56
|
+
PRICER_MAKER_PRICE_INVALID: 70316,
|
|
57
|
+
PRICER_MAKER_EXPIRED: 70317,
|
|
58
|
+
PRICER_MAKER_NONCE_INVALID: 70318,
|
|
59
|
+
PRICER_MAKER_APPENDIX_INVALID: 70319,
|
|
60
|
+
PRICER_MAKER_SIDE_MISMATCH: 70320,
|
|
61
|
+
PRICER_MAKER_LEVERAGE_INVALID: 70321,
|
|
62
|
+
PRICER_MAKER_BORROW_MARGIN_INVALID: 70322,
|
|
63
|
+
PRICER_SELF_TRADE: 70323,
|
|
64
|
+
PRICER_DUPLICATE_MAKER: 70324,
|
|
65
|
+
PRICER_MAKER_RECV_TIME_INVALID: 70325,
|
|
66
|
+
PRICER_MAKER_AMOUNT_OFF_INCREMENT: 70326,
|
|
67
|
+
PRICER_MAKER_PRICE_OFF_INCREMENT: 70327,
|
|
68
|
+
PRICER_MAKER_BELOW_MINIMUM_NOTIONAL: 70328,
|
|
69
|
+
PRICER_AMOUNT_MISMATCH: 70329,
|
|
70
|
+
PRICER_LIMIT_VIOLATED: 70330,
|
|
71
|
+
PRICER_MAKER_DIGEST_INVALID: 70331,
|
|
72
|
+
PRICER_HEDGE_CAPACITY_INSUFFICIENT: 70332,
|
|
73
|
+
|
|
74
|
+
// *** Order validation and Nado precheck (704xx) ***
|
|
75
|
+
INVALID_ORDER_PRICE_INCREMENT: 70400,
|
|
76
|
+
INVALID_ORDER_AMOUNT_INCREMENT: 70401,
|
|
77
|
+
ORDER_BELOW_MINIMUM_NOTIONAL: 70402,
|
|
78
|
+
ORDER_EXPIRED: 70403,
|
|
79
|
+
ACCOUNT_INSUFFICIENT_HEALTH: 70404,
|
|
80
|
+
ORDER_PRICE_OUTSIDE_ORACLE_RANGE: 70405,
|
|
81
|
+
NADO_LATE_RECEIVE: 70406,
|
|
82
|
+
NADO_EARLY_RECEIVE: 70407,
|
|
83
|
+
INVALID_NONCE: 70408,
|
|
84
|
+
INVALID_SIGNATURE: 70409,
|
|
85
|
+
FOK_NOT_FILLED: 70410,
|
|
86
|
+
ORDERS_CANNOT_BE_MATCHED: 70411,
|
|
87
|
+
OTC_AMOUNT_MISMATCH: 70412,
|
|
88
|
+
ORDERS_DO_NOT_CROSS: 70413,
|
|
89
|
+
OTC_ORDER_TYPE_INVALID: 70414,
|
|
90
|
+
OTC_SELF_TRADE: 70415,
|
|
91
|
+
OTC_DUPLICATE_MAKER: 70416,
|
|
92
|
+
NADO_INTERNAL_ERROR: 70417,
|
|
93
|
+
NADO_PRECHECK_UNAVAILABLE: 70418,
|
|
94
|
+
NADO_REJECTED: 70419,
|
|
95
|
+
REDUCE_ONLY_INCREASES_POSITION: 70420,
|
|
96
|
+
SIGNER_LOOKUP_UNAVAILABLE: 70421,
|
|
97
|
+
|
|
98
|
+
// *** Settlement and unknown (705xx, 70999) ***
|
|
99
|
+
/** Settlement outcome is unknown; returned with `status: "pending_resolution"`. Resolve the position from Nado and never resubmit. */
|
|
100
|
+
SETTLEMENT_OUTCOME_UNKNOWN: 70500,
|
|
101
|
+
/** Unclassified OTC error. */
|
|
102
|
+
UNKNOWN: 70999,
|
|
103
|
+
} as const;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Union of all known OTC service API error codes.
|
|
107
|
+
*/
|
|
108
|
+
export type OtcErrorCode =
|
|
109
|
+
(typeof OTC_ERROR_CODES)[keyof typeof OTC_ERROR_CODES];
|
package/src/types/serverTypes.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type OtcQuoteSizeUnit = 'base' | 'quote';
|
|
|
3
3
|
interface OtcServerExecutionDiagnostics {
|
|
4
4
|
failure_source?: string;
|
|
5
5
|
failure_stage?: string;
|
|
6
|
-
upstream_error_code?:
|
|
6
|
+
upstream_error_code?: string;
|
|
7
7
|
retryable?: boolean;
|
|
8
8
|
/**
|
|
9
9
|
* Documented values are `retry_same_request`, `sign_new_order`, `reconcile`, `wait`, and
|