zklighter-perps 1.0.194 → 1.0.196

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.
@@ -58,6 +58,7 @@ models/DetailedCandlestick.ts
58
58
  models/EnrichedTx.ts
59
59
  models/ExchangeMetric.ts
60
60
  models/ExchangeStats.ts
61
+ models/ExecuteStat.ts
61
62
  models/ExportData.ts
62
63
  models/Funding.ts
63
64
  models/FundingRate.ts
@@ -123,6 +124,7 @@ models/ReqGetCandles.ts
123
124
  models/ReqGetCandlesticks.ts
124
125
  models/ReqGetDepositHistory.ts
125
126
  models/ReqGetExchangeMetrics.ts
127
+ models/ReqGetExecuteStats.ts
126
128
  models/ReqGetFastWithdrawInfo.ts
127
129
  models/ReqGetFundings.ts
128
130
  models/ReqGetGeckoOrderbook.ts
@@ -153,6 +155,7 @@ models/RespChangeAccountTier.ts
153
155
  models/RespGetApiTokens.ts
154
156
  models/RespGetBridgesByL1Addr.ts
155
157
  models/RespGetExchangeMetrics.ts
158
+ models/RespGetExecuteStats.ts
156
159
  models/RespGetFastBridgeInfo.ts
157
160
  models/RespGetFastwithdrawalInfo.ts
158
161
  models/RespGetIsNextBridgeFast.ts
@@ -169,6 +172,7 @@ models/RiskInfo.ts
169
172
  models/RiskParameters.ts
170
173
  models/SharePrice.ts
171
174
  models/SimpleOrder.ts
175
+ models/SlippageResult.ts
172
176
  models/SpotMarketStats.ts
173
177
  models/SpotOrderBookDetail.ts
174
178
  models/Status.ts
package/apis/OrderApi.ts CHANGED
@@ -23,6 +23,7 @@ import type {
23
23
  OrderBooks,
24
24
  Orders,
25
25
  RespGetExchangeMetrics,
26
+ RespGetExecuteStats,
26
27
  ResultCode,
27
28
  Trades,
28
29
  } from '../models/index';
@@ -43,6 +44,8 @@ import {
43
44
  OrdersToJSON,
44
45
  RespGetExchangeMetricsFromJSON,
45
46
  RespGetExchangeMetricsToJSON,
47
+ RespGetExecuteStatsFromJSON,
48
+ RespGetExecuteStatsToJSON,
46
49
  ResultCodeFromJSON,
47
50
  ResultCodeToJSON,
48
51
  TradesFromJSON,
@@ -86,6 +89,10 @@ export interface ExchangeMetricsRequest {
86
89
  value?: string;
87
90
  }
88
91
 
92
+ export interface ExecuteStatsRequest {
93
+ period: ExecuteStatsPeriodEnum;
94
+ }
95
+
89
96
  export interface OrderBookDetailsRequest {
90
97
  market_id?: number;
91
98
  filter?: OrderBookDetailsFilterEnum;
@@ -433,6 +440,45 @@ export class OrderApi extends runtime.BaseAPI {
433
440
  return await response.value();
434
441
  }
435
442
 
443
+ /**
444
+ * Get execute stats
445
+ * executeStats
446
+ */
447
+ async executeStatsRaw(requestParameters: ExecuteStatsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespGetExecuteStats>> {
448
+ if (requestParameters['period'] == null) {
449
+ throw new runtime.RequiredError(
450
+ 'period',
451
+ 'Required parameter "period" was null or undefined when calling executeStats().'
452
+ );
453
+ }
454
+
455
+ const queryParameters: any = {};
456
+
457
+ if (requestParameters['period'] != null) {
458
+ queryParameters['period'] = requestParameters['period'];
459
+ }
460
+
461
+ const headerParameters: runtime.HTTPHeaders = {};
462
+
463
+ const response = await this.request({
464
+ path: `/api/v1/executeStats`,
465
+ method: 'GET',
466
+ headers: headerParameters,
467
+ query: queryParameters,
468
+ }, initOverrides);
469
+
470
+ return new runtime.JSONApiResponse(response, (jsonValue) => RespGetExecuteStatsFromJSON(jsonValue));
471
+ }
472
+
473
+ /**
474
+ * Get execute stats
475
+ * executeStats
476
+ */
477
+ async executeStats(requestParameters: ExecuteStatsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespGetExecuteStats> {
478
+ const response = await this.executeStatsRaw(requestParameters, initOverrides);
479
+ return await response.value();
480
+ }
481
+
436
482
  /**
437
483
  * Get order books metadata
438
484
  * orderBookDetails
@@ -751,6 +797,18 @@ export const ExchangeMetricsFilterEnum = {
751
797
  ByMarket: 'byMarket'
752
798
  } as const;
753
799
  export type ExchangeMetricsFilterEnum = typeof ExchangeMetricsFilterEnum[keyof typeof ExchangeMetricsFilterEnum];
800
+ /**
801
+ * @export
802
+ */
803
+ export const ExecuteStatsPeriodEnum = {
804
+ D: 'd',
805
+ W: 'w',
806
+ M: 'm',
807
+ Q: 'q',
808
+ Y: 'y',
809
+ All: 'all'
810
+ } as const;
811
+ export type ExecuteStatsPeriodEnum = typeof ExecuteStatsPeriodEnum[keyof typeof ExecuteStatsPeriodEnum];
754
812
  /**
755
813
  * @export
756
814
  */
@@ -0,0 +1,77 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ *
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document:
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { SlippageResult } from './SlippageResult';
17
+ import {
18
+ SlippageResultFromJSON,
19
+ SlippageResultFromJSONTyped,
20
+ SlippageResultToJSON,
21
+ } from './SlippageResult';
22
+
23
+ /**
24
+ *
25
+ * @export
26
+ * @interface ExecuteStat
27
+ */
28
+ export interface ExecuteStat {
29
+ /**
30
+ *
31
+ * @type {number}
32
+ * @memberof ExecuteStat
33
+ */
34
+ timestamp: number;
35
+ /**
36
+ *
37
+ * @type {Array<SlippageResult>}
38
+ * @memberof ExecuteStat
39
+ */
40
+ slippage: Array<SlippageResult>;
41
+ }
42
+
43
+ /**
44
+ * Check if a given object implements the ExecuteStat interface.
45
+ */
46
+ export function instanceOfExecuteStat(value: object): value is ExecuteStat {
47
+ if (!('timestamp' in value) || value['timestamp'] === undefined) return false;
48
+ if (!('slippage' in value) || value['slippage'] === undefined) return false;
49
+ return true;
50
+ }
51
+
52
+ export function ExecuteStatFromJSON(json: any): ExecuteStat {
53
+ return ExecuteStatFromJSONTyped(json, false);
54
+ }
55
+
56
+ export function ExecuteStatFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExecuteStat {
57
+ if (json == null) {
58
+ return json;
59
+ }
60
+ return {
61
+
62
+ 'timestamp': json['timestamp'],
63
+ 'slippage': ((json['slippage'] as Array<any>).map(SlippageResultFromJSON)),
64
+ };
65
+ }
66
+
67
+ export function ExecuteStatToJSON(value?: ExecuteStat | null): any {
68
+ if (value == null) {
69
+ return value;
70
+ }
71
+ return {
72
+
73
+ 'timestamp': value['timestamp'],
74
+ 'slippage': ((value['slippage'] as Array<any>).map(SlippageResultToJSON)),
75
+ };
76
+ }
77
+
@@ -0,0 +1,76 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ *
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document:
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface ReqGetExecuteStats
20
+ */
21
+ export interface ReqGetExecuteStats {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ReqGetExecuteStats
26
+ */
27
+ period: ReqGetExecuteStatsPeriodEnum;
28
+ }
29
+
30
+
31
+ /**
32
+ * @export
33
+ */
34
+ export const ReqGetExecuteStatsPeriodEnum = {
35
+ D: 'd',
36
+ W: 'w',
37
+ M: 'm',
38
+ Q: 'q',
39
+ Y: 'y',
40
+ All: 'all'
41
+ } as const;
42
+ export type ReqGetExecuteStatsPeriodEnum = typeof ReqGetExecuteStatsPeriodEnum[keyof typeof ReqGetExecuteStatsPeriodEnum];
43
+
44
+
45
+ /**
46
+ * Check if a given object implements the ReqGetExecuteStats interface.
47
+ */
48
+ export function instanceOfReqGetExecuteStats(value: object): value is ReqGetExecuteStats {
49
+ if (!('period' in value) || value['period'] === undefined) return false;
50
+ return true;
51
+ }
52
+
53
+ export function ReqGetExecuteStatsFromJSON(json: any): ReqGetExecuteStats {
54
+ return ReqGetExecuteStatsFromJSONTyped(json, false);
55
+ }
56
+
57
+ export function ReqGetExecuteStatsFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReqGetExecuteStats {
58
+ if (json == null) {
59
+ return json;
60
+ }
61
+ return {
62
+
63
+ 'period': json['period'],
64
+ };
65
+ }
66
+
67
+ export function ReqGetExecuteStatsToJSON(value?: ReqGetExecuteStats | null): any {
68
+ if (value == null) {
69
+ return value;
70
+ }
71
+ return {
72
+
73
+ 'period': value['period'],
74
+ };
75
+ }
76
+
@@ -0,0 +1,92 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ *
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document:
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { ExecuteStat } from './ExecuteStat';
17
+ import {
18
+ ExecuteStatFromJSON,
19
+ ExecuteStatFromJSONTyped,
20
+ ExecuteStatToJSON,
21
+ } from './ExecuteStat';
22
+
23
+ /**
24
+ *
25
+ * @export
26
+ * @interface RespGetExecuteStats
27
+ */
28
+ export interface RespGetExecuteStats {
29
+ /**
30
+ *
31
+ * @type {string}
32
+ * @memberof RespGetExecuteStats
33
+ */
34
+ period: RespGetExecuteStatsPeriodEnum;
35
+ /**
36
+ *
37
+ * @type {Array<ExecuteStat>}
38
+ * @memberof RespGetExecuteStats
39
+ */
40
+ result: Array<ExecuteStat>;
41
+ }
42
+
43
+
44
+ /**
45
+ * @export
46
+ */
47
+ export const RespGetExecuteStatsPeriodEnum = {
48
+ D: 'd',
49
+ W: 'w',
50
+ M: 'm',
51
+ Q: 'q',
52
+ Y: 'y',
53
+ All: 'all'
54
+ } as const;
55
+ export type RespGetExecuteStatsPeriodEnum = typeof RespGetExecuteStatsPeriodEnum[keyof typeof RespGetExecuteStatsPeriodEnum];
56
+
57
+
58
+ /**
59
+ * Check if a given object implements the RespGetExecuteStats interface.
60
+ */
61
+ export function instanceOfRespGetExecuteStats(value: object): value is RespGetExecuteStats {
62
+ if (!('period' in value) || value['period'] === undefined) return false;
63
+ if (!('result' in value) || value['result'] === undefined) return false;
64
+ return true;
65
+ }
66
+
67
+ export function RespGetExecuteStatsFromJSON(json: any): RespGetExecuteStats {
68
+ return RespGetExecuteStatsFromJSONTyped(json, false);
69
+ }
70
+
71
+ export function RespGetExecuteStatsFromJSONTyped(json: any, ignoreDiscriminator: boolean): RespGetExecuteStats {
72
+ if (json == null) {
73
+ return json;
74
+ }
75
+ return {
76
+
77
+ 'period': json['period'],
78
+ 'result': ((json['result'] as Array<any>).map(ExecuteStatFromJSON)),
79
+ };
80
+ }
81
+
82
+ export function RespGetExecuteStatsToJSON(value?: RespGetExecuteStats | null): any {
83
+ if (value == null) {
84
+ return value;
85
+ }
86
+ return {
87
+
88
+ 'period': value['period'],
89
+ 'result': ((value['result'] as Array<any>).map(ExecuteStatToJSON)),
90
+ };
91
+ }
92
+
@@ -0,0 +1,97 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ *
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document:
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface SlippageResult
20
+ */
21
+ export interface SlippageResult {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof SlippageResult
26
+ */
27
+ exchange: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof SlippageResult
32
+ */
33
+ market: string;
34
+ /**
35
+ *
36
+ * @type {number}
37
+ * @memberof SlippageResult
38
+ */
39
+ size_usd: number;
40
+ /**
41
+ *
42
+ * @type {number}
43
+ * @memberof SlippageResult
44
+ */
45
+ avg_slippage: number;
46
+ /**
47
+ *
48
+ * @type {number}
49
+ * @memberof SlippageResult
50
+ */
51
+ data_count: number;
52
+ }
53
+
54
+ /**
55
+ * Check if a given object implements the SlippageResult interface.
56
+ */
57
+ export function instanceOfSlippageResult(value: object): value is SlippageResult {
58
+ if (!('exchange' in value) || value['exchange'] === undefined) return false;
59
+ if (!('market' in value) || value['market'] === undefined) return false;
60
+ if (!('size_usd' in value) || value['size_usd'] === undefined) return false;
61
+ if (!('avg_slippage' in value) || value['avg_slippage'] === undefined) return false;
62
+ if (!('data_count' in value) || value['data_count'] === undefined) return false;
63
+ return true;
64
+ }
65
+
66
+ export function SlippageResultFromJSON(json: any): SlippageResult {
67
+ return SlippageResultFromJSONTyped(json, false);
68
+ }
69
+
70
+ export function SlippageResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): SlippageResult {
71
+ if (json == null) {
72
+ return json;
73
+ }
74
+ return {
75
+
76
+ 'exchange': json['exchange'],
77
+ 'market': json['market'],
78
+ 'size_usd': json['size_usd'],
79
+ 'avg_slippage': json['avg_slippage'],
80
+ 'data_count': json['data_count'],
81
+ };
82
+ }
83
+
84
+ export function SlippageResultToJSON(value?: SlippageResult | null): any {
85
+ if (value == null) {
86
+ return value;
87
+ }
88
+ return {
89
+
90
+ 'exchange': value['exchange'],
91
+ 'market': value['market'],
92
+ 'size_usd': value['size_usd'],
93
+ 'avg_slippage': value['avg_slippage'],
94
+ 'data_count': value['data_count'],
95
+ };
96
+ }
97
+
package/models/index.ts CHANGED
@@ -44,6 +44,7 @@ export * from './DetailedCandlestick';
44
44
  export * from './EnrichedTx';
45
45
  export * from './ExchangeMetric';
46
46
  export * from './ExchangeStats';
47
+ export * from './ExecuteStat';
47
48
  export * from './ExportData';
48
49
  export * from './Funding';
49
50
  export * from './FundingRate';
@@ -109,6 +110,7 @@ export * from './ReqGetCandles';
109
110
  export * from './ReqGetCandlesticks';
110
111
  export * from './ReqGetDepositHistory';
111
112
  export * from './ReqGetExchangeMetrics';
113
+ export * from './ReqGetExecuteStats';
112
114
  export * from './ReqGetFastWithdrawInfo';
113
115
  export * from './ReqGetFundings';
114
116
  export * from './ReqGetGeckoOrderbook';
@@ -139,6 +141,7 @@ export * from './RespChangeAccountTier';
139
141
  export * from './RespGetApiTokens';
140
142
  export * from './RespGetBridgesByL1Addr';
141
143
  export * from './RespGetExchangeMetrics';
144
+ export * from './RespGetExecuteStats';
142
145
  export * from './RespGetFastBridgeInfo';
143
146
  export * from './RespGetFastwithdrawalInfo';
144
147
  export * from './RespGetIsNextBridgeFast';
@@ -155,6 +158,7 @@ export * from './RiskInfo';
155
158
  export * from './RiskParameters';
156
159
  export * from './SharePrice';
157
160
  export * from './SimpleOrder';
161
+ export * from './SlippageResult';
158
162
  export * from './SpotMarketStats';
159
163
  export * from './SpotOrderBookDetail';
160
164
  export * from './Status';
package/openapi.json CHANGED
@@ -1379,6 +1379,49 @@
1379
1379
  "description": "Get exchange stats"
1380
1380
  }
1381
1381
  },
1382
+ "/api/v1/executeStats": {
1383
+ "get": {
1384
+ "summary": "executeStats",
1385
+ "operationId": "executeStats",
1386
+ "responses": {
1387
+ "200": {
1388
+ "description": "A successful response.",
1389
+ "schema": {
1390
+ "$ref": "#/definitions/RespGetExecuteStats"
1391
+ }
1392
+ },
1393
+ "400": {
1394
+ "description": "Bad request",
1395
+ "schema": {
1396
+ "$ref": "#/definitions/ResultCode"
1397
+ }
1398
+ }
1399
+ },
1400
+ "parameters": [
1401
+ {
1402
+ "name": "period",
1403
+ "in": "query",
1404
+ "required": true,
1405
+ "type": "string",
1406
+ "enum": [
1407
+ "d",
1408
+ "w",
1409
+ "m",
1410
+ "q",
1411
+ "y",
1412
+ "all"
1413
+ ]
1414
+ }
1415
+ ],
1416
+ "tags": [
1417
+ "order"
1418
+ ],
1419
+ "consumes": [
1420
+ "multipart/form-data"
1421
+ ],
1422
+ "description": "Get execute stats"
1423
+ }
1424
+ },
1382
1425
  "/api/v1/export": {
1383
1426
  "get": {
1384
1427
  "summary": "export",
@@ -5653,6 +5696,27 @@
5653
5696
  "daily_trades_count"
5654
5697
  ]
5655
5698
  },
5699
+ "ExecuteStat": {
5700
+ "type": "object",
5701
+ "properties": {
5702
+ "timestamp": {
5703
+ "type": "integer",
5704
+ "format": "int64",
5705
+ "example": "1640995200"
5706
+ },
5707
+ "slippage": {
5708
+ "type": "array",
5709
+ "items": {
5710
+ "$ref": "#/definitions/SlippageResult"
5711
+ }
5712
+ }
5713
+ },
5714
+ "title": "ExecuteStat",
5715
+ "required": [
5716
+ "timestamp",
5717
+ "slippage"
5718
+ ]
5719
+ },
5656
5720
  "ExportData": {
5657
5721
  "type": "object",
5658
5722
  "properties": {
@@ -8505,6 +8569,26 @@
8505
8569
  "type": "object",
8506
8570
  "title": "ReqGetExchangeStats"
8507
8571
  },
8572
+ "ReqGetExecuteStats": {
8573
+ "type": "object",
8574
+ "properties": {
8575
+ "period": {
8576
+ "type": "string",
8577
+ "enum": [
8578
+ "d",
8579
+ "w",
8580
+ "m",
8581
+ "q",
8582
+ "y",
8583
+ "all"
8584
+ ]
8585
+ }
8586
+ },
8587
+ "title": "ReqGetExecuteStats",
8588
+ "required": [
8589
+ "period"
8590
+ ]
8591
+ },
8508
8592
  "ReqGetFastWithdrawInfo": {
8509
8593
  "type": "object",
8510
8594
  "properties": {
@@ -9423,6 +9507,33 @@
9423
9507
  "metrics"
9424
9508
  ]
9425
9509
  },
9510
+ "RespGetExecuteStats": {
9511
+ "type": "object",
9512
+ "properties": {
9513
+ "period": {
9514
+ "type": "string",
9515
+ "enum": [
9516
+ "d",
9517
+ "w",
9518
+ "m",
9519
+ "q",
9520
+ "y",
9521
+ "all"
9522
+ ]
9523
+ },
9524
+ "result": {
9525
+ "type": "array",
9526
+ "items": {
9527
+ "$ref": "#/definitions/ExecuteStat"
9528
+ }
9529
+ }
9530
+ },
9531
+ "title": "RespGetExecuteStats",
9532
+ "required": [
9533
+ "period",
9534
+ "result"
9535
+ ]
9536
+ },
9426
9537
  "RespGetFastBridgeInfo": {
9427
9538
  "type": "object",
9428
9539
  "properties": {
@@ -9870,6 +9981,42 @@
9870
9981
  "transaction_time"
9871
9982
  ]
9872
9983
  },
9984
+ "SlippageResult": {
9985
+ "type": "object",
9986
+ "properties": {
9987
+ "exchange": {
9988
+ "type": "string",
9989
+ "example": "lighter"
9990
+ },
9991
+ "market": {
9992
+ "type": "string",
9993
+ "example": "ETH"
9994
+ },
9995
+ "size_usd": {
9996
+ "type": "integer",
9997
+ "format": "int64",
9998
+ "example": "1000"
9999
+ },
10000
+ "avg_slippage": {
10001
+ "type": "number",
10002
+ "format": "double",
10003
+ "example": "0.5"
10004
+ },
10005
+ "data_count": {
10006
+ "type": "integer",
10007
+ "format": "int64",
10008
+ "example": "100"
10009
+ }
10010
+ },
10011
+ "title": "SlippageResult",
10012
+ "required": [
10013
+ "exchange",
10014
+ "market",
10015
+ "size_usd",
10016
+ "avg_slippage",
10017
+ "data_count"
10018
+ ]
10019
+ },
9873
10020
  "SpotMarketStats": {
9874
10021
  "type": "object",
9875
10022
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.194",
3
+ "version": "1.0.196",
4
4
  "description": "zkLighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {