@polyester/sdk 0.4.1 → 0.4.3

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.
Files changed (68) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/core-client.d.ts +9 -0
  3. package/dist/core-client.d.ts.map +1 -1
  4. package/dist/core-client.js +21 -0
  5. package/dist/core-client.js.map +1 -1
  6. package/dist/environment.js +4 -0
  7. package/dist/environment.js.map +1 -1
  8. package/dist/gen/fees/v1/fees_pb.d.ts +124 -0
  9. package/dist/gen/fees/v1/fees_pb.d.ts.map +1 -0
  10. package/dist/gen/fees/v1/fees_pb.js +39 -0
  11. package/dist/gen/fees/v1/fees_pb.js.map +1 -0
  12. package/dist/gen/index.d.ts +4 -1
  13. package/dist/gen/index.js +4 -1
  14. package/dist/gen/ratelimit/v1/ratelimit_pb.d.ts +223 -0
  15. package/dist/gen/ratelimit/v1/ratelimit_pb.d.ts.map +1 -0
  16. package/dist/gen/ratelimit/v1/ratelimit_pb.js +86 -0
  17. package/dist/gen/ratelimit/v1/ratelimit_pb.js.map +1 -0
  18. package/dist/gen/vip/v1/vip_pb.d.ts +277 -0
  19. package/dist/gen/vip/v1/vip_pb.d.ts.map +1 -0
  20. package/dist/gen/vip/v1/vip_pb.js +60 -0
  21. package/dist/gen/vip/v1/vip_pb.js.map +1 -0
  22. package/dist/index.d.ts +8 -1
  23. package/dist/services/candles/candles.schemas.d.ts +10 -10
  24. package/dist/services/fees/fees.d.ts +19 -0
  25. package/dist/services/fees/fees.d.ts.map +1 -0
  26. package/dist/services/fees/fees.js +32 -0
  27. package/dist/services/fees/fees.js.map +1 -0
  28. package/dist/services/fees/fees.schemas.d.ts +28 -0
  29. package/dist/services/fees/fees.schemas.d.ts.map +1 -0
  30. package/dist/services/fees/fees.schemas.js +25 -0
  31. package/dist/services/fees/fees.schemas.js.map +1 -0
  32. package/dist/services/fees/fees.types.d.ts +2 -0
  33. package/dist/services/fees/index.d.ts +3 -0
  34. package/dist/services/heatmap/heatmap.schemas.d.ts +13 -13
  35. package/dist/services/market-overview/market-overview.schemas.d.ts +3 -3
  36. package/dist/services/orderbook/orderbook.schemas.d.ts +1 -1
  37. package/dist/services/orders/orders-batch.schemas.d.ts +14 -14
  38. package/dist/services/orders/orders-output.schemas.d.ts +12 -12
  39. package/dist/services/rate-limits/index.d.ts +4 -0
  40. package/dist/services/rate-limits/rate-limits.codecs.d.ts +6 -0
  41. package/dist/services/rate-limits/rate-limits.codecs.d.ts.map +1 -0
  42. package/dist/services/rate-limits/rate-limits.codecs.js +11 -0
  43. package/dist/services/rate-limits/rate-limits.codecs.js.map +1 -0
  44. package/dist/services/rate-limits/rate-limits.d.ts +24 -0
  45. package/dist/services/rate-limits/rate-limits.d.ts.map +1 -0
  46. package/dist/services/rate-limits/rate-limits.js +40 -0
  47. package/dist/services/rate-limits/rate-limits.js.map +1 -0
  48. package/dist/services/rate-limits/rate-limits.schemas.d.ts +58 -0
  49. package/dist/services/rate-limits/rate-limits.schemas.d.ts.map +1 -0
  50. package/dist/services/rate-limits/rate-limits.schemas.js +30 -0
  51. package/dist/services/rate-limits/rate-limits.schemas.js.map +1 -0
  52. package/dist/services/rate-limits/rate-limits.types.d.ts +3 -0
  53. package/dist/services/triggers/trigger-input.schemas.d.ts +1 -1
  54. package/dist/services/triggers/triggers-output.schemas.d.ts +1 -1
  55. package/dist/services/vip/index.d.ts +3 -0
  56. package/dist/services/vip/vip.d.ts +22 -0
  57. package/dist/services/vip/vip.d.ts.map +1 -0
  58. package/dist/services/vip/vip.js +35 -0
  59. package/dist/services/vip/vip.js.map +1 -0
  60. package/dist/services/vip/vip.schemas.d.ts +90 -0
  61. package/dist/services/vip/vip.schemas.d.ts.map +1 -0
  62. package/dist/services/vip/vip.schemas.js +47 -0
  63. package/dist/services/vip/vip.schemas.js.map +1 -0
  64. package/dist/services/vip/vip.types.d.ts +2 -0
  65. package/dist/wired-services.d.ts.map +1 -1
  66. package/dist/wired-services.js +6 -0
  67. package/dist/wired-services.js.map +1 -1
  68. package/package.json +1 -1
@@ -2982,18 +2982,18 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
2982
2982
  readonly admissionStatus: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BatchReplaceAdmissionStatus, undefined>, v.TransformAction<BatchReplaceAdmissionStatus, "unspecified" | "rejected" | "admitted" | "partially_admitted">]>;
2983
2983
  readonly items: v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
2984
2984
  readonly itemIndex: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
2985
- readonly phase: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BatchReplacePhase, undefined>, v.TransformAction<BatchReplacePhase, "unspecified" | "terminal" | "working" | "rejected" | "admitted">]>;
2985
+ readonly phase: v.SchemaWithPipe<readonly [v.EnumSchema<typeof BatchReplacePhase, undefined>, v.TransformAction<BatchReplacePhase, "unspecified" | "terminal" | "rejected" | "admitted" | "working">]>;
2986
2986
  readonly oldOrderId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BigintSchema<undefined>, undefined>, v.TransformAction<bigint | undefined, string | undefined>]>;
2987
2987
  readonly replacementOrderId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BigintSchema<undefined>, undefined>, v.TransformAction<bigint | undefined, string | undefined>]>;
2988
- readonly orderStatus: v.SchemaWithPipe<readonly [v.EnumSchema<typeof OrderStatus, undefined>, v.TransformAction<OrderStatus, "unspecified" | "pending" | "canceled" | "pending_cancel" | "working" | "filled" | "rejected">]>;
2988
+ readonly orderStatus: v.SchemaWithPipe<readonly [v.EnumSchema<typeof OrderStatus, undefined>, v.TransformAction<OrderStatus, "unspecified" | "pending" | "canceled" | "rejected" | "working" | "pending_cancel" | "filled">]>;
2989
2989
  readonly code: v.StringSchema<undefined>;
2990
2990
  readonly updatedTsNs: v.BigintSchema<undefined>;
2991
2991
  }, undefined>, v.TransformAction<{
2992
2992
  itemIndex: number;
2993
- phase: "unspecified" | "terminal" | "working" | "rejected" | "admitted";
2993
+ phase: "unspecified" | "terminal" | "rejected" | "admitted" | "working";
2994
2994
  oldOrderId?: string | undefined;
2995
2995
  replacementOrderId?: string | undefined;
2996
- orderStatus: "unspecified" | "pending" | "canceled" | "pending_cancel" | "working" | "filled" | "rejected";
2996
+ orderStatus: "unspecified" | "pending" | "canceled" | "rejected" | "working" | "pending_cancel" | "filled";
2997
2997
  code: string;
2998
2998
  updatedTsNs: bigint;
2999
2999
  }, {
@@ -3001,10 +3001,10 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
3001
3001
  updatedTs: number;
3002
3002
  updatedTsNs: string;
3003
3003
  itemIndex: number;
3004
- phase: "unspecified" | "terminal" | "working" | "rejected" | "admitted";
3004
+ phase: "unspecified" | "terminal" | "rejected" | "admitted" | "working";
3005
3005
  oldOrderId?: string | undefined;
3006
3006
  replacementOrderId?: string | undefined;
3007
- orderStatus: "unspecified" | "pending" | "canceled" | "pending_cancel" | "working" | "filled" | "rejected";
3007
+ orderStatus: "unspecified" | "pending" | "canceled" | "rejected" | "working" | "pending_cancel" | "filled";
3008
3008
  }>]>, undefined>;
3009
3009
  readonly acceptedCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
3010
3010
  readonly rejectedCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
@@ -3018,10 +3018,10 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
3018
3018
  updatedTs: number;
3019
3019
  updatedTsNs: string;
3020
3020
  itemIndex: number;
3021
- phase: "unspecified" | "terminal" | "working" | "rejected" | "admitted";
3021
+ phase: "unspecified" | "terminal" | "rejected" | "admitted" | "working";
3022
3022
  oldOrderId?: string | undefined;
3023
3023
  replacementOrderId?: string | undefined;
3024
- orderStatus: "unspecified" | "pending" | "canceled" | "pending_cancel" | "working" | "filled" | "rejected";
3024
+ orderStatus: "unspecified" | "pending" | "canceled" | "rejected" | "working" | "pending_cancel" | "filled";
3025
3025
  }[];
3026
3026
  acceptedCount: number;
3027
3027
  rejectedCount: number;
@@ -3035,10 +3035,10 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
3035
3035
  updatedTs: number;
3036
3036
  updatedTsNs: string;
3037
3037
  itemIndex: number;
3038
- phase: "unspecified" | "terminal" | "working" | "rejected" | "admitted";
3038
+ phase: "unspecified" | "terminal" | "rejected" | "admitted" | "working";
3039
3039
  oldOrderId?: string | undefined;
3040
3040
  replacementOrderId?: string | undefined;
3041
- orderStatus: "unspecified" | "pending" | "canceled" | "pending_cancel" | "working" | "filled" | "rejected";
3041
+ orderStatus: "unspecified" | "pending" | "canceled" | "rejected" | "working" | "pending_cancel" | "filled";
3042
3042
  }[];
3043
3043
  acceptedCount: number;
3044
3044
  rejectedCount: number;
@@ -3052,10 +3052,10 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
3052
3052
  updatedTs: number;
3053
3053
  updatedTsNs: string;
3054
3054
  itemIndex: number;
3055
- phase: "unspecified" | "terminal" | "working" | "rejected" | "admitted";
3055
+ phase: "unspecified" | "terminal" | "rejected" | "admitted" | "working";
3056
3056
  oldOrderId?: string | undefined;
3057
3057
  replacementOrderId?: string | undefined;
3058
- orderStatus: "unspecified" | "pending" | "canceled" | "pending_cancel" | "working" | "filled" | "rejected";
3058
+ orderStatus: "unspecified" | "pending" | "canceled" | "rejected" | "working" | "pending_cancel" | "filled";
3059
3059
  }[];
3060
3060
  acceptedCount: number;
3061
3061
  rejectedCount: number;
@@ -3073,10 +3073,10 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
3073
3073
  updatedTs: number;
3074
3074
  updatedTsNs: string;
3075
3075
  itemIndex: number;
3076
- phase: "unspecified" | "terminal" | "working" | "rejected" | "admitted";
3076
+ phase: "unspecified" | "terminal" | "rejected" | "admitted" | "working";
3077
3077
  oldOrderId?: string | undefined;
3078
3078
  replacementOrderId?: string | undefined;
3079
- orderStatus: "unspecified" | "pending" | "canceled" | "pending_cancel" | "working" | "filled" | "rejected";
3079
+ orderStatus: "unspecified" | "pending" | "canceled" | "rejected" | "working" | "pending_cancel" | "filled";
3080
3080
  }[];
3081
3081
  acceptedCount: number;
3082
3082
  rejectedCount: number;
@@ -9,7 +9,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
9
9
  readonly symbolId: v.NumberSchema<undefined>;
10
10
  readonly clientOrderId: v.StringSchema<undefined>;
11
11
  readonly side: v.EnumSchema<typeof Side, undefined>;
12
- readonly status: v.SchemaWithPipe<readonly [v.EnumSchema<typeof OrderStatus, undefined>, v.TransformAction<OrderStatus, "unspecified" | "pending" | "canceled" | "pending_cancel" | "working" | "filled" | "rejected">]>;
12
+ readonly status: v.SchemaWithPipe<readonly [v.EnumSchema<typeof OrderStatus, undefined>, v.TransformAction<OrderStatus, "unspecified" | "pending" | "canceled" | "rejected" | "working" | "pending_cancel" | "filled">]>;
13
13
  readonly orderType: v.NumberSchema<undefined>;
14
14
  readonly timeInForce: v.NumberSchema<undefined>;
15
15
  readonly selfTradePreventionMode: v.NumberSchema<undefined>;
@@ -74,7 +74,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
74
74
  }, undefined>, undefined>;
75
75
  readonly origin: v.OptionalSchema<v.ObjectSchema<{
76
76
  readonly scope: v.SchemaWithPipe<readonly [v.EnumSchema<typeof OrderOriginScope, undefined>, v.TransformAction<OrderOriginScope, "unspecified" | "direct" | "attached_risk" | "standalone_trigger" | "system">]>;
77
- readonly triggerType: v.SchemaWithPipe<readonly [v.EnumSchema<typeof OrderTriggerType, undefined>, v.TransformAction<OrderTriggerType, "unspecified" | "twap" | "ladder" | "stop_loss" | "take_profit" | "trailing_stop">]>;
77
+ readonly triggerType: v.SchemaWithPipe<readonly [v.EnumSchema<typeof OrderTriggerType, undefined>, v.TransformAction<OrderTriggerType, "unspecified" | "stop_loss" | "take_profit" | "trailing_stop" | "twap" | "ladder">]>;
78
78
  readonly triggerId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BigintSchema<undefined>, undefined>, v.TransformAction<bigint | undefined, string | undefined>]>;
79
79
  readonly parentOrderId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BigintSchema<undefined>, undefined>, v.TransformAction<bigint | undefined, string | undefined>]>;
80
80
  readonly childSeq: v.NumberSchema<undefined>;
@@ -90,7 +90,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
90
90
  symbolId: number;
91
91
  clientOrderId: string;
92
92
  side: Side;
93
- status: "unspecified" | "pending" | "canceled" | "pending_cancel" | "working" | "filled" | "rejected";
93
+ status: "unspecified" | "pending" | "canceled" | "rejected" | "working" | "pending_cancel" | "filled";
94
94
  orderType: number;
95
95
  timeInForce: number;
96
96
  selfTradePreventionMode: number;
@@ -155,7 +155,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
155
155
  } | undefined;
156
156
  origin?: {
157
157
  scope: "unspecified" | "direct" | "attached_risk" | "standalone_trigger" | "system";
158
- triggerType: "unspecified" | "twap" | "ladder" | "stop_loss" | "take_profit" | "trailing_stop";
158
+ triggerType: "unspecified" | "stop_loss" | "take_profit" | "trailing_stop" | "twap" | "ladder";
159
159
  triggerId?: string | undefined;
160
160
  parentOrderId?: string | undefined;
161
161
  childSeq: number;
@@ -174,7 +174,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
174
174
  marketClientRefPrice?: string | undefined;
175
175
  origin?: {
176
176
  scope: "unspecified" | "direct" | "attached_risk" | "standalone_trigger" | "system";
177
- triggerType: "unspecified" | "twap" | "ladder" | "stop_loss" | "take_profit" | "trailing_stop";
177
+ triggerType: "unspecified" | "stop_loss" | "take_profit" | "trailing_stop" | "twap" | "ladder";
178
178
  triggerId?: string | undefined;
179
179
  parentOrderId?: string | undefined;
180
180
  childSeq: number;
@@ -182,7 +182,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
182
182
  orderId: string;
183
183
  symbolId: number;
184
184
  clientOrderId: string;
185
- status: "unspecified" | "pending" | "canceled" | "pending_cancel" | "working" | "filled" | "rejected" | "partial";
185
+ status: "unspecified" | "pending" | "canceled" | "rejected" | "working" | "pending_cancel" | "filled" | "partial";
186
186
  side: "unspecified" | "buy" | "sell";
187
187
  orderType: "unspecified" | "limit" | "market";
188
188
  timeInForce: "unspecified" | "GTC" | "IOC" | "FOK";
@@ -283,7 +283,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
283
283
  readonly symbolId: v.NumberSchema<undefined>;
284
284
  readonly clientOrderId: v.StringSchema<undefined>;
285
285
  readonly side: v.EnumSchema<typeof Side, undefined>;
286
- readonly status: v.SchemaWithPipe<readonly [v.EnumSchema<typeof OrderStatus, undefined>, v.TransformAction<OrderStatus, "unspecified" | "pending" | "canceled" | "pending_cancel" | "working" | "filled" | "rejected">]>;
286
+ readonly status: v.SchemaWithPipe<readonly [v.EnumSchema<typeof OrderStatus, undefined>, v.TransformAction<OrderStatus, "unspecified" | "pending" | "canceled" | "rejected" | "working" | "pending_cancel" | "filled">]>;
287
287
  readonly orderType: v.NumberSchema<undefined>;
288
288
  readonly timeInForce: v.NumberSchema<undefined>;
289
289
  readonly selfTradePreventionMode: v.NumberSchema<undefined>;
@@ -348,7 +348,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
348
348
  }, undefined>, undefined>;
349
349
  readonly origin: v.OptionalSchema<v.ObjectSchema<{
350
350
  readonly scope: v.SchemaWithPipe<readonly [v.EnumSchema<typeof OrderOriginScope, undefined>, v.TransformAction<OrderOriginScope, "unspecified" | "direct" | "attached_risk" | "standalone_trigger" | "system">]>;
351
- readonly triggerType: v.SchemaWithPipe<readonly [v.EnumSchema<typeof OrderTriggerType, undefined>, v.TransformAction<OrderTriggerType, "unspecified" | "twap" | "ladder" | "stop_loss" | "take_profit" | "trailing_stop">]>;
351
+ readonly triggerType: v.SchemaWithPipe<readonly [v.EnumSchema<typeof OrderTriggerType, undefined>, v.TransformAction<OrderTriggerType, "unspecified" | "stop_loss" | "take_profit" | "trailing_stop" | "twap" | "ladder">]>;
352
352
  readonly triggerId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BigintSchema<undefined>, undefined>, v.TransformAction<bigint | undefined, string | undefined>]>;
353
353
  readonly parentOrderId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BigintSchema<undefined>, undefined>, v.TransformAction<bigint | undefined, string | undefined>]>;
354
354
  readonly childSeq: v.NumberSchema<undefined>;
@@ -364,7 +364,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
364
364
  symbolId: number;
365
365
  clientOrderId: string;
366
366
  side: Side;
367
- status: "unspecified" | "pending" | "canceled" | "pending_cancel" | "working" | "filled" | "rejected";
367
+ status: "unspecified" | "pending" | "canceled" | "rejected" | "working" | "pending_cancel" | "filled";
368
368
  orderType: number;
369
369
  timeInForce: number;
370
370
  selfTradePreventionMode: number;
@@ -429,7 +429,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
429
429
  } | undefined;
430
430
  origin?: {
431
431
  scope: "unspecified" | "direct" | "attached_risk" | "standalone_trigger" | "system";
432
- triggerType: "unspecified" | "twap" | "ladder" | "stop_loss" | "take_profit" | "trailing_stop";
432
+ triggerType: "unspecified" | "stop_loss" | "take_profit" | "trailing_stop" | "twap" | "ladder";
433
433
  triggerId?: string | undefined;
434
434
  parentOrderId?: string | undefined;
435
435
  childSeq: number;
@@ -448,7 +448,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
448
448
  marketClientRefPrice?: string | undefined;
449
449
  origin?: {
450
450
  scope: "unspecified" | "direct" | "attached_risk" | "standalone_trigger" | "system";
451
- triggerType: "unspecified" | "twap" | "ladder" | "stop_loss" | "take_profit" | "trailing_stop";
451
+ triggerType: "unspecified" | "stop_loss" | "take_profit" | "trailing_stop" | "twap" | "ladder";
452
452
  triggerId?: string | undefined;
453
453
  parentOrderId?: string | undefined;
454
454
  childSeq: number;
@@ -456,7 +456,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
456
456
  orderId: string;
457
457
  symbolId: number;
458
458
  clientOrderId: string;
459
- status: "unspecified" | "pending" | "canceled" | "pending_cancel" | "working" | "filled" | "rejected" | "partial";
459
+ status: "unspecified" | "pending" | "canceled" | "rejected" | "working" | "pending_cancel" | "filled" | "partial";
460
460
  side: "unspecified" | "buy" | "sell";
461
461
  orderType: "unspecified" | "limit" | "market";
462
462
  timeInForce: "unspecified" | "GTC" | "IOC" | "FOK";
@@ -0,0 +1,4 @@
1
+ import { TradingRateLimitClass } from "./rate-limits.codecs.js";
2
+ import { RateLimitConfig, RateLimitConfigSchema, TradingRateLimitRule, TradingRateLimitRuleSchema, TradingRateLimits, TradingRateLimitsSchema } from "./rate-limits.schemas.js";
3
+ import { RateLimitService } from "./rate-limits.js";
4
+ export { RateLimitConfig, RateLimitConfigSchema, RateLimitService, type TradingRateLimitClass, TradingRateLimitRule, TradingRateLimitRuleSchema, TradingRateLimits, TradingRateLimitsSchema };
@@ -0,0 +1,6 @@
1
+ import { RateLimitPolicyClass } from "../../shared/rate-limit.schemas.js";
2
+ //#region src/services/rate-limits/rate-limits.codecs.d.ts
3
+ type TradingRateLimitClass = Extract<RateLimitPolicyClass, "unspecified" | "trading_place" | "trading_cancel">;
4
+ //#endregion
5
+ export { TradingRateLimitClass };
6
+ //# sourceMappingURL=rate-limits.codecs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate-limits.codecs.d.ts","names":[],"sources":["../../../src/services/rate-limits/rate-limits.codecs.ts"],"mappings":";;KAIY,wBAAwB,QAChC"}
@@ -0,0 +1,11 @@
1
+ import "../../gen/ratelimit/v1/ratelimit_pb.js";
2
+ //#region src/services/rate-limits/rate-limits.codecs.ts
3
+ const TradingRateLimitClassCodec = { protoToOutput: {
4
+ [0]: "unspecified",
5
+ [1]: "trading_place",
6
+ [2]: "trading_cancel"
7
+ } };
8
+ //#endregion
9
+ export { TradingRateLimitClassCodec };
10
+
11
+ //# sourceMappingURL=rate-limits.codecs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate-limits.codecs.js","names":[],"sources":["../../../src/services/rate-limits/rate-limits.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/ratelimit/v1/ratelimit_pb.js\";\nimport type { RateLimitPolicyClass } from \"../../shared/rate-limit.schemas.js\";\nimport type { ProtoToOutput } from \"../../utils/types.js\";\n\nexport type TradingRateLimitClass = Extract<\n RateLimitPolicyClass,\n \"unspecified\" | \"trading_place\" | \"trading_cancel\"\n>;\n\nexport const TradingRateLimitClassCodec = {\n protoToOutput: {\n [Proto.TradingRateLimitClass.UNSPECIFIED]: \"unspecified\",\n [Proto.TradingRateLimitClass.PLACE]: \"trading_place\",\n [Proto.TradingRateLimitClass.CANCEL]: \"trading_cancel\",\n } satisfies ProtoToOutput<Proto.TradingRateLimitClass, TradingRateLimitClass>,\n} as const;\n"],"mappings":";;AASA,MAAa,6BAA6B,EACtC,eAAe;EACgC,IAAA;EACN,IAAA;EACC,IAAA;AAC1C,EACJ"}
@@ -0,0 +1,24 @@
1
+ import { Transports } from "../../shared/transports.js";
2
+ import { PolyesterRequestOptions } from "../../shared/request-options.js";
3
+ import { AccountScopedInput } from "../../shared/account-scope.js";
4
+ import { SubaccountResolver } from "../subaccount-resolver.js";
5
+ import { RateLimitConfig, TradingRateLimits } from "./rate-limits.schemas.js";
6
+ //#region src/services/rate-limits/rate-limits.d.ts
7
+ /**
8
+ * Reads public trading quota catalogs and authenticated effective trading limits.
9
+ */
10
+ declare class RateLimitService {
11
+ #private;
12
+ constructor(transports: Transports, resolver?: SubaccountResolver);
13
+ /**
14
+ * Returns the complete active placement and cancellation quota catalog for VIP0+.
15
+ */
16
+ getConfig(options?: PolyesterRequestOptions): Promise<RateLimitConfig>;
17
+ /**
18
+ * Returns the effective placement and cancellation limits for the resolved account target, including API-key-scoped rules when the caller authenticated with an API key.
19
+ */
20
+ getTradingLimits(input?: AccountScopedInput, options?: PolyesterRequestOptions): Promise<TradingRateLimits>;
21
+ }
22
+ //#endregion
23
+ export { RateLimitService };
24
+ //# sourceMappingURL=rate-limits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate-limits.d.ts","names":[],"sources":["../../../src/services/rate-limits/rate-limits.ts"],"mappings":";;;;;;;;;cAsBa;;EAKG,YAAA,YAAY,YAAY,WAAW;;;;EASzC,UAAU,UAAU,0BAA0B,QAAQ;;;;EAQtD,iBACF,QAAO,oBACP,UAAU,0BACX,QAAQ"}
@@ -0,0 +1,40 @@
1
+ import { parse } from "../../shared/validation.js";
2
+ import { toConnectCallOptions } from "../../shared/request-options.js";
3
+ import { removeUndefined } from "../../utils/remove-undefined.js";
4
+ import { resolveAccountScopedInput } from "../subaccount-resolver.js";
5
+ import { RateLimitService as RateLimitService$1 } from "../../gen/ratelimit/v1/ratelimit_pb.js";
6
+ import { GetTradingRateLimitsInputSchema, RateLimitConfigSchema, TradingRateLimitsSchema } from "./rate-limits.schemas.js";
7
+ import { createClient } from "@connectrpc/connect";
8
+ //#region src/services/rate-limits/rate-limits.ts
9
+ /**
10
+ * Reads public trading quota catalogs and authenticated effective trading limits.
11
+ */
12
+ var RateLimitService = class {
13
+ #publicClient;
14
+ #authClient;
15
+ #resolver;
16
+ constructor(transports, resolver) {
17
+ this.#publicClient = createClient(RateLimitService$1, transports.publicApi);
18
+ this.#authClient = createClient(RateLimitService$1, transports.authApi);
19
+ this.#resolver = resolver;
20
+ }
21
+ /**
22
+ * Returns the complete active placement and cancellation quota catalog for VIP0+.
23
+ */
24
+ async getConfig(options) {
25
+ const res = await this.#publicClient.getRateLimitConfig({}, toConnectCallOptions(options));
26
+ return parse(RateLimitConfigSchema, res);
27
+ }
28
+ /**
29
+ * Returns the effective placement and cancellation limits for the resolved account target, including API-key-scoped rules when the caller authenticated with an API key.
30
+ */
31
+ async getTradingLimits(input = {}, options) {
32
+ const resolvedInput = resolveAccountScopedInput(input, this.#resolver);
33
+ const res = await this.#authClient.getTradingRateLimits(removeUndefined(parse(GetTradingRateLimitsInputSchema, resolvedInput)), toConnectCallOptions(options));
34
+ return parse(TradingRateLimitsSchema, res);
35
+ }
36
+ };
37
+ //#endregion
38
+ export { RateLimitService };
39
+
40
+ //# sourceMappingURL=rate-limits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate-limits.js","names":["#publicClient","Proto.RateLimitService","#authClient","#resolver"],"sources":["../../../src/services/rate-limits/rate-limits.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/ratelimit/v1/ratelimit_pb.js\";\nimport type { AccountScopedInput } from \"../../shared/account-scope.js\";\nimport {\n toConnectCallOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport type { Transports } from \"../../shared/transports.js\";\nimport { parse } from \"../../shared/validation.js\";\nimport { removeUndefined } from \"../../utils/remove-undefined.js\";\nimport { type SubaccountResolver, resolveAccountScopedInput } from \"../subaccount-resolver.js\";\nimport {\n GetTradingRateLimitsInputSchema,\n RateLimitConfigSchema,\n TradingRateLimitsSchema,\n type RateLimitConfig,\n type TradingRateLimits,\n} from \"./rate-limits.schemas.js\";\n\n/**\n * Reads public trading quota catalogs and authenticated effective trading limits.\n */\nexport class RateLimitService {\n #publicClient: Client<typeof Proto.RateLimitService>;\n #authClient: Client<typeof Proto.RateLimitService>;\n #resolver?: SubaccountResolver;\n\n constructor(transports: Transports, resolver?: SubaccountResolver) {\n this.#publicClient = createClient(Proto.RateLimitService, transports.publicApi);\n this.#authClient = createClient(Proto.RateLimitService, transports.authApi);\n this.#resolver = resolver;\n }\n\n /**\n * Returns the complete active placement and cancellation quota catalog for VIP0+.\n */\n async getConfig(options?: PolyesterRequestOptions): Promise<RateLimitConfig> {\n const res = await this.#publicClient.getRateLimitConfig({}, toConnectCallOptions(options));\n return parse(RateLimitConfigSchema, res);\n }\n\n /**\n * Returns the effective placement and cancellation limits for the resolved account target, including API-key-scoped rules when the caller authenticated with an API key.\n */\n async getTradingLimits(\n input: AccountScopedInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<TradingRateLimits> {\n const resolvedInput = resolveAccountScopedInput(input, this.#resolver);\n const res = await this.#authClient.getTradingRateLimits(\n removeUndefined(parse(GetTradingRateLimitsInputSchema, resolvedInput)),\n toConnectCallOptions(options),\n );\n return parse(TradingRateLimitsSchema, res);\n }\n}\n"],"mappings":";;;;;;;;;;;AAsBA,IAAa,mBAAb,MAA8B;CAC1B;CACA;CACA;CAEA,YAAY,YAAwB,UAA+B;EAC/D,KAAKA,gBAAgB,aAAaC,oBAAwB,WAAW,SAAS;EAC9E,KAAKC,cAAc,aAAaD,oBAAwB,WAAW,OAAO;EAC1E,KAAKE,YAAY;CACrB;;;;CAKA,MAAM,UAAU,SAA6D;EACzE,MAAM,MAAM,MAAM,KAAKH,cAAc,mBAAmB,CAAC,GAAG,qBAAqB,OAAO,CAAC;EACzF,OAAO,MAAM,uBAAuB,GAAG;CAC3C;;;;CAKA,MAAM,iBACF,QAA4B,CAAC,GAC7B,SAC0B;EAC1B,MAAM,gBAAgB,0BAA0B,OAAO,KAAKG,SAAS;EACrE,MAAM,MAAM,MAAM,KAAKD,YAAY,qBAC/B,gBAAgB,MAAM,iCAAiC,aAAa,CAAC,GACrE,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,yBAAyB,GAAG;CAC7C;AACJ"}
@@ -0,0 +1,58 @@
1
+ import { TradingRateLimitClass } from "../../gen/ratelimit/v1/ratelimit_pb.js";
2
+ import { TradingRateLimitClass as TradingRateLimitClass$1 } from "./rate-limits.codecs.js";
3
+ import * as v from "valibot";
4
+ //#region src/services/rate-limits/rate-limits.schemas.d.ts
5
+ declare const TradingRateLimitRuleSchema: v.ObjectSchema<{
6
+ readonly policyClass: v.SchemaWithPipe<readonly [v.EnumSchema<typeof TradingRateLimitClass, undefined>, v.TransformAction<TradingRateLimitClass, TradingRateLimitClass$1>]>;
7
+ readonly tier: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
8
+ readonly quotaWeight: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
9
+ readonly periodMs: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
10
+ readonly burstWeight: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
11
+ }, undefined>;
12
+ type TradingRateLimitRule = v.InferOutput<typeof TradingRateLimitRuleSchema>;
13
+ declare const RateLimitConfigSchema: v.ObjectSchema<{
14
+ readonly policyVersion: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
15
+ readonly effectiveFrom: v.SchemaWithPipe<readonly [v.ObjectSchema<{
16
+ readonly seconds: v.BigintSchema<undefined>;
17
+ readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
18
+ }, undefined>, v.TransformAction<{
19
+ seconds: bigint;
20
+ nanos: number;
21
+ }, number>]>;
22
+ readonly rules: v.ArraySchema<v.ObjectSchema<{
23
+ readonly policyClass: v.SchemaWithPipe<readonly [v.EnumSchema<typeof TradingRateLimitClass, undefined>, v.TransformAction<TradingRateLimitClass, TradingRateLimitClass$1>]>;
24
+ readonly tier: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
25
+ readonly quotaWeight: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
26
+ readonly periodMs: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
27
+ readonly burstWeight: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
28
+ }, undefined>, undefined>;
29
+ }, undefined>;
30
+ type RateLimitConfig = v.InferOutput<typeof RateLimitConfigSchema>;
31
+ declare const TradingRateLimitsSchema: v.ObjectSchema<{
32
+ readonly apiKeyRules: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
33
+ readonly policyClass: v.SchemaWithPipe<readonly [v.EnumSchema<typeof TradingRateLimitClass, undefined>, v.TransformAction<TradingRateLimitClass, TradingRateLimitClass$1>]>;
34
+ readonly tier: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
35
+ readonly quotaWeight: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
36
+ readonly periodMs: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
37
+ readonly burstWeight: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
38
+ }, undefined>, undefined>, readonly []>;
39
+ readonly policyVersion: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
40
+ readonly effectiveFrom: v.SchemaWithPipe<readonly [v.ObjectSchema<{
41
+ readonly seconds: v.BigintSchema<undefined>;
42
+ readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
43
+ }, undefined>, v.TransformAction<{
44
+ seconds: bigint;
45
+ nanos: number;
46
+ }, number>]>;
47
+ readonly rules: v.ArraySchema<v.ObjectSchema<{
48
+ readonly policyClass: v.SchemaWithPipe<readonly [v.EnumSchema<typeof TradingRateLimitClass, undefined>, v.TransformAction<TradingRateLimitClass, TradingRateLimitClass$1>]>;
49
+ readonly tier: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
50
+ readonly quotaWeight: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
51
+ readonly periodMs: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
52
+ readonly burstWeight: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
53
+ }, undefined>, undefined>;
54
+ }, undefined>;
55
+ type TradingRateLimits = v.InferOutput<typeof TradingRateLimitsSchema>;
56
+ //#endregion
57
+ export { RateLimitConfig, RateLimitConfigSchema, type TradingRateLimitClass$1 as TradingRateLimitClass, TradingRateLimitRule, TradingRateLimitRuleSchema, TradingRateLimits, TradingRateLimitsSchema };
58
+ //# sourceMappingURL=rate-limits.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate-limits.schemas.d.ts","names":[],"sources":["../../../src/services/rate-limits/rate-limits.schemas.ts"],"mappings":";;;;cA0Ba,4BAA0B,EAAA;;;;;;;KAQ3B,uBAAuB,EAAE,mBAAmB;cAE3C,uBAAqB,EAAA;;;;;;;;;;;;;;;;;KAMtB,kBAAkB,EAAE,mBAAmB;cAWtC,yBAAuB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;KAKxB,oBAAoB,EAAE,mBAAmB"}
@@ -0,0 +1,30 @@
1
+ import { requiredEnumLabel } from "../../shared/proto-enum-codec.js";
2
+ import { BigIntStringSchema, TimestampMsSchema } from "../../shared/schemas.js";
3
+ import { AccountScopeInputEntries, accountScopeToSubaccountId } from "../../shared/account-scope.js";
4
+ import { VipTierNumberSchema } from "../vip/vip.schemas.js";
5
+ import { TradingRateLimitClass } from "../../gen/ratelimit/v1/ratelimit_pb.js";
6
+ import { TradingRateLimitClassCodec } from "./rate-limits.codecs.js";
7
+ import * as v from "valibot";
8
+ //#region src/services/rate-limits/rate-limits.schemas.ts
9
+ const TradingRateLimitClassOutputSchema = v.pipe(v.enum(TradingRateLimitClass), v.transform((value) => requiredEnumLabel(TradingRateLimitClassCodec.protoToOutput, value, "TradingRateLimitRuleSchema", "policyClass")));
10
+ const TradingRateLimitRuleSchema = v.object({
11
+ policyClass: TradingRateLimitClassOutputSchema,
12
+ tier: VipTierNumberSchema,
13
+ quotaWeight: BigIntStringSchema,
14
+ periodMs: BigIntStringSchema,
15
+ burstWeight: BigIntStringSchema
16
+ });
17
+ const RateLimitConfigSchema = v.object({
18
+ policyVersion: BigIntStringSchema,
19
+ effectiveFrom: TimestampMsSchema,
20
+ rules: v.array(TradingRateLimitRuleSchema)
21
+ });
22
+ const GetTradingRateLimitsInputSchema = v.pipe(v.strictObject({ ...AccountScopeInputEntries }), v.transform(({ account }) => ({ subaccountId: accountScopeToSubaccountId(account) })));
23
+ const TradingRateLimitsSchema = v.object({
24
+ ...RateLimitConfigSchema.entries,
25
+ apiKeyRules: v.optional(v.array(TradingRateLimitRuleSchema), [])
26
+ });
27
+ //#endregion
28
+ export { GetTradingRateLimitsInputSchema, RateLimitConfigSchema, TradingRateLimitRuleSchema, TradingRateLimitsSchema };
29
+
30
+ //# sourceMappingURL=rate-limits.schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate-limits.schemas.js","names":["Proto.TradingRateLimitClass"],"sources":["../../../src/services/rate-limits/rate-limits.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport * as Proto from \"../../gen/ratelimit/v1/ratelimit_pb.js\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport { requiredEnumLabel } from \"../../shared/proto-enum-codec.js\";\nimport { BigIntStringSchema, TimestampMsSchema } from \"../../shared/schemas.js\";\nimport { VipTierNumberSchema } from \"../vip/vip.schemas.js\";\nimport { TradingRateLimitClassCodec, type TradingRateLimitClass } from \"./rate-limits.codecs.js\";\n\nexport type { TradingRateLimitClass } from \"./rate-limits.codecs.js\";\n\nconst TradingRateLimitClassOutputSchema = v.pipe(\n v.enum(Proto.TradingRateLimitClass),\n v.transform(\n (value): TradingRateLimitClass =>\n requiredEnumLabel(\n TradingRateLimitClassCodec.protoToOutput,\n value,\n \"TradingRateLimitRuleSchema\",\n \"policyClass\",\n ),\n ),\n);\n\nexport const TradingRateLimitRuleSchema = v.object({\n policyClass: TradingRateLimitClassOutputSchema,\n tier: VipTierNumberSchema,\n quotaWeight: BigIntStringSchema,\n periodMs: BigIntStringSchema,\n burstWeight: BigIntStringSchema,\n});\n\nexport type TradingRateLimitRule = v.InferOutput<typeof TradingRateLimitRuleSchema>;\n\nexport const RateLimitConfigSchema = v.object({\n policyVersion: BigIntStringSchema,\n effectiveFrom: TimestampMsSchema,\n rules: v.array(TradingRateLimitRuleSchema),\n});\n\nexport type RateLimitConfig = v.InferOutput<typeof RateLimitConfigSchema>;\n\nexport const GetTradingRateLimitsInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n }),\n v.transform(({ account }) => ({\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport const TradingRateLimitsSchema = v.object({\n ...RateLimitConfigSchema.entries,\n apiKeyRules: v.optional(v.array(TradingRateLimitRuleSchema), []),\n});\n\nexport type TradingRateLimits = v.InferOutput<typeof TradingRateLimitsSchema>;\n"],"mappings":";;;;;;;;AAaA,MAAM,oCAAoC,EAAE,KACxC,EAAE,KAAKA,qBAA2B,GAClC,EAAE,WACG,UACG,kBACI,2BAA2B,eAC3B,OACA,8BACA,aACJ,CACR,CACJ;AAEA,MAAa,6BAA6B,EAAE,OAAO;CAC/C,aAAa;CACb,MAAM;CACN,aAAa;CACb,UAAU;CACV,aAAa;AACjB,CAAC;AAID,MAAa,wBAAwB,EAAE,OAAO;CAC1C,eAAe;CACf,eAAe;CACf,OAAO,EAAE,MAAM,0BAA0B;AAC7C,CAAC;AAID,MAAa,kCAAkC,EAAE,KAC7C,EAAE,aAAa,EACX,GAAG,yBACP,CAAC,GACD,EAAE,WAAW,EAAE,eAAe,EAC1B,cAAc,2BAA2B,OAAO,EACpD,EAAE,CACN;AAEA,MAAa,0BAA0B,EAAE,OAAO;CAC5C,GAAG,sBAAsB;CACzB,aAAa,EAAE,SAAS,EAAE,MAAM,0BAA0B,GAAG,CAAC,CAAC;AACnE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { TradingRateLimitClass } from "./rate-limits.codecs.js";
2
+ import { RateLimitConfig, TradingRateLimitRule, TradingRateLimits } from "./rate-limits.schemas.js";
3
+ export type { RateLimitConfig, TradingRateLimitClass, TradingRateLimitRule, TradingRateLimits };
@@ -788,7 +788,7 @@ declare const ListTriggersInputSchema: v.SchemaWithPipe<readonly [v.StrictObject
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
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
- 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>]>;
791
+ readonly triggerType: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["stop_loss", "take_profit", "trailing_stop", "twap", "ladder"], undefined>, undefined>, v.TransformAction<"stop_loss" | "take_profit" | "trailing_stop" | "twap" | "ladder" | 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]>, "">;
794
794
  readonly account: v.OptionalSchema<v.UnionSchema<[v.PicklistSchema<["active", "main"], undefined>, v.StrictObjectSchema<{
@@ -670,7 +670,7 @@ declare function createTriggerEventSchema(scales: SdkScales): v.SchemaWithPipe<r
670
670
  triggerId: string;
671
671
  subaccountId: string;
672
672
  symbolId: number;
673
- triggerType: "unspecified" | "twap" | "ladder" | "stop_loss" | "take_profit" | "trailing_stop";
673
+ triggerType: "unspecified" | "stop_loss" | "take_profit" | "trailing_stop" | "twap" | "ladder";
674
674
  eventType: "unspecified" | "updated" | "fired" | "canceled";
675
675
  ts: number;
676
676
  childSeq: number;
@@ -0,0 +1,3 @@
1
+ import { NextVipTierThresholds, NextVipTierThresholdsSchema, VipStatus, VipStatusSchema, VipTier, VipTierCatalog, VipTierCatalogSchema, VipTierSchema } from "./vip.schemas.js";
2
+ import { VipService } from "./vip.js";
3
+ export { NextVipTierThresholds, NextVipTierThresholdsSchema, VipService, VipStatus, VipStatusSchema, VipTier, VipTierCatalog, VipTierCatalogSchema, VipTierSchema };
@@ -0,0 +1,22 @@
1
+ import { Transports } from "../../shared/transports.js";
2
+ import { PolyesterRequestOptions } from "../../shared/request-options.js";
3
+ import { VipStatus, VipTierCatalog } from "./vip.schemas.js";
4
+ //#region src/services/vip/vip.d.ts
5
+ /**
6
+ * Reads public VIP policy catalogs and authenticated caller-root VIP status.
7
+ */
8
+ declare class VipService {
9
+ #private;
10
+ constructor(transports: Transports);
11
+ /**
12
+ * Returns the complete active VIP0+ tier catalog, including policy version, effective time, retention threshold, and per-tier volume/AOP thresholds and fee rates.
13
+ */
14
+ listTiers(options?: PolyesterRequestOptions): Promise<VipTierCatalog>;
15
+ /**
16
+ * Returns VIP qualification status for the authenticated caller's root account, including effective/volume/AOP tiers, optional rolling metrics, and next-tier thresholds.
17
+ */
18
+ getStatus(options?: PolyesterRequestOptions): Promise<VipStatus>;
19
+ }
20
+ //#endregion
21
+ export { VipService };
22
+ //# sourceMappingURL=vip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vip.d.ts","names":[],"sources":["../../../src/services/vip/vip.ts"],"mappings":";;;;;;;cAkBa;;EAIG,YAAA,YAAY;;;;EAQlB,UAAU,UAAU,0BAA0B,QAAQ;;;;EAQtD,UAAU,UAAU,0BAA0B,QAAQ"}
@@ -0,0 +1,35 @@
1
+ import { parse } from "../../shared/validation.js";
2
+ import { toConnectCallOptions } from "../../shared/request-options.js";
3
+ import { VIPService } from "../../gen/vip/v1/vip_pb.js";
4
+ import { VipStatusSchema, VipTierCatalogSchema } from "./vip.schemas.js";
5
+ import { createClient } from "@connectrpc/connect";
6
+ //#region src/services/vip/vip.ts
7
+ /**
8
+ * Reads public VIP policy catalogs and authenticated caller-root VIP status.
9
+ */
10
+ var VipService = class {
11
+ #publicClient;
12
+ #authClient;
13
+ constructor(transports) {
14
+ this.#publicClient = createClient(VIPService, transports.publicApi);
15
+ this.#authClient = createClient(VIPService, transports.authApi);
16
+ }
17
+ /**
18
+ * Returns the complete active VIP0+ tier catalog, including policy version, effective time, retention threshold, and per-tier volume/AOP thresholds and fee rates.
19
+ */
20
+ async listTiers(options) {
21
+ const res = await this.#publicClient.listVIPTiers({}, toConnectCallOptions(options));
22
+ return parse(VipTierCatalogSchema, res);
23
+ }
24
+ /**
25
+ * Returns VIP qualification status for the authenticated caller's root account, including effective/volume/AOP tiers, optional rolling metrics, and next-tier thresholds.
26
+ */
27
+ async getStatus(options) {
28
+ const res = await this.#authClient.getVIPStatus({}, toConnectCallOptions(options));
29
+ return parse(VipStatusSchema, res);
30
+ }
31
+ };
32
+ //#endregion
33
+ export { VipService };
34
+
35
+ //# sourceMappingURL=vip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vip.js","names":["#publicClient","Proto.VIPService","#authClient"],"sources":["../../../src/services/vip/vip.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/vip/v1/vip_pb.js\";\nimport {\n toConnectCallOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport type { Transports } from \"../../shared/transports.js\";\nimport { parse } from \"../../shared/validation.js\";\nimport {\n VipStatusSchema,\n VipTierCatalogSchema,\n type VipStatus,\n type VipTierCatalog,\n} from \"./vip.schemas.js\";\n\n/**\n * Reads public VIP policy catalogs and authenticated caller-root VIP status.\n */\nexport class VipService {\n #publicClient: Client<typeof Proto.VIPService>;\n #authClient: Client<typeof Proto.VIPService>;\n\n constructor(transports: Transports) {\n this.#publicClient = createClient(Proto.VIPService, transports.publicApi);\n this.#authClient = createClient(Proto.VIPService, transports.authApi);\n }\n\n /**\n * Returns the complete active VIP0+ tier catalog, including policy version, effective time, retention threshold, and per-tier volume/AOP thresholds and fee rates.\n */\n async listTiers(options?: PolyesterRequestOptions): Promise<VipTierCatalog> {\n const res = await this.#publicClient.listVIPTiers({}, toConnectCallOptions(options));\n return parse(VipTierCatalogSchema, res);\n }\n\n /**\n * Returns VIP qualification status for the authenticated caller's root account, including effective/volume/AOP tiers, optional rolling metrics, and next-tier thresholds.\n */\n async getStatus(options?: PolyesterRequestOptions): Promise<VipStatus> {\n const res = await this.#authClient.getVIPStatus({}, toConnectCallOptions(options));\n return parse(VipStatusSchema, res);\n }\n}\n"],"mappings":";;;;;;;;;AAkBA,IAAa,aAAb,MAAwB;CACpB;CACA;CAEA,YAAY,YAAwB;EAChC,KAAKA,gBAAgB,aAAaC,YAAkB,WAAW,SAAS;EACxE,KAAKC,cAAc,aAAaD,YAAkB,WAAW,OAAO;CACxE;;;;CAKA,MAAM,UAAU,SAA4D;EACxE,MAAM,MAAM,MAAM,KAAKD,cAAc,aAAa,CAAC,GAAG,qBAAqB,OAAO,CAAC;EACnF,OAAO,MAAM,sBAAsB,GAAG;CAC1C;;;;CAKA,MAAM,UAAU,SAAuD;EACnE,MAAM,MAAM,MAAM,KAAKE,YAAY,aAAa,CAAC,GAAG,qBAAqB,OAAO,CAAC;EACjF,OAAO,MAAM,iBAAiB,GAAG;CACrC;AACJ"}