zklighter-perps 1.0.3 → 1.0.4
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/TransactionApi.ts +34 -6
- package/models/AccountMarketStats.ts +18 -12
- package/models/AccountPnL.ts +7 -5
- package/models/AccountPosition.ts +33 -22
- package/models/AccountStats.ts +15 -10
- package/models/Block.ts +40 -27
- package/models/Blocks.ts +7 -5
- package/models/Candlestick.ts +21 -14
- package/models/Candlesticks.ts +7 -5
- package/models/ContractAddress.ts +6 -4
- package/models/CurrentHeight.ts +3 -2
- package/models/DetailedAccount.ts +11 -8
- package/models/DetailedAccounts.ts +7 -5
- package/models/EnrichedTx.ts +9 -6
- package/models/ExchangeStats.ts +13 -9
- package/models/Funding.ts +12 -8
- package/models/Fundings.ts +7 -5
- package/models/L1ProviderInfo.ts +12 -8
- package/models/Layer1BasicInfo.ts +24 -17
- package/models/Layer2BasicInfo.ts +9 -6
- package/models/MainAccount.ts +9 -6
- package/models/MainAccounts.ts +7 -5
- package/models/MarketInfo.ts +33 -22
- package/models/MarketSig.ts +12 -8
- package/models/NextNonce.ts +3 -2
- package/models/Order.ts +48 -32
- package/models/OrderBook.ts +30 -20
- package/models/OrderBookDepth.ts +11 -8
- package/models/OrderBookDetail.ts +54 -36
- package/models/OrderBookDetails.ts +4 -3
- package/models/OrderBookOrders.ts +14 -10
- package/models/OrderBookStats.ts +18 -12
- package/models/OrderBooks.ts +4 -3
- package/models/Orders.ts +4 -3
- package/models/Permission.ts +3 -2
- package/models/PnLEntry.ts +6 -4
- package/models/PriceLevel.ts +6 -4
- package/models/ReqDoFaucet.ts +3 -2
- package/models/ReqGetAccount.ts +6 -4
- package/models/ReqGetAccountActiveOrders.ts +9 -6
- package/models/ReqGetAccountByL1Address.ts +3 -2
- package/models/ReqGetAccountInactiveOrders.ts +12 -8
- package/models/ReqGetAccountOrders.ts +9 -6
- package/models/ReqGetAccountPnL.ts +18 -12
- package/models/ReqGetBlock.ts +6 -4
- package/models/ReqGetBlockTxs.ts +6 -4
- package/models/ReqGetByAccount.ts +6 -4
- package/models/ReqGetCandlesticks.ts +15 -10
- package/models/ReqGetFundings.ts +15 -10
- package/models/ReqGetL1Tx.ts +3 -2
- package/models/ReqGetMarketSig.ts +9 -6
- package/models/ReqGetNextNonce.ts +6 -4
- package/models/ReqGetOrderBookDetails.ts +3 -2
- package/models/ReqGetOrderBookOrders.ts +6 -4
- package/models/ReqGetOrderBooks.ts +3 -2
- package/models/ReqGetPermission.ts +9 -6
- package/models/ReqGetRangeWithCursor.ts +3 -2
- package/models/ReqGetRangeWithIndex.ts +3 -2
- package/models/ReqGetRecentTrades.ts +6 -4
- package/models/ReqGetRollbacks.ts +9 -6
- package/models/ReqGetSubAccount.ts +9 -6
- package/models/ReqGetTrades.ts +12 -8
- package/models/ReqGetTx.ts +6 -4
- package/models/ReqSearch.ts +3 -2
- package/models/ResultCode.ts +3 -2
- package/models/Rollback.ts +12 -8
- package/models/Rollbacks.ts +7 -5
- package/models/Search.ts +3 -2
- package/models/SignBody.ts +3 -2
- package/models/SimpleOrder.ts +18 -12
- package/models/Status.ts +6 -4
- package/models/SubAccount.ts +24 -16
- package/models/SubAccounts.ts +13 -9
- package/models/Trade.ts +36 -24
- package/models/Trades.ts +4 -3
- package/models/Tx.ts +42 -28
- package/models/TxHash.ts +3 -2
- package/models/Txs.ts +4 -3
- package/models/ValidatorInfo.ts +6 -4
- package/openapi.json +536 -80
- package/package.json +1 -1
package/apis/TransactionApi.ts
CHANGED
|
@@ -54,8 +54,8 @@ export interface GetBlockTxsRequest {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export interface GetL2SignatureBodyRequest {
|
|
57
|
-
txType
|
|
58
|
-
txInfo
|
|
57
|
+
txType: number;
|
|
58
|
+
txInfo: string;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
export interface GetNextNonceRequest {
|
|
@@ -83,8 +83,8 @@ export interface GetTxsRequest {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
export interface SendTxRequest {
|
|
86
|
-
txType
|
|
87
|
-
txInfo
|
|
86
|
+
txType: number;
|
|
87
|
+
txInfo: string;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
/**
|
|
@@ -263,6 +263,20 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
263
263
|
* Get transaction signature body
|
|
264
264
|
*/
|
|
265
265
|
async getL2SignatureBodyRaw(requestParameters: GetL2SignatureBodyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SignBody>> {
|
|
266
|
+
if (requestParameters['txType'] == null) {
|
|
267
|
+
throw new runtime.RequiredError(
|
|
268
|
+
'txType',
|
|
269
|
+
'Required parameter "txType" was null or undefined when calling getL2SignatureBody().'
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (requestParameters['txInfo'] == null) {
|
|
274
|
+
throw new runtime.RequiredError(
|
|
275
|
+
'txInfo',
|
|
276
|
+
'Required parameter "txInfo" was null or undefined when calling getL2SignatureBody().'
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
|
|
266
280
|
const queryParameters: any = {};
|
|
267
281
|
|
|
268
282
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
@@ -303,7 +317,7 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
303
317
|
/**
|
|
304
318
|
* Get transaction signature body
|
|
305
319
|
*/
|
|
306
|
-
async getL2SignatureBody(requestParameters: GetL2SignatureBodyRequest
|
|
320
|
+
async getL2SignatureBody(requestParameters: GetL2SignatureBodyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SignBody> {
|
|
307
321
|
const response = await this.getL2SignatureBodyRaw(requestParameters, initOverrides);
|
|
308
322
|
return await response.value();
|
|
309
323
|
}
|
|
@@ -527,6 +541,20 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
527
541
|
* Send raw transaction
|
|
528
542
|
*/
|
|
529
543
|
async sendTxRaw(requestParameters: SendTxRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TxHash>> {
|
|
544
|
+
if (requestParameters['txType'] == null) {
|
|
545
|
+
throw new runtime.RequiredError(
|
|
546
|
+
'txType',
|
|
547
|
+
'Required parameter "txType" was null or undefined when calling sendTx().'
|
|
548
|
+
);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
if (requestParameters['txInfo'] == null) {
|
|
552
|
+
throw new runtime.RequiredError(
|
|
553
|
+
'txInfo',
|
|
554
|
+
'Required parameter "txInfo" was null or undefined when calling sendTx().'
|
|
555
|
+
);
|
|
556
|
+
}
|
|
557
|
+
|
|
530
558
|
const queryParameters: any = {};
|
|
531
559
|
|
|
532
560
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
@@ -567,7 +595,7 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
567
595
|
/**
|
|
568
596
|
* Send raw transaction
|
|
569
597
|
*/
|
|
570
|
-
async sendTx(requestParameters: SendTxRequest
|
|
598
|
+
async sendTx(requestParameters: SendTxRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TxHash> {
|
|
571
599
|
const response = await this.sendTxRaw(requestParameters, initOverrides);
|
|
572
600
|
return await response.value();
|
|
573
601
|
}
|
|
@@ -24,43 +24,49 @@ 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;
|
|
64
70
|
return true;
|
|
65
71
|
}
|
|
66
72
|
|
|
@@ -74,12 +80,12 @@ export function AccountMarketStatsFromJSONTyped(json: any, ignoreDiscriminator:
|
|
|
74
80
|
}
|
|
75
81
|
return {
|
|
76
82
|
|
|
77
|
-
'marketId': json['market_id']
|
|
78
|
-
'dailyTradesCount': json['daily_trades_count']
|
|
79
|
-
'dailyBaseTokenVolume': json['daily_base_token_volume']
|
|
80
|
-
'dailyQuoteTokenVolume': json['daily_quote_token_volume']
|
|
81
|
-
'openPositionBase': json['open_position_base']
|
|
82
|
-
'openPositionQuote': json['open_position_quote']
|
|
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'],
|
|
83
89
|
};
|
|
84
90
|
}
|
|
85
91
|
|
package/models/AccountPnL.ts
CHANGED
|
@@ -43,19 +43,21 @@ 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;
|
|
59
61
|
return true;
|
|
60
62
|
}
|
|
61
63
|
|
|
@@ -71,8 +73,8 @@ export function AccountPnLFromJSONTyped(json: any, ignoreDiscriminator: boolean)
|
|
|
71
73
|
|
|
72
74
|
'code': json['code'] == null ? undefined : json['code'],
|
|
73
75
|
'message': json['message'] == null ? undefined : json['message'],
|
|
74
|
-
'resolution': json['resolution']
|
|
75
|
-
'pnl':
|
|
76
|
+
'resolution': json['resolution'],
|
|
77
|
+
'pnl': ((json['pnl'] as Array<any>).map(PnLEntryFromJSON)),
|
|
76
78
|
};
|
|
77
79
|
}
|
|
78
80
|
|
|
@@ -85,7 +87,7 @@ export function AccountPnLToJSON(value?: AccountPnL | null): any {
|
|
|
85
87
|
'code': value['code'],
|
|
86
88
|
'message': value['message'],
|
|
87
89
|
'resolution': value['resolution'],
|
|
88
|
-
'pnl':
|
|
90
|
+
'pnl': ((value['pnl'] as Array<any>).map(PnLEntryToJSON)),
|
|
89
91
|
};
|
|
90
92
|
}
|
|
91
93
|
|
|
@@ -24,73 +24,84 @@ 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;
|
|
94
105
|
return true;
|
|
95
106
|
}
|
|
96
107
|
|
|
@@ -104,17 +115,17 @@ export function AccountPositionFromJSONTyped(json: any, ignoreDiscriminator: boo
|
|
|
104
115
|
}
|
|
105
116
|
return {
|
|
106
117
|
|
|
107
|
-
'marketId': json['market_id']
|
|
108
|
-
'name': json['name']
|
|
109
|
-
'symbol': json['symbol']
|
|
110
|
-
'sign': json['sign']
|
|
111
|
-
'position': json['position']
|
|
112
|
-
'askOrderSize': json['ask_order_size']
|
|
113
|
-
'bidOrderSize': json['bid_order_size']
|
|
114
|
-
'avgEntryPrice': json['avg_entry_price']
|
|
115
|
-
'positionValue': json['position_value']
|
|
116
|
-
'unrealizedPnl': json['unrealized_pnl']
|
|
117
|
-
'realizedPnl': json['realized_pnl']
|
|
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'],
|
|
118
129
|
};
|
|
119
130
|
}
|
|
120
131
|
|
package/models/AccountStats.ts
CHANGED
|
@@ -24,37 +24,42 @@ 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;
|
|
58
63
|
return true;
|
|
59
64
|
}
|
|
60
65
|
|
|
@@ -68,11 +73,11 @@ export function AccountStatsFromJSONTyped(json: any, ignoreDiscriminator: boolea
|
|
|
68
73
|
}
|
|
69
74
|
return {
|
|
70
75
|
|
|
71
|
-
'portfolioValue': json['portfolio_value']
|
|
72
|
-
'leverage': json['leverage']
|
|
73
|
-
'freeCollateral': json['free_collateral']
|
|
74
|
-
'marginUsage': json['margin_usage']
|
|
75
|
-
'buyingPower': json['buying_power']
|
|
76
|
+
'portfolioValue': json['portfolio_value'],
|
|
77
|
+
'leverage': json['leverage'],
|
|
78
|
+
'freeCollateral': json['free_collateral'],
|
|
79
|
+
'marginUsage': json['margin_usage'],
|
|
80
|
+
'buyingPower': json['buying_power'],
|
|
76
81
|
};
|
|
77
82
|
}
|
|
78
83
|
|
package/models/Block.ts
CHANGED
|
@@ -31,85 +31,98 @@ export interface Block {
|
|
|
31
31
|
* @type {string}
|
|
32
32
|
* @memberof Block
|
|
33
33
|
*/
|
|
34
|
-
commitment
|
|
34
|
+
commitment: string;
|
|
35
35
|
/**
|
|
36
36
|
*
|
|
37
37
|
* @type {number}
|
|
38
38
|
* @memberof Block
|
|
39
39
|
*/
|
|
40
|
-
height
|
|
40
|
+
height: number;
|
|
41
41
|
/**
|
|
42
42
|
*
|
|
43
43
|
* @type {string}
|
|
44
44
|
* @memberof Block
|
|
45
45
|
*/
|
|
46
|
-
stateRoot
|
|
46
|
+
stateRoot: string;
|
|
47
47
|
/**
|
|
48
48
|
*
|
|
49
49
|
* @type {number}
|
|
50
50
|
* @memberof Block
|
|
51
51
|
*/
|
|
52
|
-
priorityOperations
|
|
52
|
+
priorityOperations: number;
|
|
53
53
|
/**
|
|
54
54
|
*
|
|
55
55
|
* @type {number}
|
|
56
56
|
* @memberof Block
|
|
57
57
|
*/
|
|
58
|
-
onChainL2Operations
|
|
58
|
+
onChainL2Operations: number;
|
|
59
59
|
/**
|
|
60
60
|
*
|
|
61
61
|
* @type {string}
|
|
62
62
|
* @memberof Block
|
|
63
63
|
*/
|
|
64
|
-
pendingOnChainOperationsPubData
|
|
64
|
+
pendingOnChainOperationsPubData: string;
|
|
65
65
|
/**
|
|
66
66
|
*
|
|
67
67
|
* @type {string}
|
|
68
68
|
* @memberof Block
|
|
69
69
|
*/
|
|
70
|
-
committedTxHash
|
|
70
|
+
committedTxHash: string;
|
|
71
71
|
/**
|
|
72
72
|
*
|
|
73
73
|
* @type {number}
|
|
74
74
|
* @memberof Block
|
|
75
75
|
*/
|
|
76
|
-
committedAt
|
|
76
|
+
committedAt: number;
|
|
77
77
|
/**
|
|
78
78
|
*
|
|
79
79
|
* @type {string}
|
|
80
80
|
* @memberof Block
|
|
81
81
|
*/
|
|
82
|
-
verifiedTxHash
|
|
82
|
+
verifiedTxHash: string;
|
|
83
83
|
/**
|
|
84
84
|
*
|
|
85
85
|
* @type {number}
|
|
86
86
|
* @memberof Block
|
|
87
87
|
*/
|
|
88
|
-
verifiedAt
|
|
88
|
+
verifiedAt: number;
|
|
89
89
|
/**
|
|
90
90
|
*
|
|
91
91
|
* @type {Array<Tx>}
|
|
92
92
|
* @memberof Block
|
|
93
93
|
*/
|
|
94
|
-
txs
|
|
94
|
+
txs: Array<Tx>;
|
|
95
95
|
/**
|
|
96
96
|
*
|
|
97
97
|
* @type {number}
|
|
98
98
|
* @memberof Block
|
|
99
99
|
*/
|
|
100
|
-
status
|
|
100
|
+
status: number;
|
|
101
101
|
/**
|
|
102
102
|
*
|
|
103
103
|
* @type {number}
|
|
104
104
|
* @memberof Block
|
|
105
105
|
*/
|
|
106
|
-
size
|
|
106
|
+
size: number;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* Check if a given object implements the Block interface.
|
|
111
111
|
*/
|
|
112
112
|
export function instanceOfBlock(value: object): value is Block {
|
|
113
|
+
if (!('commitment' in value) || value['commitment'] === undefined) return false;
|
|
114
|
+
if (!('height' in value) || value['height'] === undefined) return false;
|
|
115
|
+
if (!('stateRoot' in value) || value['stateRoot'] === undefined) return false;
|
|
116
|
+
if (!('priorityOperations' in value) || value['priorityOperations'] === undefined) return false;
|
|
117
|
+
if (!('onChainL2Operations' in value) || value['onChainL2Operations'] === undefined) return false;
|
|
118
|
+
if (!('pendingOnChainOperationsPubData' in value) || value['pendingOnChainOperationsPubData'] === undefined) return false;
|
|
119
|
+
if (!('committedTxHash' in value) || value['committedTxHash'] === undefined) return false;
|
|
120
|
+
if (!('committedAt' in value) || value['committedAt'] === undefined) return false;
|
|
121
|
+
if (!('verifiedTxHash' in value) || value['verifiedTxHash'] === undefined) return false;
|
|
122
|
+
if (!('verifiedAt' in value) || value['verifiedAt'] === undefined) return false;
|
|
123
|
+
if (!('txs' in value) || value['txs'] === undefined) return false;
|
|
124
|
+
if (!('status' in value) || value['status'] === undefined) return false;
|
|
125
|
+
if (!('size' in value) || value['size'] === undefined) return false;
|
|
113
126
|
return true;
|
|
114
127
|
}
|
|
115
128
|
|
|
@@ -123,19 +136,19 @@ export function BlockFromJSONTyped(json: any, ignoreDiscriminator: boolean): Blo
|
|
|
123
136
|
}
|
|
124
137
|
return {
|
|
125
138
|
|
|
126
|
-
'commitment': json['commitment']
|
|
127
|
-
'height': json['height']
|
|
128
|
-
'stateRoot': json['state_root']
|
|
129
|
-
'priorityOperations': json['priority_operations']
|
|
130
|
-
'onChainL2Operations': json['on_chain_l2_operations']
|
|
131
|
-
'pendingOnChainOperationsPubData': json['pending_on_chain_operations_pub_data']
|
|
132
|
-
'committedTxHash': json['committed_tx_hash']
|
|
133
|
-
'committedAt': json['committed_at']
|
|
134
|
-
'verifiedTxHash': json['verified_tx_hash']
|
|
135
|
-
'verifiedAt': json['verified_at']
|
|
136
|
-
'txs':
|
|
137
|
-
'status': json['status']
|
|
138
|
-
'size': json['size']
|
|
139
|
+
'commitment': json['commitment'],
|
|
140
|
+
'height': json['height'],
|
|
141
|
+
'stateRoot': json['state_root'],
|
|
142
|
+
'priorityOperations': json['priority_operations'],
|
|
143
|
+
'onChainL2Operations': json['on_chain_l2_operations'],
|
|
144
|
+
'pendingOnChainOperationsPubData': json['pending_on_chain_operations_pub_data'],
|
|
145
|
+
'committedTxHash': json['committed_tx_hash'],
|
|
146
|
+
'committedAt': json['committed_at'],
|
|
147
|
+
'verifiedTxHash': json['verified_tx_hash'],
|
|
148
|
+
'verifiedAt': json['verified_at'],
|
|
149
|
+
'txs': ((json['txs'] as Array<any>).map(TxFromJSON)),
|
|
150
|
+
'status': json['status'],
|
|
151
|
+
'size': json['size'],
|
|
139
152
|
};
|
|
140
153
|
}
|
|
141
154
|
|
|
@@ -155,7 +168,7 @@ export function BlockToJSON(value?: Block | null): any {
|
|
|
155
168
|
'committed_at': value['committedAt'],
|
|
156
169
|
'verified_tx_hash': value['verifiedTxHash'],
|
|
157
170
|
'verified_at': value['verifiedAt'],
|
|
158
|
-
'txs':
|
|
171
|
+
'txs': ((value['txs'] as Array<any>).map(TxToJSON)),
|
|
159
172
|
'status': value['status'],
|
|
160
173
|
'size': value['size'],
|
|
161
174
|
};
|
package/models/Blocks.ts
CHANGED
|
@@ -43,19 +43,21 @@ export interface Blocks {
|
|
|
43
43
|
* @type {number}
|
|
44
44
|
* @memberof Blocks
|
|
45
45
|
*/
|
|
46
|
-
total
|
|
46
|
+
total: number;
|
|
47
47
|
/**
|
|
48
48
|
*
|
|
49
49
|
* @type {Array<Block>}
|
|
50
50
|
* @memberof Blocks
|
|
51
51
|
*/
|
|
52
|
-
blocks
|
|
52
|
+
blocks: Array<Block>;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* Check if a given object implements the Blocks interface.
|
|
57
57
|
*/
|
|
58
58
|
export function instanceOfBlocks(value: object): value is Blocks {
|
|
59
|
+
if (!('total' in value) || value['total'] === undefined) return false;
|
|
60
|
+
if (!('blocks' in value) || value['blocks'] === undefined) return false;
|
|
59
61
|
return true;
|
|
60
62
|
}
|
|
61
63
|
|
|
@@ -71,8 +73,8 @@ export function BlocksFromJSONTyped(json: any, ignoreDiscriminator: boolean): Bl
|
|
|
71
73
|
|
|
72
74
|
'code': json['code'] == null ? undefined : json['code'],
|
|
73
75
|
'message': json['message'] == null ? undefined : json['message'],
|
|
74
|
-
'total': json['total']
|
|
75
|
-
'blocks':
|
|
76
|
+
'total': json['total'],
|
|
77
|
+
'blocks': ((json['blocks'] as Array<any>).map(BlockFromJSON)),
|
|
76
78
|
};
|
|
77
79
|
}
|
|
78
80
|
|
|
@@ -85,7 +87,7 @@ export function BlocksToJSON(value?: Blocks | null): any {
|
|
|
85
87
|
'code': value['code'],
|
|
86
88
|
'message': value['message'],
|
|
87
89
|
'total': value['total'],
|
|
88
|
-
'blocks':
|
|
90
|
+
'blocks': ((value['blocks'] as Array<any>).map(BlockToJSON)),
|
|
89
91
|
};
|
|
90
92
|
}
|
|
91
93
|
|
package/models/Candlestick.ts
CHANGED
|
@@ -24,49 +24,56 @@ export interface Candlestick {
|
|
|
24
24
|
* @type {number}
|
|
25
25
|
* @memberof Candlestick
|
|
26
26
|
*/
|
|
27
|
-
timestamp
|
|
27
|
+
timestamp: number;
|
|
28
28
|
/**
|
|
29
29
|
*
|
|
30
30
|
* @type {number}
|
|
31
31
|
* @memberof Candlestick
|
|
32
32
|
*/
|
|
33
|
-
open
|
|
33
|
+
open: number;
|
|
34
34
|
/**
|
|
35
35
|
*
|
|
36
36
|
* @type {number}
|
|
37
37
|
* @memberof Candlestick
|
|
38
38
|
*/
|
|
39
|
-
high
|
|
39
|
+
high: number;
|
|
40
40
|
/**
|
|
41
41
|
*
|
|
42
42
|
* @type {number}
|
|
43
43
|
* @memberof Candlestick
|
|
44
44
|
*/
|
|
45
|
-
low
|
|
45
|
+
low: number;
|
|
46
46
|
/**
|
|
47
47
|
*
|
|
48
48
|
* @type {number}
|
|
49
49
|
* @memberof Candlestick
|
|
50
50
|
*/
|
|
51
|
-
close
|
|
51
|
+
close: number;
|
|
52
52
|
/**
|
|
53
53
|
*
|
|
54
54
|
* @type {number}
|
|
55
55
|
* @memberof Candlestick
|
|
56
56
|
*/
|
|
57
|
-
volume0
|
|
57
|
+
volume0: number;
|
|
58
58
|
/**
|
|
59
59
|
*
|
|
60
60
|
* @type {number}
|
|
61
61
|
* @memberof Candlestick
|
|
62
62
|
*/
|
|
63
|
-
volume1
|
|
63
|
+
volume1: number;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
67
|
* Check if a given object implements the Candlestick interface.
|
|
68
68
|
*/
|
|
69
69
|
export function instanceOfCandlestick(value: object): value is Candlestick {
|
|
70
|
+
if (!('timestamp' in value) || value['timestamp'] === undefined) return false;
|
|
71
|
+
if (!('open' in value) || value['open'] === undefined) return false;
|
|
72
|
+
if (!('high' in value) || value['high'] === undefined) return false;
|
|
73
|
+
if (!('low' in value) || value['low'] === undefined) return false;
|
|
74
|
+
if (!('close' in value) || value['close'] === undefined) return false;
|
|
75
|
+
if (!('volume0' in value) || value['volume0'] === undefined) return false;
|
|
76
|
+
if (!('volume1' in value) || value['volume1'] === undefined) return false;
|
|
70
77
|
return true;
|
|
71
78
|
}
|
|
72
79
|
|
|
@@ -80,13 +87,13 @@ export function CandlestickFromJSONTyped(json: any, ignoreDiscriminator: boolean
|
|
|
80
87
|
}
|
|
81
88
|
return {
|
|
82
89
|
|
|
83
|
-
'timestamp': json['timestamp']
|
|
84
|
-
'open': json['open']
|
|
85
|
-
'high': json['high']
|
|
86
|
-
'low': json['low']
|
|
87
|
-
'close': json['close']
|
|
88
|
-
'volume0': json['volume0']
|
|
89
|
-
'volume1': json['volume1']
|
|
90
|
+
'timestamp': json['timestamp'],
|
|
91
|
+
'open': json['open'],
|
|
92
|
+
'high': json['high'],
|
|
93
|
+
'low': json['low'],
|
|
94
|
+
'close': json['close'],
|
|
95
|
+
'volume0': json['volume0'],
|
|
96
|
+
'volume1': json['volume1'],
|
|
90
97
|
};
|
|
91
98
|
}
|
|
92
99
|
|