zklighter-perps 1.0.5 → 1.0.7
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 +0 -1
- package/apis/AccountApi.ts +12 -0
- package/apis/BlockApi.ts +6 -3
- package/apis/CandlestickApi.ts +4 -3
- package/apis/InfoApi.ts +8 -3
- package/apis/OrderApi.ts +18 -3
- package/apis/RelayerApi.ts +2 -3
- package/apis/RootApi.ts +2 -69
- package/apis/TransactionApi.ts +26 -37
- package/apis/WsApi.ts +4 -0
- package/apis/index.ts +0 -1
- package/models/AccountMarketStats.ts +12 -18
- package/models/AccountPnL.ts +5 -7
- package/models/AccountPosition.ts +22 -33
- package/models/AccountStats.ts +10 -15
- package/models/Block.ts +27 -40
- package/models/Blocks.ts +5 -7
- package/models/Candlestick.ts +14 -21
- package/models/Candlesticks.ts +5 -7
- package/models/ContractAddress.ts +4 -6
- package/models/CurrentHeight.ts +2 -3
- package/models/DetailedAccount.ts +8 -11
- package/models/DetailedAccounts.ts +5 -7
- package/models/EnrichedTx.ts +6 -9
- package/models/ExchangeStats.ts +9 -13
- package/models/Funding.ts +8 -12
- package/models/Fundings.ts +5 -7
- package/models/L1ProviderInfo.ts +8 -12
- package/models/Layer1BasicInfo.ts +17 -24
- package/models/Layer2BasicInfo.ts +6 -9
- package/models/MainAccount.ts +6 -9
- package/models/MainAccounts.ts +5 -7
- package/models/MarketInfo.ts +22 -33
- package/models/MarketSig.ts +8 -12
- package/models/NextNonce.ts +2 -3
- package/models/Order.ts +32 -48
- package/models/OrderBook.ts +20 -30
- package/models/OrderBookDepth.ts +8 -11
- package/models/OrderBookDetail.ts +36 -54
- package/models/OrderBookDetails.ts +3 -4
- package/models/OrderBookOrders.ts +10 -14
- package/models/OrderBookStats.ts +12 -18
- package/models/OrderBooks.ts +3 -4
- package/models/Orders.ts +3 -4
- package/models/Permission.ts +2 -3
- package/models/PnLEntry.ts +4 -6
- package/models/PriceLevel.ts +4 -6
- package/models/ReqDoFaucet.ts +2 -3
- package/models/ReqGetAccount.ts +4 -6
- package/models/ReqGetAccountActiveOrders.ts +6 -9
- package/models/ReqGetAccountByL1Address.ts +2 -3
- package/models/ReqGetAccountInactiveOrders.ts +8 -12
- package/models/ReqGetAccountOrders.ts +6 -9
- package/models/ReqGetAccountPnL.ts +12 -18
- package/models/ReqGetBlock.ts +4 -6
- package/models/ReqGetBlockTxs.ts +4 -6
- package/models/ReqGetByAccount.ts +4 -6
- package/models/ReqGetCandlesticks.ts +10 -15
- package/models/ReqGetFundings.ts +10 -15
- package/models/ReqGetL1Tx.ts +2 -3
- package/models/ReqGetMarketSig.ts +6 -9
- package/models/ReqGetNextNonce.ts +4 -6
- package/models/ReqGetOrderBookDetails.ts +2 -3
- package/models/ReqGetOrderBookOrders.ts +4 -6
- package/models/ReqGetOrderBooks.ts +2 -3
- package/models/ReqGetPermission.ts +6 -9
- package/models/ReqGetRangeWithCursor.ts +2 -3
- package/models/ReqGetRangeWithIndex.ts +2 -3
- package/models/ReqGetRecentTrades.ts +4 -6
- package/models/ReqGetRollbacks.ts +6 -9
- package/models/ReqGetSubAccount.ts +6 -9
- package/models/ReqGetTrades.ts +8 -12
- package/models/ReqGetTx.ts +4 -6
- package/models/ReqSearch.ts +2 -3
- package/models/ResultCode.ts +2 -3
- package/models/Rollback.ts +8 -12
- package/models/Rollbacks.ts +5 -7
- package/models/Search.ts +2 -3
- package/models/SignBody.ts +2 -3
- package/models/SimpleOrder.ts +12 -18
- package/models/Status.ts +4 -6
- package/models/SubAccount.ts +16 -24
- package/models/SubAccounts.ts +9 -13
- package/models/Trade.ts +24 -36
- package/models/Trades.ts +3 -4
- package/models/Tx.ts +28 -42
- package/models/TxHash.ts +2 -3
- package/models/Txs.ts +3 -4
- package/models/ValidatorInfo.ts +4 -6
- package/openapi.json +185 -921
- package/package.json +1 -1
package/apis/TransactionApi.ts
CHANGED
|
@@ -17,7 +17,6 @@ import * as runtime from '../runtime';
|
|
|
17
17
|
import type {
|
|
18
18
|
EnrichedTx,
|
|
19
19
|
NextNonce,
|
|
20
|
-
ResultCode,
|
|
21
20
|
SignBody,
|
|
22
21
|
TxHash,
|
|
23
22
|
Txs,
|
|
@@ -27,8 +26,6 @@ import {
|
|
|
27
26
|
EnrichedTxToJSON,
|
|
28
27
|
NextNonceFromJSON,
|
|
29
28
|
NextNonceToJSON,
|
|
30
|
-
ResultCodeFromJSON,
|
|
31
|
-
ResultCodeToJSON,
|
|
32
29
|
SignBodyFromJSON,
|
|
33
30
|
SignBodyToJSON,
|
|
34
31
|
TxHashFromJSON,
|
|
@@ -57,8 +54,8 @@ export interface GetBlockTxsRequest {
|
|
|
57
54
|
}
|
|
58
55
|
|
|
59
56
|
export interface GetL2SignatureBodyRequest {
|
|
60
|
-
txType
|
|
61
|
-
txInfo
|
|
57
|
+
txType?: number;
|
|
58
|
+
txInfo?: string;
|
|
62
59
|
}
|
|
63
60
|
|
|
64
61
|
export interface GetNextNonceRequest {
|
|
@@ -86,8 +83,8 @@ export interface GetTxsRequest {
|
|
|
86
83
|
}
|
|
87
84
|
|
|
88
85
|
export interface SendTxRequest {
|
|
89
|
-
txType
|
|
90
|
-
txInfo
|
|
86
|
+
txType?: number;
|
|
87
|
+
txInfo?: string;
|
|
91
88
|
}
|
|
92
89
|
|
|
93
90
|
/**
|
|
@@ -97,6 +94,7 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
97
94
|
|
|
98
95
|
/**
|
|
99
96
|
* Get pending transactions of a specific account
|
|
97
|
+
* GetAccountPendingTxs
|
|
100
98
|
*/
|
|
101
99
|
async getAccountPendingTxsRaw(requestParameters: GetAccountPendingTxsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Txs>> {
|
|
102
100
|
if (requestParameters['by'] == null) {
|
|
@@ -141,6 +139,7 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
141
139
|
|
|
142
140
|
/**
|
|
143
141
|
* Get pending transactions of a specific account
|
|
142
|
+
* GetAccountPendingTxs
|
|
144
143
|
*/
|
|
145
144
|
async getAccountPendingTxs(requestParameters: GetAccountPendingTxsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Txs> {
|
|
146
145
|
const response = await this.getAccountPendingTxsRaw(requestParameters, initOverrides);
|
|
@@ -149,6 +148,7 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
149
148
|
|
|
150
149
|
/**
|
|
151
150
|
* Get transactions of a specific account
|
|
151
|
+
* GetAccountTxs
|
|
152
152
|
*/
|
|
153
153
|
async getAccountTxsRaw(requestParameters: GetAccountTxsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Txs>> {
|
|
154
154
|
if (requestParameters['limit'] == null) {
|
|
@@ -208,6 +208,7 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
210
|
* Get transactions of a specific account
|
|
211
|
+
* GetAccountTxs
|
|
211
212
|
*/
|
|
212
213
|
async getAccountTxs(requestParameters: GetAccountTxsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Txs> {
|
|
213
214
|
const response = await this.getAccountTxsRaw(requestParameters, initOverrides);
|
|
@@ -216,6 +217,7 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
216
217
|
|
|
217
218
|
/**
|
|
218
219
|
* Get transactions in a block
|
|
220
|
+
* GetBlockTxs
|
|
219
221
|
*/
|
|
220
222
|
async getBlockTxsRaw(requestParameters: GetBlockTxsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Txs>> {
|
|
221
223
|
if (requestParameters['by'] == null) {
|
|
@@ -256,6 +258,7 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
256
258
|
|
|
257
259
|
/**
|
|
258
260
|
* Get transactions in a block
|
|
261
|
+
* GetBlockTxs
|
|
259
262
|
*/
|
|
260
263
|
async getBlockTxs(requestParameters: GetBlockTxsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Txs> {
|
|
261
264
|
const response = await this.getBlockTxsRaw(requestParameters, initOverrides);
|
|
@@ -264,22 +267,9 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
264
267
|
|
|
265
268
|
/**
|
|
266
269
|
* Get transaction signature body
|
|
270
|
+
* GetL2SignatureBody
|
|
267
271
|
*/
|
|
268
272
|
async getL2SignatureBodyRaw(requestParameters: GetL2SignatureBodyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SignBody>> {
|
|
269
|
-
if (requestParameters['txType'] == null) {
|
|
270
|
-
throw new runtime.RequiredError(
|
|
271
|
-
'txType',
|
|
272
|
-
'Required parameter "txType" was null or undefined when calling getL2SignatureBody().'
|
|
273
|
-
);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
if (requestParameters['txInfo'] == null) {
|
|
277
|
-
throw new runtime.RequiredError(
|
|
278
|
-
'txInfo',
|
|
279
|
-
'Required parameter "txInfo" was null or undefined when calling getL2SignatureBody().'
|
|
280
|
-
);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
273
|
const queryParameters: any = {};
|
|
284
274
|
|
|
285
275
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
@@ -319,14 +309,16 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
319
309
|
|
|
320
310
|
/**
|
|
321
311
|
* Get transaction signature body
|
|
312
|
+
* GetL2SignatureBody
|
|
322
313
|
*/
|
|
323
|
-
async getL2SignatureBody(requestParameters: GetL2SignatureBodyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SignBody> {
|
|
314
|
+
async getL2SignatureBody(requestParameters: GetL2SignatureBodyRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SignBody> {
|
|
324
315
|
const response = await this.getL2SignatureBodyRaw(requestParameters, initOverrides);
|
|
325
316
|
return await response.value();
|
|
326
317
|
}
|
|
327
318
|
|
|
328
319
|
/**
|
|
329
320
|
* Get next nonce for a specific account
|
|
321
|
+
* GetNextNonce
|
|
330
322
|
*/
|
|
331
323
|
async getNextNonceRaw(requestParameters: GetNextNonceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<NextNonce>> {
|
|
332
324
|
if (requestParameters['accountIndex'] == null) {
|
|
@@ -367,6 +359,7 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
367
359
|
|
|
368
360
|
/**
|
|
369
361
|
* Get next nonce for a specific account
|
|
362
|
+
* GetNextNonce
|
|
370
363
|
*/
|
|
371
364
|
async getNextNonce(requestParameters: GetNextNonceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<NextNonce> {
|
|
372
365
|
const response = await this.getNextNonceRaw(requestParameters, initOverrides);
|
|
@@ -375,6 +368,7 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
375
368
|
|
|
376
369
|
/**
|
|
377
370
|
* Get pending transactions
|
|
371
|
+
* GetPendingTxs
|
|
378
372
|
*/
|
|
379
373
|
async getPendingTxsRaw(requestParameters: GetPendingTxsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Txs>> {
|
|
380
374
|
if (requestParameters['limit'] == null) {
|
|
@@ -408,6 +402,7 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
408
402
|
|
|
409
403
|
/**
|
|
410
404
|
* Get pending transactions
|
|
405
|
+
* GetPendingTxs
|
|
411
406
|
*/
|
|
412
407
|
async getPendingTxs(requestParameters: GetPendingTxsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Txs> {
|
|
413
408
|
const response = await this.getPendingTxsRaw(requestParameters, initOverrides);
|
|
@@ -416,6 +411,7 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
416
411
|
|
|
417
412
|
/**
|
|
418
413
|
* Get transaction by hash or sequence index
|
|
414
|
+
* GetTx
|
|
419
415
|
*/
|
|
420
416
|
async getTxRaw(requestParameters: GetTxRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EnrichedTx>> {
|
|
421
417
|
if (requestParameters['by'] == null) {
|
|
@@ -456,6 +452,7 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
456
452
|
|
|
457
453
|
/**
|
|
458
454
|
* Get transaction by hash or sequence index
|
|
455
|
+
* GetTx
|
|
459
456
|
*/
|
|
460
457
|
async getTx(requestParameters: GetTxRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EnrichedTx> {
|
|
461
458
|
const response = await this.getTxRaw(requestParameters, initOverrides);
|
|
@@ -464,6 +461,7 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
464
461
|
|
|
465
462
|
/**
|
|
466
463
|
* Get L1 transaction by L1 transaction hash
|
|
464
|
+
* getTxFromL1TxHash
|
|
467
465
|
*/
|
|
468
466
|
async getTxFromL1TxHashRaw(requestParameters: GetTxFromL1TxHashRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EnrichedTx>> {
|
|
469
467
|
if (requestParameters['hash'] == null) {
|
|
@@ -493,6 +491,7 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
493
491
|
|
|
494
492
|
/**
|
|
495
493
|
* Get L1 transaction by L1 transaction hash
|
|
494
|
+
* getTxFromL1TxHash
|
|
496
495
|
*/
|
|
497
496
|
async getTxFromL1TxHash(requestParameters: GetTxFromL1TxHashRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EnrichedTx> {
|
|
498
497
|
const response = await this.getTxFromL1TxHashRaw(requestParameters, initOverrides);
|
|
@@ -501,6 +500,7 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
501
500
|
|
|
502
501
|
/**
|
|
503
502
|
* Get transactions which are already packed into blocks
|
|
503
|
+
* GetTxs
|
|
504
504
|
*/
|
|
505
505
|
async getTxsRaw(requestParameters: GetTxsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Txs>> {
|
|
506
506
|
if (requestParameters['limit'] == null) {
|
|
@@ -534,6 +534,7 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
534
534
|
|
|
535
535
|
/**
|
|
536
536
|
* Get transactions which are already packed into blocks
|
|
537
|
+
* GetTxs
|
|
537
538
|
*/
|
|
538
539
|
async getTxs(requestParameters: GetTxsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Txs> {
|
|
539
540
|
const response = await this.getTxsRaw(requestParameters, initOverrides);
|
|
@@ -542,22 +543,9 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
542
543
|
|
|
543
544
|
/**
|
|
544
545
|
* Send raw transaction
|
|
546
|
+
* SendTx
|
|
545
547
|
*/
|
|
546
548
|
async sendTxRaw(requestParameters: SendTxRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TxHash>> {
|
|
547
|
-
if (requestParameters['txType'] == null) {
|
|
548
|
-
throw new runtime.RequiredError(
|
|
549
|
-
'txType',
|
|
550
|
-
'Required parameter "txType" was null or undefined when calling sendTx().'
|
|
551
|
-
);
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
if (requestParameters['txInfo'] == null) {
|
|
555
|
-
throw new runtime.RequiredError(
|
|
556
|
-
'txInfo',
|
|
557
|
-
'Required parameter "txInfo" was null or undefined when calling sendTx().'
|
|
558
|
-
);
|
|
559
|
-
}
|
|
560
|
-
|
|
561
549
|
const queryParameters: any = {};
|
|
562
550
|
|
|
563
551
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
@@ -597,8 +585,9 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
597
585
|
|
|
598
586
|
/**
|
|
599
587
|
* Send raw transaction
|
|
588
|
+
* SendTx
|
|
600
589
|
*/
|
|
601
|
-
async sendTx(requestParameters: SendTxRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TxHash> {
|
|
590
|
+
async sendTx(requestParameters: SendTxRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TxHash> {
|
|
602
591
|
const response = await this.sendTxRaw(requestParameters, initOverrides);
|
|
603
592
|
return await response.value();
|
|
604
593
|
}
|
package/apis/WsApi.ts
CHANGED
|
@@ -29,6 +29,7 @@ export class WsApi extends runtime.BaseAPI {
|
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* WebSocket Status
|
|
32
|
+
* GetWebSocketStatus
|
|
32
33
|
*/
|
|
33
34
|
async getWebSocketStatusRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResultCode>> {
|
|
34
35
|
const queryParameters: any = {};
|
|
@@ -47,6 +48,7 @@ export class WsApi extends runtime.BaseAPI {
|
|
|
47
48
|
|
|
48
49
|
/**
|
|
49
50
|
* WebSocket Status
|
|
51
|
+
* GetWebSocketStatus
|
|
50
52
|
*/
|
|
51
53
|
async getWebSocketStatus(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResultCode> {
|
|
52
54
|
const response = await this.getWebSocketStatusRaw(initOverrides);
|
|
@@ -55,6 +57,7 @@ export class WsApi extends runtime.BaseAPI {
|
|
|
55
57
|
|
|
56
58
|
/**
|
|
57
59
|
* WebSocket
|
|
60
|
+
* Stream
|
|
58
61
|
*/
|
|
59
62
|
async streamRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResultCode>> {
|
|
60
63
|
const queryParameters: any = {};
|
|
@@ -73,6 +76,7 @@ export class WsApi extends runtime.BaseAPI {
|
|
|
73
76
|
|
|
74
77
|
/**
|
|
75
78
|
* WebSocket
|
|
79
|
+
* Stream
|
|
76
80
|
*/
|
|
77
81
|
async stream(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResultCode> {
|
|
78
82
|
const response = await this.streamRaw(initOverrides);
|
package/apis/index.ts
CHANGED
|
@@ -24,49 +24,43 @@ export interface AccountMarketStats {
|
|
|
24
24
|
* @type {number}
|
|
25
25
|
* @memberof AccountMarketStats
|
|
26
26
|
*/
|
|
27
|
-
marketId
|
|
27
|
+
marketId?: number;
|
|
28
28
|
/**
|
|
29
29
|
*
|
|
30
30
|
* @type {number}
|
|
31
31
|
* @memberof AccountMarketStats
|
|
32
32
|
*/
|
|
33
|
-
dailyTradesCount
|
|
33
|
+
dailyTradesCount?: number;
|
|
34
34
|
/**
|
|
35
35
|
*
|
|
36
36
|
* @type {number}
|
|
37
37
|
* @memberof AccountMarketStats
|
|
38
38
|
*/
|
|
39
|
-
dailyBaseTokenVolume
|
|
39
|
+
dailyBaseTokenVolume?: number;
|
|
40
40
|
/**
|
|
41
41
|
*
|
|
42
42
|
* @type {number}
|
|
43
43
|
* @memberof AccountMarketStats
|
|
44
44
|
*/
|
|
45
|
-
dailyQuoteTokenVolume
|
|
45
|
+
dailyQuoteTokenVolume?: number;
|
|
46
46
|
/**
|
|
47
47
|
*
|
|
48
48
|
* @type {number}
|
|
49
49
|
* @memberof AccountMarketStats
|
|
50
50
|
*/
|
|
51
|
-
openPositionBase
|
|
51
|
+
openPositionBase?: number;
|
|
52
52
|
/**
|
|
53
53
|
*
|
|
54
54
|
* @type {number}
|
|
55
55
|
* @memberof AccountMarketStats
|
|
56
56
|
*/
|
|
57
|
-
openPositionQuote
|
|
57
|
+
openPositionQuote?: number;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Check if a given object implements the AccountMarketStats interface.
|
|
62
62
|
*/
|
|
63
63
|
export function instanceOfAccountMarketStats(value: object): value is AccountMarketStats {
|
|
64
|
-
if (!('marketId' in value) || value['marketId'] === undefined) return false;
|
|
65
|
-
if (!('dailyTradesCount' in value) || value['dailyTradesCount'] === undefined) return false;
|
|
66
|
-
if (!('dailyBaseTokenVolume' in value) || value['dailyBaseTokenVolume'] === undefined) return false;
|
|
67
|
-
if (!('dailyQuoteTokenVolume' in value) || value['dailyQuoteTokenVolume'] === undefined) return false;
|
|
68
|
-
if (!('openPositionBase' in value) || value['openPositionBase'] === undefined) return false;
|
|
69
|
-
if (!('openPositionQuote' in value) || value['openPositionQuote'] === undefined) return false;
|
|
70
64
|
return true;
|
|
71
65
|
}
|
|
72
66
|
|
|
@@ -80,12 +74,12 @@ export function AccountMarketStatsFromJSONTyped(json: any, ignoreDiscriminator:
|
|
|
80
74
|
}
|
|
81
75
|
return {
|
|
82
76
|
|
|
83
|
-
'marketId': json['market_id'],
|
|
84
|
-
'dailyTradesCount': json['daily_trades_count'],
|
|
85
|
-
'dailyBaseTokenVolume': json['daily_base_token_volume'],
|
|
86
|
-
'dailyQuoteTokenVolume': json['daily_quote_token_volume'],
|
|
87
|
-
'openPositionBase': json['open_position_base'],
|
|
88
|
-
'openPositionQuote': json['open_position_quote'],
|
|
77
|
+
'marketId': json['market_id'] == null ? undefined : json['market_id'],
|
|
78
|
+
'dailyTradesCount': json['daily_trades_count'] == null ? undefined : json['daily_trades_count'],
|
|
79
|
+
'dailyBaseTokenVolume': json['daily_base_token_volume'] == null ? undefined : json['daily_base_token_volume'],
|
|
80
|
+
'dailyQuoteTokenVolume': json['daily_quote_token_volume'] == null ? undefined : json['daily_quote_token_volume'],
|
|
81
|
+
'openPositionBase': json['open_position_base'] == null ? undefined : json['open_position_base'],
|
|
82
|
+
'openPositionQuote': json['open_position_quote'] == null ? undefined : json['open_position_quote'],
|
|
89
83
|
};
|
|
90
84
|
}
|
|
91
85
|
|
package/models/AccountPnL.ts
CHANGED
|
@@ -43,21 +43,19 @@ export interface AccountPnL {
|
|
|
43
43
|
* @type {string}
|
|
44
44
|
* @memberof AccountPnL
|
|
45
45
|
*/
|
|
46
|
-
resolution
|
|
46
|
+
resolution?: string;
|
|
47
47
|
/**
|
|
48
48
|
*
|
|
49
49
|
* @type {Array<PnLEntry>}
|
|
50
50
|
* @memberof AccountPnL
|
|
51
51
|
*/
|
|
52
|
-
pnl
|
|
52
|
+
pnl?: Array<PnLEntry>;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* Check if a given object implements the AccountPnL interface.
|
|
57
57
|
*/
|
|
58
58
|
export function instanceOfAccountPnL(value: object): value is AccountPnL {
|
|
59
|
-
if (!('resolution' in value) || value['resolution'] === undefined) return false;
|
|
60
|
-
if (!('pnl' in value) || value['pnl'] === undefined) return false;
|
|
61
59
|
return true;
|
|
62
60
|
}
|
|
63
61
|
|
|
@@ -73,8 +71,8 @@ export function AccountPnLFromJSONTyped(json: any, ignoreDiscriminator: boolean)
|
|
|
73
71
|
|
|
74
72
|
'code': json['code'] == null ? undefined : json['code'],
|
|
75
73
|
'message': json['message'] == null ? undefined : json['message'],
|
|
76
|
-
'resolution': json['resolution'],
|
|
77
|
-
'pnl': ((json['pnl'] as Array<any>).map(PnLEntryFromJSON)),
|
|
74
|
+
'resolution': json['resolution'] == null ? undefined : json['resolution'],
|
|
75
|
+
'pnl': json['pnl'] == null ? undefined : ((json['pnl'] as Array<any>).map(PnLEntryFromJSON)),
|
|
78
76
|
};
|
|
79
77
|
}
|
|
80
78
|
|
|
@@ -87,7 +85,7 @@ export function AccountPnLToJSON(value?: AccountPnL | null): any {
|
|
|
87
85
|
'code': value['code'],
|
|
88
86
|
'message': value['message'],
|
|
89
87
|
'resolution': value['resolution'],
|
|
90
|
-
'pnl': ((value['pnl'] as Array<any>).map(PnLEntryToJSON)),
|
|
88
|
+
'pnl': value['pnl'] == null ? undefined : ((value['pnl'] as Array<any>).map(PnLEntryToJSON)),
|
|
91
89
|
};
|
|
92
90
|
}
|
|
93
91
|
|
|
@@ -24,84 +24,73 @@ export interface AccountPosition {
|
|
|
24
24
|
* @type {number}
|
|
25
25
|
* @memberof AccountPosition
|
|
26
26
|
*/
|
|
27
|
-
marketId
|
|
27
|
+
marketId?: number;
|
|
28
28
|
/**
|
|
29
29
|
*
|
|
30
30
|
* @type {string}
|
|
31
31
|
* @memberof AccountPosition
|
|
32
32
|
*/
|
|
33
|
-
name
|
|
33
|
+
name?: string;
|
|
34
34
|
/**
|
|
35
35
|
*
|
|
36
36
|
* @type {string}
|
|
37
37
|
* @memberof AccountPosition
|
|
38
38
|
*/
|
|
39
|
-
symbol
|
|
39
|
+
symbol?: string;
|
|
40
40
|
/**
|
|
41
41
|
*
|
|
42
42
|
* @type {number}
|
|
43
43
|
* @memberof AccountPosition
|
|
44
44
|
*/
|
|
45
|
-
sign
|
|
45
|
+
sign?: number;
|
|
46
46
|
/**
|
|
47
47
|
*
|
|
48
48
|
* @type {string}
|
|
49
49
|
* @memberof AccountPosition
|
|
50
50
|
*/
|
|
51
|
-
position
|
|
51
|
+
position?: string;
|
|
52
52
|
/**
|
|
53
53
|
*
|
|
54
54
|
* @type {string}
|
|
55
55
|
* @memberof AccountPosition
|
|
56
56
|
*/
|
|
57
|
-
askOrderSize
|
|
57
|
+
askOrderSize?: string;
|
|
58
58
|
/**
|
|
59
59
|
*
|
|
60
60
|
* @type {string}
|
|
61
61
|
* @memberof AccountPosition
|
|
62
62
|
*/
|
|
63
|
-
bidOrderSize
|
|
63
|
+
bidOrderSize?: string;
|
|
64
64
|
/**
|
|
65
65
|
*
|
|
66
66
|
* @type {string}
|
|
67
67
|
* @memberof AccountPosition
|
|
68
68
|
*/
|
|
69
|
-
avgEntryPrice
|
|
69
|
+
avgEntryPrice?: string;
|
|
70
70
|
/**
|
|
71
71
|
*
|
|
72
72
|
* @type {string}
|
|
73
73
|
* @memberof AccountPosition
|
|
74
74
|
*/
|
|
75
|
-
positionValue
|
|
75
|
+
positionValue?: string;
|
|
76
76
|
/**
|
|
77
77
|
*
|
|
78
78
|
* @type {string}
|
|
79
79
|
* @memberof AccountPosition
|
|
80
80
|
*/
|
|
81
|
-
unrealizedPnl
|
|
81
|
+
unrealizedPnl?: string;
|
|
82
82
|
/**
|
|
83
83
|
*
|
|
84
84
|
* @type {string}
|
|
85
85
|
* @memberof AccountPosition
|
|
86
86
|
*/
|
|
87
|
-
realizedPnl
|
|
87
|
+
realizedPnl?: string;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
91
|
* Check if a given object implements the AccountPosition interface.
|
|
92
92
|
*/
|
|
93
93
|
export function instanceOfAccountPosition(value: object): value is AccountPosition {
|
|
94
|
-
if (!('marketId' in value) || value['marketId'] === undefined) return false;
|
|
95
|
-
if (!('name' in value) || value['name'] === undefined) return false;
|
|
96
|
-
if (!('symbol' in value) || value['symbol'] === undefined) return false;
|
|
97
|
-
if (!('sign' in value) || value['sign'] === undefined) return false;
|
|
98
|
-
if (!('position' in value) || value['position'] === undefined) return false;
|
|
99
|
-
if (!('askOrderSize' in value) || value['askOrderSize'] === undefined) return false;
|
|
100
|
-
if (!('bidOrderSize' in value) || value['bidOrderSize'] === undefined) return false;
|
|
101
|
-
if (!('avgEntryPrice' in value) || value['avgEntryPrice'] === undefined) return false;
|
|
102
|
-
if (!('positionValue' in value) || value['positionValue'] === undefined) return false;
|
|
103
|
-
if (!('unrealizedPnl' in value) || value['unrealizedPnl'] === undefined) return false;
|
|
104
|
-
if (!('realizedPnl' in value) || value['realizedPnl'] === undefined) return false;
|
|
105
94
|
return true;
|
|
106
95
|
}
|
|
107
96
|
|
|
@@ -115,17 +104,17 @@ export function AccountPositionFromJSONTyped(json: any, ignoreDiscriminator: boo
|
|
|
115
104
|
}
|
|
116
105
|
return {
|
|
117
106
|
|
|
118
|
-
'marketId': json['market_id'],
|
|
119
|
-
'name': json['name'],
|
|
120
|
-
'symbol': json['symbol'],
|
|
121
|
-
'sign': json['sign'],
|
|
122
|
-
'position': json['position'],
|
|
123
|
-
'askOrderSize': json['ask_order_size'],
|
|
124
|
-
'bidOrderSize': json['bid_order_size'],
|
|
125
|
-
'avgEntryPrice': json['avg_entry_price'],
|
|
126
|
-
'positionValue': json['position_value'],
|
|
127
|
-
'unrealizedPnl': json['unrealized_pnl'],
|
|
128
|
-
'realizedPnl': json['realized_pnl'],
|
|
107
|
+
'marketId': json['market_id'] == null ? undefined : json['market_id'],
|
|
108
|
+
'name': json['name'] == null ? undefined : json['name'],
|
|
109
|
+
'symbol': json['symbol'] == null ? undefined : json['symbol'],
|
|
110
|
+
'sign': json['sign'] == null ? undefined : json['sign'],
|
|
111
|
+
'position': json['position'] == null ? undefined : json['position'],
|
|
112
|
+
'askOrderSize': json['ask_order_size'] == null ? undefined : json['ask_order_size'],
|
|
113
|
+
'bidOrderSize': json['bid_order_size'] == null ? undefined : json['bid_order_size'],
|
|
114
|
+
'avgEntryPrice': json['avg_entry_price'] == null ? undefined : json['avg_entry_price'],
|
|
115
|
+
'positionValue': json['position_value'] == null ? undefined : json['position_value'],
|
|
116
|
+
'unrealizedPnl': json['unrealized_pnl'] == null ? undefined : json['unrealized_pnl'],
|
|
117
|
+
'realizedPnl': json['realized_pnl'] == null ? undefined : json['realized_pnl'],
|
|
129
118
|
};
|
|
130
119
|
}
|
|
131
120
|
|
package/models/AccountStats.ts
CHANGED
|
@@ -24,42 +24,37 @@ export interface AccountStats {
|
|
|
24
24
|
* @type {string}
|
|
25
25
|
* @memberof AccountStats
|
|
26
26
|
*/
|
|
27
|
-
portfolioValue
|
|
27
|
+
portfolioValue?: string;
|
|
28
28
|
/**
|
|
29
29
|
*
|
|
30
30
|
* @type {string}
|
|
31
31
|
* @memberof AccountStats
|
|
32
32
|
*/
|
|
33
|
-
leverage
|
|
33
|
+
leverage?: string;
|
|
34
34
|
/**
|
|
35
35
|
*
|
|
36
36
|
* @type {string}
|
|
37
37
|
* @memberof AccountStats
|
|
38
38
|
*/
|
|
39
|
-
freeCollateral
|
|
39
|
+
freeCollateral?: string;
|
|
40
40
|
/**
|
|
41
41
|
*
|
|
42
42
|
* @type {string}
|
|
43
43
|
* @memberof AccountStats
|
|
44
44
|
*/
|
|
45
|
-
marginUsage
|
|
45
|
+
marginUsage?: string;
|
|
46
46
|
/**
|
|
47
47
|
*
|
|
48
48
|
* @type {string}
|
|
49
49
|
* @memberof AccountStats
|
|
50
50
|
*/
|
|
51
|
-
buyingPower
|
|
51
|
+
buyingPower?: string;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* Check if a given object implements the AccountStats interface.
|
|
56
56
|
*/
|
|
57
57
|
export function instanceOfAccountStats(value: object): value is AccountStats {
|
|
58
|
-
if (!('portfolioValue' in value) || value['portfolioValue'] === undefined) return false;
|
|
59
|
-
if (!('leverage' in value) || value['leverage'] === undefined) return false;
|
|
60
|
-
if (!('freeCollateral' in value) || value['freeCollateral'] === undefined) return false;
|
|
61
|
-
if (!('marginUsage' in value) || value['marginUsage'] === undefined) return false;
|
|
62
|
-
if (!('buyingPower' in value) || value['buyingPower'] === undefined) return false;
|
|
63
58
|
return true;
|
|
64
59
|
}
|
|
65
60
|
|
|
@@ -73,11 +68,11 @@ export function AccountStatsFromJSONTyped(json: any, ignoreDiscriminator: boolea
|
|
|
73
68
|
}
|
|
74
69
|
return {
|
|
75
70
|
|
|
76
|
-
'portfolioValue': json['portfolio_value'],
|
|
77
|
-
'leverage': json['leverage'],
|
|
78
|
-
'freeCollateral': json['free_collateral'],
|
|
79
|
-
'marginUsage': json['margin_usage'],
|
|
80
|
-
'buyingPower': json['buying_power'],
|
|
71
|
+
'portfolioValue': json['portfolio_value'] == null ? undefined : json['portfolio_value'],
|
|
72
|
+
'leverage': json['leverage'] == null ? undefined : json['leverage'],
|
|
73
|
+
'freeCollateral': json['free_collateral'] == null ? undefined : json['free_collateral'],
|
|
74
|
+
'marginUsage': json['margin_usage'] == null ? undefined : json['margin_usage'],
|
|
75
|
+
'buyingPower': json['buying_power'] == null ? undefined : json['buying_power'],
|
|
81
76
|
};
|
|
82
77
|
}
|
|
83
78
|
|