feat(): added all spot response types
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
|||||||
BGBConvertHistoryV2,
|
BGBConvertHistoryV2,
|
||||||
BorrowLoanRequestV2,
|
BorrowLoanRequestV2,
|
||||||
BotAssetsV2,
|
BotAssetsV2,
|
||||||
|
CancelAndSubmitSpotOrderResponseV2,
|
||||||
CloseFuturesFollowerPositionsRequestV2,
|
CloseFuturesFollowerPositionsRequestV2,
|
||||||
ConvertBGBResponseV2,
|
ConvertBGBResponseV2,
|
||||||
ConvertCurrenciesV2,
|
ConvertCurrenciesV2,
|
||||||
@@ -135,28 +136,52 @@ import {
|
|||||||
P2PMerchantOrderV2,
|
P2PMerchantOrderV2,
|
||||||
RedeemSavingsRequestV2,
|
RedeemSavingsRequestV2,
|
||||||
RepayLoanRequestV2,
|
RepayLoanRequestV2,
|
||||||
SpotAccountBill,
|
SpotAccountAssetV2,
|
||||||
|
SpotAccountBillV2,
|
||||||
|
SpotAccountInfoV2,
|
||||||
SpotAccountTypeV2,
|
SpotAccountTypeV2,
|
||||||
SpotBatchCancelOrderRequestV2,
|
SpotBatchCancelOrderRequestV2,
|
||||||
SpotBatchOrderRequestV2,
|
SpotBatchOrderRequestV2,
|
||||||
SpotCancelandSubmitOrderRequestV2,
|
SpotCancelandSubmitOrderRequestV2,
|
||||||
SpotCancelOrderRequestV2,
|
SpotCancelOrderRequestV2,
|
||||||
|
SpotCancelPlanOrdersV2,
|
||||||
SpotCandlesRequestV2,
|
SpotCandlesRequestV2,
|
||||||
|
SpotCandlestickV2,
|
||||||
|
SpotCoinInfoV2,
|
||||||
|
SpotCurrentPlanOrderV2,
|
||||||
|
SpotDepositAddressV2,
|
||||||
|
SpotDepositRecordV2,
|
||||||
|
SpotFillV2,
|
||||||
SpotFollowerCopyTradeSettingV2,
|
SpotFollowerCopyTradeSettingV2,
|
||||||
SpotFundFlowV2,
|
SpotFundFlowV2,
|
||||||
SpotHistoricCandlesRequestV2,
|
SpotHistoricCandlesRequestV2,
|
||||||
SpotHistoricTradesRequestV2,
|
SpotHistoricTradesRequestV2,
|
||||||
SpotMainSubTransferRecordRequestV2,
|
SpotMainSubTransferRecordRequestV2,
|
||||||
|
SpotMainSubTransferRecordV2,
|
||||||
|
SpotMergeDepthV2,
|
||||||
SpotModifyPlanOrderRequestV2,
|
SpotModifyPlanOrderRequestV2,
|
||||||
|
SpotOpenOrderV2,
|
||||||
|
SpotOrderBookDepthV2,
|
||||||
|
SpotOrderInfoV2,
|
||||||
SpotOrderRequestV2,
|
SpotOrderRequestV2,
|
||||||
SpotPlanOrderRequestV2,
|
SpotPlanOrderRequestV2,
|
||||||
|
SpotPlanSubOrderV2,
|
||||||
|
SpotSubAccountAssetsV2,
|
||||||
|
SpotSubAccountDepositRecordV2,
|
||||||
SpotSubAccountTransferRequestV2,
|
SpotSubAccountTransferRequestV2,
|
||||||
|
SpotSymbolInfoV2,
|
||||||
|
SpotTickerV2,
|
||||||
|
SpotTradeV2,
|
||||||
SpotTransactionRecordV2,
|
SpotTransactionRecordV2,
|
||||||
|
SpotTransferRecordV2,
|
||||||
SpotTransferRequestV2,
|
SpotTransferRequestV2,
|
||||||
|
SpotVipFeeRateV2,
|
||||||
SpotWhaleNetFlowV2,
|
SpotWhaleNetFlowV2,
|
||||||
|
SpotWithdrawalRecordV2,
|
||||||
SpotWithdrawalRequestV2,
|
SpotWithdrawalRequestV2,
|
||||||
SubAccountApiKeyListV2,
|
SubAccountApiKeyListV2,
|
||||||
SubDepositRecordsRequestV2,
|
SubDepositRecordsRequestV2,
|
||||||
|
SubmitSpotBatchOrdersResponseV2,
|
||||||
SubWithdrawalRecordsRequestV2,
|
SubWithdrawalRecordsRequestV2,
|
||||||
SubWithdrawalRequestV2,
|
SubWithdrawalRequestV2,
|
||||||
UpdateFuturesFollowerSettingsRequestV2,
|
UpdateFuturesFollowerSettingsRequestV2,
|
||||||
@@ -596,19 +621,25 @@ export class RestClientV2 extends BaseRestClient {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
getSpotCoinInfo(params?: { coin?: string }): Promise<APIResponse<any>> {
|
getSpotCoinInfo(params?: {
|
||||||
|
coin?: string;
|
||||||
|
}): Promise<APIResponse<SpotCoinInfoV2[]>> {
|
||||||
return this.getPrivate('/api/v2/spot/public/coins', params);
|
return this.getPrivate('/api/v2/spot/public/coins', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotSymbolInfo(params?: { symbol?: string }): Promise<APIResponse<any>> {
|
getSpotSymbolInfo(params?: {
|
||||||
|
symbol?: string;
|
||||||
|
}): Promise<APIResponse<SpotSymbolInfoV2[]>> {
|
||||||
return this.getPrivate('/api/v2/spot/public/symbols', params);
|
return this.getPrivate('/api/v2/spot/public/symbols', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotVIPFeeRate(): Promise<APIResponse<any>> {
|
getSpotVIPFeeRate(): Promise<APIResponse<SpotVipFeeRateV2[]>> {
|
||||||
return this.getPrivate('/api/v2/spot/market/vip-fee-rate');
|
return this.getPrivate('/api/v2/spot/market/vip-fee-rate');
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotTicker(params?: { symbol?: string }): Promise<APIResponse<any>> {
|
getSpotTicker(params?: {
|
||||||
|
symbol?: string;
|
||||||
|
}): Promise<APIResponse<SpotTickerV2[]>> {
|
||||||
return this.getPrivate('/api/v2/spot/market/tickers', params);
|
return this.getPrivate('/api/v2/spot/market/tickers', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -616,7 +647,7 @@ export class RestClientV2 extends BaseRestClient {
|
|||||||
symbol: string;
|
symbol: string;
|
||||||
precision?: string;
|
precision?: string;
|
||||||
limit?: string;
|
limit?: string;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<SpotMergeDepthV2>> {
|
||||||
return this.getPrivate('/api/v2/spot/market/merge-depth', params);
|
return this.getPrivate('/api/v2/spot/market/merge-depth', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -624,30 +655,32 @@ export class RestClientV2 extends BaseRestClient {
|
|||||||
symbol: string;
|
symbol: string;
|
||||||
type?: string;
|
type?: string;
|
||||||
limit?: string;
|
limit?: string;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<SpotOrderBookDepthV2>> {
|
||||||
return this.getPrivate('/api/v2/spot/market/orderbook', params);
|
return this.getPrivate('/api/v2/spot/market/orderbook', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotCandles(params: SpotCandlesRequestV2): Promise<APIResponse<any>> {
|
getSpotCandles(
|
||||||
|
params: SpotCandlesRequestV2,
|
||||||
|
): Promise<APIResponse<SpotCandlestickV2[]>> {
|
||||||
return this.getPrivate('/api/v2/spot/market/candles', params);
|
return this.getPrivate('/api/v2/spot/market/candles', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotHistoricCandles(
|
getSpotHistoricCandles(
|
||||||
params: SpotHistoricCandlesRequestV2,
|
params: SpotHistoricCandlesRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<SpotCandlestickV2[]>> {
|
||||||
return this.getPrivate('/api/v2/spot/market/history-candles', params);
|
return this.getPrivate('/api/v2/spot/market/history-candles', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotRecentTrades(params: {
|
getSpotRecentTrades(params: {
|
||||||
symbol: string;
|
symbol: string;
|
||||||
limit?: string;
|
limit?: string;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<SpotTradeV2[]>> {
|
||||||
return this.getPrivate('/api/v2/spot/market/fills', params);
|
return this.getPrivate('/api/v2/spot/market/fills', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotHistoricTrades(
|
getSpotHistoricTrades(
|
||||||
params: SpotHistoricTradesRequestV2,
|
params: SpotHistoricTradesRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<SpotTradeV2[]>> {
|
||||||
return this.getPrivate('/api/v2/spot/market/fills-history', params);
|
return this.getPrivate('/api/v2/spot/market/fills-history', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -657,62 +690,80 @@ export class RestClientV2 extends BaseRestClient {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
spotSubmitOrder(params: SpotOrderRequestV2): Promise<APIResponse<any>> {
|
spotSubmitOrder(params: SpotOrderRequestV2): Promise<
|
||||||
|
APIResponse<{
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
}>
|
||||||
|
> {
|
||||||
return this.postPrivate('/api/v2/spot/trade/place-order', params);
|
return this.postPrivate('/api/v2/spot/trade/place-order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
spotCancelandSubmitOrder(
|
spotCancelandSubmitOrder(
|
||||||
params: SpotCancelandSubmitOrderRequestV2,
|
params: SpotCancelandSubmitOrderRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<CancelAndSubmitSpotOrderResponseV2>> {
|
||||||
return this.postPrivate('/api/v2/spot/trade/cancel-replace-order', params);
|
return this.postPrivate('/api/v2/spot/trade/cancel-replace-order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
spotBatchCancelandSubmitOrder(params: {
|
spotBatchCancelandSubmitOrder(params: {
|
||||||
orderList: SpotCancelandSubmitOrderRequestV2[];
|
orderList: SpotCancelandSubmitOrderRequestV2[];
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<CancelAndSubmitSpotOrderResponseV2[]>> {
|
||||||
return this.postPrivate(
|
return this.postPrivate(
|
||||||
'/api/v2/spot/trade/batch-cancel-replace-order',
|
'/api/v2/spot/trade/batch-cancel-replace-order',
|
||||||
params,
|
params,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
spotCancelOrder(params: SpotCancelOrderRequestV2): Promise<APIResponse<any>> {
|
spotCancelOrder(params: SpotCancelOrderRequestV2): Promise<
|
||||||
|
APIResponse<{
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
}>
|
||||||
|
> {
|
||||||
return this.postPrivate('/api/v2/spot/trade/cancel-order', params);
|
return this.postPrivate('/api/v2/spot/trade/cancel-order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
spotBatchSubmitOrders(
|
spotBatchSubmitOrders(
|
||||||
params: SpotBatchOrderRequestV2,
|
params: SpotBatchOrderRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<SubmitSpotBatchOrdersResponseV2>> {
|
||||||
return this.postPrivate('/api/v2/spot/trade/batch-orders', params);
|
return this.postPrivate('/api/v2/spot/trade/batch-orders', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
spotBatchCancelOrders(
|
spotBatchCancelOrders(
|
||||||
params: SpotBatchCancelOrderRequestV2,
|
params: SpotBatchCancelOrderRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<SubmitSpotBatchOrdersResponseV2>> {
|
||||||
return this.postPrivate('/api/v2/spot/trade/batch-cancel-order', params);
|
return this.postPrivate('/api/v2/spot/trade/batch-cancel-order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
spotCancelSymbolOrder(params: { symbol: string }): Promise<APIResponse<any>> {
|
spotCancelSymbolOrder(params: { symbol: string }): Promise<
|
||||||
|
APIResponse<{
|
||||||
|
symbol: string;
|
||||||
|
}>
|
||||||
|
> {
|
||||||
return this.postPrivate('/api/v2/spot/trade/cancel-symbol-order', params);
|
return this.postPrivate('/api/v2/spot/trade/cancel-symbol-order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotOrder(params?: GetSpotOrderInfoRequestV2): Promise<APIResponse<any>> {
|
getSpotOrder(
|
||||||
|
params?: GetSpotOrderInfoRequestV2,
|
||||||
|
): Promise<APIResponse<SpotOrderInfoV2[]>> {
|
||||||
return this.getPrivate('/api/v2/spot/trade/orderInfo', params);
|
return this.getPrivate('/api/v2/spot/trade/orderInfo', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotOpenOrders(
|
getSpotOpenOrders(
|
||||||
params?: GetSpotOpenOrdersRequestV2,
|
params?: GetSpotOpenOrdersRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<SpotOpenOrderV2[]>> {
|
||||||
return this.getPrivate('/api/v2/spot/trade/unfilled-orders', params);
|
return this.getPrivate('/api/v2/spot/trade/unfilled-orders', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotHistoricOrders(
|
getSpotHistoricOrders(
|
||||||
params?: GetSpotHistoryOrdersRequestV2,
|
params?: GetSpotHistoryOrdersRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<SpotOrderInfoV2[]>> {
|
||||||
return this.getPrivate('/api/v2/spot/trade/history-orders', params);
|
return this.getPrivate('/api/v2/spot/trade/history-orders', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotFills(params: GetSpotFillsRequestV2): Promise<APIResponse<any>> {
|
getSpotFills(
|
||||||
|
params: GetSpotFillsRequestV2,
|
||||||
|
): Promise<APIResponse<SpotFillV2[]>> {
|
||||||
return this.getPrivate('/api/v2/spot/trade/fills', params);
|
return this.getPrivate('/api/v2/spot/trade/fills', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -722,46 +773,56 @@ export class RestClientV2 extends BaseRestClient {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
spotSubmitPlanOrder(
|
spotSubmitPlanOrder(params: SpotPlanOrderRequestV2): Promise<
|
||||||
params: SpotPlanOrderRequestV2,
|
APIResponse<{
|
||||||
): Promise<APIResponse<any>> {
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
}>
|
||||||
|
> {
|
||||||
return this.postPrivate('/api/v2/spot/trade/place-plan-order', params);
|
return this.postPrivate('/api/v2/spot/trade/place-plan-order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
spotModifyPlanOrder(
|
spotModifyPlanOrder(params: SpotModifyPlanOrderRequestV2): Promise<
|
||||||
params: SpotModifyPlanOrderRequestV2,
|
APIResponse<{
|
||||||
): Promise<APIResponse<any>> {
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
}>
|
||||||
|
> {
|
||||||
return this.postPrivate('/api/v2/spot/trade/modify-plan-order', params);
|
return this.postPrivate('/api/v2/spot/trade/modify-plan-order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
spotCancelPlanOrder(params: {
|
spotCancelPlanOrder(params: {
|
||||||
clientOid?: string;
|
clientOid?: string;
|
||||||
orderId?: string;
|
orderId?: string;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<
|
||||||
|
APIResponse<{
|
||||||
|
result: string;
|
||||||
|
}>
|
||||||
|
> {
|
||||||
return this.postPrivate('/api/v2/spot/trade/cancel-plan-order', params);
|
return this.postPrivate('/api/v2/spot/trade/cancel-plan-order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotCurrentPlanOrders(
|
getSpotCurrentPlanOrders(
|
||||||
params: GetSpotCurrentPlanOrdersRequestV2,
|
params: GetSpotCurrentPlanOrdersRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<SpotCurrentPlanOrderV2>> {
|
||||||
return this.getPrivate('/api/v2/spot/trade/current-plan-order', params);
|
return this.getPrivate('/api/v2/spot/trade/current-plan-order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotPlanSubOrder(params: {
|
getSpotPlanSubOrder(params: {
|
||||||
planOrderId: string;
|
planOrderId: string;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<SpotPlanSubOrderV2[]>> {
|
||||||
return this.getPrivate('/api/v2/spot/trade/plan-sub-order', params);
|
return this.getPrivate('/api/v2/spot/trade/plan-sub-order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotHistoricPlanOrders(
|
getSpotHistoricPlanOrders(
|
||||||
params: GetSpotHistoryPlanOrdersRequestV2,
|
params: GetSpotHistoryPlanOrdersRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<SpotCurrentPlanOrderV2>> {
|
||||||
return this.getPrivate('/api/v2/spot/trade/history-plan-order', params);
|
return this.getPrivate('/api/v2/spot/trade/history-plan-order', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
spotCancelPlanOrders(params?: {
|
spotCancelPlanOrders(params?: {
|
||||||
symbolList?: string[];
|
symbolList?: string[];
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<SpotCancelPlanOrdersV2>> {
|
||||||
return this.postPrivate(
|
return this.postPrivate(
|
||||||
'/api/v2/spot/trade/batch-cancel-plan-order',
|
'/api/v2/spot/trade/batch-cancel-plan-order',
|
||||||
params,
|
params,
|
||||||
@@ -774,25 +835,25 @@ export class RestClientV2 extends BaseRestClient {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
getSpotAccount(): Promise<APIResponse<any>> {
|
getSpotAccount(): Promise<APIResponse<SpotAccountInfoV2>> {
|
||||||
return this.getPrivate('/api/v2/spot/account/info');
|
return this.getPrivate('/api/v2/spot/account/info');
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotAccountAssets(params?: {
|
getSpotAccountAssets(params?: {
|
||||||
coin?: string;
|
coin?: string;
|
||||||
assetType?: string;
|
assetType?: string;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<SpotAccountAssetV2[]>> {
|
||||||
return this.getPrivate('/api/v2/spot/account/assets', params);
|
return this.getPrivate('/api/v2/spot/account/assets', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotSubAccountAssets(): Promise<APIResponse<any>> {
|
getSpotSubAccountAssets(): Promise<APIResponse<SpotSubAccountAssetsV2[]>> {
|
||||||
return this.getPrivate('/api/v2/spot/account/subaccount-assets');
|
return this.getPrivate('/api/v2/spot/account/subaccount-assets');
|
||||||
}
|
}
|
||||||
|
|
||||||
spotModifyDepositAccount(params: {
|
spotModifyDepositAccount(params: {
|
||||||
accountType: string;
|
accountType: string;
|
||||||
coin: string;
|
coin: string;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<string>> {
|
||||||
return this.postPrivate(
|
return this.postPrivate(
|
||||||
'/api/v2/spot/wallet/modify-deposit-account',
|
'/api/v2/spot/wallet/modify-deposit-account',
|
||||||
params,
|
params,
|
||||||
@@ -801,34 +862,47 @@ export class RestClientV2 extends BaseRestClient {
|
|||||||
|
|
||||||
getSpotAccountBills(
|
getSpotAccountBills(
|
||||||
params?: GetSpotAccountBillsRequestV2,
|
params?: GetSpotAccountBillsRequestV2,
|
||||||
): Promise<APIResponse<SpotAccountBill[]>> {
|
): Promise<APIResponse<SpotAccountBillV2[]>> {
|
||||||
return this.getPrivate('/api/v2/spot/account/bills', params);
|
return this.getPrivate('/api/v2/spot/account/bills', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
spotTransfer(params: SpotTransferRequestV2): Promise<APIResponse<any>> {
|
spotTransfer(params: SpotTransferRequestV2): Promise<
|
||||||
|
APIResponse<{
|
||||||
|
transferId: string;
|
||||||
|
clientOid: string;
|
||||||
|
}>
|
||||||
|
> {
|
||||||
return this.postPrivate('/api/v2/spot/wallet/transfer', params);
|
return this.postPrivate('/api/v2/spot/wallet/transfer', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotTransferableCoins(params: {
|
getSpotTransferableCoins(params: {
|
||||||
fromType: SpotAccountTypeV2;
|
fromType: SpotAccountTypeV2;
|
||||||
toType: SpotAccountTypeV2;
|
toType: SpotAccountTypeV2;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<string[]>> {
|
||||||
return this.getPrivate('/api/v2/spot/wallet/transfer-coin-info', params);
|
return this.getPrivate('/api/v2/spot/wallet/transfer-coin-info', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
spotSubTransfer(
|
spotSubTransfer(params: SpotSubAccountTransferRequestV2): Promise<
|
||||||
params: SpotSubAccountTransferRequestV2,
|
APIResponse<{
|
||||||
): Promise<APIResponse<any>> {
|
transferId: string;
|
||||||
|
clientOid: string;
|
||||||
|
}>
|
||||||
|
> {
|
||||||
return this.postPrivate('/api/v2/spot/wallet/subaccount-transfer', params);
|
return this.postPrivate('/api/v2/spot/wallet/subaccount-transfer', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
spotWithdraw(params: SpotWithdrawalRequestV2): Promise<APIResponse<any>> {
|
spotWithdraw(params: SpotWithdrawalRequestV2): Promise<
|
||||||
|
APIResponse<{
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
}>
|
||||||
|
> {
|
||||||
return this.postPrivate('/api/v2/spot/wallet/withdrawal', params);
|
return this.postPrivate('/api/v2/spot/wallet/withdrawal', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotMainSubTransferRecord(
|
getSpotMainSubTransferRecord(
|
||||||
params: SpotMainSubTransferRecordRequestV2,
|
params: SpotMainSubTransferRecordRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<SpotMainSubTransferRecordV2[]>> {
|
||||||
return this.getPrivate(
|
return this.getPrivate(
|
||||||
'/api/v2/spot/account/sub-main-trans-record',
|
'/api/v2/spot/account/sub-main-trans-record',
|
||||||
params,
|
params,
|
||||||
@@ -837,11 +911,13 @@ export class RestClientV2 extends BaseRestClient {
|
|||||||
|
|
||||||
getSpotTransferHistory(
|
getSpotTransferHistory(
|
||||||
params: GetSpotTransferRecordRequestV2,
|
params: GetSpotTransferRecordRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<SpotTransferRecordV2[]>> {
|
||||||
return this.getPrivate('/api/v2/spot/account/transferRecords', params);
|
return this.getPrivate('/api/v2/spot/account/transferRecords', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
spotSwitchBGBDeduct(params: { deduct: boolean }): Promise<APIResponse<any>> {
|
spotSwitchBGBDeduct(params: {
|
||||||
|
deduct: boolean;
|
||||||
|
}): Promise<APIResponse<boolean>> {
|
||||||
return this.postPrivate('/api/v2/spot/account/switch-deduct', params);
|
return this.postPrivate('/api/v2/spot/account/switch-deduct', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -849,7 +925,7 @@ export class RestClientV2 extends BaseRestClient {
|
|||||||
coin: string;
|
coin: string;
|
||||||
chain?: string;
|
chain?: string;
|
||||||
size: string;
|
size: string;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<SpotDepositAddressV2>> {
|
||||||
return this.getPrivate('/api/v2/spot/wallet/deposit-address', params);
|
return this.getPrivate('/api/v2/spot/wallet/deposit-address', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -858,42 +934,48 @@ export class RestClientV2 extends BaseRestClient {
|
|||||||
coin: string;
|
coin: string;
|
||||||
chain?: string;
|
chain?: string;
|
||||||
size: string;
|
size: string;
|
||||||
}): Promise<APIResponse<any>> {
|
}): Promise<APIResponse<SpotDepositAddressV2>> {
|
||||||
return this.getPrivate(
|
return this.getPrivate(
|
||||||
'/api/v2/spot/wallet/subaccount-deposit-address',
|
'/api/v2/spot/wallet/subaccount-deposit-address',
|
||||||
params,
|
params,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotBGBDeductInfo(): Promise<APIResponse<any>> {
|
getSpotBGBDeductInfo(): Promise<
|
||||||
|
APIResponse<{
|
||||||
|
deduct: string;
|
||||||
|
}>
|
||||||
|
> {
|
||||||
return this.getPrivate('/api/v2/spot/account/deduct-info');
|
return this.getPrivate('/api/v2/spot/account/deduct-info');
|
||||||
}
|
}
|
||||||
|
|
||||||
spotCancelWithdrawal(params: { orderId: string }): Promise<APIResponse<any>> {
|
spotCancelWithdrawal(params: {
|
||||||
|
orderId: string;
|
||||||
|
}): Promise<APIResponse<string>> {
|
||||||
return this.postPrivate('/api/v2/spot/wallet/cancel-withdrawal', params);
|
return this.postPrivate('/api/v2/spot/wallet/cancel-withdrawal', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSubAccountDepositRecords(
|
getSubAccountDepositRecords(
|
||||||
params: GetSpotSubAccountDepositRecordRequestV2,
|
params: GetSpotSubAccountDepositRecordRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<SpotSubAccountDepositRecordV2[]>> {
|
||||||
return this.getPrivate(
|
return this.getPrivate(
|
||||||
'/api/v2/spot/wallet/subaccount-deposit-records',
|
'/api/v2/spot/wallet/subaccount-deposit-records',
|
||||||
params,
|
params,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSpotDepositHistory(
|
|
||||||
params: GetSpotDepositRecordRequestV2,
|
|
||||||
): Promise<APIResponse<any>> {
|
|
||||||
return this.getPrivate('/api/v2/spot/wallet/deposit-records', params);
|
|
||||||
}
|
|
||||||
|
|
||||||
getSpotWithdrawalHistory(
|
getSpotWithdrawalHistory(
|
||||||
params: GetSpotWithdrawalRecordRequestV2,
|
params: GetSpotWithdrawalRecordRequestV2,
|
||||||
): Promise<APIResponse<any>> {
|
): Promise<APIResponse<SpotWithdrawalRecordV2[]>> {
|
||||||
return this.getPrivate('/api/v2/spot/wallet/withdrawal-records', params);
|
return this.getPrivate('/api/v2/spot/wallet/withdrawal-records', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getSpotDepositHistory(
|
||||||
|
params: GetSpotDepositRecordRequestV2,
|
||||||
|
): Promise<APIResponse<SpotDepositRecordV2[]>> {
|
||||||
|
return this.getPrivate('/api/v2/spot/wallet/deposit-records', params);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ export * from './v1/futures';
|
|||||||
export * from './v1/shared';
|
export * from './v1/shared';
|
||||||
export * from './v1/spot';
|
export * from './v1/spot';
|
||||||
export * from './v2/common';
|
export * from './v2/common';
|
||||||
|
export * from './v2/spot';
|
||||||
|
|||||||
400
src/types/response/v2/spot.ts
Normal file
400
src/types/response/v2/spot.ts
Normal file
@@ -0,0 +1,400 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* * Spot | Market
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
export interface SpotCoinInfoV2 {
|
||||||
|
coinId: string;
|
||||||
|
coin: string;
|
||||||
|
transfer: boolean;
|
||||||
|
chains: {
|
||||||
|
chain: string;
|
||||||
|
needTag: boolean;
|
||||||
|
withdrawable: boolean;
|
||||||
|
rechargeable: boolean;
|
||||||
|
withdrawFee: string;
|
||||||
|
extraWithdrawFee: string;
|
||||||
|
depositConfirm: string;
|
||||||
|
withdrawConfirm: string;
|
||||||
|
minDepositAmount: string;
|
||||||
|
minWithdrawAmount: string;
|
||||||
|
browserUrl: string;
|
||||||
|
contractAddress: string;
|
||||||
|
withdrawStep: string;
|
||||||
|
withdrawMinScale: string;
|
||||||
|
congestion: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotSymbolInfoV2 {
|
||||||
|
symbol: string;
|
||||||
|
baseCoin: string;
|
||||||
|
quoteCoin: string;
|
||||||
|
minTradeAmount: string;
|
||||||
|
maxTradeAmount: string;
|
||||||
|
takerFeeRate: string;
|
||||||
|
makerFeeRate: string;
|
||||||
|
pricePrecision: string;
|
||||||
|
quantityPrecision: string;
|
||||||
|
quotePrecision: string;
|
||||||
|
minTradeUSDT: string;
|
||||||
|
status: string;
|
||||||
|
buyLimitPriceRatio: string;
|
||||||
|
sellLimitPriceRatio: string;
|
||||||
|
orderQuantity: string;
|
||||||
|
areaSymbol: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotVipFeeRateV2 {
|
||||||
|
level: number;
|
||||||
|
dealAmount: string;
|
||||||
|
assetAmount: string;
|
||||||
|
takerFeeRate: string;
|
||||||
|
makerFeeRate: string;
|
||||||
|
btcWithdrawAmount: string;
|
||||||
|
usdtWithdrawAmount: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotTickerV2 {
|
||||||
|
symbol: string;
|
||||||
|
high24h: string;
|
||||||
|
open: string;
|
||||||
|
low24h: string;
|
||||||
|
lastPr: string;
|
||||||
|
quoteVolume: string;
|
||||||
|
baseVolume: string;
|
||||||
|
usdtVolume: string;
|
||||||
|
bidPr: string;
|
||||||
|
askPr: string;
|
||||||
|
bidSz: string;
|
||||||
|
askSz: string;
|
||||||
|
openUtc: string;
|
||||||
|
ts: string;
|
||||||
|
changeUtc24h: string;
|
||||||
|
change24h: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotMergeDepthV2 {
|
||||||
|
asks: [string, string][];
|
||||||
|
bids: [string, string][];
|
||||||
|
ts: string;
|
||||||
|
scale: string;
|
||||||
|
precision: string;
|
||||||
|
isMaxPrecision: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotOrderBookDepthV2 {
|
||||||
|
asks: [string, string][];
|
||||||
|
bids: [string, string][];
|
||||||
|
ts: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotCandlestickV2 {
|
||||||
|
[0]: string; // timestamp
|
||||||
|
[1]: string; // open
|
||||||
|
[2]: string; // high
|
||||||
|
[3]: string; // low
|
||||||
|
[4]: string; // close
|
||||||
|
[5]: string; // baseVolume
|
||||||
|
[6]: string; // usdtVolume
|
||||||
|
[7]: string; // quoteVolume
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotTradeV2 {
|
||||||
|
symbol: string;
|
||||||
|
tradeId: string;
|
||||||
|
side: string;
|
||||||
|
price: string;
|
||||||
|
size: string;
|
||||||
|
ts: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* * Spot | Trade
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
export interface CancelAndSubmitSpotOrderResponseV2 {
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string | null;
|
||||||
|
success: string;
|
||||||
|
msg: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SubmitSpotBatchOrdersResponseV2 {
|
||||||
|
successList: {
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
}[];
|
||||||
|
failureList: {
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
errorMsg: string;
|
||||||
|
errorCode?: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotOrderInfoV2 {
|
||||||
|
userId: string;
|
||||||
|
symbol: string;
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
price: string;
|
||||||
|
size: string;
|
||||||
|
orderType: string;
|
||||||
|
side: string;
|
||||||
|
status: string;
|
||||||
|
priceAvg: string;
|
||||||
|
baseVolume: string;
|
||||||
|
quoteVolume: string;
|
||||||
|
enterPointSource: string;
|
||||||
|
feeDetail: {
|
||||||
|
BGB?: {
|
||||||
|
deduction: boolean;
|
||||||
|
feeCoinCode: string;
|
||||||
|
totalDeductionFee: string;
|
||||||
|
totalFee: string;
|
||||||
|
};
|
||||||
|
newFees?: {
|
||||||
|
c: number;
|
||||||
|
d: number;
|
||||||
|
deduction: boolean;
|
||||||
|
r: string;
|
||||||
|
t: string;
|
||||||
|
totalDeductionFee: number;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
orderSource: string;
|
||||||
|
cancelReason: string;
|
||||||
|
cTime: string;
|
||||||
|
uTime: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotOpenOrderV2 {
|
||||||
|
userId: string;
|
||||||
|
symbol: string;
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
priceAvg: string;
|
||||||
|
size: string;
|
||||||
|
orderType: string;
|
||||||
|
side: string;
|
||||||
|
status: string;
|
||||||
|
basePrice: string;
|
||||||
|
baseVolume: string;
|
||||||
|
quoteVolume: string;
|
||||||
|
enterPointSource: string;
|
||||||
|
orderSource?: string;
|
||||||
|
presetTakeProfitPrice: string;
|
||||||
|
executeTakeProfitPrice: string;
|
||||||
|
presetStopLossPrice: string;
|
||||||
|
executeStopLossPrice: string;
|
||||||
|
cTime: string;
|
||||||
|
uTime?: string;
|
||||||
|
tpslType: string;
|
||||||
|
triggerPrice: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotFillV2 {
|
||||||
|
userId: string;
|
||||||
|
symbol: string;
|
||||||
|
orderId: string;
|
||||||
|
tradeId: string;
|
||||||
|
orderType: string;
|
||||||
|
side: string;
|
||||||
|
priceAvg: string;
|
||||||
|
size: string;
|
||||||
|
amount: string;
|
||||||
|
feeDetail: {
|
||||||
|
deduction: string;
|
||||||
|
feeCoin: string;
|
||||||
|
totalDeductionFee: string;
|
||||||
|
totalFee: string;
|
||||||
|
};
|
||||||
|
tradeScope: string;
|
||||||
|
cTime: string;
|
||||||
|
uTime: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* * Spot | Trigger Orders
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
export interface SpotCurrentPlanOrderV2 {
|
||||||
|
nextFlag: boolean;
|
||||||
|
idLessThan: string;
|
||||||
|
orderList: {
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
symbol: string;
|
||||||
|
size: string;
|
||||||
|
executePrice: string;
|
||||||
|
triggerPrice: string;
|
||||||
|
status: string;
|
||||||
|
orderType: string;
|
||||||
|
side: string;
|
||||||
|
planType: string;
|
||||||
|
triggerType: string;
|
||||||
|
enterPointSource: string;
|
||||||
|
uTime: string;
|
||||||
|
cTime: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotPlanSubOrderV2 {
|
||||||
|
orderId: string;
|
||||||
|
price: string;
|
||||||
|
type: string;
|
||||||
|
status: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotCancelPlanOrdersV2 {
|
||||||
|
successList: {
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
}[];
|
||||||
|
failureList: {
|
||||||
|
orderId: string;
|
||||||
|
clientOid: string;
|
||||||
|
errorMsg: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* * Spot | Account
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
export interface SpotAccountInfoV2 {
|
||||||
|
userId: string;
|
||||||
|
inviterId: string;
|
||||||
|
ips: string;
|
||||||
|
authorities: string[];
|
||||||
|
parentId: number;
|
||||||
|
traderType: string;
|
||||||
|
channelCode: string;
|
||||||
|
channel: string;
|
||||||
|
regisTime: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotAccountAssetV2 {
|
||||||
|
coin: string;
|
||||||
|
available: string;
|
||||||
|
frozen: string;
|
||||||
|
locked: string;
|
||||||
|
limitAvailable: string;
|
||||||
|
uTime: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotSubAccountAssetsV2 {
|
||||||
|
userId: number;
|
||||||
|
assetsList: {
|
||||||
|
coin: string;
|
||||||
|
available: string;
|
||||||
|
limitAvailable: string;
|
||||||
|
frozen: string;
|
||||||
|
locked: string;
|
||||||
|
uTime: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotAccountBillV2 {
|
||||||
|
cTime: string;
|
||||||
|
coin: string;
|
||||||
|
groupType: string;
|
||||||
|
businessType: string;
|
||||||
|
size: string;
|
||||||
|
balance: string;
|
||||||
|
fees: string;
|
||||||
|
billId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotMainSubTransferRecordV2 {
|
||||||
|
coin: string;
|
||||||
|
status: string;
|
||||||
|
toType: string;
|
||||||
|
fromType: string;
|
||||||
|
size: string;
|
||||||
|
ts: string;
|
||||||
|
clientOid: string;
|
||||||
|
transferId: string;
|
||||||
|
fromUserId: string;
|
||||||
|
toUserId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotTransferRecordV2 {
|
||||||
|
coin: string;
|
||||||
|
status: string;
|
||||||
|
toType: string;
|
||||||
|
toSymbol: string;
|
||||||
|
fromType: string;
|
||||||
|
fromSymbol: string;
|
||||||
|
size: string;
|
||||||
|
ts: string;
|
||||||
|
clientOid: string;
|
||||||
|
transferId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotDepositAddressV2 {
|
||||||
|
address: string;
|
||||||
|
chain: string;
|
||||||
|
coin: string;
|
||||||
|
tag: string;
|
||||||
|
url: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotSubAccountDepositRecordV2 {
|
||||||
|
orderId: string;
|
||||||
|
tradeId: string;
|
||||||
|
coin: string;
|
||||||
|
size: string;
|
||||||
|
status: string;
|
||||||
|
toAddress: string;
|
||||||
|
dest: string;
|
||||||
|
chain: string;
|
||||||
|
fromAddress: string;
|
||||||
|
clientOid?: string;
|
||||||
|
confirm?: string;
|
||||||
|
tag?: string;
|
||||||
|
cTime: string;
|
||||||
|
uTime: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotWithdrawalRecordV2 {
|
||||||
|
orderId: string;
|
||||||
|
tradeId: string;
|
||||||
|
coin: string;
|
||||||
|
dest: string;
|
||||||
|
clientOid: string;
|
||||||
|
type: string;
|
||||||
|
tag: string;
|
||||||
|
size: string;
|
||||||
|
fee: string;
|
||||||
|
status: string;
|
||||||
|
toAddress: string;
|
||||||
|
fromAddress: string;
|
||||||
|
confirm: string;
|
||||||
|
chain: string;
|
||||||
|
cTime: string;
|
||||||
|
uTime: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpotDepositRecordV2 {
|
||||||
|
orderId: string;
|
||||||
|
tradeId: string;
|
||||||
|
coin: string;
|
||||||
|
type: string;
|
||||||
|
size: string;
|
||||||
|
status: string;
|
||||||
|
toAddress: string;
|
||||||
|
dest: string;
|
||||||
|
chain: string;
|
||||||
|
fromAddress: string;
|
||||||
|
cTime: string;
|
||||||
|
uTime: string;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user