@proton/wrap-constants 0.2.120 → 0.2.122
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +68 -60
- package/dist/index.js +7 -5
- package/dist/index.mjs +7 -5
- package/package.json +2 -2
- package/src/parsers/dex.ts +11 -8
package/dist/index.d.ts
CHANGED
|
@@ -6397,19 +6397,19 @@ declare const getOhlcvParser: z.ZodObject<{
|
|
|
6397
6397
|
from: z.ZodString;
|
|
6398
6398
|
to: z.ZodString;
|
|
6399
6399
|
symbol: z.ZodString;
|
|
6400
|
-
limit: z.ZodEffects<z.ZodDefault<z.
|
|
6400
|
+
limit: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
|
|
6401
6401
|
}, "strip", z.ZodTypeAny, {
|
|
6402
6402
|
symbol: string;
|
|
6403
6403
|
from: string;
|
|
6404
6404
|
to: string;
|
|
6405
6405
|
interval: string;
|
|
6406
|
-
limit:
|
|
6406
|
+
limit: number;
|
|
6407
6407
|
}, {
|
|
6408
6408
|
symbol: string;
|
|
6409
6409
|
from: string;
|
|
6410
6410
|
to: string;
|
|
6411
6411
|
interval: string;
|
|
6412
|
-
limit?:
|
|
6412
|
+
limit?: number | undefined;
|
|
6413
6413
|
}>;
|
|
6414
6414
|
declare type GetOHLCV = z.infer<typeof getOhlcvParser>;
|
|
6415
6415
|
declare const getOhlcvResponseParser: z.ZodObject<{
|
|
@@ -6472,6 +6472,7 @@ declare type GetOHLCVResponse = z.infer<typeof getOhlcvResponseParser>;
|
|
|
6472
6472
|
* Order History
|
|
6473
6473
|
*/
|
|
6474
6474
|
declare const openOrderParser: z.ZodObject<{
|
|
6475
|
+
block_time: z.ZodString;
|
|
6475
6476
|
order_id: z.ZodString;
|
|
6476
6477
|
ordinal_order_id: z.ZodString;
|
|
6477
6478
|
market_id: z.ZodNumber;
|
|
@@ -6492,6 +6493,7 @@ declare const openOrderParser: z.ZodObject<{
|
|
|
6492
6493
|
}, "strip", z.ZodTypeAny, {
|
|
6493
6494
|
status: string;
|
|
6494
6495
|
price: number;
|
|
6496
|
+
block_time: string;
|
|
6495
6497
|
order_id: string;
|
|
6496
6498
|
ordinal_order_id: string;
|
|
6497
6499
|
market_id: number;
|
|
@@ -6510,6 +6512,7 @@ declare const openOrderParser: z.ZodObject<{
|
|
|
6510
6512
|
}, {
|
|
6511
6513
|
status: string;
|
|
6512
6514
|
price: number;
|
|
6515
|
+
block_time: string;
|
|
6513
6516
|
order_id: string;
|
|
6514
6517
|
ordinal_order_id: string;
|
|
6515
6518
|
market_id: number;
|
|
@@ -6551,6 +6554,7 @@ declare const orderHistoryParser: z.ZodObject<{
|
|
|
6551
6554
|
}, "strip", z.ZodTypeAny, {
|
|
6552
6555
|
status: string;
|
|
6553
6556
|
price: number;
|
|
6557
|
+
block_time: string;
|
|
6554
6558
|
order_id: string;
|
|
6555
6559
|
ordinal_order_id: string;
|
|
6556
6560
|
market_id: number;
|
|
@@ -6561,7 +6565,6 @@ declare const orderHistoryParser: z.ZodObject<{
|
|
|
6561
6565
|
trigger_price: number;
|
|
6562
6566
|
fill_type: number;
|
|
6563
6567
|
block_num: string;
|
|
6564
|
-
block_time: string;
|
|
6565
6568
|
quantity_change: number;
|
|
6566
6569
|
seq: string;
|
|
6567
6570
|
trx_id: string;
|
|
@@ -6572,6 +6575,7 @@ declare const orderHistoryParser: z.ZodObject<{
|
|
|
6572
6575
|
}, {
|
|
6573
6576
|
status: string;
|
|
6574
6577
|
price: number;
|
|
6578
|
+
block_time: string;
|
|
6575
6579
|
order_id: string;
|
|
6576
6580
|
ordinal_order_id: string;
|
|
6577
6581
|
market_id: number;
|
|
@@ -6582,7 +6586,6 @@ declare const orderHistoryParser: z.ZodObject<{
|
|
|
6582
6586
|
trigger_price: number;
|
|
6583
6587
|
fill_type: number;
|
|
6584
6588
|
block_num: string;
|
|
6585
|
-
block_time: string;
|
|
6586
6589
|
quantity_change: number;
|
|
6587
6590
|
seq: string;
|
|
6588
6591
|
trx_id: string;
|
|
@@ -6595,20 +6598,20 @@ declare type OrderHistory = z.infer<typeof orderHistoryParser>;
|
|
|
6595
6598
|
declare const getOpenOrdersParser: z.ZodObject<{
|
|
6596
6599
|
account: z.ZodString;
|
|
6597
6600
|
symbol: z.ZodOptional<z.ZodString>;
|
|
6598
|
-
offset: z.ZodDefault<z.
|
|
6599
|
-
limit: z.ZodEffects<z.ZodDefault<z.
|
|
6601
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
6602
|
+
limit: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
|
|
6600
6603
|
ordinal_order_ids: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>>;
|
|
6601
6604
|
}, "strip", z.ZodTypeAny, {
|
|
6602
6605
|
account: string;
|
|
6603
|
-
limit:
|
|
6604
|
-
offset:
|
|
6606
|
+
limit: number;
|
|
6607
|
+
offset: number;
|
|
6605
6608
|
symbol?: string | undefined;
|
|
6606
6609
|
ordinal_order_ids?: string | string[] | undefined;
|
|
6607
6610
|
}, {
|
|
6608
6611
|
account: string;
|
|
6609
6612
|
symbol?: string | undefined;
|
|
6610
|
-
offset?:
|
|
6611
|
-
limit?:
|
|
6613
|
+
offset?: number | undefined;
|
|
6614
|
+
limit?: number | undefined;
|
|
6612
6615
|
ordinal_order_ids?: string | string[] | undefined;
|
|
6613
6616
|
}>;
|
|
6614
6617
|
declare type GetOpenOrders = z.infer<typeof getOpenOrdersParser>;
|
|
@@ -6616,6 +6619,7 @@ declare const getOpenOrdersResponseParser: z.ZodObject<{
|
|
|
6616
6619
|
sync: z.ZodNumber;
|
|
6617
6620
|
count: z.ZodNumber;
|
|
6618
6621
|
data: z.ZodArray<z.ZodObject<{
|
|
6622
|
+
block_time: z.ZodString;
|
|
6619
6623
|
order_id: z.ZodString;
|
|
6620
6624
|
ordinal_order_id: z.ZodString;
|
|
6621
6625
|
market_id: z.ZodNumber;
|
|
@@ -6636,6 +6640,7 @@ declare const getOpenOrdersResponseParser: z.ZodObject<{
|
|
|
6636
6640
|
}, "strip", z.ZodTypeAny, {
|
|
6637
6641
|
status: string;
|
|
6638
6642
|
price: number;
|
|
6643
|
+
block_time: string;
|
|
6639
6644
|
order_id: string;
|
|
6640
6645
|
ordinal_order_id: string;
|
|
6641
6646
|
market_id: number;
|
|
@@ -6654,6 +6659,7 @@ declare const getOpenOrdersResponseParser: z.ZodObject<{
|
|
|
6654
6659
|
}, {
|
|
6655
6660
|
status: string;
|
|
6656
6661
|
price: number;
|
|
6662
|
+
block_time: string;
|
|
6657
6663
|
order_id: string;
|
|
6658
6664
|
ordinal_order_id: string;
|
|
6659
6665
|
market_id: number;
|
|
@@ -6674,6 +6680,7 @@ declare const getOpenOrdersResponseParser: z.ZodObject<{
|
|
|
6674
6680
|
data: {
|
|
6675
6681
|
status: string;
|
|
6676
6682
|
price: number;
|
|
6683
|
+
block_time: string;
|
|
6677
6684
|
order_id: string;
|
|
6678
6685
|
ordinal_order_id: string;
|
|
6679
6686
|
market_id: number;
|
|
@@ -6696,6 +6703,7 @@ declare const getOpenOrdersResponseParser: z.ZodObject<{
|
|
|
6696
6703
|
data: {
|
|
6697
6704
|
status: string;
|
|
6698
6705
|
price: number;
|
|
6706
|
+
block_time: string;
|
|
6699
6707
|
order_id: string;
|
|
6700
6708
|
ordinal_order_id: string;
|
|
6701
6709
|
market_id: number;
|
|
@@ -6719,15 +6727,15 @@ declare type GetOpenOrdersResponse = z.infer<typeof getOpenOrdersResponseParser>
|
|
|
6719
6727
|
declare const getOrderHistoryParser: z.ZodObject<{
|
|
6720
6728
|
account: z.ZodString;
|
|
6721
6729
|
symbol: z.ZodOptional<z.ZodString>;
|
|
6722
|
-
offset: z.ZodDefault<z.
|
|
6723
|
-
limit: z.ZodEffects<z.ZodDefault<z.
|
|
6730
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
6731
|
+
limit: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
|
|
6724
6732
|
ordinal_order_ids: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>>;
|
|
6725
6733
|
trx_id: z.ZodOptional<z.ZodString>;
|
|
6726
6734
|
status: z.ZodOptional<z.ZodString>;
|
|
6727
6735
|
}, "strip", z.ZodTypeAny, {
|
|
6728
6736
|
account: string;
|
|
6729
|
-
limit:
|
|
6730
|
-
offset:
|
|
6737
|
+
limit: number;
|
|
6738
|
+
offset: number;
|
|
6731
6739
|
symbol?: string | undefined;
|
|
6732
6740
|
ordinal_order_ids?: string | string[] | undefined;
|
|
6733
6741
|
trx_id?: string | undefined;
|
|
@@ -6735,8 +6743,8 @@ declare const getOrderHistoryParser: z.ZodObject<{
|
|
|
6735
6743
|
}, {
|
|
6736
6744
|
account: string;
|
|
6737
6745
|
symbol?: string | undefined;
|
|
6738
|
-
offset?:
|
|
6739
|
-
limit?:
|
|
6746
|
+
offset?: number | undefined;
|
|
6747
|
+
limit?: number | undefined;
|
|
6740
6748
|
ordinal_order_ids?: string | string[] | undefined;
|
|
6741
6749
|
trx_id?: string | undefined;
|
|
6742
6750
|
status?: string | undefined;
|
|
@@ -6769,6 +6777,7 @@ declare const getOrderHistoryResponseParser: z.ZodObject<{
|
|
|
6769
6777
|
}, "strip", z.ZodTypeAny, {
|
|
6770
6778
|
status: string;
|
|
6771
6779
|
price: number;
|
|
6780
|
+
block_time: string;
|
|
6772
6781
|
order_id: string;
|
|
6773
6782
|
ordinal_order_id: string;
|
|
6774
6783
|
market_id: number;
|
|
@@ -6779,7 +6788,6 @@ declare const getOrderHistoryResponseParser: z.ZodObject<{
|
|
|
6779
6788
|
trigger_price: number;
|
|
6780
6789
|
fill_type: number;
|
|
6781
6790
|
block_num: string;
|
|
6782
|
-
block_time: string;
|
|
6783
6791
|
quantity_change: number;
|
|
6784
6792
|
seq: string;
|
|
6785
6793
|
trx_id: string;
|
|
@@ -6790,6 +6798,7 @@ declare const getOrderHistoryResponseParser: z.ZodObject<{
|
|
|
6790
6798
|
}, {
|
|
6791
6799
|
status: string;
|
|
6792
6800
|
price: number;
|
|
6801
|
+
block_time: string;
|
|
6793
6802
|
order_id: string;
|
|
6794
6803
|
ordinal_order_id: string;
|
|
6795
6804
|
market_id: number;
|
|
@@ -6800,7 +6809,6 @@ declare const getOrderHistoryResponseParser: z.ZodObject<{
|
|
|
6800
6809
|
trigger_price: number;
|
|
6801
6810
|
fill_type: number;
|
|
6802
6811
|
block_num: string;
|
|
6803
|
-
block_time: string;
|
|
6804
6812
|
quantity_change: number;
|
|
6805
6813
|
seq: string;
|
|
6806
6814
|
trx_id: string;
|
|
@@ -6813,6 +6821,7 @@ declare const getOrderHistoryResponseParser: z.ZodObject<{
|
|
|
6813
6821
|
data: {
|
|
6814
6822
|
status: string;
|
|
6815
6823
|
price: number;
|
|
6824
|
+
block_time: string;
|
|
6816
6825
|
order_id: string;
|
|
6817
6826
|
ordinal_order_id: string;
|
|
6818
6827
|
market_id: number;
|
|
@@ -6823,7 +6832,6 @@ declare const getOrderHistoryResponseParser: z.ZodObject<{
|
|
|
6823
6832
|
trigger_price: number;
|
|
6824
6833
|
fill_type: number;
|
|
6825
6834
|
block_num: string;
|
|
6826
|
-
block_time: string;
|
|
6827
6835
|
quantity_change: number;
|
|
6828
6836
|
seq: string;
|
|
6829
6837
|
trx_id: string;
|
|
@@ -6838,6 +6846,7 @@ declare const getOrderHistoryResponseParser: z.ZodObject<{
|
|
|
6838
6846
|
data: {
|
|
6839
6847
|
status: string;
|
|
6840
6848
|
price: number;
|
|
6849
|
+
block_time: string;
|
|
6841
6850
|
order_id: string;
|
|
6842
6851
|
ordinal_order_id: string;
|
|
6843
6852
|
market_id: number;
|
|
@@ -6848,7 +6857,6 @@ declare const getOrderHistoryResponseParser: z.ZodObject<{
|
|
|
6848
6857
|
trigger_price: number;
|
|
6849
6858
|
fill_type: number;
|
|
6850
6859
|
block_num: string;
|
|
6851
|
-
block_time: string;
|
|
6852
6860
|
quantity_change: number;
|
|
6853
6861
|
seq: string;
|
|
6854
6862
|
trx_id: string;
|
|
@@ -6898,6 +6906,7 @@ declare const getOrderLifecycleResponseParser: z.ZodObject<{
|
|
|
6898
6906
|
}, "strip", z.ZodTypeAny, {
|
|
6899
6907
|
status: string;
|
|
6900
6908
|
price: number;
|
|
6909
|
+
block_time: string;
|
|
6901
6910
|
order_id: string;
|
|
6902
6911
|
ordinal_order_id: string;
|
|
6903
6912
|
market_id: number;
|
|
@@ -6908,7 +6917,6 @@ declare const getOrderLifecycleResponseParser: z.ZodObject<{
|
|
|
6908
6917
|
trigger_price: number;
|
|
6909
6918
|
fill_type: number;
|
|
6910
6919
|
block_num: string;
|
|
6911
|
-
block_time: string;
|
|
6912
6920
|
quantity_change: number;
|
|
6913
6921
|
seq: string;
|
|
6914
6922
|
trx_id: string;
|
|
@@ -6919,6 +6927,7 @@ declare const getOrderLifecycleResponseParser: z.ZodObject<{
|
|
|
6919
6927
|
}, {
|
|
6920
6928
|
status: string;
|
|
6921
6929
|
price: number;
|
|
6930
|
+
block_time: string;
|
|
6922
6931
|
order_id: string;
|
|
6923
6932
|
ordinal_order_id: string;
|
|
6924
6933
|
market_id: number;
|
|
@@ -6929,7 +6938,6 @@ declare const getOrderLifecycleResponseParser: z.ZodObject<{
|
|
|
6929
6938
|
trigger_price: number;
|
|
6930
6939
|
fill_type: number;
|
|
6931
6940
|
block_num: string;
|
|
6932
|
-
block_time: string;
|
|
6933
6941
|
quantity_change: number;
|
|
6934
6942
|
seq: string;
|
|
6935
6943
|
trx_id: string;
|
|
@@ -6942,6 +6950,7 @@ declare const getOrderLifecycleResponseParser: z.ZodObject<{
|
|
|
6942
6950
|
data: {
|
|
6943
6951
|
status: string;
|
|
6944
6952
|
price: number;
|
|
6953
|
+
block_time: string;
|
|
6945
6954
|
order_id: string;
|
|
6946
6955
|
ordinal_order_id: string;
|
|
6947
6956
|
market_id: number;
|
|
@@ -6952,7 +6961,6 @@ declare const getOrderLifecycleResponseParser: z.ZodObject<{
|
|
|
6952
6961
|
trigger_price: number;
|
|
6953
6962
|
fill_type: number;
|
|
6954
6963
|
block_num: string;
|
|
6955
|
-
block_time: string;
|
|
6956
6964
|
quantity_change: number;
|
|
6957
6965
|
seq: string;
|
|
6958
6966
|
trx_id: string;
|
|
@@ -6966,6 +6974,7 @@ declare const getOrderLifecycleResponseParser: z.ZodObject<{
|
|
|
6966
6974
|
data: {
|
|
6967
6975
|
status: string;
|
|
6968
6976
|
price: number;
|
|
6977
|
+
block_time: string;
|
|
6969
6978
|
order_id: string;
|
|
6970
6979
|
ordinal_order_id: string;
|
|
6971
6980
|
market_id: number;
|
|
@@ -6976,7 +6985,6 @@ declare const getOrderLifecycleResponseParser: z.ZodObject<{
|
|
|
6976
6985
|
trigger_price: number;
|
|
6977
6986
|
fill_type: number;
|
|
6978
6987
|
block_num: string;
|
|
6979
|
-
block_time: string;
|
|
6980
6988
|
quantity_change: number;
|
|
6981
6989
|
seq: string;
|
|
6982
6990
|
trx_id: string;
|
|
@@ -7190,15 +7198,15 @@ declare type Depth = z.infer<typeof depthParser>;
|
|
|
7190
7198
|
declare const getDepthParser: z.ZodObject<{
|
|
7191
7199
|
symbol: z.ZodString;
|
|
7192
7200
|
step: z.ZodString;
|
|
7193
|
-
limit: z.ZodEffects<z.ZodDefault<z.
|
|
7201
|
+
limit: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
|
|
7194
7202
|
}, "strip", z.ZodTypeAny, {
|
|
7195
7203
|
symbol: string;
|
|
7196
|
-
limit:
|
|
7204
|
+
limit: number;
|
|
7197
7205
|
step: string;
|
|
7198
7206
|
}, {
|
|
7199
7207
|
symbol: string;
|
|
7200
7208
|
step: string;
|
|
7201
|
-
limit?:
|
|
7209
|
+
limit?: number | undefined;
|
|
7202
7210
|
}>;
|
|
7203
7211
|
declare type GetDepth = z.infer<typeof getDepthParser>;
|
|
7204
7212
|
declare const getDepthResponseParser: z.ZodObject<{
|
|
@@ -7679,10 +7687,10 @@ declare const tradeParser: z.ZodObject<{
|
|
|
7679
7687
|
trx_id: z.ZodString;
|
|
7680
7688
|
}, "strip", z.ZodTypeAny, {
|
|
7681
7689
|
price: number;
|
|
7690
|
+
block_time: string;
|
|
7682
7691
|
market_id: number;
|
|
7683
7692
|
order_side: number;
|
|
7684
7693
|
block_num: string;
|
|
7685
|
-
block_time: string;
|
|
7686
7694
|
trx_id: string;
|
|
7687
7695
|
trade_id: string;
|
|
7688
7696
|
bid_user: string;
|
|
@@ -7703,10 +7711,10 @@ declare const tradeParser: z.ZodObject<{
|
|
|
7703
7711
|
ask_referrer_fee: number;
|
|
7704
7712
|
}, {
|
|
7705
7713
|
price: number;
|
|
7714
|
+
block_time: string;
|
|
7706
7715
|
market_id: number;
|
|
7707
7716
|
order_side: number;
|
|
7708
7717
|
block_num: string;
|
|
7709
|
-
block_time: string;
|
|
7710
7718
|
trx_id: string;
|
|
7711
7719
|
trade_id: string;
|
|
7712
7720
|
bid_user: string;
|
|
@@ -7729,16 +7737,16 @@ declare const tradeParser: z.ZodObject<{
|
|
|
7729
7737
|
declare type Trade = z.infer<typeof tradeParser>;
|
|
7730
7738
|
declare const getTradesParser: z.ZodObject<{
|
|
7731
7739
|
symbol: z.ZodString;
|
|
7732
|
-
offset: z.ZodDefault<z.
|
|
7733
|
-
limit: z.ZodEffects<z.ZodDefault<z.
|
|
7740
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
7741
|
+
limit: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
|
|
7734
7742
|
}, "strip", z.ZodTypeAny, {
|
|
7735
7743
|
symbol: string;
|
|
7736
|
-
limit:
|
|
7737
|
-
offset:
|
|
7744
|
+
limit: number;
|
|
7745
|
+
offset: number;
|
|
7738
7746
|
}, {
|
|
7739
7747
|
symbol: string;
|
|
7740
|
-
offset?:
|
|
7741
|
-
limit?:
|
|
7748
|
+
offset?: number | undefined;
|
|
7749
|
+
limit?: number | undefined;
|
|
7742
7750
|
}>;
|
|
7743
7751
|
declare type GetTrades = z.infer<typeof getTradesParser>;
|
|
7744
7752
|
declare const getTradesResponseParser: z.ZodObject<{
|
|
@@ -7769,10 +7777,10 @@ declare const getTradesResponseParser: z.ZodObject<{
|
|
|
7769
7777
|
trx_id: z.ZodString;
|
|
7770
7778
|
}, "strip", z.ZodTypeAny, {
|
|
7771
7779
|
price: number;
|
|
7780
|
+
block_time: string;
|
|
7772
7781
|
market_id: number;
|
|
7773
7782
|
order_side: number;
|
|
7774
7783
|
block_num: string;
|
|
7775
|
-
block_time: string;
|
|
7776
7784
|
trx_id: string;
|
|
7777
7785
|
trade_id: string;
|
|
7778
7786
|
bid_user: string;
|
|
@@ -7793,10 +7801,10 @@ declare const getTradesResponseParser: z.ZodObject<{
|
|
|
7793
7801
|
ask_referrer_fee: number;
|
|
7794
7802
|
}, {
|
|
7795
7803
|
price: number;
|
|
7804
|
+
block_time: string;
|
|
7796
7805
|
market_id: number;
|
|
7797
7806
|
order_side: number;
|
|
7798
7807
|
block_num: string;
|
|
7799
|
-
block_time: string;
|
|
7800
7808
|
trx_id: string;
|
|
7801
7809
|
trade_id: string;
|
|
7802
7810
|
bid_user: string;
|
|
@@ -7819,10 +7827,10 @@ declare const getTradesResponseParser: z.ZodObject<{
|
|
|
7819
7827
|
}, "strip", z.ZodTypeAny, {
|
|
7820
7828
|
data: {
|
|
7821
7829
|
price: number;
|
|
7830
|
+
block_time: string;
|
|
7822
7831
|
market_id: number;
|
|
7823
7832
|
order_side: number;
|
|
7824
7833
|
block_num: string;
|
|
7825
|
-
block_time: string;
|
|
7826
7834
|
trx_id: string;
|
|
7827
7835
|
trade_id: string;
|
|
7828
7836
|
bid_user: string;
|
|
@@ -7846,10 +7854,10 @@ declare const getTradesResponseParser: z.ZodObject<{
|
|
|
7846
7854
|
}, {
|
|
7847
7855
|
data: {
|
|
7848
7856
|
price: number;
|
|
7857
|
+
block_time: string;
|
|
7849
7858
|
market_id: number;
|
|
7850
7859
|
order_side: number;
|
|
7851
7860
|
block_num: string;
|
|
7852
|
-
block_time: string;
|
|
7853
7861
|
trx_id: string;
|
|
7854
7862
|
trade_id: string;
|
|
7855
7863
|
bid_user: string;
|
|
@@ -7875,21 +7883,21 @@ declare type GetTradesResponseParser = z.infer<typeof getTradesResponseParser>;
|
|
|
7875
7883
|
declare const getTradeHistoryParser: z.ZodObject<{
|
|
7876
7884
|
account: z.ZodString;
|
|
7877
7885
|
symbol: z.ZodOptional<z.ZodString>;
|
|
7878
|
-
offset: z.ZodDefault<z.
|
|
7886
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
7879
7887
|
ordinal_order_ids: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>>;
|
|
7880
|
-
limit: z.ZodEffects<z.ZodDefault<z.
|
|
7888
|
+
limit: z.ZodEffects<z.ZodDefault<z.ZodNumber>, number, number | undefined>;
|
|
7881
7889
|
}, "strip", z.ZodTypeAny, {
|
|
7882
7890
|
account: string;
|
|
7883
|
-
limit:
|
|
7884
|
-
offset:
|
|
7891
|
+
limit: number;
|
|
7892
|
+
offset: number;
|
|
7885
7893
|
symbol?: string | undefined;
|
|
7886
7894
|
ordinal_order_ids?: string | string[] | undefined;
|
|
7887
7895
|
}, {
|
|
7888
7896
|
account: string;
|
|
7889
7897
|
symbol?: string | undefined;
|
|
7890
|
-
offset?:
|
|
7898
|
+
offset?: number | undefined;
|
|
7891
7899
|
ordinal_order_ids?: string | string[] | undefined;
|
|
7892
|
-
limit?:
|
|
7900
|
+
limit?: number | undefined;
|
|
7893
7901
|
}>;
|
|
7894
7902
|
declare type GetTradeHistory = z.infer<typeof getTradeHistoryParser>;
|
|
7895
7903
|
declare const getTradeHistoryResponseParser: z.ZodObject<{
|
|
@@ -7921,10 +7929,10 @@ declare const getTradeHistoryResponseParser: z.ZodObject<{
|
|
|
7921
7929
|
trx_id: z.ZodString;
|
|
7922
7930
|
}, "strip", z.ZodTypeAny, {
|
|
7923
7931
|
price: number;
|
|
7932
|
+
block_time: string;
|
|
7924
7933
|
market_id: number;
|
|
7925
7934
|
order_side: number;
|
|
7926
7935
|
block_num: string;
|
|
7927
|
-
block_time: string;
|
|
7928
7936
|
trx_id: string;
|
|
7929
7937
|
trade_id: string;
|
|
7930
7938
|
bid_user: string;
|
|
@@ -7945,10 +7953,10 @@ declare const getTradeHistoryResponseParser: z.ZodObject<{
|
|
|
7945
7953
|
ask_referrer_fee: number;
|
|
7946
7954
|
}, {
|
|
7947
7955
|
price: number;
|
|
7956
|
+
block_time: string;
|
|
7948
7957
|
market_id: number;
|
|
7949
7958
|
order_side: number;
|
|
7950
7959
|
block_num: string;
|
|
7951
|
-
block_time: string;
|
|
7952
7960
|
trx_id: string;
|
|
7953
7961
|
trade_id: string;
|
|
7954
7962
|
bid_user: string;
|
|
@@ -7971,10 +7979,10 @@ declare const getTradeHistoryResponseParser: z.ZodObject<{
|
|
|
7971
7979
|
}, "strip", z.ZodTypeAny, {
|
|
7972
7980
|
data: {
|
|
7973
7981
|
price: number;
|
|
7982
|
+
block_time: string;
|
|
7974
7983
|
market_id: number;
|
|
7975
7984
|
order_side: number;
|
|
7976
7985
|
block_num: string;
|
|
7977
|
-
block_time: string;
|
|
7978
7986
|
trx_id: string;
|
|
7979
7987
|
trade_id: string;
|
|
7980
7988
|
bid_user: string;
|
|
@@ -7999,10 +8007,10 @@ declare const getTradeHistoryResponseParser: z.ZodObject<{
|
|
|
7999
8007
|
}, {
|
|
8000
8008
|
data: {
|
|
8001
8009
|
price: number;
|
|
8010
|
+
block_time: string;
|
|
8002
8011
|
market_id: number;
|
|
8003
8012
|
order_side: number;
|
|
8004
8013
|
block_num: string;
|
|
8005
|
-
block_time: string;
|
|
8006
8014
|
trx_id: string;
|
|
8007
8015
|
trade_id: string;
|
|
8008
8016
|
bid_user: string;
|
|
@@ -8037,15 +8045,15 @@ declare const syncParser: z.ZodObject<{
|
|
|
8037
8045
|
is_master: z.ZodNumber;
|
|
8038
8046
|
last_updated: z.ZodString;
|
|
8039
8047
|
}, "strip", z.ZodTypeAny, {
|
|
8040
|
-
block_num: string;
|
|
8041
8048
|
block_time: string;
|
|
8049
|
+
block_num: string;
|
|
8042
8050
|
sourceid: number;
|
|
8043
8051
|
irreversible: string;
|
|
8044
8052
|
is_master: number;
|
|
8045
8053
|
last_updated: string;
|
|
8046
8054
|
}, {
|
|
8047
|
-
block_num: string;
|
|
8048
8055
|
block_time: string;
|
|
8056
|
+
block_num: string;
|
|
8049
8057
|
sourceid: number;
|
|
8050
8058
|
irreversible: string;
|
|
8051
8059
|
is_master: number;
|
|
@@ -8250,14 +8258,14 @@ declare const dbHistoryTransactionParser: z.ZodObject<{
|
|
|
8250
8258
|
trx_id: z.ZodString;
|
|
8251
8259
|
trace: z.ZodAny;
|
|
8252
8260
|
}, "strip", z.ZodTypeAny, {
|
|
8253
|
-
block_num: string;
|
|
8254
8261
|
block_time: string;
|
|
8262
|
+
block_num: string;
|
|
8255
8263
|
seq: string;
|
|
8256
8264
|
trx_id: string;
|
|
8257
8265
|
trace?: any;
|
|
8258
8266
|
}, {
|
|
8259
|
-
block_num: string;
|
|
8260
8267
|
block_time: string;
|
|
8268
|
+
block_num: string;
|
|
8261
8269
|
seq: string;
|
|
8262
8270
|
trx_id: string;
|
|
8263
8271
|
trace?: any;
|
|
@@ -9394,8 +9402,8 @@ declare const historyTransactionParser: z.ZodObject<{
|
|
|
9394
9402
|
block_timestamp: string;
|
|
9395
9403
|
}>;
|
|
9396
9404
|
}, "strip", z.ZodTypeAny, {
|
|
9397
|
-
block_num: string;
|
|
9398
9405
|
block_time: string;
|
|
9406
|
+
block_num: string;
|
|
9399
9407
|
seq: string;
|
|
9400
9408
|
trx_id: string;
|
|
9401
9409
|
trace: {
|
|
@@ -9468,8 +9476,8 @@ declare const historyTransactionParser: z.ZodObject<{
|
|
|
9468
9476
|
block_timestamp: string;
|
|
9469
9477
|
};
|
|
9470
9478
|
}, {
|
|
9471
|
-
block_num: string;
|
|
9472
9479
|
block_time: string;
|
|
9480
|
+
block_num: string;
|
|
9473
9481
|
seq: string;
|
|
9474
9482
|
trx_id: string;
|
|
9475
9483
|
trace: {
|
|
@@ -10043,8 +10051,8 @@ declare const getHistoryTransactionResponseParser: z.ZodObject<{
|
|
|
10043
10051
|
block_timestamp: string;
|
|
10044
10052
|
}>;
|
|
10045
10053
|
}, "strip", z.ZodTypeAny, {
|
|
10046
|
-
block_num: string;
|
|
10047
10054
|
block_time: string;
|
|
10055
|
+
block_num: string;
|
|
10048
10056
|
seq: string;
|
|
10049
10057
|
trx_id: string;
|
|
10050
10058
|
trace: {
|
|
@@ -10117,8 +10125,8 @@ declare const getHistoryTransactionResponseParser: z.ZodObject<{
|
|
|
10117
10125
|
block_timestamp: string;
|
|
10118
10126
|
};
|
|
10119
10127
|
}, {
|
|
10120
|
-
block_num: string;
|
|
10121
10128
|
block_time: string;
|
|
10129
|
+
block_num: string;
|
|
10122
10130
|
seq: string;
|
|
10123
10131
|
trx_id: string;
|
|
10124
10132
|
trace: {
|
|
@@ -10193,8 +10201,8 @@ declare const getHistoryTransactionResponseParser: z.ZodObject<{
|
|
|
10193
10201
|
}>>;
|
|
10194
10202
|
}, "strip", z.ZodTypeAny, {
|
|
10195
10203
|
data: {
|
|
10196
|
-
block_num: string;
|
|
10197
10204
|
block_time: string;
|
|
10205
|
+
block_num: string;
|
|
10198
10206
|
seq: string;
|
|
10199
10207
|
trx_id: string;
|
|
10200
10208
|
trace: {
|
|
@@ -10269,8 +10277,8 @@ declare const getHistoryTransactionResponseParser: z.ZodObject<{
|
|
|
10269
10277
|
} | null;
|
|
10270
10278
|
}, {
|
|
10271
10279
|
data: {
|
|
10272
|
-
block_num: string;
|
|
10273
10280
|
block_time: string;
|
|
10281
|
+
block_num: string;
|
|
10274
10282
|
seq: string;
|
|
10275
10283
|
trx_id: string;
|
|
10276
10284
|
trace: {
|
package/dist/index.js
CHANGED
|
@@ -1896,7 +1896,8 @@ var wrapParser = z10.object({
|
|
|
1896
1896
|
|
|
1897
1897
|
// src/parsers/dex.ts
|
|
1898
1898
|
var z11 = __toESM(require("zod"));
|
|
1899
|
-
var createLimit = (
|
|
1899
|
+
var createLimit = (base, max) => z11.coerce.number().default(base).refine((n) => +n > 0 && +n <= max, `Limit must be between 0 and ${max}`);
|
|
1900
|
+
var createOffset = (base) => z11.coerce.number().default(base);
|
|
1900
1901
|
var ohlcvParser = z11.object({
|
|
1901
1902
|
time: z11.number(),
|
|
1902
1903
|
open: z11.number(),
|
|
@@ -1919,6 +1920,7 @@ var getOhlcvResponseParser = z11.object({
|
|
|
1919
1920
|
data: z11.array(ohlcvParser)
|
|
1920
1921
|
});
|
|
1921
1922
|
var openOrderParser = z11.object({
|
|
1923
|
+
block_time: z11.string(),
|
|
1922
1924
|
order_id: z11.string(),
|
|
1923
1925
|
ordinal_order_id: z11.string(),
|
|
1924
1926
|
market_id: z11.number(),
|
|
@@ -1962,7 +1964,7 @@ var orderHistoryParser = z11.object({
|
|
|
1962
1964
|
var getOpenOrdersParser = z11.object({
|
|
1963
1965
|
account: z11.string(),
|
|
1964
1966
|
symbol: z11.string().optional(),
|
|
1965
|
-
offset:
|
|
1967
|
+
offset: createOffset(0),
|
|
1966
1968
|
limit: createLimit(100, 250),
|
|
1967
1969
|
ordinal_order_ids: z11.array(z11.string()).or(z11.string()).optional()
|
|
1968
1970
|
});
|
|
@@ -1974,7 +1976,7 @@ var getOpenOrdersResponseParser = z11.object({
|
|
|
1974
1976
|
var getOrderHistoryParser = z11.object({
|
|
1975
1977
|
account: z11.string(),
|
|
1976
1978
|
symbol: z11.string().optional(),
|
|
1977
|
-
offset:
|
|
1979
|
+
offset: createOffset(0),
|
|
1978
1980
|
limit: createLimit(100, 250),
|
|
1979
1981
|
ordinal_order_ids: z11.array(z11.string()).or(z11.string()).optional(),
|
|
1980
1982
|
trx_id: z11.string().optional(),
|
|
@@ -2128,7 +2130,7 @@ var tradeParser = z11.object({
|
|
|
2128
2130
|
});
|
|
2129
2131
|
var getTradesParser = z11.object({
|
|
2130
2132
|
symbol: z11.string(),
|
|
2131
|
-
offset:
|
|
2133
|
+
offset: createOffset(0),
|
|
2132
2134
|
limit: createLimit(100, 250)
|
|
2133
2135
|
});
|
|
2134
2136
|
var getTradesResponseParser = z11.object({
|
|
@@ -2138,7 +2140,7 @@ var getTradesResponseParser = z11.object({
|
|
|
2138
2140
|
var getTradeHistoryParser = z11.object({
|
|
2139
2141
|
account: z11.string(),
|
|
2140
2142
|
symbol: z11.string().optional(),
|
|
2141
|
-
offset:
|
|
2143
|
+
offset: createOffset(0),
|
|
2142
2144
|
ordinal_order_ids: z11.array(z11.string()).or(z11.string()).optional(),
|
|
2143
2145
|
limit: createLimit(100, 250)
|
|
2144
2146
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1753,7 +1753,8 @@ var wrapParser = z10.object({
|
|
|
1753
1753
|
|
|
1754
1754
|
// src/parsers/dex.ts
|
|
1755
1755
|
import * as z11 from "zod";
|
|
1756
|
-
var createLimit = (
|
|
1756
|
+
var createLimit = (base, max) => z11.coerce.number().default(base).refine((n) => +n > 0 && +n <= max, `Limit must be between 0 and ${max}`);
|
|
1757
|
+
var createOffset = (base) => z11.coerce.number().default(base);
|
|
1757
1758
|
var ohlcvParser = z11.object({
|
|
1758
1759
|
time: z11.number(),
|
|
1759
1760
|
open: z11.number(),
|
|
@@ -1776,6 +1777,7 @@ var getOhlcvResponseParser = z11.object({
|
|
|
1776
1777
|
data: z11.array(ohlcvParser)
|
|
1777
1778
|
});
|
|
1778
1779
|
var openOrderParser = z11.object({
|
|
1780
|
+
block_time: z11.string(),
|
|
1779
1781
|
order_id: z11.string(),
|
|
1780
1782
|
ordinal_order_id: z11.string(),
|
|
1781
1783
|
market_id: z11.number(),
|
|
@@ -1819,7 +1821,7 @@ var orderHistoryParser = z11.object({
|
|
|
1819
1821
|
var getOpenOrdersParser = z11.object({
|
|
1820
1822
|
account: z11.string(),
|
|
1821
1823
|
symbol: z11.string().optional(),
|
|
1822
|
-
offset:
|
|
1824
|
+
offset: createOffset(0),
|
|
1823
1825
|
limit: createLimit(100, 250),
|
|
1824
1826
|
ordinal_order_ids: z11.array(z11.string()).or(z11.string()).optional()
|
|
1825
1827
|
});
|
|
@@ -1831,7 +1833,7 @@ var getOpenOrdersResponseParser = z11.object({
|
|
|
1831
1833
|
var getOrderHistoryParser = z11.object({
|
|
1832
1834
|
account: z11.string(),
|
|
1833
1835
|
symbol: z11.string().optional(),
|
|
1834
|
-
offset:
|
|
1836
|
+
offset: createOffset(0),
|
|
1835
1837
|
limit: createLimit(100, 250),
|
|
1836
1838
|
ordinal_order_ids: z11.array(z11.string()).or(z11.string()).optional(),
|
|
1837
1839
|
trx_id: z11.string().optional(),
|
|
@@ -1985,7 +1987,7 @@ var tradeParser = z11.object({
|
|
|
1985
1987
|
});
|
|
1986
1988
|
var getTradesParser = z11.object({
|
|
1987
1989
|
symbol: z11.string(),
|
|
1988
|
-
offset:
|
|
1990
|
+
offset: createOffset(0),
|
|
1989
1991
|
limit: createLimit(100, 250)
|
|
1990
1992
|
});
|
|
1991
1993
|
var getTradesResponseParser = z11.object({
|
|
@@ -1995,7 +1997,7 @@ var getTradesResponseParser = z11.object({
|
|
|
1995
1997
|
var getTradeHistoryParser = z11.object({
|
|
1996
1998
|
account: z11.string(),
|
|
1997
1999
|
symbol: z11.string().optional(),
|
|
1998
|
-
offset:
|
|
2000
|
+
offset: createOffset(0),
|
|
1999
2001
|
ordinal_order_ids: z11.array(z11.string()).or(z11.string()).optional(),
|
|
2000
2002
|
limit: createLimit(100, 250)
|
|
2001
2003
|
});
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
|
-
"version": "0.2.
|
|
8
|
+
"version": "0.2.122",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"typings": "dist/index.d.ts",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"resolutions": {
|
|
41
41
|
"typescript": "4.5"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "412005a5fd9d671655384c5df74101922a1458cb"
|
|
44
44
|
}
|
package/src/parsers/dex.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
import { accountRamDeltaParser, authorizationParser } from "./base";
|
|
3
3
|
|
|
4
|
-
const createLimit = (
|
|
5
|
-
z
|
|
6
|
-
.
|
|
7
|
-
.default(
|
|
4
|
+
const createLimit = (base: number, max: number) =>
|
|
5
|
+
z.coerce
|
|
6
|
+
.number()
|
|
7
|
+
.default(base)
|
|
8
8
|
.refine((n) => +n > 0 && +n <= max, `Limit must be between 0 and ${max}`);
|
|
9
9
|
|
|
10
|
+
const createOffset = (base: number) => z.coerce.number().default(base);
|
|
11
|
+
|
|
10
12
|
/**
|
|
11
13
|
* OHLCV
|
|
12
14
|
*/
|
|
@@ -41,6 +43,7 @@ export type GetOHLCVResponse = z.infer<typeof getOhlcvResponseParser>;
|
|
|
41
43
|
* Order History
|
|
42
44
|
*/
|
|
43
45
|
export const openOrderParser = z.object({
|
|
46
|
+
block_time: z.string(),
|
|
44
47
|
order_id: z.string(),
|
|
45
48
|
ordinal_order_id: z.string(),
|
|
46
49
|
market_id: z.number(),
|
|
@@ -88,7 +91,7 @@ export type OrderHistory = z.infer<typeof orderHistoryParser>;
|
|
|
88
91
|
export const getOpenOrdersParser = z.object({
|
|
89
92
|
account: z.string(),
|
|
90
93
|
symbol: z.string().optional(),
|
|
91
|
-
offset:
|
|
94
|
+
offset: createOffset(0),
|
|
92
95
|
limit: createLimit(100, 250),
|
|
93
96
|
ordinal_order_ids: z
|
|
94
97
|
.array(z.string())
|
|
@@ -107,7 +110,7 @@ export type GetOpenOrdersResponse = z.infer<typeof getOpenOrdersResponseParser>;
|
|
|
107
110
|
export const getOrderHistoryParser = z.object({
|
|
108
111
|
account: z.string(),
|
|
109
112
|
symbol: z.string().optional(),
|
|
110
|
-
offset:
|
|
113
|
+
offset: createOffset(0),
|
|
111
114
|
limit: createLimit(100, 250),
|
|
112
115
|
ordinal_order_ids: z
|
|
113
116
|
.array(z.string())
|
|
@@ -323,7 +326,7 @@ export type Trade = z.infer<typeof tradeParser>;
|
|
|
323
326
|
|
|
324
327
|
export const getTradesParser = z.object({
|
|
325
328
|
symbol: z.string(),
|
|
326
|
-
offset:
|
|
329
|
+
offset: createOffset(0),
|
|
327
330
|
limit: createLimit(100, 250),
|
|
328
331
|
});
|
|
329
332
|
export type GetTrades = z.infer<typeof getTradesParser>;
|
|
@@ -337,7 +340,7 @@ export type GetTradesResponseParser = z.infer<typeof getTradesResponseParser>;
|
|
|
337
340
|
export const getTradeHistoryParser = z.object({
|
|
338
341
|
account: z.string(),
|
|
339
342
|
symbol: z.string().optional(),
|
|
340
|
-
offset:
|
|
343
|
+
offset: createOffset(0),
|
|
341
344
|
ordinal_order_ids: z
|
|
342
345
|
.array(z.string())
|
|
343
346
|
.or(z.string())
|