zklighter-perps 1.0.15 → 1.0.17
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 +5 -4
- package/apis/AccountApi.ts +12 -24
- package/apis/LiquidationApi.ts +121 -0
- package/apis/OrderApi.ts +0 -24
- package/apis/TransactionApi.ts +6 -6
- package/apis/index.ts +1 -0
- package/models/Account.ts +104 -0
- package/models/Accounts.ts +93 -0
- package/models/DetailedAccount.ts +0 -32
- package/models/EnrichedTx.ts +4 -12
- package/models/Liquidation.ts +76 -0
- package/models/Order.ts +0 -8
- package/models/ReqGetAccountActiveOrders.ts +0 -9
- package/models/ReqGetAccountInactiveOrders.ts +0 -9
- package/models/ReqGetNextNonce.ts +4 -4
- package/models/ReqMarkNotifRead.ts +97 -0
- package/models/SimpleOrder.ts +0 -9
- package/models/SubAccounts.ts +9 -27
- package/models/Tx.ts +4 -4
- package/models/index.ts +4 -4
- package/openapi.json +182 -237
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
|
@@ -2,15 +2,18 @@ apis/AccountApi.ts
|
|
|
2
2
|
apis/BlockApi.ts
|
|
3
3
|
apis/CandlestickApi.ts
|
|
4
4
|
apis/InfoApi.ts
|
|
5
|
+
apis/LiquidationApi.ts
|
|
5
6
|
apis/OrderApi.ts
|
|
6
7
|
apis/RootApi.ts
|
|
7
8
|
apis/TransactionApi.ts
|
|
8
9
|
apis/index.ts
|
|
9
10
|
index.ts
|
|
11
|
+
models/Account.ts
|
|
10
12
|
models/AccountMarketStats.ts
|
|
11
13
|
models/AccountPnL.ts
|
|
12
14
|
models/AccountPosition.ts
|
|
13
15
|
models/AccountStats.ts
|
|
16
|
+
models/Accounts.ts
|
|
14
17
|
models/Block.ts
|
|
15
18
|
models/Blocks.ts
|
|
16
19
|
models/Candlestick.ts
|
|
@@ -27,8 +30,7 @@ models/Fundings.ts
|
|
|
27
30
|
models/L1ProviderInfo.ts
|
|
28
31
|
models/Layer1BasicInfo.ts
|
|
29
32
|
models/Layer2BasicInfo.ts
|
|
30
|
-
models/
|
|
31
|
-
models/MainAccounts.ts
|
|
33
|
+
models/Liquidation.ts
|
|
32
34
|
models/MarketInfo.ts
|
|
33
35
|
models/NextNonce.ts
|
|
34
36
|
models/Order.ts
|
|
@@ -68,9 +70,9 @@ models/ReqGetRangeWithIndex.ts
|
|
|
68
70
|
models/ReqGetRangeWithIndexSortable.ts
|
|
69
71
|
models/ReqGetRecentTrades.ts
|
|
70
72
|
models/ReqGetRollbacks.ts
|
|
71
|
-
models/ReqGetSubAccount.ts
|
|
72
73
|
models/ReqGetTrades.ts
|
|
73
74
|
models/ReqGetTx.ts
|
|
75
|
+
models/ReqMarkNotifRead.ts
|
|
74
76
|
models/ReqSearch.ts
|
|
75
77
|
models/ResultCode.ts
|
|
76
78
|
models/Rollback.ts
|
|
@@ -79,7 +81,6 @@ models/Search.ts
|
|
|
79
81
|
models/SignBody.ts
|
|
80
82
|
models/SimpleOrder.ts
|
|
81
83
|
models/Status.ts
|
|
82
|
-
models/SubAccount.ts
|
|
83
84
|
models/SubAccounts.ts
|
|
84
85
|
models/Trade.ts
|
|
85
86
|
models/Trades.ts
|
package/apis/AccountApi.ts
CHANGED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
18
|
AccountPnL,
|
|
19
|
+
Accounts,
|
|
19
20
|
DetailedAccounts,
|
|
20
|
-
MainAccounts,
|
|
21
21
|
Permission,
|
|
22
22
|
ResultCode,
|
|
23
23
|
SubAccounts,
|
|
@@ -25,10 +25,10 @@ import type {
|
|
|
25
25
|
import {
|
|
26
26
|
AccountPnLFromJSON,
|
|
27
27
|
AccountPnLToJSON,
|
|
28
|
+
AccountsFromJSON,
|
|
29
|
+
AccountsToJSON,
|
|
28
30
|
DetailedAccountsFromJSON,
|
|
29
31
|
DetailedAccountsToJSON,
|
|
30
|
-
MainAccountsFromJSON,
|
|
31
|
-
MainAccountsToJSON,
|
|
32
32
|
PermissionFromJSON,
|
|
33
33
|
PermissionToJSON,
|
|
34
34
|
ResultCodeFromJSON,
|
|
@@ -44,7 +44,6 @@ export interface DoFaucetRequest {
|
|
|
44
44
|
export interface GetAccountRequest {
|
|
45
45
|
by: GetAccountByEnum;
|
|
46
46
|
value: string;
|
|
47
|
-
sub_account_index: number;
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
export interface GetAccountPnlRequest {
|
|
@@ -117,7 +116,7 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
117
116
|
}
|
|
118
117
|
|
|
119
118
|
/**
|
|
120
|
-
* Get account by
|
|
119
|
+
* Get account by account\'s l1_address or index. Returns detailed account info
|
|
121
120
|
* GetAccount
|
|
122
121
|
*/
|
|
123
122
|
async getAccountRaw(requestParameters: GetAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DetailedAccounts>> {
|
|
@@ -135,13 +134,6 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
135
134
|
);
|
|
136
135
|
}
|
|
137
136
|
|
|
138
|
-
if (requestParameters['sub_account_index'] == null) {
|
|
139
|
-
throw new runtime.RequiredError(
|
|
140
|
-
'sub_account_index',
|
|
141
|
-
'Required parameter "sub_account_index" was null or undefined when calling getAccount().'
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
137
|
const queryParameters: any = {};
|
|
146
138
|
|
|
147
139
|
if (requestParameters['by'] != null) {
|
|
@@ -152,10 +144,6 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
152
144
|
queryParameters['value'] = requestParameters['value'];
|
|
153
145
|
}
|
|
154
146
|
|
|
155
|
-
if (requestParameters['sub_account_index'] != null) {
|
|
156
|
-
queryParameters['sub_account_index'] = requestParameters['sub_account_index'];
|
|
157
|
-
}
|
|
158
|
-
|
|
159
147
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
160
148
|
|
|
161
149
|
const response = await this.request({
|
|
@@ -169,7 +157,7 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
169
157
|
}
|
|
170
158
|
|
|
171
159
|
/**
|
|
172
|
-
* Get account by
|
|
160
|
+
* Get account by account\'s l1_address or index. Returns detailed account info
|
|
173
161
|
* GetAccount
|
|
174
162
|
*/
|
|
175
163
|
async getAccount(requestParameters: GetAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DetailedAccounts> {
|
|
@@ -272,10 +260,10 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
272
260
|
}
|
|
273
261
|
|
|
274
262
|
/**
|
|
275
|
-
* Get accounts returns
|
|
263
|
+
* Get accounts returns accounts by account index
|
|
276
264
|
* GetAccounts
|
|
277
265
|
*/
|
|
278
|
-
async getAccountsRaw(requestParameters: GetAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
266
|
+
async getAccountsRaw(requestParameters: GetAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Accounts>> {
|
|
279
267
|
if (requestParameters['limit'] == null) {
|
|
280
268
|
throw new runtime.RequiredError(
|
|
281
269
|
'limit',
|
|
@@ -306,20 +294,20 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
306
294
|
query: queryParameters,
|
|
307
295
|
}, initOverrides);
|
|
308
296
|
|
|
309
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
297
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AccountsFromJSON(jsonValue));
|
|
310
298
|
}
|
|
311
299
|
|
|
312
300
|
/**
|
|
313
|
-
* Get accounts returns
|
|
301
|
+
* Get accounts returns accounts by account index
|
|
314
302
|
* GetAccounts
|
|
315
303
|
*/
|
|
316
|
-
async getAccounts(requestParameters: GetAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
304
|
+
async getAccounts(requestParameters: GetAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Accounts> {
|
|
317
305
|
const response = await this.getAccountsRaw(requestParameters, initOverrides);
|
|
318
306
|
return await response.value();
|
|
319
307
|
}
|
|
320
308
|
|
|
321
309
|
/**
|
|
322
|
-
* Get accounts by l1_address returns
|
|
310
|
+
* Get accounts by l1_address returns all accounts associated with the given L1 address
|
|
323
311
|
* GetAccountsByL1Address
|
|
324
312
|
*/
|
|
325
313
|
async getAccountsByL1AddressRaw(requestParameters: GetAccountsByL1AddressRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SubAccounts>> {
|
|
@@ -349,7 +337,7 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
349
337
|
}
|
|
350
338
|
|
|
351
339
|
/**
|
|
352
|
-
* Get accounts by l1_address returns
|
|
340
|
+
* Get accounts by l1_address returns all accounts associated with the given L1 address
|
|
353
341
|
* GetAccountsByL1Address
|
|
354
342
|
*/
|
|
355
343
|
async getAccountsByL1Address(requestParameters: GetAccountsByL1AddressRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SubAccounts> {
|
|
@@ -0,0 +1,121 @@
|
|
|
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 MarkNotifReadRequest {
|
|
26
|
+
notif_type: string;
|
|
27
|
+
account_index: number;
|
|
28
|
+
api_key_index: number;
|
|
29
|
+
liquidation_ids: string;
|
|
30
|
+
signature: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
export class LiquidationApi extends runtime.BaseAPI {
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Mark
|
|
40
|
+
* MarkNotifRead
|
|
41
|
+
*/
|
|
42
|
+
async markNotifReadRaw(requestParameters: MarkNotifReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResultCode>> {
|
|
43
|
+
if (requestParameters['notif_type'] == null) {
|
|
44
|
+
throw new runtime.RequiredError(
|
|
45
|
+
'notif_type',
|
|
46
|
+
'Required parameter "notif_type" was null or undefined when calling markNotifRead().'
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (requestParameters['account_index'] == null) {
|
|
51
|
+
throw new runtime.RequiredError(
|
|
52
|
+
'account_index',
|
|
53
|
+
'Required parameter "account_index" was null or undefined when calling markNotifRead().'
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (requestParameters['api_key_index'] == null) {
|
|
58
|
+
throw new runtime.RequiredError(
|
|
59
|
+
'api_key_index',
|
|
60
|
+
'Required parameter "api_key_index" was null or undefined when calling markNotifRead().'
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (requestParameters['liquidation_ids'] == null) {
|
|
65
|
+
throw new runtime.RequiredError(
|
|
66
|
+
'liquidation_ids',
|
|
67
|
+
'Required parameter "liquidation_ids" was null or undefined when calling markNotifRead().'
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (requestParameters['signature'] == null) {
|
|
72
|
+
throw new runtime.RequiredError(
|
|
73
|
+
'signature',
|
|
74
|
+
'Required parameter "signature" was null or undefined when calling markNotifRead().'
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const queryParameters: any = {};
|
|
79
|
+
|
|
80
|
+
if (requestParameters['notif_type'] != null) {
|
|
81
|
+
queryParameters['notif_type'] = requestParameters['notif_type'];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (requestParameters['account_index'] != null) {
|
|
85
|
+
queryParameters['account_index'] = requestParameters['account_index'];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (requestParameters['api_key_index'] != null) {
|
|
89
|
+
queryParameters['api_key_index'] = requestParameters['api_key_index'];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (requestParameters['liquidation_ids'] != null) {
|
|
93
|
+
queryParameters['liquidation_ids'] = requestParameters['liquidation_ids'];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (requestParameters['signature'] != null) {
|
|
97
|
+
queryParameters['signature'] = requestParameters['signature'];
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
101
|
+
|
|
102
|
+
const response = await this.request({
|
|
103
|
+
path: `/api/v1/markNotifRead`,
|
|
104
|
+
method: 'GET',
|
|
105
|
+
headers: headerParameters,
|
|
106
|
+
query: queryParameters,
|
|
107
|
+
}, initOverrides);
|
|
108
|
+
|
|
109
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ResultCodeFromJSON(jsonValue));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Mark
|
|
114
|
+
* MarkNotifRead
|
|
115
|
+
*/
|
|
116
|
+
async markNotifRead(requestParameters: MarkNotifReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResultCode> {
|
|
117
|
+
const response = await this.markNotifReadRaw(requestParameters, initOverrides);
|
|
118
|
+
return await response.value();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
}
|
package/apis/OrderApi.ts
CHANGED
|
@@ -42,13 +42,11 @@ import {
|
|
|
42
42
|
|
|
43
43
|
export interface GetAccountActiveOrdersRequest {
|
|
44
44
|
account_index: number;
|
|
45
|
-
sub_account_index: number;
|
|
46
45
|
market_id: number;
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
export interface GetAccountInactiveOrdersRequest {
|
|
50
49
|
account_index: number;
|
|
51
|
-
sub_account_index: number;
|
|
52
50
|
filter: GetAccountInactiveOrdersFilterEnum;
|
|
53
51
|
limit: number;
|
|
54
52
|
market_id?: number;
|
|
@@ -107,13 +105,6 @@ export class OrderApi extends runtime.BaseAPI {
|
|
|
107
105
|
);
|
|
108
106
|
}
|
|
109
107
|
|
|
110
|
-
if (requestParameters['sub_account_index'] == null) {
|
|
111
|
-
throw new runtime.RequiredError(
|
|
112
|
-
'sub_account_index',
|
|
113
|
-
'Required parameter "sub_account_index" was null or undefined when calling getAccountActiveOrders().'
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
108
|
if (requestParameters['market_id'] == null) {
|
|
118
109
|
throw new runtime.RequiredError(
|
|
119
110
|
'market_id',
|
|
@@ -127,10 +118,6 @@ export class OrderApi extends runtime.BaseAPI {
|
|
|
127
118
|
queryParameters['account_index'] = requestParameters['account_index'];
|
|
128
119
|
}
|
|
129
120
|
|
|
130
|
-
if (requestParameters['sub_account_index'] != null) {
|
|
131
|
-
queryParameters['sub_account_index'] = requestParameters['sub_account_index'];
|
|
132
|
-
}
|
|
133
|
-
|
|
134
121
|
if (requestParameters['market_id'] != null) {
|
|
135
122
|
queryParameters['market_id'] = requestParameters['market_id'];
|
|
136
123
|
}
|
|
@@ -168,13 +155,6 @@ export class OrderApi extends runtime.BaseAPI {
|
|
|
168
155
|
);
|
|
169
156
|
}
|
|
170
157
|
|
|
171
|
-
if (requestParameters['sub_account_index'] == null) {
|
|
172
|
-
throw new runtime.RequiredError(
|
|
173
|
-
'sub_account_index',
|
|
174
|
-
'Required parameter "sub_account_index" was null or undefined when calling getAccountInactiveOrders().'
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
158
|
if (requestParameters['filter'] == null) {
|
|
179
159
|
throw new runtime.RequiredError(
|
|
180
160
|
'filter',
|
|
@@ -195,10 +175,6 @@ export class OrderApi extends runtime.BaseAPI {
|
|
|
195
175
|
queryParameters['account_index'] = requestParameters['account_index'];
|
|
196
176
|
}
|
|
197
177
|
|
|
198
|
-
if (requestParameters['sub_account_index'] != null) {
|
|
199
|
-
queryParameters['sub_account_index'] = requestParameters['sub_account_index'];
|
|
200
|
-
}
|
|
201
|
-
|
|
202
178
|
if (requestParameters['filter'] != null) {
|
|
203
179
|
queryParameters['filter'] = requestParameters['filter'];
|
|
204
180
|
}
|
package/apis/TransactionApi.ts
CHANGED
|
@@ -66,7 +66,7 @@ export interface GetL2SignatureBodyRequest {
|
|
|
66
66
|
|
|
67
67
|
export interface GetNextNonceRequest {
|
|
68
68
|
account_index: number;
|
|
69
|
-
|
|
69
|
+
api_key_index: number;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
export interface GetPendingTxsRequest {
|
|
@@ -353,10 +353,10 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
353
353
|
);
|
|
354
354
|
}
|
|
355
355
|
|
|
356
|
-
if (requestParameters['
|
|
356
|
+
if (requestParameters['api_key_index'] == null) {
|
|
357
357
|
throw new runtime.RequiredError(
|
|
358
|
-
'
|
|
359
|
-
'Required parameter "
|
|
358
|
+
'api_key_index',
|
|
359
|
+
'Required parameter "api_key_index" was null or undefined when calling getNextNonce().'
|
|
360
360
|
);
|
|
361
361
|
}
|
|
362
362
|
|
|
@@ -366,8 +366,8 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
366
366
|
queryParameters['account_index'] = requestParameters['account_index'];
|
|
367
367
|
}
|
|
368
368
|
|
|
369
|
-
if (requestParameters['
|
|
370
|
-
queryParameters['
|
|
369
|
+
if (requestParameters['api_key_index'] != null) {
|
|
370
|
+
queryParameters['api_key_index'] = requestParameters['api_key_index'];
|
|
371
371
|
}
|
|
372
372
|
|
|
373
373
|
const headerParameters: runtime.HTTPHeaders = {};
|
package/apis/index.ts
CHANGED
|
@@ -0,0 +1,104 @@
|
|
|
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 Account
|
|
20
|
+
*/
|
|
21
|
+
export interface Account {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof Account
|
|
26
|
+
*/
|
|
27
|
+
code?: number;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof Account
|
|
32
|
+
*/
|
|
33
|
+
message?: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {number}
|
|
37
|
+
* @memberof Account
|
|
38
|
+
*/
|
|
39
|
+
index: number;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof Account
|
|
44
|
+
*/
|
|
45
|
+
l1_address: string;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {number}
|
|
49
|
+
* @memberof Account
|
|
50
|
+
*/
|
|
51
|
+
status: number;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {string}
|
|
55
|
+
* @memberof Account
|
|
56
|
+
*/
|
|
57
|
+
collateral: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Check if a given object implements the Account interface.
|
|
62
|
+
*/
|
|
63
|
+
export function instanceOfAccount(value: object): value is Account {
|
|
64
|
+
if (!('index' in value) || value['index'] === undefined) return false;
|
|
65
|
+
if (!('l1_address' in value) || value['l1_address'] === undefined) return false;
|
|
66
|
+
if (!('status' in value) || value['status'] === undefined) return false;
|
|
67
|
+
if (!('collateral' in value) || value['collateral'] === undefined) return false;
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function AccountFromJSON(json: any): Account {
|
|
72
|
+
return AccountFromJSONTyped(json, false);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function AccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): Account {
|
|
76
|
+
if (json == null) {
|
|
77
|
+
return json;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
|
|
81
|
+
'code': json['code'] == null ? undefined : json['code'],
|
|
82
|
+
'message': json['message'] == null ? undefined : json['message'],
|
|
83
|
+
'index': json['index'],
|
|
84
|
+
'l1_address': json['l1_address'],
|
|
85
|
+
'status': json['status'],
|
|
86
|
+
'collateral': json['collateral'],
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function AccountToJSON(value?: Account | null): any {
|
|
91
|
+
if (value == null) {
|
|
92
|
+
return value;
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
|
|
96
|
+
'code': value['code'],
|
|
97
|
+
'message': value['message'],
|
|
98
|
+
'index': value['index'],
|
|
99
|
+
'l1_address': value['l1_address'],
|
|
100
|
+
'status': value['status'],
|
|
101
|
+
'collateral': value['collateral'],
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
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 { Account } from './Account';
|
|
17
|
+
import {
|
|
18
|
+
AccountFromJSON,
|
|
19
|
+
AccountFromJSONTyped,
|
|
20
|
+
AccountToJSON,
|
|
21
|
+
} from './Account';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @export
|
|
26
|
+
* @interface Accounts
|
|
27
|
+
*/
|
|
28
|
+
export interface Accounts {
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @type {number}
|
|
32
|
+
* @memberof Accounts
|
|
33
|
+
*/
|
|
34
|
+
code?: number;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @type {string}
|
|
38
|
+
* @memberof Accounts
|
|
39
|
+
*/
|
|
40
|
+
message?: string;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @type {number}
|
|
44
|
+
* @memberof Accounts
|
|
45
|
+
*/
|
|
46
|
+
total: number;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @type {Array<Account>}
|
|
50
|
+
* @memberof Accounts
|
|
51
|
+
*/
|
|
52
|
+
accounts: Array<Account>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Check if a given object implements the Accounts interface.
|
|
57
|
+
*/
|
|
58
|
+
export function instanceOfAccounts(value: object): value is Accounts {
|
|
59
|
+
if (!('total' in value) || value['total'] === undefined) return false;
|
|
60
|
+
if (!('accounts' in value) || value['accounts'] === undefined) return false;
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function AccountsFromJSON(json: any): Accounts {
|
|
65
|
+
return AccountsFromJSONTyped(json, false);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function AccountsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Accounts {
|
|
69
|
+
if (json == null) {
|
|
70
|
+
return json;
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
|
|
74
|
+
'code': json['code'] == null ? undefined : json['code'],
|
|
75
|
+
'message': json['message'] == null ? undefined : json['message'],
|
|
76
|
+
'total': json['total'],
|
|
77
|
+
'accounts': ((json['accounts'] as Array<any>).map(AccountFromJSON)),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function AccountsToJSON(value?: Accounts | null): any {
|
|
82
|
+
if (value == null) {
|
|
83
|
+
return value;
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
|
|
87
|
+
'code': value['code'],
|
|
88
|
+
'message': value['message'],
|
|
89
|
+
'total': value['total'],
|
|
90
|
+
'accounts': ((value['accounts'] as Array<any>).map(AccountToJSON)),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
@@ -50,30 +50,12 @@ export interface DetailedAccount {
|
|
|
50
50
|
* @memberof DetailedAccount
|
|
51
51
|
*/
|
|
52
52
|
index?: number;
|
|
53
|
-
/**
|
|
54
|
-
*
|
|
55
|
-
* @type {number}
|
|
56
|
-
* @memberof DetailedAccount
|
|
57
|
-
*/
|
|
58
|
-
sub_account_index?: number;
|
|
59
53
|
/**
|
|
60
54
|
*
|
|
61
55
|
* @type {string}
|
|
62
56
|
* @memberof DetailedAccount
|
|
63
57
|
*/
|
|
64
58
|
l1_address?: string;
|
|
65
|
-
/**
|
|
66
|
-
*
|
|
67
|
-
* @type {string}
|
|
68
|
-
* @memberof DetailedAccount
|
|
69
|
-
*/
|
|
70
|
-
pk?: string;
|
|
71
|
-
/**
|
|
72
|
-
*
|
|
73
|
-
* @type {number}
|
|
74
|
-
* @memberof DetailedAccount
|
|
75
|
-
*/
|
|
76
|
-
nonce?: number;
|
|
77
59
|
/**
|
|
78
60
|
*
|
|
79
61
|
* @type {number}
|
|
@@ -86,12 +68,6 @@ export interface DetailedAccount {
|
|
|
86
68
|
* @memberof DetailedAccount
|
|
87
69
|
*/
|
|
88
70
|
collateral?: string;
|
|
89
|
-
/**
|
|
90
|
-
*
|
|
91
|
-
* @type {number}
|
|
92
|
-
* @memberof DetailedAccount
|
|
93
|
-
*/
|
|
94
|
-
collateral_type?: number;
|
|
95
71
|
/**
|
|
96
72
|
*
|
|
97
73
|
* @type {Array<AccountPosition>}
|
|
@@ -135,13 +111,9 @@ export function DetailedAccountFromJSONTyped(json: any, ignoreDiscriminator: boo
|
|
|
135
111
|
'code': json['code'] == null ? undefined : json['code'],
|
|
136
112
|
'message': json['message'] == null ? undefined : json['message'],
|
|
137
113
|
'index': json['index'] == null ? undefined : json['index'],
|
|
138
|
-
'sub_account_index': json['sub_account_index'] == null ? undefined : json['sub_account_index'],
|
|
139
114
|
'l1_address': json['l1_address'] == null ? undefined : json['l1_address'],
|
|
140
|
-
'pk': json['pk'] == null ? undefined : json['pk'],
|
|
141
|
-
'nonce': json['nonce'] == null ? undefined : json['nonce'],
|
|
142
115
|
'status': json['status'] == null ? undefined : json['status'],
|
|
143
116
|
'collateral': json['collateral'] == null ? undefined : json['collateral'],
|
|
144
|
-
'collateral_type': json['collateral_type'] == null ? undefined : json['collateral_type'],
|
|
145
117
|
'positions': ((json['positions'] as Array<any>).map(AccountPositionFromJSON)),
|
|
146
118
|
'total_asset_value': json['total_asset_value'],
|
|
147
119
|
'market_stats': ((json['market_stats'] as Array<any>).map(AccountMarketStatsFromJSON)),
|
|
@@ -157,13 +129,9 @@ export function DetailedAccountToJSON(value?: DetailedAccount | null): any {
|
|
|
157
129
|
'code': value['code'],
|
|
158
130
|
'message': value['message'],
|
|
159
131
|
'index': value['index'],
|
|
160
|
-
'sub_account_index': value['sub_account_index'],
|
|
161
132
|
'l1_address': value['l1_address'],
|
|
162
|
-
'pk': value['pk'],
|
|
163
|
-
'nonce': value['nonce'],
|
|
164
133
|
'status': value['status'],
|
|
165
134
|
'collateral': value['collateral'],
|
|
166
|
-
'collateral_type': value['collateral_type'],
|
|
167
135
|
'positions': ((value['positions'] as Array<any>).map(AccountPositionToJSON)),
|
|
168
136
|
'total_asset_value': value['total_asset_value'],
|
|
169
137
|
'market_stats': ((value['market_stats'] as Array<any>).map(AccountMarketStatsToJSON)),
|