zklighter-perps 1.0.199 → 1.0.201
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 -0
- package/apis/InfoApi.ts +31 -0
- package/apis/TransactionApi.ts +17 -0
- package/models/PendingUnlock.ts +12 -12
- package/models/ReqGetTransferHistory.ts +8 -0
- package/models/SystemConfig.ts +105 -0
- package/models/index.ts +1 -0
- package/openapi.json +100 -7
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
package/apis/InfoApi.ts
CHANGED
|
@@ -18,6 +18,7 @@ import type {
|
|
|
18
18
|
Layer1BasicInfo,
|
|
19
19
|
RespWithdrawalDelay,
|
|
20
20
|
ResultCode,
|
|
21
|
+
SystemConfig,
|
|
21
22
|
TransferFeeInfo,
|
|
22
23
|
} from '../models/index';
|
|
23
24
|
import {
|
|
@@ -27,6 +28,8 @@ import {
|
|
|
27
28
|
RespWithdrawalDelayToJSON,
|
|
28
29
|
ResultCodeFromJSON,
|
|
29
30
|
ResultCodeToJSON,
|
|
31
|
+
SystemConfigFromJSON,
|
|
32
|
+
SystemConfigToJSON,
|
|
30
33
|
TransferFeeInfoFromJSON,
|
|
31
34
|
TransferFeeInfoToJSON,
|
|
32
35
|
} from '../models/index';
|
|
@@ -71,6 +74,34 @@ export class InfoApi extends runtime.BaseAPI {
|
|
|
71
74
|
return await response.value();
|
|
72
75
|
}
|
|
73
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Get system configuration including pool indexes and lockup/cooldown periods
|
|
79
|
+
* systemConfig
|
|
80
|
+
*/
|
|
81
|
+
async systemConfigRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SystemConfig>> {
|
|
82
|
+
const queryParameters: any = {};
|
|
83
|
+
|
|
84
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
85
|
+
|
|
86
|
+
const response = await this.request({
|
|
87
|
+
path: `/api/v1/systemConfig`,
|
|
88
|
+
method: 'GET',
|
|
89
|
+
headers: headerParameters,
|
|
90
|
+
query: queryParameters,
|
|
91
|
+
}, initOverrides);
|
|
92
|
+
|
|
93
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SystemConfigFromJSON(jsonValue));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Get system configuration including pool indexes and lockup/cooldown periods
|
|
98
|
+
* systemConfig
|
|
99
|
+
*/
|
|
100
|
+
async systemConfig(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SystemConfig> {
|
|
101
|
+
const response = await this.systemConfigRaw(initOverrides);
|
|
102
|
+
return await response.value();
|
|
103
|
+
}
|
|
104
|
+
|
|
74
105
|
/**
|
|
75
106
|
* Transfer fee info
|
|
76
107
|
* transferFeeInfo
|
package/apis/TransactionApi.ts
CHANGED
|
@@ -100,6 +100,7 @@ export interface TransferHistoryRequest {
|
|
|
100
100
|
authorization?: string;
|
|
101
101
|
auth?: string;
|
|
102
102
|
cursor?: string;
|
|
103
|
+
type?: TransferHistoryTypeEnum;
|
|
103
104
|
}
|
|
104
105
|
|
|
105
106
|
export interface TxRequest {
|
|
@@ -631,6 +632,10 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
631
632
|
queryParameters['cursor'] = requestParameters['cursor'];
|
|
632
633
|
}
|
|
633
634
|
|
|
635
|
+
if (requestParameters['type'] != null) {
|
|
636
|
+
queryParameters['type'] = requestParameters['type'];
|
|
637
|
+
}
|
|
638
|
+
|
|
634
639
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
635
640
|
|
|
636
641
|
const response = await this.request({
|
|
@@ -865,6 +870,18 @@ export const DepositHistoryFilterEnum = {
|
|
|
865
870
|
Claimable: 'claimable'
|
|
866
871
|
} as const;
|
|
867
872
|
export type DepositHistoryFilterEnum = typeof DepositHistoryFilterEnum[keyof typeof DepositHistoryFilterEnum];
|
|
873
|
+
/**
|
|
874
|
+
* @export
|
|
875
|
+
*/
|
|
876
|
+
export const TransferHistoryTypeEnum = {
|
|
877
|
+
All: 'all',
|
|
878
|
+
L2Transfer: 'L2Transfer',
|
|
879
|
+
L2MintShares: 'L2MintShares',
|
|
880
|
+
L2BurnShares: 'L2BurnShares',
|
|
881
|
+
L2StakeAssets: 'L2StakeAssets',
|
|
882
|
+
L2UnstakeAssets: 'L2UnstakeAssets'
|
|
883
|
+
} as const;
|
|
884
|
+
export type TransferHistoryTypeEnum = typeof TransferHistoryTypeEnum[keyof typeof TransferHistoryTypeEnum];
|
|
868
885
|
/**
|
|
869
886
|
* @export
|
|
870
887
|
*/
|
package/models/PendingUnlock.ts
CHANGED
|
@@ -24,28 +24,28 @@ export interface PendingUnlock {
|
|
|
24
24
|
* @type {number}
|
|
25
25
|
* @memberof PendingUnlock
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
unlock_timestamp: number;
|
|
28
28
|
/**
|
|
29
29
|
*
|
|
30
30
|
* @type {number}
|
|
31
31
|
* @memberof PendingUnlock
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
asset_index: number;
|
|
34
34
|
/**
|
|
35
35
|
*
|
|
36
36
|
* @type {string}
|
|
37
37
|
* @memberof PendingUnlock
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
amount: string;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Check if a given object implements the PendingUnlock interface.
|
|
44
44
|
*/
|
|
45
45
|
export function instanceOfPendingUnlock(value: object): value is PendingUnlock {
|
|
46
|
-
if (!('
|
|
47
|
-
if (!('
|
|
48
|
-
if (!('
|
|
46
|
+
if (!('unlock_timestamp' in value) || value['unlock_timestamp'] === undefined) return false;
|
|
47
|
+
if (!('asset_index' in value) || value['asset_index'] === undefined) return false;
|
|
48
|
+
if (!('amount' in value) || value['amount'] === undefined) return false;
|
|
49
49
|
return true;
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -59,9 +59,9 @@ export function PendingUnlockFromJSONTyped(json: any, ignoreDiscriminator: boole
|
|
|
59
59
|
}
|
|
60
60
|
return {
|
|
61
61
|
|
|
62
|
-
'
|
|
63
|
-
'
|
|
64
|
-
'
|
|
62
|
+
'unlock_timestamp': json['unlock_timestamp'],
|
|
63
|
+
'asset_index': json['asset_index'],
|
|
64
|
+
'amount': json['amount'],
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -71,9 +71,9 @@ export function PendingUnlockToJSON(value?: PendingUnlock | null): any {
|
|
|
71
71
|
}
|
|
72
72
|
return {
|
|
73
73
|
|
|
74
|
-
'
|
|
75
|
-
'
|
|
76
|
-
'
|
|
74
|
+
'unlock_timestamp': value['unlock_timestamp'],
|
|
75
|
+
'asset_index': value['asset_index'],
|
|
76
|
+
'amount': value['amount'],
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -37,6 +37,12 @@ export interface ReqGetTransferHistory {
|
|
|
37
37
|
* @memberof ReqGetTransferHistory
|
|
38
38
|
*/
|
|
39
39
|
cursor?: string;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {Array<string>}
|
|
43
|
+
* @memberof ReqGetTransferHistory
|
|
44
|
+
*/
|
|
45
|
+
type?: Array<string>;
|
|
40
46
|
}
|
|
41
47
|
|
|
42
48
|
/**
|
|
@@ -60,6 +66,7 @@ export function ReqGetTransferHistoryFromJSONTyped(json: any, ignoreDiscriminato
|
|
|
60
66
|
'auth': json['auth'] == null ? undefined : json['auth'],
|
|
61
67
|
'account_index': json['account_index'],
|
|
62
68
|
'cursor': json['cursor'] == null ? undefined : json['cursor'],
|
|
69
|
+
'type': json['type'] == null ? undefined : json['type'],
|
|
63
70
|
};
|
|
64
71
|
}
|
|
65
72
|
|
|
@@ -72,6 +79,7 @@ export function ReqGetTransferHistoryToJSON(value?: ReqGetTransferHistory | null
|
|
|
72
79
|
'auth': value['auth'],
|
|
73
80
|
'account_index': value['account_index'],
|
|
74
81
|
'cursor': value['cursor'],
|
|
82
|
+
'type': value['type'],
|
|
75
83
|
};
|
|
76
84
|
}
|
|
77
85
|
|
|
@@ -0,0 +1,105 @@
|
|
|
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 SystemConfig
|
|
20
|
+
*/
|
|
21
|
+
export interface SystemConfig {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof SystemConfig
|
|
26
|
+
*/
|
|
27
|
+
code: number;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof SystemConfig
|
|
32
|
+
*/
|
|
33
|
+
message?: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {number}
|
|
37
|
+
* @memberof SystemConfig
|
|
38
|
+
*/
|
|
39
|
+
liquidity_pool_index: number;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {number}
|
|
43
|
+
* @memberof SystemConfig
|
|
44
|
+
*/
|
|
45
|
+
staking_pool_index: number;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {number}
|
|
49
|
+
* @memberof SystemConfig
|
|
50
|
+
*/
|
|
51
|
+
liquidity_pool_cooldown_period: number;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {number}
|
|
55
|
+
* @memberof SystemConfig
|
|
56
|
+
*/
|
|
57
|
+
staking_pool_lockup_period: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Check if a given object implements the SystemConfig interface.
|
|
62
|
+
*/
|
|
63
|
+
export function instanceOfSystemConfig(value: object): value is SystemConfig {
|
|
64
|
+
if (!('code' in value) || value['code'] === undefined) return false;
|
|
65
|
+
if (!('liquidity_pool_index' in value) || value['liquidity_pool_index'] === undefined) return false;
|
|
66
|
+
if (!('staking_pool_index' in value) || value['staking_pool_index'] === undefined) return false;
|
|
67
|
+
if (!('liquidity_pool_cooldown_period' in value) || value['liquidity_pool_cooldown_period'] === undefined) return false;
|
|
68
|
+
if (!('staking_pool_lockup_period' in value) || value['staking_pool_lockup_period'] === undefined) return false;
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function SystemConfigFromJSON(json: any): SystemConfig {
|
|
73
|
+
return SystemConfigFromJSONTyped(json, false);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function SystemConfigFromJSONTyped(json: any, ignoreDiscriminator: boolean): SystemConfig {
|
|
77
|
+
if (json == null) {
|
|
78
|
+
return json;
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
|
|
82
|
+
'code': json['code'],
|
|
83
|
+
'message': json['message'] == null ? undefined : json['message'],
|
|
84
|
+
'liquidity_pool_index': json['liquidity_pool_index'],
|
|
85
|
+
'staking_pool_index': json['staking_pool_index'],
|
|
86
|
+
'liquidity_pool_cooldown_period': json['liquidity_pool_cooldown_period'],
|
|
87
|
+
'staking_pool_lockup_period': json['staking_pool_lockup_period'],
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function SystemConfigToJSON(value?: SystemConfig | null): any {
|
|
92
|
+
if (value == null) {
|
|
93
|
+
return value;
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
|
|
97
|
+
'code': value['code'],
|
|
98
|
+
'message': value['message'],
|
|
99
|
+
'liquidity_pool_index': value['liquidity_pool_index'],
|
|
100
|
+
'staking_pool_index': value['staking_pool_index'],
|
|
101
|
+
'liquidity_pool_cooldown_period': value['liquidity_pool_cooldown_period'],
|
|
102
|
+
'staking_pool_lockup_period': value['staking_pool_lockup_period'],
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
package/models/index.ts
CHANGED
|
@@ -164,6 +164,7 @@ export * from './SpotMarketStats';
|
|
|
164
164
|
export * from './SpotOrderBookDetail';
|
|
165
165
|
export * from './Status';
|
|
166
166
|
export * from './SubAccounts';
|
|
167
|
+
export * from './SystemConfig';
|
|
167
168
|
export * from './Ticker';
|
|
168
169
|
export * from './Trade';
|
|
169
170
|
export * from './Trades';
|
package/openapi.json
CHANGED
|
@@ -3059,6 +3059,30 @@
|
|
|
3059
3059
|
"description": "Set account metadata"
|
|
3060
3060
|
}
|
|
3061
3061
|
},
|
|
3062
|
+
"/api/v1/systemConfig": {
|
|
3063
|
+
"get": {
|
|
3064
|
+
"summary": "systemConfig",
|
|
3065
|
+
"operationId": "systemConfig",
|
|
3066
|
+
"responses": {
|
|
3067
|
+
"200": {
|
|
3068
|
+
"description": "A successful response.",
|
|
3069
|
+
"schema": {
|
|
3070
|
+
"$ref": "#/definitions/SystemConfig"
|
|
3071
|
+
}
|
|
3072
|
+
},
|
|
3073
|
+
"400": {
|
|
3074
|
+
"description": "Bad request",
|
|
3075
|
+
"schema": {
|
|
3076
|
+
"$ref": "#/definitions/ResultCode"
|
|
3077
|
+
}
|
|
3078
|
+
}
|
|
3079
|
+
},
|
|
3080
|
+
"tags": [
|
|
3081
|
+
"info"
|
|
3082
|
+
],
|
|
3083
|
+
"description": "Get system configuration including pool indexes and lockup/cooldown periods"
|
|
3084
|
+
}
|
|
3085
|
+
},
|
|
3062
3086
|
"/api/v1/tokens": {
|
|
3063
3087
|
"get": {
|
|
3064
3088
|
"summary": "tokens",
|
|
@@ -3385,6 +3409,20 @@
|
|
|
3385
3409
|
"in": "query",
|
|
3386
3410
|
"required": false,
|
|
3387
3411
|
"type": "string"
|
|
3412
|
+
},
|
|
3413
|
+
{
|
|
3414
|
+
"name": "type",
|
|
3415
|
+
"in": "query",
|
|
3416
|
+
"required": false,
|
|
3417
|
+
"type": "string",
|
|
3418
|
+
"enum": [
|
|
3419
|
+
"all",
|
|
3420
|
+
"L2Transfer",
|
|
3421
|
+
"L2MintShares",
|
|
3422
|
+
"L2BurnShares",
|
|
3423
|
+
"L2StakeAssets",
|
|
3424
|
+
"L2UnstakeAssets"
|
|
3425
|
+
]
|
|
3388
3426
|
}
|
|
3389
3427
|
],
|
|
3390
3428
|
"tags": [
|
|
@@ -7062,26 +7100,26 @@
|
|
|
7062
7100
|
"PendingUnlock": {
|
|
7063
7101
|
"type": "object",
|
|
7064
7102
|
"properties": {
|
|
7065
|
-
"
|
|
7103
|
+
"unlock_timestamp": {
|
|
7066
7104
|
"type": "integer",
|
|
7067
7105
|
"format": "int64",
|
|
7068
|
-
"example": "
|
|
7106
|
+
"example": "1640995200"
|
|
7069
7107
|
},
|
|
7070
|
-
"
|
|
7108
|
+
"asset_index": {
|
|
7071
7109
|
"type": "integer",
|
|
7072
7110
|
"format": "int16",
|
|
7073
7111
|
"example": "1"
|
|
7074
7112
|
},
|
|
7075
|
-
"
|
|
7113
|
+
"amount": {
|
|
7076
7114
|
"type": "string",
|
|
7077
7115
|
"example": "1"
|
|
7078
7116
|
}
|
|
7079
7117
|
},
|
|
7080
7118
|
"title": "PendingUnlock",
|
|
7081
7119
|
"required": [
|
|
7082
|
-
"
|
|
7083
|
-
"
|
|
7084
|
-
"
|
|
7120
|
+
"unlock_timestamp",
|
|
7121
|
+
"asset_index",
|
|
7122
|
+
"amount"
|
|
7085
7123
|
]
|
|
7086
7124
|
},
|
|
7087
7125
|
"PerpsMarketStats": {
|
|
@@ -9193,6 +9231,20 @@
|
|
|
9193
9231
|
},
|
|
9194
9232
|
"cursor": {
|
|
9195
9233
|
"type": "string"
|
|
9234
|
+
},
|
|
9235
|
+
"type": {
|
|
9236
|
+
"type": "array",
|
|
9237
|
+
"items": {
|
|
9238
|
+
"type": "string"
|
|
9239
|
+
},
|
|
9240
|
+
"enum": [
|
|
9241
|
+
"all",
|
|
9242
|
+
"L2Transfer",
|
|
9243
|
+
"L2MintShares",
|
|
9244
|
+
"L2BurnShares",
|
|
9245
|
+
"L2StakeAssets",
|
|
9246
|
+
"L2UnstakeAssets"
|
|
9247
|
+
]
|
|
9196
9248
|
}
|
|
9197
9249
|
},
|
|
9198
9250
|
"title": "ReqGetTransferHistory",
|
|
@@ -10334,6 +10386,47 @@
|
|
|
10334
10386
|
"sub_accounts"
|
|
10335
10387
|
]
|
|
10336
10388
|
},
|
|
10389
|
+
"SystemConfig": {
|
|
10390
|
+
"type": "object",
|
|
10391
|
+
"properties": {
|
|
10392
|
+
"code": {
|
|
10393
|
+
"type": "integer",
|
|
10394
|
+
"format": "int32",
|
|
10395
|
+
"example": "200"
|
|
10396
|
+
},
|
|
10397
|
+
"message": {
|
|
10398
|
+
"type": "string"
|
|
10399
|
+
},
|
|
10400
|
+
"liquidity_pool_index": {
|
|
10401
|
+
"type": "integer",
|
|
10402
|
+
"format": "int64",
|
|
10403
|
+
"example": "1"
|
|
10404
|
+
},
|
|
10405
|
+
"staking_pool_index": {
|
|
10406
|
+
"type": "integer",
|
|
10407
|
+
"format": "int64",
|
|
10408
|
+
"example": "2"
|
|
10409
|
+
},
|
|
10410
|
+
"liquidity_pool_cooldown_period": {
|
|
10411
|
+
"type": "integer",
|
|
10412
|
+
"format": "int64",
|
|
10413
|
+
"example": "86400"
|
|
10414
|
+
},
|
|
10415
|
+
"staking_pool_lockup_period": {
|
|
10416
|
+
"type": "integer",
|
|
10417
|
+
"format": "int64",
|
|
10418
|
+
"example": "604800"
|
|
10419
|
+
}
|
|
10420
|
+
},
|
|
10421
|
+
"title": "SystemConfig",
|
|
10422
|
+
"required": [
|
|
10423
|
+
"code",
|
|
10424
|
+
"liquidity_pool_index",
|
|
10425
|
+
"staking_pool_index",
|
|
10426
|
+
"liquidity_pool_cooldown_period",
|
|
10427
|
+
"staking_pool_lockup_period"
|
|
10428
|
+
]
|
|
10429
|
+
},
|
|
10337
10430
|
"Ticker": {
|
|
10338
10431
|
"type": "object",
|
|
10339
10432
|
"properties": {
|