bybit-api 4.6.0 → 4.6.2

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 (77) hide show
  1. package/README.md +3 -2
  2. package/lib/constants/enum.d.ts +1 -0
  3. package/lib/constants/enum.js +1 -0
  4. package/lib/constants/enum.js.map +1 -1
  5. package/lib/rest-client-v5.d.ts +419 -14
  6. package/lib/rest-client-v5.js +492 -4
  7. package/lib/rest-client-v5.js.map +1 -1
  8. package/lib/types/request/index.d.ts +6 -0
  9. package/lib/types/request/index.js +6 -0
  10. package/lib/types/request/index.js.map +1 -1
  11. package/lib/types/request/v5-account.d.ts +26 -0
  12. package/lib/types/request/v5-alpha-trade.d.ts +52 -0
  13. package/lib/types/request/v5-alpha-trade.js +6 -0
  14. package/lib/types/request/v5-alpha-trade.js.map +1 -0
  15. package/lib/types/request/v5-asset.d.ts +37 -2
  16. package/lib/types/request/v5-broker.d.ts +14 -0
  17. package/lib/types/request/v5-card.d.ts +51 -0
  18. package/lib/types/request/v5-card.js +7 -0
  19. package/lib/types/request/v5-card.js.map +1 -0
  20. package/lib/types/request/v5-earn-advance-discount.d.ts +75 -0
  21. package/lib/types/request/v5-earn-advance-discount.js +3 -0
  22. package/lib/types/request/v5-earn-advance-discount.js.map +1 -0
  23. package/lib/types/request/v5-earn-fixed-term.d.ts +42 -0
  24. package/lib/types/request/v5-earn-fixed-term.js +3 -0
  25. package/lib/types/request/v5-earn-fixed-term.js.map +1 -0
  26. package/lib/types/request/v5-earn-liquidity-mining.d.ts +7 -0
  27. package/lib/types/request/v5-earn-liquidity-mining.js +3 -0
  28. package/lib/types/request/v5-earn-liquidity-mining.js.map +1 -0
  29. package/lib/types/request/v5-earn-token.d.ts +49 -0
  30. package/lib/types/request/v5-earn-token.js +6 -0
  31. package/lib/types/request/v5-earn-token.js.map +1 -0
  32. package/lib/types/request/v5-earn.d.ts +24 -0
  33. package/lib/types/request/v5-market.d.ts +10 -1
  34. package/lib/types/request/v5-spot-leverage-token.d.ts +46 -0
  35. package/lib/types/request/v5-spreadtrading.d.ts +7 -0
  36. package/lib/types/request/v5-user.d.ts +15 -1
  37. package/lib/types/response/index.d.ts +6 -0
  38. package/lib/types/response/index.js +6 -0
  39. package/lib/types/response/index.js.map +1 -1
  40. package/lib/types/response/v5-account.d.ts +76 -0
  41. package/lib/types/response/v5-alpha-trade.d.ts +170 -0
  42. package/lib/types/response/v5-alpha-trade.js +6 -0
  43. package/lib/types/response/v5-alpha-trade.js.map +1 -0
  44. package/lib/types/response/v5-asset.d.ts +158 -10
  45. package/lib/types/response/v5-broker.d.ts +18 -0
  46. package/lib/types/response/v5-card.d.ts +118 -0
  47. package/lib/types/response/v5-card.js +3 -0
  48. package/lib/types/response/v5-card.js.map +1 -0
  49. package/lib/types/response/v5-earn-advance-discount.d.ts +143 -0
  50. package/lib/types/response/v5-earn-advance-discount.js +3 -0
  51. package/lib/types/response/v5-earn-advance-discount.js.map +1 -0
  52. package/lib/types/response/v5-earn-fixed-term.d.ts +102 -0
  53. package/lib/types/response/v5-earn-fixed-term.js +3 -0
  54. package/lib/types/response/v5-earn-fixed-term.js.map +1 -0
  55. package/lib/types/response/v5-earn-liquidity-mining.d.ts +31 -0
  56. package/lib/types/response/v5-earn-liquidity-mining.js +3 -0
  57. package/lib/types/response/v5-earn-liquidity-mining.js.map +1 -0
  58. package/lib/types/response/v5-earn-token.d.ts +62 -0
  59. package/lib/types/response/v5-earn-token.js +6 -0
  60. package/lib/types/response/v5-earn-token.js.map +1 -0
  61. package/lib/types/response/v5-earn.d.ts +103 -0
  62. package/lib/types/response/v5-market.d.ts +14 -0
  63. package/lib/types/response/v5-position.d.ts +4 -0
  64. package/lib/types/response/v5-spot-leverage-token.d.ts +56 -0
  65. package/lib/types/response/v5-spreadtrading.d.ts +5 -0
  66. package/lib/types/response/v5-user.d.ts +43 -0
  67. package/lib/types/shared-v5.d.ts +11 -1
  68. package/lib/types/websockets/ws-events.d.ts +4 -0
  69. package/lib/util/BaseWSClient.js +1 -0
  70. package/lib/util/BaseWSClient.js.map +1 -1
  71. package/lib/util/webCryptoAPI.d.ts +1 -1
  72. package/lib/util/webCryptoAPI.js +1 -1
  73. package/lib/util/webCryptoAPI.js.map +1 -1
  74. package/lib/util/websockets/websocket-util.js +1 -0
  75. package/lib/util/websockets/websocket-util.js.map +1 -1
  76. package/llms.txt +8037 -5345
  77. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v5-earn-token.js","sourceRoot":"","sources":["../../../src/types/request/v5-earn-token.ts"],"names":[],"mappings":";AAAA;;GAEG"}
@@ -39,3 +39,27 @@ export interface GetEarnHourlyYieldHistoryParamsV5 {
39
39
  limit?: number;
40
40
  cursor?: string;
41
41
  }
42
+ export interface ModifyEarnPositionParamsV5 {
43
+ category: 'OnChain';
44
+ productId: number;
45
+ positionId: number;
46
+ autoReinvest: 0 | 1;
47
+ }
48
+ export interface GetEarnAprHistoryParamsV5 {
49
+ category: 'FlexibleSaving' | 'OnChain';
50
+ productId: string;
51
+ startTime?: number;
52
+ endTime?: number;
53
+ }
54
+ /**
55
+ * GET /v5/earn/advance/product — Advanced Earn: Dual Asset, Double Win, Smart Leverage, etc.
56
+ * Public, no auth. Rate limit: 50 req/s per IP.
57
+ */
58
+ export interface GetAdvanceEarnProductParamsV5 {
59
+ category: 'DualAssets' | 'DoubleWin' | 'SmartLeverage' | 'DiscountBuy';
60
+ coin?: string;
61
+ /**
62
+ * Product duration, e.g. 8h, 1d, 2d, 3d, 6d, 7d, 12d (depends on product).
63
+ */
64
+ duration?: string;
65
+ }
@@ -9,11 +9,17 @@ export interface GetKlineParamsV5 {
9
9
  limit?: number;
10
10
  }
11
11
  export interface GetMarkPriceKlineParamsV5 {
12
- category: 'linear' | 'inverse';
12
+ /**
13
+ * linear (default if omitted), inverse, or option.
14
+ */
15
+ category?: 'linear' | 'inverse' | 'option';
13
16
  symbol: string;
14
17
  interval: KlineIntervalV3;
15
18
  start?: number;
16
19
  end?: number;
20
+ /**
21
+ * Futures: [1, 1000], default 200. Options: [1, 500], default 200.
22
+ */
17
23
  limit?: number;
18
24
  }
19
25
  export interface GetIndexPriceKlineParamsV5 {
@@ -35,6 +41,9 @@ export interface GetPremiumIndexPriceKlineParamsV5 {
35
41
  export interface GetInstrumentsInfoParamsV5 {
36
42
  category: CategoryV5;
37
43
  symbol?: string;
44
+ /**
45
+ * Filter by instrument `symbolType` (linear / inverse / spot as applicable), e.g. `commodity`, `stock`, `forex` (linear per Bybit).
46
+ */
38
47
  symbolType?: string;
39
48
  status?: InstrumentStatusV5;
40
49
  baseCoin?: string;
@@ -22,6 +22,9 @@ export interface GetVIPMarginDataParamsV5 {
22
22
  vipLevel?: string;
23
23
  currency?: string;
24
24
  }
25
+ export interface GetSpotMarginCurrencyDataParamsV5 {
26
+ currency?: string;
27
+ }
25
28
  export interface ManualBorrowParamsV5 {
26
29
  coin: string;
27
30
  amount: string;
@@ -45,6 +48,10 @@ export interface SetSpotMarginLeverageParamsV5 {
45
48
  export interface ManualRepayWithoutConversionParamsV5 {
46
49
  coin: string;
47
50
  amount?: string;
51
+ /**
52
+ * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE.
53
+ */
54
+ repaymentType?: 'ALL' | 'FIXED' | 'FLEXIBLE';
48
55
  }
49
56
  export interface GetAutoRepayModeParamsV5 {
50
57
  currency?: string;
@@ -53,3 +60,42 @@ export interface SetAutoRepayModeParamsV5 {
53
60
  currency?: string;
54
61
  autoRepayMode: '0' | '1';
55
62
  }
63
+ export interface GetSpotMarginLiabilityInfoParamsV5 {
64
+ currency: string;
65
+ }
66
+ export interface FixedRateBorrowParamsV5 {
67
+ orderCurrency: string;
68
+ orderAmount: string;
69
+ /** e.g. 0.02 = 2% p.a. */
70
+ annualRate: string;
71
+ /** 7, 14, 30, 90, 180 (days) */
72
+ term: string;
73
+ /** 1: auto repayment; 2: transfer to flexible loan */
74
+ repayType?: '1' | '2';
75
+ }
76
+ export interface GetFixedRateBorrowOrderInfoParamsV5 {
77
+ orderId?: string;
78
+ orderCurrency?: string;
79
+ state?: string;
80
+ term?: string;
81
+ limit?: string;
82
+ cursor?: string;
83
+ }
84
+ export interface GetFixedRateBorrowContractInfoParamsV5 {
85
+ orderId?: string;
86
+ orderCurrency?: string;
87
+ term?: string;
88
+ limit?: string;
89
+ cursor?: string;
90
+ }
91
+ export interface GetFixedRateBorrowOrderQuoteParamsV5 {
92
+ orderCurrency: string;
93
+ term?: string;
94
+ orderBy?: 'apy' | 'term' | 'quantity';
95
+ sort?: 0 | 1;
96
+ limit?: number;
97
+ }
98
+ export interface RenewFixedRateBorrowParamsV5 {
99
+ loanId: string;
100
+ qty?: string;
101
+ }
@@ -4,6 +4,13 @@ export interface GetSpreadInstrumentsInfoParamsV5 {
4
4
  limit?: number;
5
5
  cursor?: string;
6
6
  }
7
+ /** GET /v5/spread/max-qty */
8
+ export interface GetSpreadMaxQtyParamsV5 {
9
+ symbol: string;
10
+ /** 1: Buy, 2: Sell */
11
+ side: '1' | '2';
12
+ orderPrice: string;
13
+ }
7
14
  export interface SubmitSpreadOrderParamsV5 {
8
15
  symbol: string;
9
16
  side: 'Buy' | 'Sell';
@@ -23,7 +23,6 @@ export interface CreateSubApiKeyParamsV5 {
23
23
  export interface UpdateApiKeyParamsV5 {
24
24
  apikey?: string;
25
25
  readOnly?: 0 | 1;
26
- ips?: string[];
27
26
  permissions: PermissionsV5;
28
27
  }
29
28
  export interface UpdateSubApiKeyUpdateParamsV5 {
@@ -48,3 +47,18 @@ export interface GetAffiliateUserListParamsV5 {
48
47
  startDate?: string;
49
48
  endDate?: string;
50
49
  }
50
+ /** Get Friend Referrals - invitation relationship status. 0: alive; 1: invalid */
51
+ export interface GetFriendReferralsParamsV5 {
52
+ status?: string;
53
+ size?: string;
54
+ cursor?: string;
55
+ }
56
+ /** Sign Agreement. Only master account.
57
+ * - `category` (legacy): 2 = metals (XAU/XAG perps; stock perps share this); 3 = crude oil. New enum values are not added here; prefer `categoryV2`.
58
+ * - `categoryV2` (recommended): 1 = metals; 2 = crude oil. Additional values may be added by the API; use a numeric literal or variable.
59
+ * - Either `category` or `categoryV2` must be sent. */
60
+ export interface SignAgreementParamsV5 {
61
+ agree: boolean;
62
+ category?: 2 | 3;
63
+ categoryV2?: number;
64
+ }
@@ -5,10 +5,16 @@ export * from './spot';
5
5
  export * from './unified-margin';
6
6
  export * from './usdt-perp';
7
7
  export * from './v5-account';
8
+ export * from './v5-alpha-trade';
8
9
  export * from './v5-asset';
9
10
  export * from './v5-broker';
11
+ export * from './v5-card';
10
12
  export * from './v5-crypto-loan';
11
13
  export * from './v5-earn';
14
+ export * from './v5-earn-advance-discount';
15
+ export * from './v5-earn-fixed-term';
16
+ export * from './v5-earn-liquidity-mining';
17
+ export * from './v5-earn-token';
12
18
  export * from './v5-market';
13
19
  export * from './v5-p2p-trading';
14
20
  export * from './v5-position';
@@ -21,10 +21,16 @@ __exportStar(require("./spot"), exports);
21
21
  __exportStar(require("./unified-margin"), exports);
22
22
  __exportStar(require("./usdt-perp"), exports);
23
23
  __exportStar(require("./v5-account"), exports);
24
+ __exportStar(require("./v5-alpha-trade"), exports);
24
25
  __exportStar(require("./v5-asset"), exports);
25
26
  __exportStar(require("./v5-broker"), exports);
27
+ __exportStar(require("./v5-card"), exports);
26
28
  __exportStar(require("./v5-crypto-loan"), exports);
27
29
  __exportStar(require("./v5-earn"), exports);
30
+ __exportStar(require("./v5-earn-advance-discount"), exports);
31
+ __exportStar(require("./v5-earn-fixed-term"), exports);
32
+ __exportStar(require("./v5-earn-liquidity-mining"), exports);
33
+ __exportStar(require("./v5-earn-token"), exports);
28
34
  __exportStar(require("./v5-market"), exports);
29
35
  __exportStar(require("./v5-p2p-trading"), exports);
30
36
  __exportStar(require("./v5-position"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/response/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,6CAA2B;AAC3B,2CAAyB;AACzB,yCAAuB;AACvB,mDAAiC;AACjC,8CAA4B;AAC5B,+CAA6B;AAC7B,6CAA2B;AAC3B,8CAA4B;AAC5B,mDAAiC;AACjC,4CAA0B;AAC1B,8CAA4B;AAC5B,mDAAiC;AACjC,gDAA8B;AAC9B,kDAAgC;AAChC,2CAAyB;AACzB,2DAAyC;AACzC,qDAAmC;AACnC,6CAA2B;AAC3B,4CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/response/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,6CAA2B;AAC3B,2CAAyB;AACzB,yCAAuB;AACvB,mDAAiC;AACjC,8CAA4B;AAC5B,+CAA6B;AAC7B,mDAAiC;AACjC,6CAA2B;AAC3B,8CAA4B;AAC5B,4CAA0B;AAC1B,mDAAiC;AACjC,4CAA0B;AAC1B,6DAA2C;AAC3C,uDAAqC;AACrC,6DAA2C;AAC3C,kDAAgC;AAChC,8CAA4B;AAC5B,mDAAiC;AACjC,gDAA8B;AAC9B,kDAAgC;AAChC,2CAAyB;AACzB,2DAAyC;AACzC,qDAAmC;AACnC,6CAA2B;AAC3B,4CAA0B"}
@@ -89,6 +89,19 @@ export interface AccountInfoV5 {
89
89
  spotHedgingStatus: string;
90
90
  updatedTime: string;
91
91
  }
92
+ /**
93
+ * Get Trade Behaviour Config / `getLimitPriceAction()` — `/v5/account/user-setting-config`
94
+ */
95
+ export interface UserSettingConfigV5 {
96
+ lpaSpot: boolean;
97
+ lpaPerp: boolean;
98
+ /** Spot MNT fee deduction enabled. */
99
+ smsef?: boolean;
100
+ /** Futures MNT fee deduction enabled. */
101
+ fmsef?: boolean;
102
+ /** Delta Neutral mode; may be absent on older API responses. */
103
+ deltaEnable?: boolean;
104
+ }
92
105
  export interface TransactionLogV5 {
93
106
  symbol: string;
94
107
  category: CategoryV5;
@@ -134,3 +147,66 @@ export interface DCPInfoV5 {
134
147
  export interface ManualRepayResultV5 {
135
148
  resultStatus: 'P' | 'SU' | 'FA';
136
149
  }
150
+ /** GET /v5/account/option-asset-info — response `result` wraps a nested `result` array. */
151
+ export interface OptionAssetInfoRowV5 {
152
+ coin: string;
153
+ totalDelta: string;
154
+ totalRPL: string;
155
+ totalUPL: string;
156
+ assetIM: string;
157
+ assetMM: string;
158
+ sendTime: number;
159
+ }
160
+ export interface OptionAssetInfoNestedResultV5 {
161
+ result: OptionAssetInfoRowV5[];
162
+ }
163
+ /** GET /v5/account/pay-info */
164
+ export interface PayInfoCollateralItemV5 {
165
+ coin: string;
166
+ availableSize: string;
167
+ availableValue: string;
168
+ coinScale: number;
169
+ borrowSize: string;
170
+ spotHedgeAmount: string;
171
+ assetFrozen: string;
172
+ }
173
+ export interface PayInfoBorrowBlockV5 {
174
+ coin?: string;
175
+ borrowSize: string;
176
+ borrowValue?: string;
177
+ assetFrozen: string;
178
+ availableBalance: string;
179
+ }
180
+ export interface PayInfoResultV5 {
181
+ collateralInfo: {
182
+ collateralList: PayInfoCollateralItemV5[];
183
+ };
184
+ borrowInfo: PayInfoBorrowBlockV5;
185
+ }
186
+ /** GET /v5/account/trade-info-for-analysis */
187
+ export interface TradeInfoAnalysisDailyV5 {
188
+ day: string;
189
+ sumBuyExecValue: string;
190
+ sumSellExecValue: string;
191
+ sumExecValue: string;
192
+ }
193
+ export interface TradeInfoForAnalysisResultV5 {
194
+ symbolRnl: string;
195
+ netExecQty: string;
196
+ sumExecValue: string;
197
+ sumExecQty: string;
198
+ avgBuyExecPrice: string;
199
+ sumBuyExecValue: string;
200
+ sumBuyExecQty: string;
201
+ sumBuyExecFee: string;
202
+ sumBuyOrderQty: string;
203
+ avgSellExecPrice: string;
204
+ sumSellExecValue: string;
205
+ sumSellExecQty: string;
206
+ sumSellExecFee: string;
207
+ sumSellOrderQty: string;
208
+ maxMarginVersion: number;
209
+ baseCoin: string;
210
+ settleCoin: string;
211
+ sumPriceList?: TradeInfoAnalysisDailyV5[];
212
+ }
@@ -0,0 +1,170 @@
1
+ /**
2
+ * V5 private Alpha / on-chain (Web3) trade responses.
3
+ */
4
+ export interface AlphaTradeQuoteModeEstimationV5 {
5
+ quoteMode: number;
6
+ estimatedGas: string;
7
+ estimatedGasUsd: string;
8
+ estimatedSlippage: string;
9
+ }
10
+ export interface AlphaTradeQuoteResultV5 {
11
+ tradeType: number;
12
+ fromTokenCode: string;
13
+ fromTokenAmount: string;
14
+ fromTokenAmountUsd: string;
15
+ toTokenCode: string;
16
+ toTokenAmount: string;
17
+ toTokenAmountUsd: string;
18
+ minToTokenAmount: string;
19
+ slippage: string;
20
+ gas: string;
21
+ gasUsd: string;
22
+ platformFee: string;
23
+ platformFeeUsd: string;
24
+ swapRate: string;
25
+ lossRate: string;
26
+ quoteData: string;
27
+ correctingCode: string;
28
+ quoteMode: number;
29
+ quoteDataId: string;
30
+ expireTime: number;
31
+ modeEstimations: AlphaTradeQuoteModeEstimationV5[];
32
+ chargeAmount?: string;
33
+ timestamp?: number;
34
+ }
35
+ export interface ExecuteAlphaTradeResultV5 {
36
+ orderNo: string;
37
+ }
38
+ export interface AlphaPayTokenV5 {
39
+ tokenCode: string;
40
+ symbol: string;
41
+ tokenDecimals: number;
42
+ tokenIconUrlDay: string;
43
+ tokenIconUrlNight: string;
44
+ limit: string;
45
+ supportChains: string[];
46
+ }
47
+ export interface AlphaTradeOrderV5 {
48
+ orderType: number;
49
+ tradeType: number;
50
+ orderNo: string;
51
+ orderStatus: number;
52
+ fromTokenCode: string;
53
+ fromTokenAmount: string;
54
+ fromTokenSymbol: string;
55
+ fromTokenDecimals: number;
56
+ fromTokenIconUrlDay?: string;
57
+ fromTokenIconUrlNight?: string;
58
+ fromChainCode: string;
59
+ fromChainIconUrl?: string;
60
+ toTokenCode: string;
61
+ toTokenAmount: string;
62
+ toTokenSymbol: string;
63
+ toTokenDecimals: number;
64
+ toTokenIconUrlDay?: string;
65
+ toTokenIconUrlNight?: string;
66
+ toChainCode: string;
67
+ toChainIconUrl?: string;
68
+ gasTokenSymbol: string;
69
+ gasOnchain: string;
70
+ gasUsd: string | null;
71
+ platformFee: string;
72
+ platformFeeUsd: string | null;
73
+ quoteMode: number;
74
+ createTime: number;
75
+ executionTime?: number;
76
+ failureReasonCode?: string;
77
+ source?: string;
78
+ swapRate: string;
79
+ actualFromTokenAmount: string;
80
+ }
81
+ export interface AlphaTradeOrderListResultV5 {
82
+ total: number;
83
+ pageIndex: number;
84
+ orders: AlphaTradeOrderV5[];
85
+ }
86
+ export interface AlphaBizTokenV5 {
87
+ tokenCode: string;
88
+ chainCode: string;
89
+ chainIconUrl: string;
90
+ tokenAddress: string;
91
+ symbol: string;
92
+ tokenDecimals: number;
93
+ tokenIconUrlDay: string;
94
+ tokenIconUrlNight: string;
95
+ createTime: number;
96
+ createTimeOnchain: number;
97
+ riskFlag: number;
98
+ minOrderQuantity: number;
99
+ maxOrderQuantity: number;
100
+ tokenTags: number[];
101
+ payTokenCodes: string[];
102
+ }
103
+ export interface AlphaBizTokenPriceV5 {
104
+ chainCode: string;
105
+ tokenAddress: string;
106
+ price: string;
107
+ change24h: string;
108
+ vol24h: string;
109
+ marketCap: string;
110
+ liquidity: string;
111
+ holders: string;
112
+ }
113
+ export interface AlphaBizTokenPriceListResultV5 {
114
+ tokenPriceInfoList: AlphaBizTokenPriceV5[];
115
+ }
116
+ export interface AlphaBizTokenDetailsV5 {
117
+ tokenCode: string;
118
+ chainCode: string;
119
+ chainIconUrl: string;
120
+ tokenAddress: string;
121
+ symbol: string;
122
+ tokenDecimals: number;
123
+ tokenIconUrlDay: string;
124
+ tokenIconUrlNight: string;
125
+ minOrderQuantity: string;
126
+ maxOrderQuantity: string;
127
+ maxPositionQuantity: string;
128
+ tokenDesc: string;
129
+ xUrl: string;
130
+ officialUrl: string;
131
+ whitePaperUrl: string;
132
+ tokenTag: number;
133
+ riskFlag: number;
134
+ createTimeOnchain: number;
135
+ status: number;
136
+ tokenTags: number[];
137
+ showMessage: number;
138
+ content?: string;
139
+ linkName?: string;
140
+ linkAddress?: string;
141
+ }
142
+ export interface AlphaAssetV5 {
143
+ chainCode: string;
144
+ chainIconUrl: string;
145
+ tokenAddress: string;
146
+ tokenCode: string;
147
+ tokenSymbol: string;
148
+ tokenDecimals: number;
149
+ tokenIconUrlDay: string;
150
+ tokenIconUrlNight: string;
151
+ tokenAmount: string;
152
+ tokenAmountUsd: string;
153
+ tradeFlag: number;
154
+ pnl: string | null;
155
+ pnlRatio: string | null;
156
+ costPrice: string | null;
157
+ lastPrice: string;
158
+ costTotalValue: string | null;
159
+ assetStatus: number;
160
+ announcementUrl?: string;
161
+ estimatedOfflineTime?: number;
162
+ delistingTime?: number;
163
+ }
164
+ export interface AlphaAssetListResultV5 {
165
+ totalAssetUsd: string;
166
+ assetList: AlphaAssetV5[];
167
+ }
168
+ export interface AlphaAssetDetailResultV5 {
169
+ assetList: AlphaAssetV5[];
170
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * V5 private Alpha / on-chain (Web3) trade responses.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=v5-alpha-trade.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v5-alpha-trade.js","sourceRoot":"","sources":["../../../src/types/response/v5-alpha-trade.ts"],"names":[],"mappings":";AAAA;;GAEG"}
@@ -175,19 +175,22 @@ export interface WithdrawalAddressV5 {
175
175
  verified: number;
176
176
  createdAt: string;
177
177
  }
178
+ export interface WithdrawableAccountSliceV5 {
179
+ coin: string;
180
+ withdrawableAmount: string;
181
+ availableBalance: string;
182
+ }
183
+ /**
184
+ * GET /v5/asset/withdraw/withdrawable-amount. Only keys with data are returned
185
+ * (e.g. UTA, FUND, EARN; EARN when the coin can be withdrawn from Earn; SPOT if present).
186
+ */
178
187
  export interface WithdrawableAmountV5 {
179
188
  limitAmountUsd: string;
180
189
  withdrawableAmount: {
181
- SPOT: {
182
- coin: string;
183
- withdrawableAmount: string;
184
- availableBalance: string;
185
- };
186
- FUND: {
187
- coin: string;
188
- withdrawableAmount: string;
189
- availableBalance: string;
190
- };
190
+ SPOT?: WithdrawableAccountSliceV5;
191
+ FUND?: WithdrawableAccountSliceV5;
192
+ UTA?: WithdrawableAccountSliceV5;
193
+ EARN?: WithdrawableAccountSliceV5;
191
194
  };
192
195
  }
193
196
  export interface VaspEntityV5 {
@@ -302,3 +305,148 @@ export interface FiatTradingPairListV5 {
302
305
  fiats: FiatCoinInfoV5[];
303
306
  cryptos: CryptoCoinInfoV5[];
304
307
  }
308
+ export interface FundingAccountTransactionRecordV5 {
309
+ memberId: string;
310
+ currency: string;
311
+ ioDirection: string;
312
+ txnAmt: string;
313
+ afterAmt: string;
314
+ createTime: string;
315
+ showBusiType: string;
316
+ showBusiTypeEn: string;
317
+ description: string;
318
+ descriptionEn: string;
319
+ }
320
+ /** When accountType=Alpha and category is farm, under `coinDetail` in sub-categories. */
321
+ export interface AssetOverviewCoinExtMapV5 {
322
+ priceUpper?: string;
323
+ priceLower?: string;
324
+ equityUnit?: string;
325
+ }
326
+ export interface AssetOverviewCoinDetailV5 {
327
+ coin: string;
328
+ equity: string;
329
+ extMap?: AssetOverviewCoinExtMapV5;
330
+ }
331
+ export interface AssetOverviewCategoryV5 {
332
+ category: string;
333
+ equity: string;
334
+ coinDetail: AssetOverviewCoinDetailV5[];
335
+ }
336
+ export interface AssetOverviewAccountItemV5 {
337
+ accountType: string;
338
+ totalEquity: string;
339
+ valuationCurrency: string;
340
+ snapshotTime: string;
341
+ coinDetail?: AssetOverviewCoinDetailV5[];
342
+ categories?: AssetOverviewCategoryV5[];
343
+ }
344
+ export interface AssetOverviewResultV5 {
345
+ totalEquity: string;
346
+ list: AssetOverviewAccountItemV5[];
347
+ }
348
+ export interface PortfolioMarginWalletV5 {
349
+ equity: string;
350
+ cashBalance: string;
351
+ marginBalance: string;
352
+ availableBalance: string;
353
+ accountIM: string;
354
+ accountMM: string;
355
+ accountMMRate: string;
356
+ accountIMRate: string;
357
+ }
358
+ export interface PortfolioMarginPnlRangePointV5 {
359
+ priceScale: string;
360
+ pnls: string[];
361
+ }
362
+ export interface PortfolioMarginContractBucketPnlV5 {
363
+ pnlRanges: PortfolioMarginPnlRangePointV5[];
364
+ }
365
+ export interface PortfolioMarginTotalPnlRangesV5 {
366
+ ALL?: PortfolioMarginContractBucketPnlV5;
367
+ PERPETUAL?: PortfolioMarginContractBucketPnlV5;
368
+ OPTION?: PortfolioMarginContractBucketPnlV5;
369
+ }
370
+ export interface PortfolioMarginPerpPositionPnlV5 {
371
+ symbolName: string;
372
+ position: string;
373
+ pnlRanges: PortfolioMarginPnlRangePointV5[];
374
+ sessionAvgPrice: string;
375
+ markPrice: string;
376
+ orderSize: string;
377
+ contractType: number;
378
+ settleCoin: string;
379
+ symbolAlias?: string;
380
+ }
381
+ export interface PortfolioMarginOptionPositionPnlV5 {
382
+ symbolName: string;
383
+ position: string;
384
+ pnlRanges: PortfolioMarginPnlRangePointV5[];
385
+ sessionAvgPrice: string;
386
+ markPrice: string;
387
+ orderSize: string;
388
+ contractType: number;
389
+ settleCoin: string;
390
+ }
391
+ export interface PortfolioMarginOptionExpiryPnlV5 {
392
+ expiryDateRepresentation: string;
393
+ pnlRanges: PortfolioMarginPnlRangePointV5[];
394
+ optionPositionPnlRanges: PortfolioMarginOptionPositionPnlV5[];
395
+ }
396
+ export interface PortfolioMarginContingencyV5 {
397
+ optionContingency: string;
398
+ futureDeltaContingency: string;
399
+ optionVegaContingency: string;
400
+ contingencyComponents: string;
401
+ usdtUsdcContingency: string;
402
+ futureContingency: string;
403
+ }
404
+ export interface PortfolioMarginAssetBlockV5 {
405
+ coin: string;
406
+ assetIM: string;
407
+ assetMM: string;
408
+ }
409
+ export interface PortfolioMarginSpotHedgeInfoV5 {
410
+ hedgeSpotSize: string;
411
+ walletBalance: string;
412
+ usdIndexPrice: string;
413
+ pnlRanges: PortfolioMarginPnlRangePointV5[];
414
+ }
415
+ export interface PortfolioMarginByBaseCoinV5 {
416
+ baseCoin: string;
417
+ totalPnlRanges: PortfolioMarginTotalPnlRangesV5;
418
+ perpPositionPnlRanges: PortfolioMarginPerpPositionPnlV5[];
419
+ optionExpiryDatePnlRanges: PortfolioMarginOptionExpiryPnlV5[];
420
+ contingency: PortfolioMarginContingencyV5;
421
+ asset: PortfolioMarginAssetBlockV5;
422
+ maxLossPriceMove: string;
423
+ maxLossIvShock: string;
424
+ totalClosePzFee: string;
425
+ spotHedgeInfo: PortfolioMarginSpotHedgeInfoV5;
426
+ maxLossIvShockList: string[];
427
+ }
428
+ export interface PortfolioMarginInfoResultV5 {
429
+ wallet: PortfolioMarginWalletV5;
430
+ assetPnlRange: PortfolioMarginByBaseCoinV5[];
431
+ }
432
+ export interface TotalMembersAccountBreakdownItemV5 {
433
+ type: string;
434
+ origb: string;
435
+ quoteb: string;
436
+ stat: number;
437
+ }
438
+ export interface TotalMembersMemberEntryV5 {
439
+ uid: number;
440
+ isM?: boolean;
441
+ type?: number;
442
+ stat: number;
443
+ origb: string;
444
+ quoteb?: string;
445
+ items: TotalMembersAccountBreakdownItemV5[];
446
+ }
447
+ export interface TotalMembersAssetsResultV5 {
448
+ total: string;
449
+ quoteTotal: string;
450
+ stat: number;
451
+ list: TotalMembersMemberEntryV5[];
452
+ }
@@ -79,4 +79,22 @@ export interface BrokerIssuedVoucherV5 {
79
79
  ineffectiveAt: string;
80
80
  usedAmount: string;
81
81
  }
82
+ export interface BrokerRateLimitSetResultItemV5 {
83
+ uids: string;
84
+ bizType: string;
85
+ rate: number;
86
+ success: boolean;
87
+ msg: string;
88
+ }
89
+ export interface BrokerRateLimitCapItemV5 {
90
+ bizType: string;
91
+ totalRate: string;
92
+ ebCap: string;
93
+ uidCap: string;
94
+ }
95
+ export interface BrokerRateLimitAllItemV5 {
96
+ uids: string;
97
+ bizType: string;
98
+ rate: number;
99
+ }
82
100
  export {};