zklighter-perps 1.0.116 → 1.0.118

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
  }
@@ -103,6 +111,7 @@ export interface PositionFundingRequest {
103
111
  export interface PublicPoolsRequest {
104
112
  index: number;
105
113
  limit: number;
114
+ auth?: string;
106
115
  filter?: PublicPoolsFilterEnum;
107
116
  account_index?: number;
108
117
  }
@@ -162,6 +171,56 @@ export class AccountApi extends runtime.BaseAPI {
162
171
  return await response.value();
163
172
  }
164
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
+
165
224
  /**
166
225
  * Get accounts by l1_address returns all accounts associated with the given L1 address
167
226
  * accountsByL1Address
@@ -593,6 +652,10 @@ export class AccountApi extends runtime.BaseAPI {
593
652
 
594
653
  const queryParameters: any = {};
595
654
 
655
+ if (requestParameters['auth'] != null) {
656
+ queryParameters['auth'] = requestParameters['auth'];
657
+ }
658
+
596
659
  if (requestParameters['filter'] != null) {
597
660
  queryParameters['filter'] = requestParameters['filter'];
598
661
  }
@@ -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
+
@@ -19,6 +19,12 @@ import { mapValues } from '../runtime';
19
19
  * @interface ReqGetPublicPools
20
20
  */
21
21
  export interface ReqGetPublicPools {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ReqGetPublicPools
26
+ */
27
+ auth?: string;
22
28
  /**
23
29
  *
24
30
  * @type {string}
@@ -77,6 +83,7 @@ export function ReqGetPublicPoolsFromJSONTyped(json: any, ignoreDiscriminator: b
77
83
  }
78
84
  return {
79
85
 
86
+ 'auth': json['auth'] == null ? undefined : json['auth'],
80
87
  'filter': json['filter'] == null ? undefined : json['filter'],
81
88
  'index': json['index'],
82
89
  'limit': json['limit'],
@@ -90,6 +97,7 @@ export function ReqGetPublicPoolsToJSON(value?: ReqGetPublicPools | null): any {
90
97
  }
91
98
  return {
92
99
 
100
+ 'auth': value['auth'],
93
101
  'filter': value['filter'],
94
102
  'index': value['index'],
95
103
  'limit': value['limit'],
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",
@@ -1787,6 +1829,12 @@
1787
1829
  }
1788
1830
  },
1789
1831
  "parameters": [
1832
+ {
1833
+ "name": "auth",
1834
+ "in": "query",
1835
+ "required": false,
1836
+ "type": "string"
1837
+ },
1790
1838
  {
1791
1839
  "name": "filter",
1792
1840
  "in": "query",
@@ -2554,6 +2602,29 @@
2554
2602
  "api_keys"
2555
2603
  ]
2556
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
+ },
2557
2628
  "AccountMarketStats": {
2558
2629
  "type": "object",
2559
2630
  "properties": {
@@ -5537,6 +5608,23 @@
5537
5608
  "limit"
5538
5609
  ]
5539
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
+ },
5540
5628
  "ReqGetAccountOrders": {
5541
5629
  "type": "object",
5542
5630
  "properties": {
@@ -6034,6 +6122,9 @@
6034
6122
  "ReqGetPublicPools": {
6035
6123
  "type": "object",
6036
6124
  "properties": {
6125
+ "auth": {
6126
+ "type": "string"
6127
+ },
6037
6128
  "filter": {
6038
6129
  "type": "string",
6039
6130
  "enum": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.116",
3
+ "version": "1.0.118",
4
4
  "description": "zkLighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {