@polyester/sdk 0.18.0 → 0.19.1
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 +16 -0
- package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts +258 -3
- package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts.map +1 -1
- package/dist/gen/ledger/read/v1/ledger_read_pb.js +55 -13
- package/dist/gen/ledger/read/v1/ledger_read_pb.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/services/balances/balances.d.ts +9 -1
- package/dist/services/balances/balances.d.ts.map +1 -1
- package/dist/services/balances/balances.js +22 -1
- package/dist/services/balances/balances.js.map +1 -1
- package/dist/services/balances/balances.schemas.d.ts +165 -1
- package/dist/services/balances/balances.schemas.d.ts.map +1 -1
- package/dist/services/balances/balances.schemas.js +84 -3
- package/dist/services/balances/balances.schemas.js.map +1 -1
- package/dist/services/balances/balances.types.d.ts +2 -2
- package/dist/services/balances/index.d.ts +2 -2
- package/dist/services/heatmap/heatmap.schemas.d.ts +4 -4
- package/dist/services/market-overview/market-overview.d.ts +1 -0
- package/dist/services/market-overview/market-overview.d.ts.map +1 -1
- package/dist/services/market-overview/market-overview.js +24 -6
- package/dist/services/market-overview/market-overview.js.map +1 -1
- package/dist/services/orderbook/orderbook.schemas.d.ts +1 -1
- package/dist/services/orders/orders-input.schemas.d.ts +1 -1
- package/dist/services/orders/orders-output.schemas.d.ts +6 -6
- package/dist/services/subaccounts/subaccounts.schemas.d.ts +5 -5
- package/dist/services/trades/trades.d.ts +3 -4
- package/dist/services/trades/trades.d.ts.map +1 -1
- package/dist/services/trades/trades.js +1 -1
- package/dist/services/trades/trades.js.map +1 -1
- package/dist/services/trades/trades.schemas.d.ts +41 -7
- package/dist/services/trades/trades.schemas.d.ts.map +1 -1
- package/dist/services/trades/trades.schemas.js +20 -10
- package/dist/services/trades/trades.schemas.js.map +1 -1
- package/dist/services/triggers/trigger-input.schemas.d.ts +2 -2
- package/dist/services/triggers/triggers-output.schemas.d.ts +18 -18
- package/package.json +1 -1
|
@@ -60,39 +60,73 @@ declare function createUserTradeSchema(scales: SdkScales): v.SchemaWithPipe<read
|
|
|
60
60
|
/** A JSON-safe authenticated trade fill returned by the SDK. */
|
|
61
61
|
type Trade = v.InferOutput<ReturnType<typeof createUserTradeSchema>>;
|
|
62
62
|
/** Validates filters accepted by {@link TradesService.list}. */
|
|
63
|
-
declare const GetUserTradesInputSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
64
|
-
readonly symbolId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<
|
|
63
|
+
declare const GetUserTradesInputSchema: v.SchemaWithPipe<readonly [v.UnionSchema<[v.StrictObjectSchema<{
|
|
64
|
+
readonly symbolId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.TransformAction<string, number>]>, undefined>, v.TransformAction<number | undefined, number | undefined>]>;
|
|
65
|
+
readonly afterMatchId: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
65
66
|
readonly side: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["buy", "sell"], undefined>, undefined>, v.TransformAction<"buy" | "sell" | undefined, Side.BUY | Side.SELL | undefined>]>;
|
|
66
67
|
readonly startTsNs: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, bigint | undefined>]>;
|
|
67
68
|
readonly endTsNs: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, bigint | undefined>]>;
|
|
68
69
|
readonly limit: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
69
70
|
readonly pageToken: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>;
|
|
70
|
-
readonly afterMatchId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, bigint | undefined>]>;
|
|
71
71
|
readonly account: v.OptionalSchema<v.UnionSchema<[v.PicklistSchema<["active", "main"], undefined>, v.StrictObjectSchema<{
|
|
72
72
|
readonly subaccountId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
73
73
|
}, undefined>], undefined>, undefined>;
|
|
74
|
-
}, undefined>, v.
|
|
74
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
75
|
+
readonly symbolId: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.TransformAction<string, number>]>, v.CheckAction<number, "symbolId is required when afterMatchId is set">]>;
|
|
76
|
+
readonly afterMatchId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.TransformAction<string, bigint | undefined>]>;
|
|
77
|
+
readonly side: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["buy", "sell"], undefined>, undefined>, v.TransformAction<"buy" | "sell" | undefined, Side.BUY | Side.SELL | undefined>]>;
|
|
78
|
+
readonly startTsNs: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, bigint | undefined>]>;
|
|
79
|
+
readonly endTsNs: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, bigint | undefined>]>;
|
|
80
|
+
readonly limit: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
81
|
+
readonly pageToken: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>;
|
|
82
|
+
readonly account: v.OptionalSchema<v.UnionSchema<[v.PicklistSchema<["active", "main"], undefined>, v.StrictObjectSchema<{
|
|
83
|
+
readonly subaccountId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
84
|
+
}, undefined>], undefined>, undefined>;
|
|
85
|
+
}, undefined>], "symbolId is required when afterMatchId is set">, v.TransformAction<{
|
|
75
86
|
symbolId?: number | undefined;
|
|
87
|
+
afterMatchId?: undefined;
|
|
88
|
+
side?: Side.BUY | Side.SELL | undefined;
|
|
89
|
+
startTsNs?: bigint | undefined;
|
|
90
|
+
endTsNs?: bigint | undefined;
|
|
91
|
+
limit?: number | undefined;
|
|
92
|
+
pageToken?: string | undefined;
|
|
93
|
+
account?: "active" | "main" | {
|
|
94
|
+
subaccountId: string;
|
|
95
|
+
} | undefined;
|
|
96
|
+
} | {
|
|
97
|
+
symbolId: number;
|
|
98
|
+
afterMatchId: bigint | undefined;
|
|
76
99
|
side?: Side.BUY | Side.SELL | undefined;
|
|
77
100
|
startTsNs?: bigint | undefined;
|
|
78
101
|
endTsNs?: bigint | undefined;
|
|
79
102
|
limit?: number | undefined;
|
|
80
103
|
pageToken?: string | undefined;
|
|
81
|
-
afterMatchId?: bigint | undefined;
|
|
82
104
|
account?: "active" | "main" | {
|
|
83
105
|
subaccountId: string;
|
|
84
106
|
} | undefined;
|
|
85
107
|
}, {
|
|
86
108
|
subaccountId: bigint | undefined;
|
|
87
109
|
symbolId?: number | undefined;
|
|
110
|
+
afterMatchId?: undefined;
|
|
111
|
+
side?: Side.BUY | Side.SELL | undefined;
|
|
112
|
+
startTsNs?: bigint | undefined;
|
|
113
|
+
endTsNs?: bigint | undefined;
|
|
114
|
+
limit?: number | undefined;
|
|
115
|
+
pageToken?: string | undefined;
|
|
116
|
+
} | {
|
|
117
|
+
subaccountId: bigint | undefined;
|
|
118
|
+
symbolId: number;
|
|
119
|
+
afterMatchId: bigint | undefined;
|
|
88
120
|
side?: Side.BUY | Side.SELL | undefined;
|
|
89
121
|
startTsNs?: bigint | undefined;
|
|
90
122
|
endTsNs?: bigint | undefined;
|
|
91
123
|
limit?: number | undefined;
|
|
92
124
|
pageToken?: string | undefined;
|
|
93
|
-
afterMatchId?: bigint | undefined;
|
|
94
125
|
}>]>;
|
|
95
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* Filters accepted by {@link TradesService.list}. Passing `afterMatchId` requires
|
|
128
|
+
* `symbolId`; the two shapes form a discriminated union so the constraint is a compile error.
|
|
129
|
+
*/
|
|
96
130
|
type GetUserTradesInput = v.InferInput<typeof GetUserTradesInputSchema>;
|
|
97
131
|
//#endregion
|
|
98
132
|
export { GetUserTradesInput, GetUserTradesInputSchema, Trade, createUserTradeSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trades.schemas.d.ts","names":[],"sources":["../../../src/services/trades/trades.schemas.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"trades.schemas.d.ts","names":[],"sources":["../../../src/services/trades/trades.schemas.ts"],"mappings":";;;;;iBAsBgB,sBAAsB,QAAQ,YAAS,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwD3C,QAAQ,EAAE,YAAY,kBAAkB;;cAkDvC,0BAAwB,EAAA,yBAAA,EAAA,aAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAezB,qBAAqB,EAAE,kBAAkB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { requiredEnumLabel } from "../../shared/proto-enum-codec.js";
|
|
2
2
|
import { formatId } from "../../utils/base58-id.js";
|
|
3
|
+
import { parseOptionalUint64DecimalStrict } from "../../utils/numbers.js";
|
|
3
4
|
import { tsNsToISO, tsNsToMs } from "../../utils/time.js";
|
|
4
5
|
import { optionalUint64DecimalFilterSchema } from "../../shared/schemas.js";
|
|
5
6
|
import { SideSchema } from "../shared.js";
|
|
@@ -49,21 +50,30 @@ function createUserTradeSchema(scales) {
|
|
|
49
50
|
};
|
|
50
51
|
}));
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
-
const
|
|
53
|
+
const AFTER_MATCH_REQUIRES_SYMBOL = "symbolId is required when afterMatchId is set";
|
|
54
|
+
const SymbolIdStringSchema = v.pipe(v.string(), v.trim(), v.transform((value) => Number(value)));
|
|
55
|
+
const GetUserTradesCommonEntries = {
|
|
54
56
|
...AccountScopeInputEntries,
|
|
55
|
-
symbolId: v.pipe(v.optional(v.pipe(v.string(), v.trim())), v.transform((v) => {
|
|
56
|
-
if (!v) return void 0;
|
|
57
|
-
const sid = Number(v);
|
|
58
|
-
return Number.isFinite(sid) && sid > 0 ? sid : void 0;
|
|
59
|
-
})),
|
|
60
57
|
side: v.pipe(v.optional(SideSchema), v.transform((v) => v ? TradeSideCodec.inputToProto[v] : void 0)),
|
|
61
58
|
startTsNs: optionalUint64DecimalFilterSchema("startTsNs"),
|
|
62
59
|
endTsNs: optionalUint64DecimalFilterSchema("endTsNs"),
|
|
63
60
|
limit: v.optional(v.number()),
|
|
64
|
-
pageToken: v.optional(v.pipe(v.string(), v.trim()))
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
pageToken: v.optional(v.pipe(v.string(), v.trim()))
|
|
62
|
+
};
|
|
63
|
+
/** Browse mode: optional symbol filter, no replay cursor. */
|
|
64
|
+
const BrowseUserTradesInputSchema = v.strictObject({
|
|
65
|
+
...GetUserTradesCommonEntries,
|
|
66
|
+
symbolId: v.pipe(v.optional(SymbolIdStringSchema), v.transform((sid) => sid !== void 0 && Number.isFinite(sid) && sid > 0 ? sid : void 0)),
|
|
67
|
+
afterMatchId: v.optional(v.never())
|
|
68
|
+
});
|
|
69
|
+
/** Replay mode: `afterMatchId` cursor, which the backend only accepts scoped to a symbol. */
|
|
70
|
+
const ReplayUserTradesInputSchema = v.strictObject({
|
|
71
|
+
...GetUserTradesCommonEntries,
|
|
72
|
+
symbolId: v.pipe(SymbolIdStringSchema, v.check((sid) => Number.isInteger(sid) && sid > 0, AFTER_MATCH_REQUIRES_SYMBOL)),
|
|
73
|
+
afterMatchId: v.pipe(v.string(), v.trim(), v.minLength(1), v.transform((value) => parseOptionalUint64DecimalStrict(value, "afterMatchId")))
|
|
74
|
+
});
|
|
75
|
+
/** Validates filters accepted by {@link TradesService.list}. */
|
|
76
|
+
const GetUserTradesInputSchema = v.pipe(v.union([BrowseUserTradesInputSchema, ReplayUserTradesInputSchema], AFTER_MATCH_REQUIRES_SYMBOL), v.transform(({ account, ...input }) => ({
|
|
67
77
|
...input,
|
|
68
78
|
subaccountId: accountScopeToSubaccountId(account)
|
|
69
79
|
})));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trades.schemas.js","names":[],"sources":["../../../src/services/trades/trades.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { tsNsToISO, tsNsToMs } from \"../../utils/time.js\";\nimport { SideSchema } from \"../shared.js\";\nimport { FeeAssetCodec, OrderSideCodec } from \"../orders/orders.codecs.js\";\nimport { formatId } from \"../../utils/base58-id.js\";\nimport { optionalUint64DecimalFilterSchema } from \"../../shared/schemas.js\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport { TradeSideCodec } from \"./trades.codecs.js\";\nimport { requiredEnumLabel } from \"../../shared/proto-enum-codec.js\";\nimport { E18_SCALE, scaledToDecimalOutput, type SdkScales } from \"../../shared/decimal-surface.js\";\nimport { fromU128 } from \"../../utils/u128.js\";\n\nconst U128Schema = v.object({\n hi: v.bigint(),\n lo: v.bigint(),\n});\n\n/** Parses a generated user-trade fill into the SDK's JSON-safe public shape. */\nexport function createUserTradeSchema(scales: SdkScales) {\n return v.pipe(\n v.object({\n orderId: v.bigint(),\n symbolId: v.number(),\n side: v.number(),\n isMaker: v.boolean(),\n feeAsset: v.number(),\n qtyScaled: v.bigint(),\n priceTicks: v.bigint(),\n feeAmountE18: v.optional(U128Schema),\n referralShareAmountE18: v.optional(U128Schema),\n feeIsRebate: v.boolean(),\n tsNs: v.bigint(),\n matchId: v.bigint(),\n }),\n v.transform((t) => {\n const feeAsset = requiredEnumLabel(\n FeeAssetCodec.protoToOutput,\n t.feeAsset,\n \"UserTradeSchema\",\n \"fee asset\",\n );\n return {\n orderId: formatId(t.orderId),\n symbolId: t.symbolId,\n sideLabel: requiredEnumLabel(\n OrderSideCodec.protoToOutput,\n t.side,\n \"UserTradeSchema\",\n \"side\",\n ),\n liquidityLabel: t.isMaker ? (\"maker\" as const) : (\"taker\" as const),\n feeAsset,\n qty: scaledToDecimalOutput(t.qtyScaled, scales.baseQty(t.symbolId)),\n price: scaledToDecimalOutput(t.priceTicks, scales.price()),\n fee: scaledToDecimalOutput(fromU128(t.feeAmountE18), E18_SCALE),\n ...(t.referralShareAmountE18 === undefined\n ? {}\n : {\n referralShare: scaledToDecimalOutput(\n fromU128(t.referralShareAmountE18),\n E18_SCALE,\n ),\n }),\n feeIsRebate: t.feeIsRebate,\n tsNs: t.tsNs.toString(),\n tsIso: tsNsToISO(t.tsNs),\n tsMs: tsNsToMs(t.tsNs),\n matchId: t.matchId.toString(),\n };\n }),\n );\n}\n\n/** A JSON-safe authenticated trade fill returned by the SDK. */\nexport type Trade = v.InferOutput<ReturnType<typeof createUserTradeSchema>>;\n\
|
|
1
|
+
{"version":3,"file":"trades.schemas.js","names":[],"sources":["../../../src/services/trades/trades.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { tsNsToISO, tsNsToMs } from \"../../utils/time.js\";\nimport { SideSchema } from \"../shared.js\";\nimport { FeeAssetCodec, OrderSideCodec } from \"../orders/orders.codecs.js\";\nimport { formatId } from \"../../utils/base58-id.js\";\nimport { optionalUint64DecimalFilterSchema } from \"../../shared/schemas.js\";\nimport { parseOptionalUint64DecimalStrict } from \"../../utils/numbers.js\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport { TradeSideCodec } from \"./trades.codecs.js\";\nimport { requiredEnumLabel } from \"../../shared/proto-enum-codec.js\";\nimport { E18_SCALE, scaledToDecimalOutput, type SdkScales } from \"../../shared/decimal-surface.js\";\nimport { fromU128 } from \"../../utils/u128.js\";\n\nconst U128Schema = v.object({\n hi: v.bigint(),\n lo: v.bigint(),\n});\n\n/** Parses a generated user-trade fill into the SDK's JSON-safe public shape. */\nexport function createUserTradeSchema(scales: SdkScales) {\n return v.pipe(\n v.object({\n orderId: v.bigint(),\n symbolId: v.number(),\n side: v.number(),\n isMaker: v.boolean(),\n feeAsset: v.number(),\n qtyScaled: v.bigint(),\n priceTicks: v.bigint(),\n feeAmountE18: v.optional(U128Schema),\n referralShareAmountE18: v.optional(U128Schema),\n feeIsRebate: v.boolean(),\n tsNs: v.bigint(),\n matchId: v.bigint(),\n }),\n v.transform((t) => {\n const feeAsset = requiredEnumLabel(\n FeeAssetCodec.protoToOutput,\n t.feeAsset,\n \"UserTradeSchema\",\n \"fee asset\",\n );\n return {\n orderId: formatId(t.orderId),\n symbolId: t.symbolId,\n sideLabel: requiredEnumLabel(\n OrderSideCodec.protoToOutput,\n t.side,\n \"UserTradeSchema\",\n \"side\",\n ),\n liquidityLabel: t.isMaker ? (\"maker\" as const) : (\"taker\" as const),\n feeAsset,\n qty: scaledToDecimalOutput(t.qtyScaled, scales.baseQty(t.symbolId)),\n price: scaledToDecimalOutput(t.priceTicks, scales.price()),\n fee: scaledToDecimalOutput(fromU128(t.feeAmountE18), E18_SCALE),\n ...(t.referralShareAmountE18 === undefined\n ? {}\n : {\n referralShare: scaledToDecimalOutput(\n fromU128(t.referralShareAmountE18),\n E18_SCALE,\n ),\n }),\n feeIsRebate: t.feeIsRebate,\n tsNs: t.tsNs.toString(),\n tsIso: tsNsToISO(t.tsNs),\n tsMs: tsNsToMs(t.tsNs),\n matchId: t.matchId.toString(),\n };\n }),\n );\n}\n\n/** A JSON-safe authenticated trade fill returned by the SDK. */\nexport type Trade = v.InferOutput<ReturnType<typeof createUserTradeSchema>>;\n\nconst AFTER_MATCH_REQUIRES_SYMBOL = \"symbolId is required when afterMatchId is set\";\n\nconst SymbolIdStringSchema = v.pipe(\n v.string(),\n v.trim(),\n v.transform((value) => Number(value)),\n);\n\nconst GetUserTradesCommonEntries = {\n ...AccountScopeInputEntries,\n side: v.pipe(\n v.optional(SideSchema),\n v.transform((v) => (v ? TradeSideCodec.inputToProto[v] : undefined)),\n ),\n startTsNs: optionalUint64DecimalFilterSchema(\"startTsNs\"),\n endTsNs: optionalUint64DecimalFilterSchema(\"endTsNs\"),\n limit: v.optional(v.number()),\n pageToken: v.optional(v.pipe(v.string(), v.trim())),\n};\n\n/** Browse mode: optional symbol filter, no replay cursor. */\nconst BrowseUserTradesInputSchema = v.strictObject({\n ...GetUserTradesCommonEntries,\n symbolId: v.pipe(\n v.optional(SymbolIdStringSchema),\n v.transform((sid) =>\n sid !== undefined && Number.isFinite(sid) && sid > 0 ? sid : undefined,\n ),\n ),\n afterMatchId: v.optional(v.never()),\n});\n\n/** Replay mode: `afterMatchId` cursor, which the backend only accepts scoped to a symbol. */\nconst ReplayUserTradesInputSchema = v.strictObject({\n ...GetUserTradesCommonEntries,\n symbolId: v.pipe(\n SymbolIdStringSchema,\n v.check((sid) => Number.isInteger(sid) && sid > 0, AFTER_MATCH_REQUIRES_SYMBOL),\n ),\n afterMatchId: v.pipe(\n v.string(),\n v.trim(),\n v.minLength(1),\n v.transform((value) => parseOptionalUint64DecimalStrict(value, \"afterMatchId\")),\n ),\n});\n\n/** Validates filters accepted by {@link TradesService.list}. */\nexport const GetUserTradesInputSchema = v.pipe(\n v.union(\n [BrowseUserTradesInputSchema, ReplayUserTradesInputSchema],\n AFTER_MATCH_REQUIRES_SYMBOL,\n ),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\n/**\n * Filters accepted by {@link TradesService.list}. Passing `afterMatchId` requires\n * `symbolId`; the two shapes form a discriminated union so the constraint is a compile error.\n */\nexport type GetUserTradesInput = v.InferInput<typeof GetUserTradesInputSchema>;\n"],"mappings":";;;;;;;;;;;;;AAgBA,MAAM,aAAa,EAAE,OAAO;CACxB,IAAI,EAAE,OAAO;CACb,IAAI,EAAE,OAAO;AACjB,CAAC;;AAGD,SAAgB,sBAAsB,QAAmB;CACrD,OAAO,EAAE,KACL,EAAE,OAAO;EACL,SAAS,EAAE,OAAO;EAClB,UAAU,EAAE,OAAO;EACnB,MAAM,EAAE,OAAO;EACf,SAAS,EAAE,QAAQ;EACnB,UAAU,EAAE,OAAO;EACnB,WAAW,EAAE,OAAO;EACpB,YAAY,EAAE,OAAO;EACrB,cAAc,EAAE,SAAS,UAAU;EACnC,wBAAwB,EAAE,SAAS,UAAU;EAC7C,aAAa,EAAE,QAAQ;EACvB,MAAM,EAAE,OAAO;EACf,SAAS,EAAE,OAAO;CACtB,CAAC,GACD,EAAE,WAAW,MAAM;EACf,MAAM,WAAW,kBACb,cAAc,eACd,EAAE,UACF,mBACA,WACJ;EACA,OAAO;GACH,SAAS,SAAS,EAAE,OAAO;GAC3B,UAAU,EAAE;GACZ,WAAW,kBACP,eAAe,eACf,EAAE,MACF,mBACA,MACJ;GACA,gBAAgB,EAAE,UAAW,UAAqB;GAClD;GACA,KAAK,sBAAsB,EAAE,WAAW,OAAO,QAAQ,EAAE,QAAQ,CAAC;GAClE,OAAO,sBAAsB,EAAE,YAAY,OAAO,MAAM,CAAC;GACzD,KAAK,sBAAsB,SAAS,EAAE,YAAY,GAAA,EAAY;GAC9D,GAAI,EAAE,2BAA2B,KAAA,IAC3B,CAAC,IACD,EACI,eAAe,sBACX,SAAS,EAAE,sBAAsB,GAAA,EAErC,EACJ;GACN,aAAa,EAAE;GACf,MAAM,EAAE,KAAK,SAAS;GACtB,OAAO,UAAU,EAAE,IAAI;GACvB,MAAM,SAAS,EAAE,IAAI;GACrB,SAAS,EAAE,QAAQ,SAAS;EAChC;CACJ,CAAC,CACL;AACJ;AAKA,MAAM,8BAA8B;AAEpC,MAAM,uBAAuB,EAAE,KAC3B,EAAE,OAAO,GACT,EAAE,KAAK,GACP,EAAE,WAAW,UAAU,OAAO,KAAK,CAAC,CACxC;AAEA,MAAM,6BAA6B;CAC/B,GAAG;CACH,MAAM,EAAE,KACJ,EAAE,SAAS,UAAU,GACrB,EAAE,WAAW,MAAO,IAAI,eAAe,aAAa,KAAK,KAAA,CAAU,CACvE;CACA,WAAW,kCAAkC,WAAW;CACxD,SAAS,kCAAkC,SAAS;CACpD,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC;CAC5B,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,CAAC,CAAC;AACtD;;AAGA,MAAM,8BAA8B,EAAE,aAAa;CAC/C,GAAG;CACH,UAAU,EAAE,KACR,EAAE,SAAS,oBAAoB,GAC/B,EAAE,WAAW,QACT,QAAQ,KAAA,KAAa,OAAO,SAAS,GAAG,KAAK,MAAM,IAAI,MAAM,KAAA,CACjE,CACJ;CACA,cAAc,EAAE,SAAS,EAAE,MAAM,CAAC;AACtC,CAAC;;AAGD,MAAM,8BAA8B,EAAE,aAAa;CAC/C,GAAG;CACH,UAAU,EAAE,KACR,sBACA,EAAE,OAAO,QAAQ,OAAO,UAAU,GAAG,KAAK,MAAM,GAAG,2BAA2B,CAClF;CACA,cAAc,EAAE,KACZ,EAAE,OAAO,GACT,EAAE,KAAK,GACP,EAAE,UAAU,CAAC,GACb,EAAE,WAAW,UAAU,iCAAiC,OAAO,cAAc,CAAC,CAClF;AACJ,CAAC;;AAGD,MAAa,2BAA2B,EAAE,KACtC,EAAE,MACE,CAAC,6BAA6B,2BAA2B,GACzD,2BACJ,GACA,EAAE,WAAW,EAAE,SAAS,GAAG,aAAa;CACpC,GAAG;CACH,cAAc,2BAA2B,OAAO;AACpD,EAAE,CACN"}
|
|
@@ -809,7 +809,7 @@ type CreateTriggerInput = v.InferInput<ReturnType<typeof createCreateTriggerInpu
|
|
|
809
809
|
declare const ListTriggersInputSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
810
810
|
readonly parentOrderId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, bigint | undefined>]>;
|
|
811
811
|
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>;
|
|
812
|
-
readonly status: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["created", "armed", "running", "completed", "cancelled", "failed", "paused"], undefined>, undefined>, undefined>, v.TransformAction<("
|
|
812
|
+
readonly status: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["created", "armed", "running", "completed", "cancelled", "failed", "paused"], undefined>, undefined>, undefined>, v.TransformAction<("failed" | "cancelled" | "completed" | "created" | "armed" | "running" | "paused")[] | undefined, (TriggerStatus.STATUS_CREATED | TriggerStatus.STATUS_ARMED | TriggerStatus.STATUS_RUNNING | TriggerStatus.STATUS_COMPLETED | TriggerStatus.STATUS_CANCELED | TriggerStatus.STATUS_FAILED | TriggerStatus.STATUS_PAUSED)[]>]>;
|
|
813
813
|
readonly triggerType: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["stop_loss", "take_profit", "trailing_stop", "twap", "ladder"], undefined>, undefined>, v.TransformAction<"twap" | "ladder" | "stop_loss" | "take_profit" | "trailing_stop" | undefined, TriggerType>]>;
|
|
814
814
|
readonly limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 1000, undefined>]>, 50>;
|
|
815
815
|
readonly pageToken: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, "">;
|
|
@@ -1030,7 +1030,7 @@ declare const ListTriggerEventsInputSchema: v.SchemaWithPipe<readonly [v.StrictO
|
|
|
1030
1030
|
readonly triggerId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.TransformAction<string, bigint>]>;
|
|
1031
1031
|
}, undefined>, v.TransformAction<{
|
|
1032
1032
|
limit?: number | undefined;
|
|
1033
|
-
eventType?: "
|
|
1033
|
+
eventType?: "failed" | "updated" | "fired" | "canceled" | undefined;
|
|
1034
1034
|
pageToken: string;
|
|
1035
1035
|
account?: "active" | "main" | {
|
|
1036
1036
|
subaccountId: string;
|
|
@@ -31,62 +31,62 @@ declare const CreateTriggerResultSchema: v.SchemaWithPipe<readonly [v.ObjectSche
|
|
|
31
31
|
type CreateTriggerResult = v.InferOutput<typeof CreateTriggerResultSchema>;
|
|
32
32
|
declare const CancelTriggerResultSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
33
33
|
readonly triggerId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
34
|
-
readonly status: v.SchemaWithPipe<readonly [v.EnumSchema<typeof TriggerStatus, undefined>, v.TransformAction<TriggerStatus, "unspecified" | "
|
|
34
|
+
readonly status: v.SchemaWithPipe<readonly [v.EnumSchema<typeof TriggerStatus, undefined>, v.TransformAction<TriggerStatus, "unspecified" | "failed" | "cancelled" | "completed" | "created" | "armed" | "running" | "paused">]>;
|
|
35
35
|
readonly tsNs: v.BigintSchema<undefined>;
|
|
36
36
|
}, undefined>, v.TransformAction<{
|
|
37
37
|
triggerId: string;
|
|
38
|
-
status: "unspecified" | "
|
|
38
|
+
status: "unspecified" | "failed" | "cancelled" | "completed" | "created" | "armed" | "running" | "paused";
|
|
39
39
|
tsNs: bigint;
|
|
40
40
|
}, {
|
|
41
41
|
ts: number;
|
|
42
42
|
tsNs: string;
|
|
43
43
|
triggerId: string;
|
|
44
|
-
status: "unspecified" | "
|
|
44
|
+
status: "unspecified" | "failed" | "cancelled" | "completed" | "created" | "armed" | "running" | "paused";
|
|
45
45
|
}>]>;
|
|
46
46
|
type CancelTriggerResult = v.InferOutput<typeof CancelTriggerResultSchema>;
|
|
47
47
|
declare const ModifyTriggerResultSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
48
48
|
readonly triggerId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
49
|
-
readonly status: v.SchemaWithPipe<readonly [v.EnumSchema<typeof TriggerStatus, undefined>, v.TransformAction<TriggerStatus, "unspecified" | "
|
|
49
|
+
readonly status: v.SchemaWithPipe<readonly [v.EnumSchema<typeof TriggerStatus, undefined>, v.TransformAction<TriggerStatus, "unspecified" | "failed" | "cancelled" | "completed" | "created" | "armed" | "running" | "paused">]>;
|
|
50
50
|
readonly tsNs: v.BigintSchema<undefined>;
|
|
51
51
|
}, undefined>, v.TransformAction<{
|
|
52
52
|
triggerId: string;
|
|
53
|
-
status: "unspecified" | "
|
|
53
|
+
status: "unspecified" | "failed" | "cancelled" | "completed" | "created" | "armed" | "running" | "paused";
|
|
54
54
|
tsNs: bigint;
|
|
55
55
|
}, {
|
|
56
56
|
ts: number;
|
|
57
57
|
tsNs: string;
|
|
58
58
|
triggerId: string;
|
|
59
|
-
status: "unspecified" | "
|
|
59
|
+
status: "unspecified" | "failed" | "cancelled" | "completed" | "created" | "armed" | "running" | "paused";
|
|
60
60
|
}>]>;
|
|
61
61
|
type ModifyTriggerResult = v.InferOutput<typeof ModifyTriggerResultSchema>;
|
|
62
62
|
declare const PauseTriggerResultSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
63
63
|
readonly triggerId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
64
|
-
readonly status: v.SchemaWithPipe<readonly [v.EnumSchema<typeof TriggerStatus, undefined>, v.TransformAction<TriggerStatus, "unspecified" | "
|
|
64
|
+
readonly status: v.SchemaWithPipe<readonly [v.EnumSchema<typeof TriggerStatus, undefined>, v.TransformAction<TriggerStatus, "unspecified" | "failed" | "cancelled" | "completed" | "created" | "armed" | "running" | "paused">]>;
|
|
65
65
|
readonly tsNs: v.BigintSchema<undefined>;
|
|
66
66
|
}, undefined>, v.TransformAction<{
|
|
67
67
|
triggerId: string;
|
|
68
|
-
status: "unspecified" | "
|
|
68
|
+
status: "unspecified" | "failed" | "cancelled" | "completed" | "created" | "armed" | "running" | "paused";
|
|
69
69
|
tsNs: bigint;
|
|
70
70
|
}, {
|
|
71
71
|
ts: number;
|
|
72
72
|
tsNs: string;
|
|
73
73
|
triggerId: string;
|
|
74
|
-
status: "unspecified" | "
|
|
74
|
+
status: "unspecified" | "failed" | "cancelled" | "completed" | "created" | "armed" | "running" | "paused";
|
|
75
75
|
}>]>;
|
|
76
76
|
type PauseTriggerResult = v.InferOutput<typeof PauseTriggerResultSchema>;
|
|
77
77
|
declare const ResumeTriggerResultSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
78
78
|
readonly triggerId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
79
|
-
readonly status: v.SchemaWithPipe<readonly [v.EnumSchema<typeof TriggerStatus, undefined>, v.TransformAction<TriggerStatus, "unspecified" | "
|
|
79
|
+
readonly status: v.SchemaWithPipe<readonly [v.EnumSchema<typeof TriggerStatus, undefined>, v.TransformAction<TriggerStatus, "unspecified" | "failed" | "cancelled" | "completed" | "created" | "armed" | "running" | "paused">]>;
|
|
80
80
|
readonly tsNs: v.BigintSchema<undefined>;
|
|
81
81
|
}, undefined>, v.TransformAction<{
|
|
82
82
|
triggerId: string;
|
|
83
|
-
status: "unspecified" | "
|
|
83
|
+
status: "unspecified" | "failed" | "cancelled" | "completed" | "created" | "armed" | "running" | "paused";
|
|
84
84
|
tsNs: bigint;
|
|
85
85
|
}, {
|
|
86
86
|
ts: number;
|
|
87
87
|
tsNs: string;
|
|
88
88
|
triggerId: string;
|
|
89
|
-
status: "unspecified" | "
|
|
89
|
+
status: "unspecified" | "failed" | "cancelled" | "completed" | "created" | "armed" | "running" | "paused";
|
|
90
90
|
}>]>;
|
|
91
91
|
type ResumeTriggerResult = v.InferOutput<typeof ResumeTriggerResultSchema>;
|
|
92
92
|
type StopDetailsOutput = {
|
|
@@ -528,7 +528,7 @@ declare function createTriggerSchema(scales: SdkScales): v.SchemaWithPipe<readon
|
|
|
528
528
|
triggerId: string;
|
|
529
529
|
subaccountId: string;
|
|
530
530
|
symbolId: number;
|
|
531
|
-
status: "unspecified" | "
|
|
531
|
+
status: "unspecified" | "failed" | "cancelled" | "completed" | "created" | "armed" | "running" | "paused";
|
|
532
532
|
parentOrderId: string | undefined;
|
|
533
533
|
qty: string;
|
|
534
534
|
feeAsset: "unspecified" | "quote" | "base";
|
|
@@ -669,7 +669,7 @@ declare function createTriggerSchema(scales: SdkScales): v.SchemaWithPipe<readon
|
|
|
669
669
|
triggerId: string;
|
|
670
670
|
subaccountId: string;
|
|
671
671
|
symbolId: number;
|
|
672
|
-
status: "unspecified" | "
|
|
672
|
+
status: "unspecified" | "failed" | "cancelled" | "completed" | "created" | "armed" | "running" | "paused";
|
|
673
673
|
parentOrderId: string | undefined;
|
|
674
674
|
qty: string;
|
|
675
675
|
feeAsset: "unspecified" | "quote" | "base";
|
|
@@ -810,7 +810,7 @@ declare function createTriggerSchema(scales: SdkScales): v.SchemaWithPipe<readon
|
|
|
810
810
|
triggerId: string;
|
|
811
811
|
subaccountId: string;
|
|
812
812
|
symbolId: number;
|
|
813
|
-
status: "unspecified" | "
|
|
813
|
+
status: "unspecified" | "failed" | "cancelled" | "completed" | "created" | "armed" | "running" | "paused";
|
|
814
814
|
parentOrderId: string | undefined;
|
|
815
815
|
qty: string;
|
|
816
816
|
feeAsset: "unspecified" | "quote" | "base";
|
|
@@ -994,7 +994,7 @@ declare function createTriggerEventSchema(scales: SdkScales): v.SchemaWithPipe<r
|
|
|
994
994
|
subaccountId: string;
|
|
995
995
|
symbolId: number;
|
|
996
996
|
triggerType: "unspecified" | "twap" | "ladder" | "stop_loss" | "take_profit" | "trailing_stop";
|
|
997
|
-
eventType: "unspecified" | "
|
|
997
|
+
eventType: "unspecified" | "failed" | "updated" | "fired" | "canceled";
|
|
998
998
|
ts: number;
|
|
999
999
|
childSeq: number;
|
|
1000
1000
|
childOrderId: string | undefined;
|
|
@@ -1006,7 +1006,7 @@ declare function createTriggerEventSchema(scales: SdkScales): v.SchemaWithPipe<r
|
|
|
1006
1006
|
subaccountId: string;
|
|
1007
1007
|
symbolId: number;
|
|
1008
1008
|
triggerType: "unspecified" | "twap" | "ladder" | "stop_loss" | "take_profit" | "trailing_stop";
|
|
1009
|
-
eventType: "unspecified" | "
|
|
1009
|
+
eventType: "unspecified" | "failed" | "updated" | "fired" | "canceled";
|
|
1010
1010
|
ts: number;
|
|
1011
1011
|
childSeq: number;
|
|
1012
1012
|
childOrderId: string | undefined;
|
|
@@ -1018,7 +1018,7 @@ declare function createTriggerEventSchema(scales: SdkScales): v.SchemaWithPipe<r
|
|
|
1018
1018
|
subaccountId: string;
|
|
1019
1019
|
symbolId: number;
|
|
1020
1020
|
triggerType: "unspecified" | "twap" | "ladder" | "stop_loss" | "take_profit" | "trailing_stop";
|
|
1021
|
-
eventType: "unspecified" | "
|
|
1021
|
+
eventType: "unspecified" | "failed" | "updated" | "fired" | "canceled";
|
|
1022
1022
|
ts: number;
|
|
1023
1023
|
childSeq: number;
|
|
1024
1024
|
childOrderId: string | undefined;
|
package/package.json
CHANGED