@polyester/sdk 0.9.0 → 0.10.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/CHANGELOG.md +40 -0
- package/dist/catalogs/decimal.js +6 -4
- package/dist/catalogs/decimal.js.map +1 -1
- package/dist/catalogs/readers.d.ts.map +1 -1
- package/dist/catalogs/readers.js +22 -0
- package/dist/catalogs/readers.js.map +1 -1
- package/dist/core-client.d.ts.map +1 -1
- package/dist/core-client.js +49 -15
- package/dist/core-client.js.map +1 -1
- package/dist/environment.d.ts.map +1 -1
- package/dist/environment.js +3 -2
- package/dist/environment.js.map +1 -1
- package/dist/realtime/client.d.ts.map +1 -1
- package/dist/realtime/client.js +13 -5
- package/dist/realtime/client.js.map +1 -1
- package/dist/realtime/ready-gated-subscription.js +68 -0
- package/dist/realtime/ready-gated-subscription.js.map +1 -0
- package/dist/realtime/snapshot-then-stream.js +19 -10
- package/dist/realtime/snapshot-then-stream.js.map +1 -1
- package/dist/server-client.d.ts +3 -1
- package/dist/server-client.d.ts.map +1 -1
- package/dist/server-client.js +9 -4
- package/dist/server-client.js.map +1 -1
- package/dist/services/auth/session.d.ts.map +1 -1
- package/dist/services/auth/session.js +4 -1
- package/dist/services/auth/session.js.map +1 -1
- package/dist/services/auth/token-storage.js +2 -2
- package/dist/services/auth/token-storage.js.map +1 -1
- package/dist/services/balances/balances.js +5 -8
- package/dist/services/balances/balances.js.map +1 -1
- package/dist/services/candles/candles.js +9 -12
- package/dist/services/candles/candles.js.map +1 -1
- package/dist/services/heatmap/heatmap.js +5 -8
- package/dist/services/heatmap/heatmap.js.map +1 -1
- package/dist/services/lifecycle/lifecycle.schemas.d.ts +42 -42
- package/dist/services/lifecycle/lifecycle.schemas.js +1 -1
- package/dist/services/market-data/market-data.d.ts.map +1 -1
- package/dist/services/market-data/market-data.js +5 -8
- package/dist/services/market-data/market-data.js.map +1 -1
- package/dist/services/market-data/market-data.schemas.d.ts.map +1 -1
- package/dist/services/market-data/market-data.schemas.js +3 -2
- package/dist/services/market-data/market-data.schemas.js.map +1 -1
- package/dist/services/market-overview/market-overview.d.ts.map +1 -1
- package/dist/services/market-overview/market-overview.js +7 -13
- package/dist/services/market-overview/market-overview.js.map +1 -1
- package/dist/services/orderbook/orderbook.d.ts.map +1 -1
- package/dist/services/orderbook/orderbook.js +18 -11
- package/dist/services/orderbook/orderbook.js.map +1 -1
- package/dist/services/orders/orders-batch.schemas.d.ts +193 -35
- package/dist/services/orders/orders-batch.schemas.d.ts.map +1 -1
- package/dist/services/orders/orders-batch.schemas.js +27 -21
- package/dist/services/orders/orders-batch.schemas.js.map +1 -1
- package/dist/services/orders/orders-identifiers.schemas.js +6 -1
- package/dist/services/orders/orders-identifiers.schemas.js.map +1 -1
- package/dist/services/orders/orders-input.schemas.d.ts +36 -68
- package/dist/services/orders/orders-input.schemas.d.ts.map +1 -1
- package/dist/services/orders/orders-input.schemas.js +11 -12
- package/dist/services/orders/orders-input.schemas.js.map +1 -1
- package/dist/services/orders/orders-modify.schemas.d.ts +19 -43
- package/dist/services/orders/orders-modify.schemas.d.ts.map +1 -1
- package/dist/services/orders/orders-modify.schemas.js +2 -4
- package/dist/services/orders/orders-modify.schemas.js.map +1 -1
- package/dist/services/orders/orders-output.schemas.d.ts +165 -27
- package/dist/services/orders/orders-output.schemas.d.ts.map +1 -1
- package/dist/services/orders/orders-output.schemas.js +1 -1
- package/dist/services/orders/orders-output.schemas.js.map +1 -1
- package/dist/services/orders/orders-risk.schemas.d.ts +13 -32
- package/dist/services/orders/orders-risk.schemas.d.ts.map +1 -1
- package/dist/services/orders/orders-risk.schemas.js +59 -21
- package/dist/services/orders/orders-risk.schemas.js.map +1 -1
- package/dist/services/orders/orders.codecs.js +12 -1
- package/dist/services/orders/orders.codecs.js.map +1 -1
- package/dist/services/orders/orders.d.ts.map +1 -1
- package/dist/services/orders/orders.js +6 -9
- package/dist/services/orders/orders.js.map +1 -1
- package/dist/services/subaccounts/subaccounts.schemas.d.ts +2 -2
- package/dist/services/trades/trades.js +5 -8
- package/dist/services/trades/trades.js.map +1 -1
- package/dist/services/trailing-oneof-inputs.js +3 -3
- package/dist/services/trailing-oneof-inputs.js.map +1 -1
- package/dist/services/transfers/index.d.ts +2 -2
- package/dist/services/transfers/transfers.d.ts +1 -2
- package/dist/services/transfers/transfers.d.ts.map +1 -1
- package/dist/services/transfers/transfers.js +8 -13
- package/dist/services/transfers/transfers.js.map +1 -1
- package/dist/services/transfers/transfers.schemas.d.ts +5 -5
- package/dist/services/transfers/transfers.schemas.d.ts.map +1 -1
- package/dist/services/transfers/transfers.schemas.js +31 -33
- package/dist/services/transfers/transfers.schemas.js.map +1 -1
- package/dist/services/triggers/trigger-input.schemas.d.ts +22 -9
- package/dist/services/triggers/trigger-input.schemas.d.ts.map +1 -1
- package/dist/services/triggers/trigger-input.schemas.js +20 -43
- package/dist/services/triggers/trigger-input.schemas.js.map +1 -1
- package/dist/services/triggers/triggers-output.schemas.d.ts +14 -14
- package/dist/services/triggers/triggers-output.schemas.js +5 -5
- package/dist/services/triggers/triggers-output.schemas.js.map +1 -1
- package/dist/services/triggers/triggers.d.ts.map +1 -1
- package/dist/services/triggers/triggers.js +10 -23
- package/dist/services/triggers/triggers.js.map +1 -1
- package/dist/services/zipper/zipper.d.ts.map +1 -1
- package/dist/services/zipper/zipper.js +15 -18
- package/dist/services/zipper/zipper.js.map +1 -1
- package/dist/shared/connect-error-mapping.d.ts.map +1 -1
- package/dist/shared/connect-error-mapping.js +9 -2
- package/dist/shared/connect-error-mapping.js.map +1 -1
- package/dist/shared/decimal-surface.d.ts.map +1 -1
- package/dist/shared/decimal-surface.js +41 -18
- package/dist/shared/decimal-surface.js.map +1 -1
- package/dist/shared/transports.d.ts.map +1 -1
- package/dist/shared/transports.js +33 -11
- package/dist/shared/transports.js.map +1 -1
- package/dist/utils/base58-id.js +1 -2
- package/dist/utils/base58-id.js.map +1 -1
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +4 -3
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/event-emitter.d.ts.map +1 -1
- package/dist/utils/event-emitter.js +6 -3
- package/dist/utils/event-emitter.js.map +1 -1
- package/dist/utils/jwt.d.ts.map +1 -1
- package/dist/utils/jwt.js +2 -2
- package/dist/utils/jwt.js.map +1 -1
- package/dist/utils/numbers.js +20 -3
- package/dist/utils/numbers.js.map +1 -1
- package/dist/utils/timestamp.js +27 -16
- package/dist/utils/timestamp.js.map +1 -1
- package/dist/utils/u128.js +6 -18
- package/dist/utils/u128.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orders-batch.schemas.js","names":["ProtoWrite.RiskPolicySchema","ProtoWrite.BatchReplaceItemAdmissionStatus","ProtoWrite.BatchReplaceAdmissionStatus","ProtoRead.BatchReplacePhase","ProtoRead.OrderStatus"],"sources":["../../../src/services/orders/orders-batch.schemas.ts"],"sourcesContent":["import * as ProtoWrite from \"../../gen/orders/v1/orders_pb.js\";\nimport * as ProtoRead from \"../../gen/orders/v1/orders_read_pb.js\";\nimport { create } from \"@bufbuild/protobuf\";\nimport * as v from \"valibot\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport { OptionalPublicIdSchema, PublicIdSchema, idInputSchema } from \"../../shared/schemas.js\";\nimport { requiredEnumLabel } from \"../../shared/proto-enum-codec.js\";\nimport { tsNsToMs } from \"../../utils/time.js\";\nimport { formatId } from \"../../utils/base58-id.js\";\nimport { SideSchema, SymbolIdInputSchema } from \"../shared.js\";\nimport {\n positiveDecimalInputToScaled,\n scaledToDecimalOutput,\n type SdkScales,\n} from \"../../shared/decimal-surface.js\";\nimport {\n BatchReplaceAdmissionStatusCodec,\n BatchReplaceItemAdmissionStatusCodec,\n BatchReplacePhaseCodec,\n OrderStatusCodec,\n OrderSideCodec,\n} from \"./orders.codecs.js\";\nimport { createOrderIntentInputSchema } from \"./orders-input.schemas.js\";\nimport { createRequiredRiskPolicyInputSchema } from \"./orders-risk.schemas.js\";\nimport {\n ClientOrderIdInputSchema,\n OrderRequestIdInputSchema,\n} from \"./orders-identifiers.schemas.js\";\nimport { OrderErrorDetailSchema } from \"./order-errors.schemas.js\";\n\nconst BatchCountSchema = v.pipe(v.number(), v.integer(), v.minValue(0));\nconst BatchItemIndexSchema = v.pipe(v.number(), v.integer(), v.minValue(0));\nconst PositivePublicIdSchema = v.pipe(\n v.bigint(),\n v.gtValue(0n),\n v.transform((value) => formatId(value)),\n);\nconst OptionalSideInputSchema = v.pipe(\n v.optional(SideSchema),\n v.transform((side) => (side ? OrderSideCodec.inputToProto[side] : undefined)),\n);\n\nconst CancelAllAfterTimeoutInputSchema = v.pipe(\n v.number(),\n v.integer(),\n v.check(\n (timeoutSec) => timeoutSec === 0 || (timeoutSec >= 10 && timeoutSec <= 120),\n \"timeoutSec must be 0 to disable or between 10 and 120 seconds to arm\",\n ),\n);\n\nexport const CancelAllAfterInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n timeoutSec: CancelAllAfterTimeoutInputSchema,\n symbolId: v.optional(SymbolIdInputSchema),\n side: OptionalSideInputSchema,\n requestId: v.optional(OrderRequestIdInputSchema),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type CancelAllAfterInput = v.InferInput<typeof CancelAllAfterInputSchema>;\n\nexport const CancelAllAfterResultSchema = v.pipe(\n v.object({\n status: v.picklist([\"armed\", \"disabled\"]),\n effectiveTimeoutSec: v.pipe(v.number(), v.integer(), v.minValue(0)),\n expiresAtTsNs: v.bigint(),\n tsNs: v.bigint(),\n }),\n v.transform(({ expiresAtTsNs, tsNs, ...result }) => ({\n ...result,\n expiresAt: tsNsToMs(expiresAtTsNs),\n expiresAtNs: expiresAtTsNs.toString(),\n ts: tsNsToMs(tsNs),\n tsNs: tsNs.toString(),\n })),\n);\n\nexport type CancelAllAfterResult = v.InferOutput<typeof CancelAllAfterResultSchema>;\n\nexport function createBatchCreateOrdersInputSchema(scales: SdkScales) {\n return v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n requestId: v.optional(OrderRequestIdInputSchema),\n items: v.pipe(\n v.array(createOrderIntentInputSchema(scales)),\n v.minLength(1, \"At least one order is required.\"),\n v.maxLength(20, \"Batch create accepts at most 20 orders.\"),\n ),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n );\n}\n\nexport type BatchCreateOrdersInput = v.InferInput<\n ReturnType<typeof createBatchCreateOrdersInputSchema>\n>;\n\nconst BatchCreateOrderResultRawSchema = v.object({\n clientOrderId: v.string(),\n outcome: v.variant(\"case\", [\n v.object({\n case: v.literal(\"accepted\"),\n value: v.object({\n orderId: PublicIdSchema,\n takeProfitTriggerId: OptionalPublicIdSchema,\n stopLossTriggerId: OptionalPublicIdSchema,\n trailingStopTriggerId: OptionalPublicIdSchema,\n resolvedBaseQtyScaled: v.bigint(),\n submittedMaxQuoteDebitScaled: v.optional(v.bigint()),\n }),\n }),\n v.object({\n case: v.literal(\"rejected\"),\n value: v.object({\n // The server may reject without a structured detail (e.g. capacity\n // limits); surface the rejection instead of failing the parse.\n error: v.optional(OrderErrorDetailSchema),\n }),\n }),\n ]),\n});\n\nexport function createBatchCreateOrdersResultSchema(scales: SdkScales, symbolIds: number[]) {\n return v.pipe(\n v.object({\n results: v.array(BatchCreateOrderResultRawSchema),\n acceptedCount: BatchCountSchema,\n rejectedCount: BatchCountSchema,\n tsNs: v.bigint(),\n }),\n v.check(\n (response) =>\n response.acceptedCount + response.rejectedCount === response.results.length,\n \"Batch create result counts do not match the returned results.\",\n ),\n v.check(\n (response) => response.results.length === symbolIds.length,\n \"Batch create result count does not match the submitted item count.\",\n ),\n v.transform(({ tsNs, ...response }) => ({\n ...response,\n results: response.results.map(({ clientOrderId, outcome }, index) => {\n if (outcome.case === \"rejected\") {\n return {\n status: \"rejected\" as const,\n clientOrderId,\n error: outcome.value.error,\n };\n }\n const { resolvedBaseQtyScaled, submittedMaxQuoteDebitScaled, ...accepted } =\n outcome.value;\n const symbolId = symbolIds[index]!;\n return {\n status: \"accepted\" as const,\n clientOrderId,\n ...accepted,\n resolvedBaseQty: scaledToDecimalOutput(\n resolvedBaseQtyScaled,\n scales.baseQty(symbolId),\n ),\n ...(submittedMaxQuoteDebitScaled === undefined\n ? {}\n : {\n submittedMaxQuoteDebit: scaledToDecimalOutput(\n submittedMaxQuoteDebitScaled,\n scales.quoteAmount(symbolId),\n ),\n }),\n };\n }),\n ts: tsNsToMs(tsNs),\n tsNs: tsNs.toString(),\n })),\n );\n}\n\nexport type BatchCreateOrdersResult = v.InferOutput<\n ReturnType<typeof createBatchCreateOrdersResultSchema>\n>;\nexport type BatchCreateOrderResult = BatchCreateOrdersResult[\"results\"][number];\n\nconst DecimalInputStringSchema = v.pipe(v.string(), v.trim(), v.minLength(1));\nconst BATCH_REPLACE_ITEM_INPUT_KEYS = new Set([\n \"orderId\",\n \"clientOrderId\",\n \"newPrice\",\n \"newQty\",\n \"risk\",\n \"clearRisk\",\n \"newClientOrderId\",\n]);\n\nexport function assertKnownBatchReplaceOrderItemInputKeys(input: object): void {\n for (const key of Object.keys(input)) {\n if (!BATCH_REPLACE_ITEM_INPUT_KEYS.has(key)) {\n throw new Error(`Unknown key \"${key}\" in batch replace order item.`);\n }\n }\n}\n\nconst BatchReplaceTargetInputSchema = v.union([\n v.pipe(\n v.object({\n orderId: v.pipe(\n idInputSchema(\"items.orderId\"),\n v.check((value) => value > 0n, \"items.orderId must be greater than zero\"),\n ),\n clientOrderId: v.optional(v.never()),\n }),\n v.transform(({ orderId }) => ({\n key: { case: \"orderId\" as const, value: orderId },\n })),\n ),\n v.pipe(\n v.object({\n orderId: v.optional(v.never()),\n clientOrderId: ClientOrderIdInputSchema,\n }),\n v.transform(({ clientOrderId }) => ({\n key: { case: \"clientOrderId\" as const, value: clientOrderId },\n })),\n ),\n]);\n\nfunction createBatchReplaceOrderItemInputSchema(scales: SdkScales, symbolId: number) {\n const patchSchema = v.union([\n v.object({\n newPrice: DecimalInputStringSchema,\n newQty: v.optional(DecimalInputStringSchema),\n risk: v.optional(createRequiredRiskPolicyInputSchema(scales)),\n clearRisk: v.optional(v.literal(false)),\n }),\n v.object({\n newPrice: v.optional(DecimalInputStringSchema),\n newQty: DecimalInputStringSchema,\n risk: v.optional(createRequiredRiskPolicyInputSchema(scales)),\n clearRisk: v.optional(v.literal(false)),\n }),\n v.object({\n newPrice: v.optional(v.never()),\n newQty: v.optional(v.never()),\n risk: createRequiredRiskPolicyInputSchema(scales),\n clearRisk: v.optional(v.literal(false)),\n }),\n v.object({\n newPrice: v.optional(v.never()),\n newQty: v.optional(v.never()),\n risk: v.optional(v.never()),\n clearRisk: v.literal(true),\n }),\n ]);\n return v.pipe(\n v.intersect([\n BatchReplaceTargetInputSchema,\n patchSchema,\n v.object({\n newClientOrderId: v.optional(ClientOrderIdInputSchema),\n }),\n ]),\n v.transform((input) => ({\n key: input.key,\n newPriceTicks:\n input.newPrice === undefined\n ? undefined\n : positiveDecimalInputToScaled(\n \"items.newPrice\",\n input.newPrice,\n scales.price(),\n ),\n newQtyScaled:\n input.newQty === undefined\n ? undefined\n : positiveDecimalInputToScaled(\n \"items.newQty\",\n input.newQty,\n scales.baseQty(symbolId),\n ),\n newAttachedRisk:\n input.clearRisk === true ? create(ProtoWrite.RiskPolicySchema) : input.risk,\n newClientOrderId: input.newClientOrderId ?? \"\",\n })),\n );\n}\n\nexport function createBatchReplaceOrdersInputSchema(scales: SdkScales, symbolId: number) {\n return v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n symbolId: v.pipe(v.literal(symbolId), v.integer(), v.minValue(1)),\n requestId: v.optional(OrderRequestIdInputSchema),\n items: v.pipe(\n v.array(createBatchReplaceOrderItemInputSchema(scales, symbolId)),\n v.minLength(1, \"At least one replacement is required.\"),\n v.maxLength(50, \"Batch replace accepts at most 50 replacements.\"),\n ),\n }),\n v.check((input) => {\n const targets = input.items.map(\n (item) => `${item.key.case}:${item.key.value.toString()}`,\n );\n return new Set(targets).size === targets.length;\n }, \"Each batch replace target must be unique.\"),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n );\n}\n\nexport type BatchReplaceOrdersInput = {\n account?: v.InferInput<typeof AccountScopeInputEntries.account>;\n symbolId: number;\n requestId?: string;\n items: Array<{\n orderId?: string;\n clientOrderId?: string;\n newPrice?: string;\n newQty?: string;\n risk?: v.InferInput<ReturnType<typeof createRequiredRiskPolicyInputSchema>>;\n clearRisk?: boolean;\n newClientOrderId?: string;\n }>;\n};\n\nconst BatchReplaceAdmissionItemSchema = v.pipe(\n v.object({\n itemIndex: BatchItemIndexSchema,\n status: v.pipe(\n v.enum(ProtoWrite.BatchReplaceItemAdmissionStatus),\n v.transform((status) =>\n requiredEnumLabel(\n BatchReplaceItemAdmissionStatusCodec.protoToOutput,\n status,\n \"BatchReplaceAdmissionItemSchema\",\n \"status\",\n ),\n ),\n ),\n oldOrderId: OptionalPublicIdSchema,\n replacementOrderId: OptionalPublicIdSchema,\n clientOrderId: v.string(),\n code: v.string(),\n error: v.optional(OrderErrorDetailSchema),\n }),\n v.transform((item) => ({\n ...item,\n code: item.code || undefined,\n })),\n);\n\nexport type BatchReplaceAdmissionItem = v.InferOutput<typeof BatchReplaceAdmissionItemSchema>;\n\nexport const BatchReplaceOrdersResultSchema = v.pipe(\n v.object({\n batchRequestId: PositivePublicIdSchema,\n status: v.pipe(\n v.enum(ProtoWrite.BatchReplaceAdmissionStatus),\n v.transform((status) =>\n requiredEnumLabel(\n BatchReplaceAdmissionStatusCodec.protoToOutput,\n status,\n \"BatchReplaceOrdersResultSchema\",\n \"status\",\n ),\n ),\n ),\n results: v.array(BatchReplaceAdmissionItemSchema),\n acceptedCount: BatchCountSchema,\n rejectedCount: BatchCountSchema,\n acceptedTsNs: v.bigint(),\n }),\n v.check(\n (response) => response.acceptedCount + response.rejectedCount === response.results.length,\n \"Batch replace result counts do not match the returned results.\",\n ),\n v.check(\n (response) => response.results.every((item, index) => item.itemIndex === index),\n \"Batch replace results must preserve request item order.\",\n ),\n v.transform(({ acceptedTsNs, ...response }) => ({\n ...response,\n acceptedTs: tsNsToMs(acceptedTsNs),\n acceptedTsNs: acceptedTsNs.toString(),\n })),\n);\n\nexport type BatchReplaceOrdersResult = v.InferOutput<typeof BatchReplaceOrdersResultSchema>;\n\nexport const GetBatchReplaceStatusInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n batchRequestId: v.pipe(\n idInputSchema(\"batchRequestId\"),\n v.check((value) => value > 0n, \"batchRequestId must be greater than zero\"),\n ),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type GetBatchReplaceStatusInput = v.InferInput<typeof GetBatchReplaceStatusInputSchema>;\n\nconst BatchReplaceStatusItemSchema = v.pipe(\n v.object({\n itemIndex: BatchItemIndexSchema,\n phase: v.pipe(\n v.enum(ProtoRead.BatchReplacePhase),\n v.transform((phase) =>\n requiredEnumLabel(\n BatchReplacePhaseCodec.protoToOutput,\n phase,\n \"BatchReplaceStatusItemSchema\",\n \"phase\",\n ),\n ),\n ),\n oldOrderId: OptionalPublicIdSchema,\n replacementOrderId: OptionalPublicIdSchema,\n orderStatus: v.pipe(\n v.enum(ProtoRead.OrderStatus),\n v.transform((status) =>\n requiredEnumLabel(\n OrderStatusCodec.protoToOutput,\n status,\n \"BatchReplaceStatusItemSchema\",\n \"order status\",\n ),\n ),\n ),\n code: v.string(),\n updatedTsNs: v.bigint(),\n }),\n v.transform(({ updatedTsNs, ...item }) => ({\n ...item,\n code: item.code || undefined,\n updatedTs: tsNsToMs(updatedTsNs),\n updatedTsNs: updatedTsNs.toString(),\n })),\n);\n\nexport const GetBatchReplaceStatusResultSchema = v.pipe(\n v.object({\n batchRequestId: PositivePublicIdSchema,\n admissionStatus: v.pipe(\n v.enum(ProtoWrite.BatchReplaceAdmissionStatus),\n v.transform((status) =>\n requiredEnumLabel(\n BatchReplaceAdmissionStatusCodec.protoToOutput,\n status,\n \"GetBatchReplaceStatusResultSchema\",\n \"admission status\",\n ),\n ),\n ),\n items: v.array(BatchReplaceStatusItemSchema),\n acceptedCount: BatchCountSchema,\n rejectedCount: BatchCountSchema,\n acceptedTsNs: v.bigint(),\n updatedTsNs: v.bigint(),\n }),\n v.check(\n (response) => response.acceptedCount + response.rejectedCount === response.items.length,\n \"Batch replace status counts do not match the returned items.\",\n ),\n v.check(\n (response) => response.items.every((item, index) => item.itemIndex === index),\n \"Batch replace status items must preserve request item order.\",\n ),\n v.transform(({ acceptedTsNs, updatedTsNs, ...response }) => ({\n ...response,\n acceptedTs: tsNsToMs(acceptedTsNs),\n acceptedTsNs: acceptedTsNs.toString(),\n updatedTs: tsNsToMs(updatedTsNs),\n updatedTsNs: updatedTsNs.toString(),\n })),\n);\n\nexport type GetBatchReplaceStatusResult = v.InferOutput<typeof GetBatchReplaceStatusResultSchema>;\n\nconst BatchCancelOrderInputSchema = v.union([\n v.pipe(\n v.strictObject({\n orderId: v.pipe(\n idInputSchema(\"items.orderId\"),\n v.check((value) => value > 0n, \"items.orderId must be greater than zero\"),\n ),\n clientOrderId: v.optional(v.never()),\n symbolId: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1))),\n }),\n v.transform(({ orderId, symbolId }) => ({ orderId, symbolId })),\n ),\n v.pipe(\n v.strictObject({\n orderId: v.optional(v.never()),\n clientOrderId: ClientOrderIdInputSchema,\n symbolId: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1))),\n }),\n v.transform(({ clientOrderId, symbolId }) => ({ clientOrderId, symbolId })),\n ),\n]);\n\nexport type BatchCancelOrderInput = v.InferInput<typeof BatchCancelOrderInputSchema>;\n\nexport const BatchCancelOrdersInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n requestId: v.optional(OrderRequestIdInputSchema),\n items: v.pipe(\n v.array(BatchCancelOrderInputSchema),\n v.minLength(1, \"At least one order is required.\"),\n v.maxLength(50, \"Batch cancel accepts at most 50 orders.\"),\n ),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type BatchCancelOrdersInput = v.InferInput<typeof BatchCancelOrdersInputSchema>;\n\nconst BatchCancelOrderResultSchema = v.object({\n status: v.picklist([\"accepted\", \"rejected\"]),\n orderId: OptionalPublicIdSchema,\n clientOrderId: v.string(),\n code: v.string(),\n error: v.optional(OrderErrorDetailSchema),\n});\n\nexport type BatchCancelOrderResult = v.InferOutput<typeof BatchCancelOrderResultSchema>;\n\nexport const BatchCancelOrdersResultSchema = v.pipe(\n v.object({\n results: v.array(BatchCancelOrderResultSchema),\n acceptedCount: BatchCountSchema,\n rejectedCount: BatchCountSchema,\n tsNs: v.bigint(),\n }),\n v.check(\n (response) => response.acceptedCount + response.rejectedCount === response.results.length,\n \"Batch cancel result counts do not match the returned results.\",\n ),\n v.transform(({ tsNs, ...response }) => ({\n ...response,\n ts: tsNsToMs(tsNs),\n tsNs: tsNs.toString(),\n })),\n);\n\nexport type BatchCancelOrdersResult = v.InferOutput<typeof BatchCancelOrdersResultSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiCA,MAAM,mBAAmB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,CAAC;AACtE,MAAM,uBAAuB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,CAAC;AAC1E,MAAM,yBAAyB,EAAE,KAC7B,EAAE,OAAO,GACT,EAAE,QAAQ,EAAE,GACZ,EAAE,WAAW,UAAU,SAAS,KAAK,CAAC,CAC1C;AACA,MAAM,0BAA0B,EAAE,KAC9B,EAAE,SAAS,UAAU,GACrB,EAAE,WAAW,SAAU,OAAO,e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Ae,EAAE,OAAO;CACxB,MAAM,EAAE,OAAO;CACf,OAAO,EAAE,SAAS,sBAAsB;AAC5C,CAAC;AAID,MAAa,gCAAgC,EAAE,KAC3C,EAAE,OAAO;CACL,SAAS,EAAE,MAAM,4BAA4B;CAC7C,eAAe;CACf,eAAe;CACf,MAAM,EAAE,OAAO;AACnB,CAAC,GACD,EAAE,OACG,aAAa,SAAS,gBAAgB,SAAS,kBAAkB,SAAS,QAAQ,QACnF,+DACJ,GACA,EAAE,WAAW,EAAE,MAAM,GAAG,gBAAgB;CACpC,GAAG;CACH,IAAI,SAAS,IAAI;CACjB,MAAM,KAAK,SAAS;AACxB,EAAE,CACN"}
|
|
1
|
+
{"version":3,"file":"orders-batch.schemas.js","names":["ProtoWrite.RiskPolicySchema","ProtoWrite.BatchReplaceItemAdmissionStatus","ProtoWrite.BatchReplaceAdmissionStatus","ProtoRead.BatchReplacePhase","ProtoRead.OrderStatus"],"sources":["../../../src/services/orders/orders-batch.schemas.ts"],"sourcesContent":["import * as ProtoWrite from \"../../gen/orders/v1/orders_pb.js\";\nimport * as ProtoRead from \"../../gen/orders/v1/orders_read_pb.js\";\nimport { create } from \"@bufbuild/protobuf\";\nimport * as v from \"valibot\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport { OptionalPublicIdSchema, PublicIdSchema, idInputSchema } from \"../../shared/schemas.js\";\nimport { requiredEnumLabel } from \"../../shared/proto-enum-codec.js\";\nimport { tsNsToMs } from \"../../utils/time.js\";\nimport { formatId } from \"../../utils/base58-id.js\";\nimport { SideSchema, SymbolIdInputSchema } from \"../shared.js\";\nimport {\n positiveDecimalInputToScaled,\n scaledToDecimalOutput,\n type SdkScales,\n} from \"../../shared/decimal-surface.js\";\nimport {\n BatchReplaceAdmissionStatusCodec,\n BatchReplaceItemAdmissionStatusCodec,\n BatchReplacePhaseCodec,\n OrderStatusCodec,\n OrderSideCodec,\n} from \"./orders.codecs.js\";\nimport { createOrderIntentInputSchema } from \"./orders-input.schemas.js\";\nimport { createRequiredRiskPolicyInputSchema } from \"./orders-risk.schemas.js\";\nimport {\n ClientOrderIdInputSchema,\n positiveOrderIdInputSchema,\n OrderRequestIdInputSchema,\n} from \"./orders-identifiers.schemas.js\";\nimport { OrderErrorDetailSchema } from \"./order-errors.schemas.js\";\n\nconst BatchCountSchema = v.pipe(v.number(), v.integer(), v.minValue(0));\nconst BatchItemIndexSchema = v.pipe(v.number(), v.integer(), v.minValue(0));\nconst PositivePublicIdSchema = v.pipe(\n v.bigint(),\n v.gtValue(0n),\n v.transform((value) => formatId(value)),\n);\nconst OptionalSideInputSchema = v.pipe(\n v.optional(SideSchema),\n v.transform((side) => (side ? OrderSideCodec.inputToProto[side] : undefined)),\n);\n\nconst CancelAllAfterTimeoutInputSchema = v.pipe(\n v.number(),\n v.integer(),\n v.check(\n (timeoutSec) => timeoutSec === 0 || (timeoutSec >= 10 && timeoutSec <= 120),\n \"timeoutSec must be 0 to disable or between 10 and 120 seconds to arm\",\n ),\n);\n\nexport const CancelAllAfterInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n timeoutSec: CancelAllAfterTimeoutInputSchema,\n symbolId: v.optional(SymbolIdInputSchema),\n side: OptionalSideInputSchema,\n requestId: v.optional(OrderRequestIdInputSchema),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type CancelAllAfterInput = v.InferInput<typeof CancelAllAfterInputSchema>;\n\nexport const CancelAllAfterResultSchema = v.pipe(\n v.object({\n status: v.picklist([\"armed\", \"disabled\"]),\n effectiveTimeoutSec: v.pipe(v.number(), v.integer(), v.minValue(0)),\n expiresAtTsNs: v.bigint(),\n tsNs: v.bigint(),\n }),\n v.transform(({ expiresAtTsNs, tsNs, ...result }) => ({\n ...result,\n expiresAt: tsNsToMs(expiresAtTsNs),\n expiresAtNs: expiresAtTsNs.toString(),\n ts: tsNsToMs(tsNs),\n tsNs: tsNs.toString(),\n })),\n);\n\nexport type CancelAllAfterResult = v.InferOutput<typeof CancelAllAfterResultSchema>;\n\nexport function createBatchCreateOrdersInputSchema(scales: SdkScales) {\n return v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n requestId: v.optional(OrderRequestIdInputSchema),\n items: v.pipe(\n v.array(createOrderIntentInputSchema(scales)),\n v.minLength(1, \"At least one order is required.\"),\n v.maxLength(20, \"Batch create accepts at most 20 orders.\"),\n ),\n }),\n v.check((input) => {\n const clientOrderIds = input.items\n .map((item) => item.clientOrderId)\n .filter((clientOrderId) => clientOrderId !== undefined && clientOrderId !== \"\");\n return new Set(clientOrderIds).size === clientOrderIds.length;\n }, \"Each non-empty batch create clientOrderId must be unique.\"),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n );\n}\n\nexport type BatchCreateOrdersInput = v.InferInput<\n ReturnType<typeof createBatchCreateOrdersInputSchema>\n>;\n\nconst BatchCreateOrderResultRawSchema = v.object({\n clientOrderId: v.string(),\n outcome: v.variant(\"case\", [\n v.object({\n case: v.literal(\"accepted\"),\n value: v.object({\n orderId: PublicIdSchema,\n takeProfitTriggerId: OptionalPublicIdSchema,\n stopLossTriggerId: OptionalPublicIdSchema,\n trailingStopTriggerId: OptionalPublicIdSchema,\n resolvedBaseQtyScaled: v.bigint(),\n submittedMaxQuoteDebitScaled: v.optional(v.bigint()),\n }),\n }),\n v.object({\n case: v.literal(\"rejected\"),\n value: v.object({\n // The server may reject without a structured detail (e.g. capacity\n // limits); surface the rejection instead of failing the parse.\n error: v.optional(OrderErrorDetailSchema),\n }),\n }),\n ]),\n});\n\nexport function createBatchCreateOrdersResultSchema(scales: SdkScales, symbolIds: number[]) {\n return v.pipe(\n v.object({\n results: v.array(BatchCreateOrderResultRawSchema),\n acceptedCount: BatchCountSchema,\n rejectedCount: BatchCountSchema,\n tsNs: v.bigint(),\n }),\n v.check(\n (response) =>\n response.acceptedCount + response.rejectedCount === response.results.length,\n \"Batch create result counts do not match the returned results.\",\n ),\n v.check(\n (response) => response.results.length === symbolIds.length,\n \"Batch create result count does not match the submitted item count.\",\n ),\n v.transform(({ tsNs, ...response }) => ({\n ...response,\n results: response.results.map(({ clientOrderId, outcome }, index) => {\n if (outcome.case === \"rejected\") {\n return {\n status: \"rejected\" as const,\n clientOrderId,\n error: outcome.value.error,\n };\n }\n const { resolvedBaseQtyScaled, submittedMaxQuoteDebitScaled, ...accepted } =\n outcome.value;\n const symbolId = symbolIds[index]!;\n return {\n status: \"accepted\" as const,\n clientOrderId,\n ...accepted,\n resolvedBaseQty: scaledToDecimalOutput(\n resolvedBaseQtyScaled,\n scales.baseQty(symbolId),\n ),\n ...(submittedMaxQuoteDebitScaled === undefined\n ? {}\n : {\n submittedMaxQuoteDebit: scaledToDecimalOutput(\n submittedMaxQuoteDebitScaled,\n scales.quoteAmount(symbolId),\n ),\n }),\n };\n }),\n ts: tsNsToMs(tsNs),\n tsNs: tsNs.toString(),\n })),\n );\n}\n\nexport type BatchCreateOrdersResult = v.InferOutput<\n ReturnType<typeof createBatchCreateOrdersResultSchema>\n>;\nexport type BatchCreateOrderResult = BatchCreateOrdersResult[\"results\"][number];\n\nconst DecimalInputStringSchema = v.pipe(v.string(), v.trim(), v.minLength(1));\nconst BATCH_REPLACE_ITEM_INPUT_KEYS = new Set([\n \"orderId\",\n \"clientOrderId\",\n \"newPrice\",\n \"newQty\",\n \"risk\",\n \"clearRisk\",\n \"newClientOrderId\",\n]);\n\nexport function assertKnownBatchReplaceOrderItemInputKeys(input: object): void {\n for (const key of Object.keys(input)) {\n if (!BATCH_REPLACE_ITEM_INPUT_KEYS.has(key)) {\n throw new Error(`Unknown key \"${key}\" in batch replace order item.`);\n }\n }\n}\n\nconst BatchReplaceTargetInputSchema = v.union([\n v.pipe(\n v.object({\n orderId: v.pipe(\n idInputSchema(\"items.orderId\"),\n v.check((value) => value > 0n, \"items.orderId must be greater than zero\"),\n ),\n clientOrderId: v.optional(v.never()),\n }),\n v.transform(({ orderId }) => ({\n key: { case: \"orderId\" as const, value: orderId },\n })),\n ),\n v.pipe(\n v.object({\n orderId: v.optional(v.never()),\n clientOrderId: ClientOrderIdInputSchema,\n }),\n v.transform(({ clientOrderId }) => ({\n key: { case: \"clientOrderId\" as const, value: clientOrderId },\n })),\n ),\n]);\n\nfunction createBatchReplaceOrderItemInputSchema(scales: SdkScales) {\n const patchSchema = v.union([\n v.object({\n newPrice: DecimalInputStringSchema,\n newQty: v.optional(DecimalInputStringSchema),\n risk: v.optional(createRequiredRiskPolicyInputSchema(scales)),\n clearRisk: v.optional(v.literal(false)),\n }),\n v.object({\n newPrice: v.optional(DecimalInputStringSchema),\n newQty: DecimalInputStringSchema,\n risk: v.optional(createRequiredRiskPolicyInputSchema(scales)),\n clearRisk: v.optional(v.literal(false)),\n }),\n v.object({\n newPrice: v.optional(v.never()),\n newQty: v.optional(v.never()),\n risk: createRequiredRiskPolicyInputSchema(scales),\n clearRisk: v.optional(v.literal(false)),\n }),\n v.object({\n newPrice: v.optional(v.never()),\n newQty: v.optional(v.never()),\n risk: v.optional(v.never()),\n clearRisk: v.literal(true),\n }),\n ]);\n return v.intersect([\n BatchReplaceTargetInputSchema,\n patchSchema,\n v.object({\n newClientOrderId: v.optional(ClientOrderIdInputSchema),\n }),\n ]);\n}\n\nexport function createBatchReplaceOrdersInputSchema(scales: SdkScales) {\n return v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n symbolId: SymbolIdInputSchema,\n requestId: v.optional(OrderRequestIdInputSchema),\n items: v.pipe(\n v.array(createBatchReplaceOrderItemInputSchema(scales)),\n v.minLength(1, \"At least one replacement is required.\"),\n v.maxLength(50, \"Batch replace accepts at most 50 replacements.\"),\n ),\n }),\n v.check((input) => {\n const targets = input.items.map(\n (item) => `${item.key.case}:${item.key.value.toString()}`,\n );\n return new Set(targets).size === targets.length;\n }, \"Each batch replace target must be unique.\"),\n v.transform(({ account, items, ...input }) => {\n return {\n ...input,\n items: items.map((item) => ({\n key: item.key,\n newPriceTicks:\n item.newPrice === undefined\n ? undefined\n : positiveDecimalInputToScaled(\n \"items.newPrice\",\n item.newPrice,\n scales.price(),\n ),\n newQtyScaled:\n item.newQty === undefined\n ? undefined\n : positiveDecimalInputToScaled(\n \"items.newQty\",\n item.newQty,\n scales.baseQty(input.symbolId),\n ),\n newAttachedRisk:\n item.clearRisk === true ? create(ProtoWrite.RiskPolicySchema) : item.risk,\n newClientOrderId: item.newClientOrderId ?? \"\",\n })),\n subaccountId: accountScopeToSubaccountId(account),\n };\n }),\n );\n}\n\nexport type BatchReplaceOrdersInput = {\n account?: v.InferInput<typeof AccountScopeInputEntries.account>;\n symbolId: number;\n requestId?: string;\n items: Array<{\n orderId?: string;\n clientOrderId?: string;\n newPrice?: string;\n newQty?: string;\n risk?: v.InferInput<ReturnType<typeof createRequiredRiskPolicyInputSchema>>;\n clearRisk?: boolean;\n newClientOrderId?: string;\n }>;\n};\n\nconst BatchReplaceAdmissionItemSchema = v.pipe(\n v.object({\n itemIndex: BatchItemIndexSchema,\n status: v.pipe(\n v.enum(ProtoWrite.BatchReplaceItemAdmissionStatus),\n v.transform((status) =>\n requiredEnumLabel(\n BatchReplaceItemAdmissionStatusCodec.protoToOutput,\n status,\n \"BatchReplaceAdmissionItemSchema\",\n \"status\",\n ),\n ),\n ),\n oldOrderId: OptionalPublicIdSchema,\n replacementOrderId: OptionalPublicIdSchema,\n clientOrderId: v.string(),\n code: v.string(),\n error: v.optional(OrderErrorDetailSchema),\n }),\n v.transform((item) => ({\n ...item,\n code: item.code || undefined,\n })),\n);\n\nexport type BatchReplaceAdmissionItem = v.InferOutput<typeof BatchReplaceAdmissionItemSchema>;\n\nexport const BatchReplaceOrdersResultSchema = v.pipe(\n v.object({\n batchRequestId: PositivePublicIdSchema,\n status: v.pipe(\n v.enum(ProtoWrite.BatchReplaceAdmissionStatus),\n v.transform((status) =>\n requiredEnumLabel(\n BatchReplaceAdmissionStatusCodec.protoToOutput,\n status,\n \"BatchReplaceOrdersResultSchema\",\n \"status\",\n ),\n ),\n ),\n results: v.array(BatchReplaceAdmissionItemSchema),\n acceptedCount: BatchCountSchema,\n rejectedCount: BatchCountSchema,\n acceptedTsNs: v.bigint(),\n }),\n v.check(\n (response) => response.acceptedCount + response.rejectedCount === response.results.length,\n \"Batch replace result counts do not match the returned results.\",\n ),\n v.check(\n (response) => response.results.every((item, index) => item.itemIndex === index),\n \"Batch replace results must preserve request item order.\",\n ),\n v.transform(({ acceptedTsNs, ...response }) => ({\n ...response,\n acceptedTs: tsNsToMs(acceptedTsNs),\n acceptedTsNs: acceptedTsNs.toString(),\n })),\n);\n\nexport type BatchReplaceOrdersResult = v.InferOutput<typeof BatchReplaceOrdersResultSchema>;\n\nexport const GetBatchReplaceStatusInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n batchRequestId: v.pipe(\n idInputSchema(\"batchRequestId\"),\n v.check((value) => value > 0n, \"batchRequestId must be greater than zero\"),\n ),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type GetBatchReplaceStatusInput = v.InferInput<typeof GetBatchReplaceStatusInputSchema>;\n\nconst BatchReplaceStatusItemSchema = v.pipe(\n v.object({\n itemIndex: BatchItemIndexSchema,\n phase: v.pipe(\n v.enum(ProtoRead.BatchReplacePhase),\n v.transform((phase) =>\n requiredEnumLabel(\n BatchReplacePhaseCodec.protoToOutput,\n phase,\n \"BatchReplaceStatusItemSchema\",\n \"phase\",\n ),\n ),\n ),\n oldOrderId: OptionalPublicIdSchema,\n replacementOrderId: OptionalPublicIdSchema,\n orderStatus: v.pipe(\n v.enum(ProtoRead.OrderStatus),\n v.transform((status) =>\n requiredEnumLabel(\n OrderStatusCodec.protoToOutput,\n status,\n \"BatchReplaceStatusItemSchema\",\n \"order status\",\n ),\n ),\n ),\n code: v.string(),\n updatedTsNs: v.bigint(),\n }),\n v.transform(({ updatedTsNs, ...item }) => ({\n ...item,\n code: item.code || undefined,\n updatedTs: tsNsToMs(updatedTsNs),\n updatedTsNs: updatedTsNs.toString(),\n })),\n);\n\nexport const GetBatchReplaceStatusResultSchema = v.pipe(\n v.object({\n batchRequestId: PositivePublicIdSchema,\n admissionStatus: v.pipe(\n v.enum(ProtoWrite.BatchReplaceAdmissionStatus),\n v.transform((status) =>\n requiredEnumLabel(\n BatchReplaceAdmissionStatusCodec.protoToOutput,\n status,\n \"GetBatchReplaceStatusResultSchema\",\n \"admission status\",\n ),\n ),\n ),\n items: v.array(BatchReplaceStatusItemSchema),\n acceptedCount: BatchCountSchema,\n rejectedCount: BatchCountSchema,\n acceptedTsNs: v.bigint(),\n updatedTsNs: v.bigint(),\n }),\n v.check(\n (response) => response.acceptedCount + response.rejectedCount === response.items.length,\n \"Batch replace status counts do not match the returned items.\",\n ),\n v.check(\n (response) => response.items.every((item, index) => item.itemIndex === index),\n \"Batch replace status items must preserve request item order.\",\n ),\n v.transform(({ acceptedTsNs, updatedTsNs, ...response }) => ({\n ...response,\n acceptedTs: tsNsToMs(acceptedTsNs),\n acceptedTsNs: acceptedTsNs.toString(),\n updatedTs: tsNsToMs(updatedTsNs),\n updatedTsNs: updatedTsNs.toString(),\n })),\n);\n\nexport type GetBatchReplaceStatusResult = v.InferOutput<typeof GetBatchReplaceStatusResultSchema>;\n\nconst BatchCancelOrderInputSchema = v.union([\n v.pipe(\n v.strictObject({\n orderId: positiveOrderIdInputSchema(\"items.orderId\"),\n clientOrderId: v.optional(v.never()),\n symbolId: v.optional(SymbolIdInputSchema),\n }),\n v.transform(({ orderId, symbolId }) => ({ orderId, symbolId })),\n ),\n v.pipe(\n v.strictObject({\n orderId: v.optional(v.never()),\n clientOrderId: ClientOrderIdInputSchema,\n symbolId: v.optional(SymbolIdInputSchema),\n }),\n v.transform(({ clientOrderId, symbolId }) => ({ clientOrderId, symbolId })),\n ),\n]);\n\nexport type BatchCancelOrderInput = v.InferInput<typeof BatchCancelOrderInputSchema>;\n\nexport const BatchCancelOrdersInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n requestId: v.optional(OrderRequestIdInputSchema),\n items: v.pipe(\n v.array(BatchCancelOrderInputSchema),\n v.minLength(1, \"At least one order is required.\"),\n v.maxLength(50, \"Batch cancel accepts at most 50 orders.\"),\n ),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type BatchCancelOrdersInput = v.InferInput<typeof BatchCancelOrdersInputSchema>;\n\nconst BatchCancelOrderResultSchema = v.object({\n status: v.picklist([\"accepted\", \"rejected\"]),\n orderId: OptionalPublicIdSchema,\n clientOrderId: v.string(),\n code: v.string(),\n error: v.optional(OrderErrorDetailSchema),\n});\n\nexport type BatchCancelOrderResult = v.InferOutput<typeof BatchCancelOrderResultSchema>;\n\nexport const BatchCancelOrdersResultSchema = v.pipe(\n v.object({\n results: v.array(BatchCancelOrderResultSchema),\n acceptedCount: BatchCountSchema,\n rejectedCount: BatchCountSchema,\n tsNs: v.bigint(),\n }),\n v.check(\n (response) => response.acceptedCount + response.rejectedCount === response.results.length,\n \"Batch cancel result counts do not match the returned results.\",\n ),\n v.transform(({ tsNs, ...response }) => ({\n ...response,\n ts: tsNsToMs(tsNs),\n tsNs: tsNs.toString(),\n })),\n);\n\nexport type BatchCancelOrdersResult = v.InferOutput<typeof BatchCancelOrdersResultSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkCA,MAAM,mBAAmB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,CAAC;AACtE,MAAM,uBAAuB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,CAAC;AAC1E,MAAM,yBAAyB,EAAE,KAC7B,EAAE,OAAO,GACT,EAAE,QAAQ,EAAE,GACZ,EAAE,WAAW,UAAU,SAAS,KAAK,CAAC,CAC1C;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,SAAS;CACT,eAAe,EAAE,OAAO;CACxB,MAAM,EAAE,OAAO;CACf,OAAO,EAAE,SAAS,sBAAsB;AAC5C,CAAC;AAID,MAAa,gCAAgC,EAAE,KAC3C,EAAE,OAAO;CACL,SAAS,EAAE,MAAM,4BAA4B;CAC7C,eAAe;CACf,eAAe;CACf,MAAM,EAAE,OAAO;AACnB,CAAC,GACD,EAAE,OACG,aAAa,SAAS,gBAAgB,SAAS,kBAAkB,SAAS,QAAQ,QACnF,+DACJ,GACA,EAAE,WAAW,EAAE,MAAM,GAAG,gBAAgB;CACpC,GAAG;CACH,IAAI,SAAS,IAAI;CACjB,MAAM,KAAK,SAAS;AACxB,EAAE,CACN"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import { idInputSchema } from "../../shared/schemas.js";
|
|
1
2
|
import * as v from "valibot";
|
|
2
3
|
//#region src/services/orders/orders-identifiers.schemas.ts
|
|
3
4
|
const OrderIdempotencyKeyPattern = /^[A-Za-z0-9._:/-]*$/;
|
|
4
5
|
const ClientOrderIdWireInputSchema = v.pipe(v.string(), v.trim(), v.maxLength(36), v.regex(OrderIdempotencyKeyPattern, "clientOrderId has an invalid format"));
|
|
5
6
|
const ClientOrderIdInputSchema = v.pipe(ClientOrderIdWireInputSchema, v.minLength(1));
|
|
6
7
|
const OptionalClientOrderIdInputSchema = v.optional(ClientOrderIdWireInputSchema);
|
|
8
|
+
function positiveOrderIdInputSchema(fieldName = "orderId") {
|
|
9
|
+
return v.pipe(idInputSchema(fieldName), v.check((value) => value > 0n, `${fieldName} must be greater than zero`));
|
|
10
|
+
}
|
|
11
|
+
const OrderIdInputSchema = positiveOrderIdInputSchema();
|
|
7
12
|
const OrderRequestIdInputSchema = v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(64), v.regex(OrderIdempotencyKeyPattern, "requestId has an invalid format"));
|
|
8
13
|
//#endregion
|
|
9
|
-
export { ClientOrderIdInputSchema, OptionalClientOrderIdInputSchema, OrderRequestIdInputSchema };
|
|
14
|
+
export { ClientOrderIdInputSchema, OptionalClientOrderIdInputSchema, OrderIdInputSchema, OrderRequestIdInputSchema, positiveOrderIdInputSchema };
|
|
10
15
|
|
|
11
16
|
//# sourceMappingURL=orders-identifiers.schemas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orders-identifiers.schemas.js","names":[],"sources":["../../../src/services/orders/orders-identifiers.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\n\nconst OrderIdempotencyKeyPattern = /^[A-Za-z0-9._:/-]*$/;\n\nconst ClientOrderIdWireInputSchema = v.pipe(\n v.string(),\n v.trim(),\n v.maxLength(36),\n v.regex(OrderIdempotencyKeyPattern, \"clientOrderId has an invalid format\"),\n);\n\nexport const ClientOrderIdInputSchema = v.pipe(ClientOrderIdWireInputSchema, v.minLength(1));\n\nexport const OptionalClientOrderIdInputSchema = v.optional(ClientOrderIdWireInputSchema);\n\nexport const OrderRequestIdInputSchema = v.pipe(\n v.string(),\n v.trim(),\n v.minLength(1),\n v.maxLength(64),\n v.regex(OrderIdempotencyKeyPattern, \"requestId has an invalid format\"),\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"orders-identifiers.schemas.js","names":[],"sources":["../../../src/services/orders/orders-identifiers.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { idInputSchema } from \"../../shared/schemas.js\";\n\nconst OrderIdempotencyKeyPattern = /^[A-Za-z0-9._:/-]*$/;\n\nconst ClientOrderIdWireInputSchema = v.pipe(\n v.string(),\n v.trim(),\n v.maxLength(36),\n v.regex(OrderIdempotencyKeyPattern, \"clientOrderId has an invalid format\"),\n);\n\nexport const ClientOrderIdInputSchema = v.pipe(ClientOrderIdWireInputSchema, v.minLength(1));\n\nexport const OptionalClientOrderIdInputSchema = v.optional(ClientOrderIdWireInputSchema);\n\nexport function positiveOrderIdInputSchema(fieldName = \"orderId\") {\n return v.pipe(\n idInputSchema(fieldName),\n v.check((value) => value > 0n, `${fieldName} must be greater than zero`),\n );\n}\n\nexport const OrderIdInputSchema = positiveOrderIdInputSchema();\n\nexport const OrderRequestIdInputSchema = v.pipe(\n v.string(),\n v.trim(),\n v.minLength(1),\n v.maxLength(64),\n v.regex(OrderIdempotencyKeyPattern, \"requestId has an invalid format\"),\n);\n"],"mappings":";;;AAGA,MAAM,6BAA6B;AAEnC,MAAM,+BAA+B,EAAE,KACnC,EAAE,OAAO,GACT,EAAE,KAAK,GACP,EAAE,UAAU,EAAE,GACd,EAAE,MAAM,4BAA4B,qCAAqC,CAC7E;AAEA,MAAa,2BAA2B,EAAE,KAAK,8BAA8B,EAAE,UAAU,CAAC,CAAC;AAE3F,MAAa,mCAAmC,EAAE,SAAS,4BAA4B;AAEvF,SAAgB,2BAA2B,YAAY,WAAW;CAC9D,OAAO,EAAE,KACL,cAAc,SAAS,GACvB,EAAE,OAAO,UAAU,QAAQ,IAAI,GAAG,UAAU,2BAA2B,CAC3E;AACJ;AAEA,MAAa,qBAAqB,2BAA2B;AAE7D,MAAa,4BAA4B,EAAE,KACvC,EAAE,OAAO,GACT,EAAE,KAAK,GACP,EAAE,UAAU,CAAC,GACb,EAAE,UAAU,EAAE,GACd,EAAE,MAAM,4BAA4B,iCAAiC,CACzE"}
|
|
@@ -7,7 +7,7 @@ import * as v from "valibot";
|
|
|
7
7
|
declare const OpenOrdersInputSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
8
8
|
readonly includeAttachedRisk: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
9
9
|
readonly includeAttachedRiskState: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
10
|
-
readonly symbolId: v.OptionalSchema<v.ArraySchema<v.NumberSchema<undefined>, undefined>, undefined>;
|
|
10
|
+
readonly symbolId: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>, undefined>, undefined>;
|
|
11
11
|
readonly triggerId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, bigint | undefined>]>;
|
|
12
12
|
readonly side: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["buy", "sell"], undefined>, undefined>, v.TransformAction<"buy" | "sell" | undefined, Side.BUY | Side.SELL | undefined>]>;
|
|
13
13
|
readonly limit: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
@@ -40,10 +40,10 @@ type OpenOrdersInput = v.InferInput<typeof OpenOrdersInputSchema>;
|
|
|
40
40
|
declare const OrderHistoryInputSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
41
41
|
readonly includeAttachedRisk: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
42
42
|
readonly includeAttachedRiskState: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
43
|
-
readonly status: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["FILLED", "CANCELED", "REJECTED"], undefined>, undefined>, v.TransformAction<"
|
|
43
|
+
readonly status: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["FILLED", "CANCELED", "REJECTED"], undefined>, undefined>, v.TransformAction<"CANCELED" | "FILLED" | "REJECTED" | undefined, OrderStatus.FILLED | OrderStatus.CANCELED | OrderStatus.REJECTED | undefined>]>;
|
|
44
44
|
readonly startTsNs: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, bigint | undefined>]>;
|
|
45
45
|
readonly endTsNs: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, bigint | undefined>]>;
|
|
46
|
-
readonly symbolId: v.OptionalSchema<v.ArraySchema<v.NumberSchema<undefined>, undefined>, undefined>;
|
|
46
|
+
readonly symbolId: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>, undefined>, undefined>;
|
|
47
47
|
readonly triggerId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, bigint | undefined>]>;
|
|
48
48
|
readonly side: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["buy", "sell"], undefined>, undefined>, v.TransformAction<"buy" | "sell" | undefined, Side.BUY | Side.SELL | undefined>]>;
|
|
49
49
|
readonly limit: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
@@ -240,8 +240,6 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
240
240
|
}, undefined>, v.StrictObjectSchema<{
|
|
241
241
|
readonly kind: v.LiteralSchema<"bps", undefined>;
|
|
242
242
|
readonly bps: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.GtValueAction<number, 0, undefined>]>], undefined>;
|
|
243
|
-
}, undefined>, v.StrictObjectSchema<{
|
|
244
|
-
readonly kind: v.LiteralSchema<"none", undefined>;
|
|
245
243
|
}, undefined>], undefined>;
|
|
246
244
|
readonly maxSlippage: v.OptionalSchema<v.UnionSchema<[v.StrictObjectSchema<{
|
|
247
245
|
readonly kind: v.LiteralSchema<"slippage", undefined>;
|
|
@@ -257,8 +255,6 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
257
255
|
trailingDistance: {
|
|
258
256
|
kind: "bps";
|
|
259
257
|
bps: string | number;
|
|
260
|
-
} | {
|
|
261
|
-
kind: "none";
|
|
262
258
|
} | {
|
|
263
259
|
kind: "distance";
|
|
264
260
|
distance: string;
|
|
@@ -328,7 +324,7 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
328
324
|
}>]>;
|
|
329
325
|
readonly stopLoss: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
330
326
|
readonly trailingStop: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
331
|
-
readonly oco: v.OptionalSchema<v.
|
|
327
|
+
readonly oco: v.OptionalSchema<v.LiteralSchema<false, "oco requires takeProfit and exactly one stop leg">, undefined>;
|
|
332
328
|
}, undefined>, v.StrictObjectSchema<{
|
|
333
329
|
readonly takeProfit: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
334
330
|
readonly stopLoss: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
@@ -360,7 +356,7 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
360
356
|
};
|
|
361
357
|
}>]>;
|
|
362
358
|
readonly trailingStop: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
363
|
-
readonly oco: v.OptionalSchema<v.
|
|
359
|
+
readonly oco: v.OptionalSchema<v.LiteralSchema<false, "oco requires takeProfit and exactly one stop leg">, undefined>;
|
|
364
360
|
}, undefined>, v.StrictObjectSchema<{
|
|
365
361
|
readonly takeProfit: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
366
362
|
readonly stopLoss: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
@@ -371,8 +367,6 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
371
367
|
}, undefined>, v.StrictObjectSchema<{
|
|
372
368
|
readonly kind: v.LiteralSchema<"bps", undefined>;
|
|
373
369
|
readonly bps: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.GtValueAction<number, 0, undefined>]>], undefined>;
|
|
374
|
-
}, undefined>, v.StrictObjectSchema<{
|
|
375
|
-
readonly kind: v.LiteralSchema<"none", undefined>;
|
|
376
370
|
}, undefined>], undefined>;
|
|
377
371
|
readonly maxSlippage: v.OptionalSchema<v.UnionSchema<[v.StrictObjectSchema<{
|
|
378
372
|
readonly kind: v.LiteralSchema<"slippage", undefined>;
|
|
@@ -388,8 +382,6 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
388
382
|
trailingDistance: {
|
|
389
383
|
kind: "bps";
|
|
390
384
|
bps: string | number;
|
|
391
|
-
} | {
|
|
392
|
-
kind: "none";
|
|
393
385
|
} | {
|
|
394
386
|
kind: "distance";
|
|
395
387
|
distance: string;
|
|
@@ -427,7 +419,7 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
427
419
|
};
|
|
428
420
|
activationPriceTicks: bigint;
|
|
429
421
|
}>]>;
|
|
430
|
-
readonly oco: v.OptionalSchema<v.
|
|
422
|
+
readonly oco: v.OptionalSchema<v.LiteralSchema<false, "oco requires takeProfit and exactly one stop leg">, undefined>;
|
|
431
423
|
}, undefined>], undefined>, undefined>, v.TransformAction<{
|
|
432
424
|
takeProfit: {
|
|
433
425
|
triggerPriceTicks: bigint;
|
|
@@ -508,7 +500,7 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
508
500
|
};
|
|
509
501
|
stopLoss?: undefined;
|
|
510
502
|
trailingStop?: undefined;
|
|
511
|
-
oco?:
|
|
503
|
+
oco?: false | undefined;
|
|
512
504
|
} | {
|
|
513
505
|
takeProfit?: undefined;
|
|
514
506
|
stopLoss: {
|
|
@@ -524,7 +516,7 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
524
516
|
};
|
|
525
517
|
};
|
|
526
518
|
trailingStop?: undefined;
|
|
527
|
-
oco?:
|
|
519
|
+
oco?: false | undefined;
|
|
528
520
|
} | {
|
|
529
521
|
takeProfit?: undefined;
|
|
530
522
|
stopLoss?: undefined;
|
|
@@ -551,7 +543,7 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
551
543
|
};
|
|
552
544
|
activationPriceTicks: bigint;
|
|
553
545
|
};
|
|
554
|
-
oco?:
|
|
546
|
+
oco?: false | undefined;
|
|
555
547
|
} | undefined, {
|
|
556
548
|
takeProfit: {
|
|
557
549
|
triggerPriceTicks: bigint;
|
|
@@ -771,8 +763,6 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
771
763
|
}, undefined>, v.StrictObjectSchema<{
|
|
772
764
|
readonly kind: v.LiteralSchema<"bps", undefined>;
|
|
773
765
|
readonly bps: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.GtValueAction<number, 0, undefined>]>], undefined>;
|
|
774
|
-
}, undefined>, v.StrictObjectSchema<{
|
|
775
|
-
readonly kind: v.LiteralSchema<"none", undefined>;
|
|
776
766
|
}, undefined>], undefined>;
|
|
777
767
|
readonly maxSlippage: v.OptionalSchema<v.UnionSchema<[v.StrictObjectSchema<{
|
|
778
768
|
readonly kind: v.LiteralSchema<"slippage", undefined>;
|
|
@@ -788,8 +778,6 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
788
778
|
trailingDistance: {
|
|
789
779
|
kind: "bps";
|
|
790
780
|
bps: string | number;
|
|
791
|
-
} | {
|
|
792
|
-
kind: "none";
|
|
793
781
|
} | {
|
|
794
782
|
kind: "distance";
|
|
795
783
|
distance: string;
|
|
@@ -859,7 +847,7 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
859
847
|
}>]>;
|
|
860
848
|
readonly stopLoss: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
861
849
|
readonly trailingStop: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
862
|
-
readonly oco: v.OptionalSchema<v.
|
|
850
|
+
readonly oco: v.OptionalSchema<v.LiteralSchema<false, "oco requires takeProfit and exactly one stop leg">, undefined>;
|
|
863
851
|
}, undefined>, v.StrictObjectSchema<{
|
|
864
852
|
readonly takeProfit: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
865
853
|
readonly stopLoss: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
@@ -891,7 +879,7 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
891
879
|
};
|
|
892
880
|
}>]>;
|
|
893
881
|
readonly trailingStop: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
894
|
-
readonly oco: v.OptionalSchema<v.
|
|
882
|
+
readonly oco: v.OptionalSchema<v.LiteralSchema<false, "oco requires takeProfit and exactly one stop leg">, undefined>;
|
|
895
883
|
}, undefined>, v.StrictObjectSchema<{
|
|
896
884
|
readonly takeProfit: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
897
885
|
readonly stopLoss: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
@@ -902,8 +890,6 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
902
890
|
}, undefined>, v.StrictObjectSchema<{
|
|
903
891
|
readonly kind: v.LiteralSchema<"bps", undefined>;
|
|
904
892
|
readonly bps: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.GtValueAction<number, 0, undefined>]>], undefined>;
|
|
905
|
-
}, undefined>, v.StrictObjectSchema<{
|
|
906
|
-
readonly kind: v.LiteralSchema<"none", undefined>;
|
|
907
893
|
}, undefined>], undefined>;
|
|
908
894
|
readonly maxSlippage: v.OptionalSchema<v.UnionSchema<[v.StrictObjectSchema<{
|
|
909
895
|
readonly kind: v.LiteralSchema<"slippage", undefined>;
|
|
@@ -919,8 +905,6 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
919
905
|
trailingDistance: {
|
|
920
906
|
kind: "bps";
|
|
921
907
|
bps: string | number;
|
|
922
|
-
} | {
|
|
923
|
-
kind: "none";
|
|
924
908
|
} | {
|
|
925
909
|
kind: "distance";
|
|
926
910
|
distance: string;
|
|
@@ -958,7 +942,7 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
958
942
|
};
|
|
959
943
|
activationPriceTicks: bigint;
|
|
960
944
|
}>]>;
|
|
961
|
-
readonly oco: v.OptionalSchema<v.
|
|
945
|
+
readonly oco: v.OptionalSchema<v.LiteralSchema<false, "oco requires takeProfit and exactly one stop leg">, undefined>;
|
|
962
946
|
}, undefined>], undefined>, undefined>, v.TransformAction<{
|
|
963
947
|
takeProfit: {
|
|
964
948
|
triggerPriceTicks: bigint;
|
|
@@ -1039,7 +1023,7 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
1039
1023
|
};
|
|
1040
1024
|
stopLoss?: undefined;
|
|
1041
1025
|
trailingStop?: undefined;
|
|
1042
|
-
oco?:
|
|
1026
|
+
oco?: false | undefined;
|
|
1043
1027
|
} | {
|
|
1044
1028
|
takeProfit?: undefined;
|
|
1045
1029
|
stopLoss: {
|
|
@@ -1055,7 +1039,7 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
1055
1039
|
};
|
|
1056
1040
|
};
|
|
1057
1041
|
trailingStop?: undefined;
|
|
1058
|
-
oco?:
|
|
1042
|
+
oco?: false | undefined;
|
|
1059
1043
|
} | {
|
|
1060
1044
|
takeProfit?: undefined;
|
|
1061
1045
|
stopLoss?: undefined;
|
|
@@ -1082,7 +1066,7 @@ declare function createOrderIntentInputSchema(scales: SdkScales): v.SchemaWithPi
|
|
|
1082
1066
|
};
|
|
1083
1067
|
activationPriceTicks: bigint;
|
|
1084
1068
|
};
|
|
1085
|
-
oco?:
|
|
1069
|
+
oco?: false | undefined;
|
|
1086
1070
|
} | undefined, {
|
|
1087
1071
|
takeProfit: {
|
|
1088
1072
|
triggerPriceTicks: bigint;
|
|
@@ -1946,8 +1930,6 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
1946
1930
|
}, undefined>, v.StrictObjectSchema<{
|
|
1947
1931
|
readonly kind: v.LiteralSchema<"bps", undefined>;
|
|
1948
1932
|
readonly bps: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.GtValueAction<number, 0, undefined>]>], undefined>;
|
|
1949
|
-
}, undefined>, v.StrictObjectSchema<{
|
|
1950
|
-
readonly kind: v.LiteralSchema<"none", undefined>;
|
|
1951
1933
|
}, undefined>], undefined>;
|
|
1952
1934
|
readonly maxSlippage: v.OptionalSchema<v.UnionSchema<[v.StrictObjectSchema<{
|
|
1953
1935
|
readonly kind: v.LiteralSchema<"slippage", undefined>;
|
|
@@ -1963,8 +1945,6 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
1963
1945
|
trailingDistance: {
|
|
1964
1946
|
kind: "bps";
|
|
1965
1947
|
bps: string | number;
|
|
1966
|
-
} | {
|
|
1967
|
-
kind: "none";
|
|
1968
1948
|
} | {
|
|
1969
1949
|
kind: "distance";
|
|
1970
1950
|
distance: string;
|
|
@@ -2034,7 +2014,7 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
2034
2014
|
}>]>;
|
|
2035
2015
|
readonly stopLoss: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
2036
2016
|
readonly trailingStop: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
2037
|
-
readonly oco: v.OptionalSchema<v.
|
|
2017
|
+
readonly oco: v.OptionalSchema<v.LiteralSchema<false, "oco requires takeProfit and exactly one stop leg">, undefined>;
|
|
2038
2018
|
}, undefined>, v.StrictObjectSchema<{
|
|
2039
2019
|
readonly takeProfit: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
2040
2020
|
readonly stopLoss: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
@@ -2066,7 +2046,7 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
2066
2046
|
};
|
|
2067
2047
|
}>]>;
|
|
2068
2048
|
readonly trailingStop: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
2069
|
-
readonly oco: v.OptionalSchema<v.
|
|
2049
|
+
readonly oco: v.OptionalSchema<v.LiteralSchema<false, "oco requires takeProfit and exactly one stop leg">, undefined>;
|
|
2070
2050
|
}, undefined>, v.StrictObjectSchema<{
|
|
2071
2051
|
readonly takeProfit: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
2072
2052
|
readonly stopLoss: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
@@ -2077,8 +2057,6 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
2077
2057
|
}, undefined>, v.StrictObjectSchema<{
|
|
2078
2058
|
readonly kind: v.LiteralSchema<"bps", undefined>;
|
|
2079
2059
|
readonly bps: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.GtValueAction<number, 0, undefined>]>], undefined>;
|
|
2080
|
-
}, undefined>, v.StrictObjectSchema<{
|
|
2081
|
-
readonly kind: v.LiteralSchema<"none", undefined>;
|
|
2082
2060
|
}, undefined>], undefined>;
|
|
2083
2061
|
readonly maxSlippage: v.OptionalSchema<v.UnionSchema<[v.StrictObjectSchema<{
|
|
2084
2062
|
readonly kind: v.LiteralSchema<"slippage", undefined>;
|
|
@@ -2094,8 +2072,6 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
2094
2072
|
trailingDistance: {
|
|
2095
2073
|
kind: "bps";
|
|
2096
2074
|
bps: string | number;
|
|
2097
|
-
} | {
|
|
2098
|
-
kind: "none";
|
|
2099
2075
|
} | {
|
|
2100
2076
|
kind: "distance";
|
|
2101
2077
|
distance: string;
|
|
@@ -2133,7 +2109,7 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
2133
2109
|
};
|
|
2134
2110
|
activationPriceTicks: bigint;
|
|
2135
2111
|
}>]>;
|
|
2136
|
-
readonly oco: v.OptionalSchema<v.
|
|
2112
|
+
readonly oco: v.OptionalSchema<v.LiteralSchema<false, "oco requires takeProfit and exactly one stop leg">, undefined>;
|
|
2137
2113
|
}, undefined>], undefined>, undefined>, v.TransformAction<{
|
|
2138
2114
|
takeProfit: {
|
|
2139
2115
|
triggerPriceTicks: bigint;
|
|
@@ -2214,7 +2190,7 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
2214
2190
|
};
|
|
2215
2191
|
stopLoss?: undefined;
|
|
2216
2192
|
trailingStop?: undefined;
|
|
2217
|
-
oco?:
|
|
2193
|
+
oco?: false | undefined;
|
|
2218
2194
|
} | {
|
|
2219
2195
|
takeProfit?: undefined;
|
|
2220
2196
|
stopLoss: {
|
|
@@ -2230,7 +2206,7 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
2230
2206
|
};
|
|
2231
2207
|
};
|
|
2232
2208
|
trailingStop?: undefined;
|
|
2233
|
-
oco?:
|
|
2209
|
+
oco?: false | undefined;
|
|
2234
2210
|
} | {
|
|
2235
2211
|
takeProfit?: undefined;
|
|
2236
2212
|
stopLoss?: undefined;
|
|
@@ -2257,7 +2233,7 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
2257
2233
|
};
|
|
2258
2234
|
activationPriceTicks: bigint;
|
|
2259
2235
|
};
|
|
2260
|
-
oco?:
|
|
2236
|
+
oco?: false | undefined;
|
|
2261
2237
|
} | undefined, {
|
|
2262
2238
|
takeProfit: {
|
|
2263
2239
|
triggerPriceTicks: bigint;
|
|
@@ -2480,8 +2456,6 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
2480
2456
|
}, undefined>, v.StrictObjectSchema<{
|
|
2481
2457
|
readonly kind: v.LiteralSchema<"bps", undefined>;
|
|
2482
2458
|
readonly bps: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.GtValueAction<number, 0, undefined>]>], undefined>;
|
|
2483
|
-
}, undefined>, v.StrictObjectSchema<{
|
|
2484
|
-
readonly kind: v.LiteralSchema<"none", undefined>;
|
|
2485
2459
|
}, undefined>], undefined>;
|
|
2486
2460
|
readonly maxSlippage: v.OptionalSchema<v.UnionSchema<[v.StrictObjectSchema<{
|
|
2487
2461
|
readonly kind: v.LiteralSchema<"slippage", undefined>;
|
|
@@ -2497,8 +2471,6 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
2497
2471
|
trailingDistance: {
|
|
2498
2472
|
kind: "bps";
|
|
2499
2473
|
bps: string | number;
|
|
2500
|
-
} | {
|
|
2501
|
-
kind: "none";
|
|
2502
2474
|
} | {
|
|
2503
2475
|
kind: "distance";
|
|
2504
2476
|
distance: string;
|
|
@@ -2568,7 +2540,7 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
2568
2540
|
}>]>;
|
|
2569
2541
|
readonly stopLoss: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
2570
2542
|
readonly trailingStop: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
2571
|
-
readonly oco: v.OptionalSchema<v.
|
|
2543
|
+
readonly oco: v.OptionalSchema<v.LiteralSchema<false, "oco requires takeProfit and exactly one stop leg">, undefined>;
|
|
2572
2544
|
}, undefined>, v.StrictObjectSchema<{
|
|
2573
2545
|
readonly takeProfit: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
2574
2546
|
readonly stopLoss: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
@@ -2600,7 +2572,7 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
2600
2572
|
};
|
|
2601
2573
|
}>]>;
|
|
2602
2574
|
readonly trailingStop: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
2603
|
-
readonly oco: v.OptionalSchema<v.
|
|
2575
|
+
readonly oco: v.OptionalSchema<v.LiteralSchema<false, "oco requires takeProfit and exactly one stop leg">, undefined>;
|
|
2604
2576
|
}, undefined>, v.StrictObjectSchema<{
|
|
2605
2577
|
readonly takeProfit: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
2606
2578
|
readonly stopLoss: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
@@ -2611,8 +2583,6 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
2611
2583
|
}, undefined>, v.StrictObjectSchema<{
|
|
2612
2584
|
readonly kind: v.LiteralSchema<"bps", undefined>;
|
|
2613
2585
|
readonly bps: v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.GtValueAction<number, 0, undefined>]>], undefined>;
|
|
2614
|
-
}, undefined>, v.StrictObjectSchema<{
|
|
2615
|
-
readonly kind: v.LiteralSchema<"none", undefined>;
|
|
2616
2586
|
}, undefined>], undefined>;
|
|
2617
2587
|
readonly maxSlippage: v.OptionalSchema<v.UnionSchema<[v.StrictObjectSchema<{
|
|
2618
2588
|
readonly kind: v.LiteralSchema<"slippage", undefined>;
|
|
@@ -2628,8 +2598,6 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
2628
2598
|
trailingDistance: {
|
|
2629
2599
|
kind: "bps";
|
|
2630
2600
|
bps: string | number;
|
|
2631
|
-
} | {
|
|
2632
|
-
kind: "none";
|
|
2633
2601
|
} | {
|
|
2634
2602
|
kind: "distance";
|
|
2635
2603
|
distance: string;
|
|
@@ -2667,7 +2635,7 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
2667
2635
|
};
|
|
2668
2636
|
activationPriceTicks: bigint;
|
|
2669
2637
|
}>]>;
|
|
2670
|
-
readonly oco: v.OptionalSchema<v.
|
|
2638
|
+
readonly oco: v.OptionalSchema<v.LiteralSchema<false, "oco requires takeProfit and exactly one stop leg">, undefined>;
|
|
2671
2639
|
}, undefined>], undefined>, undefined>, v.TransformAction<{
|
|
2672
2640
|
takeProfit: {
|
|
2673
2641
|
triggerPriceTicks: bigint;
|
|
@@ -2748,7 +2716,7 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
2748
2716
|
};
|
|
2749
2717
|
stopLoss?: undefined;
|
|
2750
2718
|
trailingStop?: undefined;
|
|
2751
|
-
oco?:
|
|
2719
|
+
oco?: false | undefined;
|
|
2752
2720
|
} | {
|
|
2753
2721
|
takeProfit?: undefined;
|
|
2754
2722
|
stopLoss: {
|
|
@@ -2764,7 +2732,7 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
2764
2732
|
};
|
|
2765
2733
|
};
|
|
2766
2734
|
trailingStop?: undefined;
|
|
2767
|
-
oco?:
|
|
2735
|
+
oco?: false | undefined;
|
|
2768
2736
|
} | {
|
|
2769
2737
|
takeProfit?: undefined;
|
|
2770
2738
|
stopLoss?: undefined;
|
|
@@ -2791,7 +2759,7 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
2791
2759
|
};
|
|
2792
2760
|
activationPriceTicks: bigint;
|
|
2793
2761
|
};
|
|
2794
|
-
oco?:
|
|
2762
|
+
oco?: false | undefined;
|
|
2795
2763
|
} | undefined, {
|
|
2796
2764
|
takeProfit: {
|
|
2797
2765
|
triggerPriceTicks: bigint;
|
|
@@ -3519,19 +3487,19 @@ declare function createNewOrderInputSchema(scales: SdkScales): v.SchemaWithPipe<
|
|
|
3519
3487
|
}>]>;
|
|
3520
3488
|
type NewOrderInput = v.InferInput<ReturnType<typeof createNewOrderInputSchema>>;
|
|
3521
3489
|
declare const CancelOrderInputSchema: v.SchemaWithPipe<readonly [v.UnionSchema<[v.StrictObjectSchema<{
|
|
3522
|
-
readonly orderId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.TransformAction<string, bigint>]>;
|
|
3490
|
+
readonly orderId: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.TransformAction<string, bigint>]>, v.CheckAction<bigint, `${string} must be greater than zero`>]>;
|
|
3523
3491
|
readonly clientOrderId: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
3524
3492
|
readonly account: v.OptionalSchema<v.UnionSchema<[v.PicklistSchema<["active", "main"], undefined>, v.StrictObjectSchema<{
|
|
3525
3493
|
readonly subaccountId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
3526
3494
|
}, undefined>], undefined>, undefined>;
|
|
3527
|
-
readonly symbolId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
3495
|
+
readonly symbolId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>, undefined>;
|
|
3528
3496
|
}, undefined>, v.StrictObjectSchema<{
|
|
3529
3497
|
readonly orderId: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
3530
|
-
readonly clientOrderId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
3498
|
+
readonly clientOrderId: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, "clientOrderId has an invalid format">]>, v.MinLengthAction<string, 1, undefined>]>;
|
|
3531
3499
|
readonly account: v.OptionalSchema<v.UnionSchema<[v.PicklistSchema<["active", "main"], undefined>, v.StrictObjectSchema<{
|
|
3532
3500
|
readonly subaccountId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
3533
3501
|
}, undefined>], undefined>, undefined>;
|
|
3534
|
-
readonly symbolId: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
3502
|
+
readonly symbolId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>, undefined>;
|
|
3535
3503
|
}, undefined>], undefined>, v.TransformAction<{
|
|
3536
3504
|
orderId: bigint;
|
|
3537
3505
|
clientOrderId?: undefined;
|
|
@@ -3587,7 +3555,7 @@ declare const CancelAllOrdersInputSchema: v.SchemaWithPipe<readonly [v.StrictObj
|
|
|
3587
3555
|
readonly symbolId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>, undefined>;
|
|
3588
3556
|
readonly side: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["buy", "sell"], undefined>, undefined>, v.TransformAction<"buy" | "sell" | undefined, Side.BUY | Side.SELL | undefined>]>;
|
|
3589
3557
|
readonly dryRun: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
3590
|
-
readonly requestId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>]>, undefined>;
|
|
3558
|
+
readonly requestId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 64, undefined>, v.RegexAction<string, "requestId has an invalid format">]>, undefined>;
|
|
3591
3559
|
readonly account: v.OptionalSchema<v.UnionSchema<[v.PicklistSchema<["active", "main"], undefined>, v.StrictObjectSchema<{
|
|
3592
3560
|
readonly subaccountId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
3593
3561
|
}, undefined>], undefined>, undefined>;
|
|
@@ -3633,15 +3601,15 @@ declare const GetOrderDetailsInputSchema: v.SchemaWithPipe<readonly [v.StrictObj
|
|
|
3633
3601
|
readonly account: v.OptionalSchema<v.UnionSchema<[v.PicklistSchema<["active", "main"], undefined>, v.StrictObjectSchema<{
|
|
3634
3602
|
readonly subaccountId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
3635
3603
|
}, undefined>], undefined>, undefined>;
|
|
3636
|
-
readonly orderId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>;
|
|
3637
|
-
readonly clientOrderId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>;
|
|
3604
|
+
readonly orderId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.TransformAction<string, bigint>]>, v.CheckAction<bigint, `${string} must be greater than zero`>]>, undefined>;
|
|
3605
|
+
readonly clientOrderId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, "clientOrderId has an invalid format">]>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
3638
3606
|
}, undefined>, v.CheckAction<{
|
|
3639
3607
|
includeAttachedRisk: boolean;
|
|
3640
3608
|
includeAttachedRiskState: boolean;
|
|
3641
3609
|
account?: "active" | "main" | {
|
|
3642
3610
|
subaccountId: string;
|
|
3643
3611
|
} | undefined;
|
|
3644
|
-
orderId?:
|
|
3612
|
+
orderId?: bigint | undefined;
|
|
3645
3613
|
clientOrderId?: string | undefined;
|
|
3646
3614
|
}, "Provide exactly one of orderId or clientOrderId">, v.TransformAction<{
|
|
3647
3615
|
includeAttachedRisk: boolean;
|
|
@@ -3649,7 +3617,7 @@ declare const GetOrderDetailsInputSchema: v.SchemaWithPipe<readonly [v.StrictObj
|
|
|
3649
3617
|
account?: "active" | "main" | {
|
|
3650
3618
|
subaccountId: string;
|
|
3651
3619
|
} | undefined;
|
|
3652
|
-
orderId?:
|
|
3620
|
+
orderId?: bigint | undefined;
|
|
3653
3621
|
clientOrderId?: string | undefined;
|
|
3654
3622
|
}, {
|
|
3655
3623
|
subaccountId: bigint | undefined;
|