zklighter-perps 1.0.0
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/.circleci/config.yml +86 -0
- package/.openapi-generator/FILES +95 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/apis/AccountApi.ts +454 -0
- package/apis/BlockApi.ts +178 -0
- package/apis/CandlestickApi.ts +231 -0
- package/apis/InfoApi.ts +197 -0
- package/apis/OrderApi.ts +607 -0
- package/apis/RelayerApi.ts +95 -0
- package/apis/RootApi.ts +56 -0
- package/apis/TransactionApi.ts +608 -0
- package/apis/WsApi.ts +82 -0
- package/apis/index.ts +11 -0
- package/config.yaml +5 -0
- package/index.ts +5 -0
- package/models/AccountMarketStats.ts +100 -0
- package/models/AccountPnL.ts +91 -0
- package/models/AccountPosition.ts +140 -0
- package/models/AccountStats.ts +92 -0
- package/models/Block.ts +163 -0
- package/models/Blocks.ts +91 -0
- package/models/Candlestick.ts +108 -0
- package/models/Candlesticks.ts +91 -0
- package/models/ContractAddress.ts +68 -0
- package/models/CurrentHeight.ts +76 -0
- package/models/Cursor.ts +60 -0
- package/models/DetailedAccount.ts +169 -0
- package/models/DetailedAccounts.ts +91 -0
- package/models/EnrichedTx.ts +204 -0
- package/models/ExchangeStats.ts +107 -0
- package/models/Funding.ts +84 -0
- package/models/Fundings.ts +91 -0
- package/models/L1ProviderInfo.ts +84 -0
- package/models/Layer1BasicInfo.ts +143 -0
- package/models/Layer2BasicInfo.ts +92 -0
- package/models/MainAccount.ts +92 -0
- package/models/MainAccounts.ts +91 -0
- package/models/MarketInfo.ts +140 -0
- package/models/MarketSig.ts +100 -0
- package/models/NextNonce.ts +76 -0
- package/models/Order.ts +209 -0
- package/models/OrderBook.ts +143 -0
- package/models/OrderBookDepth.ts +99 -0
- package/models/OrderBookDetail.ts +287 -0
- package/models/OrderBookDetails.ts +83 -0
- package/models/OrderBookOrders.ts +107 -0
- package/models/OrderBookStats.ts +100 -0
- package/models/OrderBooks.ts +83 -0
- package/models/Orders.ts +91 -0
- package/models/Permission.ts +76 -0
- package/models/PnLEntry.ts +68 -0
- package/models/PriceLevel.ts +68 -0
- package/models/ReqDoFaucet.ts +60 -0
- package/models/ReqGetAccount.ts +79 -0
- package/models/ReqGetAccountActiveOrders.ts +76 -0
- package/models/ReqGetAccountByL1Address.ts +60 -0
- package/models/ReqGetAccountInactiveOrders.ts +111 -0
- package/models/ReqGetAccountOrders.ts +84 -0
- package/models/ReqGetAccountPendingTxs.ts +87 -0
- package/models/ReqGetAccountPnL.ts +124 -0
- package/models/ReqGetAccountTxs.ts +103 -0
- package/models/ReqGetBlock.ts +79 -0
- package/models/ReqGetBlockTxs.ts +79 -0
- package/models/ReqGetByAccount.ts +79 -0
- package/models/ReqGetCandlesticks.ts +107 -0
- package/models/ReqGetFundings.ts +102 -0
- package/models/ReqGetL1Tx.ts +60 -0
- package/models/ReqGetMarketSig.ts +76 -0
- package/models/ReqGetNextNonce.ts +68 -0
- package/models/ReqGetOrderBookDetails.ts +79 -0
- package/models/ReqGetOrderBookOrders.ts +68 -0
- package/models/ReqGetOrderBooks.ts +79 -0
- package/models/ReqGetPermission.ts +87 -0
- package/models/ReqGetRangeWithCursor.ts +68 -0
- package/models/ReqGetRangeWithIndex.ts +68 -0
- package/models/ReqGetRangeWithIndexSortable.ts +87 -0
- package/models/ReqGetRecentTrades.ts +68 -0
- package/models/ReqGetRollbacks.ts +76 -0
- package/models/ReqGetSubAccount.ts +87 -0
- package/models/ReqGetTrades.ts +104 -0
- package/models/ReqGetTx.ts +79 -0
- package/models/ReqSearch.ts +60 -0
- package/models/ResultCode.ts +68 -0
- package/models/Rollback.ts +84 -0
- package/models/Rollbacks.ts +91 -0
- package/models/Search.ts +76 -0
- package/models/SignBody.ts +76 -0
- package/models/SimpleOrder.ts +100 -0
- package/models/Status.ts +68 -0
- package/models/SubAccount.ts +116 -0
- package/models/SubAccounts.ts +107 -0
- package/models/Trade.ts +148 -0
- package/models/Trades.ts +83 -0
- package/models/Tx.ts +164 -0
- package/models/TxHash.ts +76 -0
- package/models/Txs.ts +83 -0
- package/models/ValidatorInfo.ts +68 -0
- package/models/index.ts +84 -0
- package/openapi-generator-cli.jar +0 -0
- package/openapi.json +3934 -0
- package/package.json +23 -0
- package/runtime.ts +426 -0
package/apis/WsApi.ts
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export class WsApi extends runtime.BaseAPI {
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* WebSocket Status
|
|
32
|
+
*/
|
|
33
|
+
async getWebSocketStatusRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResultCode>> {
|
|
34
|
+
const queryParameters: any = {};
|
|
35
|
+
|
|
36
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
37
|
+
|
|
38
|
+
const response = await this.request({
|
|
39
|
+
path: `/api/v1/ws_status`,
|
|
40
|
+
method: 'GET',
|
|
41
|
+
headers: headerParameters,
|
|
42
|
+
query: queryParameters,
|
|
43
|
+
}, initOverrides);
|
|
44
|
+
|
|
45
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ResultCodeFromJSON(jsonValue));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* WebSocket Status
|
|
50
|
+
*/
|
|
51
|
+
async getWebSocketStatus(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResultCode> {
|
|
52
|
+
const response = await this.getWebSocketStatusRaw(initOverrides);
|
|
53
|
+
return await response.value();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* WebSocket
|
|
58
|
+
*/
|
|
59
|
+
async streamRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResultCode>> {
|
|
60
|
+
const queryParameters: any = {};
|
|
61
|
+
|
|
62
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
63
|
+
|
|
64
|
+
const response = await this.request({
|
|
65
|
+
path: `/stream`,
|
|
66
|
+
method: 'GET',
|
|
67
|
+
headers: headerParameters,
|
|
68
|
+
query: queryParameters,
|
|
69
|
+
}, initOverrides);
|
|
70
|
+
|
|
71
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ResultCodeFromJSON(jsonValue));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* WebSocket
|
|
76
|
+
*/
|
|
77
|
+
async stream(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResultCode> {
|
|
78
|
+
const response = await this.streamRaw(initOverrides);
|
|
79
|
+
return await response.value();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
}
|
package/apis/index.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export * from './AccountApi';
|
|
4
|
+
export * from './BlockApi';
|
|
5
|
+
export * from './CandlestickApi';
|
|
6
|
+
export * from './InfoApi';
|
|
7
|
+
export * from './OrderApi';
|
|
8
|
+
export * from './RelayerApi';
|
|
9
|
+
export * from './RootApi';
|
|
10
|
+
export * from './TransactionApi';
|
|
11
|
+
export * from './WsApi';
|
package/config.yaml
ADDED
package/index.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
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 AccountMarketStats
|
|
20
|
+
*/
|
|
21
|
+
export interface AccountMarketStats {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof AccountMarketStats
|
|
26
|
+
*/
|
|
27
|
+
marketId?: number;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {number}
|
|
31
|
+
* @memberof AccountMarketStats
|
|
32
|
+
*/
|
|
33
|
+
dailyTradesCount?: number;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {number}
|
|
37
|
+
* @memberof AccountMarketStats
|
|
38
|
+
*/
|
|
39
|
+
dailyBaseTokenVolume?: number;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {number}
|
|
43
|
+
* @memberof AccountMarketStats
|
|
44
|
+
*/
|
|
45
|
+
dailyQuoteTokenVolume?: number;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {number}
|
|
49
|
+
* @memberof AccountMarketStats
|
|
50
|
+
*/
|
|
51
|
+
openPositionBase?: number;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {number}
|
|
55
|
+
* @memberof AccountMarketStats
|
|
56
|
+
*/
|
|
57
|
+
openPositionQuote?: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Check if a given object implements the AccountMarketStats interface.
|
|
62
|
+
*/
|
|
63
|
+
export function instanceOfAccountMarketStats(value: object): value is AccountMarketStats {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function AccountMarketStatsFromJSON(json: any): AccountMarketStats {
|
|
68
|
+
return AccountMarketStatsFromJSONTyped(json, false);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function AccountMarketStatsFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountMarketStats {
|
|
72
|
+
if (json == null) {
|
|
73
|
+
return json;
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
|
|
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'],
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function AccountMarketStatsToJSON(value?: AccountMarketStats | null): any {
|
|
87
|
+
if (value == null) {
|
|
88
|
+
return value;
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
|
|
92
|
+
'market_id': value['marketId'],
|
|
93
|
+
'daily_trades_count': value['dailyTradesCount'],
|
|
94
|
+
'daily_base_token_volume': value['dailyBaseTokenVolume'],
|
|
95
|
+
'daily_quote_token_volume': value['dailyQuoteTokenVolume'],
|
|
96
|
+
'open_position_base': value['openPositionBase'],
|
|
97
|
+
'open_position_quote': value['openPositionQuote'],
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
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 { PnLEntry } from './PnLEntry';
|
|
17
|
+
import {
|
|
18
|
+
PnLEntryFromJSON,
|
|
19
|
+
PnLEntryFromJSONTyped,
|
|
20
|
+
PnLEntryToJSON,
|
|
21
|
+
} from './PnLEntry';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @export
|
|
26
|
+
* @interface AccountPnL
|
|
27
|
+
*/
|
|
28
|
+
export interface AccountPnL {
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @type {number}
|
|
32
|
+
* @memberof AccountPnL
|
|
33
|
+
*/
|
|
34
|
+
code?: number;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @type {string}
|
|
38
|
+
* @memberof AccountPnL
|
|
39
|
+
*/
|
|
40
|
+
message?: string;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @type {string}
|
|
44
|
+
* @memberof AccountPnL
|
|
45
|
+
*/
|
|
46
|
+
resolution?: string;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @type {Array<PnLEntry>}
|
|
50
|
+
* @memberof AccountPnL
|
|
51
|
+
*/
|
|
52
|
+
pnl?: Array<PnLEntry>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Check if a given object implements the AccountPnL interface.
|
|
57
|
+
*/
|
|
58
|
+
export function instanceOfAccountPnL(value: object): value is AccountPnL {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function AccountPnLFromJSON(json: any): AccountPnL {
|
|
63
|
+
return AccountPnLFromJSONTyped(json, false);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function AccountPnLFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountPnL {
|
|
67
|
+
if (json == null) {
|
|
68
|
+
return json;
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
|
|
72
|
+
'code': json['code'] == null ? undefined : json['code'],
|
|
73
|
+
'message': json['message'] == null ? undefined : json['message'],
|
|
74
|
+
'resolution': json['resolution'] == null ? undefined : json['resolution'],
|
|
75
|
+
'pnl': json['pnl'] == null ? undefined : ((json['pnl'] as Array<any>).map(PnLEntryFromJSON)),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function AccountPnLToJSON(value?: AccountPnL | null): any {
|
|
80
|
+
if (value == null) {
|
|
81
|
+
return value;
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
|
|
85
|
+
'code': value['code'],
|
|
86
|
+
'message': value['message'],
|
|
87
|
+
'resolution': value['resolution'],
|
|
88
|
+
'pnl': value['pnl'] == null ? undefined : ((value['pnl'] as Array<any>).map(PnLEntryToJSON)),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
@@ -0,0 +1,140 @@
|
|
|
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 AccountPosition
|
|
20
|
+
*/
|
|
21
|
+
export interface AccountPosition {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof AccountPosition
|
|
26
|
+
*/
|
|
27
|
+
marketId?: number;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof AccountPosition
|
|
32
|
+
*/
|
|
33
|
+
name?: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof AccountPosition
|
|
38
|
+
*/
|
|
39
|
+
symbol?: string;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {number}
|
|
43
|
+
* @memberof AccountPosition
|
|
44
|
+
*/
|
|
45
|
+
sign?: number;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof AccountPosition
|
|
50
|
+
*/
|
|
51
|
+
position?: string;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {string}
|
|
55
|
+
* @memberof AccountPosition
|
|
56
|
+
*/
|
|
57
|
+
askOrderSize?: string;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @type {string}
|
|
61
|
+
* @memberof AccountPosition
|
|
62
|
+
*/
|
|
63
|
+
bidOrderSize?: string;
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @type {string}
|
|
67
|
+
* @memberof AccountPosition
|
|
68
|
+
*/
|
|
69
|
+
avgEntryPrice?: string;
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
* @type {string}
|
|
73
|
+
* @memberof AccountPosition
|
|
74
|
+
*/
|
|
75
|
+
positionValue?: string;
|
|
76
|
+
/**
|
|
77
|
+
*
|
|
78
|
+
* @type {string}
|
|
79
|
+
* @memberof AccountPosition
|
|
80
|
+
*/
|
|
81
|
+
unrealizedPnl?: string;
|
|
82
|
+
/**
|
|
83
|
+
*
|
|
84
|
+
* @type {string}
|
|
85
|
+
* @memberof AccountPosition
|
|
86
|
+
*/
|
|
87
|
+
realizedPnl?: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Check if a given object implements the AccountPosition interface.
|
|
92
|
+
*/
|
|
93
|
+
export function instanceOfAccountPosition(value: object): value is AccountPosition {
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function AccountPositionFromJSON(json: any): AccountPosition {
|
|
98
|
+
return AccountPositionFromJSONTyped(json, false);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function AccountPositionFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountPosition {
|
|
102
|
+
if (json == null) {
|
|
103
|
+
return json;
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
|
|
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'],
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export function AccountPositionToJSON(value?: AccountPosition | null): any {
|
|
122
|
+
if (value == null) {
|
|
123
|
+
return value;
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
|
|
127
|
+
'market_id': value['marketId'],
|
|
128
|
+
'name': value['name'],
|
|
129
|
+
'symbol': value['symbol'],
|
|
130
|
+
'sign': value['sign'],
|
|
131
|
+
'position': value['position'],
|
|
132
|
+
'ask_order_size': value['askOrderSize'],
|
|
133
|
+
'bid_order_size': value['bidOrderSize'],
|
|
134
|
+
'avg_entry_price': value['avgEntryPrice'],
|
|
135
|
+
'position_value': value['positionValue'],
|
|
136
|
+
'unrealized_pnl': value['unrealizedPnl'],
|
|
137
|
+
'realized_pnl': value['realizedPnl'],
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
@@ -0,0 +1,92 @@
|
|
|
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 AccountStats
|
|
20
|
+
*/
|
|
21
|
+
export interface AccountStats {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof AccountStats
|
|
26
|
+
*/
|
|
27
|
+
portfolioValue?: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof AccountStats
|
|
32
|
+
*/
|
|
33
|
+
leverage?: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof AccountStats
|
|
38
|
+
*/
|
|
39
|
+
freeCollateral?: string;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof AccountStats
|
|
44
|
+
*/
|
|
45
|
+
marginUsage?: string;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof AccountStats
|
|
50
|
+
*/
|
|
51
|
+
buyingPower?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Check if a given object implements the AccountStats interface.
|
|
56
|
+
*/
|
|
57
|
+
export function instanceOfAccountStats(value: object): value is AccountStats {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function AccountStatsFromJSON(json: any): AccountStats {
|
|
62
|
+
return AccountStatsFromJSONTyped(json, false);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function AccountStatsFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountStats {
|
|
66
|
+
if (json == null) {
|
|
67
|
+
return json;
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
|
|
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'],
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function AccountStatsToJSON(value?: AccountStats | null): any {
|
|
80
|
+
if (value == null) {
|
|
81
|
+
return value;
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
|
|
85
|
+
'portfolio_value': value['portfolioValue'],
|
|
86
|
+
'leverage': value['leverage'],
|
|
87
|
+
'free_collateral': value['freeCollateral'],
|
|
88
|
+
'margin_usage': value['marginUsage'],
|
|
89
|
+
'buying_power': value['buyingPower'],
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
package/models/Block.ts
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
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 { Tx } from './Tx';
|
|
17
|
+
import {
|
|
18
|
+
TxFromJSON,
|
|
19
|
+
TxFromJSONTyped,
|
|
20
|
+
TxToJSON,
|
|
21
|
+
} from './Tx';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @export
|
|
26
|
+
* @interface Block
|
|
27
|
+
*/
|
|
28
|
+
export interface Block {
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @type {string}
|
|
32
|
+
* @memberof Block
|
|
33
|
+
*/
|
|
34
|
+
commitment?: string;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @type {number}
|
|
38
|
+
* @memberof Block
|
|
39
|
+
*/
|
|
40
|
+
height?: number;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @type {string}
|
|
44
|
+
* @memberof Block
|
|
45
|
+
*/
|
|
46
|
+
stateRoot?: string;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @type {number}
|
|
50
|
+
* @memberof Block
|
|
51
|
+
*/
|
|
52
|
+
priorityOperations?: number;
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @type {number}
|
|
56
|
+
* @memberof Block
|
|
57
|
+
*/
|
|
58
|
+
onChainL2Operations?: number;
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* @type {string}
|
|
62
|
+
* @memberof Block
|
|
63
|
+
*/
|
|
64
|
+
pendingOnChainOperationsPubData?: string;
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* @type {string}
|
|
68
|
+
* @memberof Block
|
|
69
|
+
*/
|
|
70
|
+
committedTxHash?: string;
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* @type {number}
|
|
74
|
+
* @memberof Block
|
|
75
|
+
*/
|
|
76
|
+
committedAt?: number;
|
|
77
|
+
/**
|
|
78
|
+
*
|
|
79
|
+
* @type {string}
|
|
80
|
+
* @memberof Block
|
|
81
|
+
*/
|
|
82
|
+
verifiedTxHash?: string;
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
* @type {number}
|
|
86
|
+
* @memberof Block
|
|
87
|
+
*/
|
|
88
|
+
verifiedAt?: number;
|
|
89
|
+
/**
|
|
90
|
+
*
|
|
91
|
+
* @type {Array<Tx>}
|
|
92
|
+
* @memberof Block
|
|
93
|
+
*/
|
|
94
|
+
txs?: Array<Tx>;
|
|
95
|
+
/**
|
|
96
|
+
*
|
|
97
|
+
* @type {number}
|
|
98
|
+
* @memberof Block
|
|
99
|
+
*/
|
|
100
|
+
status?: number;
|
|
101
|
+
/**
|
|
102
|
+
*
|
|
103
|
+
* @type {number}
|
|
104
|
+
* @memberof Block
|
|
105
|
+
*/
|
|
106
|
+
size?: number;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Check if a given object implements the Block interface.
|
|
111
|
+
*/
|
|
112
|
+
export function instanceOfBlock(value: object): value is Block {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function BlockFromJSON(json: any): Block {
|
|
117
|
+
return BlockFromJSONTyped(json, false);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function BlockFromJSONTyped(json: any, ignoreDiscriminator: boolean): Block {
|
|
121
|
+
if (json == null) {
|
|
122
|
+
return json;
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
|
|
126
|
+
'commitment': json['commitment'] == null ? undefined : json['commitment'],
|
|
127
|
+
'height': json['height'] == null ? undefined : json['height'],
|
|
128
|
+
'stateRoot': json['state_root'] == null ? undefined : json['state_root'],
|
|
129
|
+
'priorityOperations': json['priority_operations'] == null ? undefined : json['priority_operations'],
|
|
130
|
+
'onChainL2Operations': json['on_chain_l2_operations'] == null ? undefined : json['on_chain_l2_operations'],
|
|
131
|
+
'pendingOnChainOperationsPubData': json['pending_on_chain_operations_pub_data'] == null ? undefined : json['pending_on_chain_operations_pub_data'],
|
|
132
|
+
'committedTxHash': json['committed_tx_hash'] == null ? undefined : json['committed_tx_hash'],
|
|
133
|
+
'committedAt': json['committed_at'] == null ? undefined : json['committed_at'],
|
|
134
|
+
'verifiedTxHash': json['verified_tx_hash'] == null ? undefined : json['verified_tx_hash'],
|
|
135
|
+
'verifiedAt': json['verified_at'] == null ? undefined : json['verified_at'],
|
|
136
|
+
'txs': json['txs'] == null ? undefined : ((json['txs'] as Array<any>).map(TxFromJSON)),
|
|
137
|
+
'status': json['status'] == null ? undefined : json['status'],
|
|
138
|
+
'size': json['size'] == null ? undefined : json['size'],
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function BlockToJSON(value?: Block | null): any {
|
|
143
|
+
if (value == null) {
|
|
144
|
+
return value;
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
|
|
148
|
+
'commitment': value['commitment'],
|
|
149
|
+
'height': value['height'],
|
|
150
|
+
'state_root': value['stateRoot'],
|
|
151
|
+
'priority_operations': value['priorityOperations'],
|
|
152
|
+
'on_chain_l2_operations': value['onChainL2Operations'],
|
|
153
|
+
'pending_on_chain_operations_pub_data': value['pendingOnChainOperationsPubData'],
|
|
154
|
+
'committed_tx_hash': value['committedTxHash'],
|
|
155
|
+
'committed_at': value['committedAt'],
|
|
156
|
+
'verified_tx_hash': value['verifiedTxHash'],
|
|
157
|
+
'verified_at': value['verifiedAt'],
|
|
158
|
+
'txs': value['txs'] == null ? undefined : ((value['txs'] as Array<any>).map(TxToJSON)),
|
|
159
|
+
'status': value['status'],
|
|
160
|
+
'size': value['size'],
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|