zklighter-perps 1.0.113 → 1.0.115
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/apis/AccountApi.ts +10 -0
- package/apis/OrderApi.ts +24 -0
- package/models/DetailedAccount.ts +0 -15
- package/models/ReqGetAccountOrders.ts +9 -0
- package/models/ReqGetAccountPnL.ts +8 -0
- package/models/ReqGetPositionFunding.ts +8 -0
- package/models/ReqGetTrades.ts +9 -0
- package/openapi.json +38 -7
- package/package.json +1 -1
package/apis/AccountApi.ts
CHANGED
|
@@ -87,12 +87,14 @@ export interface PnlRequest {
|
|
|
87
87
|
start_timestamp: number;
|
|
88
88
|
end_timestamp: number;
|
|
89
89
|
count_back: number;
|
|
90
|
+
auth?: string;
|
|
90
91
|
ignore_transfers?: boolean;
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
export interface PositionFundingRequest {
|
|
94
95
|
account_index: number;
|
|
95
96
|
limit: number;
|
|
97
|
+
auth?: string;
|
|
96
98
|
market_id?: number;
|
|
97
99
|
cursor?: string;
|
|
98
100
|
side?: PositionFundingSideEnum;
|
|
@@ -451,6 +453,10 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
451
453
|
|
|
452
454
|
const queryParameters: any = {};
|
|
453
455
|
|
|
456
|
+
if (requestParameters['auth'] != null) {
|
|
457
|
+
queryParameters['auth'] = requestParameters['auth'];
|
|
458
|
+
}
|
|
459
|
+
|
|
454
460
|
if (requestParameters['by'] != null) {
|
|
455
461
|
queryParameters['by'] = requestParameters['by'];
|
|
456
462
|
}
|
|
@@ -521,6 +527,10 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
521
527
|
|
|
522
528
|
const queryParameters: any = {};
|
|
523
529
|
|
|
530
|
+
if (requestParameters['auth'] != null) {
|
|
531
|
+
queryParameters['auth'] = requestParameters['auth'];
|
|
532
|
+
}
|
|
533
|
+
|
|
524
534
|
if (requestParameters['account_index'] != null) {
|
|
525
535
|
queryParameters['account_index'] = requestParameters['account_index'];
|
|
526
536
|
}
|
package/apis/OrderApi.ts
CHANGED
|
@@ -57,6 +57,7 @@ export interface AccountInactiveOrdersRequest {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
export interface AccountOrdersRequest {
|
|
60
|
+
auth: string;
|
|
60
61
|
account_index: number;
|
|
61
62
|
market_id: number;
|
|
62
63
|
limit: number;
|
|
@@ -82,6 +83,7 @@ export interface RecentTradesRequest {
|
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
export interface TradesRequest {
|
|
86
|
+
auth: string;
|
|
85
87
|
sort_by: TradesSortByEnum;
|
|
86
88
|
limit: number;
|
|
87
89
|
market_id?: number;
|
|
@@ -241,6 +243,13 @@ export class OrderApi extends runtime.BaseAPI {
|
|
|
241
243
|
* accountOrders
|
|
242
244
|
*/
|
|
243
245
|
async accountOrdersRaw(requestParameters: AccountOrdersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Orders>> {
|
|
246
|
+
if (requestParameters['auth'] == null) {
|
|
247
|
+
throw new runtime.RequiredError(
|
|
248
|
+
'auth',
|
|
249
|
+
'Required parameter "auth" was null or undefined when calling accountOrders().'
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
|
|
244
253
|
if (requestParameters['account_index'] == null) {
|
|
245
254
|
throw new runtime.RequiredError(
|
|
246
255
|
'account_index',
|
|
@@ -264,6 +273,10 @@ export class OrderApi extends runtime.BaseAPI {
|
|
|
264
273
|
|
|
265
274
|
const queryParameters: any = {};
|
|
266
275
|
|
|
276
|
+
if (requestParameters['auth'] != null) {
|
|
277
|
+
queryParameters['auth'] = requestParameters['auth'];
|
|
278
|
+
}
|
|
279
|
+
|
|
267
280
|
if (requestParameters['account_index'] != null) {
|
|
268
281
|
queryParameters['account_index'] = requestParameters['account_index'];
|
|
269
282
|
}
|
|
@@ -498,6 +511,13 @@ export class OrderApi extends runtime.BaseAPI {
|
|
|
498
511
|
* trades
|
|
499
512
|
*/
|
|
500
513
|
async tradesRaw(requestParameters: TradesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Trades>> {
|
|
514
|
+
if (requestParameters['auth'] == null) {
|
|
515
|
+
throw new runtime.RequiredError(
|
|
516
|
+
'auth',
|
|
517
|
+
'Required parameter "auth" was null or undefined when calling trades().'
|
|
518
|
+
);
|
|
519
|
+
}
|
|
520
|
+
|
|
501
521
|
if (requestParameters['sort_by'] == null) {
|
|
502
522
|
throw new runtime.RequiredError(
|
|
503
523
|
'sort_by',
|
|
@@ -514,6 +534,10 @@ export class OrderApi extends runtime.BaseAPI {
|
|
|
514
534
|
|
|
515
535
|
const queryParameters: any = {};
|
|
516
536
|
|
|
537
|
+
if (requestParameters['auth'] != null) {
|
|
538
|
+
queryParameters['auth'] = requestParameters['auth'];
|
|
539
|
+
}
|
|
540
|
+
|
|
517
541
|
if (requestParameters['market_id'] != null) {
|
|
518
542
|
queryParameters['market_id'] = requestParameters['market_id'];
|
|
519
543
|
}
|
|
@@ -13,12 +13,6 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { mapValues } from '../runtime';
|
|
16
|
-
import type { AccountMarketStats } from './AccountMarketStats';
|
|
17
|
-
import {
|
|
18
|
-
AccountMarketStatsFromJSON,
|
|
19
|
-
AccountMarketStatsFromJSONTyped,
|
|
20
|
-
AccountMarketStatsToJSON,
|
|
21
|
-
} from './AccountMarketStats';
|
|
22
16
|
import type { AccountPosition } from './AccountPosition';
|
|
23
17
|
import {
|
|
24
18
|
AccountPositionFromJSON,
|
|
@@ -146,12 +140,6 @@ export interface DetailedAccount {
|
|
|
146
140
|
* @memberof DetailedAccount
|
|
147
141
|
*/
|
|
148
142
|
total_asset_value: string;
|
|
149
|
-
/**
|
|
150
|
-
*
|
|
151
|
-
* @type {Array<AccountMarketStats>}
|
|
152
|
-
* @memberof DetailedAccount
|
|
153
|
-
*/
|
|
154
|
-
market_stats: Array<AccountMarketStats>;
|
|
155
143
|
/**
|
|
156
144
|
*
|
|
157
145
|
* @type {PublicPoolInfo}
|
|
@@ -186,7 +174,6 @@ export function instanceOfDetailedAccount(value: object): value is DetailedAccou
|
|
|
186
174
|
if (!('max_referral_usage_limit' in value) || value['max_referral_usage_limit'] === undefined) return false;
|
|
187
175
|
if (!('positions' in value) || value['positions'] === undefined) return false;
|
|
188
176
|
if (!('total_asset_value' in value) || value['total_asset_value'] === undefined) return false;
|
|
189
|
-
if (!('market_stats' in value) || value['market_stats'] === undefined) return false;
|
|
190
177
|
if (!('pool_info' in value) || value['pool_info'] === undefined) return false;
|
|
191
178
|
if (!('shares' in value) || value['shares'] === undefined) return false;
|
|
192
179
|
return true;
|
|
@@ -219,7 +206,6 @@ export function DetailedAccountFromJSONTyped(json: any, ignoreDiscriminator: boo
|
|
|
219
206
|
'max_referral_usage_limit': json['max_referral_usage_limit'],
|
|
220
207
|
'positions': ((json['positions'] as Array<any>).map(AccountPositionFromJSON)),
|
|
221
208
|
'total_asset_value': json['total_asset_value'],
|
|
222
|
-
'market_stats': ((json['market_stats'] as Array<any>).map(AccountMarketStatsFromJSON)),
|
|
223
209
|
'pool_info': PublicPoolInfoFromJSON(json['pool_info']),
|
|
224
210
|
'shares': ((json['shares'] as Array<any>).map(PublicPoolShareFromJSON)),
|
|
225
211
|
};
|
|
@@ -248,7 +234,6 @@ export function DetailedAccountToJSON(value?: DetailedAccount | null): any {
|
|
|
248
234
|
'max_referral_usage_limit': value['max_referral_usage_limit'],
|
|
249
235
|
'positions': ((value['positions'] as Array<any>).map(AccountPositionToJSON)),
|
|
250
236
|
'total_asset_value': value['total_asset_value'],
|
|
251
|
-
'market_stats': ((value['market_stats'] as Array<any>).map(AccountMarketStatsToJSON)),
|
|
252
237
|
'pool_info': PublicPoolInfoToJSON(value['pool_info']),
|
|
253
238
|
'shares': ((value['shares'] as Array<any>).map(PublicPoolShareToJSON)),
|
|
254
239
|
};
|
|
@@ -19,6 +19,12 @@ import { mapValues } from '../runtime';
|
|
|
19
19
|
* @interface ReqGetAccountOrders
|
|
20
20
|
*/
|
|
21
21
|
export interface ReqGetAccountOrders {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof ReqGetAccountOrders
|
|
26
|
+
*/
|
|
27
|
+
auth: string;
|
|
22
28
|
/**
|
|
23
29
|
*
|
|
24
30
|
* @type {number}
|
|
@@ -49,6 +55,7 @@ export interface ReqGetAccountOrders {
|
|
|
49
55
|
* Check if a given object implements the ReqGetAccountOrders interface.
|
|
50
56
|
*/
|
|
51
57
|
export function instanceOfReqGetAccountOrders(value: object): value is ReqGetAccountOrders {
|
|
58
|
+
if (!('auth' in value) || value['auth'] === undefined) return false;
|
|
52
59
|
if (!('account_index' in value) || value['account_index'] === undefined) return false;
|
|
53
60
|
if (!('market_id' in value) || value['market_id'] === undefined) return false;
|
|
54
61
|
if (!('limit' in value) || value['limit'] === undefined) return false;
|
|
@@ -65,6 +72,7 @@ export function ReqGetAccountOrdersFromJSONTyped(json: any, ignoreDiscriminator:
|
|
|
65
72
|
}
|
|
66
73
|
return {
|
|
67
74
|
|
|
75
|
+
'auth': json['auth'],
|
|
68
76
|
'account_index': json['account_index'],
|
|
69
77
|
'market_id': json['market_id'],
|
|
70
78
|
'cursor': json['cursor'] == null ? undefined : json['cursor'],
|
|
@@ -78,6 +86,7 @@ export function ReqGetAccountOrdersToJSON(value?: ReqGetAccountOrders | null): a
|
|
|
78
86
|
}
|
|
79
87
|
return {
|
|
80
88
|
|
|
89
|
+
'auth': value['auth'],
|
|
81
90
|
'account_index': value['account_index'],
|
|
82
91
|
'market_id': value['market_id'],
|
|
83
92
|
'cursor': value['cursor'],
|
|
@@ -19,6 +19,12 @@ import { mapValues } from '../runtime';
|
|
|
19
19
|
* @interface ReqGetAccountPnL
|
|
20
20
|
*/
|
|
21
21
|
export interface ReqGetAccountPnL {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof ReqGetAccountPnL
|
|
26
|
+
*/
|
|
27
|
+
auth?: string;
|
|
22
28
|
/**
|
|
23
29
|
*
|
|
24
30
|
* @type {string}
|
|
@@ -109,6 +115,7 @@ export function ReqGetAccountPnLFromJSONTyped(json: any, ignoreDiscriminator: bo
|
|
|
109
115
|
}
|
|
110
116
|
return {
|
|
111
117
|
|
|
118
|
+
'auth': json['auth'] == null ? undefined : json['auth'],
|
|
112
119
|
'by': json['by'],
|
|
113
120
|
'value': json['value'],
|
|
114
121
|
'resolution': json['resolution'],
|
|
@@ -125,6 +132,7 @@ export function ReqGetAccountPnLToJSON(value?: ReqGetAccountPnL | null): any {
|
|
|
125
132
|
}
|
|
126
133
|
return {
|
|
127
134
|
|
|
135
|
+
'auth': value['auth'],
|
|
128
136
|
'by': value['by'],
|
|
129
137
|
'value': value['value'],
|
|
130
138
|
'resolution': value['resolution'],
|
|
@@ -19,6 +19,12 @@ import { mapValues } from '../runtime';
|
|
|
19
19
|
* @interface ReqGetPositionFunding
|
|
20
20
|
*/
|
|
21
21
|
export interface ReqGetPositionFunding {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof ReqGetPositionFunding
|
|
26
|
+
*/
|
|
27
|
+
auth?: string;
|
|
22
28
|
/**
|
|
23
29
|
*
|
|
24
30
|
* @type {number}
|
|
@@ -82,6 +88,7 @@ export function ReqGetPositionFundingFromJSONTyped(json: any, ignoreDiscriminato
|
|
|
82
88
|
}
|
|
83
89
|
return {
|
|
84
90
|
|
|
91
|
+
'auth': json['auth'] == null ? undefined : json['auth'],
|
|
85
92
|
'account_index': json['account_index'],
|
|
86
93
|
'market_id': json['market_id'] == null ? undefined : json['market_id'],
|
|
87
94
|
'cursor': json['cursor'] == null ? undefined : json['cursor'],
|
|
@@ -96,6 +103,7 @@ export function ReqGetPositionFundingToJSON(value?: ReqGetPositionFunding | null
|
|
|
96
103
|
}
|
|
97
104
|
return {
|
|
98
105
|
|
|
106
|
+
'auth': value['auth'],
|
|
99
107
|
'account_index': value['account_index'],
|
|
100
108
|
'market_id': value['market_id'],
|
|
101
109
|
'cursor': value['cursor'],
|
package/models/ReqGetTrades.ts
CHANGED
|
@@ -19,6 +19,12 @@ import { mapValues } from '../runtime';
|
|
|
19
19
|
* @interface ReqGetTrades
|
|
20
20
|
*/
|
|
21
21
|
export interface ReqGetTrades {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof ReqGetTrades
|
|
26
|
+
*/
|
|
27
|
+
auth: string;
|
|
22
28
|
/**
|
|
23
29
|
*
|
|
24
30
|
* @type {number}
|
|
@@ -100,6 +106,7 @@ export type ReqGetTradesSortDirEnum = typeof ReqGetTradesSortDirEnum[keyof typeo
|
|
|
100
106
|
* Check if a given object implements the ReqGetTrades interface.
|
|
101
107
|
*/
|
|
102
108
|
export function instanceOfReqGetTrades(value: object): value is ReqGetTrades {
|
|
109
|
+
if (!('auth' in value) || value['auth'] === undefined) return false;
|
|
103
110
|
if (!('sort_by' in value) || value['sort_by'] === undefined) return false;
|
|
104
111
|
if (!('limit' in value) || value['limit'] === undefined) return false;
|
|
105
112
|
return true;
|
|
@@ -115,6 +122,7 @@ export function ReqGetTradesFromJSONTyped(json: any, ignoreDiscriminator: boolea
|
|
|
115
122
|
}
|
|
116
123
|
return {
|
|
117
124
|
|
|
125
|
+
'auth': json['auth'],
|
|
118
126
|
'market_id': json['market_id'] == null ? undefined : json['market_id'],
|
|
119
127
|
'account_index': json['account_index'] == null ? undefined : json['account_index'],
|
|
120
128
|
'order_index': json['order_index'] == null ? undefined : json['order_index'],
|
|
@@ -133,6 +141,7 @@ export function ReqGetTradesToJSON(value?: ReqGetTrades | null): any {
|
|
|
133
141
|
}
|
|
134
142
|
return {
|
|
135
143
|
|
|
144
|
+
'auth': value['auth'],
|
|
136
145
|
'market_id': value['market_id'],
|
|
137
146
|
'account_index': value['account_index'],
|
|
138
147
|
'order_index': value['order_index'],
|
package/openapi.json
CHANGED
|
@@ -231,6 +231,12 @@
|
|
|
231
231
|
}
|
|
232
232
|
},
|
|
233
233
|
"parameters": [
|
|
234
|
+
{
|
|
235
|
+
"name": "auth",
|
|
236
|
+
"in": "query",
|
|
237
|
+
"required": true,
|
|
238
|
+
"type": "string"
|
|
239
|
+
},
|
|
234
240
|
{
|
|
235
241
|
"name": "account_index",
|
|
236
242
|
"in": "query",
|
|
@@ -1607,6 +1613,12 @@
|
|
|
1607
1613
|
}
|
|
1608
1614
|
},
|
|
1609
1615
|
"parameters": [
|
|
1616
|
+
{
|
|
1617
|
+
"name": "auth",
|
|
1618
|
+
"in": "query",
|
|
1619
|
+
"required": false,
|
|
1620
|
+
"type": "string"
|
|
1621
|
+
},
|
|
1610
1622
|
{
|
|
1611
1623
|
"name": "by",
|
|
1612
1624
|
"in": "query",
|
|
@@ -1698,6 +1710,12 @@
|
|
|
1698
1710
|
}
|
|
1699
1711
|
},
|
|
1700
1712
|
"parameters": [
|
|
1713
|
+
{
|
|
1714
|
+
"name": "auth",
|
|
1715
|
+
"in": "query",
|
|
1716
|
+
"required": false,
|
|
1717
|
+
"type": "string"
|
|
1718
|
+
},
|
|
1701
1719
|
{
|
|
1702
1720
|
"name": "account_index",
|
|
1703
1721
|
"in": "query",
|
|
@@ -2147,6 +2165,12 @@
|
|
|
2147
2165
|
}
|
|
2148
2166
|
},
|
|
2149
2167
|
"parameters": [
|
|
2168
|
+
{
|
|
2169
|
+
"name": "auth",
|
|
2170
|
+
"in": "query",
|
|
2171
|
+
"required": true,
|
|
2172
|
+
"type": "string"
|
|
2173
|
+
},
|
|
2150
2174
|
{
|
|
2151
2175
|
"name": "market_id",
|
|
2152
2176
|
"in": "query",
|
|
@@ -3461,12 +3485,6 @@
|
|
|
3461
3485
|
"type": "string",
|
|
3462
3486
|
"example": "19995"
|
|
3463
3487
|
},
|
|
3464
|
-
"market_stats": {
|
|
3465
|
-
"type": "array",
|
|
3466
|
-
"items": {
|
|
3467
|
-
"$ref": "#/definitions/AccountMarketStats"
|
|
3468
|
-
}
|
|
3469
|
-
},
|
|
3470
3488
|
"pool_info": {
|
|
3471
3489
|
"$ref": "#/definitions/PublicPoolInfo"
|
|
3472
3490
|
},
|
|
@@ -3495,7 +3513,6 @@
|
|
|
3495
3513
|
"max_referral_usage_limit",
|
|
3496
3514
|
"positions",
|
|
3497
3515
|
"total_asset_value",
|
|
3498
|
-
"market_stats",
|
|
3499
3516
|
"pool_info",
|
|
3500
3517
|
"shares"
|
|
3501
3518
|
]
|
|
@@ -5523,6 +5540,9 @@
|
|
|
5523
5540
|
"ReqGetAccountOrders": {
|
|
5524
5541
|
"type": "object",
|
|
5525
5542
|
"properties": {
|
|
5543
|
+
"auth": {
|
|
5544
|
+
"type": "string"
|
|
5545
|
+
},
|
|
5526
5546
|
"account_index": {
|
|
5527
5547
|
"type": "integer",
|
|
5528
5548
|
"format": "int64"
|
|
@@ -5543,6 +5563,7 @@
|
|
|
5543
5563
|
},
|
|
5544
5564
|
"title": "ReqGetAccountOrders",
|
|
5545
5565
|
"required": [
|
|
5566
|
+
"auth",
|
|
5546
5567
|
"account_index",
|
|
5547
5568
|
"market_id",
|
|
5548
5569
|
"limit"
|
|
@@ -5573,6 +5594,9 @@
|
|
|
5573
5594
|
"ReqGetAccountPnL": {
|
|
5574
5595
|
"type": "object",
|
|
5575
5596
|
"properties": {
|
|
5597
|
+
"auth": {
|
|
5598
|
+
"type": "string"
|
|
5599
|
+
},
|
|
5576
5600
|
"by": {
|
|
5577
5601
|
"type": "string",
|
|
5578
5602
|
"enum": [
|
|
@@ -5970,6 +5994,9 @@
|
|
|
5970
5994
|
"ReqGetPositionFunding": {
|
|
5971
5995
|
"type": "object",
|
|
5972
5996
|
"properties": {
|
|
5997
|
+
"auth": {
|
|
5998
|
+
"type": "string"
|
|
5999
|
+
},
|
|
5973
6000
|
"account_index": {
|
|
5974
6001
|
"type": "integer",
|
|
5975
6002
|
"format": "int64"
|
|
@@ -6155,6 +6182,9 @@
|
|
|
6155
6182
|
"ReqGetTrades": {
|
|
6156
6183
|
"type": "object",
|
|
6157
6184
|
"properties": {
|
|
6185
|
+
"auth": {
|
|
6186
|
+
"type": "string"
|
|
6187
|
+
},
|
|
6158
6188
|
"market_id": {
|
|
6159
6189
|
"type": "integer",
|
|
6160
6190
|
"format": "uint8",
|
|
@@ -6207,6 +6237,7 @@
|
|
|
6207
6237
|
},
|
|
6208
6238
|
"title": "ReqGetTrades",
|
|
6209
6239
|
"required": [
|
|
6240
|
+
"auth",
|
|
6210
6241
|
"sort_by",
|
|
6211
6242
|
"limit"
|
|
6212
6243
|
]
|