@polyester/sdk 0.34.1-devnet-20261106025831 → 0.34.1-devnet-20261106033258

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 (39) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/dist/services/address-book/address-book.schemas.d.ts +2 -2
  3. package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts +19 -19
  4. package/dist/services/candles/candles.schemas.d.ts +10 -10
  5. package/dist/services/checkpoints/checkpoints.schemas.d.ts +6 -0
  6. package/dist/services/checkpoints/checkpoints.schemas.d.ts.map +1 -1
  7. package/dist/services/checkpoints/checkpoints.schemas.js +6 -0
  8. package/dist/services/checkpoints/checkpoints.schemas.js.map +1 -1
  9. package/dist/services/heatmap/heatmap.schemas.d.ts +13 -13
  10. package/dist/services/lifecycle/lifecycle.schemas.d.ts +81 -81
  11. package/dist/services/market-overview/market-overview.schemas.d.ts +3 -3
  12. package/dist/services/orderbook/orderbook.schemas.d.ts +1 -1
  13. package/dist/services/orders/orders-batch.schemas.d.ts +12 -12
  14. package/dist/services/orders/orders-output.schemas.d.ts +12 -12
  15. package/dist/services/orders/orders.d.ts +1 -1
  16. package/dist/services/orders/orders.js +1 -1
  17. package/dist/services/orders/orders.js.map +1 -1
  18. package/dist/services/rewards/rewards.d.ts +1 -1
  19. package/dist/services/rewards/rewards.js +1 -1
  20. package/dist/services/rewards/rewards.js.map +1 -1
  21. package/dist/services/rewards/rewards.schemas.d.ts +10 -3
  22. package/dist/services/rewards/rewards.schemas.d.ts.map +1 -1
  23. package/dist/services/rewards/rewards.schemas.js +8 -1
  24. package/dist/services/rewards/rewards.schemas.js.map +1 -1
  25. package/dist/services/subaccounts/subaccounts.d.ts +1 -1
  26. package/dist/services/subaccounts/subaccounts.js +1 -1
  27. package/dist/services/subaccounts/subaccounts.js.map +1 -1
  28. package/dist/services/subaccounts/subaccounts.schemas.d.ts +24 -15
  29. package/dist/services/subaccounts/subaccounts.schemas.d.ts.map +1 -1
  30. package/dist/services/subaccounts/subaccounts.schemas.js +8 -1
  31. package/dist/services/subaccounts/subaccounts.schemas.js.map +1 -1
  32. package/dist/services/trades/trades.schemas.d.ts +1 -1
  33. package/dist/services/triggers/trigger-input.schemas.d.ts +2 -2
  34. package/dist/services/triggers/triggers-output.schemas.d.ts +18 -18
  35. package/dist/shared/errors.d.ts +1 -1
  36. package/dist/shared/errors.d.ts.map +1 -1
  37. package/dist/shared/errors.js.map +1 -1
  38. package/dist/shared/transports.js.map +1 -1
  39. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,11 +1,21 @@
1
1
  # @polyester/sdk
2
2
 
3
- ## 0.34.1-devnet-20261106025831
3
+ ## 0.34.1-devnet-20261106033258
4
4
 
5
5
  ### Patch Changes
6
6
 
7
+ - The `orders.batchCreate` JSDoc now gives the batch's 15-minute idempotency window. It previously said 60 seconds, which is the `batchReplace` window. Within 15 minutes, a retry with the same `requestId` and payload returns each decided item's original result and retries the unresolved ones. After that the ID is free, and a repeat can place its orders again. ([#235](https://github.com/Fabric-Labs/polyester-sdk-typescript/pull/235))
8
+
9
+ - `Checkpoint` now carries `openingValueUsd`, the season-end USD value of the holdings restored when the season opened (`"0"` when it opened with no balances, `undefined` when a restored balance had no USD value). With it, `seasonResultUsd` reconciles as `finalValueUsd - openingValueUsd - netInflowUsd`. ([#235](https://github.com/Fabric-Labs/polyester-sdk-typescript/pull/235))
10
+
7
11
  - `expandColumnarTimestampsSec` and `columnarTimestampSecAt` now end at `endTsSec`, so the last columnar history point is no longer one bucket early. ([#233](https://github.com/Fabric-Labs/polyester-sdk-typescript/pull/233))
8
12
 
13
+ - `rewards.listAwards` now returns `awardsMayChange`. It is `true` while a campaign can still publish awards or one of the account's awards is awaiting a destination, ready for payout, or failed and retryable. When it is `false`, polling cannot return new awards or award changes until a new campaign is created. ([#235](https://github.com/Fabric-Labs/polyester-sdk-typescript/pull/235))
14
+
15
+ - `PolyesterErrorCode` now includes `"SUBACCOUNT_CHALLENGE_INVALID"`, the code `SubaccountChallengeInvalidError` already carries, so an exhaustive `switch` over the union covers it. ([#235](https://github.com/Fabric-Labs/polyester-sdk-typescript/pull/235))
16
+
17
+ - `Subaccount` records now carry `removed`. `subaccounts.subscribe` emits `removed: true` (with `role: "unspecified"`) when the caller loses access to a subaccount, for example after the owner removes them as a member, so drop it from local state. List and get responses always return `false`. Access and role changes do not bump `revision` or `updatedAt`, so apply them in arrival order. ([#235](https://github.com/Fabric-Labs/polyester-sdk-typescript/pull/235))
18
+
9
19
  ## 0.34.0
10
20
 
11
21
  ### Minor Changes
@@ -297,7 +297,7 @@ declare const AddressBookSchema: v.ObjectSchema<{
297
297
  rootAccountId: string;
298
298
  subaccountId: bigint;
299
299
  }, AddressBookAccountScope>]>, undefined>;
300
- readonly callerRole: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer">]>;
300
+ readonly callerRole: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer" | "unspecified">]>;
301
301
  readonly label: v.StringSchema<undefined>;
302
302
  readonly ownerUsername: v.StringSchema<undefined>;
303
303
  readonly smartAccountAddress: v.StringSchema<undefined>;
@@ -1102,7 +1102,7 @@ declare const AddressBookViewSchema: v.ObjectSchema<{
1102
1102
  rootAccountId: string;
1103
1103
  subaccountId: bigint;
1104
1104
  }, AddressBookAccountScope>]>, undefined>;
1105
- readonly callerRole: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer">]>;
1105
+ readonly callerRole: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer" | "unspecified">]>;
1106
1106
  readonly label: v.StringSchema<undefined>;
1107
1107
  readonly ownerUsername: v.StringSchema<undefined>;
1108
1108
  readonly smartAccountAddress: v.StringSchema<undefined>;
@@ -460,7 +460,7 @@ declare const AutoWithdrawStepSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<
460
460
  readonly hi: v.BigintSchema<undefined>;
461
461
  readonly lo: v.BigintSchema<undefined>;
462
462
  }, undefined>, undefined>;
463
- readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "failed" | "completed" | "skipped" | "pending" | "submitting" | "submitted">]>;
463
+ readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "completed" | "failed" | "skipped" | "pending" | "submitting" | "submitted">]>;
464
464
  readonly reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, "">, v.TransformAction<string, AutoWithdrawStepReason | null>]>;
465
465
  readonly intentId: v.OptionalSchema<v.StringSchema<undefined>, "">;
466
466
  readonly txHash: v.OptionalSchema<v.StringSchema<undefined>, "">;
@@ -480,7 +480,7 @@ declare const AutoWithdrawStepSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<
480
480
  hi: bigint;
481
481
  lo: bigint;
482
482
  } | undefined;
483
- state: "unspecified" | "failed" | "completed" | "skipped" | "pending" | "submitting" | "submitted";
483
+ state: "unspecified" | "completed" | "failed" | "skipped" | "pending" | "submitting" | "submitted";
484
484
  reason: AutoWithdrawStepReason | null;
485
485
  intentId: string;
486
486
  txHash: string;
@@ -493,7 +493,7 @@ declare const AutoWithdrawStepSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<
493
493
  txHash: string | null;
494
494
  assetId: number;
495
495
  destinationAddress: string;
496
- state: "unspecified" | "failed" | "completed" | "skipped" | "pending" | "submitting" | "submitted";
496
+ state: "unspecified" | "completed" | "failed" | "skipped" | "pending" | "submitting" | "submitted";
497
497
  reason: AutoWithdrawStepReason | null;
498
498
  }>]>;
499
499
  /**
@@ -511,7 +511,7 @@ declare const AutoWithdrawRunSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
511
511
  seconds: bigint;
512
512
  nanos: number;
513
513
  }, number>]>;
514
- readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "failed" | "planned" | "paying" | "completed" | "partially_failed" | "skipped">]>;
514
+ readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "planned" | "paying" | "completed" | "partially_failed" | "failed" | "skipped">]>;
515
515
  readonly reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, "">, v.TransformAction<string, AutoWithdrawRunReason | null>]>;
516
516
  readonly steps: v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
517
517
  readonly assetId: v.NumberSchema<undefined>;
@@ -529,7 +529,7 @@ declare const AutoWithdrawRunSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
529
529
  readonly hi: v.BigintSchema<undefined>;
530
530
  readonly lo: v.BigintSchema<undefined>;
531
531
  }, undefined>, undefined>;
532
- readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "failed" | "completed" | "skipped" | "pending" | "submitting" | "submitted">]>;
532
+ readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "completed" | "failed" | "skipped" | "pending" | "submitting" | "submitted">]>;
533
533
  readonly reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, "">, v.TransformAction<string, AutoWithdrawStepReason | null>]>;
534
534
  readonly intentId: v.OptionalSchema<v.StringSchema<undefined>, "">;
535
535
  readonly txHash: v.OptionalSchema<v.StringSchema<undefined>, "">;
@@ -549,7 +549,7 @@ declare const AutoWithdrawRunSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
549
549
  hi: bigint;
550
550
  lo: bigint;
551
551
  } | undefined;
552
- state: "unspecified" | "failed" | "completed" | "skipped" | "pending" | "submitting" | "submitted";
552
+ state: "unspecified" | "completed" | "failed" | "skipped" | "pending" | "submitting" | "submitted";
553
553
  reason: AutoWithdrawStepReason | null;
554
554
  intentId: string;
555
555
  txHash: string;
@@ -562,7 +562,7 @@ declare const AutoWithdrawRunSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
562
562
  txHash: string | null;
563
563
  assetId: number;
564
564
  destinationAddress: string;
565
- state: "unspecified" | "failed" | "completed" | "skipped" | "pending" | "submitting" | "submitted";
565
+ state: "unspecified" | "completed" | "failed" | "skipped" | "pending" | "submitting" | "submitted";
566
566
  reason: AutoWithdrawStepReason | null;
567
567
  }>]>, undefined>;
568
568
  readonly createdAt: v.SchemaWithPipe<readonly [v.ObjectSchema<{
@@ -583,7 +583,7 @@ declare const AutoWithdrawRunSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
583
583
  runSeq: string;
584
584
  ruleVersion: number;
585
585
  scheduledFor: number;
586
- state: "unspecified" | "failed" | "planned" | "paying" | "completed" | "partially_failed" | "skipped";
586
+ state: "unspecified" | "planned" | "paying" | "completed" | "partially_failed" | "failed" | "skipped";
587
587
  reason: AutoWithdrawRunReason | null;
588
588
  steps: {
589
589
  destinationChainId: number;
@@ -594,7 +594,7 @@ declare const AutoWithdrawRunSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
594
594
  txHash: string | null;
595
595
  assetId: number;
596
596
  destinationAddress: string;
597
- state: "unspecified" | "failed" | "completed" | "skipped" | "pending" | "submitting" | "submitted";
597
+ state: "unspecified" | "completed" | "failed" | "skipped" | "pending" | "submitting" | "submitted";
598
598
  reason: AutoWithdrawStepReason | null;
599
599
  }[];
600
600
  createdAt: number;
@@ -604,7 +604,7 @@ declare const AutoWithdrawRunSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
604
604
  runSeq: string;
605
605
  ruleVersion: number;
606
606
  scheduledFor: number;
607
- state: "unspecified" | "failed" | "planned" | "paying" | "completed" | "partially_failed" | "skipped";
607
+ state: "unspecified" | "planned" | "paying" | "completed" | "partially_failed" | "failed" | "skipped";
608
608
  reason: AutoWithdrawRunReason | null;
609
609
  steps: {
610
610
  destinationChainId: number;
@@ -615,7 +615,7 @@ declare const AutoWithdrawRunSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
615
615
  txHash: string | null;
616
616
  assetId: number;
617
617
  destinationAddress: string;
618
- state: "unspecified" | "failed" | "completed" | "skipped" | "pending" | "submitting" | "submitted";
618
+ state: "unspecified" | "completed" | "failed" | "skipped" | "pending" | "submitting" | "submitted";
619
619
  reason: AutoWithdrawStepReason | null;
620
620
  }[];
621
621
  createdAt: number;
@@ -633,7 +633,7 @@ declare const ListAutoWithdrawRunsResultSchema: v.ObjectSchema<{
633
633
  seconds: bigint;
634
634
  nanos: number;
635
635
  }, number>]>;
636
- readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "failed" | "planned" | "paying" | "completed" | "partially_failed" | "skipped">]>;
636
+ readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "planned" | "paying" | "completed" | "partially_failed" | "failed" | "skipped">]>;
637
637
  readonly reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, "">, v.TransformAction<string, AutoWithdrawRunReason | null>]>;
638
638
  readonly steps: v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
639
639
  readonly assetId: v.NumberSchema<undefined>;
@@ -651,7 +651,7 @@ declare const ListAutoWithdrawRunsResultSchema: v.ObjectSchema<{
651
651
  readonly hi: v.BigintSchema<undefined>;
652
652
  readonly lo: v.BigintSchema<undefined>;
653
653
  }, undefined>, undefined>;
654
- readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "failed" | "completed" | "skipped" | "pending" | "submitting" | "submitted">]>;
654
+ readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "completed" | "failed" | "skipped" | "pending" | "submitting" | "submitted">]>;
655
655
  readonly reason: v.SchemaWithPipe<readonly [v.OptionalSchema<v.StringSchema<undefined>, "">, v.TransformAction<string, AutoWithdrawStepReason | null>]>;
656
656
  readonly intentId: v.OptionalSchema<v.StringSchema<undefined>, "">;
657
657
  readonly txHash: v.OptionalSchema<v.StringSchema<undefined>, "">;
@@ -671,7 +671,7 @@ declare const ListAutoWithdrawRunsResultSchema: v.ObjectSchema<{
671
671
  hi: bigint;
672
672
  lo: bigint;
673
673
  } | undefined;
674
- state: "unspecified" | "failed" | "completed" | "skipped" | "pending" | "submitting" | "submitted";
674
+ state: "unspecified" | "completed" | "failed" | "skipped" | "pending" | "submitting" | "submitted";
675
675
  reason: AutoWithdrawStepReason | null;
676
676
  intentId: string;
677
677
  txHash: string;
@@ -684,7 +684,7 @@ declare const ListAutoWithdrawRunsResultSchema: v.ObjectSchema<{
684
684
  txHash: string | null;
685
685
  assetId: number;
686
686
  destinationAddress: string;
687
- state: "unspecified" | "failed" | "completed" | "skipped" | "pending" | "submitting" | "submitted";
687
+ state: "unspecified" | "completed" | "failed" | "skipped" | "pending" | "submitting" | "submitted";
688
688
  reason: AutoWithdrawStepReason | null;
689
689
  }>]>, undefined>;
690
690
  readonly createdAt: v.SchemaWithPipe<readonly [v.ObjectSchema<{
@@ -705,7 +705,7 @@ declare const ListAutoWithdrawRunsResultSchema: v.ObjectSchema<{
705
705
  runSeq: string;
706
706
  ruleVersion: number;
707
707
  scheduledFor: number;
708
- state: "unspecified" | "failed" | "planned" | "paying" | "completed" | "partially_failed" | "skipped";
708
+ state: "unspecified" | "planned" | "paying" | "completed" | "partially_failed" | "failed" | "skipped";
709
709
  reason: AutoWithdrawRunReason | null;
710
710
  steps: {
711
711
  destinationChainId: number;
@@ -716,7 +716,7 @@ declare const ListAutoWithdrawRunsResultSchema: v.ObjectSchema<{
716
716
  txHash: string | null;
717
717
  assetId: number;
718
718
  destinationAddress: string;
719
- state: "unspecified" | "failed" | "completed" | "skipped" | "pending" | "submitting" | "submitted";
719
+ state: "unspecified" | "completed" | "failed" | "skipped" | "pending" | "submitting" | "submitted";
720
720
  reason: AutoWithdrawStepReason | null;
721
721
  }[];
722
722
  createdAt: number;
@@ -726,7 +726,7 @@ declare const ListAutoWithdrawRunsResultSchema: v.ObjectSchema<{
726
726
  runSeq: string;
727
727
  ruleVersion: number;
728
728
  scheduledFor: number;
729
- state: "unspecified" | "failed" | "planned" | "paying" | "completed" | "partially_failed" | "skipped";
729
+ state: "unspecified" | "planned" | "paying" | "completed" | "partially_failed" | "failed" | "skipped";
730
730
  reason: AutoWithdrawRunReason | null;
731
731
  steps: {
732
732
  destinationChainId: number;
@@ -737,7 +737,7 @@ declare const ListAutoWithdrawRunsResultSchema: v.ObjectSchema<{
737
737
  txHash: string | null;
738
738
  assetId: number;
739
739
  destinationAddress: string;
740
- state: "unspecified" | "failed" | "completed" | "skipped" | "pending" | "submitting" | "submitted";
740
+ state: "unspecified" | "completed" | "failed" | "skipped" | "pending" | "submitting" | "submitted";
741
741
  reason: AutoWithdrawStepReason | null;
742
742
  }[];
743
743
  createdAt: number;
@@ -11,7 +11,7 @@ type TimestampInit = {
11
11
  };
12
12
  declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
13
13
  readonly symbolId: v.NumberSchema<undefined>;
14
- readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">>]>;
14
+ readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1d" | "1s" | "1m" | "5m" | "1h" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1w" | "1mo">>]>;
15
15
  readonly tsSec: v.BigintSchema<undefined>;
16
16
  readonly open: v.BigintSchema<undefined>;
17
17
  readonly high: v.BigintSchema<undefined>;
@@ -22,7 +22,7 @@ declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<read
22
22
  readonly isClosed: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
23
23
  }, undefined>, v.TransformAction<{
24
24
  symbolId: number;
25
- timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">;
25
+ timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "1h" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1w" | "1mo">;
26
26
  tsSec: bigint;
27
27
  open: bigint;
28
28
  high: bigint;
@@ -33,7 +33,7 @@ declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<read
33
33
  isClosed: boolean;
34
34
  }, {
35
35
  symbolId: number;
36
- timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">;
36
+ timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "1h" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1w" | "1mo">;
37
37
  time: number;
38
38
  open: string;
39
39
  high: string;
@@ -46,7 +46,7 @@ declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<read
46
46
  declare const createCandleRowIntSchema: typeof createCandleRowSchema;
47
47
  declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
48
48
  readonly symbolId: v.NumberSchema<undefined>;
49
- readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">>]>;
49
+ readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1d" | "1s" | "1m" | "5m" | "1h" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1w" | "1mo">>]>;
50
50
  readonly tsSec: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
51
51
  readonly open: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
52
52
  readonly high: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
@@ -63,7 +63,7 @@ declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe
63
63
  readonly nextPageToken: v.OptionalSchema<v.StringSchema<undefined>, "">;
64
64
  }, undefined>, v.TransformAction<{
65
65
  symbolId: number;
66
- timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">;
66
+ timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "1h" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1w" | "1mo">;
67
67
  tsSec: bigint[];
68
68
  open: bigint[];
69
69
  high: bigint[];
@@ -80,7 +80,7 @@ declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe
80
80
  nextPageToken: string;
81
81
  }, {
82
82
  symbolId: number;
83
- timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">;
83
+ timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "1h" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1w" | "1mo">;
84
84
  time: number[];
85
85
  open: string[];
86
86
  high: string[];
@@ -100,7 +100,7 @@ declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe
100
100
  }>]>;
101
101
  declare function createCandleColumnarIntSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
102
102
  readonly symbolId: v.NumberSchema<undefined>;
103
- readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">>]>;
103
+ readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1d" | "1s" | "1m" | "5m" | "1h" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1w" | "1mo">>]>;
104
104
  readonly tsSec: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
105
105
  readonly open: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
106
106
  readonly high: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
@@ -117,7 +117,7 @@ declare function createCandleColumnarIntSchema(scales: SdkScales): v.SchemaWithP
117
117
  readonly nextPageToken: v.OptionalSchema<v.StringSchema<undefined>, "">;
118
118
  }, undefined>, v.TransformAction<{
119
119
  symbolId: number;
120
- timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">;
120
+ timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "1h" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1w" | "1mo">;
121
121
  tsSec: bigint[];
122
122
  open: bigint[];
123
123
  high: bigint[];
@@ -134,7 +134,7 @@ declare function createCandleColumnarIntSchema(scales: SdkScales): v.SchemaWithP
134
134
  nextPageToken: string;
135
135
  }, {
136
136
  symbolId: number;
137
- timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">;
137
+ timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "1h" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1w" | "1mo">;
138
138
  tsSec: number[];
139
139
  open: string[];
140
140
  high: string[];
@@ -158,7 +158,7 @@ type CandleColumnar = v.InferOutput<ReturnType<typeof createCandleColumnarSchema
158
158
  type CandleColumnarInt = v.InferOutput<ReturnType<typeof createCandleColumnarIntSchema>>;
159
159
  declare function createListCandlesInputSchema(): v.SchemaWithPipe<readonly [v.ObjectSchema<{
160
160
  readonly symbolId: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>;
161
- readonly timeframe: v.SchemaWithPipe<readonly [v.PicklistSchema<readonly ["1s", "1m", "3m", "5m", "15m", "30m", "1h", "2h", "4h", "6h", "8h", "12h", "1d", "3d", "1w", "1mo"], undefined>, v.TransformAction<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo", Timeframe$1.SEC_1 | Timeframe$1.MIN_1 | Timeframe$1.MIN_3 | Timeframe$1.MIN_5 | Timeframe$1.MIN_15 | Timeframe$1.MIN_30 | Timeframe$1.HOUR_1 | Timeframe$1.HOUR_2 | Timeframe$1.HOUR_4 | Timeframe$1.HOUR_6 | Timeframe$1.HOUR_8 | Timeframe$1.HOUR_12 | Timeframe$1.DAY_1 | Timeframe$1.DAY_3 | Timeframe$1.WEEK_1 | Timeframe$1.MONTH_1>]>;
161
+ readonly timeframe: v.SchemaWithPipe<readonly [v.PicklistSchema<readonly ["1s", "1m", "3m", "5m", "15m", "30m", "1h", "2h", "4h", "6h", "8h", "12h", "1d", "3d", "1w", "1mo"], undefined>, v.TransformAction<"1d" | "1s" | "1m" | "5m" | "1h" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1w" | "1mo", Timeframe$1.SEC_1 | Timeframe$1.MIN_1 | Timeframe$1.MIN_3 | Timeframe$1.MIN_5 | Timeframe$1.MIN_15 | Timeframe$1.MIN_30 | Timeframe$1.HOUR_1 | Timeframe$1.HOUR_2 | Timeframe$1.HOUR_4 | Timeframe$1.HOUR_6 | Timeframe$1.HOUR_8 | Timeframe$1.HOUR_12 | Timeframe$1.DAY_1 | Timeframe$1.DAY_3 | Timeframe$1.WEEK_1 | Timeframe$1.MONTH_1>]>;
162
162
  readonly limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 10000, undefined>]>, undefined>;
163
163
  readonly includeIncomplete: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
164
164
  readonly includeReference: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
@@ -418,6 +418,12 @@ declare const CheckpointSchema: v.ObjectSchema<{
418
418
  readonly outflowUsd: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
419
419
  readonly netInflowUsd: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
420
420
  readonly finalValueUsd: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
421
+ /**
422
+ * Holdings restored when the season opened, valued at season end like `finalValueUsd`;
423
+ * `"0"` when the season opened with no balances.
424
+ */
425
+ readonly openingValueUsd: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
426
+ /** `finalValueUsd` minus `openingValueUsd` minus `netInflowUsd`; absent when any of them is. */
421
427
  readonly seasonResultUsd: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
422
428
  readonly subaccounts: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.MaxValueAction<bigint, bigint, undefined>, v.TransformAction<any, number>]>;
423
429
  /** Values computed from partial evidence; show them with an approximation marker. */
@@ -1 +1 @@
1
- {"version":3,"file":"checkpoints.schemas.d.ts","names":[],"sources":["../../../src/services/checkpoints/checkpoints.schemas.ts"],"mappings":";;cA2Ba,6BAA2B,EAAA;;;;;;;;;;;;KAO5B,wBAAwB,EAAE,mBAAmB;cAE5C,qCAAmC,EAAA;;;;;;;;;;;KAMpC,gCAAgC,EAAE,mBACnC;cAcE,8BAA4B,EAAA;;;;;;KAO7B,yBAAyB,EAAE,mBAAmB;cAE7C,8BAA4B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;KAa7B,yBAAyB,EAAE,mBAAmB;cAE7C,iCAA+B,EAAA;;;;KAKhC,4BAA4B,EAAE,mBAAmB;cAEhD,mCAAiC,EAAA;;;;;;KAOlC,8BAA8B,EAAE,mBAAmB;cAElD,iCAA+B,EAAA;;;;;;;KAQhC,4BAA4B,EAAE,mBAAmB;cAEhD,+BAA6B,EAAA;;;;KAK9B,0BAA0B,EAAE,mBAAmB;cAE9C,6BAA2B,EAAA;;;;;;;;;;KAK5B,wBAAwB,EAAE,mBAAmB;;;;;;cAO5C,6BAA2B,EAAA,yBAAA,EAAA;;;;;;;;;;;KAa5B,wBAAwB,EAAE,mBAAmB;;cAG5C,2BAAyB,EAAA;;;;KAK1B,sBAAsB,EAAE,mBAAmB;cAI1C,2BAAyB,EAAA;;;;;;;;;;KAM1B,sBAAsB,EAAE,mBAAmB;cAE1C,oCAAkC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;KAMnC,+BAA+B,EAAE,mBAAmB;cAInD,4BAA0B,EAAA;;;;;KAM3B,uBAAuB,EAAE,mBAAmB;cAE3C,kBAAgB,EAAA;;;;;;;;;;;;;;;;;;;;;;;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AmB;cAE1C,oCAAkC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;KAMnC,+BAA+B,EAAE,mBAAmB;cAInD,4BAA0B,EAAA;;;;;KAM3B,uBAAuB,EAAE,mBAAmB;cAE3C,kBAAgB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgFjB,aAAa,EAAE,mBAAmB;cAOjC,4BAA0B,EAAA;;;KAO3B,uBAAuB,EAAE,kBAAkB"}
@@ -163,6 +163,12 @@ const CheckpointSchema = v.object({
163
163
  outflowUsd: v.optional(UnsignedDecimalSchema),
164
164
  netInflowUsd: v.optional(SignedDecimalSchema),
165
165
  finalValueUsd: v.optional(SignedDecimalSchema),
166
+ /**
167
+ * Holdings restored when the season opened, valued at season end like `finalValueUsd`;
168
+ * `"0"` when the season opened with no balances.
169
+ */
170
+ openingValueUsd: v.optional(UnsignedDecimalSchema),
171
+ /** `finalValueUsd` minus `openingValueUsd` minus `netInflowUsd`; absent when any of them is. */
166
172
  seasonResultUsd: v.optional(SignedDecimalSchema),
167
173
  subaccounts: CountSchema,
168
174
  /** Values computed from partial evidence; show them with an approximation marker. */
@@ -1 +1 @@
1
- {"version":3,"file":"checkpoints.schemas.js","names":[],"sources":["../../../src/services/checkpoints/checkpoints.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { enumLabel, enumLabelSchema } from \"../../shared/proto-enum-codec.js\";\nimport {\n OptionalTimestampMsSchema,\n optionalSubaccountIdInputSchema,\n TimestampMsSchema,\n} from \"../../shared/schemas.js\";\nimport { OrderSideCodec } from \"../orders/order-enums.codecs.js\";\nimport { CheckpointBadgeCodec, CheckpointFieldCodec } from \"./checkpoints.codecs.js\";\n\n// Money values and ratios stay base-10 decimal strings so consumers parse them\n// with a decimal type; the contract marks which ones may be negative.\nconst UnsignedDecimalSchema = v.pipe(v.string(), v.regex(/^\\d+(\\.\\d+)?$/));\nconst SignedDecimalSchema = v.pipe(v.string(), v.regex(/^-?\\d+(\\.\\d+)?$/));\nconst RatioSchema = v.pipe(v.string(), v.regex(/^(0(\\.\\d+)?|1(\\.0+)?)$/));\nconst UtcDateSchema = v.pipe(v.string(), v.isoDate());\n\n// uint64 counts surface as numbers; a count past 2^53 would lose precision, so it fails instead.\nconst CountSchema = v.pipe(\n v.bigint(),\n v.maxValue(BigInt(Number.MAX_SAFE_INTEGER)),\n v.transform(Number),\n);\n\nconst VipTierSchema = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(10));\nconst UtcHourSchema = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(23));\n\nexport const CheckpointVolumePointSchema = v.object({\n day: TimestampMsSchema,\n usd: UnsignedDecimalSchema,\n approximate: v.boolean(),\n trades: CountSchema,\n});\n\nexport type CheckpointVolumePoint = v.InferOutput<typeof CheckpointVolumePointSchema>;\n\nexport const CheckpointPortfolioValuePointSchema = v.object({\n hour: TimestampMsSchema,\n usd: SignedDecimalSchema,\n approximate: v.boolean(),\n});\n\nexport type CheckpointPortfolioValuePoint = v.InferOutput<\n typeof CheckpointPortfolioValuePointSchema\n>;\n\n// Monday first; each row holds UTC hours 0 through 23.\nconst TradesByWeekdayHourSchema = v.pipe(\n v.array(\n v.pipe(\n v.object({ hours: v.pipe(v.array(CountSchema), v.length(24)) }),\n v.transform(({ hours }) => hours),\n ),\n ),\n v.length(7),\n);\n\nexport const CheckpointPairActivitySchema = v.object({\n symbolId: v.number(),\n symbol: v.string(),\n volumeUsd: UnsignedDecimalSchema,\n trades: CountSchema,\n});\n\nexport type CheckpointPairActivity = v.InferOutput<typeof CheckpointPairActivitySchema>;\n\nexport const CheckpointBiggestTradeSchema = v.pipe(\n v.object({\n symbolId: v.number(),\n symbol: v.string(),\n side: v.number(),\n at: TimestampMsSchema,\n }),\n v.transform(({ side, ...trade }) => ({\n ...trade,\n side: enumLabel(OrderSideCodec.protoToOutput, side),\n })),\n);\n\nexport type CheckpointBiggestTrade = v.InferOutput<typeof CheckpointBiggestTradeSchema>;\n\nexport const CheckpointOrderTypeCountsSchema = v.object({\n limit: CountSchema,\n market: CountSchema,\n});\n\nexport type CheckpointOrderTypeCounts = v.InferOutput<typeof CheckpointOrderTypeCountsSchema>;\n\nexport const CheckpointTimeInForceCountsSchema = v.object({\n gtc: CountSchema,\n ioc: CountSchema,\n fok: CountSchema,\n gtd: CountSchema,\n});\n\nexport type CheckpointTimeInForceCounts = v.InferOutput<typeof CheckpointTimeInForceCountsSchema>;\n\nexport const CheckpointOrderToolCountsSchema = v.object({\n stopLoss: CountSchema,\n takeProfit: CountSchema,\n trailingStop: CountSchema,\n twap: CountSchema,\n ladder: CountSchema,\n});\n\nexport type CheckpointOrderToolCounts = v.InferOutput<typeof CheckpointOrderToolCountsSchema>;\n\nexport const CheckpointVipTierChangeSchema = v.object({\n date: UtcDateSchema,\n tier: VipTierSchema,\n});\n\nexport type CheckpointVipTierChange = v.InferOutput<typeof CheckpointVipTierChangeSchema>;\n\nexport const CheckpointEarnedBadgeSchema = v.object({\n badge: enumLabelSchema(CheckpointBadgeCodec.protoToOutput),\n earnedAt: TimestampMsSchema,\n});\n\nexport type CheckpointEarnedBadge = v.InferOutput<typeof CheckpointEarnedBadgeSchema>;\n\n/**\n * `usd` is `undefined` when the asset had no USD price at the required time; it is not zero.\n * `excludedFromValue` marks an asset that is not account equity, such as a testnet faucet\n * token: it is listed by amount only, never has `usd`, and is left out of every USD total.\n */\nexport const CheckpointAssetAmountSchema = v.pipe(\n v.object({\n asset: v.string(),\n amount: SignedDecimalSchema,\n usd: v.optional(SignedDecimalSchema),\n excludedFromValue: v.boolean(),\n }),\n v.check(\n (amount) => !amount.excludedFromValue || amount.usd === undefined,\n \"usd: must be absent for an asset excluded from value\",\n ),\n);\n\nexport type CheckpointAssetAmount = v.InferOutput<typeof CheckpointAssetAmountSchema>;\n\n/** `usd` is `undefined` when any operation had no USD value; it is not zero. */\nexport const CheckpointFlowTotalSchema = v.object({\n count: CountSchema,\n usd: v.optional(UnsignedDecimalSchema),\n});\n\nexport type CheckpointFlowTotal = v.InferOutput<typeof CheckpointFlowTotalSchema>;\n\nconst EmptyFlowTotal = { count: 0n };\n\nexport const CheckpointChainFlowSchema = v.object({\n polyesterChainId: v.number(),\n chainName: v.string(),\n total: v.optional(CheckpointFlowTotalSchema, EmptyFlowTotal),\n});\n\nexport type CheckpointChainFlow = v.InferOutput<typeof CheckpointChainFlowSchema>;\n\nexport const CheckpointFundingFlowSummarySchema = v.object({\n count: CountSchema,\n chains: v.optional(v.array(CheckpointChainFlowSchema), []),\n amounts: v.optional(v.array(CheckpointAssetAmountSchema), []),\n});\n\nexport type CheckpointFundingFlowSummary = v.InferOutput<typeof CheckpointFundingFlowSummarySchema>;\n\nconst EmptyFundingFlowSummary = { count: 0n };\n\nexport const CheckpointFundingDaySchema = v.object({\n date: UtcDateSchema,\n depositUsd: v.optional(UnsignedDecimalSchema),\n withdrawalUsd: v.optional(UnsignedDecimalSchema),\n});\n\nexport type CheckpointFundingDay = v.InferOutput<typeof CheckpointFundingDaySchema>;\n\nexport const CheckpointSchema = v.object({\n number: v.pipe(v.number(), v.integer(), v.minValue(1)),\n seasonStart: TimestampMsSchema,\n seasonEnd: TimestampMsSchema,\n takenAt: TimestampMsSchema,\n volumeUsd: UnsignedDecimalSchema,\n trades: CountSchema,\n orders: CountSchema,\n daysActive: v.number(),\n longestStreak: v.number(),\n topPairs: v.optional(v.array(CheckpointPairActivitySchema), []),\n marketsTraded: v.number(),\n makerTrades: CountSchema,\n takerTrades: CountSchema,\n selfTrades: CountSchema,\n tradesByWeekdayHour: TradesByWeekdayHourSchema,\n dailyVolume: v.optional(v.array(CheckpointVolumePointSchema), []),\n biggestTradeUsd: UnsignedDecimalSchema,\n biggestTrade: v.optional(CheckpointBiggestTradeSchema),\n orderTypes: v.optional(CheckpointOrderTypeCountsSchema, { limit: 0n, market: 0n }),\n timeInForce: v.optional(CheckpointTimeInForceCountsSchema, {\n gtc: 0n,\n ioc: 0n,\n fok: 0n,\n gtd: 0n,\n }),\n tools: v.optional(CheckpointOrderToolCountsSchema, {\n stopLoss: 0n,\n takeProfit: 0n,\n trailingStop: 0n,\n twap: 0n,\n ladder: 0n,\n }),\n postOnly: CountSchema,\n amends: CountSchema,\n filledOrders: CountSchema,\n partiallyFilledOrders: CountSchema,\n canceledOrders: CountSchema,\n rejectedOrders: CountSchema,\n fillRate: RatioSchema,\n cancelRatio: RatioSchema,\n medianLimitRestMs: v.optional(CountSchema),\n firstTradeAt: OptionalTimestampMsSchema,\n busiestDay: v.optional(UtcDateSchema),\n mostActiveHourUtc: v.optional(UtcHourSchema),\n vipTierAtCheckpoint: VipTierSchema,\n peakVipTier: VipTierSchema,\n vipTimeline: v.optional(v.array(CheckpointVipTierChangeSchema), []),\n badges: v.optional(v.array(CheckpointEarnedBadgeSchema), []),\n portfolioValue: v.optional(v.array(CheckpointPortfolioValuePointSchema), []),\n tradingBalances: v.optional(v.array(CheckpointAssetAmountSchema), []),\n fundingBalances: v.optional(v.array(CheckpointAssetAmountSchema), []),\n deposits: v.optional(CheckpointFundingFlowSummarySchema, EmptyFundingFlowSummary),\n withdrawals: v.optional(CheckpointFundingFlowSummarySchema, EmptyFundingFlowSummary),\n fundingByDay: v.optional(v.array(CheckpointFundingDaySchema), []),\n transfersIn: v.optional(CheckpointFlowTotalSchema, EmptyFlowTotal),\n transfersOut: v.optional(CheckpointFlowTotalSchema, EmptyFlowTotal),\n internalTransfers: CountSchema,\n dailyClaims: CountSchema,\n dailyClaimAmounts: v.optional(v.array(CheckpointAssetAmountSchema), []),\n inflowUsd: v.optional(UnsignedDecimalSchema),\n outflowUsd: v.optional(UnsignedDecimalSchema),\n netInflowUsd: v.optional(SignedDecimalSchema),\n finalValueUsd: v.optional(SignedDecimalSchema),\n seasonResultUsd: v.optional(SignedDecimalSchema),\n subaccounts: CountSchema,\n /** Values computed from partial evidence; show them with an approximation marker. */\n incomplete: v.optional(v.array(enumLabelSchema(CheckpointFieldCodec.protoToOutput)), []),\n});\n\n/**\n * One frozen season recap of a root account and all of its subaccounts. An absent USD value\n * means the value was unavailable, not zero.\n */\nexport type Checkpoint = v.InferOutput<typeof CheckpointSchema>;\n\nexport const ListCheckpointsResultSchema = v.object({\n checkpoints: v.optional(v.array(CheckpointSchema), []),\n});\n\n// A present `subaccountId` of zero names no subaccount, so it fails here instead of reaching the server.\nexport const ListCheckpointsInputSchema = v.strictObject({\n subaccountId: v.pipe(\n optionalSubaccountIdInputSchema(),\n v.check((value) => value !== 0n, \"subaccountId: must be greater than zero\"),\n ),\n});\n\nexport type ListCheckpointsInput = v.InferInput<typeof ListCheckpointsInputSchema>;\n"],"mappings":";;;;;;AAYA,MAAM,wBAAwB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,MAAM,eAAe,CAAC;AACzE,MAAM,sBAAsB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACzE,MAAM,cAAc,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,MAAM,wBAAwB,CAAC;AACxE,MAAM,gBAAgB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC;AAGpD,MAAM,cAAc,EAAE,KAClB,EAAE,OAAO,GACT,EAAE,SAAS,OAAO,OAAO,gBAAgB,CAAC,GAC1C,EAAE,UAAU,MAAM,CACtB;AAEA,MAAM,gBAAgB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC;AACnF,MAAM,gBAAgB,EA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AAS,EAAE,MAAM,2BAA2B,GAAG,CAAC,CAAC;CACtE,WAAW,EAAE,SAAS,qBAAqB;CAC3C,YAAY,EAAE,SAAS,qBAAqB;CAC5C,cAAc,EAAE,SAAS,mBAAmB;CAC5C,eAAe,EAAE,SAAS,mBAAmB;CAC7C,iBAAiB,EAAE,SAAS,mBAAmB;CAC/C,aAAa;;CAEb,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,qBAAqB,aAAa,CAAC,GAAG,CAAC,CAAC;AAC3F,CAAC;AAQD,MAAa,8BAA8B,EAAE,OAAO,EAChD,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,GAAG,CAAC,CAAC,EACzD,CAAC;AAGD,MAAa,6BAA6B,EAAE,aAAa,EACrD,cAAc,EAAE,KACZ,gCAAgC,GAChC,EAAE,OAAO,UAAU,UAAU,IAAI,yCAAyC,CAC9E,EACJ,CAAC"}
1
+ {"version":3,"file":"checkpoints.schemas.js","names":[],"sources":["../../../src/services/checkpoints/checkpoints.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { enumLabel, enumLabelSchema } from \"../../shared/proto-enum-codec.js\";\nimport {\n OptionalTimestampMsSchema,\n optionalSubaccountIdInputSchema,\n TimestampMsSchema,\n} from \"../../shared/schemas.js\";\nimport { OrderSideCodec } from \"../orders/order-enums.codecs.js\";\nimport { CheckpointBadgeCodec, CheckpointFieldCodec } from \"./checkpoints.codecs.js\";\n\n// Money values and ratios stay base-10 decimal strings so consumers parse them\n// with a decimal type; the contract marks which ones may be negative.\nconst UnsignedDecimalSchema = v.pipe(v.string(), v.regex(/^\\d+(\\.\\d+)?$/));\nconst SignedDecimalSchema = v.pipe(v.string(), v.regex(/^-?\\d+(\\.\\d+)?$/));\nconst RatioSchema = v.pipe(v.string(), v.regex(/^(0(\\.\\d+)?|1(\\.0+)?)$/));\nconst UtcDateSchema = v.pipe(v.string(), v.isoDate());\n\n// uint64 counts surface as numbers; a count past 2^53 would lose precision, so it fails instead.\nconst CountSchema = v.pipe(\n v.bigint(),\n v.maxValue(BigInt(Number.MAX_SAFE_INTEGER)),\n v.transform(Number),\n);\n\nconst VipTierSchema = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(10));\nconst UtcHourSchema = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(23));\n\nexport const CheckpointVolumePointSchema = v.object({\n day: TimestampMsSchema,\n usd: UnsignedDecimalSchema,\n approximate: v.boolean(),\n trades: CountSchema,\n});\n\nexport type CheckpointVolumePoint = v.InferOutput<typeof CheckpointVolumePointSchema>;\n\nexport const CheckpointPortfolioValuePointSchema = v.object({\n hour: TimestampMsSchema,\n usd: SignedDecimalSchema,\n approximate: v.boolean(),\n});\n\nexport type CheckpointPortfolioValuePoint = v.InferOutput<\n typeof CheckpointPortfolioValuePointSchema\n>;\n\n// Monday first; each row holds UTC hours 0 through 23.\nconst TradesByWeekdayHourSchema = v.pipe(\n v.array(\n v.pipe(\n v.object({ hours: v.pipe(v.array(CountSchema), v.length(24)) }),\n v.transform(({ hours }) => hours),\n ),\n ),\n v.length(7),\n);\n\nexport const CheckpointPairActivitySchema = v.object({\n symbolId: v.number(),\n symbol: v.string(),\n volumeUsd: UnsignedDecimalSchema,\n trades: CountSchema,\n});\n\nexport type CheckpointPairActivity = v.InferOutput<typeof CheckpointPairActivitySchema>;\n\nexport const CheckpointBiggestTradeSchema = v.pipe(\n v.object({\n symbolId: v.number(),\n symbol: v.string(),\n side: v.number(),\n at: TimestampMsSchema,\n }),\n v.transform(({ side, ...trade }) => ({\n ...trade,\n side: enumLabel(OrderSideCodec.protoToOutput, side),\n })),\n);\n\nexport type CheckpointBiggestTrade = v.InferOutput<typeof CheckpointBiggestTradeSchema>;\n\nexport const CheckpointOrderTypeCountsSchema = v.object({\n limit: CountSchema,\n market: CountSchema,\n});\n\nexport type CheckpointOrderTypeCounts = v.InferOutput<typeof CheckpointOrderTypeCountsSchema>;\n\nexport const CheckpointTimeInForceCountsSchema = v.object({\n gtc: CountSchema,\n ioc: CountSchema,\n fok: CountSchema,\n gtd: CountSchema,\n});\n\nexport type CheckpointTimeInForceCounts = v.InferOutput<typeof CheckpointTimeInForceCountsSchema>;\n\nexport const CheckpointOrderToolCountsSchema = v.object({\n stopLoss: CountSchema,\n takeProfit: CountSchema,\n trailingStop: CountSchema,\n twap: CountSchema,\n ladder: CountSchema,\n});\n\nexport type CheckpointOrderToolCounts = v.InferOutput<typeof CheckpointOrderToolCountsSchema>;\n\nexport const CheckpointVipTierChangeSchema = v.object({\n date: UtcDateSchema,\n tier: VipTierSchema,\n});\n\nexport type CheckpointVipTierChange = v.InferOutput<typeof CheckpointVipTierChangeSchema>;\n\nexport const CheckpointEarnedBadgeSchema = v.object({\n badge: enumLabelSchema(CheckpointBadgeCodec.protoToOutput),\n earnedAt: TimestampMsSchema,\n});\n\nexport type CheckpointEarnedBadge = v.InferOutput<typeof CheckpointEarnedBadgeSchema>;\n\n/**\n * `usd` is `undefined` when the asset had no USD price at the required time; it is not zero.\n * `excludedFromValue` marks an asset that is not account equity, such as a testnet faucet\n * token: it is listed by amount only, never has `usd`, and is left out of every USD total.\n */\nexport const CheckpointAssetAmountSchema = v.pipe(\n v.object({\n asset: v.string(),\n amount: SignedDecimalSchema,\n usd: v.optional(SignedDecimalSchema),\n excludedFromValue: v.boolean(),\n }),\n v.check(\n (amount) => !amount.excludedFromValue || amount.usd === undefined,\n \"usd: must be absent for an asset excluded from value\",\n ),\n);\n\nexport type CheckpointAssetAmount = v.InferOutput<typeof CheckpointAssetAmountSchema>;\n\n/** `usd` is `undefined` when any operation had no USD value; it is not zero. */\nexport const CheckpointFlowTotalSchema = v.object({\n count: CountSchema,\n usd: v.optional(UnsignedDecimalSchema),\n});\n\nexport type CheckpointFlowTotal = v.InferOutput<typeof CheckpointFlowTotalSchema>;\n\nconst EmptyFlowTotal = { count: 0n };\n\nexport const CheckpointChainFlowSchema = v.object({\n polyesterChainId: v.number(),\n chainName: v.string(),\n total: v.optional(CheckpointFlowTotalSchema, EmptyFlowTotal),\n});\n\nexport type CheckpointChainFlow = v.InferOutput<typeof CheckpointChainFlowSchema>;\n\nexport const CheckpointFundingFlowSummarySchema = v.object({\n count: CountSchema,\n chains: v.optional(v.array(CheckpointChainFlowSchema), []),\n amounts: v.optional(v.array(CheckpointAssetAmountSchema), []),\n});\n\nexport type CheckpointFundingFlowSummary = v.InferOutput<typeof CheckpointFundingFlowSummarySchema>;\n\nconst EmptyFundingFlowSummary = { count: 0n };\n\nexport const CheckpointFundingDaySchema = v.object({\n date: UtcDateSchema,\n depositUsd: v.optional(UnsignedDecimalSchema),\n withdrawalUsd: v.optional(UnsignedDecimalSchema),\n});\n\nexport type CheckpointFundingDay = v.InferOutput<typeof CheckpointFundingDaySchema>;\n\nexport const CheckpointSchema = v.object({\n number: v.pipe(v.number(), v.integer(), v.minValue(1)),\n seasonStart: TimestampMsSchema,\n seasonEnd: TimestampMsSchema,\n takenAt: TimestampMsSchema,\n volumeUsd: UnsignedDecimalSchema,\n trades: CountSchema,\n orders: CountSchema,\n daysActive: v.number(),\n longestStreak: v.number(),\n topPairs: v.optional(v.array(CheckpointPairActivitySchema), []),\n marketsTraded: v.number(),\n makerTrades: CountSchema,\n takerTrades: CountSchema,\n selfTrades: CountSchema,\n tradesByWeekdayHour: TradesByWeekdayHourSchema,\n dailyVolume: v.optional(v.array(CheckpointVolumePointSchema), []),\n biggestTradeUsd: UnsignedDecimalSchema,\n biggestTrade: v.optional(CheckpointBiggestTradeSchema),\n orderTypes: v.optional(CheckpointOrderTypeCountsSchema, { limit: 0n, market: 0n }),\n timeInForce: v.optional(CheckpointTimeInForceCountsSchema, {\n gtc: 0n,\n ioc: 0n,\n fok: 0n,\n gtd: 0n,\n }),\n tools: v.optional(CheckpointOrderToolCountsSchema, {\n stopLoss: 0n,\n takeProfit: 0n,\n trailingStop: 0n,\n twap: 0n,\n ladder: 0n,\n }),\n postOnly: CountSchema,\n amends: CountSchema,\n filledOrders: CountSchema,\n partiallyFilledOrders: CountSchema,\n canceledOrders: CountSchema,\n rejectedOrders: CountSchema,\n fillRate: RatioSchema,\n cancelRatio: RatioSchema,\n medianLimitRestMs: v.optional(CountSchema),\n firstTradeAt: OptionalTimestampMsSchema,\n busiestDay: v.optional(UtcDateSchema),\n mostActiveHourUtc: v.optional(UtcHourSchema),\n vipTierAtCheckpoint: VipTierSchema,\n peakVipTier: VipTierSchema,\n vipTimeline: v.optional(v.array(CheckpointVipTierChangeSchema), []),\n badges: v.optional(v.array(CheckpointEarnedBadgeSchema), []),\n portfolioValue: v.optional(v.array(CheckpointPortfolioValuePointSchema), []),\n tradingBalances: v.optional(v.array(CheckpointAssetAmountSchema), []),\n fundingBalances: v.optional(v.array(CheckpointAssetAmountSchema), []),\n deposits: v.optional(CheckpointFundingFlowSummarySchema, EmptyFundingFlowSummary),\n withdrawals: v.optional(CheckpointFundingFlowSummarySchema, EmptyFundingFlowSummary),\n fundingByDay: v.optional(v.array(CheckpointFundingDaySchema), []),\n transfersIn: v.optional(CheckpointFlowTotalSchema, EmptyFlowTotal),\n transfersOut: v.optional(CheckpointFlowTotalSchema, EmptyFlowTotal),\n internalTransfers: CountSchema,\n dailyClaims: CountSchema,\n dailyClaimAmounts: v.optional(v.array(CheckpointAssetAmountSchema), []),\n inflowUsd: v.optional(UnsignedDecimalSchema),\n outflowUsd: v.optional(UnsignedDecimalSchema),\n netInflowUsd: v.optional(SignedDecimalSchema),\n finalValueUsd: v.optional(SignedDecimalSchema),\n /**\n * Holdings restored when the season opened, valued at season end like `finalValueUsd`;\n * `\"0\"` when the season opened with no balances.\n */\n openingValueUsd: v.optional(UnsignedDecimalSchema),\n /** `finalValueUsd` minus `openingValueUsd` minus `netInflowUsd`; absent when any of them is. */\n seasonResultUsd: v.optional(SignedDecimalSchema),\n subaccounts: CountSchema,\n /** Values computed from partial evidence; show them with an approximation marker. */\n incomplete: v.optional(v.array(enumLabelSchema(CheckpointFieldCodec.protoToOutput)), []),\n});\n\n/**\n * One frozen season recap of a root account and all of its subaccounts. An absent USD value\n * means the value was unavailable, not zero.\n */\nexport type Checkpoint = v.InferOutput<typeof CheckpointSchema>;\n\nexport const ListCheckpointsResultSchema = v.object({\n checkpoints: v.optional(v.array(CheckpointSchema), []),\n});\n\n// A present `subaccountId` of zero names no subaccount, so it fails here instead of reaching the server.\nexport const ListCheckpointsInputSchema = v.strictObject({\n subaccountId: v.pipe(\n optionalSubaccountIdInputSchema(),\n v.check((value) => value !== 0n, \"subaccountId: must be greater than zero\"),\n ),\n});\n\nexport type ListCheckpointsInput = v.InferInput<typeof ListCheckpointsInputSchema>;\n"],"mappings":";;;;;;AAYA,MAAM,wBAAwB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,MAAM,eAAe,CAAC;AACzE,MAAM,sBAAsB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACzE,MAAM,cAAc,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,MAAM,wBAAwB,CAAC;AACxE,MAAM,gBAAgB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC;AAGpD,MAAM,cAAc,EAAE,KAClB,EAAE,OAAO,GACT,EAAE,SAAS,OAAO,OAAO,gBAAgB,CAAC,GAC1C,EAAE,UAAU,MAAM,CACtB;AAEA,MAAM,gBAAgB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC;AACnF,MAAM,gBAAgB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC;AAEnF,MAAa,8BAA8B,EAAE,OAAO;CAChD,KAAK;CACL,KAAK;CACL,aAAa,EAAE,QAAQ;CACvB,QAAQ;AACZ,CAAC;AAID,MAAa,sCAAsC,EAAE,OAAO;CACxD,MAAM;CACN,KAAK;CACL,aAAa,EAAE,QAAQ;AAC3B,CAAC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S,EAAE,MAAM,gBAAgB,qBAAqB,aAAa,CAAC,GAAG,CAAC,CAAC;AAC3F,CAAC;AAQD,MAAa,8BAA8B,EAAE,OAAO,EAChD,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,GAAG,CAAC,CAAC,EACzD,CAAC;AAGD,MAAa,6BAA6B,EAAE,aAAa,EACrD,cAAc,EAAE,KACZ,gCAAgC,GAChC,EAAE,OAAO,UAAU,UAAU,IAAI,yCAAyC,CAC9E,EACJ,CAAC"}
@@ -13,8 +13,8 @@ type TimestampInit = {
13
13
  };
14
14
  declare const GetOrderbookHeatmapInputSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
15
15
  readonly symbolId: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>;
16
- readonly interval: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["1s", "1m", "5m", "1h"], undefined>, "1s">, v.TransformAction<"1h" | "1m" | "1s" | "5m", HeatmapInterval>]>;
17
- readonly depth: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly [1, 5, 10, 20, 50, 100, 200, 500, 1000], undefined>, 50>, v.TransformAction<1 | 5 | 10 | 20 | 100 | 500 | 1000 | 200 | 50, HeatmapDepth>]>;
16
+ readonly interval: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["1s", "1m", "5m", "1h"], undefined>, "1s">, v.TransformAction<"1s" | "1m" | "5m" | "1h", HeatmapInterval>]>;
17
+ readonly depth: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly [1, 5, 10, 20, 50, 100, 200, 500, 1000], undefined>, 50>, v.TransformAction<1 | 5 | 10 | 20 | 100 | 500 | 1000 | 50 | 200, HeatmapDepth>]>;
18
18
  readonly quantityMode: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["close", "peak"], undefined>, "close">, v.TransformAction<"close" | "peak", HeatmapQuantityMode>]>;
19
19
  readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 20000, undefined>]>;
20
20
  readonly startTsSec: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>, v.TransformAction<number, bigint>]>, undefined>;
@@ -122,7 +122,7 @@ declare function convertHeatmapDeltaBucket(bucket: OrderbookHeatmapDeltaBucketRa
122
122
  type OrderbookHeatmapDeltaBucket = ReturnType<typeof convertHeatmapDeltaBucket>;
123
123
  declare const OrderbookHeatmapLiveBucketRawSchema: v.ObjectSchema<{
124
124
  readonly symbolId: v.NumberSchema<undefined>;
125
- readonly interval: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1h" | "1m" | "1s" | "5m">>]>;
125
+ readonly interval: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1s" | "1m" | "5m" | "1h">>]>;
126
126
  readonly tsSec: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, number>]>;
127
127
  readonly isFinal: v.BooleanSchema<undefined>;
128
128
  readonly bids: v.OptionalSchema<v.ObjectSchema<{
@@ -142,7 +142,7 @@ declare const OrderbookHeatmapLiveBucketRawSchema: v.ObjectSchema<{
142
142
  type OrderbookHeatmapLiveBucketRaw = v.InferOutput<typeof OrderbookHeatmapLiveBucketRawSchema>;
143
143
  declare function convertHeatmapLiveBucket(bucket: OrderbookHeatmapLiveBucketRaw, scales: SdkScales): {
144
144
  symbolId: number;
145
- interval: DecodedEnum<"1h" | "1m" | "1s" | "5m">;
145
+ interval: DecodedEnum<"1s" | "1m" | "5m" | "1h">;
146
146
  tsSec: number;
147
147
  isFinal: boolean;
148
148
  bids: {
@@ -226,8 +226,8 @@ declare function convertHeatmapDeltaChain(chain: OrderbookHeatmapDeltaChainRaw,
226
226
  type OrderbookHeatmapDeltaChain = ReturnType<typeof convertHeatmapDeltaChain>;
227
227
  declare function createOrderbookHeatmapResponseSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
228
228
  readonly symbolId: v.NumberSchema<undefined>;
229
- readonly interval: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1h" | "1m" | "1s" | "5m">>]>;
230
- readonly depth: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, 1 | 5 | 10 | 20 | "unspecified" | 100 | 500 | 1000 | 200 | 50>]>;
229
+ readonly interval: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1s" | "1m" | "5m" | "1h">>]>;
230
+ readonly depth: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, 1 | "unspecified" | 5 | 10 | 20 | 100 | 500 | 1000 | 50 | 200>]>;
231
231
  readonly chain: v.OptionalSchema<v.ObjectSchema<{
232
232
  readonly baseKeyframe: v.OptionalSchema<v.ObjectSchema<{
233
233
  readonly tsSec: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, number>]>;
@@ -267,7 +267,7 @@ declare function createOrderbookHeatmapResponseSchema(scales: SdkScales): v.Sche
267
267
  readonly quantityMode: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"close" | "peak">>]>;
268
268
  readonly liveBucket: v.OptionalSchema<v.ObjectSchema<{
269
269
  readonly symbolId: v.NumberSchema<undefined>;
270
- readonly interval: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1h" | "1m" | "1s" | "5m">>]>;
270
+ readonly interval: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1s" | "1m" | "5m" | "1h">>]>;
271
271
  readonly tsSec: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, number>]>;
272
272
  readonly isFinal: v.BooleanSchema<undefined>;
273
273
  readonly bids: v.OptionalSchema<v.ObjectSchema<{
@@ -286,8 +286,8 @@ declare function createOrderbookHeatmapResponseSchema(scales: SdkScales): v.Sche
286
286
  }, undefined>, undefined>;
287
287
  }, undefined>, v.TransformAction<{
288
288
  symbolId: number;
289
- interval: DecodedEnum<"1h" | "1m" | "1s" | "5m">;
290
- depth: 1 | 5 | 10 | 20 | "unspecified" | 100 | 500 | 1000 | 200 | 50;
289
+ interval: DecodedEnum<"1s" | "1m" | "5m" | "1h">;
290
+ depth: 1 | "unspecified" | 5 | 10 | 20 | 100 | 500 | 1000 | 50 | 200;
291
291
  chain?: {
292
292
  baseKeyframe?: {
293
293
  tsSec: number;
@@ -327,7 +327,7 @@ declare function createOrderbookHeatmapResponseSchema(scales: SdkScales): v.Sche
327
327
  quantityMode: DecodedEnum<"close" | "peak">;
328
328
  liveBucket?: {
329
329
  symbolId: number;
330
- interval: DecodedEnum<"1h" | "1m" | "1s" | "5m">;
330
+ interval: DecodedEnum<"1s" | "1m" | "5m" | "1h">;
331
331
  tsSec: number;
332
332
  isFinal: boolean;
333
333
  bids?: {
@@ -346,8 +346,8 @@ declare function createOrderbookHeatmapResponseSchema(scales: SdkScales): v.Sche
346
346
  } | undefined;
347
347
  }, {
348
348
  symbolId: number;
349
- interval: DecodedEnum<"1h" | "1m" | "1s" | "5m">;
350
- depth: 1 | 5 | 10 | 20 | "unspecified" | 100 | 500 | 1000 | 200 | 50;
349
+ interval: DecodedEnum<"1s" | "1m" | "5m" | "1h">;
350
+ depth: 1 | "unspecified" | 5 | 10 | 20 | 100 | 500 | 1000 | 50 | 200;
351
351
  chain: {
352
352
  baseKeyframe: {
353
353
  tsSec: number;
@@ -387,7 +387,7 @@ declare function createOrderbookHeatmapResponseSchema(scales: SdkScales): v.Sche
387
387
  quantityMode: DecodedEnum<"close" | "peak">;
388
388
  liveBucket: {
389
389
  symbolId: number;
390
- interval: DecodedEnum<"1h" | "1m" | "1s" | "5m">;
390
+ interval: DecodedEnum<"1s" | "1m" | "5m" | "1h">;
391
391
  tsSec: number;
392
392
  isFinal: boolean;
393
393
  bids: {