bitget-api 3.1.7 → 3.1.8
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/dist/cjs/index.d.ts +5 -0
- package/dist/cjs/index.js +5 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/rest-client-v2.d.ts +13 -2
- package/dist/cjs/rest-client-v2.js +13 -0
- package/dist/cjs/rest-client-v2.js.map +1 -1
- package/dist/cjs/rest-client-v3.d.ts +68 -4
- package/dist/cjs/rest-client-v3.js +114 -1
- package/dist/cjs/rest-client-v3.js.map +1 -1
- package/dist/cjs/types/request/v2/common.d.ts +7 -0
- package/dist/cjs/types/request/v3/account.d.ts +16 -0
- package/dist/cjs/types/request/v3/broker.d.ts +2 -2
- package/dist/cjs/types/request/v3/copytrading.d.ts +15 -0
- package/dist/cjs/types/request/v3/copytrading.js +3 -0
- package/dist/cjs/types/request/v3/copytrading.js.map +1 -0
- package/dist/cjs/types/request/v3/p2p.d.ts +105 -0
- package/dist/cjs/types/request/v3/p2p.js +3 -0
- package/dist/cjs/types/request/v3/p2p.js.map +1 -0
- package/dist/cjs/types/request/v3/strategy.d.ts +28 -13
- package/dist/cjs/types/request/v3/trade.d.ts +3 -0
- package/dist/cjs/types/response/v2/common.d.ts +8 -0
- package/dist/cjs/types/response/v3/account.d.ts +45 -1
- package/dist/cjs/types/response/v3/broker.d.ts +3 -3
- package/dist/cjs/types/response/v3/copytrading.d.ts +20 -0
- package/dist/cjs/types/response/v3/p2p.d.ts +202 -0
- package/dist/cjs/types/response/v3/p2p.js +3 -0
- package/dist/cjs/types/response/v3/p2p.js.map +1 -0
- package/dist/cjs/types/response/v3/strategy.d.ts +15 -8
- package/dist/cjs/types/response/v3/trade.d.ts +2 -1
- package/dist/cjs/types/websockets/ws-api-request.d.ts +3 -0
- package/dist/cjs/types/websockets/ws-api.d.ts +2 -0
- package/dist/cjs/types/websockets/ws-general.d.ts +1 -1
- package/dist/cjs/util/websocket-util.js +1 -0
- package/dist/cjs/util/websocket-util.js.map +1 -1
- package/dist/mjs/index.d.ts +5 -0
- package/dist/mjs/index.js +5 -0
- package/dist/mjs/index.js.map +1 -1
- package/dist/mjs/rest-client-v2.d.ts +13 -2
- package/dist/mjs/rest-client-v2.js +13 -0
- package/dist/mjs/rest-client-v2.js.map +1 -1
- package/dist/mjs/rest-client-v3.d.ts +68 -4
- package/dist/mjs/rest-client-v3.js +114 -1
- package/dist/mjs/rest-client-v3.js.map +1 -1
- package/dist/mjs/types/request/v2/common.d.ts +7 -0
- package/dist/mjs/types/request/v3/account.d.ts +16 -0
- package/dist/mjs/types/request/v3/broker.d.ts +2 -2
- package/dist/mjs/types/request/v3/copytrading.d.ts +15 -0
- package/dist/mjs/types/request/v3/copytrading.js +2 -0
- package/dist/mjs/types/request/v3/copytrading.js.map +1 -0
- package/dist/mjs/types/request/v3/p2p.d.ts +105 -0
- package/dist/mjs/types/request/v3/p2p.js +2 -0
- package/dist/mjs/types/request/v3/p2p.js.map +1 -0
- package/dist/mjs/types/request/v3/strategy.d.ts +28 -13
- package/dist/mjs/types/request/v3/trade.d.ts +3 -0
- package/dist/mjs/types/response/v2/common.d.ts +8 -0
- package/dist/mjs/types/response/v3/account.d.ts +45 -1
- package/dist/mjs/types/response/v3/broker.d.ts +3 -3
- package/dist/mjs/types/response/v3/copytrading.d.ts +20 -0
- package/dist/mjs/types/response/v3/p2p.d.ts +202 -0
- package/dist/mjs/types/response/v3/p2p.js +2 -0
- package/dist/mjs/types/response/v3/p2p.js.map +1 -0
- package/dist/mjs/types/response/v3/strategy.d.ts +15 -8
- package/dist/mjs/types/response/v3/trade.d.ts +2 -1
- package/dist/mjs/types/websockets/ws-api-request.d.ts +3 -0
- package/dist/mjs/types/websockets/ws-api.d.ts +2 -0
- package/dist/mjs/types/websockets/ws-general.d.ts +1 -1
- package/dist/mjs/util/websocket-util.js +1 -0
- package/dist/mjs/util/websocket-util.js.map +1 -1
- package/llms.txt +6734 -5957
- package/package.json +1 -1
|
@@ -8,12 +8,41 @@ export interface AccountCoinConfigV3 {
|
|
|
8
8
|
coin: string;
|
|
9
9
|
leverage: string;
|
|
10
10
|
}
|
|
11
|
+
export type AccountPermissionV3 = 'uta_mgt' | 'uta_trade' | 'withdraw' | 'copy_futures_position' | 'copy_futures_order';
|
|
12
|
+
export interface AccountInfoV3 {
|
|
13
|
+
userId: string;
|
|
14
|
+
inviterId: string;
|
|
15
|
+
/** Only set when the calling account is a sub-account */
|
|
16
|
+
parentId: string;
|
|
17
|
+
channelCode: string;
|
|
18
|
+
channel: string;
|
|
19
|
+
ips: string;
|
|
20
|
+
permType: 'read-only' | 'read-and-write';
|
|
21
|
+
permissions: AccountPermissionV3[];
|
|
22
|
+
regisTime: string;
|
|
23
|
+
}
|
|
24
|
+
export type AccountLevelV3 = 'basic' | 'advanced' | 'isolated' | 'delta';
|
|
11
25
|
export interface AccountSettingsV3 {
|
|
26
|
+
uid: string;
|
|
27
|
+
accountMode: 'unified' | 'hybrid' | 'upgrading' | 'switching';
|
|
12
28
|
assetMode: string;
|
|
29
|
+
accountLevel: AccountLevelV3;
|
|
13
30
|
holdMode: string;
|
|
31
|
+
stpMode: 'none' | 'cancel_taker' | 'cancel_maker' | 'cancel_both';
|
|
14
32
|
symbolConfigList: AccountSymbolConfigV3[];
|
|
15
33
|
coinConfigList: AccountCoinConfigV3[];
|
|
16
34
|
}
|
|
35
|
+
export interface AccountDeltaCoinPositionV3 {
|
|
36
|
+
coin: string;
|
|
37
|
+
positionRatio: string;
|
|
38
|
+
}
|
|
39
|
+
/** Delta-neutral mode metrics. Only available when accountLevel is delta. */
|
|
40
|
+
export interface AccountDeltaInfoV3 {
|
|
41
|
+
deltaEquityRatio: string;
|
|
42
|
+
deltaThreshold: string;
|
|
43
|
+
positionThreshold: string;
|
|
44
|
+
list: AccountDeltaCoinPositionV3[];
|
|
45
|
+
}
|
|
17
46
|
export interface AccountAssetV3 {
|
|
18
47
|
coin: string;
|
|
19
48
|
equity: string;
|
|
@@ -106,11 +135,26 @@ export interface SubAccountV3 {
|
|
|
106
135
|
username: string;
|
|
107
136
|
status: string;
|
|
108
137
|
accountMode: string;
|
|
109
|
-
type:
|
|
138
|
+
type: 'normal' | 'virtual' | 'custodian';
|
|
110
139
|
note: string;
|
|
111
140
|
createdTime: string;
|
|
112
141
|
updatedTime: string;
|
|
113
142
|
}
|
|
143
|
+
export interface WithdrawAddressBookEntryV3 {
|
|
144
|
+
coin: string;
|
|
145
|
+
chain: string;
|
|
146
|
+
address: string;
|
|
147
|
+
countryCode: string;
|
|
148
|
+
label: string;
|
|
149
|
+
memo: string;
|
|
150
|
+
type: 'regular' | 'EVM' | 'universal' | 'internal';
|
|
151
|
+
internalType: '' | 'uid' | 'mobile' | 'email';
|
|
152
|
+
createdTime: string;
|
|
153
|
+
}
|
|
154
|
+
export interface WithdrawAddressBookV3 {
|
|
155
|
+
addressList: WithdrawAddressBookEntryV3[];
|
|
156
|
+
cursor?: string;
|
|
157
|
+
}
|
|
114
158
|
export interface TransferResponseV3 {
|
|
115
159
|
transferId: string;
|
|
116
160
|
}
|
|
@@ -73,7 +73,7 @@ export interface CreateBrokerSubApiKeyResponseV3 {
|
|
|
73
73
|
label: string;
|
|
74
74
|
apiKey: string;
|
|
75
75
|
secretKey: string;
|
|
76
|
-
permType: '
|
|
76
|
+
permType: 'read_write' | 'read_only';
|
|
77
77
|
permList: string[];
|
|
78
78
|
ipList: string[] | null;
|
|
79
79
|
}
|
|
@@ -81,7 +81,7 @@ export interface ModifyBrokerSubApiKeyResponseV3 {
|
|
|
81
81
|
subUid: string;
|
|
82
82
|
label: string;
|
|
83
83
|
apiKey: string;
|
|
84
|
-
permType: '
|
|
84
|
+
permType: 'read_write' | 'read_only';
|
|
85
85
|
permList: string[];
|
|
86
86
|
ipList: string[];
|
|
87
87
|
}
|
|
@@ -90,7 +90,7 @@ export interface GetBrokerSubApiKeyResponseV3 {
|
|
|
90
90
|
label: string;
|
|
91
91
|
apiKey: string;
|
|
92
92
|
secretKey: string;
|
|
93
|
-
permType: '
|
|
93
|
+
permType: 'read_write' | 'read_only';
|
|
94
94
|
permList: string[];
|
|
95
95
|
ipList: string[] | null;
|
|
96
96
|
}
|
|
@@ -32,3 +32,23 @@ export interface CopyFuturesPositionSummaryV3 {
|
|
|
32
32
|
markPrice: string;
|
|
33
33
|
positionValue: string;
|
|
34
34
|
}
|
|
35
|
+
export interface CopyFuturesMaxTransferableV3 {
|
|
36
|
+
maxTransferable: string;
|
|
37
|
+
available: string;
|
|
38
|
+
}
|
|
39
|
+
export interface CopyFuturesTransferResponseV3 {
|
|
40
|
+
transferId: string;
|
|
41
|
+
}
|
|
42
|
+
export type CopyFuturesTransferAccountTypeV3 = 'spot' | 'uta' | 'lead';
|
|
43
|
+
export interface CopyFuturesTransferRecordV3 {
|
|
44
|
+
transferId: string;
|
|
45
|
+
fromType: CopyFuturesTransferAccountTypeV3;
|
|
46
|
+
toType: CopyFuturesTransferAccountTypeV3;
|
|
47
|
+
amount: string;
|
|
48
|
+
coin: string;
|
|
49
|
+
status: 'Successful' | 'Failed' | 'Processing';
|
|
50
|
+
createdTime: string;
|
|
51
|
+
}
|
|
52
|
+
export interface CopyFuturesTransferRecordListV3 {
|
|
53
|
+
list: CopyFuturesTransferRecordV3[];
|
|
54
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import type { P2pAdStatusV3, P2pMarketTypeV3, P2pOrderStatusV3, P2pPriceTypeV3, P2pSideV3 } from '../../request/v3/p2p.js';
|
|
2
|
+
export interface P2pPayMethodInfoFieldV3 {
|
|
3
|
+
name: string;
|
|
4
|
+
type: 'file' | 'number' | 'txt';
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
export interface P2pPayMethodV3 {
|
|
8
|
+
payMethodId: string;
|
|
9
|
+
payMethodName: string;
|
|
10
|
+
payMethodUserName: string;
|
|
11
|
+
userPayMethodId: string;
|
|
12
|
+
payMethodInfo: P2pPayMethodInfoFieldV3[];
|
|
13
|
+
}
|
|
14
|
+
export interface P2pTokenDetailV3 {
|
|
15
|
+
token: string;
|
|
16
|
+
precision: string;
|
|
17
|
+
}
|
|
18
|
+
export interface P2pFiatPayMethodV3 {
|
|
19
|
+
payMethodName: string;
|
|
20
|
+
iconUrl: string;
|
|
21
|
+
payMethodId: string;
|
|
22
|
+
}
|
|
23
|
+
export interface P2pWithdrawalLimitV3 {
|
|
24
|
+
withdrawLimitKey: string;
|
|
25
|
+
withdrawLimitValue: string;
|
|
26
|
+
}
|
|
27
|
+
export interface P2pFiatDetailV3 {
|
|
28
|
+
fiat: string;
|
|
29
|
+
precision: string;
|
|
30
|
+
floatRateMin: string;
|
|
31
|
+
floatRateMax: string;
|
|
32
|
+
fixedRateMin: string;
|
|
33
|
+
fixedRateMax: string;
|
|
34
|
+
adMinLimit: string;
|
|
35
|
+
adMaxLimit: string;
|
|
36
|
+
payMethods: P2pFiatPayMethodV3;
|
|
37
|
+
withdrawalLimit: P2pWithdrawalLimitV3;
|
|
38
|
+
payTimeLimit: number[];
|
|
39
|
+
}
|
|
40
|
+
export interface P2pCurrenciesV3 {
|
|
41
|
+
tokenDetailList: P2pTokenDetailV3[];
|
|
42
|
+
fiatDetailList: P2pFiatDetailV3[];
|
|
43
|
+
}
|
|
44
|
+
export interface P2pUserEquityDetailV3 {
|
|
45
|
+
maxAdvSellNum: string;
|
|
46
|
+
maxAdvSellLimit: string;
|
|
47
|
+
maxAdvBuyNum: string;
|
|
48
|
+
maxAdvBuyLimit: string;
|
|
49
|
+
totalMaxPendingOrder: string;
|
|
50
|
+
advMaxPendingOrder: string;
|
|
51
|
+
}
|
|
52
|
+
export interface P2pUserInfoV3 {
|
|
53
|
+
uid: string;
|
|
54
|
+
nickName: string;
|
|
55
|
+
accountLevel: 'starter' | 'advanced' | 'master';
|
|
56
|
+
completedOrderNum: string;
|
|
57
|
+
positiveRate: string;
|
|
58
|
+
completedOrderNum30D: string;
|
|
59
|
+
completedRate30D: string;
|
|
60
|
+
avgPayTime30D: string;
|
|
61
|
+
avgReleaseTime30D: string;
|
|
62
|
+
equityDetail: P2pUserEquityDetailV3;
|
|
63
|
+
registerTime: string;
|
|
64
|
+
}
|
|
65
|
+
export interface P2pBalanceV3 {
|
|
66
|
+
token: string;
|
|
67
|
+
totalBalance: string;
|
|
68
|
+
frozenBalance: string;
|
|
69
|
+
availableBalance: string;
|
|
70
|
+
}
|
|
71
|
+
export interface P2pExchangeRateV3 {
|
|
72
|
+
rate: string;
|
|
73
|
+
}
|
|
74
|
+
export interface P2pFeeSimulateV3 {
|
|
75
|
+
feeToken: string;
|
|
76
|
+
feeAmount: string;
|
|
77
|
+
taxToken: string;
|
|
78
|
+
taxAmount: string;
|
|
79
|
+
}
|
|
80
|
+
export interface P2pAdLimitV3 {
|
|
81
|
+
buyMinTokenAmount: string;
|
|
82
|
+
buyMaxTokenAmount: string;
|
|
83
|
+
sellMinTokenAmount: string;
|
|
84
|
+
sellMaxTokenAmount: string;
|
|
85
|
+
}
|
|
86
|
+
export interface P2pCreateAdResponseV3 {
|
|
87
|
+
advId: string;
|
|
88
|
+
}
|
|
89
|
+
export interface P2pAdPayMethodRefV3 {
|
|
90
|
+
payMethodId: string;
|
|
91
|
+
userPayMethodId?: string;
|
|
92
|
+
}
|
|
93
|
+
export interface P2pAdInfoV3 {
|
|
94
|
+
advId: string;
|
|
95
|
+
side: P2pSideV3;
|
|
96
|
+
priceType: P2pPriceTypeV3;
|
|
97
|
+
token: string;
|
|
98
|
+
fiat: string;
|
|
99
|
+
price: string;
|
|
100
|
+
amount: string;
|
|
101
|
+
minAmount: string;
|
|
102
|
+
maxAmount: string;
|
|
103
|
+
payDuration: string;
|
|
104
|
+
soldAmount: string;
|
|
105
|
+
lastAmount: string;
|
|
106
|
+
premium: string;
|
|
107
|
+
turnover: string;
|
|
108
|
+
remark: string;
|
|
109
|
+
tradeTerm: string;
|
|
110
|
+
payMethodIds: P2pAdPayMethodRefV3[];
|
|
111
|
+
tokenPrecision: string;
|
|
112
|
+
fiatPrecision: string;
|
|
113
|
+
market: P2pMarketTypeV3;
|
|
114
|
+
avgTime: string;
|
|
115
|
+
createdTime: string;
|
|
116
|
+
updatedTime: string;
|
|
117
|
+
}
|
|
118
|
+
export interface P2pPublicAdListItemV3 {
|
|
119
|
+
advId: string;
|
|
120
|
+
merchantId: string;
|
|
121
|
+
merchantName: string;
|
|
122
|
+
token: string;
|
|
123
|
+
fiat: string;
|
|
124
|
+
side: P2pSideV3;
|
|
125
|
+
price: string;
|
|
126
|
+
minAmount: string;
|
|
127
|
+
maxAmount: string;
|
|
128
|
+
quantity: string;
|
|
129
|
+
payMethods: {
|
|
130
|
+
payMethodId: string;
|
|
131
|
+
payMethodName: string;
|
|
132
|
+
}[];
|
|
133
|
+
completedOrderNum: string;
|
|
134
|
+
completedRate: string;
|
|
135
|
+
avgReleaseTime: string;
|
|
136
|
+
createdTime: string;
|
|
137
|
+
}
|
|
138
|
+
export interface P2pMyAdListItemV3 {
|
|
139
|
+
advId: string;
|
|
140
|
+
side: P2pSideV3;
|
|
141
|
+
priceType: P2pPriceTypeV3;
|
|
142
|
+
token: string;
|
|
143
|
+
fiat: string;
|
|
144
|
+
price: string;
|
|
145
|
+
soldAmount: string;
|
|
146
|
+
lastAmount: string;
|
|
147
|
+
payMethods: {
|
|
148
|
+
payMethodId: string;
|
|
149
|
+
}[];
|
|
150
|
+
status: P2pAdStatusV3;
|
|
151
|
+
createdTime: string;
|
|
152
|
+
updatedTime: string;
|
|
153
|
+
}
|
|
154
|
+
export interface P2pCursorListV3<T> {
|
|
155
|
+
items: T[];
|
|
156
|
+
nextId?: string;
|
|
157
|
+
}
|
|
158
|
+
export interface P2pOrderListItemV3 {
|
|
159
|
+
orderId: string;
|
|
160
|
+
side: P2pSideV3;
|
|
161
|
+
token: string;
|
|
162
|
+
fiat: string;
|
|
163
|
+
price: string;
|
|
164
|
+
amount: string;
|
|
165
|
+
quantity: string;
|
|
166
|
+
fee: string;
|
|
167
|
+
counterparty: string;
|
|
168
|
+
status: P2pOrderStatusV3;
|
|
169
|
+
createdTime: string;
|
|
170
|
+
updatedTime: string;
|
|
171
|
+
}
|
|
172
|
+
export interface P2pOrderPayMethodDetailV3 {
|
|
173
|
+
payMethodId: string;
|
|
174
|
+
payMethodName: string;
|
|
175
|
+
payMethodUserName: string;
|
|
176
|
+
postscript: string;
|
|
177
|
+
payMethodInfo: P2pPayMethodInfoFieldV3[];
|
|
178
|
+
}
|
|
179
|
+
export interface P2pOrderUserInfoV3 {
|
|
180
|
+
nickName: string;
|
|
181
|
+
realName: string;
|
|
182
|
+
}
|
|
183
|
+
export interface P2pOrderInfoV3 {
|
|
184
|
+
orderId: string;
|
|
185
|
+
side: P2pSideV3;
|
|
186
|
+
token: string;
|
|
187
|
+
fiat: string;
|
|
188
|
+
price: string;
|
|
189
|
+
quantity: string;
|
|
190
|
+
amount: string;
|
|
191
|
+
status: P2pOrderStatusV3;
|
|
192
|
+
advId: string;
|
|
193
|
+
remark: string;
|
|
194
|
+
orderCancelCountdown: string;
|
|
195
|
+
fee: string;
|
|
196
|
+
verifyCapital: 'yes' | 'no';
|
|
197
|
+
payMethodDetail?: P2pOrderPayMethodDetailV3;
|
|
198
|
+
sellUserInfo: P2pOrderUserInfoV3;
|
|
199
|
+
buyUserInfo: P2pOrderUserInfoV3;
|
|
200
|
+
createdTime: string;
|
|
201
|
+
updatedTime: string;
|
|
202
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"p2p.js","sourceRoot":"","sources":["../../../../../src/types/response/v3/p2p.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { StrategyOrderStatusV3, StrategyTriggerByV3, StrategyTriggerOrderTypeV3 } from '../../request/v3/strategy.js';
|
|
1
2
|
export interface PlaceStrategyOrderResponseV3 {
|
|
2
3
|
orderId: string;
|
|
3
4
|
clientOid: string;
|
|
@@ -13,14 +14,20 @@ export interface StrategyOrderV3 {
|
|
|
13
14
|
symbol: string;
|
|
14
15
|
qty: string;
|
|
15
16
|
posSide: 'long' | 'short';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
status: StrategyOrderStatusV3;
|
|
18
|
+
triggerType?: 'takeProfit' | 'stopLoss';
|
|
19
|
+
tpTriggerBy?: StrategyTriggerByV3;
|
|
20
|
+
slTriggerBy?: StrategyTriggerByV3;
|
|
21
|
+
takeProfit?: string;
|
|
22
|
+
stopLoss?: string;
|
|
23
|
+
tpOrderType?: StrategyTriggerOrderTypeV3;
|
|
24
|
+
slOrderType?: StrategyTriggerOrderTypeV3;
|
|
25
|
+
tpLimitPrice?: string;
|
|
26
|
+
slLimitPrice?: string;
|
|
27
|
+
triggerBy?: StrategyTriggerByV3;
|
|
28
|
+
triggerPrice?: string;
|
|
29
|
+
triggerOrderType?: StrategyTriggerOrderTypeV3;
|
|
30
|
+
triggerOrderPrice?: string;
|
|
24
31
|
createdTime: string;
|
|
25
32
|
updatedTime: string;
|
|
26
33
|
}
|
|
@@ -65,10 +65,11 @@ export interface OrderInfoV3 {
|
|
|
65
65
|
createdTime: string;
|
|
66
66
|
updatedTime: string;
|
|
67
67
|
}
|
|
68
|
+
export type FillCategoryV3 = 'spot' | 'margin' | 'usdt-futures' | 'coin-futures' | 'usdc-futures' | 'SPOT' | 'MARGIN' | 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
|
|
68
69
|
export interface FillV3 {
|
|
69
70
|
execId: string;
|
|
70
71
|
orderId: string;
|
|
71
|
-
category:
|
|
72
|
+
category: FillCategoryV3;
|
|
72
73
|
symbol: string;
|
|
73
74
|
orderType: string;
|
|
74
75
|
side: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { FuturesMarginModeV3 } from '../request/v3/trade.js';
|
|
1
2
|
export interface WSAPIPlaceOrderRequestV3 {
|
|
2
3
|
symbol: string;
|
|
3
4
|
orderType: 'limit' | 'market';
|
|
@@ -7,6 +8,8 @@ export interface WSAPIPlaceOrderRequestV3 {
|
|
|
7
8
|
posSide?: 'long' | 'short';
|
|
8
9
|
timeInForce?: 'gtc' | 'ioc' | 'fok' | 'post_only';
|
|
9
10
|
reduceOnly?: 'YES' | 'NO';
|
|
11
|
+
/** Futures only. Defaults to crossed */
|
|
12
|
+
marginMode?: FuturesMarginModeV3;
|
|
10
13
|
clientOid?: string;
|
|
11
14
|
stpMode?: 'none' | 'cancel_taker' | 'cancel_maker' | 'cancel_both';
|
|
12
15
|
tpTriggerBy?: 'market' | 'mark';
|
|
@@ -64,6 +64,8 @@ export interface WSAPIResponse<TResponseData extends object = object, TOperation
|
|
|
64
64
|
code: '0' | string;
|
|
65
65
|
msg: 'success' | string;
|
|
66
66
|
ts: string;
|
|
67
|
+
/** Connection ID (trade operation responses, May 2026+) */
|
|
68
|
+
connId?: string;
|
|
67
69
|
}
|
|
68
70
|
/**
|
|
69
71
|
* List of operations supported for this WsKey (connection)
|
|
@@ -34,7 +34,7 @@ export type WsTopicV2 = WsPublicTopicV2 | WsPrivateTopicV2;
|
|
|
34
34
|
*
|
|
35
35
|
*/
|
|
36
36
|
export type WsPublicTopicV3 = 'ticker' | 'kline' | 'books' | 'publicTrade';
|
|
37
|
-
export type WsPrivateTopicV3 = 'account' | 'position' | 'fill' | 'order';
|
|
37
|
+
export type WsPrivateTopicV3 = 'account' | 'position' | 'fill' | 'order' | 'strategy-order';
|
|
38
38
|
export type WsTopicV3 = WsPublicTopicV3 | WsPrivateTopicV3;
|
|
39
39
|
/** This is used to differentiate between each of the available websocket streams */
|
|
40
40
|
export type WsKey = (typeof WS_KEY_MAP)[keyof typeof WS_KEY_MAP];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websocket-util.js","sourceRoot":"","sources":["../../../src/util/websocket-util.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,kBAAkB,GAAG,E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E/E,MAAM,CAAC,MAAM,iBAAiB,GAAuB;IACnD,SAAS;IACT,QAAQ;IACR,WAAW;IACX,aAAa;IACb,mBAAmB;IACnB,gBAAgB;IAChB,iBAAiB;IACjB,kBAAkB;IAClB,iBAAiB;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAuB;IACnD,SAAS;IACT,UAAU;IACV,MAAM;IACN,OAAO;
|
|
1
|
+
{"version":3,"file":"websocket-util.js","sourceRoot":"","sources":["../../../src/util/websocket-util.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;AAiB5D,MAAM,CAAC,MAAM,eAAe,GAGxB;IACF,KAAK,EAAE;QACL,GAAG,EAAE;YACH,OAAO,EAAE,mCAAmC;YAC5C,IAAI,EAAE,mBAAmB;SAC1B;KACF;IACD,MAAM,EAAE;QACN,GAAG,EAAE;YACH,OAAO,EAAE,oCAAoC;YAC7C,IAAI,EAAE,mBAAmB;SAC1B;KACF;IACD,QAAQ,EAAE;QACR,GAAG,EAAE;YACH,OAAO,EAAE,kCAAkC;YAC3C,IAAI,EAAE,qCAAqC;SAC5C;KACF;IACD,SAAS,EAAE;QACT,GAAG,EAAE;YACH,OAAO,EAAE,mCAAmC;YAC5C,IAAI,EAAE,sCAAsC;SAC7C;KACF;IACD,QAAQ,EAAE;QACR,GAAG,EAAE;YACH,OAAO,EAAE,kCAAkC;YAC3C,IAAI,EAAE,qCAAqC;SAC5C;KACF;IACD,SAAS,EAAE;QACT,GAAG,EAAE;YACH,OAAO,EAAE,mCAAmC;YAC5C,IAAI,EAAE,sCAAsC;SAC7C;KACF;CACF,CAAC;AAEF,0CAA0C;AAC1C,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;I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