zklighter-perps 1.0.117 → 1.0.119

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.
@@ -14,6 +14,7 @@ apis/index.ts
14
14
  index.ts
15
15
  models/Account.ts
16
16
  models/AccountApiKeys.ts
17
+ models/AccountLimits.ts
17
18
  models/AccountMarketStats.ts
18
19
  models/AccountMetadata.ts
19
20
  models/AccountPnL.ts
@@ -80,6 +81,7 @@ models/ReqGetAccountActiveOrders.ts
80
81
  models/ReqGetAccountApiKeys.ts
81
82
  models/ReqGetAccountByL1Address.ts
82
83
  models/ReqGetAccountInactiveOrders.ts
84
+ models/ReqGetAccountLimits.ts
83
85
  models/ReqGetAccountOrders.ts
84
86
  models/ReqGetAccountPendingTxs.ts
85
87
  models/ReqGetAccountPnL.ts
@@ -16,6 +16,7 @@
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
18
  AccountApiKeys,
19
+ AccountLimits,
19
20
  AccountPnL,
20
21
  DetailedAccounts,
21
22
  FeeBucket,
@@ -29,6 +30,8 @@ import type {
29
30
  import {
30
31
  AccountApiKeysFromJSON,
31
32
  AccountApiKeysToJSON,
33
+ AccountLimitsFromJSON,
34
+ AccountLimitsToJSON,
32
35
  AccountPnLFromJSON,
33
36
  AccountPnLToJSON,
34
37
  DetailedAccountsFromJSON,
@@ -54,6 +57,11 @@ export interface AccountRequest {
54
57
  value: string;
55
58
  }
56
59
 
60
+ export interface AccountLimitsRequest {
61
+ account_index: number;
62
+ auth: string;
63
+ }
64
+
57
65
  export interface AccountsByL1AddressRequest {
58
66
  l1_address: string;
59
67
  }
@@ -163,6 +171,56 @@ export class AccountApi extends runtime.BaseAPI {
163
171
  return await response.value();
164
172
  }
165
173
 
174
+ /**
175
+ * Get account limits
176
+ * accountLimits
177
+ */
178
+ async accountLimitsRaw(requestParameters: AccountLimitsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AccountLimits>> {
179
+ if (requestParameters['account_index'] == null) {
180
+ throw new runtime.RequiredError(
181
+ 'account_index',
182
+ 'Required parameter "account_index" was null or undefined when calling accountLimits().'
183
+ );
184
+ }
185
+
186
+ if (requestParameters['auth'] == null) {
187
+ throw new runtime.RequiredError(
188
+ 'auth',
189
+ 'Required parameter "auth" was null or undefined when calling accountLimits().'
190
+ );
191
+ }
192
+
193
+ const queryParameters: any = {};
194
+
195
+ if (requestParameters['account_index'] != null) {
196
+ queryParameters['account_index'] = requestParameters['account_index'];
197
+ }
198
+
199
+ if (requestParameters['auth'] != null) {
200
+ queryParameters['auth'] = requestParameters['auth'];
201
+ }
202
+
203
+ const headerParameters: runtime.HTTPHeaders = {};
204
+
205
+ const response = await this.request({
206
+ path: `/api/v1/accountLimits`,
207
+ method: 'GET',
208
+ headers: headerParameters,
209
+ query: queryParameters,
210
+ }, initOverrides);
211
+
212
+ return new runtime.JSONApiResponse(response, (jsonValue) => AccountLimitsFromJSON(jsonValue));
213
+ }
214
+
215
+ /**
216
+ * Get account limits
217
+ * accountLimits
218
+ */
219
+ async accountLimits(requestParameters: AccountLimitsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountLimits> {
220
+ const response = await this.accountLimitsRaw(requestParameters, initOverrides);
221
+ return await response.value();
222
+ }
223
+
166
224
  /**
167
225
  * Get accounts by l1_address returns all accounts associated with the given L1 address
168
226
  * accountsByL1Address
@@ -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 AccountLimits
20
+ */
21
+ export interface AccountLimits {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof AccountLimits
26
+ */
27
+ code: number;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof AccountLimits
32
+ */
33
+ message?: string;
34
+ /**
35
+ *
36
+ * @type {number}
37
+ * @memberof AccountLimits
38
+ */
39
+ max_llp_percentage: number;
40
+ }
41
+
42
+ /**
43
+ * Check if a given object implements the AccountLimits interface.
44
+ */
45
+ export function instanceOfAccountLimits(value: object): value is AccountLimits {
46
+ if (!('code' in value) || value['code'] === undefined) return false;
47
+ if (!('max_llp_percentage' in value) || value['max_llp_percentage'] === undefined) return false;
48
+ return true;
49
+ }
50
+
51
+ export function AccountLimitsFromJSON(json: any): AccountLimits {
52
+ return AccountLimitsFromJSONTyped(json, false);
53
+ }
54
+
55
+ export function AccountLimitsFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountLimits {
56
+ if (json == null) {
57
+ return json;
58
+ }
59
+ return {
60
+
61
+ 'code': json['code'],
62
+ 'message': json['message'] == null ? undefined : json['message'],
63
+ 'max_llp_percentage': json['max_llp_percentage'],
64
+ };
65
+ }
66
+
67
+ export function AccountLimitsToJSON(value?: AccountLimits | null): any {
68
+ if (value == null) {
69
+ return value;
70
+ }
71
+ return {
72
+
73
+ 'code': value['code'],
74
+ 'message': value['message'],
75
+ 'max_llp_percentage': value['max_llp_percentage'],
76
+ };
77
+ }
78
+
@@ -0,0 +1,70 @@
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 ReqGetAccountLimits
20
+ */
21
+ export interface ReqGetAccountLimits {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof ReqGetAccountLimits
26
+ */
27
+ account_index: number;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof ReqGetAccountLimits
32
+ */
33
+ auth: string;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the ReqGetAccountLimits interface.
38
+ */
39
+ export function instanceOfReqGetAccountLimits(value: object): value is ReqGetAccountLimits {
40
+ if (!('account_index' in value) || value['account_index'] === undefined) return false;
41
+ if (!('auth' in value) || value['auth'] === undefined) return false;
42
+ return true;
43
+ }
44
+
45
+ export function ReqGetAccountLimitsFromJSON(json: any): ReqGetAccountLimits {
46
+ return ReqGetAccountLimitsFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function ReqGetAccountLimitsFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReqGetAccountLimits {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'account_index': json['account_index'],
56
+ 'auth': json['auth'],
57
+ };
58
+ }
59
+
60
+ export function ReqGetAccountLimitsToJSON(value?: ReqGetAccountLimits | null): any {
61
+ if (value == null) {
62
+ return value;
63
+ }
64
+ return {
65
+
66
+ 'account_index': value['account_index'],
67
+ 'auth': value['auth'],
68
+ };
69
+ }
70
+
package/models/Trade.ts CHANGED
@@ -103,6 +103,54 @@ export interface Trade {
103
103
  * @memberof Trade
104
104
  */
105
105
  timestamp: number;
106
+ /**
107
+ *
108
+ * @type {number}
109
+ * @memberof Trade
110
+ */
111
+ taker_fee: number;
112
+ /**
113
+ *
114
+ * @type {number}
115
+ * @memberof Trade
116
+ */
117
+ taker_position_size_before: number;
118
+ /**
119
+ *
120
+ * @type {number}
121
+ * @memberof Trade
122
+ */
123
+ taker_entry_quote_before: number;
124
+ /**
125
+ *
126
+ * @type {boolean}
127
+ * @memberof Trade
128
+ */
129
+ taker_position_sign_changed: boolean;
130
+ /**
131
+ *
132
+ * @type {number}
133
+ * @memberof Trade
134
+ */
135
+ maker_fee: number;
136
+ /**
137
+ *
138
+ * @type {number}
139
+ * @memberof Trade
140
+ */
141
+ maker_position_size_before: number;
142
+ /**
143
+ *
144
+ * @type {number}
145
+ * @memberof Trade
146
+ */
147
+ maker_entry_quote_before: number;
148
+ /**
149
+ *
150
+ * @type {boolean}
151
+ * @memberof Trade
152
+ */
153
+ maker_position_sign_changed: boolean;
106
154
  }
107
155
 
108
156
 
@@ -135,6 +183,14 @@ export function instanceOfTrade(value: object): value is Trade {
135
183
  if (!('is_maker_ask' in value) || value['is_maker_ask'] === undefined) return false;
136
184
  if (!('block_height' in value) || value['block_height'] === undefined) return false;
137
185
  if (!('timestamp' in value) || value['timestamp'] === undefined) return false;
186
+ if (!('taker_fee' in value) || value['taker_fee'] === undefined) return false;
187
+ if (!('taker_position_size_before' in value) || value['taker_position_size_before'] === undefined) return false;
188
+ if (!('taker_entry_quote_before' in value) || value['taker_entry_quote_before'] === undefined) return false;
189
+ if (!('taker_position_sign_changed' in value) || value['taker_position_sign_changed'] === undefined) return false;
190
+ if (!('maker_fee' in value) || value['maker_fee'] === undefined) return false;
191
+ if (!('maker_position_size_before' in value) || value['maker_position_size_before'] === undefined) return false;
192
+ if (!('maker_entry_quote_before' in value) || value['maker_entry_quote_before'] === undefined) return false;
193
+ if (!('maker_position_sign_changed' in value) || value['maker_position_sign_changed'] === undefined) return false;
138
194
  return true;
139
195
  }
140
196
 
@@ -162,6 +218,14 @@ export function TradeFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tra
162
218
  'is_maker_ask': json['is_maker_ask'],
163
219
  'block_height': json['block_height'],
164
220
  'timestamp': json['timestamp'],
221
+ 'taker_fee': json['taker_fee'],
222
+ 'taker_position_size_before': json['taker_position_size_before'],
223
+ 'taker_entry_quote_before': json['taker_entry_quote_before'],
224
+ 'taker_position_sign_changed': json['taker_position_sign_changed'],
225
+ 'maker_fee': json['maker_fee'],
226
+ 'maker_position_size_before': json['maker_position_size_before'],
227
+ 'maker_entry_quote_before': json['maker_entry_quote_before'],
228
+ 'maker_position_sign_changed': json['maker_position_sign_changed'],
165
229
  };
166
230
  }
167
231
 
@@ -185,6 +249,14 @@ export function TradeToJSON(value?: Trade | null): any {
185
249
  'is_maker_ask': value['is_maker_ask'],
186
250
  'block_height': value['block_height'],
187
251
  'timestamp': value['timestamp'],
252
+ 'taker_fee': value['taker_fee'],
253
+ 'taker_position_size_before': value['taker_position_size_before'],
254
+ 'taker_entry_quote_before': value['taker_entry_quote_before'],
255
+ 'taker_position_sign_changed': value['taker_position_sign_changed'],
256
+ 'maker_fee': value['maker_fee'],
257
+ 'maker_position_size_before': value['maker_position_size_before'],
258
+ 'maker_entry_quote_before': value['maker_entry_quote_before'],
259
+ 'maker_position_sign_changed': value['maker_position_sign_changed'],
188
260
  };
189
261
  }
190
262
 
package/models/index.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  /* eslint-disable */
3
3
  export * from './Account';
4
4
  export * from './AccountApiKeys';
5
+ export * from './AccountLimits';
5
6
  export * from './AccountMarketStats';
6
7
  export * from './AccountMetadata';
7
8
  export * from './AccountPnL';
@@ -68,6 +69,7 @@ export * from './ReqGetAccountActiveOrders';
68
69
  export * from './ReqGetAccountApiKeys';
69
70
  export * from './ReqGetAccountByL1Address';
70
71
  export * from './ReqGetAccountInactiveOrders';
72
+ export * from './ReqGetAccountLimits';
71
73
  export * from './ReqGetAccountOrders';
72
74
  export * from './ReqGetAccountPendingTxs';
73
75
  export * from './ReqGetAccountPnL';
package/openapi.json CHANGED
@@ -212,6 +212,48 @@
212
212
  "description": "Get account inactive orders"
213
213
  }
214
214
  },
215
+ "/api/v1/accountLimits": {
216
+ "get": {
217
+ "summary": "accountLimits",
218
+ "operationId": "accountLimits",
219
+ "responses": {
220
+ "200": {
221
+ "description": "A successful response.",
222
+ "schema": {
223
+ "$ref": "#/definitions/AccountLimits"
224
+ }
225
+ },
226
+ "400": {
227
+ "description": "Bad request",
228
+ "schema": {
229
+ "$ref": "#/definitions/ResultCode"
230
+ }
231
+ }
232
+ },
233
+ "parameters": [
234
+ {
235
+ "name": "account_index",
236
+ "in": "query",
237
+ "required": true,
238
+ "type": "integer",
239
+ "format": "int64"
240
+ },
241
+ {
242
+ "name": "auth",
243
+ "in": "query",
244
+ "required": true,
245
+ "type": "string"
246
+ }
247
+ ],
248
+ "tags": [
249
+ "account"
250
+ ],
251
+ "consumes": [
252
+ "multipart/form-data"
253
+ ],
254
+ "description": "Get account limits"
255
+ }
256
+ },
215
257
  "/api/v1/accountOrders": {
216
258
  "get": {
217
259
  "summary": "accountOrders",
@@ -2560,6 +2602,29 @@
2560
2602
  "api_keys"
2561
2603
  ]
2562
2604
  },
2605
+ "AccountLimits": {
2606
+ "type": "object",
2607
+ "properties": {
2608
+ "code": {
2609
+ "type": "integer",
2610
+ "format": "int32",
2611
+ "example": "200"
2612
+ },
2613
+ "message": {
2614
+ "type": "string"
2615
+ },
2616
+ "max_llp_percentage": {
2617
+ "type": "integer",
2618
+ "format": "int32",
2619
+ "example": "25"
2620
+ }
2621
+ },
2622
+ "title": "AccountLimits",
2623
+ "required": [
2624
+ "code",
2625
+ "max_llp_percentage"
2626
+ ]
2627
+ },
2563
2628
  "AccountMarketStats": {
2564
2629
  "type": "object",
2565
2630
  "properties": {
@@ -5543,6 +5608,23 @@
5543
5608
  "limit"
5544
5609
  ]
5545
5610
  },
5611
+ "ReqGetAccountLimits": {
5612
+ "type": "object",
5613
+ "properties": {
5614
+ "account_index": {
5615
+ "type": "integer",
5616
+ "format": "int64"
5617
+ },
5618
+ "auth": {
5619
+ "type": "string"
5620
+ }
5621
+ },
5622
+ "title": "ReqGetAccountLimits",
5623
+ "required": [
5624
+ "account_index",
5625
+ "auth"
5626
+ ]
5627
+ },
5546
5628
  "ReqGetAccountOrders": {
5547
5629
  "type": "object",
5548
5630
  "properties": {
@@ -6664,6 +6746,46 @@
6664
6746
  "type": "integer",
6665
6747
  "format": "int64",
6666
6748
  "example": "1640995200"
6749
+ },
6750
+ "taker_fee": {
6751
+ "type": "integer",
6752
+ "format": "int32",
6753
+ "example": "0"
6754
+ },
6755
+ "taker_position_size_before": {
6756
+ "type": "integer",
6757
+ "format": "int64",
6758
+ "example": "0"
6759
+ },
6760
+ "taker_entry_quote_before": {
6761
+ "type": "integer",
6762
+ "format": "int64",
6763
+ "example": "0"
6764
+ },
6765
+ "taker_position_sign_changed": {
6766
+ "type": "boolean",
6767
+ "format": "boolean",
6768
+ "example": "true"
6769
+ },
6770
+ "maker_fee": {
6771
+ "type": "integer",
6772
+ "format": "int32",
6773
+ "example": "0"
6774
+ },
6775
+ "maker_position_size_before": {
6776
+ "type": "integer",
6777
+ "format": "int64",
6778
+ "example": "0"
6779
+ },
6780
+ "maker_entry_quote_before": {
6781
+ "type": "integer",
6782
+ "format": "int64",
6783
+ "example": "0"
6784
+ },
6785
+ "maker_position_sign_changed": {
6786
+ "type": "boolean",
6787
+ "format": "boolean",
6788
+ "example": "true"
6667
6789
  }
6668
6790
  },
6669
6791
  "title": "Trade",
@@ -6681,7 +6803,15 @@
6681
6803
  "bid_account_id",
6682
6804
  "is_maker_ask",
6683
6805
  "block_height",
6684
- "timestamp"
6806
+ "timestamp",
6807
+ "taker_fee",
6808
+ "taker_position_size_before",
6809
+ "taker_entry_quote_before",
6810
+ "taker_position_sign_changed",
6811
+ "maker_fee",
6812
+ "maker_position_size_before",
6813
+ "maker_entry_quote_before",
6814
+ "maker_position_sign_changed"
6685
6815
  ]
6686
6816
  },
6687
6817
  "Trades": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.117",
3
+ "version": "1.0.119",
4
4
  "description": "zkLighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {