zklighter-perps 1.0.124 → 1.0.126

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.
@@ -44,6 +44,7 @@ models/DetailedAccounts.ts
44
44
  models/DetailedCandlestick.ts
45
45
  models/EnrichedTx.ts
46
46
  models/ExchangeStats.ts
47
+ models/ExportData.ts
47
48
  models/Funding.ts
48
49
  models/FundingRate.ts
49
50
  models/FundingRates.ts
@@ -81,6 +82,7 @@ models/ReferralCode.ts
81
82
  models/ReferralPointEntry.ts
82
83
  models/ReferralPoints.ts
83
84
  models/ReqDoFaucet.ts
85
+ models/ReqExportData.ts
84
86
  models/ReqGetAccount.ts
85
87
  models/ReqGetAccountActiveOrders.ts
86
88
  models/ReqGetAccountApiKeys.ts
package/apis/OrderApi.ts CHANGED
@@ -16,6 +16,7 @@
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
18
  ExchangeStats,
19
+ ExportData,
19
20
  OrderBookDetails,
20
21
  OrderBookOrders,
21
22
  OrderBooks,
@@ -26,6 +27,8 @@ import type {
26
27
  import {
27
28
  ExchangeStatsFromJSON,
28
29
  ExchangeStatsToJSON,
30
+ ExportDataFromJSON,
31
+ ExportDataToJSON,
29
32
  OrderBookDetailsFromJSON,
30
33
  OrderBookDetailsToJSON,
31
34
  OrderBookOrdersFromJSON,
@@ -40,6 +43,14 @@ import {
40
43
  TradesToJSON,
41
44
  } from '../models/index';
42
45
 
46
+ export interface ExportRequest {
47
+ type: ExportTypeEnum;
48
+ authorization?: string;
49
+ auth?: string;
50
+ account_index?: number;
51
+ market_id?: number;
52
+ }
53
+
43
54
  export interface AccountActiveOrdersRequest {
44
55
  account_index: number;
45
56
  market_id: number;
@@ -95,6 +106,61 @@ export interface TradesRequest {
95
106
  */
96
107
  export class OrderApi extends runtime.BaseAPI {
97
108
 
109
+ /**
110
+ * Export data
111
+ * export
112
+ */
113
+ async _exportRaw(requestParameters: ExportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ExportData>> {
114
+ if (requestParameters['type'] == null) {
115
+ throw new runtime.RequiredError(
116
+ 'type',
117
+ 'Required parameter "type" was null or undefined when calling _export().'
118
+ );
119
+ }
120
+
121
+ const queryParameters: any = {};
122
+
123
+ if (requestParameters['auth'] != null) {
124
+ queryParameters['auth'] = requestParameters['auth'];
125
+ }
126
+
127
+ if (requestParameters['account_index'] != null) {
128
+ queryParameters['account_index'] = requestParameters['account_index'];
129
+ }
130
+
131
+ if (requestParameters['market_id'] != null) {
132
+ queryParameters['market_id'] = requestParameters['market_id'];
133
+ }
134
+
135
+ if (requestParameters['type'] != null) {
136
+ queryParameters['type'] = requestParameters['type'];
137
+ }
138
+
139
+ const headerParameters: runtime.HTTPHeaders = {};
140
+
141
+ if (requestParameters['authorization'] != null) {
142
+ headerParameters['authorization'] = String(requestParameters['authorization']);
143
+ }
144
+
145
+ const response = await this.request({
146
+ path: `/api/v1/export`,
147
+ method: 'GET',
148
+ headers: headerParameters,
149
+ query: queryParameters,
150
+ }, initOverrides);
151
+
152
+ return new runtime.JSONApiResponse(response, (jsonValue) => ExportDataFromJSON(jsonValue));
153
+ }
154
+
155
+ /**
156
+ * Export data
157
+ * export
158
+ */
159
+ async _export(requestParameters: ExportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ExportData> {
160
+ const response = await this._exportRaw(requestParameters, initOverrides);
161
+ return await response.value();
162
+ }
163
+
98
164
  /**
99
165
  * Get account active orders. `auth` can be generated using the SDK.
100
166
  * accountActiveOrders
@@ -507,6 +573,14 @@ export class OrderApi extends runtime.BaseAPI {
507
573
 
508
574
  }
509
575
 
576
+ /**
577
+ * @export
578
+ */
579
+ export const ExportTypeEnum = {
580
+ Funding: 'funding',
581
+ Trade: 'trade'
582
+ } as const;
583
+ export type ExportTypeEnum = typeof ExportTypeEnum[keyof typeof ExportTypeEnum];
510
584
  /**
511
585
  * @export
512
586
  */
@@ -0,0 +1,78 @@
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 ExportData
20
+ */
21
+ export interface ExportData {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof ExportData
26
+ */
27
+ code: number;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof ExportData
32
+ */
33
+ message?: string;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof ExportData
38
+ */
39
+ data_url: string;
40
+ }
41
+
42
+ /**
43
+ * Check if a given object implements the ExportData interface.
44
+ */
45
+ export function instanceOfExportData(value: object): value is ExportData {
46
+ if (!('code' in value) || value['code'] === undefined) return false;
47
+ if (!('data_url' in value) || value['data_url'] === undefined) return false;
48
+ return true;
49
+ }
50
+
51
+ export function ExportDataFromJSON(json: any): ExportData {
52
+ return ExportDataFromJSONTyped(json, false);
53
+ }
54
+
55
+ export function ExportDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExportData {
56
+ if (json == null) {
57
+ return json;
58
+ }
59
+ return {
60
+
61
+ 'code': json['code'],
62
+ 'message': json['message'] == null ? undefined : json['message'],
63
+ 'data_url': json['data_url'],
64
+ };
65
+ }
66
+
67
+ export function ExportDataToJSON(value?: ExportData | null): any {
68
+ if (value == null) {
69
+ return value;
70
+ }
71
+ return {
72
+
73
+ 'code': value['code'],
74
+ 'message': value['message'],
75
+ 'data_url': value['data_url'],
76
+ };
77
+ }
78
+
@@ -0,0 +1,96 @@
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 ReqExportData
20
+ */
21
+ export interface ReqExportData {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ReqExportData
26
+ */
27
+ auth?: string;
28
+ /**
29
+ *
30
+ * @type {number}
31
+ * @memberof ReqExportData
32
+ */
33
+ account_index?: number;
34
+ /**
35
+ *
36
+ * @type {number}
37
+ * @memberof ReqExportData
38
+ */
39
+ market_id?: number;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof ReqExportData
44
+ */
45
+ type: ReqExportDataTypeEnum;
46
+ }
47
+
48
+
49
+ /**
50
+ * @export
51
+ */
52
+ export const ReqExportDataTypeEnum = {
53
+ Funding: 'funding',
54
+ Trade: 'trade'
55
+ } as const;
56
+ export type ReqExportDataTypeEnum = typeof ReqExportDataTypeEnum[keyof typeof ReqExportDataTypeEnum];
57
+
58
+
59
+ /**
60
+ * Check if a given object implements the ReqExportData interface.
61
+ */
62
+ export function instanceOfReqExportData(value: object): value is ReqExportData {
63
+ if (!('type' in value) || value['type'] === undefined) return false;
64
+ return true;
65
+ }
66
+
67
+ export function ReqExportDataFromJSON(json: any): ReqExportData {
68
+ return ReqExportDataFromJSONTyped(json, false);
69
+ }
70
+
71
+ export function ReqExportDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReqExportData {
72
+ if (json == null) {
73
+ return json;
74
+ }
75
+ return {
76
+
77
+ 'auth': json['auth'] == null ? undefined : json['auth'],
78
+ 'account_index': json['account_index'] == null ? undefined : json['account_index'],
79
+ 'market_id': json['market_id'] == null ? undefined : json['market_id'],
80
+ 'type': json['type'],
81
+ };
82
+ }
83
+
84
+ export function ReqExportDataToJSON(value?: ReqExportData | null): any {
85
+ if (value == null) {
86
+ return value;
87
+ }
88
+ return {
89
+
90
+ 'auth': value['auth'],
91
+ 'account_index': value['account_index'],
92
+ 'market_id': value['market_id'],
93
+ 'type': value['type'],
94
+ };
95
+ }
96
+
package/models/index.ts CHANGED
@@ -32,6 +32,7 @@ export * from './DetailedAccounts';
32
32
  export * from './DetailedCandlestick';
33
33
  export * from './EnrichedTx';
34
34
  export * from './ExchangeStats';
35
+ export * from './ExportData';
35
36
  export * from './Funding';
36
37
  export * from './FundingRate';
37
38
  export * from './FundingRates';
@@ -69,6 +70,7 @@ export * from './ReferralCode';
69
70
  export * from './ReferralPointEntry';
70
71
  export * from './ReferralPoints';
71
72
  export * from './ReqDoFaucet';
73
+ export * from './ReqExportData';
72
74
  export * from './ReqGetAccount';
73
75
  export * from './ReqGetAccountActiveOrders';
74
76
  export * from './ReqGetAccountApiKeys';
package/openapi.json CHANGED
@@ -1045,6 +1045,73 @@
1045
1045
  "description": "Get exchange stats"
1046
1046
  }
1047
1047
  },
1048
+ "/api/v1/export": {
1049
+ "get": {
1050
+ "summary": "export",
1051
+ "operationId": "export",
1052
+ "responses": {
1053
+ "200": {
1054
+ "description": "A successful response.",
1055
+ "schema": {
1056
+ "$ref": "#/definitions/ExportData"
1057
+ }
1058
+ },
1059
+ "400": {
1060
+ "description": "Bad request",
1061
+ "schema": {
1062
+ "$ref": "#/definitions/ResultCode"
1063
+ }
1064
+ }
1065
+ },
1066
+ "parameters": [
1067
+ {
1068
+ "name": "authorization",
1069
+ "in": "header",
1070
+ "required": false,
1071
+ "type": "string"
1072
+ },
1073
+ {
1074
+ "name": "auth",
1075
+ "in": "query",
1076
+ "required": false,
1077
+ "type": "string"
1078
+ },
1079
+ {
1080
+ "name": "account_index",
1081
+ "in": "query",
1082
+ "required": false,
1083
+ "type": "integer",
1084
+ "format": "int64",
1085
+ "default": "-1"
1086
+ },
1087
+ {
1088
+ "name": "market_id",
1089
+ "in": "query",
1090
+ "required": false,
1091
+ "type": "integer",
1092
+ "format": "uint8",
1093
+ "default": "255"
1094
+ },
1095
+ {
1096
+ "name": "type",
1097
+ "in": "query",
1098
+ "required": true,
1099
+ "type": "string",
1100
+ "enum": [
1101
+ "funding",
1102
+ "trade"
1103
+ ]
1104
+ }
1105
+ ],
1106
+ "tags": [
1107
+ "order"
1108
+ ],
1109
+ "consumes": [
1110
+ "multipart/form-data"
1111
+ ],
1112
+ "description": "Export data"
1113
+ }
1114
+ },
1048
1115
  "/api/v1/fastbridge/info": {
1049
1116
  "get": {
1050
1117
  "summary": "fastbridge_info",
@@ -4073,6 +4140,27 @@
4073
4140
  "daily_trades_count"
4074
4141
  ]
4075
4142
  },
4143
+ "ExportData": {
4144
+ "type": "object",
4145
+ "properties": {
4146
+ "code": {
4147
+ "type": "integer",
4148
+ "format": "int32",
4149
+ "example": "200"
4150
+ },
4151
+ "message": {
4152
+ "type": "string"
4153
+ },
4154
+ "data_url": {
4155
+ "type": "string"
4156
+ }
4157
+ },
4158
+ "title": "ExportData",
4159
+ "required": [
4160
+ "code",
4161
+ "data_url"
4162
+ ]
4163
+ },
4076
4164
  "Funding": {
4077
4165
  "type": "object",
4078
4166
  "properties": {
@@ -5831,6 +5919,35 @@
5831
5919
  "l1_address"
5832
5920
  ]
5833
5921
  },
5922
+ "ReqExportData": {
5923
+ "type": "object",
5924
+ "properties": {
5925
+ "auth": {
5926
+ "type": "string"
5927
+ },
5928
+ "account_index": {
5929
+ "type": "integer",
5930
+ "format": "int64",
5931
+ "default": "-1"
5932
+ },
5933
+ "market_id": {
5934
+ "type": "integer",
5935
+ "format": "uint8",
5936
+ "default": "255"
5937
+ },
5938
+ "type": {
5939
+ "type": "string",
5940
+ "enum": [
5941
+ "funding",
5942
+ "trade"
5943
+ ]
5944
+ }
5945
+ },
5946
+ "title": "ReqExportData",
5947
+ "required": [
5948
+ "type"
5949
+ ]
5950
+ },
5834
5951
  "ReqFastwithdraw": {
5835
5952
  "type": "object",
5836
5953
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.124",
3
+ "version": "1.0.126",
4
4
  "description": "zkLighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {