zklighter-perps 1.0.117 → 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.
- package/.openapi-generator/FILES +2 -0
- package/apis/AccountApi.ts +58 -0
- package/models/AccountLimits.ts +78 -0
- package/models/ReqGetAccountLimits.ts +70 -0
- package/models/index.ts +2 -0
- package/openapi.json +82 -0
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
|
@@ -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
|
package/apis/AccountApi.ts
CHANGED
|
@@ -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/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": {
|