binance 3.0.0-beta.8 → 3.0.1
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 -1
- package/lib/main-client.d.ts +100 -2
- package/lib/main-client.js +126 -1
- package/lib/main-client.js.map +1 -1
- package/lib/types/futures.d.ts +11 -0
- package/lib/types/shared.d.ts +8 -1
- package/lib/types/spot.d.ts +346 -3
- package/lib/types/websockets/ws-api-requests.d.ts +37 -29
- package/lib/types/websockets/ws-api-responses.d.ts +35 -1
- package/lib/types/websockets/ws-api.d.ts +11 -9
- package/lib/types/websockets/ws-api.js +1 -0
- package/lib/types/websockets/ws-api.js.map +1 -1
- package/lib/types/websockets/ws-events-formatted.d.ts +14 -12
- package/lib/types/websockets/ws-events-raw.d.ts +10 -0
- package/lib/types/websockets/ws-general.d.ts +5 -0
- package/lib/usdm-client.d.ts +4 -1
- package/lib/usdm-client.js +3 -0
- package/lib/usdm-client.js.map +1 -1
- package/lib/util/BaseRestClient.d.ts +2 -1
- package/lib/util/BaseRestClient.js +6 -5
- package/lib/util/BaseRestClient.js.map +1 -1
- package/lib/util/BaseWSClient.js +28 -5
- package/lib/util/BaseWSClient.js.map +1 -1
- package/lib/util/beautifier-maps.d.ts +34 -0
- package/lib/util/beautifier-maps.js +34 -0
- package/lib/util/beautifier-maps.js.map +1 -1
- package/lib/util/beautifier.d.ts +1 -0
- package/lib/util/beautifier.js +46 -7
- package/lib/util/beautifier.js.map +1 -1
- package/lib/util/node-support.js +3 -1
- package/lib/util/node-support.js.map +1 -1
- package/lib/util/requestUtils.d.ts +2 -2
- package/lib/util/requestUtils.js +69 -16
- package/lib/util/requestUtils.js.map +1 -1
- package/lib/util/typeGuards.d.ts +27 -4
- package/lib/util/typeGuards.js +103 -41
- package/lib/util/typeGuards.js.map +1 -1
- package/lib/util/webCryptoAPI.js +0 -2
- package/lib/util/webCryptoAPI.js.map +1 -1
- package/lib/util/websockets/WsStore.js.map +1 -1
- package/lib/util/websockets/user-data-stream-manager.js +2 -2
- package/lib/util/websockets/user-data-stream-manager.js.map +1 -1
- package/lib/util/websockets/websocket-util.d.ts +16 -2
- package/lib/util/websockets/websocket-util.js +92 -42
- package/lib/util/websockets/websocket-util.js.map +1 -1
- package/lib/websocket-api-client.d.ts +14 -8
- package/lib/websocket-api-client.js +39 -24
- package/lib/websocket-api-client.js.map +1 -1
- package/lib/websocket-client-legacy.js +3 -3
- package/lib/websocket-client-legacy.js.map +1 -1
- package/lib/websocket-client.d.ts +48 -14
- package/lib/websocket-client.js +312 -154
- package/lib/websocket-client.js.map +1 -1
- package/package.json +1 -1
package/lib/types/spot.d.ts
CHANGED
|
@@ -725,6 +725,41 @@ export interface SpotOrder {
|
|
|
725
725
|
origQuoteOrderQty: numberInString;
|
|
726
726
|
selfTradePreventionMode: SelfTradePreventionMode;
|
|
727
727
|
}
|
|
728
|
+
export interface SpotAmendKeepPriorityResult {
|
|
729
|
+
transactTime: number;
|
|
730
|
+
executionId: number;
|
|
731
|
+
amendedOrder: {
|
|
732
|
+
symbol: string;
|
|
733
|
+
orderId: number;
|
|
734
|
+
orderListId: number;
|
|
735
|
+
origClientOrderId: string;
|
|
736
|
+
clientOrderId: string;
|
|
737
|
+
price: string;
|
|
738
|
+
qty: string;
|
|
739
|
+
executedQty: string;
|
|
740
|
+
preventedQty: string;
|
|
741
|
+
quoteOrderQty: string;
|
|
742
|
+
cumulativeQuoteQty: string;
|
|
743
|
+
status: string;
|
|
744
|
+
timeInForce: string;
|
|
745
|
+
type: string;
|
|
746
|
+
side: string;
|
|
747
|
+
workingTime: number;
|
|
748
|
+
selfTradePreventionMode: string;
|
|
749
|
+
};
|
|
750
|
+
listStatus?: {
|
|
751
|
+
orderListId: number;
|
|
752
|
+
contingencyType: string;
|
|
753
|
+
listOrderStatus: string;
|
|
754
|
+
listClientOrderId: string;
|
|
755
|
+
symbol: string;
|
|
756
|
+
orders: {
|
|
757
|
+
symbol: string;
|
|
758
|
+
orderId: number;
|
|
759
|
+
clientOrderId: string;
|
|
760
|
+
}[];
|
|
761
|
+
};
|
|
762
|
+
}
|
|
728
763
|
export interface SpotAssetBalance {
|
|
729
764
|
asset: string;
|
|
730
765
|
free: numberInString;
|
|
@@ -826,13 +861,18 @@ export interface MarginAccountRecord {
|
|
|
826
861
|
txId: number;
|
|
827
862
|
}
|
|
828
863
|
export interface QueryCrossMarginAccountDetailsParams {
|
|
864
|
+
created: boolean;
|
|
829
865
|
borrowEnabled: boolean;
|
|
830
866
|
marginLevel: numberInString;
|
|
831
867
|
totalAssetOfBtc: numberInString;
|
|
832
868
|
totalLiabilityOfBtc: numberInString;
|
|
833
869
|
totalNetAssetOfBtc: numberInString;
|
|
870
|
+
totalCollateralValueInUSDT: numberInString;
|
|
871
|
+
totalOpenOrderLossInUSDT: numberInString;
|
|
834
872
|
tradeEnabled: boolean;
|
|
835
|
-
|
|
873
|
+
transferInEnabled: boolean;
|
|
874
|
+
transferOutEnabled: boolean;
|
|
875
|
+
accountType: string;
|
|
836
876
|
userAssets: MarginBalance[];
|
|
837
877
|
}
|
|
838
878
|
export interface BasicMarginAssetParams {
|
|
@@ -4590,7 +4630,7 @@ export interface SubmitMarginOTOOrderParams {
|
|
|
4590
4630
|
isIsolated?: 'TRUE' | 'FALSE';
|
|
4591
4631
|
listClientOrderId?: string;
|
|
4592
4632
|
newOrderRespType?: 'ACK' | 'RESULT' | 'FULL';
|
|
4593
|
-
sideEffectType?:
|
|
4633
|
+
sideEffectType?: SideEffects;
|
|
4594
4634
|
selfTradePreventionMode?: 'EXPIRE_TAKER' | 'EXPIRE_MAKER' | 'EXPIRE_BOTH' | 'NONE';
|
|
4595
4635
|
autoRepayAtCancel?: boolean;
|
|
4596
4636
|
workingType: 'LIMIT' | 'LIMIT_MAKER';
|
|
@@ -4644,7 +4684,7 @@ export interface MarginOTOOrder {
|
|
|
4644
4684
|
export interface SubmitMarginOTOCOOrderParams {
|
|
4645
4685
|
symbol: string;
|
|
4646
4686
|
isIsolated?: 'TRUE' | 'FALSE';
|
|
4647
|
-
sideEffectType?:
|
|
4687
|
+
sideEffectType?: SideEffects;
|
|
4648
4688
|
autoRepayAtCancel?: boolean;
|
|
4649
4689
|
listClientOrderId?: string;
|
|
4650
4690
|
newOrderRespType?: 'ACK' | 'RESULT' | 'FULL';
|
|
@@ -4879,6 +4919,11 @@ export interface PMProRedeemBFUSDResponse {
|
|
|
4879
4919
|
targetAssetQty: number;
|
|
4880
4920
|
rate: number;
|
|
4881
4921
|
}
|
|
4922
|
+
export interface PMProBankruptcyLoanRepaymentHistory {
|
|
4923
|
+
asset: string;
|
|
4924
|
+
amount: string;
|
|
4925
|
+
repayTime: number;
|
|
4926
|
+
}
|
|
4882
4927
|
export interface VipLoanInterestRateHistoryParams {
|
|
4883
4928
|
coin: string;
|
|
4884
4929
|
startTime?: number;
|
|
@@ -5010,3 +5055,301 @@ export interface VASPInfo {
|
|
|
5010
5055
|
vaspName: string;
|
|
5011
5056
|
vaspCode: string;
|
|
5012
5057
|
}
|
|
5058
|
+
export interface InstitutionalLoanLiability {
|
|
5059
|
+
assetName: string;
|
|
5060
|
+
principal: string;
|
|
5061
|
+
interest: string;
|
|
5062
|
+
}
|
|
5063
|
+
export interface InstitutionalLoanWallet {
|
|
5064
|
+
accountType: 'SPOT' | 'PORTFOLIO_MARGIN' | 'CROSS_MARGIN';
|
|
5065
|
+
netEquity: string;
|
|
5066
|
+
maintainMargin: string;
|
|
5067
|
+
}
|
|
5068
|
+
export interface InstitutionalLoanCollateralAccount {
|
|
5069
|
+
email: string;
|
|
5070
|
+
type: 'CREDIT' | 'COLLATERAL';
|
|
5071
|
+
wallets: InstitutionalLoanWallet[];
|
|
5072
|
+
}
|
|
5073
|
+
export interface InstitutionalLoanRiskUnitDetails {
|
|
5074
|
+
groupId: number;
|
|
5075
|
+
parentEmail: string;
|
|
5076
|
+
creditEmail: string;
|
|
5077
|
+
updateTime: number;
|
|
5078
|
+
ltv: string;
|
|
5079
|
+
totalNetEquity: string;
|
|
5080
|
+
totalMaintenanceMargin: string;
|
|
5081
|
+
totalLiability: string;
|
|
5082
|
+
liabilities: InstitutionalLoanLiability[];
|
|
5083
|
+
collateralAccounts: InstitutionalLoanCollateralAccount[];
|
|
5084
|
+
}
|
|
5085
|
+
export interface GetInstitutionalLoanRiskUnitDetailsParams {
|
|
5086
|
+
groupId?: number;
|
|
5087
|
+
}
|
|
5088
|
+
export interface CloseInstitutionalLoanRiskUnitResponse {
|
|
5089
|
+
groupId: number;
|
|
5090
|
+
status: 'CLOSED';
|
|
5091
|
+
}
|
|
5092
|
+
export interface AddInstitutionalLoanCollateralAccountParams {
|
|
5093
|
+
groupId: number;
|
|
5094
|
+
subEmail: string;
|
|
5095
|
+
enableSpot: boolean;
|
|
5096
|
+
enableMargin: boolean;
|
|
5097
|
+
}
|
|
5098
|
+
export interface InstitutionalLoanRiskUnitMember {
|
|
5099
|
+
email: string;
|
|
5100
|
+
type: 'CREDIT' | 'COLLATERAL';
|
|
5101
|
+
enableMargin: boolean;
|
|
5102
|
+
enableSpot: boolean;
|
|
5103
|
+
}
|
|
5104
|
+
export interface ActiveInstitutionalLoanRiskUnit {
|
|
5105
|
+
groupId: number;
|
|
5106
|
+
members: InstitutionalLoanRiskUnitMember[];
|
|
5107
|
+
createTime: number;
|
|
5108
|
+
}
|
|
5109
|
+
export interface InstitutionalLoanBorrowParams {
|
|
5110
|
+
groupId: number;
|
|
5111
|
+
assetName: string;
|
|
5112
|
+
amount: number;
|
|
5113
|
+
}
|
|
5114
|
+
export interface InstitutionalLoanBorrowResponse {
|
|
5115
|
+
transactionId: string;
|
|
5116
|
+
amount: number;
|
|
5117
|
+
status: string;
|
|
5118
|
+
}
|
|
5119
|
+
export interface InstitutionalLoanRepayParams {
|
|
5120
|
+
groupId: number;
|
|
5121
|
+
assetName: string;
|
|
5122
|
+
amount: number;
|
|
5123
|
+
}
|
|
5124
|
+
export interface InstitutionalLoanRepayResponse {
|
|
5125
|
+
transactionId: string;
|
|
5126
|
+
amount: number;
|
|
5127
|
+
}
|
|
5128
|
+
export interface GetInstitutionalLoanInterestHistoryParams {
|
|
5129
|
+
groupId?: number;
|
|
5130
|
+
asset?: string;
|
|
5131
|
+
startTime?: number;
|
|
5132
|
+
endTime?: number;
|
|
5133
|
+
current?: number;
|
|
5134
|
+
size?: number;
|
|
5135
|
+
}
|
|
5136
|
+
export interface InstitutionalLoanInterestHistoryRecord {
|
|
5137
|
+
groupId: number;
|
|
5138
|
+
assetName: string;
|
|
5139
|
+
principal: string;
|
|
5140
|
+
interestRate: string;
|
|
5141
|
+
interest: string;
|
|
5142
|
+
interestTimestamp: number;
|
|
5143
|
+
}
|
|
5144
|
+
export interface InstitutionalLoanInterestHistoryResponse {
|
|
5145
|
+
total: number;
|
|
5146
|
+
rows: InstitutionalLoanInterestHistoryRecord[];
|
|
5147
|
+
}
|
|
5148
|
+
export interface OnchainYieldsLockedProductListParams {
|
|
5149
|
+
asset?: string;
|
|
5150
|
+
current?: number;
|
|
5151
|
+
size?: number;
|
|
5152
|
+
}
|
|
5153
|
+
export interface OnchainYieldsLockedProductDetail {
|
|
5154
|
+
asset: string;
|
|
5155
|
+
rewardAsset: string;
|
|
5156
|
+
duration: number;
|
|
5157
|
+
renewable: boolean;
|
|
5158
|
+
isSoldOut: boolean;
|
|
5159
|
+
apr: string;
|
|
5160
|
+
status: 'PREHEATING' | 'PURCHASING';
|
|
5161
|
+
subscriptionStartTime: string;
|
|
5162
|
+
canRedeemToFlex: boolean;
|
|
5163
|
+
}
|
|
5164
|
+
export interface OnchainYieldsLockedProductQuota {
|
|
5165
|
+
totalPersonalQuota: string;
|
|
5166
|
+
minimum: string;
|
|
5167
|
+
}
|
|
5168
|
+
export interface OnchainYieldsLockedProduct {
|
|
5169
|
+
projectId: string;
|
|
5170
|
+
detail: OnchainYieldsLockedProductDetail;
|
|
5171
|
+
quota: OnchainYieldsLockedProductQuota;
|
|
5172
|
+
}
|
|
5173
|
+
export interface OnchainYieldsLockedProductListResponse {
|
|
5174
|
+
rows: OnchainYieldsLockedProduct[];
|
|
5175
|
+
total: number;
|
|
5176
|
+
}
|
|
5177
|
+
export interface OnchainYieldsLockedPersonalLeftQuotaParams {
|
|
5178
|
+
projectId: string;
|
|
5179
|
+
}
|
|
5180
|
+
export interface OnchainYieldsLockedPersonalLeftQuotaResponse {
|
|
5181
|
+
leftPersonalQuota: string;
|
|
5182
|
+
}
|
|
5183
|
+
export interface OnchainYieldsLockedPositionParams {
|
|
5184
|
+
asset?: string;
|
|
5185
|
+
positionId?: number;
|
|
5186
|
+
projectId?: string;
|
|
5187
|
+
current?: number;
|
|
5188
|
+
size?: number;
|
|
5189
|
+
}
|
|
5190
|
+
export interface OnchainYieldsLockedPosition {
|
|
5191
|
+
positionId: string;
|
|
5192
|
+
projectId: string;
|
|
5193
|
+
asset: string;
|
|
5194
|
+
amount: string;
|
|
5195
|
+
purchaseTime: string;
|
|
5196
|
+
duration: string;
|
|
5197
|
+
accrualDays: string;
|
|
5198
|
+
rewardAsset: string;
|
|
5199
|
+
APY: string;
|
|
5200
|
+
rewardAmt: string;
|
|
5201
|
+
nextPay?: string;
|
|
5202
|
+
nextPayDate?: string;
|
|
5203
|
+
payPeriod?: string;
|
|
5204
|
+
rewardsPayDate?: string;
|
|
5205
|
+
rewardsEndDate: string;
|
|
5206
|
+
deliverDate?: string;
|
|
5207
|
+
nextSubscriptionDate?: string;
|
|
5208
|
+
redeemingAmt?: string;
|
|
5209
|
+
redeemTo?: 'FLEXIBLE' | 'SPOT';
|
|
5210
|
+
canRedeemEarly: boolean;
|
|
5211
|
+
autoSubscribe: boolean;
|
|
5212
|
+
type: 'AUTO' | 'NORMAL';
|
|
5213
|
+
status: 'HOLDING' | 'REDEEMING' | 'RENEWING' | 'NEW_TRANSFERRING';
|
|
5214
|
+
}
|
|
5215
|
+
export interface OnchainYieldsLockedPositionResponse {
|
|
5216
|
+
rows: OnchainYieldsLockedPosition[];
|
|
5217
|
+
total: number;
|
|
5218
|
+
}
|
|
5219
|
+
export interface OnchainYieldsAccountResponse {
|
|
5220
|
+
totalAmountInBTC: string;
|
|
5221
|
+
totalAmountInUSDT: string;
|
|
5222
|
+
totalFlexibleAmountInBTC: string;
|
|
5223
|
+
totalFlexibleAmountInUSDT: string;
|
|
5224
|
+
totalLockedInBTC: string;
|
|
5225
|
+
totalLockedInUSDT: string;
|
|
5226
|
+
}
|
|
5227
|
+
export interface OnchainYieldsLockedSubscriptionPreviewParams {
|
|
5228
|
+
projectId: string;
|
|
5229
|
+
amount: number;
|
|
5230
|
+
autoSubscribe?: boolean;
|
|
5231
|
+
}
|
|
5232
|
+
export interface OnchainYieldsLockedSubscriptionPreviewResponse {
|
|
5233
|
+
rewardAsset: string;
|
|
5234
|
+
totalRewardAmt: string;
|
|
5235
|
+
nextPay?: string;
|
|
5236
|
+
nextPayDate?: string;
|
|
5237
|
+
rewardsPayDate?: string;
|
|
5238
|
+
valueDate: string;
|
|
5239
|
+
rewardsEndDate: string;
|
|
5240
|
+
deliverDate?: string;
|
|
5241
|
+
nextSubscriptionDate?: string;
|
|
5242
|
+
}
|
|
5243
|
+
export interface OnchainYieldsLockedSubscribeParams {
|
|
5244
|
+
projectId: string;
|
|
5245
|
+
amount: number;
|
|
5246
|
+
autoSubscribe?: boolean;
|
|
5247
|
+
sourceAccount?: 'SPOT' | 'FUND' | 'ALL';
|
|
5248
|
+
redeemTo?: 'SPOT' | 'FLEXIBLE';
|
|
5249
|
+
channelId?: string;
|
|
5250
|
+
clientId?: string;
|
|
5251
|
+
}
|
|
5252
|
+
export interface OnchainYieldsLockedSubscribeResponse {
|
|
5253
|
+
purchaseId: number;
|
|
5254
|
+
positionId: string;
|
|
5255
|
+
amount: string;
|
|
5256
|
+
success: boolean;
|
|
5257
|
+
}
|
|
5258
|
+
export interface OnchainYieldsLockedSetAutoSubscribeParams {
|
|
5259
|
+
positionId: string;
|
|
5260
|
+
autoSubscribe: boolean;
|
|
5261
|
+
}
|
|
5262
|
+
export interface OnchainYieldsLockedSetAutoSubscribeResponse {
|
|
5263
|
+
success: boolean;
|
|
5264
|
+
}
|
|
5265
|
+
export interface OnchainYieldsLockedSetRedeemOptionParams {
|
|
5266
|
+
positionId: string;
|
|
5267
|
+
redeemTo: 'SPOT' | 'FLEXIBLE';
|
|
5268
|
+
}
|
|
5269
|
+
export interface OnchainYieldsLockedSetRedeemOptionResponse {
|
|
5270
|
+
success: boolean;
|
|
5271
|
+
}
|
|
5272
|
+
export interface OnchainYieldsLockedRedeemParams {
|
|
5273
|
+
positionId: number;
|
|
5274
|
+
channelId?: string;
|
|
5275
|
+
}
|
|
5276
|
+
export interface OnchainYieldsLockedRedeemResponse {
|
|
5277
|
+
redeemId: number;
|
|
5278
|
+
success: boolean;
|
|
5279
|
+
}
|
|
5280
|
+
export interface OnchainYieldsLockedSubscriptionRecordParams {
|
|
5281
|
+
purchaseId?: string;
|
|
5282
|
+
clientId?: string;
|
|
5283
|
+
asset?: string;
|
|
5284
|
+
startTime?: number;
|
|
5285
|
+
endTime?: number;
|
|
5286
|
+
current?: number;
|
|
5287
|
+
size?: number;
|
|
5288
|
+
}
|
|
5289
|
+
export interface OnchainYieldsLockedSubscriptionRecord {
|
|
5290
|
+
positionId: string;
|
|
5291
|
+
purchaseId: string;
|
|
5292
|
+
projectId: string;
|
|
5293
|
+
clientId: string;
|
|
5294
|
+
time: number;
|
|
5295
|
+
asset: string;
|
|
5296
|
+
amount: string;
|
|
5297
|
+
lockPeriod: string;
|
|
5298
|
+
type: 'NORMAL' | 'AUTO';
|
|
5299
|
+
sourceAccount: 'SPOT' | 'FUNDING' | 'SPOTANDFUNDING';
|
|
5300
|
+
amtFromSpot?: string;
|
|
5301
|
+
amtFromFunding?: string;
|
|
5302
|
+
status: 'PURCHASING' | 'SUCCESS' | 'FAILED';
|
|
5303
|
+
}
|
|
5304
|
+
export interface OnchainYieldsLockedSubscriptionRecordResponse {
|
|
5305
|
+
rows: OnchainYieldsLockedSubscriptionRecord[];
|
|
5306
|
+
total: number;
|
|
5307
|
+
}
|
|
5308
|
+
export interface OnchainYieldsLockedRewardsHistoryParams {
|
|
5309
|
+
positionId?: string;
|
|
5310
|
+
asset?: string;
|
|
5311
|
+
startTime?: number;
|
|
5312
|
+
endTime?: number;
|
|
5313
|
+
current?: number;
|
|
5314
|
+
size?: number;
|
|
5315
|
+
}
|
|
5316
|
+
export interface OnchainYieldsLockedRewardsRecord {
|
|
5317
|
+
positionId: string;
|
|
5318
|
+
time: number;
|
|
5319
|
+
asset: string;
|
|
5320
|
+
lockPeriod: string;
|
|
5321
|
+
amount: string;
|
|
5322
|
+
}
|
|
5323
|
+
export interface OnchainYieldsLockedRewardsHistoryResponse {
|
|
5324
|
+
rows: OnchainYieldsLockedRewardsRecord[];
|
|
5325
|
+
total: number;
|
|
5326
|
+
}
|
|
5327
|
+
export interface OnchainYieldsLockedRedemptionRecordParams {
|
|
5328
|
+
positionId?: number;
|
|
5329
|
+
redeemId?: string;
|
|
5330
|
+
asset?: string;
|
|
5331
|
+
startTime?: number;
|
|
5332
|
+
endTime?: number;
|
|
5333
|
+
current?: number;
|
|
5334
|
+
size?: number;
|
|
5335
|
+
}
|
|
5336
|
+
export interface OnchainYieldsLockedRedemptionRecord {
|
|
5337
|
+
positionId: string;
|
|
5338
|
+
redeemId: number;
|
|
5339
|
+
time: number;
|
|
5340
|
+
asset: string;
|
|
5341
|
+
lockPeriod: string;
|
|
5342
|
+
amount: string;
|
|
5343
|
+
originalAmount: string;
|
|
5344
|
+
type: 'NORMAL' | 'EARLY' | 'CONVERT';
|
|
5345
|
+
deliverDate: string;
|
|
5346
|
+
lossAmount: string;
|
|
5347
|
+
isComplete: boolean;
|
|
5348
|
+
rewardAsset: string;
|
|
5349
|
+
rewardAmt: string;
|
|
5350
|
+
status: 'CREATED' | 'PAID';
|
|
5351
|
+
}
|
|
5352
|
+
export interface OnchainYieldsLockedRedemptionRecordResponse {
|
|
5353
|
+
rows: OnchainYieldsLockedRedemptionRecord[];
|
|
5354
|
+
total: number;
|
|
5355
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FuturesOrderType, PositionSide, PriceMatchMode, WorkingType } from '../futures';
|
|
2
|
-
import { BooleanString, BooleanStringCapitalised, KlineInterval, numberInString,
|
|
2
|
+
import { BooleanString, BooleanStringCapitalised, KlineInterval, numberInString, OrderSide, OrderTimeInForce, OrderType, SelfTradePreventionMode } from '../shared';
|
|
3
3
|
/**
|
|
4
4
|
* Simple request params with timestamp (required) & recv window (optional)
|
|
5
5
|
*/
|
|
@@ -147,23 +147,22 @@ export interface WSAPIMyAllocationsRequest {
|
|
|
147
147
|
/**
|
|
148
148
|
* Trading request types
|
|
149
149
|
*/
|
|
150
|
-
export interface WSAPINewSpotOrderRequest
|
|
150
|
+
export interface WSAPINewSpotOrderRequest {
|
|
151
151
|
symbol: string;
|
|
152
152
|
side: OrderSide;
|
|
153
|
-
type:
|
|
153
|
+
type: OrderType;
|
|
154
154
|
timeInForce?: OrderTimeInForce;
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
price?: numberInString;
|
|
156
|
+
quantity?: numberInString;
|
|
157
|
+
quoteOrderQty?: numberInString;
|
|
158
158
|
newClientOrderId?: string;
|
|
159
|
+
newOrderRespType?: 'ACK' | 'RESULT' | 'FULL';
|
|
160
|
+
stopPrice?: numberInString;
|
|
161
|
+
trailingDelta?: number;
|
|
162
|
+
icebergQty?: numberInString;
|
|
159
163
|
strategyId?: number;
|
|
160
164
|
strategyType?: number;
|
|
161
|
-
|
|
162
|
-
trailingDelta?: number;
|
|
163
|
-
icebergQty?: number;
|
|
164
|
-
newOrderRespType?: RT;
|
|
165
|
-
isIsolated?: StringBoolean;
|
|
166
|
-
sideEffectType?: SideEffects;
|
|
165
|
+
selfTradePreventionMode?: string;
|
|
167
166
|
}
|
|
168
167
|
export interface WSAPIOrderTestRequest {
|
|
169
168
|
symbol: string;
|
|
@@ -181,7 +180,7 @@ export interface WSAPIOrderTestRequest {
|
|
|
181
180
|
strategyType?: number;
|
|
182
181
|
selfTradePreventionMode?: string;
|
|
183
182
|
computeCommissionRates?: boolean;
|
|
184
|
-
timestamp
|
|
183
|
+
timestamp: number;
|
|
185
184
|
recvWindow?: number;
|
|
186
185
|
}
|
|
187
186
|
export interface WSAPIOrderStatusRequest {
|
|
@@ -189,7 +188,7 @@ export interface WSAPIOrderStatusRequest {
|
|
|
189
188
|
orderId?: number;
|
|
190
189
|
origClientOrderId?: string;
|
|
191
190
|
recvWindow?: number;
|
|
192
|
-
timestamp
|
|
191
|
+
timestamp: number;
|
|
193
192
|
}
|
|
194
193
|
export interface WSAPIOrderCancelRequest {
|
|
195
194
|
symbol: string;
|
|
@@ -198,7 +197,7 @@ export interface WSAPIOrderCancelRequest {
|
|
|
198
197
|
newClientOrderId?: string;
|
|
199
198
|
cancelRestrictions?: 'ONLY_NEW' | 'ONLY_PARTIALLY_FILLED';
|
|
200
199
|
recvWindow?: number;
|
|
201
|
-
timestamp
|
|
200
|
+
timestamp: number;
|
|
202
201
|
}
|
|
203
202
|
export interface WSAPIOrderCancelReplaceRequest {
|
|
204
203
|
symbol: string;
|
|
@@ -223,17 +222,26 @@ export interface WSAPIOrderCancelReplaceRequest {
|
|
|
223
222
|
cancelRestrictions?: 'ONLY_NEW' | 'ONLY_PARTIALLY_FILLED';
|
|
224
223
|
orderRateLimitExceededMode?: 'DO_NOTHING' | 'CANCEL_ONLY';
|
|
225
224
|
recvWindow?: number;
|
|
226
|
-
timestamp
|
|
225
|
+
timestamp: number;
|
|
226
|
+
}
|
|
227
|
+
export interface WSAPIOrderAmendKeepPriorityRequest {
|
|
228
|
+
symbol: string;
|
|
229
|
+
orderId?: number | string;
|
|
230
|
+
origClientOrderId?: string;
|
|
231
|
+
newClientOrderId?: string;
|
|
232
|
+
newQty?: string;
|
|
233
|
+
recvWindow?: number;
|
|
234
|
+
timestamp: number;
|
|
227
235
|
}
|
|
228
236
|
export interface WSAPIOpenOrdersStatusRequest {
|
|
229
237
|
symbol?: string;
|
|
230
238
|
recvWindow?: number;
|
|
231
|
-
timestamp
|
|
239
|
+
timestamp: number;
|
|
232
240
|
}
|
|
233
241
|
export interface WSAPIOpenOrdersCancelAllRequest {
|
|
234
242
|
symbol: string;
|
|
235
243
|
recvWindow?: number;
|
|
236
|
-
timestamp
|
|
244
|
+
timestamp: number;
|
|
237
245
|
}
|
|
238
246
|
/**
|
|
239
247
|
* Order list request types
|
|
@@ -259,7 +267,7 @@ export interface WSAPIOrderListPlaceRequest {
|
|
|
259
267
|
newOrderRespType?: 'ACK' | 'RESULT' | 'FULL';
|
|
260
268
|
selfTradePreventionMode?: string;
|
|
261
269
|
recvWindow?: number;
|
|
262
|
-
timestamp
|
|
270
|
+
timestamp: number;
|
|
263
271
|
}
|
|
264
272
|
export interface WSAPIOrderListPlaceOCORequest {
|
|
265
273
|
symbol: string;
|
|
@@ -287,7 +295,7 @@ export interface WSAPIOrderListPlaceOCORequest {
|
|
|
287
295
|
newOrderRespType?: 'ACK' | 'RESULT' | 'FULL';
|
|
288
296
|
selfTradePreventionMode?: string;
|
|
289
297
|
recvWindow?: number;
|
|
290
|
-
timestamp
|
|
298
|
+
timestamp: number;
|
|
291
299
|
}
|
|
292
300
|
export interface WSAPIOrderListPlaceOTORequest {
|
|
293
301
|
symbol: string;
|
|
@@ -315,7 +323,7 @@ export interface WSAPIOrderListPlaceOTORequest {
|
|
|
315
323
|
pendingStrategyId?: number;
|
|
316
324
|
pendingStrategyType?: number;
|
|
317
325
|
recvWindow?: number;
|
|
318
|
-
timestamp
|
|
326
|
+
timestamp: number;
|
|
319
327
|
}
|
|
320
328
|
export interface WSAPIOrderListPlaceOTOCORequest {
|
|
321
329
|
symbol: string;
|
|
@@ -352,13 +360,13 @@ export interface WSAPIOrderListPlaceOTOCORequest {
|
|
|
352
360
|
pendingBelowStrategyId?: number;
|
|
353
361
|
pendingBelowStrategyType?: number;
|
|
354
362
|
recvWindow?: number;
|
|
355
|
-
timestamp
|
|
363
|
+
timestamp: number;
|
|
356
364
|
}
|
|
357
365
|
export interface WSAPIOrderListStatusRequest {
|
|
358
366
|
origClientOrderId?: string;
|
|
359
367
|
orderListId?: number;
|
|
360
368
|
recvWindow?: number;
|
|
361
|
-
timestamp
|
|
369
|
+
timestamp: number;
|
|
362
370
|
}
|
|
363
371
|
export interface WSAPIOrderListCancelRequest {
|
|
364
372
|
symbol: string;
|
|
@@ -366,7 +374,7 @@ export interface WSAPIOrderListCancelRequest {
|
|
|
366
374
|
listClientOrderId?: string;
|
|
367
375
|
newClientOrderId?: string;
|
|
368
376
|
recvWindow?: number;
|
|
369
|
-
timestamp
|
|
377
|
+
timestamp: number;
|
|
370
378
|
}
|
|
371
379
|
/**
|
|
372
380
|
* SOR request types
|
|
@@ -384,7 +392,7 @@ export interface WSAPISOROrderPlaceRequest {
|
|
|
384
392
|
strategyId?: number;
|
|
385
393
|
strategyType?: number;
|
|
386
394
|
selfTradePreventionMode?: string;
|
|
387
|
-
timestamp
|
|
395
|
+
timestamp: number;
|
|
388
396
|
recvWindow?: number;
|
|
389
397
|
}
|
|
390
398
|
export type WSAPISOROrderTestRequest = WSAPISOROrderPlaceRequest & {
|
|
@@ -406,7 +414,7 @@ export interface WSAPIFuturesTickerBookRequest {
|
|
|
406
414
|
/**
|
|
407
415
|
* Futures trading request types
|
|
408
416
|
*/
|
|
409
|
-
export interface WSAPINewFuturesOrderRequest<numberType =
|
|
417
|
+
export interface WSAPINewFuturesOrderRequest<numberType = numberInString> {
|
|
410
418
|
symbol: string;
|
|
411
419
|
side: OrderSide;
|
|
412
420
|
positionSide?: PositionSide;
|
|
@@ -440,14 +448,14 @@ export interface WSAPIFuturesOrderModifyRequest {
|
|
|
440
448
|
origType?: string;
|
|
441
449
|
positionSide?: 'BOTH' | 'LONG' | 'SHORT';
|
|
442
450
|
recvWindow?: number;
|
|
443
|
-
timestamp
|
|
451
|
+
timestamp: number;
|
|
444
452
|
}
|
|
445
453
|
export interface WSAPIFuturesOrderCancelRequest {
|
|
446
454
|
symbol: string;
|
|
447
455
|
orderId?: number;
|
|
448
456
|
origClientOrderId?: string;
|
|
449
457
|
recvWindow?: number;
|
|
450
|
-
timestamp
|
|
458
|
+
timestamp: number;
|
|
451
459
|
}
|
|
452
460
|
export interface WSAPIFuturesOrderStatusRequest {
|
|
453
461
|
symbol: string;
|
|
@@ -466,7 +474,7 @@ export interface WSAPIFuturesPositionV2Request {
|
|
|
466
474
|
recvWindow?: number;
|
|
467
475
|
timestamp: number;
|
|
468
476
|
}
|
|
469
|
-
export interface
|
|
477
|
+
export interface WSAPIAccountInformationRequest {
|
|
470
478
|
omitZeroBalances?: boolean;
|
|
471
479
|
recvWindow?: number;
|
|
472
480
|
timestamp: number;
|
|
@@ -142,7 +142,7 @@ export interface WSAPIFuturesBookTicker {
|
|
|
142
142
|
/**
|
|
143
143
|
* Account response types
|
|
144
144
|
*/
|
|
145
|
-
export interface
|
|
145
|
+
export interface WSAPIAccountInformation {
|
|
146
146
|
makerCommission: number;
|
|
147
147
|
takerCommission: number;
|
|
148
148
|
buyerCommission: number;
|
|
@@ -570,3 +570,37 @@ export interface WSAPIFuturesAccountStatus {
|
|
|
570
570
|
assets: WSAPIFuturesAccountAsset[];
|
|
571
571
|
positions: WSAPIFuturesAccountPosition[];
|
|
572
572
|
}
|
|
573
|
+
/**
|
|
574
|
+
* Spot Order response types based on newOrderRespType parameter
|
|
575
|
+
*/
|
|
576
|
+
export interface WSAPISpotOrderACK {
|
|
577
|
+
symbol: string;
|
|
578
|
+
orderId: number;
|
|
579
|
+
orderListId: number;
|
|
580
|
+
clientOrderId: string;
|
|
581
|
+
transactTime: number;
|
|
582
|
+
}
|
|
583
|
+
export interface WSAPISpotOrderRESULT extends WSAPISpotOrderACK {
|
|
584
|
+
price: numberInString;
|
|
585
|
+
origQty: numberInString;
|
|
586
|
+
executedQty: numberInString;
|
|
587
|
+
origQuoteOrderQty: numberInString;
|
|
588
|
+
cummulativeQuoteQty: numberInString;
|
|
589
|
+
status: string;
|
|
590
|
+
timeInForce: string;
|
|
591
|
+
type: string;
|
|
592
|
+
side: string;
|
|
593
|
+
workingTime: number;
|
|
594
|
+
selfTradePreventionMode: string;
|
|
595
|
+
}
|
|
596
|
+
export interface WSAPISpotOrderFill {
|
|
597
|
+
price: numberInString;
|
|
598
|
+
qty: numberInString;
|
|
599
|
+
commission: numberInString;
|
|
600
|
+
commissionAsset: string;
|
|
601
|
+
tradeId: number;
|
|
602
|
+
}
|
|
603
|
+
export interface WSAPISpotOrderFULL extends WSAPISpotOrderRESULT {
|
|
604
|
+
fills: WSAPISpotOrderFill[];
|
|
605
|
+
}
|
|
606
|
+
export type WSAPISpotOrderResponse = WSAPISpotOrderACK | WSAPISpotOrderRESULT | WSAPISpotOrderFULL;
|