diff --git a/.github/workflows/e2etest.yml b/.github/workflows/e2etest.yml index 38ef71c..e50548c 100644 --- a/.github/workflows/e2etest.yml +++ b/.github/workflows/e2etest.yml @@ -1,16 +1,20 @@ -name: 'Build & Test' +name: E2ETests -on: [push] +on: + push: + pull_request: + workflow_dispatch: + +env: + PROXY_ENABLED: ${{ secrets.PROXY_ENABLED }} + PROXY_HOST: ${{ secrets.PROXY_HOST }} + PROXY_PASS: ${{ secrets.PROXY_PASS }} + PROXY_PORT: ${{ secrets.PROXY_PORT }} + PROXY_USER: ${{ secrets.PROXY_USER }} -# on: -# # pull_request: -# # branches: -# # - "master" -# push: -# branches: jobs: - build: + E2ETests: name: 'Build & Test' runs-on: ubuntu-latest @@ -30,13 +34,20 @@ jobs: - name: Build run: npm run build - - name: Test - run: npm run test + - name: Test Public Read API Calls + run: npm run test -- public.read.test.ts + + - name: Test Private Read API Calls + run: npm run test -- private.read.test.ts env: API_KEY_COM: ${{ secrets.API_KEY_COM }} API_SECRET_COM: ${{ secrets.API_SECRET_COM }} - PROXY_ENABLED: ${{ secrets.PROXY_ENABLED }} - PROXY_HOST: ${{ secrets.PROXY_HOST }} - PROXY_PASS: ${{ secrets.PROXY_PASS }} - PROXY_PORT: ${{ secrets.PROXY_PORT }} - PROXY_USER: ${{ secrets.PROXY_USER }} + + - name: Test Private Write API Calls + run: npm run test -- private.write.test.ts + env: + API_KEY_COM: ${{ secrets.API_KEY_COM }} + API_SECRET_COM: ${{ secrets.API_SECRET_COM }} + + - name: Test Public WS + run: npm run test -- public.ws.test.ts diff --git a/src/rest-client-v5.ts b/src/rest-client-v5.ts index 0913f3e..b76b3fc 100644 --- a/src/rest-client-v5.ts +++ b/src/rest-client-v5.ts @@ -57,7 +57,7 @@ import { DeleteSubMemberParamsV5, DeliveryPriceV5, DeliveryRecordV5, - DepositAddressResultV5, + DepositAddressChainV5, DepositRecordV5, ExchangeBrokerAccountInfoV5, ExchangeBrokerEarningResultV5, @@ -1305,7 +1305,7 @@ export class RestClientV5 extends BaseRestClient { amount: string, fromAccountType: AccountTypeV5, toAccountType: AccountTypeV5, - ): Promise> { + ): Promise> { return this.postPrivate('/v5/asset/transfer/inter-transfer', { transferId, coin, @@ -1365,7 +1365,7 @@ export class RestClientV5 extends BaseRestClient { */ createUniversalTransfer( params: UniversalTransferParamsV5, - ): Promise> { + ): Promise> { return this.postPrivate('/v5/asset/transfer/universal-transfer', params); } @@ -1464,7 +1464,12 @@ export class RestClientV5 extends BaseRestClient { getMasterDepositAddress( coin: string, chainType?: string, - ): Promise> { + ): Promise< + APIResponseV3WithTime<{ + coin: string; + chains: DepositAddressChainV5[]; + }> + > { return this.getPrivate('/v5/asset/deposit/query-address', { coin, chainType, @@ -1478,7 +1483,12 @@ export class RestClientV5 extends BaseRestClient { coin: string, chainType: string, subMemberId: string, - ): Promise> { + ): Promise< + APIResponseV3WithTime<{ + coin: string; + chains: DepositAddressChainV5; + }> + > { return this.getPrivate('/v5/asset/deposit/query-sub-member-address', { coin, chainType, @@ -1488,6 +1498,7 @@ export class RestClientV5 extends BaseRestClient { /** * Query the deposit address information of SUB account. + * @deprecated Duplicate endpoint - Use getSubDepositAddress() instead * * CAUTION * Can use master UID's api key only @@ -1496,7 +1507,12 @@ export class RestClientV5 extends BaseRestClient { coin: string, chainType: string, subMemberId: string, - ): Promise> { + ): Promise< + APIResponseV3<{ + coin: string; + chains: DepositAddressChainV5; + }> + > { return this.getPrivate('/v5/asset/deposit/query-sub-member-address', { coin, chainType, diff --git a/src/types/request/v5-asset.ts b/src/types/request/v5-asset.ts index c7483d7..c981206 100644 --- a/src/types/request/v5-asset.ts +++ b/src/types/request/v5-asset.ts @@ -10,6 +10,8 @@ export interface GetCoinExchangeRecordParamsV5 { export interface GetDeliveryRecordParamsV5 { category: CategoryV5; symbol?: string; + startTime?: number; + endTime?: number; expDate?: string; limit?: number; cursor?: string;