zklighter-perps 1.0.97 → 1.0.98
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 +1 -2
- package/apis/AccountApi.ts +1 -8
- package/apis/NotificationApi.ts +112 -0
- package/apis/index.ts +1 -1
- package/models/ReqGetAccountApiKeys.ts +2 -3
- package/models/index.ts +0 -1
- package/openapi.json +54 -102
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
|
@@ -4,7 +4,7 @@ apis/BlockApi.ts
|
|
|
4
4
|
apis/BridgeApi.ts
|
|
5
5
|
apis/CandlestickApi.ts
|
|
6
6
|
apis/InfoApi.ts
|
|
7
|
-
apis/
|
|
7
|
+
apis/NotificationApi.ts
|
|
8
8
|
apis/OrderApi.ts
|
|
9
9
|
apis/ReferralApi.ts
|
|
10
10
|
apis/RootApi.ts
|
|
@@ -50,7 +50,6 @@ models/Layer1BasicInfo.ts
|
|
|
50
50
|
models/Layer2BasicInfo.ts
|
|
51
51
|
models/Leaderboard.ts
|
|
52
52
|
models/LeaderboardEntry.ts
|
|
53
|
-
models/Liquidation.ts
|
|
54
53
|
models/MarketInfo.ts
|
|
55
54
|
models/NextNonce.ts
|
|
56
55
|
models/Order.ts
|
package/apis/AccountApi.ts
CHANGED
|
@@ -66,7 +66,7 @@ export interface AccountsByL1AddressRequest {
|
|
|
66
66
|
|
|
67
67
|
export interface ApikeysRequest {
|
|
68
68
|
account_index: number;
|
|
69
|
-
api_key_index
|
|
69
|
+
api_key_index?: number;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
export interface FaucetRequest {
|
|
@@ -256,13 +256,6 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
256
256
|
);
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
if (requestParameters['api_key_index'] == null) {
|
|
260
|
-
throw new runtime.RequiredError(
|
|
261
|
-
'api_key_index',
|
|
262
|
-
'Required parameter "api_key_index" was null or undefined when calling apikeys().'
|
|
263
|
-
);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
259
|
const queryParameters: any = {};
|
|
267
260
|
|
|
268
261
|
if (requestParameters['account_index'] != null) {
|
|
@@ -0,0 +1,112 @@
|
|
|
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
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
ResultCode,
|
|
19
|
+
} from '../models/index';
|
|
20
|
+
import {
|
|
21
|
+
ResultCodeFromJSON,
|
|
22
|
+
ResultCodeToJSON,
|
|
23
|
+
} from '../models/index';
|
|
24
|
+
|
|
25
|
+
export interface NotificationAckRequest {
|
|
26
|
+
notif_id: string;
|
|
27
|
+
auth: string;
|
|
28
|
+
account_index: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
export class NotificationApi extends runtime.BaseAPI {
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Ack notification
|
|
38
|
+
* notification_ack
|
|
39
|
+
*/
|
|
40
|
+
async notificationAckRaw(requestParameters: NotificationAckRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResultCode>> {
|
|
41
|
+
if (requestParameters['notif_id'] == null) {
|
|
42
|
+
throw new runtime.RequiredError(
|
|
43
|
+
'notif_id',
|
|
44
|
+
'Required parameter "notif_id" was null or undefined when calling notificationAck().'
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (requestParameters['auth'] == null) {
|
|
49
|
+
throw new runtime.RequiredError(
|
|
50
|
+
'auth',
|
|
51
|
+
'Required parameter "auth" was null or undefined when calling notificationAck().'
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (requestParameters['account_index'] == null) {
|
|
56
|
+
throw new runtime.RequiredError(
|
|
57
|
+
'account_index',
|
|
58
|
+
'Required parameter "account_index" was null or undefined when calling notificationAck().'
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const queryParameters: any = {};
|
|
63
|
+
|
|
64
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
65
|
+
|
|
66
|
+
const consumes: runtime.Consume[] = [
|
|
67
|
+
{ contentType: 'multipart/form-data' },
|
|
68
|
+
];
|
|
69
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
70
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
71
|
+
|
|
72
|
+
let formParams: { append(param: string, value: any): any };
|
|
73
|
+
let useForm = false;
|
|
74
|
+
if (useForm) {
|
|
75
|
+
formParams = new FormData();
|
|
76
|
+
} else {
|
|
77
|
+
formParams = new URLSearchParams();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (requestParameters['notif_id'] != null) {
|
|
81
|
+
formParams.append('notif_id', requestParameters['notif_id'] as any);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (requestParameters['auth'] != null) {
|
|
85
|
+
formParams.append('auth', requestParameters['auth'] as any);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (requestParameters['account_index'] != null) {
|
|
89
|
+
formParams.append('account_index', requestParameters['account_index'] as any);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const response = await this.request({
|
|
93
|
+
path: `/api/v1/notification/ack`,
|
|
94
|
+
method: 'POST',
|
|
95
|
+
headers: headerParameters,
|
|
96
|
+
query: queryParameters,
|
|
97
|
+
body: formParams,
|
|
98
|
+
}, initOverrides);
|
|
99
|
+
|
|
100
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ResultCodeFromJSON(jsonValue));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Ack notification
|
|
105
|
+
* notification_ack
|
|
106
|
+
*/
|
|
107
|
+
async notificationAck(requestParameters: NotificationAckRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResultCode> {
|
|
108
|
+
const response = await this.notificationAckRaw(requestParameters, initOverrides);
|
|
109
|
+
return await response.value();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
}
|
package/apis/index.ts
CHANGED
|
@@ -6,7 +6,7 @@ export * from './BlockApi';
|
|
|
6
6
|
export * from './BridgeApi';
|
|
7
7
|
export * from './CandlestickApi';
|
|
8
8
|
export * from './InfoApi';
|
|
9
|
-
export * from './
|
|
9
|
+
export * from './NotificationApi';
|
|
10
10
|
export * from './OrderApi';
|
|
11
11
|
export * from './ReferralApi';
|
|
12
12
|
export * from './RootApi';
|
|
@@ -30,7 +30,7 @@ export interface ReqGetAccountApiKeys {
|
|
|
30
30
|
* @type {number}
|
|
31
31
|
* @memberof ReqGetAccountApiKeys
|
|
32
32
|
*/
|
|
33
|
-
api_key_index
|
|
33
|
+
api_key_index?: number;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/**
|
|
@@ -38,7 +38,6 @@ export interface ReqGetAccountApiKeys {
|
|
|
38
38
|
*/
|
|
39
39
|
export function instanceOfReqGetAccountApiKeys(value: object): value is ReqGetAccountApiKeys {
|
|
40
40
|
if (!('account_index' in value) || value['account_index'] === undefined) return false;
|
|
41
|
-
if (!('api_key_index' in value) || value['api_key_index'] === undefined) return false;
|
|
42
41
|
return true;
|
|
43
42
|
}
|
|
44
43
|
|
|
@@ -53,7 +52,7 @@ export function ReqGetAccountApiKeysFromJSONTyped(json: any, ignoreDiscriminator
|
|
|
53
52
|
return {
|
|
54
53
|
|
|
55
54
|
'account_index': json['account_index'],
|
|
56
|
-
'api_key_index': json['api_key_index'],
|
|
55
|
+
'api_key_index': json['api_key_index'] == null ? undefined : json['api_key_index'],
|
|
57
56
|
};
|
|
58
57
|
}
|
|
59
58
|
|
package/models/index.ts
CHANGED
|
@@ -39,7 +39,6 @@ export * from './Layer1BasicInfo';
|
|
|
39
39
|
export * from './Layer2BasicInfo';
|
|
40
40
|
export * from './Leaderboard';
|
|
41
41
|
export * from './LeaderboardEntry';
|
|
42
|
-
export * from './Liquidation';
|
|
43
42
|
export * from './MarketInfo';
|
|
44
43
|
export * from './NextNonce';
|
|
45
44
|
export * from './Order';
|
package/openapi.json
CHANGED
|
@@ -532,7 +532,7 @@
|
|
|
532
532
|
{
|
|
533
533
|
"name": "api_key_index",
|
|
534
534
|
"in": "query",
|
|
535
|
-
"required":
|
|
535
|
+
"required": false,
|
|
536
536
|
"type": "integer",
|
|
537
537
|
"format": "uint8",
|
|
538
538
|
"default": "255"
|
|
@@ -1355,15 +1355,15 @@
|
|
|
1355
1355
|
"description": "Get points leaderboard"
|
|
1356
1356
|
}
|
|
1357
1357
|
},
|
|
1358
|
-
"/api/v1/
|
|
1359
|
-
"
|
|
1360
|
-
"summary": "
|
|
1361
|
-
"operationId": "
|
|
1358
|
+
"/api/v1/nextNonce": {
|
|
1359
|
+
"get": {
|
|
1360
|
+
"summary": "nextNonce",
|
|
1361
|
+
"operationId": "nextNonce",
|
|
1362
1362
|
"responses": {
|
|
1363
1363
|
"200": {
|
|
1364
1364
|
"description": "A successful response.",
|
|
1365
1365
|
"schema": {
|
|
1366
|
-
"$ref": "#/definitions/
|
|
1366
|
+
"$ref": "#/definitions/NextNonce"
|
|
1367
1367
|
}
|
|
1368
1368
|
},
|
|
1369
1369
|
"400": {
|
|
@@ -1375,32 +1375,38 @@
|
|
|
1375
1375
|
},
|
|
1376
1376
|
"parameters": [
|
|
1377
1377
|
{
|
|
1378
|
-
"name": "
|
|
1379
|
-
"in": "
|
|
1378
|
+
"name": "account_index",
|
|
1379
|
+
"in": "query",
|
|
1380
1380
|
"required": true,
|
|
1381
|
-
"
|
|
1382
|
-
|
|
1383
|
-
|
|
1381
|
+
"type": "integer",
|
|
1382
|
+
"format": "int64"
|
|
1383
|
+
},
|
|
1384
|
+
{
|
|
1385
|
+
"name": "api_key_index",
|
|
1386
|
+
"in": "query",
|
|
1387
|
+
"required": true,
|
|
1388
|
+
"type": "integer",
|
|
1389
|
+
"format": "uint8"
|
|
1384
1390
|
}
|
|
1385
1391
|
],
|
|
1386
1392
|
"tags": [
|
|
1387
|
-
"
|
|
1393
|
+
"transaction"
|
|
1388
1394
|
],
|
|
1389
1395
|
"consumes": [
|
|
1390
1396
|
"multipart/form-data"
|
|
1391
1397
|
],
|
|
1392
|
-
"description": "
|
|
1398
|
+
"description": "Get next nonce for a specific account and api key"
|
|
1393
1399
|
}
|
|
1394
1400
|
},
|
|
1395
|
-
"/api/v1/
|
|
1396
|
-
"
|
|
1397
|
-
"summary": "
|
|
1398
|
-
"operationId": "
|
|
1401
|
+
"/api/v1/notification/ack": {
|
|
1402
|
+
"post": {
|
|
1403
|
+
"summary": "notification_ack",
|
|
1404
|
+
"operationId": "notification_ack",
|
|
1399
1405
|
"responses": {
|
|
1400
1406
|
"200": {
|
|
1401
1407
|
"description": "A successful response.",
|
|
1402
1408
|
"schema": {
|
|
1403
|
-
"$ref": "#/definitions/
|
|
1409
|
+
"$ref": "#/definitions/ResultCode"
|
|
1404
1410
|
}
|
|
1405
1411
|
},
|
|
1406
1412
|
"400": {
|
|
@@ -1412,27 +1418,21 @@
|
|
|
1412
1418
|
},
|
|
1413
1419
|
"parameters": [
|
|
1414
1420
|
{
|
|
1415
|
-
"name": "
|
|
1416
|
-
"in": "
|
|
1417
|
-
"required": true,
|
|
1418
|
-
"type": "integer",
|
|
1419
|
-
"format": "int64"
|
|
1420
|
-
},
|
|
1421
|
-
{
|
|
1422
|
-
"name": "api_key_index",
|
|
1423
|
-
"in": "query",
|
|
1421
|
+
"name": "body",
|
|
1422
|
+
"in": "body",
|
|
1424
1423
|
"required": true,
|
|
1425
|
-
"
|
|
1426
|
-
|
|
1424
|
+
"schema": {
|
|
1425
|
+
"$ref": "#/definitions/ReqAckNotif"
|
|
1426
|
+
}
|
|
1427
1427
|
}
|
|
1428
1428
|
],
|
|
1429
1429
|
"tags": [
|
|
1430
|
-
"
|
|
1430
|
+
"notification"
|
|
1431
1431
|
],
|
|
1432
1432
|
"consumes": [
|
|
1433
1433
|
"multipart/form-data"
|
|
1434
1434
|
],
|
|
1435
|
-
"description": "
|
|
1435
|
+
"description": "Ack notification"
|
|
1436
1436
|
}
|
|
1437
1437
|
},
|
|
1438
1438
|
"/api/v1/orderBookDetails": {
|
|
@@ -3961,42 +3961,6 @@
|
|
|
3961
3961
|
"entryId"
|
|
3962
3962
|
]
|
|
3963
3963
|
},
|
|
3964
|
-
"Liquidation": {
|
|
3965
|
-
"type": "object",
|
|
3966
|
-
"properties": {
|
|
3967
|
-
"liquidation_id": {
|
|
3968
|
-
"type": "integer",
|
|
3969
|
-
"format": "int64",
|
|
3970
|
-
"example": "1"
|
|
3971
|
-
},
|
|
3972
|
-
"account_index": {
|
|
3973
|
-
"type": "integer",
|
|
3974
|
-
"format": "int64",
|
|
3975
|
-
"example": "1"
|
|
3976
|
-
},
|
|
3977
|
-
"liquidation_type": {
|
|
3978
|
-
"type": "integer",
|
|
3979
|
-
"format": "uint8",
|
|
3980
|
-
"example": "1"
|
|
3981
|
-
},
|
|
3982
|
-
"portfolio_value": {
|
|
3983
|
-
"type": "string",
|
|
3984
|
-
"example": "1"
|
|
3985
|
-
},
|
|
3986
|
-
"margin_requirement": {
|
|
3987
|
-
"type": "string",
|
|
3988
|
-
"example": "1"
|
|
3989
|
-
}
|
|
3990
|
-
},
|
|
3991
|
-
"title": "Liquidation",
|
|
3992
|
-
"required": [
|
|
3993
|
-
"liquidation_id",
|
|
3994
|
-
"account_index",
|
|
3995
|
-
"liquidation_type",
|
|
3996
|
-
"portfolio_value",
|
|
3997
|
-
"margin_requirement"
|
|
3998
|
-
]
|
|
3999
|
-
},
|
|
4000
3964
|
"MarketInfo": {
|
|
4001
3965
|
"type": "object",
|
|
4002
3966
|
"properties": {
|
|
@@ -5146,6 +5110,28 @@
|
|
|
5146
5110
|
"reward_point_multiplier"
|
|
5147
5111
|
]
|
|
5148
5112
|
},
|
|
5113
|
+
"ReqAckNotif": {
|
|
5114
|
+
"type": "object",
|
|
5115
|
+
"properties": {
|
|
5116
|
+
"notif_id": {
|
|
5117
|
+
"type": "string",
|
|
5118
|
+
"example": "'liq:17:5898'"
|
|
5119
|
+
},
|
|
5120
|
+
"auth": {
|
|
5121
|
+
"type": "string"
|
|
5122
|
+
},
|
|
5123
|
+
"account_index": {
|
|
5124
|
+
"type": "integer",
|
|
5125
|
+
"format": "int64"
|
|
5126
|
+
}
|
|
5127
|
+
},
|
|
5128
|
+
"title": "ReqAckNotif",
|
|
5129
|
+
"required": [
|
|
5130
|
+
"notif_id",
|
|
5131
|
+
"auth",
|
|
5132
|
+
"account_index"
|
|
5133
|
+
]
|
|
5134
|
+
},
|
|
5149
5135
|
"ReqCancelDeposit": {
|
|
5150
5136
|
"type": "object",
|
|
5151
5137
|
"properties": {
|
|
@@ -5292,8 +5278,7 @@
|
|
|
5292
5278
|
},
|
|
5293
5279
|
"title": "ReqGetAccountApiKeys",
|
|
5294
5280
|
"required": [
|
|
5295
|
-
"account_index"
|
|
5296
|
-
"api_key_index"
|
|
5281
|
+
"account_index"
|
|
5297
5282
|
]
|
|
5298
5283
|
},
|
|
5299
5284
|
"ReqGetAccountByL1Address": {
|
|
@@ -6022,39 +6007,6 @@
|
|
|
6022
6007
|
"l1_address"
|
|
6023
6008
|
]
|
|
6024
6009
|
},
|
|
6025
|
-
"ReqMarkNotifRead": {
|
|
6026
|
-
"type": "object",
|
|
6027
|
-
"properties": {
|
|
6028
|
-
"notif_type": {
|
|
6029
|
-
"type": "string",
|
|
6030
|
-
"enum": [
|
|
6031
|
-
"liquidation"
|
|
6032
|
-
]
|
|
6033
|
-
},
|
|
6034
|
-
"account_index": {
|
|
6035
|
-
"type": "integer",
|
|
6036
|
-
"format": "int64"
|
|
6037
|
-
},
|
|
6038
|
-
"api_key_index": {
|
|
6039
|
-
"type": "integer",
|
|
6040
|
-
"format": "uint8"
|
|
6041
|
-
},
|
|
6042
|
-
"liquidation_ids": {
|
|
6043
|
-
"type": "string"
|
|
6044
|
-
},
|
|
6045
|
-
"signature": {
|
|
6046
|
-
"type": "string"
|
|
6047
|
-
}
|
|
6048
|
-
},
|
|
6049
|
-
"title": "ReqMarkNotifRead",
|
|
6050
|
-
"required": [
|
|
6051
|
-
"notif_type",
|
|
6052
|
-
"account_index",
|
|
6053
|
-
"api_key_index",
|
|
6054
|
-
"liquidation_ids",
|
|
6055
|
-
"signature"
|
|
6056
|
-
]
|
|
6057
|
-
},
|
|
6058
6010
|
"ReqSendTx": {
|
|
6059
6011
|
"type": "object",
|
|
6060
6012
|
"properties": {
|