@grvt/client 1.4.30 → 1.5.0-alpha.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/MDG/index.d.ts +2 -2
- package/MDG/index.js +76 -38
- package/TDG/index.d.ts +2 -42
- package/TDG/index.js +152 -150
- package/index.d.ts +0 -1
- package/index.js +0 -1
- package/interfaces/codegen/index.d.ts +0 -1
- package/interfaces/codegen/index.js +0 -1
- package/package.json +1 -1
- package/utils/index.d.ts +2 -2
- package/utils/index.js +2 -1
- package/ws/ws.d.ts +1 -1
- package/ws/ws.js +71 -59
- package/interfaces/codegen/schema-maps/index.d.ts +0 -332
- package/interfaces/codegen/schema-maps/index.js +0 -348
package/MDG/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import type { IApiBatchQueryVaultDetailRequest, IApiBatchQueryVaultDetailResponse, IApiBatchQueryVaultPerformanceRequest, IApiBatchQueryVaultPerformanceResponse, IApiBatchQueryVaultRiskMetricRequest, IApiBatchQueryVaultRiskMetricResponse, IApiCandlestickRequest, IApiCandlestickResponse, IApiFundingRateRequest, IApiFundingRateResponse, IApiGetAllInstrumentsRequest, IApiGetAllInstrumentsResponse, IApiGetFilteredInstrumentsRequest, IApiGetFilteredInstrumentsResponse, IApiGetInstrumentRequest, IApiGetInstrumentResponse, IApiMiniTickerRequest, IApiMiniTickerResponse, IApiOrderbookLevelsRequest, IApiOrderbookLevelsResponse, IApiQueryListVaultSubAccountSummaryRequest, IApiQueryListVaultSubAccountSummaryResponse, IApiQuerySnapVaultPositionRequest, IApiQuerySnapVaultPositionResponse, IApiQueryVaultPerformanceTrendRequest, IApiQueryVaultPerformanceTrendResponse, IApiQueryVaultSummaryHistoryRequest, IApiQueryVaultSummaryHistoryResponse, IApiSettlementPriceRequest, IApiSettlementPriceResponse, IApiTickerRequest, IApiTickerResponse, IApiTimedAssetExposureResponse, IApiTimedVaultAssetExposureRequest, IApiTradeHistoryRequest, IApiTradeHistoryResponse, IApiTradeRequest, IApiTradeResponse, IConfig } from '../interfaces';
|
|
3
3
|
export declare class MDG {
|
|
4
4
|
private readonly _axios;
|
|
5
5
|
private readonly _fullUrl;
|
package/MDG/index.js
CHANGED
|
@@ -2,6 +2,44 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MDG = void 0;
|
|
4
4
|
const interfaces_1 = require("../interfaces");
|
|
5
|
+
const api_batch_query_vault_detail_request_1 = require("../interfaces/codegen/schema-maps/api_batch_query_vault_detail_request");
|
|
6
|
+
const api_batch_query_vault_detail_response_1 = require("../interfaces/codegen/schema-maps/api_batch_query_vault_detail_response");
|
|
7
|
+
const api_batch_query_vault_performance_request_1 = require("../interfaces/codegen/schema-maps/api_batch_query_vault_performance_request");
|
|
8
|
+
const api_batch_query_vault_performance_response_1 = require("../interfaces/codegen/schema-maps/api_batch_query_vault_performance_response");
|
|
9
|
+
const api_batch_query_vault_risk_metric_request_1 = require("../interfaces/codegen/schema-maps/api_batch_query_vault_risk_metric_request");
|
|
10
|
+
const api_batch_query_vault_risk_metric_response_1 = require("../interfaces/codegen/schema-maps/api_batch_query_vault_risk_metric_response");
|
|
11
|
+
const api_candlestick_request_1 = require("../interfaces/codegen/schema-maps/api_candlestick_request");
|
|
12
|
+
const api_candlestick_response_1 = require("../interfaces/codegen/schema-maps/api_candlestick_response");
|
|
13
|
+
const api_funding_rate_request_1 = require("../interfaces/codegen/schema-maps/api_funding_rate_request");
|
|
14
|
+
const api_funding_rate_response_1 = require("../interfaces/codegen/schema-maps/api_funding_rate_response");
|
|
15
|
+
const api_get_all_instruments_request_1 = require("../interfaces/codegen/schema-maps/api_get_all_instruments_request");
|
|
16
|
+
const api_get_all_instruments_response_1 = require("../interfaces/codegen/schema-maps/api_get_all_instruments_response");
|
|
17
|
+
const api_get_filtered_instruments_request_1 = require("../interfaces/codegen/schema-maps/api_get_filtered_instruments_request");
|
|
18
|
+
const api_get_filtered_instruments_response_1 = require("../interfaces/codegen/schema-maps/api_get_filtered_instruments_response");
|
|
19
|
+
const api_get_instrument_request_1 = require("../interfaces/codegen/schema-maps/api_get_instrument_request");
|
|
20
|
+
const api_get_instrument_response_1 = require("../interfaces/codegen/schema-maps/api_get_instrument_response");
|
|
21
|
+
const api_mini_ticker_request_1 = require("../interfaces/codegen/schema-maps/api_mini_ticker_request");
|
|
22
|
+
const api_mini_ticker_response_1 = require("../interfaces/codegen/schema-maps/api_mini_ticker_response");
|
|
23
|
+
const api_orderbook_levels_request_1 = require("../interfaces/codegen/schema-maps/api_orderbook_levels_request");
|
|
24
|
+
const api_orderbook_levels_response_1 = require("../interfaces/codegen/schema-maps/api_orderbook_levels_response");
|
|
25
|
+
const api_query_list_vault_sub_account_summary_request_1 = require("../interfaces/codegen/schema-maps/api_query_list_vault_sub_account_summary_request");
|
|
26
|
+
const api_query_list_vault_sub_account_summary_response_1 = require("../interfaces/codegen/schema-maps/api_query_list_vault_sub_account_summary_response");
|
|
27
|
+
const api_query_snap_vault_position_request_1 = require("../interfaces/codegen/schema-maps/api_query_snap_vault_position_request");
|
|
28
|
+
const api_query_snap_vault_position_response_1 = require("../interfaces/codegen/schema-maps/api_query_snap_vault_position_response");
|
|
29
|
+
const api_query_vault_performance_trend_request_1 = require("../interfaces/codegen/schema-maps/api_query_vault_performance_trend_request");
|
|
30
|
+
const api_query_vault_performance_trend_response_1 = require("../interfaces/codegen/schema-maps/api_query_vault_performance_trend_response");
|
|
31
|
+
const api_query_vault_summary_history_request_1 = require("../interfaces/codegen/schema-maps/api_query_vault_summary_history_request");
|
|
32
|
+
const api_query_vault_summary_history_response_1 = require("../interfaces/codegen/schema-maps/api_query_vault_summary_history_response");
|
|
33
|
+
const api_settlement_price_request_1 = require("../interfaces/codegen/schema-maps/api_settlement_price_request");
|
|
34
|
+
const api_settlement_price_response_1 = require("../interfaces/codegen/schema-maps/api_settlement_price_response");
|
|
35
|
+
const api_ticker_request_1 = require("../interfaces/codegen/schema-maps/api_ticker_request");
|
|
36
|
+
const api_ticker_response_1 = require("../interfaces/codegen/schema-maps/api_ticker_response");
|
|
37
|
+
const api_timed_asset_exposure_response_1 = require("../interfaces/codegen/schema-maps/api_timed_asset_exposure_response");
|
|
38
|
+
const api_timed_vault_asset_exposure_request_1 = require("../interfaces/codegen/schema-maps/api_timed_vault_asset_exposure_request");
|
|
39
|
+
const api_trade_history_request_1 = require("../interfaces/codegen/schema-maps/api_trade_history_request");
|
|
40
|
+
const api_trade_history_response_1 = require("../interfaces/codegen/schema-maps/api_trade_history_response");
|
|
41
|
+
const api_trade_request_1 = require("../interfaces/codegen/schema-maps/api_trade_request");
|
|
42
|
+
const api_trade_response_1 = require("../interfaces/codegen/schema-maps/api_trade_response");
|
|
5
43
|
const services_1 = require("../services");
|
|
6
44
|
const utils_1 = require("../utils");
|
|
7
45
|
class MDG {
|
|
@@ -18,131 +56,131 @@ class MDG {
|
|
|
18
56
|
* @see https://api-docs.grvt.io/market_data_api/#get-instrument
|
|
19
57
|
*/
|
|
20
58
|
instrument(payload, config) {
|
|
21
|
-
return this._axios.post(this._liteUrl + '/instrument', utils_1.Utils.schemaMap(payload,
|
|
22
|
-
return utils_1.Utils.schemaMap(response.data,
|
|
59
|
+
return this._axios.post(this._liteUrl + '/instrument', utils_1.Utils.schemaMap(payload, api_get_instrument_request_1.API_GET_INSTRUMENT_REQUEST_MAP.FULL_TO_LITE, true), Object.assign(Object.assign({}, config), { withCredentials: false })).then((response) => {
|
|
60
|
+
return utils_1.Utils.schemaMap(response.data, api_get_instrument_response_1.API_GET_INSTRUMENT_RESPONSE_MAP.LITE_TO_FULL);
|
|
23
61
|
}).catch(utils_1.Utils.coverApiError);
|
|
24
62
|
}
|
|
25
63
|
/**
|
|
26
64
|
* @see https://api-docs.grvt.io/market_data_api/#get-instruments
|
|
27
65
|
*/
|
|
28
66
|
instruments(payload, config) {
|
|
29
|
-
return this._axios.post(this._liteUrl + '/instruments', utils_1.Utils.schemaMap(payload,
|
|
30
|
-
return utils_1.Utils.schemaMap(response.data,
|
|
67
|
+
return this._axios.post(this._liteUrl + '/instruments', utils_1.Utils.schemaMap(payload, api_get_filtered_instruments_request_1.API_GET_FILTERED_INSTRUMENTS_REQUEST_MAP.FULL_TO_LITE, true), Object.assign(Object.assign({}, config), { withCredentials: false })).then((response) => {
|
|
68
|
+
return utils_1.Utils.schemaMap(response.data, api_get_filtered_instruments_response_1.API_GET_FILTERED_INSTRUMENTS_RESPONSE_MAP.LITE_TO_FULL);
|
|
31
69
|
}).catch(utils_1.Utils.coverApiError);
|
|
32
70
|
}
|
|
33
71
|
/**
|
|
34
72
|
* @see https://api-docs.grvt.io/market_data_api/#get-all-instruments
|
|
35
73
|
*/
|
|
36
74
|
allInstruments(payload, config) {
|
|
37
|
-
return this._axios.post(this._liteUrl + '/all_instruments', utils_1.Utils.schemaMap(payload,
|
|
38
|
-
return utils_1.Utils.schemaMap(response.data,
|
|
75
|
+
return this._axios.post(this._liteUrl + '/all_instruments', utils_1.Utils.schemaMap(payload, api_get_all_instruments_request_1.API_GET_ALL_INSTRUMENTS_REQUEST_MAP.FULL_TO_LITE, true), Object.assign(Object.assign({}, config), { withCredentials: false })).then((response) => {
|
|
76
|
+
return utils_1.Utils.schemaMap(response.data, api_get_all_instruments_response_1.API_GET_ALL_INSTRUMENTS_RESPONSE_MAP.LITE_TO_FULL);
|
|
39
77
|
}).catch(utils_1.Utils.coverApiError);
|
|
40
78
|
}
|
|
41
79
|
/**
|
|
42
80
|
* @see https://api-docs.grvt.io/market_data_api/#mini-ticker
|
|
43
81
|
*/
|
|
44
82
|
miniTicker(payload, config) {
|
|
45
|
-
return this._axios.post(this._liteUrl + '/mini', utils_1.Utils.schemaMap(payload,
|
|
46
|
-
return utils_1.Utils.schemaMap(response.data,
|
|
83
|
+
return this._axios.post(this._liteUrl + '/mini', utils_1.Utils.schemaMap(payload, api_mini_ticker_request_1.API_MINI_TICKER_REQUEST_MAP.FULL_TO_LITE, true), Object.assign(Object.assign({}, config), { withCredentials: false })).then((response) => {
|
|
84
|
+
return utils_1.Utils.schemaMap(response.data, api_mini_ticker_response_1.API_MINI_TICKER_RESPONSE_MAP.LITE_TO_FULL);
|
|
47
85
|
}).catch(utils_1.Utils.coverApiError);
|
|
48
86
|
}
|
|
49
87
|
/**
|
|
50
88
|
* @see https://api-docs.grvt.io/market_data_api/#ticker
|
|
51
89
|
*/
|
|
52
90
|
ticker(payload, config) {
|
|
53
|
-
return this._axios.post(this._liteUrl + '/ticker', utils_1.Utils.schemaMap(payload,
|
|
54
|
-
return utils_1.Utils.schemaMap(response.data,
|
|
91
|
+
return this._axios.post(this._liteUrl + '/ticker', utils_1.Utils.schemaMap(payload, api_ticker_request_1.API_TICKER_REQUEST_MAP.FULL_TO_LITE, true), Object.assign(Object.assign({}, config), { withCredentials: false })).then((response) => {
|
|
92
|
+
return utils_1.Utils.schemaMap(response.data, api_ticker_response_1.API_TICKER_RESPONSE_MAP.LITE_TO_FULL);
|
|
55
93
|
}).catch(utils_1.Utils.coverApiError);
|
|
56
94
|
}
|
|
57
95
|
/**
|
|
58
96
|
* @see https://api-docs.grvt.io/market_data_api/#orderbook
|
|
59
97
|
*/
|
|
60
98
|
orderBook(payload, config) {
|
|
61
|
-
return this._axios.post(this._liteUrl + '/book', utils_1.Utils.schemaMap(payload,
|
|
62
|
-
return utils_1.Utils.schemaMap(response.data,
|
|
99
|
+
return this._axios.post(this._liteUrl + '/book', utils_1.Utils.schemaMap(payload, api_orderbook_levels_request_1.API_ORDERBOOK_LEVELS_REQUEST_MAP.FULL_TO_LITE, true), Object.assign(Object.assign({}, config), { withCredentials: false })).then((response) => {
|
|
100
|
+
return utils_1.Utils.schemaMap(response.data, api_orderbook_levels_response_1.API_ORDERBOOK_LEVELS_RESPONSE_MAP.LITE_TO_FULL);
|
|
63
101
|
}).catch(utils_1.Utils.coverApiError);
|
|
64
102
|
}
|
|
65
103
|
/**
|
|
66
104
|
* @see https://api-docs.grvt.io/market_data_api/#trade_1
|
|
67
105
|
*/
|
|
68
106
|
trade(payload, config) {
|
|
69
|
-
return this._axios.post(this._liteUrl + '/trade', utils_1.Utils.schemaMap(payload,
|
|
70
|
-
return utils_1.Utils.schemaMap(response.data,
|
|
107
|
+
return this._axios.post(this._liteUrl + '/trade', utils_1.Utils.schemaMap(payload, api_trade_request_1.API_TRADE_REQUEST_MAP.FULL_TO_LITE, true), Object.assign(Object.assign({}, config), { withCredentials: false })).then((response) => {
|
|
108
|
+
return utils_1.Utils.schemaMap(response.data, api_trade_response_1.API_TRADE_RESPONSE_MAP.LITE_TO_FULL);
|
|
71
109
|
}).catch(utils_1.Utils.coverApiError);
|
|
72
110
|
}
|
|
73
111
|
/**
|
|
74
112
|
* @see https://api-docs.grvt.io/market_data_api/#trade-history
|
|
75
113
|
*/
|
|
76
114
|
tradesHistory(payload, config) {
|
|
77
|
-
return this._axios.post(this._liteUrl + '/trade_history', utils_1.Utils.schemaMap(payload,
|
|
78
|
-
return utils_1.Utils.schemaMap(response.data,
|
|
115
|
+
return this._axios.post(this._liteUrl + '/trade_history', utils_1.Utils.schemaMap(payload, api_trade_history_request_1.API_TRADE_HISTORY_REQUEST_MAP.FULL_TO_LITE, true), Object.assign(Object.assign({}, config), { withCredentials: false })).then((response) => {
|
|
116
|
+
return utils_1.Utils.schemaMap(response.data, api_trade_history_response_1.API_TRADE_HISTORY_RESPONSE_MAP.LITE_TO_FULL);
|
|
79
117
|
}).catch(utils_1.Utils.coverApiError);
|
|
80
118
|
}
|
|
81
119
|
/**
|
|
82
120
|
* @see https://api-docs.grvt.io/market_data_api/#settlement-price
|
|
83
121
|
*/
|
|
84
122
|
settlement(payload, config) {
|
|
85
|
-
return this._axios.post(this._liteUrl + '/settlement', utils_1.Utils.schemaMap(payload,
|
|
86
|
-
return utils_1.Utils.schemaMap(response.data,
|
|
123
|
+
return this._axios.post(this._liteUrl + '/settlement', utils_1.Utils.schemaMap(payload, api_settlement_price_request_1.API_SETTLEMENT_PRICE_REQUEST_MAP.FULL_TO_LITE, true), Object.assign(Object.assign({}, config), { withCredentials: false })).then((response) => {
|
|
124
|
+
return utils_1.Utils.schemaMap(response.data, api_settlement_price_response_1.API_SETTLEMENT_PRICE_RESPONSE_MAP.LITE_TO_FULL);
|
|
87
125
|
}).catch(utils_1.Utils.coverApiError);
|
|
88
126
|
}
|
|
89
127
|
/**
|
|
90
128
|
* @see https://api-docs.grvt.io/market_data_api/#funding-rate
|
|
91
129
|
*/
|
|
92
130
|
funding(payload, config) {
|
|
93
|
-
return this._axios.post(this._liteUrl + '/funding', utils_1.Utils.schemaMap(payload,
|
|
94
|
-
return utils_1.Utils.schemaMap(response.data,
|
|
131
|
+
return this._axios.post(this._liteUrl + '/funding', utils_1.Utils.schemaMap(payload, api_funding_rate_request_1.API_FUNDING_RATE_REQUEST_MAP.FULL_TO_LITE, true), Object.assign(Object.assign({}, config), { withCredentials: false })).then((response) => {
|
|
132
|
+
return utils_1.Utils.schemaMap(response.data, api_funding_rate_response_1.API_FUNDING_RATE_RESPONSE_MAP.LITE_TO_FULL);
|
|
95
133
|
}).catch(utils_1.Utils.coverApiError);
|
|
96
134
|
}
|
|
97
135
|
/**
|
|
98
136
|
* @see https://api-docs.grvt.io/market_data_api/#candlestick
|
|
99
137
|
*/
|
|
100
138
|
candlestick(payload, config) {
|
|
101
|
-
return this._axios.post(this._liteUrl + '/kline', utils_1.Utils.schemaMap(payload,
|
|
102
|
-
return utils_1.Utils.schemaMap(response.data,
|
|
139
|
+
return this._axios.post(this._liteUrl + '/kline', utils_1.Utils.schemaMap(payload, api_candlestick_request_1.API_CANDLESTICK_REQUEST_MAP.FULL_TO_LITE, true), Object.assign(Object.assign({}, config), { withCredentials: false })).then((response) => {
|
|
140
|
+
return utils_1.Utils.schemaMap(response.data, api_candlestick_response_1.API_CANDLESTICK_RESPONSE_MAP.LITE_TO_FULL);
|
|
103
141
|
}).catch(utils_1.Utils.coverApiError);
|
|
104
142
|
}
|
|
105
143
|
/**
|
|
106
144
|
* SECTION: Vault
|
|
107
145
|
*/
|
|
108
146
|
vaultAssetExposure(payload, config) {
|
|
109
|
-
return this._axios.post(this._liteUrl + '/vault_asset_exposure', utils_1.Utils.schemaMap(payload,
|
|
110
|
-
return utils_1.Utils.schemaMap(response.data,
|
|
147
|
+
return this._axios.post(this._liteUrl + '/vault_asset_exposure', utils_1.Utils.schemaMap(payload, api_timed_vault_asset_exposure_request_1.API_TIMED_VAULT_ASSET_EXPOSURE_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
|
|
148
|
+
return utils_1.Utils.schemaMap(response.data, api_timed_asset_exposure_response_1.API_TIMED_ASSET_EXPOSURE_RESPONSE_MAP.LITE_TO_FULL);
|
|
111
149
|
}).catch(utils_1.Utils.coverApiError);
|
|
112
150
|
}
|
|
113
151
|
snapVaultPosition(payload, config) {
|
|
114
|
-
return this._axios.post(this._liteUrl + '/snap_vault_position', utils_1.Utils.schemaMap(payload,
|
|
115
|
-
return utils_1.Utils.schemaMap(response.data,
|
|
152
|
+
return this._axios.post(this._liteUrl + '/snap_vault_position', utils_1.Utils.schemaMap(payload, api_query_snap_vault_position_request_1.API_QUERY_SNAP_VAULT_POSITION_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
|
|
153
|
+
return utils_1.Utils.schemaMap(response.data, api_query_snap_vault_position_response_1.API_QUERY_SNAP_VAULT_POSITION_RESPONSE_MAP.LITE_TO_FULL);
|
|
116
154
|
}).catch(utils_1.Utils.coverApiError);
|
|
117
155
|
}
|
|
118
156
|
vaultDetail(payload, config) {
|
|
119
|
-
return this._axios.post(this._liteUrl + '/vault_detail', utils_1.Utils.schemaMap(payload,
|
|
120
|
-
return utils_1.Utils.schemaMap(response.data,
|
|
157
|
+
return this._axios.post(this._liteUrl + '/vault_detail', utils_1.Utils.schemaMap(payload, api_batch_query_vault_detail_request_1.API_BATCH_QUERY_VAULT_DETAIL_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
|
|
158
|
+
return utils_1.Utils.schemaMap(response.data, api_batch_query_vault_detail_response_1.API_BATCH_QUERY_VAULT_DETAIL_RESPONSE_MAP.LITE_TO_FULL);
|
|
121
159
|
}).catch(utils_1.Utils.coverApiError);
|
|
122
160
|
}
|
|
123
161
|
vaultPerformance(payload, config) {
|
|
124
|
-
return this._axios.post(this._liteUrl + '/vault_performance', utils_1.Utils.schemaMap(payload,
|
|
125
|
-
return utils_1.Utils.schemaMap(response.data,
|
|
162
|
+
return this._axios.post(this._liteUrl + '/vault_performance', utils_1.Utils.schemaMap(payload, api_batch_query_vault_performance_request_1.API_BATCH_QUERY_VAULT_PERFORMANCE_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
|
|
163
|
+
return utils_1.Utils.schemaMap(response.data, api_batch_query_vault_performance_response_1.API_BATCH_QUERY_VAULT_PERFORMANCE_RESPONSE_MAP.LITE_TO_FULL);
|
|
126
164
|
}).catch(utils_1.Utils.coverApiError);
|
|
127
165
|
}
|
|
128
166
|
vaultPerformanceTrend(payload, config) {
|
|
129
|
-
return this._axios.post(this._liteUrl + '/vault_performance_trend', utils_1.Utils.schemaMap(payload,
|
|
130
|
-
return utils_1.Utils.schemaMap(response.data,
|
|
167
|
+
return this._axios.post(this._liteUrl + '/vault_performance_trend', utils_1.Utils.schemaMap(payload, api_query_vault_performance_trend_request_1.API_QUERY_VAULT_PERFORMANCE_TREND_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
|
|
168
|
+
return utils_1.Utils.schemaMap(response.data, api_query_vault_performance_trend_response_1.API_QUERY_VAULT_PERFORMANCE_TREND_RESPONSE_MAP.LITE_TO_FULL);
|
|
131
169
|
}).catch(utils_1.Utils.coverApiError);
|
|
132
170
|
}
|
|
133
171
|
vaultRiskMetric(payload, config) {
|
|
134
|
-
return this._axios.post(this._liteUrl + '/vault_risk_metric', utils_1.Utils.schemaMap(payload,
|
|
135
|
-
return utils_1.Utils.schemaMap(response.data,
|
|
172
|
+
return this._axios.post(this._liteUrl + '/vault_risk_metric', utils_1.Utils.schemaMap(payload, api_batch_query_vault_risk_metric_request_1.API_BATCH_QUERY_VAULT_RISK_METRIC_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
|
|
173
|
+
return utils_1.Utils.schemaMap(response.data, api_batch_query_vault_risk_metric_response_1.API_BATCH_QUERY_VAULT_RISK_METRIC_RESPONSE_MAP.LITE_TO_FULL);
|
|
136
174
|
}).catch(utils_1.Utils.coverApiError);
|
|
137
175
|
}
|
|
138
176
|
vaultSummaryHistory(payload, config) {
|
|
139
|
-
return this._axios.post(this._liteUrl + '/vault_summary_history', utils_1.Utils.schemaMap(payload,
|
|
140
|
-
return utils_1.Utils.schemaMap(response.data,
|
|
177
|
+
return this._axios.post(this._liteUrl + '/vault_summary_history', utils_1.Utils.schemaMap(payload, api_query_vault_summary_history_request_1.API_QUERY_VAULT_SUMMARY_HISTORY_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
|
|
178
|
+
return utils_1.Utils.schemaMap(response.data, api_query_vault_summary_history_response_1.API_QUERY_VAULT_SUMMARY_HISTORY_RESPONSE_MAP.LITE_TO_FULL);
|
|
141
179
|
}).catch(utils_1.Utils.coverApiError);
|
|
142
180
|
}
|
|
143
181
|
vaultSubAccountSummaryHistory(payload, config) {
|
|
144
|
-
return this._axios.post(this._liteUrl + '/vault_sub_account_summary_history', utils_1.Utils.schemaMap(payload,
|
|
145
|
-
return utils_1.Utils.schemaMap(response.data,
|
|
182
|
+
return this._axios.post(this._liteUrl + '/vault_sub_account_summary_history', utils_1.Utils.schemaMap(payload, api_query_list_vault_sub_account_summary_request_1.API_QUERY_LIST_VAULT_SUB_ACCOUNT_SUMMARY_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
|
|
183
|
+
return utils_1.Utils.schemaMap(response.data, api_query_list_vault_sub_account_summary_response_1.API_QUERY_LIST_VAULT_SUB_ACCOUNT_SUMMARY_RESPONSE_MAP.LITE_TO_FULL);
|
|
146
184
|
}).catch(utils_1.Utils.coverApiError);
|
|
147
185
|
}
|
|
148
186
|
}
|
package/TDG/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import type { IAckResponse, IApiAggregatedAccountSummaryResponse, IApiCancelAllOrdersRequest, IApiCancelAllOrdersResponse, IApiCancelOrderRequest, IApiCancelOrderResponse, IApiCreateBulkOrdersRequest, IApiCreateBulkOrdersResponse, IApiCreateOrderRequest, IApiCreateOrderResponse, IApiDedustPositionRequest, IApiDedustPositionResponse, IApiDepositHistoryRequest, IApiDepositHistoryResponse, IApiFillHistoryRequest, IApiFillHistoryResponse, IApiFundingAccountSummaryResponse, IApiFundingPaymentHistoryRequest, IApiFundingPaymentHistoryResponse, IApiGetAllInitialLeverageRequest, IApiGetAllInitialLeverageResponse, IApiGetMarginTiersResponse, IApiGetOrderGroupRequest, IApiGetOrderGroupResponse, IApiGetOrderRequest, IApiGetOrderResponse, IApiOpenOrdersRequest, IApiOpenOrdersResponse, IApiOrderHistoryRequest, IApiOrderHistoryResponse, IApiPositionsRequest, IApiPositionsResponse, IApiPreDepositCheckRequest, IApiPreDepositCheckResponse, IApiPreOrderCheckRequest, IApiPreOrderCheckResponse, IApiQueryListFundingAccountSummaryRequest, IApiQueryListFundingAccountSummaryResponse, IApiQueryListSubAccountSummaryRequest, IApiQueryListSubAccountSummaryResponse, IApiQueryTradingPerformanceRequest, IApiQueryTradingPerformanceResponse, IApiQueryTradingPerformanceTrendRequest, IApiQueryTradingPerformanceTrendResponse, IApiQueryVaultInvestorHistoryRequest, IApiQueryVaultInvestorHistoryResponse, IApiQueryVaultManagerInvestorHistoryRequest, IApiQueryVaultManagerInvestorHistoryResponse, IApiReplaceOrdersRequest, IApiReplaceOrdersResponse, IApiSetInitialLeverageRequest, IApiSetInitialLeverageResponse, IApiSocializedLossStatusResponse, IApiSubAccountHistoryRequest, IApiSubAccountHistoryResponse, IApiSubAccountSummaryRequest, IApiSubAccountSummaryResponse, IApiTimedAssetExposureRequest, IApiTimedAssetExposureResponse, IApiTransferHistoryRequest, IApiTransferHistoryResponse, IApiTransferRequest, IApiTransferResponse, IApiVaultBurnTokensRequest, IApiVaultInvestorSummaryRequest, IApiVaultInvestorSummaryResponse, IApiVaultInvestRequest, IApiVaultRedeemCancelRequest, IApiVaultRedeemRequest, IApiVaultViewRedemptionQueueRequest, IApiVaultViewRedemptionQueueResponse, IApiWithdrawalHistoryRequest, IApiWithdrawalHistoryResponse, IApiWithdrawalRequest, IConfig } from '../interfaces';
|
|
3
3
|
export declare class TDG {
|
|
4
4
|
private readonly _axios;
|
|
5
5
|
private readonly _fullUrl;
|
|
@@ -117,46 +117,6 @@ export declare class TDG {
|
|
|
117
117
|
vaultRedeem(payload: IApiVaultRedeemRequest, config?: AxiosRequestConfig): Promise<IAckResponse>;
|
|
118
118
|
vaultRedeemCancel(payload: IApiVaultRedeemCancelRequest, config?: AxiosRequestConfig): Promise<IAckResponse>;
|
|
119
119
|
vaultViewRedemptionQueue(payload: IApiVaultViewRedemptionQueueRequest, config?: AxiosRequestConfig): Promise<IApiVaultViewRedemptionQueueResponse>;
|
|
120
|
-
/**
|
|
121
|
-
* @deprecated
|
|
122
|
-
* Use MDG
|
|
123
|
-
*/
|
|
124
|
-
vaultPerformance(payload: IApiQueryVaultPerformanceRequest, config?: AxiosRequestConfig): Promise<IApiQueryVaultPerformanceResponse>;
|
|
125
|
-
/**
|
|
126
|
-
* @deprecated
|
|
127
|
-
* Use MDG
|
|
128
|
-
*/
|
|
129
|
-
vaultPerformanceTrend(payload: IApiQueryVaultPerformanceTrendRequest, config?: AxiosRequestConfig): Promise<IApiQueryVaultPerformanceTrendResponse>;
|
|
130
|
-
/**
|
|
131
|
-
* @deprecated
|
|
132
|
-
* Use MDG
|
|
133
|
-
*/
|
|
134
|
-
vaultRiskMetric(payload: IApiQueryVaultRiskMetricRequest, config?: AxiosRequestConfig): Promise<IApiQueryVaultRiskMetricResponse>;
|
|
135
|
-
/**
|
|
136
|
-
* @deprecated
|
|
137
|
-
* Use MDG
|
|
138
|
-
*/
|
|
139
|
-
vaultSummaryHistory(payload: IApiQueryVaultSummaryHistoryRequest, config?: AxiosRequestConfig): Promise<IApiQueryVaultSummaryHistoryResponse>;
|
|
140
|
-
/**
|
|
141
|
-
* @deprecated
|
|
142
|
-
* Use MDG
|
|
143
|
-
*/
|
|
144
|
-
vaultSubAccountSummaryHistory(payload: IApiQueryListVaultSubAccountSummaryRequest, config?: AxiosRequestConfig): Promise<IApiQueryListVaultSubAccountSummaryResponse>;
|
|
145
120
|
vaultInvestorHistory(payload: IApiQueryVaultInvestorHistoryRequest, config?: AxiosRequestConfig): Promise<IApiQueryVaultInvestorHistoryResponse>;
|
|
146
|
-
/**
|
|
147
|
-
* @deprecated
|
|
148
|
-
* Use MDG
|
|
149
|
-
*/
|
|
150
|
-
vaultAssetExposure(payload: IApiTimedVaultAssetExposureRequest, config?: AxiosRequestConfig): Promise<IApiTimedAssetExposureResponse>;
|
|
151
|
-
/**
|
|
152
|
-
* @deprecated
|
|
153
|
-
* Use MDG
|
|
154
|
-
*/
|
|
155
|
-
snapVaultPosition(payload: IApiQuerySnapVaultPositionRequest, config?: AxiosRequestConfig): Promise<IApiQuerySnapVaultPositionResponse>;
|
|
156
|
-
/**
|
|
157
|
-
* @deprecated
|
|
158
|
-
* Use MDG
|
|
159
|
-
*/
|
|
160
|
-
vaultDetail(payload: IApiVaultDetailRequest, config?: AxiosRequestConfig): Promise<IApiVaultDetailResponse>;
|
|
161
121
|
vaultManagerInvestorHistory(payload: IApiQueryVaultManagerInvestorHistoryRequest, config?: AxiosRequestConfig): Promise<IApiQueryVaultManagerInvestorHistoryResponse>;
|
|
162
122
|
}
|