@polyester/sdk 0.0.1 → 0.1.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 +14 -0
- package/README.md +121 -36
- package/dist/gen/chain/lifecycle/v1/types_pb.d.ts +19 -1
- package/dist/gen/chain/lifecycle/v1/types_pb.d.ts.map +1 -1
- package/dist/gen/chain/lifecycle/v1/types_pb.js +19 -1
- package/dist/gen/chain/lifecycle/v1/types_pb.js.map +1 -1
- package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts +2 -0
- package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts.map +1 -1
- package/dist/gen/chain/withdraw/v1/withdraw_pb.js.map +1 -1
- package/dist/gen/orders/v1/orders_read_pb.d.ts +14 -13
- package/dist/gen/orders/v1/orders_read_pb.d.ts.map +1 -1
- package/dist/gen/orders/v1/orders_read_pb.js +1 -1
- package/dist/gen/orders/v1/orders_read_pb.js.map +1 -1
- package/dist/services/heatmap/heatmap.schemas.d.ts +4 -4
- package/dist/services/lifecycle/lifecycle.codecs.d.ts +1 -1
- package/dist/services/lifecycle/lifecycle.codecs.d.ts.map +1 -1
- package/dist/services/lifecycle/lifecycle.codecs.js +4 -1
- package/dist/services/lifecycle/lifecycle.codecs.js.map +1 -1
- package/dist/services/lifecycle/lifecycle.schemas.d.ts +42 -42
- package/dist/services/orderbook/orderbook.schemas.d.ts +1 -1
- package/dist/services/orders/orders-output.schemas.d.ts +24 -12
- package/dist/services/orders/orders-output.schemas.d.ts.map +1 -1
- package/dist/services/subaccounts/subaccounts.schemas.d.ts +5 -5
- package/dist/services/trades/trades.schemas.d.ts +28 -12
- package/dist/services/trades/trades.schemas.d.ts.map +1 -1
- package/dist/services/trades/trades.schemas.js +13 -7
- package/dist/services/trades/trades.schemas.js.map +1 -1
- package/dist/services/triggers/trigger-input.schemas.d.ts +1 -1
- package/dist/services/triggers/triggers-output.schemas.d.ts +13 -13
- package/package.json +1 -1
|
@@ -2,36 +2,53 @@ import { Side } from "../../gen/orders/v1/orders_pb.js";
|
|
|
2
2
|
import { SdkScales } from "../../shared/decimal-surface.js";
|
|
3
3
|
import * as v from "valibot";
|
|
4
4
|
//#region src/services/trades/trades.schemas.d.ts
|
|
5
|
+
/** Parses a generated user-trade fill into the SDK's JSON-safe public shape. */
|
|
5
6
|
declare function createUserTradeSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
6
|
-
readonly tradeId: v.OptionalSchema<v.BigintSchema<undefined>, undefined>;
|
|
7
7
|
readonly orderId: v.BigintSchema<undefined>;
|
|
8
|
-
readonly subaccountId: v.OptionalSchema<v.BigintSchema<undefined>, undefined>;
|
|
9
8
|
readonly symbolId: v.NumberSchema<undefined>;
|
|
10
9
|
readonly side: v.NumberSchema<undefined>;
|
|
11
10
|
readonly isMaker: v.BooleanSchema<undefined>;
|
|
12
11
|
readonly feeAsset: v.NumberSchema<undefined>;
|
|
13
12
|
readonly qtyScaled: v.BigintSchema<undefined>;
|
|
14
13
|
readonly priceTicks: v.BigintSchema<undefined>;
|
|
15
|
-
readonly
|
|
14
|
+
readonly feeAmountE18: v.OptionalSchema<v.ObjectSchema<{
|
|
15
|
+
readonly hi: v.BigintSchema<undefined>;
|
|
16
|
+
readonly lo: v.BigintSchema<undefined>;
|
|
17
|
+
}, undefined>, undefined>;
|
|
18
|
+
readonly referralShareAmountE18: v.OptionalSchema<v.ObjectSchema<{
|
|
19
|
+
readonly hi: v.BigintSchema<undefined>;
|
|
20
|
+
readonly lo: v.BigintSchema<undefined>;
|
|
21
|
+
}, undefined>, undefined>;
|
|
22
|
+
readonly feeIsRebate: v.BooleanSchema<undefined>;
|
|
16
23
|
readonly tsNs: v.BigintSchema<undefined>;
|
|
17
24
|
readonly matchId: v.BigintSchema<undefined>;
|
|
18
25
|
}, undefined>, v.TransformAction<{
|
|
19
|
-
tradeId?: bigint | undefined;
|
|
20
26
|
orderId: bigint;
|
|
21
|
-
subaccountId?: bigint | undefined;
|
|
22
27
|
symbolId: number;
|
|
23
28
|
side: number;
|
|
24
29
|
isMaker: boolean;
|
|
25
30
|
feeAsset: number;
|
|
26
31
|
qtyScaled: bigint;
|
|
27
32
|
priceTicks: bigint;
|
|
28
|
-
|
|
33
|
+
feeAmountE18?: {
|
|
34
|
+
hi: bigint;
|
|
35
|
+
lo: bigint;
|
|
36
|
+
} | undefined;
|
|
37
|
+
referralShareAmountE18?: {
|
|
38
|
+
hi: bigint;
|
|
39
|
+
lo: bigint;
|
|
40
|
+
} | undefined;
|
|
41
|
+
feeIsRebate: boolean;
|
|
29
42
|
tsNs: bigint;
|
|
30
43
|
matchId: bigint;
|
|
31
44
|
}, {
|
|
32
|
-
|
|
45
|
+
feeIsRebate: boolean;
|
|
46
|
+
tsNs: string;
|
|
47
|
+
tsIso: string;
|
|
48
|
+
tsMs: number;
|
|
49
|
+
matchId: string;
|
|
50
|
+
referralShare?: string | undefined;
|
|
33
51
|
orderId: string;
|
|
34
|
-
subaccountId: string | undefined;
|
|
35
52
|
symbolId: number;
|
|
36
53
|
sideLabel: "unspecified" | "buy" | "sell";
|
|
37
54
|
liquidityLabel: "maker" | "taker";
|
|
@@ -39,12 +56,10 @@ declare function createUserTradeSchema(scales: SdkScales): v.SchemaWithPipe<read
|
|
|
39
56
|
qty: string;
|
|
40
57
|
price: string;
|
|
41
58
|
fee: string;
|
|
42
|
-
tsNs: string;
|
|
43
|
-
tsIso: string;
|
|
44
|
-
tsMs: number;
|
|
45
|
-
matchId: string;
|
|
46
59
|
}>]>;
|
|
60
|
+
/** A JSON-safe authenticated trade fill returned by the SDK. */
|
|
47
61
|
type Trade = v.InferOutput<ReturnType<typeof createUserTradeSchema>>;
|
|
62
|
+
/** Validates filters accepted by {@link TradesService.list}. */
|
|
48
63
|
declare const GetUserTradesInputSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
49
64
|
readonly symbolId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, number | undefined>]>;
|
|
50
65
|
readonly side: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<["buy", "sell"], undefined>, undefined>, v.TransformAction<"buy" | "sell" | undefined, Side.BUY | Side.SELL | undefined>]>;
|
|
@@ -74,6 +89,7 @@ declare const GetUserTradesInputSchema: v.SchemaWithPipe<readonly [v.StrictObjec
|
|
|
74
89
|
limit?: number | undefined;
|
|
75
90
|
pageToken?: string | undefined;
|
|
76
91
|
}>]>;
|
|
92
|
+
/** Filters accepted by {@link TradesService.list}. */
|
|
77
93
|
type GetUserTradesInput = v.InferInput<typeof GetUserTradesInputSchema>;
|
|
78
94
|
//#endregion
|
|
79
95
|
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":";;;;;iBAqBgB,sBAAsB,QAAQ,YAAS,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwD3C,QAAQ,EAAE,YAAY,kBAAkB;;cAGvC,0BAAwB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BzB,qBAAqB,EAAE,kBAAkB"}
|
|
@@ -5,38 +5,43 @@ import { requiredEnumLabel } from "../../shared/proto-enum-codec.js";
|
|
|
5
5
|
import { AccountScopeInputEntries, accountScopeToSubaccountId } from "../../shared/account-scope.js";
|
|
6
6
|
import { scaledToDecimalOutput } from "../../shared/decimal-surface.js";
|
|
7
7
|
import { SideSchema } from "../shared.js";
|
|
8
|
+
import { fromU128 } from "../../utils/u128.js";
|
|
8
9
|
import { FeeAssetCodec, OrderSideCodec } from "../orders/order-enums.codecs.js";
|
|
9
10
|
import { TradeSideCodec } from "./trades.codecs.js";
|
|
10
11
|
import * as v from "valibot";
|
|
11
12
|
//#region src/services/trades/trades.schemas.ts
|
|
13
|
+
const U128Schema = v.object({
|
|
14
|
+
hi: v.bigint(),
|
|
15
|
+
lo: v.bigint()
|
|
16
|
+
});
|
|
17
|
+
/** Parses a generated user-trade fill into the SDK's JSON-safe public shape. */
|
|
12
18
|
function createUserTradeSchema(scales) {
|
|
13
19
|
return v.pipe(v.object({
|
|
14
|
-
tradeId: v.optional(v.bigint()),
|
|
15
20
|
orderId: v.bigint(),
|
|
16
|
-
subaccountId: v.optional(v.bigint()),
|
|
17
21
|
symbolId: v.number(),
|
|
18
22
|
side: v.number(),
|
|
19
23
|
isMaker: v.boolean(),
|
|
20
24
|
feeAsset: v.number(),
|
|
21
25
|
qtyScaled: v.bigint(),
|
|
22
26
|
priceTicks: v.bigint(),
|
|
23
|
-
|
|
27
|
+
feeAmountE18: v.optional(U128Schema),
|
|
28
|
+
referralShareAmountE18: v.optional(U128Schema),
|
|
29
|
+
feeIsRebate: v.boolean(),
|
|
24
30
|
tsNs: v.bigint(),
|
|
25
31
|
matchId: v.bigint()
|
|
26
32
|
}), v.transform((t) => {
|
|
27
33
|
const feeAsset = requiredEnumLabel(FeeAssetCodec.protoToOutput, t.feeAsset, "UserTradeSchema", "fee asset");
|
|
28
|
-
const feeScale = feeAsset === "base" ? scales.baseQty(t.symbolId) : scales.quoteAmount(t.symbolId);
|
|
29
34
|
return {
|
|
30
|
-
tradeId: t.tradeId ? formatId(t.tradeId) : void 0,
|
|
31
35
|
orderId: formatId(t.orderId),
|
|
32
|
-
subaccountId: t.subaccountId ? formatId(t.subaccountId) : void 0,
|
|
33
36
|
symbolId: t.symbolId,
|
|
34
37
|
sideLabel: requiredEnumLabel(OrderSideCodec.protoToOutput, t.side, "UserTradeSchema", "side"),
|
|
35
38
|
liquidityLabel: t.isMaker ? "maker" : "taker",
|
|
36
39
|
feeAsset,
|
|
37
40
|
qty: scaledToDecimalOutput(t.qtyScaled, scales.baseQty(t.symbolId)),
|
|
38
41
|
price: scaledToDecimalOutput(t.priceTicks, scales.price()),
|
|
39
|
-
fee: scaledToDecimalOutput(t.
|
|
42
|
+
fee: scaledToDecimalOutput(fromU128(t.feeAmountE18), 18),
|
|
43
|
+
...t.referralShareAmountE18 === void 0 ? {} : { referralShare: scaledToDecimalOutput(fromU128(t.referralShareAmountE18), 18) },
|
|
44
|
+
feeIsRebate: t.feeIsRebate,
|
|
40
45
|
tsNs: t.tsNs.toString(),
|
|
41
46
|
tsIso: tsNsToISO(t.tsNs),
|
|
42
47
|
tsMs: tsNsToMs(t.tsNs),
|
|
@@ -44,6 +49,7 @@ function createUserTradeSchema(scales) {
|
|
|
44
49
|
};
|
|
45
50
|
}));
|
|
46
51
|
}
|
|
52
|
+
/** Validates filters accepted by {@link TradesService.list}. */
|
|
47
53
|
const GetUserTradesInputSchema = v.pipe(v.strictObject({
|
|
48
54
|
...AccountScopeInputEntries,
|
|
49
55
|
symbolId: v.pipe(v.optional(v.pipe(v.string(), v.trim())), v.transform((v) => {
|
|
@@ -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 { scaledToDecimalOutput, type SdkScales } from \"../../shared/decimal-surface.js\";\n\nexport function createUserTradeSchema(scales: SdkScales) {\n return v.pipe(\n v.object({\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 {\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\n/** Validates filters accepted by {@link TradesService.list}. */\nexport const GetUserTradesInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n symbolId: v.pipe(\n v.optional(v.pipe(v.string(), v.trim())),\n v.transform((v) => {\n if (!v) return undefined;\n const sid = Number(v);\n return Number.isFinite(sid) && sid > 0 ? sid : undefined;\n }),\n ),\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 v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\n/** Filters accepted by {@link TradesService.list}. */\nexport type GetUserTradesInput = v.InferInput<typeof GetUserTradesInputSchema>;\n"],"mappings":";;;;;;;;;;;;AAeA,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;;AAMA,MAAa,2BAA2B,EAAE,KACtC,EAAE,aAAa;CACX,GAAG;CACH,UAAU,EAAE,KACR,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,CAAC,CAAC,GACvC,EAAE,WAAW,MAAM;EACf,IAAI,CAAC,GAAG,OAAO,KAAA;EACf,MAAM,MAAM,OAAO,CAAC;EACpB,OAAO,OAAO,SAAS,GAAG,KAAK,MAAM,IAAI,MAAM,KAAA;CACnD,CAAC,CACL;CACA,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,CAAC,GACD,EAAE,WAAW,EAAE,SAAS,GAAG,aAAa;CACpC,GAAG;CACH,cAAc,2BAA2B,OAAO;AACpD,EAAE,CACN"}
|
|
@@ -787,7 +787,7 @@ type CreateTriggerInput = v.InferInput<ReturnType<typeof createCreateTriggerInpu
|
|
|
787
787
|
declare const ListTriggersInputSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
788
788
|
readonly parentOrderId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, bigint | undefined>]>;
|
|
789
789
|
readonly symbol: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>;
|
|
790
|
-
readonly status: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["created", "armed", "running", "completed", "cancelled", "failed", "paused"], undefined>, undefined>, undefined>, v.TransformAction<("
|
|
790
|
+
readonly status: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["created", "armed", "running", "completed", "cancelled", "failed", "paused"], undefined>, undefined>, undefined>, v.TransformAction<("cancelled" | "created" | "failed" | "completed" | "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)[]>]>;
|
|
791
791
|
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>]>;
|
|
792
792
|
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>;
|
|
793
793
|
readonly pageToken: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, "">;
|
|
@@ -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" | "cancelled" | "created" | "failed" | "completed" | "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" | "cancelled" | "created" | "failed" | "completed" | "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" | "cancelled" | "created" | "failed" | "completed" | "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" | "cancelled" | "created" | "failed" | "completed" | "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" | "cancelled" | "created" | "failed" | "completed" | "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" | "cancelled" | "created" | "failed" | "completed" | "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" | "cancelled" | "created" | "failed" | "completed" | "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" | "cancelled" | "created" | "failed" | "completed" | "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" | "cancelled" | "created" | "failed" | "completed" | "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" | "cancelled" | "created" | "failed" | "completed" | "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" | "cancelled" | "created" | "failed" | "completed" | "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" | "cancelled" | "created" | "failed" | "completed" | "armed" | "running" | "paused";
|
|
90
90
|
}>]>;
|
|
91
91
|
type ResumeTriggerResult = v.InferOutput<typeof ResumeTriggerResultSchema>;
|
|
92
92
|
type StopDetailsOutput = {
|
|
@@ -507,7 +507,7 @@ declare function createTriggerSchema(scales: SdkScales): v.SchemaWithPipe<readon
|
|
|
507
507
|
subaccountId: string;
|
|
508
508
|
symbolId: number;
|
|
509
509
|
symbol: string;
|
|
510
|
-
status: "unspecified" | "
|
|
510
|
+
status: "unspecified" | "cancelled" | "created" | "failed" | "completed" | "armed" | "running" | "paused";
|
|
511
511
|
parentOrderId: string | undefined;
|
|
512
512
|
qty: string;
|
|
513
513
|
feeAsset: "unspecified" | "quote" | "base";
|
package/package.json
CHANGED