diff --git a/src/types/request/v5-trade.ts b/src/types/request/v5-trade.ts index 76aad5a..047e92f 100644 --- a/src/types/request/v5-trade.ts +++ b/src/types/request/v5-trade.ts @@ -19,6 +19,8 @@ export interface OrderParamsV5 { orderType: OrderTypeV5; qty: string; marketUnit?: 'baseCoin' | 'quoteCoin'; + slippageToleranceType?: string; + slippageTolerance?: string; price?: string; triggerDirection?: 1 | 2; orderFilter?: OrderFilterV5; diff --git a/src/types/response/v5-trade.ts b/src/types/response/v5-trade.ts index 454823d..f7eba1a 100644 --- a/src/types/response/v5-trade.ts +++ b/src/types/response/v5-trade.ts @@ -42,6 +42,8 @@ export interface AccountOrderV5 { stopOrderType: StopOrderTypeV5; orderIv: string; marketUnit: 'baseCoin' | 'quoteCoin'; + slippageToleranceType: string; + slippageTolerance: string; triggerPrice: string; takeProfit: string; stopLoss: string; diff --git a/src/util/BaseRestClient.ts b/src/util/BaseRestClient.ts index fb34e64..d7e639a 100644 --- a/src/util/BaseRestClient.ts +++ b/src/util/BaseRestClient.ts @@ -64,6 +64,7 @@ interface SignedRequest { interface UnsignedRequest { originalParams: T; paramsWithSign: T; + serializedParams: string; sign?: string; timestamp?: number; recvWindow?: number; @@ -276,7 +277,9 @@ export default abstract class BaseRestClient { return { ...options, headers, - params: signResult.originalParams, + url: signResult.serializedParams + ? options.url + '?' + signResult.serializedParams + : options.url, }; } diff --git a/test/v5/private.read.test.ts b/test/v5/private.read.test.ts index b84d47d..abb8625 100644 --- a/test/v5/private.read.test.ts +++ b/test/v5/private.read.test.ts @@ -188,7 +188,35 @@ describe('Private READ V5 REST API Endpoints', () => { accountType: accountType, coin: settleCoin, }), - ).toMatchObject({ ...successResponseObjectV3() }); + ).toMatchObject({ + ...successResponseObjectV3(), + // retMsg: '', + }); + }); + + it('getAllCoinsBalance() unified with one symbol', async () => { + const result = await api.getAllCoinsBalance({ + accountType: 'UNIFIED', + coin: 'USDT', + }); + + if (result.retCode !== 0) { + console.error(expect.getState().currentTestName, 'exception: ', result); + } + + expect(result).toMatchObject({ ...successResponseObjectV3() }); + }); + + it('getAllCoinsBalance() unified with multiple symbols', async () => { + const result = await api.getAllCoinsBalance({ + accountType: 'UNIFIED', + coin: 'USDT,ETH', + }); + + if (result.retCode !== 0) { + console.error(expect.getState().currentTestName, 'exception: ', result); + } + expect(result).toMatchObject({ ...successResponseObjectV3() }); }); it('getTransferableCoinList()', async () => {