bybit-api 4.6.1 → 4.6.3
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 +1 -0
- package/lib/constants/enum.d.ts +1 -0
- package/lib/constants/enum.js +1 -0
- package/lib/constants/enum.js.map +1 -1
- package/lib/rest-client-v5.d.ts +503 -18
- package/lib/rest-client-v5.js +634 -5
- package/lib/rest-client-v5.js.map +1 -1
- package/lib/types/request/index.d.ts +8 -0
- package/lib/types/request/index.js +8 -0
- package/lib/types/request/index.js.map +1 -1
- package/lib/types/request/v5-account.d.ts +25 -1
- package/lib/types/request/v5-alpha-trade.d.ts +52 -0
- package/lib/types/request/v5-alpha-trade.js +6 -0
- package/lib/types/request/v5-alpha-trade.js.map +1 -0
- package/lib/types/request/v5-asset.d.ts +26 -2
- package/lib/types/request/v5-card.d.ts +51 -0
- package/lib/types/request/v5-card.js +7 -0
- package/lib/types/request/v5-card.js.map +1 -0
- package/lib/types/request/v5-crypto-loan.d.ts +8 -0
- package/lib/types/request/v5-earn-advance-discount.d.ts +75 -0
- package/lib/types/request/v5-earn-advance-discount.js +3 -0
- package/lib/types/request/v5-earn-advance-discount.js.map +1 -0
- package/lib/types/request/v5-earn-fixed-term.d.ts +42 -0
- package/lib/types/request/v5-earn-fixed-term.js +3 -0
- package/lib/types/request/v5-earn-fixed-term.js.map +1 -0
- package/lib/types/request/v5-earn-liquidity-mining.d.ts +7 -0
- package/lib/types/request/v5-earn-liquidity-mining.js +3 -0
- package/lib/types/request/v5-earn-liquidity-mining.js.map +1 -0
- package/lib/types/request/v5-earn-pwm.d.ts +167 -0
- package/lib/types/request/v5-earn-pwm.js +3 -0
- package/lib/types/request/v5-earn-pwm.js.map +1 -0
- package/lib/types/request/v5-earn-token.d.ts +49 -0
- package/lib/types/request/v5-earn-token.js +6 -0
- package/lib/types/request/v5-earn-token.js.map +1 -0
- package/lib/types/request/v5-earn.d.ts +35 -0
- package/lib/types/request/v5-market.d.ts +10 -3
- package/lib/types/request/v5-spot-leverage-token.d.ts +46 -0
- package/lib/types/request/v5-spreadtrading.d.ts +7 -0
- package/lib/types/request/v5-strategy.d.ts +80 -0
- package/lib/types/request/v5-strategy.js +3 -0
- package/lib/types/request/v5-strategy.js.map +1 -0
- package/lib/types/request/v5-user.d.ts +29 -3
- package/lib/types/response/index.d.ts +8 -0
- package/lib/types/response/index.js +8 -0
- package/lib/types/response/index.js.map +1 -1
- package/lib/types/response/v5-account.d.ts +76 -0
- package/lib/types/response/v5-alpha-trade.d.ts +170 -0
- package/lib/types/response/v5-alpha-trade.js +6 -0
- package/lib/types/response/v5-alpha-trade.js.map +1 -0
- package/lib/types/response/v5-asset.d.ts +128 -10
- package/lib/types/response/v5-card.d.ts +118 -0
- package/lib/types/response/v5-card.js +3 -0
- package/lib/types/response/v5-card.js.map +1 -0
- package/lib/types/response/v5-earn-advance-discount.d.ts +143 -0
- package/lib/types/response/v5-earn-advance-discount.js +3 -0
- package/lib/types/response/v5-earn-advance-discount.js.map +1 -0
- package/lib/types/response/v5-earn-fixed-term.d.ts +102 -0
- package/lib/types/response/v5-earn-fixed-term.js +3 -0
- package/lib/types/response/v5-earn-fixed-term.js.map +1 -0
- package/lib/types/response/v5-earn-liquidity-mining.d.ts +31 -0
- package/lib/types/response/v5-earn-liquidity-mining.js +3 -0
- package/lib/types/response/v5-earn-liquidity-mining.js.map +1 -0
- package/lib/types/response/v5-earn-pwm.d.ts +425 -0
- package/lib/types/response/v5-earn-pwm.js +3 -0
- package/lib/types/response/v5-earn-pwm.js.map +1 -0
- package/lib/types/response/v5-earn-token.d.ts +62 -0
- package/lib/types/response/v5-earn-token.js +6 -0
- package/lib/types/response/v5-earn-token.js.map +1 -0
- package/lib/types/response/v5-earn.d.ts +141 -0
- package/lib/types/response/v5-market.d.ts +16 -4
- package/lib/types/response/v5-position.d.ts +2 -0
- package/lib/types/response/v5-spot-leverage-token.d.ts +56 -0
- package/lib/types/response/v5-spreadtrading.d.ts +5 -0
- package/lib/types/response/v5-strategy.d.ts +96 -0
- package/lib/types/response/v5-strategy.js +3 -0
- package/lib/types/response/v5-strategy.js.map +1 -0
- package/lib/types/response/v5-user.d.ts +30 -0
- package/lib/types/shared-v5.d.ts +20 -1
- package/lib/types/websockets/ws-events.d.ts +2 -0
- package/lib/util/webCryptoAPI.d.ts +1 -1
- package/lib/util/webCryptoAPI.js +1 -1
- package/lib/util/webCryptoAPI.js.map +1 -1
- package/lib/util/websockets/websocket-util.js +1 -0
- package/lib/util/websockets/websocket-util.js.map +1 -1
- package/llms.txt +12585 -7241
- package/package.json +1 -1
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/** GET /v5/earn/pwm/investment-plan/detail */
|
|
2
|
+
export interface GetPwmInvestmentPlanDetailParamsV5 {
|
|
3
|
+
planId: string;
|
|
4
|
+
}
|
|
5
|
+
/** GET /v5/earn/pwm/investment-plan/new-plan */
|
|
6
|
+
export interface GetPwmPendingInvestmentPlanDetailParamsV5 {
|
|
7
|
+
planId: string;
|
|
8
|
+
}
|
|
9
|
+
/** POST /v5/earn/pwm/investment-plan/claim */
|
|
10
|
+
export interface ClaimPwmWithdrawableFundsParamsV5 {
|
|
11
|
+
planId: string;
|
|
12
|
+
/** Default: FUND */
|
|
13
|
+
toAccountType?: string;
|
|
14
|
+
orderLinkId: string;
|
|
15
|
+
}
|
|
16
|
+
/** GET /v5/earn/pwm/investment-plan/asset-trend */
|
|
17
|
+
export interface GetPwmInvestmentPlanAssetTrendParamsV5 {
|
|
18
|
+
planId: string;
|
|
19
|
+
startTime?: number;
|
|
20
|
+
endTime?: number;
|
|
21
|
+
}
|
|
22
|
+
/** GET /v5/earn/pwm/investment-plan/fund-nav */
|
|
23
|
+
export interface GetPwmFundHistoricalNavParamsV5 {
|
|
24
|
+
fundId: string;
|
|
25
|
+
startTime?: number;
|
|
26
|
+
endTime?: number;
|
|
27
|
+
}
|
|
28
|
+
/** POST /v5/earn/pwm/investment-plan/subscribe */
|
|
29
|
+
export interface SubscribePwmInvestmentPlanParamsV5 {
|
|
30
|
+
planId: string;
|
|
31
|
+
/** Default: FUND */
|
|
32
|
+
accountType?: string;
|
|
33
|
+
orderLinkId: string;
|
|
34
|
+
}
|
|
35
|
+
/** POST /v5/earn/pwm/investment-plan/invest-more */
|
|
36
|
+
export interface InvestMorePwmInvestmentPlanParamsV5 {
|
|
37
|
+
planId: string;
|
|
38
|
+
/** Default: FUND */
|
|
39
|
+
accountType?: string;
|
|
40
|
+
category: string;
|
|
41
|
+
productId: string;
|
|
42
|
+
amount: string;
|
|
43
|
+
orderLinkId: string;
|
|
44
|
+
}
|
|
45
|
+
/** POST /v5/earn/pwm/investment-plan/redeem */
|
|
46
|
+
export interface RedeemPwmInvestmentPlanParamsV5 {
|
|
47
|
+
planId: string;
|
|
48
|
+
category: string;
|
|
49
|
+
productId: string;
|
|
50
|
+
orderLinkId: string;
|
|
51
|
+
/** Required for fund products */
|
|
52
|
+
shares?: string;
|
|
53
|
+
/** Required for non-fund products */
|
|
54
|
+
amount?: string;
|
|
55
|
+
/** Required for FundPool and On-chain Earn */
|
|
56
|
+
positionId?: string;
|
|
57
|
+
}
|
|
58
|
+
/** GET /v5/earn/pwm/investment-plan/order */
|
|
59
|
+
export interface GetPwmInvestmentPlanOrdersParamsV5 {
|
|
60
|
+
planId?: string;
|
|
61
|
+
category?: string;
|
|
62
|
+
type?: 'Subscribe' | 'Redeem' | 'AutoReinvest' | string;
|
|
63
|
+
status?: 'Completed' | 'Pending' | 'Failed' | string;
|
|
64
|
+
startTime?: string;
|
|
65
|
+
endTime?: string;
|
|
66
|
+
limit?: number;
|
|
67
|
+
cursor?: string;
|
|
68
|
+
orderLinkId?: string;
|
|
69
|
+
}
|
|
70
|
+
/** POST /v5/earn/pwm/customize-plan/create */
|
|
71
|
+
export interface CreatePwmCustomizeInvestmentPlanProductV5 {
|
|
72
|
+
category: string;
|
|
73
|
+
productId: string;
|
|
74
|
+
fundName: string;
|
|
75
|
+
amount: string;
|
|
76
|
+
}
|
|
77
|
+
export interface CreatePwmCustomizeInvestmentPlanParamsV5 {
|
|
78
|
+
accountType?: string;
|
|
79
|
+
products: CreatePwmCustomizeInvestmentPlanProductV5[];
|
|
80
|
+
}
|
|
81
|
+
/** GET /v5/earn/pwm/asset-manager/all-funds */
|
|
82
|
+
export interface GetPwmAllFundsParamsV5 {
|
|
83
|
+
coin?: string;
|
|
84
|
+
fundId?: string;
|
|
85
|
+
status?: string;
|
|
86
|
+
limit?: number;
|
|
87
|
+
cursor?: string;
|
|
88
|
+
}
|
|
89
|
+
/** POST /v5/earn/pwm/asset-manager/settle-profit */
|
|
90
|
+
export interface SettlePwmFundProfitParamsV5 {
|
|
91
|
+
fundId: string;
|
|
92
|
+
reqLinkId: string;
|
|
93
|
+
}
|
|
94
|
+
/** POST /v5/earn/pwm/asset-manager/create-fund */
|
|
95
|
+
export interface CreatePwmFundParamsV5 {
|
|
96
|
+
fundName: string;
|
|
97
|
+
coin: string;
|
|
98
|
+
profitShareRate: string;
|
|
99
|
+
managementFeeRate: string;
|
|
100
|
+
fundIntroduction?: string;
|
|
101
|
+
reqLinkId: string;
|
|
102
|
+
}
|
|
103
|
+
/** POST /v5/earn/pwm/asset-manager/create-investment-plan */
|
|
104
|
+
export interface CreatePwmAssetManagerInvestmentPlanDistributionV5 {
|
|
105
|
+
productId: string;
|
|
106
|
+
amount: string;
|
|
107
|
+
}
|
|
108
|
+
export interface CreatePwmAssetManagerInvestmentPlanParamsV5 {
|
|
109
|
+
accountUid: string;
|
|
110
|
+
planName: string;
|
|
111
|
+
planType: 'stable' | 'advanced' | string;
|
|
112
|
+
investmentDistribution: CreatePwmAssetManagerInvestmentPlanDistributionV5[];
|
|
113
|
+
reqLinkId: string;
|
|
114
|
+
}
|
|
115
|
+
/** GET /v5/earn/pwm/asset-manager/get-investment-plan */
|
|
116
|
+
export interface GetPwmAssetManagerInvestmentPlansParamsV5 {
|
|
117
|
+
planId?: string;
|
|
118
|
+
status?: string;
|
|
119
|
+
subscriptionUid?: string;
|
|
120
|
+
limit?: number;
|
|
121
|
+
cursor?: string;
|
|
122
|
+
}
|
|
123
|
+
/** POST /v5/earn/pwm/asset-manager/manage-investment-plan */
|
|
124
|
+
export interface ManagePwmAssetManagerInvestmentPlanFundV5 {
|
|
125
|
+
fundId: string;
|
|
126
|
+
amount: string;
|
|
127
|
+
}
|
|
128
|
+
export interface ManagePwmAssetManagerInvestmentPlanParamsV5 {
|
|
129
|
+
planId: string;
|
|
130
|
+
updateStatus?: 'Closed' | 'Deleted' | string;
|
|
131
|
+
updateFunds?: ManagePwmAssetManagerInvestmentPlanFundV5[];
|
|
132
|
+
reqLinkId: string;
|
|
133
|
+
}
|
|
134
|
+
/** GET /v5/earn/pwm/asset-manager/all-order */
|
|
135
|
+
export interface GetPwmAllFundOrdersParamsV5 {
|
|
136
|
+
fundId?: string;
|
|
137
|
+
orderType?: 'Subscribe' | 'Redeem' | string;
|
|
138
|
+
status?: string;
|
|
139
|
+
startTime?: number;
|
|
140
|
+
endTime?: number;
|
|
141
|
+
limit?: number;
|
|
142
|
+
cursor?: string;
|
|
143
|
+
}
|
|
144
|
+
/** POST /v5/earn/pwm/asset-manager/manage-order */
|
|
145
|
+
export interface ManagePwmFundOrderParamsV5 {
|
|
146
|
+
orderId: string;
|
|
147
|
+
action: 'approve' | 'reject' | string;
|
|
148
|
+
reqLinkId: string;
|
|
149
|
+
}
|
|
150
|
+
/** POST /v5/earn/pwm/asset-manager/create-sub-account */
|
|
151
|
+
export interface CreatePwmFundSubAccountParamsV5 {
|
|
152
|
+
fundId: string;
|
|
153
|
+
reqLinkId: string;
|
|
154
|
+
}
|
|
155
|
+
/** POST /v5/earn/pwm/fund-transfer */
|
|
156
|
+
export interface PwmFundTransferParamsV5 {
|
|
157
|
+
transferId: string;
|
|
158
|
+
fromUserId: number;
|
|
159
|
+
toUserId: number;
|
|
160
|
+
amount: string;
|
|
161
|
+
coin: string;
|
|
162
|
+
}
|
|
163
|
+
/** GET /v5/earn/pwm/query-fund-transfer-result */
|
|
164
|
+
export interface GetPwmFundTransferRecordsParamsV5 {
|
|
165
|
+
transferId?: string;
|
|
166
|
+
fromUserId?: number;
|
|
167
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v5-earn-pwm.js","sourceRoot":"","sources":["../../../src/types/request/v5-earn-pwm.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Earn token product (e.g. BYUSDT) — /v5/earn/token/*
|
|
3
|
+
*/
|
|
4
|
+
export interface GetEarnTokenProductParamsV5 {
|
|
5
|
+
/** Currently only BYUSDT */
|
|
6
|
+
coin: string;
|
|
7
|
+
}
|
|
8
|
+
export interface PlaceEarnTokenOrderParamsV5 {
|
|
9
|
+
coin: string;
|
|
10
|
+
orderLinkId: string;
|
|
11
|
+
orderType: 'Mint' | 'Redeem';
|
|
12
|
+
amount: string;
|
|
13
|
+
/** Mint: FlexibleSaving; Redeem: UNIFIED */
|
|
14
|
+
accountType: 'FlexibleSaving' | 'UNIFIED';
|
|
15
|
+
}
|
|
16
|
+
export interface GetEarnTokenOrderListParamsV5 {
|
|
17
|
+
coin: string;
|
|
18
|
+
orderLinkId?: string;
|
|
19
|
+
orderId?: string;
|
|
20
|
+
orderType?: 'Mint' | 'Redeem';
|
|
21
|
+
/** seconds */
|
|
22
|
+
startTime?: number;
|
|
23
|
+
/** seconds */
|
|
24
|
+
endTime?: number;
|
|
25
|
+
cursor?: string;
|
|
26
|
+
limit?: number;
|
|
27
|
+
}
|
|
28
|
+
export interface GetEarnTokenPositionParamsV5 {
|
|
29
|
+
coin: string;
|
|
30
|
+
}
|
|
31
|
+
export interface GetEarnTokenDailyYieldParamsV5 {
|
|
32
|
+
coin: string;
|
|
33
|
+
startTime?: number;
|
|
34
|
+
endTime?: number;
|
|
35
|
+
cursor?: string;
|
|
36
|
+
limit?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface GetEarnTokenHourlyYieldParamsV5 {
|
|
39
|
+
coin: string;
|
|
40
|
+
startTime?: number;
|
|
41
|
+
endTime?: number;
|
|
42
|
+
cursor?: string;
|
|
43
|
+
limit?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface GetEarnTokenHistoryAprParamsV5 {
|
|
46
|
+
coin: string;
|
|
47
|
+
/** 1 = 7d, 2 = 30d, 3 = 180d */
|
|
48
|
+
range: 1 | 2 | 3;
|
|
49
|
+
}
|
|
@@ -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,38 @@ 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
|
+
}
|
|
66
|
+
/** GET /v5/earn/hold-to-earn/yield-history — Hold to Earn airdrop daily PnL (Earn permission) */
|
|
67
|
+
export interface GetHoldToEarnAirdropYieldHistoryParamsV5 {
|
|
68
|
+
/** Unix seconds. Cannot be earlier than now minus 3 months */
|
|
69
|
+
timeStart?: number;
|
|
70
|
+
/** Unix seconds. Requires timeStart ≤ timeEnd */
|
|
71
|
+
timeEnd?: number;
|
|
72
|
+
/** Page size [1, 49] */
|
|
73
|
+
limit: number;
|
|
74
|
+
/** Pagination cursor from previous `nextCursor` */
|
|
75
|
+
cursor?: string;
|
|
76
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { KlineIntervalV3 } from '../shared';
|
|
2
|
-
import { CategoryV5, InstrumentStatusV5, OptionTypeV5 } from '../shared-v5';
|
|
2
|
+
import { CategoryV5, InstrumentStatusV5, InstrumentSymbolTypeV5, OptionTypeV5 } from '../shared-v5';
|
|
3
3
|
export interface GetKlineParamsV5 {
|
|
4
4
|
category: 'spot' | 'linear' | 'inverse';
|
|
5
5
|
symbol: string;
|
|
@@ -9,11 +9,17 @@ export interface GetKlineParamsV5 {
|
|
|
9
9
|
limit?: number;
|
|
10
10
|
}
|
|
11
11
|
export interface GetMarkPriceKlineParamsV5 {
|
|
12
|
-
|
|
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,7 +41,8 @@ export interface GetPremiumIndexPriceKlineParamsV5 {
|
|
|
35
41
|
export interface GetInstrumentsInfoParamsV5 {
|
|
36
42
|
category: CategoryV5;
|
|
37
43
|
symbol?: string;
|
|
38
|
-
symbolType
|
|
44
|
+
/** Filter by instrument `symbolType` (e.g. `commodity`, `stock`, `forex` for linear). */
|
|
45
|
+
symbolType?: InstrumentSymbolTypeV5;
|
|
39
46
|
status?: InstrumentStatusV5;
|
|
40
47
|
baseCoin?: string;
|
|
41
48
|
limit?: number;
|
|
@@ -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';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { OrderSideV5, PositionIdx, PovModeV5, StrategyCategoryV5, StrategyPreferV5, StrategyTypeV5 } from '../shared-v5';
|
|
2
|
+
/** POST /v5/strategy/create */
|
|
3
|
+
export interface CreateStrategyOrderParamsV5 {
|
|
4
|
+
category: StrategyCategoryV5;
|
|
5
|
+
symbol: string;
|
|
6
|
+
side: OrderSideV5;
|
|
7
|
+
strategyType: StrategyTypeV5;
|
|
8
|
+
/** Total order quantity (coin). Either size or positionValue is required */
|
|
9
|
+
size?: string;
|
|
10
|
+
/** Total order quantity (value). Either size or positionValue is required */
|
|
11
|
+
positionValue?: string;
|
|
12
|
+
reduceOnly?: boolean;
|
|
13
|
+
positionIdx?: PositionIdx;
|
|
14
|
+
/** Spot leverage type. 0: normal, 1: borrow to trade (UTA_SPOT only) */
|
|
15
|
+
leverageType?: 0 | 1;
|
|
16
|
+
/** TWAP / POV: total execution duration (seconds). Range [300, 86400]; TWAP must be divisible by interval */
|
|
17
|
+
duration?: number;
|
|
18
|
+
/** TWAP / POV: sub-order placement interval (seconds) */
|
|
19
|
+
interval?: 5 | 10 | 15 | 30 | 60 | 120;
|
|
20
|
+
/** TWAP: randomize each sub-order quantity by ±20% */
|
|
21
|
+
isRandom?: boolean;
|
|
22
|
+
/** Advanced: activate when market price reaches this value */
|
|
23
|
+
triggerPrice?: string;
|
|
24
|
+
/** Advanced: terminate when last traded price reaches this value */
|
|
25
|
+
maxChasePrice?: string;
|
|
26
|
+
/** Limit chase: absolute distance from best bid/ask. Mutually exclusive with chasePercentE4 */
|
|
27
|
+
chaseDistance?: string;
|
|
28
|
+
/** Limit chase: offset in basis points (1/10000). Mutually exclusive with chaseDistance */
|
|
29
|
+
chasePercentE4?: number;
|
|
30
|
+
/** Chase / Iceberg: reference price side, e.g. Bid1, Ask1 */
|
|
31
|
+
chasePrice?: string;
|
|
32
|
+
strategyPrefer?: StrategyPreferV5;
|
|
33
|
+
limitPrice?: string;
|
|
34
|
+
strategySl?: string;
|
|
35
|
+
strategyTp?: string;
|
|
36
|
+
/** Iceberg: 0 = taker allowed, 1 = post-only */
|
|
37
|
+
postOnly?: 0 | 1;
|
|
38
|
+
isRebalance?: boolean;
|
|
39
|
+
/** 1: market, 2: limit */
|
|
40
|
+
orderType?: 1 | 2;
|
|
41
|
+
orderPriceOffset?: string;
|
|
42
|
+
strategyName?: string;
|
|
43
|
+
/** POV execution mode */
|
|
44
|
+
mode?: PovModeV5;
|
|
45
|
+
/** POV participation rate */
|
|
46
|
+
participationRate?: string;
|
|
47
|
+
/** POV: historical traded volume window (seconds), range [60, 14400] */
|
|
48
|
+
referenceWindow?: string;
|
|
49
|
+
/** POV: book depth reference levels [1, 10] */
|
|
50
|
+
depthReference?: string;
|
|
51
|
+
}
|
|
52
|
+
/** GET /v5/strategy/list */
|
|
53
|
+
export interface GetStrategyListParamsV5 {
|
|
54
|
+
strategyId?: string;
|
|
55
|
+
symbol?: string;
|
|
56
|
+
/** 2: running, 3: terminated, 4: terminated unfilled, 5: paused, 6: untriggered */
|
|
57
|
+
status?: '2' | '3' | '4' | '5' | '6';
|
|
58
|
+
category?: StrategyCategoryV5;
|
|
59
|
+
strategyType?: StrategyTypeV5;
|
|
60
|
+
beginTimeE0?: number;
|
|
61
|
+
endTimeE0?: number;
|
|
62
|
+
pageSize?: number;
|
|
63
|
+
cursor?: string;
|
|
64
|
+
}
|
|
65
|
+
/** GET /v5/strategy/order-list */
|
|
66
|
+
export interface GetStrategyOrderListParamsV5 {
|
|
67
|
+
strategyId: string;
|
|
68
|
+
/** 2: created, 3: create failed, 4: partially filled, 5: fully filled, 6: rejected, 7: canceled */
|
|
69
|
+
status?: '2' | '3' | '4' | '5' | '6' | '7';
|
|
70
|
+
symbol?: string;
|
|
71
|
+
strategyType?: StrategyTypeV5;
|
|
72
|
+
beginTimeE0?: number;
|
|
73
|
+
endTimeE0?: number;
|
|
74
|
+
pageSize?: number;
|
|
75
|
+
cursor?: string;
|
|
76
|
+
}
|
|
77
|
+
/** POST /v5/strategy/stop */
|
|
78
|
+
export interface StopStrategyParamsV5 {
|
|
79
|
+
strategyId: string;
|
|
80
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v5-strategy.js","sourceRoot":"","sources":["../../../src/types/request/v5-strategy.ts"],"names":[],"mappings":""}
|
|
@@ -47,14 +47,40 @@ export interface GetAffiliateUserListParamsV5 {
|
|
|
47
47
|
startDate?: string;
|
|
48
48
|
endDate?: string;
|
|
49
49
|
}
|
|
50
|
+
/** GET /v5/affiliate/affiliate-sub-list */
|
|
51
|
+
export interface GetAffiliateSubAffiliateListParamsV5 {
|
|
52
|
+
cursor?: string;
|
|
53
|
+
/** [0, 100]. Default: 0 */
|
|
54
|
+
size?: number;
|
|
55
|
+
/** YYYY-MM-DD. Range with endDate max 3 months */
|
|
56
|
+
startDate?: string;
|
|
57
|
+
/** YYYY-MM-DD. Must be provided with startDate or both omitted (T-1 default) */
|
|
58
|
+
endDate?: string;
|
|
59
|
+
/** Exact sub-affiliate ID. 0 or omit for all */
|
|
60
|
+
subAffId?: number;
|
|
61
|
+
}
|
|
62
|
+
export interface GetAffiliateUserInfoParamsV5 {
|
|
63
|
+
/** The master account UID of affiliate's client */
|
|
64
|
+
uid: string;
|
|
65
|
+
/** Coin type for filtering, e.g. USDT */
|
|
66
|
+
coin?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Business line filter. 1: Derivatives, 2: Spot, 3: ByFi, 4: USDC, 5: Options
|
|
69
|
+
*/
|
|
70
|
+
business?: '1' | '2' | '3' | '4' | '5';
|
|
71
|
+
}
|
|
50
72
|
/** Get Friend Referrals - invitation relationship status. 0: alive; 1: invalid */
|
|
51
73
|
export interface GetFriendReferralsParamsV5 {
|
|
52
74
|
status?: string;
|
|
53
75
|
size?: string;
|
|
54
76
|
cursor?: string;
|
|
55
77
|
}
|
|
56
|
-
/** Sign Agreement
|
|
78
|
+
/** Sign Agreement. Only master account.
|
|
79
|
+
* - `category` (legacy): 2 = metals (XAU/XAG perps; stock perps share this); 3 = crude oil. New enum values are not added here; prefer `categoryV2`.
|
|
80
|
+
* - `categoryV2` (recommended): 1 = metals; 2 = crude oil. Additional values may be added by the API; use a numeric literal or variable.
|
|
81
|
+
* - Either `category` or `categoryV2` must be sent. */
|
|
57
82
|
export interface SignAgreementParamsV5 {
|
|
58
|
-
|
|
59
|
-
|
|
83
|
+
agree: boolean;
|
|
84
|
+
category?: 2 | 3;
|
|
85
|
+
categoryV2?: number;
|
|
60
86
|
}
|
|
@@ -5,10 +5,17 @@ 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-pwm';
|
|
18
|
+
export * from './v5-earn-token';
|
|
12
19
|
export * from './v5-market';
|
|
13
20
|
export * from './v5-p2p-trading';
|
|
14
21
|
export * from './v5-position';
|
|
@@ -16,5 +23,6 @@ export * from './v5-preupgrade';
|
|
|
16
23
|
export * from './v5-rfq';
|
|
17
24
|
export * from './v5-spot-leverage-token';
|
|
18
25
|
export * from './v5-spreadtrading';
|
|
26
|
+
export * from './v5-strategy';
|
|
19
27
|
export * from './v5-trade';
|
|
20
28
|
export * from './v5-user';
|
|
@@ -21,10 +21,17 @@ __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-pwm"), exports);
|
|
34
|
+
__exportStar(require("./v5-earn-token"), exports);
|
|
28
35
|
__exportStar(require("./v5-market"), exports);
|
|
29
36
|
__exportStar(require("./v5-p2p-trading"), exports);
|
|
30
37
|
__exportStar(require("./v5-position"), exports);
|
|
@@ -32,6 +39,7 @@ __exportStar(require("./v5-preupgrade"), exports);
|
|
|
32
39
|
__exportStar(require("./v5-rfq"), exports);
|
|
33
40
|
__exportStar(require("./v5-spot-leverage-token"), exports);
|
|
34
41
|
__exportStar(require("./v5-spreadtrading"), exports);
|
|
42
|
+
__exportStar(require("./v5-strategy"), exports);
|
|
35
43
|
__exportStar(require("./v5-trade"), exports);
|
|
36
44
|
__exportStar(require("./v5-user"), exports);
|
|
37
45
|
//# sourceMappingURL=index.js.map
|
|
@@ -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,gDAA8B;AAC9B,kDAAgC;AAChC,8CAA4B;AAC5B,mDAAiC;AACjC,gDAA8B;AAC9B,kDAAgC;AAChC,2CAAyB;AACzB,2DAAyC;AACzC,qDAAmC;AACnC,gDAA8B;AAC9B,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
|
+
}
|