zklighter-perps 1.0.109 → 1.0.110
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 +71 -0
- package/models/AccountMetadatas.ts +85 -0
- package/models/ReqGetAccountMetadata.ts +89 -0
- package/models/index.ts +2 -0
- package/openapi.json +95 -0
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
|
@@ -16,6 +16,7 @@ models/Account.ts
|
|
|
16
16
|
models/AccountApiKeys.ts
|
|
17
17
|
models/AccountMarketStats.ts
|
|
18
18
|
models/AccountMetadata.ts
|
|
19
|
+
models/AccountMetadatas.ts
|
|
19
20
|
models/AccountPnL.ts
|
|
20
21
|
models/AccountPosition.ts
|
|
21
22
|
models/AccountStats.ts
|
|
@@ -82,6 +83,7 @@ models/ReqGetAccountActiveOrders.ts
|
|
|
82
83
|
models/ReqGetAccountApiKeys.ts
|
|
83
84
|
models/ReqGetAccountByL1Address.ts
|
|
84
85
|
models/ReqGetAccountInactiveOrders.ts
|
|
86
|
+
models/ReqGetAccountMetadata.ts
|
|
85
87
|
models/ReqGetAccountOrders.ts
|
|
86
88
|
models/ReqGetAccountPendingTxs.ts
|
|
87
89
|
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
|
+
AccountMetadatas,
|
|
19
20
|
AccountPnL,
|
|
20
21
|
Accounts,
|
|
21
22
|
DetailedAccounts,
|
|
@@ -30,6 +31,8 @@ import type {
|
|
|
30
31
|
import {
|
|
31
32
|
AccountApiKeysFromJSON,
|
|
32
33
|
AccountApiKeysToJSON,
|
|
34
|
+
AccountMetadatasFromJSON,
|
|
35
|
+
AccountMetadatasToJSON,
|
|
33
36
|
AccountPnLFromJSON,
|
|
34
37
|
AccountPnLToJSON,
|
|
35
38
|
AccountsFromJSON,
|
|
@@ -57,6 +60,12 @@ export interface AccountRequest {
|
|
|
57
60
|
value: string;
|
|
58
61
|
}
|
|
59
62
|
|
|
63
|
+
export interface AccountMetadataRequest {
|
|
64
|
+
by: AccountMetadataByEnum;
|
|
65
|
+
value: string;
|
|
66
|
+
auth?: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
60
69
|
export interface AccountsRequest {
|
|
61
70
|
limit: number;
|
|
62
71
|
index?: number;
|
|
@@ -169,6 +178,60 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
169
178
|
return await response.value();
|
|
170
179
|
}
|
|
171
180
|
|
|
181
|
+
/**
|
|
182
|
+
* Get account metadatas
|
|
183
|
+
* accountMetadata
|
|
184
|
+
*/
|
|
185
|
+
async accountMetadataRaw(requestParameters: AccountMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AccountMetadatas>> {
|
|
186
|
+
if (requestParameters['by'] == null) {
|
|
187
|
+
throw new runtime.RequiredError(
|
|
188
|
+
'by',
|
|
189
|
+
'Required parameter "by" was null or undefined when calling accountMetadata().'
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (requestParameters['value'] == null) {
|
|
194
|
+
throw new runtime.RequiredError(
|
|
195
|
+
'value',
|
|
196
|
+
'Required parameter "value" was null or undefined when calling accountMetadata().'
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const queryParameters: any = {};
|
|
201
|
+
|
|
202
|
+
if (requestParameters['by'] != null) {
|
|
203
|
+
queryParameters['by'] = requestParameters['by'];
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if (requestParameters['value'] != null) {
|
|
207
|
+
queryParameters['value'] = requestParameters['value'];
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (requestParameters['auth'] != null) {
|
|
211
|
+
queryParameters['auth'] = requestParameters['auth'];
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
215
|
+
|
|
216
|
+
const response = await this.request({
|
|
217
|
+
path: `/api/v1/accountMetadata`,
|
|
218
|
+
method: 'GET',
|
|
219
|
+
headers: headerParameters,
|
|
220
|
+
query: queryParameters,
|
|
221
|
+
}, initOverrides);
|
|
222
|
+
|
|
223
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AccountMetadatasFromJSON(jsonValue));
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Get account metadatas
|
|
228
|
+
* accountMetadata
|
|
229
|
+
*/
|
|
230
|
+
async accountMetadata(requestParameters: AccountMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountMetadatas> {
|
|
231
|
+
const response = await this.accountMetadataRaw(requestParameters, initOverrides);
|
|
232
|
+
return await response.value();
|
|
233
|
+
}
|
|
234
|
+
|
|
172
235
|
/**
|
|
173
236
|
* Get accounts returns accounts by account index
|
|
174
237
|
* accounts
|
|
@@ -686,6 +749,14 @@ export const AccountByEnum = {
|
|
|
686
749
|
L1Address: 'l1_address'
|
|
687
750
|
} as const;
|
|
688
751
|
export type AccountByEnum = typeof AccountByEnum[keyof typeof AccountByEnum];
|
|
752
|
+
/**
|
|
753
|
+
* @export
|
|
754
|
+
*/
|
|
755
|
+
export const AccountMetadataByEnum = {
|
|
756
|
+
Index: 'index',
|
|
757
|
+
L1Address: 'l1_address'
|
|
758
|
+
} as const;
|
|
759
|
+
export type AccountMetadataByEnum = typeof AccountMetadataByEnum[keyof typeof AccountMetadataByEnum];
|
|
689
760
|
/**
|
|
690
761
|
* @export
|
|
691
762
|
*/
|
|
@@ -0,0 +1,85 @@
|
|
|
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 { Mapint64AccountMetadata } from './Mapint64AccountMetadata';
|
|
17
|
+
import {
|
|
18
|
+
Mapint64AccountMetadataFromJSON,
|
|
19
|
+
Mapint64AccountMetadataFromJSONTyped,
|
|
20
|
+
Mapint64AccountMetadataToJSON,
|
|
21
|
+
} from './Mapint64AccountMetadata';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @export
|
|
26
|
+
* @interface AccountMetadatas
|
|
27
|
+
*/
|
|
28
|
+
export interface AccountMetadatas {
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @type {number}
|
|
32
|
+
* @memberof AccountMetadatas
|
|
33
|
+
*/
|
|
34
|
+
code: number;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @type {string}
|
|
38
|
+
* @memberof AccountMetadatas
|
|
39
|
+
*/
|
|
40
|
+
message?: string;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @type {Mapint64AccountMetadata}
|
|
44
|
+
* @memberof AccountMetadatas
|
|
45
|
+
*/
|
|
46
|
+
account_metadatas: Mapint64AccountMetadata;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Check if a given object implements the AccountMetadatas interface.
|
|
51
|
+
*/
|
|
52
|
+
export function instanceOfAccountMetadatas(value: object): value is AccountMetadatas {
|
|
53
|
+
if (!('code' in value) || value['code'] === undefined) return false;
|
|
54
|
+
if (!('account_metadatas' in value) || value['account_metadatas'] === undefined) return false;
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function AccountMetadatasFromJSON(json: any): AccountMetadatas {
|
|
59
|
+
return AccountMetadatasFromJSONTyped(json, false);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function AccountMetadatasFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountMetadatas {
|
|
63
|
+
if (json == null) {
|
|
64
|
+
return json;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
|
|
68
|
+
'code': json['code'],
|
|
69
|
+
'message': json['message'] == null ? undefined : json['message'],
|
|
70
|
+
'account_metadatas': Mapint64AccountMetadataFromJSON(json['account_metadatas']),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function AccountMetadatasToJSON(value?: AccountMetadatas | null): any {
|
|
75
|
+
if (value == null) {
|
|
76
|
+
return value;
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
|
|
80
|
+
'code': value['code'],
|
|
81
|
+
'message': value['message'],
|
|
82
|
+
'account_metadatas': Mapint64AccountMetadataToJSON(value['account_metadatas']),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
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 ReqGetAccountMetadata
|
|
20
|
+
*/
|
|
21
|
+
export interface ReqGetAccountMetadata {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof ReqGetAccountMetadata
|
|
26
|
+
*/
|
|
27
|
+
by: ReqGetAccountMetadataByEnum;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof ReqGetAccountMetadata
|
|
32
|
+
*/
|
|
33
|
+
value: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof ReqGetAccountMetadata
|
|
38
|
+
*/
|
|
39
|
+
auth?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @export
|
|
45
|
+
*/
|
|
46
|
+
export const ReqGetAccountMetadataByEnum = {
|
|
47
|
+
Index: 'index',
|
|
48
|
+
L1Address: 'l1_address'
|
|
49
|
+
} as const;
|
|
50
|
+
export type ReqGetAccountMetadataByEnum = typeof ReqGetAccountMetadataByEnum[keyof typeof ReqGetAccountMetadataByEnum];
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Check if a given object implements the ReqGetAccountMetadata interface.
|
|
55
|
+
*/
|
|
56
|
+
export function instanceOfReqGetAccountMetadata(value: object): value is ReqGetAccountMetadata {
|
|
57
|
+
if (!('by' in value) || value['by'] === undefined) return false;
|
|
58
|
+
if (!('value' in value) || value['value'] === undefined) return false;
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function ReqGetAccountMetadataFromJSON(json: any): ReqGetAccountMetadata {
|
|
63
|
+
return ReqGetAccountMetadataFromJSONTyped(json, false);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function ReqGetAccountMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReqGetAccountMetadata {
|
|
67
|
+
if (json == null) {
|
|
68
|
+
return json;
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
|
|
72
|
+
'by': json['by'],
|
|
73
|
+
'value': json['value'],
|
|
74
|
+
'auth': json['auth'] == null ? undefined : json['auth'],
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function ReqGetAccountMetadataToJSON(value?: ReqGetAccountMetadata | null): any {
|
|
79
|
+
if (value == null) {
|
|
80
|
+
return value;
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
|
|
84
|
+
'by': value['by'],
|
|
85
|
+
'value': value['value'],
|
|
86
|
+
'auth': value['auth'],
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
package/models/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './Account';
|
|
|
4
4
|
export * from './AccountApiKeys';
|
|
5
5
|
export * from './AccountMarketStats';
|
|
6
6
|
export * from './AccountMetadata';
|
|
7
|
+
export * from './AccountMetadatas';
|
|
7
8
|
export * from './AccountPnL';
|
|
8
9
|
export * from './AccountPosition';
|
|
9
10
|
export * from './AccountStats';
|
|
@@ -70,6 +71,7 @@ export * from './ReqGetAccountActiveOrders';
|
|
|
70
71
|
export * from './ReqGetAccountApiKeys';
|
|
71
72
|
export * from './ReqGetAccountByL1Address';
|
|
72
73
|
export * from './ReqGetAccountInactiveOrders';
|
|
74
|
+
export * from './ReqGetAccountMetadata';
|
|
73
75
|
export * from './ReqGetAccountOrders';
|
|
74
76
|
export * from './ReqGetAccountPendingTxs';
|
|
75
77
|
export * from './ReqGetAccountPnL';
|
package/openapi.json
CHANGED
|
@@ -206,6 +206,57 @@
|
|
|
206
206
|
"description": "Get account inactive orders"
|
|
207
207
|
}
|
|
208
208
|
},
|
|
209
|
+
"/api/v1/accountMetadata": {
|
|
210
|
+
"get": {
|
|
211
|
+
"summary": "accountMetadata",
|
|
212
|
+
"operationId": "accountMetadata",
|
|
213
|
+
"responses": {
|
|
214
|
+
"200": {
|
|
215
|
+
"description": "A successful response.",
|
|
216
|
+
"schema": {
|
|
217
|
+
"$ref": "#/definitions/AccountMetadatas"
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"400": {
|
|
221
|
+
"description": "Bad request",
|
|
222
|
+
"schema": {
|
|
223
|
+
"$ref": "#/definitions/ResultCode"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
"parameters": [
|
|
228
|
+
{
|
|
229
|
+
"name": "by",
|
|
230
|
+
"in": "query",
|
|
231
|
+
"required": true,
|
|
232
|
+
"type": "string",
|
|
233
|
+
"enum": [
|
|
234
|
+
"index",
|
|
235
|
+
"l1_address"
|
|
236
|
+
]
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"name": "value",
|
|
240
|
+
"in": "query",
|
|
241
|
+
"required": true,
|
|
242
|
+
"type": "string"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"name": "auth",
|
|
246
|
+
"in": "query",
|
|
247
|
+
"required": false,
|
|
248
|
+
"type": "string"
|
|
249
|
+
}
|
|
250
|
+
],
|
|
251
|
+
"tags": [
|
|
252
|
+
"account"
|
|
253
|
+
],
|
|
254
|
+
"consumes": [
|
|
255
|
+
"multipart/form-data"
|
|
256
|
+
],
|
|
257
|
+
"description": "Get account metadatas"
|
|
258
|
+
}
|
|
259
|
+
},
|
|
209
260
|
"/api/v1/accountOrders": {
|
|
210
261
|
"get": {
|
|
211
262
|
"summary": "accountOrders",
|
|
@@ -2683,6 +2734,27 @@
|
|
|
2683
2734
|
"max_referral_usage_limit"
|
|
2684
2735
|
]
|
|
2685
2736
|
},
|
|
2737
|
+
"AccountMetadatas": {
|
|
2738
|
+
"type": "object",
|
|
2739
|
+
"properties": {
|
|
2740
|
+
"code": {
|
|
2741
|
+
"type": "integer",
|
|
2742
|
+
"format": "int32",
|
|
2743
|
+
"example": "200"
|
|
2744
|
+
},
|
|
2745
|
+
"message": {
|
|
2746
|
+
"type": "string"
|
|
2747
|
+
},
|
|
2748
|
+
"account_metadatas": {
|
|
2749
|
+
"$ref": "#/definitions/mapint64AccountMetadata"
|
|
2750
|
+
}
|
|
2751
|
+
},
|
|
2752
|
+
"title": "AccountMetadatas",
|
|
2753
|
+
"required": [
|
|
2754
|
+
"code",
|
|
2755
|
+
"account_metadatas"
|
|
2756
|
+
]
|
|
2757
|
+
},
|
|
2686
2758
|
"AccountPnL": {
|
|
2687
2759
|
"type": "object",
|
|
2688
2760
|
"properties": {
|
|
@@ -5618,6 +5690,29 @@
|
|
|
5618
5690
|
"limit"
|
|
5619
5691
|
]
|
|
5620
5692
|
},
|
|
5693
|
+
"ReqGetAccountMetadata": {
|
|
5694
|
+
"type": "object",
|
|
5695
|
+
"properties": {
|
|
5696
|
+
"by": {
|
|
5697
|
+
"type": "string",
|
|
5698
|
+
"enum": [
|
|
5699
|
+
"index",
|
|
5700
|
+
"l1_address"
|
|
5701
|
+
]
|
|
5702
|
+
},
|
|
5703
|
+
"value": {
|
|
5704
|
+
"type": "string"
|
|
5705
|
+
},
|
|
5706
|
+
"auth": {
|
|
5707
|
+
"type": "string"
|
|
5708
|
+
}
|
|
5709
|
+
},
|
|
5710
|
+
"title": "ReqGetAccountMetadata",
|
|
5711
|
+
"required": [
|
|
5712
|
+
"by",
|
|
5713
|
+
"value"
|
|
5714
|
+
]
|
|
5715
|
+
},
|
|
5621
5716
|
"ReqGetAccountOrders": {
|
|
5622
5717
|
"type": "object",
|
|
5623
5718
|
"properties": {
|