@grvt/client 1.4.2 → 1.4.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/README.md CHANGED
@@ -52,7 +52,7 @@ console.log(
52
52
  )
53
53
  ```
54
54
 
55
- ## To use WebSocket (available only in browsers that support WebSocket)
55
+ ## To use WebSocket (available only in browsers/platforms that support WebSocket)
56
56
 
57
57
  [Browsers supported](https://caniuse.com/websockets)
58
58
 
package/TDG/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type AxiosRequestConfig } from 'axios';
2
- import { type IApiAggregatedAccountSummaryResponse, type IApiCancelAllOrdersRequest, type IApiCancelAllOrdersResponse, type IApiCancelOrderRequest, type IApiCancelOrderResponse, type IApiCreateBulkOrdersRequest, type IApiCreateBulkOrdersResponse, type IApiCreateOrderRequest, type IApiCreateOrderResponse, type IApiDedustPositionRequest, type IApiDedustPositionResponse, type IApiDepositHistoryRequest, type IApiDepositHistoryResponse, type IApiFillHistoryRequest, type IApiFillHistoryResponse, type IApiFundingAccountSummaryResponse, type IApiFundingPaymentHistoryRequest, type IApiFundingPaymentHistoryResponse, type IApiGetAllInitialLeverageRequest, type IApiGetAllInitialLeverageResponse, type IApiGetMarginTiersResponse, type IApiGetOrderGroupRequest, type IApiGetOrderGroupResponse, type IApiGetOrderRequest, type IApiGetOrderResponse, type IApiOpenOrdersRequest, type IApiOpenOrdersResponse, type IApiOrderHistoryRequest, type IApiOrderHistoryResponse, type IApiPositionsRequest, type IApiPositionsResponse, type IApiPreDepositCheckRequest, type IApiPreDepositCheckResponse, type IApiPreOrderCheckRequest, type IApiPreOrderCheckResponse, type IApiQueryListFundingAccountSummaryRequest, type IApiQueryListFundingAccountSummaryResponse, type IApiQueryListSubAccountSummaryRequest, type IApiQueryListSubAccountSummaryResponse, type IApiQueryTradingPerformanceRequest, type IApiQueryTradingPerformanceResponse, type IApiQueryTradingPerformanceTrendRequest, type IApiQueryTradingPerformanceTrendResponse, type IApiSetInitialLeverageRequest, type IApiSetInitialLeverageResponse, type IApiSocializedLossStatusResponse, type IApiSubAccountHistoryRequest, type IApiSubAccountHistoryResponse, type IApiSubAccountSummaryRequest, type IApiSubAccountSummaryResponse, type IApiTimedAssetExposureRequest, type IApiTimedAssetExposureResponse, type IApiTransferHistoryRequest, type IApiTransferHistoryResponse, type IApiTransferRequest, type IApiWithdrawalHistoryRequest, type IApiWithdrawalHistoryResponse, type IApiWithdrawalRequest, type IConfig } from '../interfaces';
2
+ import { type IApiAggregatedAccountSummaryResponse, type IApiCancelAllOrdersRequest, type IApiCancelAllOrdersResponse, type IApiCancelOrderRequest, type IApiCancelOrderResponse, type IApiCreateBulkOrdersRequest, type IApiCreateBulkOrdersResponse, type IApiCreateOrderRequest, type IApiCreateOrderResponse, type IApiDedustPositionRequest, type IApiDedustPositionResponse, type IApiDepositHistoryRequest, type IApiDepositHistoryResponse, type IApiFillHistoryRequest, type IApiFillHistoryResponse, type IApiFundingAccountSummaryResponse, type IApiFundingPaymentHistoryRequest, type IApiFundingPaymentHistoryResponse, type IApiGetAllInitialLeverageRequest, type IApiGetAllInitialLeverageResponse, type IApiGetMarginTiersResponse, type IApiGetOrderGroupRequest, type IApiGetOrderGroupResponse, type IApiGetOrderRequest, type IApiGetOrderResponse, type IApiOpenOrdersRequest, type IApiOpenOrdersResponse, type IApiOrderHistoryRequest, type IApiOrderHistoryResponse, type IApiPositionsRequest, type IApiPositionsResponse, type IApiPreDepositCheckRequest, type IApiPreDepositCheckResponse, type IApiPreOrderCheckRequest, type IApiPreOrderCheckResponse, type IApiQueryListFundingAccountSummaryRequest, type IApiQueryListFundingAccountSummaryResponse, type IApiQueryListSubAccountSummaryRequest, type IApiQueryListSubAccountSummaryResponse, type IApiQueryTradingPerformanceRequest, type IApiQueryTradingPerformanceResponse, type IApiQueryTradingPerformanceTrendRequest, type IApiQueryTradingPerformanceTrendResponse, type IApiSetInitialLeverageRequest, type IApiSetInitialLeverageResponse, type IApiSocializedLossStatusResponse, type IApiSubAccountHistoryRequest, type IApiSubAccountHistoryResponse, type IApiSubAccountSummaryRequest, type IApiSubAccountSummaryResponse, type IApiTimedAssetExposureRequest, type IApiTimedAssetExposureResponse, type IApiTransferHistoryRequest, type IApiTransferHistoryResponse, type IApiTransferRequest, type IApiTransferResponse, type IApiWithdrawalHistoryRequest, type IApiWithdrawalHistoryResponse, type IApiWithdrawalRequest, type IConfig } from '../interfaces';
3
3
  export declare class TDG {
4
4
  private readonly _axios;
5
5
  private readonly _fullUrl;
@@ -19,9 +19,7 @@ export declare class TDG {
19
19
  * TODO: missing response interface
20
20
  * @see https://api-docs.grvt.io/trading_api/#transfer
21
21
  */
22
- transfer(payload: IApiTransferRequest, config?: AxiosRequestConfig): Promise<{
23
- acknowledgement: boolean;
24
- }>;
22
+ transfer(payload: IApiTransferRequest, config?: AxiosRequestConfig): Promise<IApiTransferResponse>;
25
23
  /**
26
24
  * @see https://api-docs.grvt.io/trading_api/#transfer-history
27
25
  */
package/TDG/index.js CHANGED
@@ -37,7 +37,7 @@ class TDG {
37
37
  */
38
38
  transfer(payload, config) {
39
39
  return this._axios.post(this._liteUrl + '/transfer', utils_1.Utils.schemaMap(payload, interfaces_1.API_TRANSFER_REQUEST_MAP.FULL_TO_LITE, true), config).then((response) => {
40
- return utils_1.Utils.schemaMap(response.data, interfaces_1.ACK_RESPONSE_MAP.LITE_TO_FULL);
40
+ return utils_1.Utils.schemaMap(response.data, interfaces_1.API_TRANSFER_RESPONSE_MAP.LITE_TO_FULL);
41
41
  }).catch(utils_1.Utils.coverApiError);
42
42
  }
43
43
  /**
@@ -1,5 +1,6 @@
1
1
  export declare enum EBridgeType {
2
- XY = "XY"
2
+ XY = "XY",
3
+ RHINO = "RHINO"
3
4
  }
4
5
  export declare enum EBrokerTag {
5
6
  UNSPECIFIED = "UNSPECIFIED",
@@ -722,9 +723,14 @@ export interface IApiTradeResponse {
722
723
  }
723
724
  export interface IApiTradingPerformanceTrend {
724
725
  start_interval?: string;
726
+ end_interval?: string;
725
727
  trading_volume?: string;
726
728
  realized_pnl?: string;
727
729
  }
730
+ export interface IApiTransferAck {
731
+ ack?: boolean;
732
+ tx_id?: string;
733
+ }
728
734
  export interface IApiTransferHistoryRequest {
729
735
  currency?: ECurrency[];
730
736
  start_time?: string;
@@ -749,6 +755,9 @@ export interface IApiTransferRequest {
749
755
  transfer_type?: ETransferType;
750
756
  transfer_metadata?: string;
751
757
  }
758
+ export interface IApiTransferResponse {
759
+ result?: IApiTransferAck;
760
+ }
752
761
  export interface IApiUserCategoryAffinityScoreRequest {
753
762
  account_id?: string;
754
763
  start_time?: string;
@@ -5,6 +5,8 @@ var EBridgeType;
5
5
  (function (EBridgeType) {
6
6
  // XY Bridge type
7
7
  EBridgeType["XY"] = "XY";
8
+ // Rhino Bridge type
9
+ EBridgeType["RHINO"] = "RHINO";
8
10
  })(EBridgeType || (exports.EBridgeType = EBridgeType = {}));
9
11
  // BrokerTag is a tag for the broker that the order is sent from.
10
12
  var EBrokerTag;
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EVenueInt = exports.EVaultTypeInt = exports.ETriggerTypeInt = exports.ETriggerByInt = exports.ETransferTypeInt = exports.ETimeIntervalInt = exports.ETimeInForceInt = exports.ESubAccountTradeIntervalInt = exports.ERewardProgramTypeInt = exports.ERewardEpochStatusInt = exports.EOrderStatusInt = exports.EOrderRejectReasonInt = exports.EMarginTypeInt = exports.EKindInt = exports.EInstrumentSettlementPeriodInt = exports.EEpochBadgeTypeInt = exports.ECurrencyInt = exports.ECandlestickTypeInt = exports.ECandlestickIntervalInt = exports.ECancelStatusInt = exports.EBrokerTagInt = exports.EBridgeTypeInt = void 0;
4
4
  const data_interface_1 = require("./data.interface");
5
5
  exports.EBridgeTypeInt = Object.freeze({
6
- [data_interface_1.EBridgeType.XY]: 1
6
+ [data_interface_1.EBridgeType.XY]: 1,
7
+ [data_interface_1.EBridgeType.RHINO]: 2
7
8
  });
8
9
  exports.EBrokerTagInt = Object.freeze({
9
10
  [data_interface_1.EBrokerTag.UNSPECIFIED]: 0,
@@ -5,11 +5,13 @@ exports.API_TRADING_PERFORMANCE_TREND_MAP = void 0;
5
5
  exports.API_TRADING_PERFORMANCE_TREND_MAP = Object.freeze({
6
6
  FULL_TO_LITE: {
7
7
  start_interval: 'si',
8
+ end_interval: 'ei',
8
9
  trading_volume: 'tv',
9
10
  realized_pnl: 'rp'
10
11
  },
11
12
  LITE_TO_FULL: {
12
13
  si: 'start_interval',
14
+ ei: 'end_interval',
13
15
  tv: 'trading_volume',
14
16
  rp: 'realized_pnl'
15
17
  }
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const API_TRANSFER_ACK_MAP: SchemaPairMap;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.API_TRANSFER_ACK_MAP = void 0;
4
+ // Schema map for the 'API_TRANSFER_ACK' struct.
5
+ exports.API_TRANSFER_ACK_MAP = Object.freeze({
6
+ FULL_TO_LITE: {
7
+ ack: 'a',
8
+ tx_id: 'ti'
9
+ },
10
+ LITE_TO_FULL: {
11
+ a: 'ack',
12
+ ti: 'tx_id'
13
+ }
14
+ });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const API_TRANSFER_RESPONSE_MAP: SchemaPairMap;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.API_TRANSFER_RESPONSE_MAP = void 0;
4
+ const api_transfer_ack_1 = require("./api_transfer_ack");
5
+ // Schema map for the 'API_TRANSFER_RESPONSE' struct.
6
+ exports.API_TRANSFER_RESPONSE_MAP = Object.freeze({
7
+ FULL_TO_LITE: {
8
+ result: ['r', api_transfer_ack_1.API_TRANSFER_ACK_MAP.FULL_TO_LITE]
9
+ },
10
+ LITE_TO_FULL: {
11
+ r: ['result', api_transfer_ack_1.API_TRANSFER_ACK_MAP.LITE_TO_FULL]
12
+ }
13
+ });
@@ -120,9 +120,11 @@ export * from './api_trade_history_response';
120
120
  export * from './api_trade_request';
121
121
  export * from './api_trade_response';
122
122
  export * from './api_trading_performance_trend';
123
+ export * from './api_transfer_ack';
123
124
  export * from './api_transfer_history_request';
124
125
  export * from './api_transfer_history_response';
125
126
  export * from './api_transfer_request';
127
+ export * from './api_transfer_response';
126
128
  export * from './api_user_category_affinity_score_request';
127
129
  export * from './api_user_category_affinity_score_response';
128
130
  export * from './api_withdrawal_history_request';
@@ -136,9 +136,11 @@ __exportStar(require("./api_trade_history_response"), exports);
136
136
  __exportStar(require("./api_trade_request"), exports);
137
137
  __exportStar(require("./api_trade_response"), exports);
138
138
  __exportStar(require("./api_trading_performance_trend"), exports);
139
+ __exportStar(require("./api_transfer_ack"), exports);
139
140
  __exportStar(require("./api_transfer_history_request"), exports);
140
141
  __exportStar(require("./api_transfer_history_response"), exports);
141
142
  __exportStar(require("./api_transfer_request"), exports);
143
+ __exportStar(require("./api_transfer_response"), exports);
142
144
  __exportStar(require("./api_user_category_affinity_score_request"), exports);
143
145
  __exportStar(require("./api_user_category_affinity_score_response"), exports);
144
146
  __exportStar(require("./api_withdrawal_history_request"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grvt/client",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "description": "Node.js & JavaScript client for GRVT REST APIs & WebSockets",
5
5
  "repository": {
6
6
  "type": "git",