@grvt/client 1.6.27 → 1.6.28

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.
Files changed (23) hide show
  1. package/interfaces/codegen/data.interface.d.ts +37 -0
  2. package/interfaces/codegen/enums/cluster-config-type.d.ts +3 -1
  3. package/interfaces/codegen/enums/cluster-config-type.js +7 -1
  4. package/interfaces/codegen/enums/sub-account-mode.d.ts +4 -0
  5. package/interfaces/codegen/enums/sub-account-mode.js +11 -0
  6. package/interfaces/codegen/enums/wallet-type.d.ts +6 -0
  7. package/interfaces/codegen/enums/wallet-type.js +17 -0
  8. package/interfaces/codegen/schema-maps/api_get_all_positions_by_asset_request.d.ts +2 -0
  9. package/interfaces/codegen/schema-maps/api_get_all_positions_by_asset_request.js +12 -0
  10. package/interfaces/codegen/schema-maps/api_get_all_positions_by_asset_response.d.ts +2 -0
  11. package/interfaces/codegen/schema-maps/api_get_all_positions_by_asset_response.js +13 -0
  12. package/interfaces/codegen/schema-maps/api_spot_balance.js +10 -2
  13. package/interfaces/codegen/schema-maps/api_spot_sub_account_summary_request.d.ts +2 -0
  14. package/interfaces/codegen/schema-maps/api_spot_sub_account_summary_request.js +12 -0
  15. package/interfaces/codegen/schema-maps/api_spot_sub_account_summary_response.d.ts +2 -0
  16. package/interfaces/codegen/schema-maps/api_spot_sub_account_summary_response.js +13 -0
  17. package/interfaces/codegen/schema-maps/api_transfer_request.js +6 -2
  18. package/interfaces/codegen/schema-maps/mini_position.d.ts +2 -0
  19. package/interfaces/codegen/schema-maps/mini_position.js +26 -0
  20. package/interfaces/codegen/schema-maps/snap_spot_sub_account.d.ts +2 -0
  21. package/interfaces/codegen/schema-maps/snap_spot_sub_account.js +19 -0
  22. package/interfaces/codegen/schema-maps/snap_sub_account.js +4 -2
  23. package/package.json +1 -1
@@ -27,6 +27,7 @@ import type { ERewardEpochStatus } from './enums/reward-epoch-status.ts';
27
27
  import type { ERewardProgramType } from './enums/reward-program-type.ts';
28
28
  import type { ERewardSession } from './enums/reward-session.ts';
29
29
  import type { ESource } from './enums/source.ts';
30
+ import type { ESubAccountMode } from './enums/sub-account-mode.ts';
30
31
  import type { ESubAccountTradeInterval } from './enums/sub-account-trade-interval.ts';
31
32
  import type { ETimeInForce } from './enums/time-in-force.ts';
32
33
  import type { ETimeInterval } from './enums/time-interval.ts';
@@ -38,6 +39,7 @@ import type { EVaultInvestorAction } from './enums/vault-investor-action.ts';
38
39
  import type { EVaultRedemptionReqAgeCategory } from './enums/vault-redemption-req-age-category.ts';
39
40
  import type { EVaultType } from './enums/vault-type.ts';
40
41
  import type { EVenue } from './enums/venue.ts';
42
+ import type { EWalletType } from './enums/wallet-type.ts';
41
43
  export interface IAPISettlementPrice {
42
44
  base?: string;
43
45
  quote?: string;
@@ -543,6 +545,12 @@ export interface IApiGetAllInstrumentsRequest {
543
545
  export interface IApiGetAllInstrumentsResponse {
544
546
  result?: IInstrumentDisplay[];
545
547
  }
548
+ export interface IApiGetAllPositionsByAssetRequest {
549
+ instrument?: string;
550
+ }
551
+ export interface IApiGetAllPositionsByAssetResponse {
552
+ result?: IMiniPosition[];
553
+ }
546
554
  export interface IApiGetAuthorizedBuildersResponse {
547
555
  results?: IApiAuthorizedBuilder[];
548
556
  }
@@ -1158,6 +1166,12 @@ export interface IApiSocializedLossStatusResponse {
1158
1166
  is_active?: boolean;
1159
1167
  haircut_ratio?: string;
1160
1168
  }
1169
+ export interface IApiSpotSubAccountSummaryRequest {
1170
+ sub_account_id?: string;
1171
+ }
1172
+ export interface IApiSpotSubAccountSummaryResponse {
1173
+ result?: ISpotSubAccount;
1174
+ }
1161
1175
  export interface IApiSubAccountDailyPerformance {
1162
1176
  start_interval?: string;
1163
1177
  pnl?: string;
@@ -1260,6 +1274,8 @@ export interface IApiTransferRequest {
1260
1274
  signature?: ISignature;
1261
1275
  transfer_type?: ETransferType;
1262
1276
  transfer_metadata?: string;
1277
+ from_wallet_type?: EWalletType;
1278
+ to_wallet_type?: EWalletType;
1263
1279
  }
1264
1280
  export interface IApiTransferResponse {
1265
1281
  result?: IApiTransferAck;
@@ -1896,6 +1912,16 @@ export interface IMarginTierResponse {
1896
1912
  lower_bound?: string;
1897
1913
  rate?: string;
1898
1914
  }
1915
+ export interface IMiniPosition {
1916
+ sub_account_id?: string;
1917
+ balance?: string;
1918
+ entry_price?: string;
1919
+ cumulative_realized_pnl?: string;
1920
+ cumulative_realized_funding_payment?: string;
1921
+ margin_type?: EPositionMarginType;
1922
+ leverage?: string;
1923
+ position_balance?: string;
1924
+ }
1899
1925
  export interface IMiniTicker {
1900
1926
  event_time?: string;
1901
1927
  instrument?: string;
@@ -2276,6 +2302,16 @@ export interface ISpotBalance {
2276
2302
  currency?: string;
2277
2303
  balance?: string;
2278
2304
  index_price?: string;
2305
+ entry_price?: string;
2306
+ realized_pnl?: string;
2307
+ unrealized_pnl?: string;
2308
+ available_to_transfer?: string;
2309
+ }
2310
+ export interface ISpotSubAccount {
2311
+ event_time?: string;
2312
+ sub_account_id?: string;
2313
+ total_equity?: string;
2314
+ spot_balances?: ISpotBalance[];
2279
2315
  }
2280
2316
  export interface IStreamReference {
2281
2317
  stream?: string;
@@ -2300,6 +2336,7 @@ export interface ISubAccount {
2300
2336
  derisk_to_maintenance_margin_ratio?: string;
2301
2337
  total_cross_equity?: string;
2302
2338
  cross_unrealized_pnl?: string;
2339
+ sub_account_mode?: ESubAccountMode;
2303
2340
  }
2304
2341
  export interface ISubAccountPerformance {
2305
2342
  start_interval?: string;
@@ -76,6 +76,8 @@ export declare enum EClusterConfigType {
76
76
  FLAG_FIX_NLSA_TRANSFER_AVAIL_BAL_CHECK = "FLAG_FIX_NLSA_TRANSFER_AVAIL_BAL_CHECK",
77
77
  FLAG_ENABLE_ISOLATED_INCREASE_MAX_ADDABLE = "FLAG_ENABLE_ISOLATED_INCREASE_MAX_ADDABLE",
78
78
  FLAG_CANCEL_ON_DISCONNECT = "FLAG_CANCEL_ON_DISCONNECT",
79
- FLAG_SPLIT_TPSL = "FLAG_SPLIT_TPSL"
79
+ FLAG_SPLIT_TPSL = "FLAG_SPLIT_TPSL",
80
+ FLAG_SPOT_TRADING = "FLAG_SPOT_TRADING",
81
+ FLAG_SNAPSHOT_CURRENCY_STORE_FIRST = "FLAG_SNAPSHOT_CURRENCY_STORE_FIRST"
80
82
  }
81
83
  export declare const EClusterConfigTypeInt: Record<EClusterConfigType, number>;
@@ -159,6 +159,10 @@ var EClusterConfigType;
159
159
  EClusterConfigType["FLAG_CANCEL_ON_DISCONNECT"] = "FLAG_CANCEL_ON_DISCONNECT";
160
160
  // Flag to control split TPSL support
161
161
  EClusterConfigType["FLAG_SPLIT_TPSL"] = "FLAG_SPLIT_TPSL";
162
+ // Flag to enable spot trading
163
+ EClusterConfigType["FLAG_SPOT_TRADING"] = "FLAG_SPOT_TRADING";
164
+ // Flag to dump currency store first in snapshot, ensuring gateway rehydrates currency store before other state
165
+ EClusterConfigType["FLAG_SNAPSHOT_CURRENCY_STORE_FIRST"] = "FLAG_SNAPSHOT_CURRENCY_STORE_FIRST";
162
166
  })(EClusterConfigType || (exports.EClusterConfigType = EClusterConfigType = {}));
163
167
  exports.EClusterConfigTypeInt = Object.freeze({
164
168
  [EClusterConfigType.CLIENT_TIER]: 1,
@@ -238,5 +242,7 @@ exports.EClusterConfigTypeInt = Object.freeze({
238
242
  [EClusterConfigType.FLAG_FIX_NLSA_TRANSFER_AVAIL_BAL_CHECK]: 75,
239
243
  [EClusterConfigType.FLAG_ENABLE_ISOLATED_INCREASE_MAX_ADDABLE]: 76,
240
244
  [EClusterConfigType.FLAG_CANCEL_ON_DISCONNECT]: 77,
241
- [EClusterConfigType.FLAG_SPLIT_TPSL]: 78
245
+ [EClusterConfigType.FLAG_SPLIT_TPSL]: 78,
246
+ [EClusterConfigType.FLAG_SPOT_TRADING]: 79,
247
+ [EClusterConfigType.FLAG_SNAPSHOT_CURRENCY_STORE_FIRST]: 80
242
248
  });
@@ -0,0 +1,4 @@
1
+ export declare enum ESubAccountMode {
2
+ SINGLE_ASSET_MODE = "SINGLE_ASSET_MODE"
3
+ }
4
+ export declare const ESubAccountModeInt: Record<ESubAccountMode, number>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ESubAccountModeInt = exports.ESubAccountMode = void 0;
4
+ var ESubAccountMode;
5
+ (function (ESubAccountMode) {
6
+ // Single asset mode: the subaccount is only allowed to hold one asset as collateral
7
+ ESubAccountMode["SINGLE_ASSET_MODE"] = "SINGLE_ASSET_MODE";
8
+ })(ESubAccountMode || (exports.ESubAccountMode = ESubAccountMode = {}));
9
+ exports.ESubAccountModeInt = Object.freeze({
10
+ [ESubAccountMode.SINGLE_ASSET_MODE]: 1
11
+ });
@@ -0,0 +1,6 @@
1
+ export declare enum EWalletType {
2
+ FUNDING = "FUNDING",
3
+ SPOT = "SPOT",
4
+ FUTURES = "FUTURES"
5
+ }
6
+ export declare const EWalletTypeInt: Record<EWalletType, number>;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EWalletTypeInt = exports.EWalletType = void 0;
4
+ var EWalletType;
5
+ (function (EWalletType) {
6
+ // Funding wallet
7
+ EWalletType["FUNDING"] = "FUNDING";
8
+ // Spot wallet
9
+ EWalletType["SPOT"] = "SPOT";
10
+ // Futures wallet
11
+ EWalletType["FUTURES"] = "FUTURES";
12
+ })(EWalletType || (exports.EWalletType = EWalletType = {}));
13
+ exports.EWalletTypeInt = Object.freeze({
14
+ [EWalletType.FUNDING]: 1,
15
+ [EWalletType.SPOT]: 2,
16
+ [EWalletType.FUTURES]: 3
17
+ });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const API_GET_ALL_POSITIONS_BY_ASSET_REQUEST_MAP: SchemaPairMap;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.API_GET_ALL_POSITIONS_BY_ASSET_REQUEST_MAP = void 0;
4
+ // Schema map for the 'API_GET_ALL_POSITIONS_BY_ASSET_REQUEST' struct.
5
+ exports.API_GET_ALL_POSITIONS_BY_ASSET_REQUEST_MAP = Object.freeze({
6
+ FULL_TO_LITE: {
7
+ instrument: 'i'
8
+ },
9
+ LITE_TO_FULL: {
10
+ i: 'instrument'
11
+ }
12
+ });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const API_GET_ALL_POSITIONS_BY_ASSET_RESPONSE_MAP: SchemaPairMap;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.API_GET_ALL_POSITIONS_BY_ASSET_RESPONSE_MAP = void 0;
4
+ const mini_position_1 = require("./mini_position");
5
+ // Schema map for the 'API_GET_ALL_POSITIONS_BY_ASSET_RESPONSE' struct.
6
+ exports.API_GET_ALL_POSITIONS_BY_ASSET_RESPONSE_MAP = Object.freeze({
7
+ FULL_TO_LITE: {
8
+ result: ['r', [mini_position_1.MINI_POSITION_MAP.FULL_TO_LITE]]
9
+ },
10
+ LITE_TO_FULL: {
11
+ r: ['result', [mini_position_1.MINI_POSITION_MAP.LITE_TO_FULL]]
12
+ }
13
+ });
@@ -6,11 +6,19 @@ exports.SPOT_BALANCE_MAP = Object.freeze({
6
6
  FULL_TO_LITE: {
7
7
  currency: 'c',
8
8
  balance: 'b',
9
- index_price: 'ip'
9
+ index_price: 'ip',
10
+ entry_price: 'ep',
11
+ realized_pnl: 'rp',
12
+ unrealized_pnl: 'up',
13
+ available_to_transfer: 'at'
10
14
  },
11
15
  LITE_TO_FULL: {
12
16
  c: 'currency',
13
17
  b: 'balance',
14
- ip: 'index_price'
18
+ ip: 'index_price',
19
+ ep: 'entry_price',
20
+ rp: 'realized_pnl',
21
+ up: 'unrealized_pnl',
22
+ at: 'available_to_transfer'
15
23
  }
16
24
  });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const API_SPOT_SUB_ACCOUNT_SUMMARY_REQUEST_MAP: SchemaPairMap;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.API_SPOT_SUB_ACCOUNT_SUMMARY_REQUEST_MAP = void 0;
4
+ // Schema map for the 'API_SPOT_SUB_ACCOUNT_SUMMARY_REQUEST' struct.
5
+ exports.API_SPOT_SUB_ACCOUNT_SUMMARY_REQUEST_MAP = Object.freeze({
6
+ FULL_TO_LITE: {
7
+ sub_account_id: 'sa'
8
+ },
9
+ LITE_TO_FULL: {
10
+ sa: 'sub_account_id'
11
+ }
12
+ });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const API_SPOT_SUB_ACCOUNT_SUMMARY_RESPONSE_MAP: SchemaPairMap;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.API_SPOT_SUB_ACCOUNT_SUMMARY_RESPONSE_MAP = void 0;
4
+ const snap_spot_sub_account_1 = require("./snap_spot_sub_account");
5
+ // Schema map for the 'API_SPOT_SUB_ACCOUNT_SUMMARY_RESPONSE' struct.
6
+ exports.API_SPOT_SUB_ACCOUNT_SUMMARY_RESPONSE_MAP = Object.freeze({
7
+ FULL_TO_LITE: {
8
+ result: ['r', snap_spot_sub_account_1.SPOT_SUB_ACCOUNT_MAP.FULL_TO_LITE]
9
+ },
10
+ LITE_TO_FULL: {
11
+ r: ['result', snap_spot_sub_account_1.SPOT_SUB_ACCOUNT_MAP.LITE_TO_FULL]
12
+ }
13
+ });
@@ -13,7 +13,9 @@ exports.API_TRANSFER_REQUEST_MAP = Object.freeze({
13
13
  num_tokens: 'nt',
14
14
  signature: ['s', signature_1.SIGNATURE_MAP.FULL_TO_LITE],
15
15
  transfer_type: 'tt',
16
- transfer_metadata: 'tm'
16
+ transfer_metadata: 'tm',
17
+ from_wallet_type: 'fw',
18
+ to_wallet_type: 'tw'
17
19
  },
18
20
  LITE_TO_FULL: {
19
21
  fa: 'from_account_id',
@@ -24,6 +26,8 @@ exports.API_TRANSFER_REQUEST_MAP = Object.freeze({
24
26
  nt: 'num_tokens',
25
27
  s: ['signature', signature_1.SIGNATURE_MAP.LITE_TO_FULL],
26
28
  tt: 'transfer_type',
27
- tm: 'transfer_metadata'
29
+ tm: 'transfer_metadata',
30
+ fw: 'from_wallet_type',
31
+ tw: 'to_wallet_type'
28
32
  }
29
33
  });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const MINI_POSITION_MAP: SchemaPairMap;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MINI_POSITION_MAP = void 0;
4
+ // Schema map for the 'MINI_POSITION' struct.
5
+ exports.MINI_POSITION_MAP = Object.freeze({
6
+ FULL_TO_LITE: {
7
+ sub_account_id: 'sa',
8
+ balance: 'b',
9
+ entry_price: 'ep',
10
+ cumulative_realized_pnl: 'cr',
11
+ cumulative_realized_funding_payment: 'cr1',
12
+ margin_type: 'mt',
13
+ leverage: 'l',
14
+ position_balance: 'pb'
15
+ },
16
+ LITE_TO_FULL: {
17
+ sa: 'sub_account_id',
18
+ b: 'balance',
19
+ ep: 'entry_price',
20
+ cr: 'cumulative_realized_pnl',
21
+ cr1: 'cumulative_realized_funding_payment',
22
+ mt: 'margin_type',
23
+ l: 'leverage',
24
+ pb: 'position_balance'
25
+ }
26
+ });
@@ -0,0 +1,2 @@
1
+ import { type SchemaPairMap } from './types';
2
+ export declare const SPOT_SUB_ACCOUNT_MAP: SchemaPairMap;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SPOT_SUB_ACCOUNT_MAP = void 0;
4
+ const api_spot_balance_1 = require("./api_spot_balance");
5
+ // Schema map for the 'SPOT_SUB_ACCOUNT' struct.
6
+ exports.SPOT_SUB_ACCOUNT_MAP = Object.freeze({
7
+ FULL_TO_LITE: {
8
+ event_time: 'et',
9
+ sub_account_id: 'sa',
10
+ total_equity: 'te',
11
+ spot_balances: ['sb', [api_spot_balance_1.SPOT_BALANCE_MAP.FULL_TO_LITE]]
12
+ },
13
+ LITE_TO_FULL: {
14
+ et: 'event_time',
15
+ sa: 'sub_account_id',
16
+ te: 'total_equity',
17
+ sb: ['spot_balances', [api_spot_balance_1.SPOT_BALANCE_MAP.LITE_TO_FULL]]
18
+ }
19
+ });
@@ -23,7 +23,8 @@ exports.SUB_ACCOUNT_MAP = Object.freeze({
23
23
  derisk_margin: 'dm',
24
24
  derisk_to_maintenance_margin_ratio: 'dt',
25
25
  total_cross_equity: 'tc',
26
- cross_unrealized_pnl: 'cu'
26
+ cross_unrealized_pnl: 'cu',
27
+ sub_account_mode: 'sa1'
27
28
  },
28
29
  LITE_TO_FULL: {
29
30
  et: 'event_time',
@@ -43,6 +44,7 @@ exports.SUB_ACCOUNT_MAP = Object.freeze({
43
44
  dm: 'derisk_margin',
44
45
  dt: 'derisk_to_maintenance_margin_ratio',
45
46
  tc: 'total_cross_equity',
46
- cu: 'cross_unrealized_pnl'
47
+ cu: 'cross_unrealized_pnl',
48
+ sa1: 'sub_account_mode'
47
49
  }
48
50
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grvt/client",
3
- "version": "1.6.27",
3
+ "version": "1.6.28",
4
4
  "description": "Node.js & JavaScript client for GRVT REST APIs & WebSockets",
5
5
  "repository": {
6
6
  "type": "git",