feat(): finished asset category types

This commit is contained in:
JJ-Cro
2025-02-17 13:51:38 +01:00
parent d2f3e25ecc
commit 50a01d123e
3 changed files with 88 additions and 56 deletions

View File

@@ -191,6 +191,7 @@ import {
VipCollateralCoinsV5,
WalletBalanceV5,
WithdrawParamsV5,
WithdrawableAmountV5,
WithdrawalRecordV5,
} from './types';
@@ -1206,20 +1207,6 @@ export class RestClientV5 extends BaseRestClient {
*
*/
/**
* Query the coin exchange records.
*
* CAUTION: You may experience long delays with this endpoint.
*/
getCoinExchangeRecords(params?: GetCoinExchangeRecordParamsV5): Promise<
APIResponseV3WithTime<{
orderBody: CoinExchangeRecordV5[];
nextPageCursor?: string;
}>
> {
return this.getPrivate('/v5/asset/exchange/order-record', params);
}
/**
* Query option delivery records, sorted by deliveryTime in descending order.
*
@@ -1244,6 +1231,46 @@ export class RestClientV5 extends BaseRestClient {
return this.getPrivate('/v5/asset/settlement-record', params);
}
/**
* Query the coin exchange records.
*
* CAUTION: You may experience long delays with this endpoint.
*/
getCoinExchangeRecords(params?: GetCoinExchangeRecordParamsV5): Promise<
APIResponseV3WithTime<{
orderBody: CoinExchangeRecordV5[];
nextPageCursor?: string;
}>
> {
return this.getPrivate('/v5/asset/exchange/order-record', params);
}
/**
* Query coin information, including chain information, withdraw and deposit status.
*/
getCoinInfo(
coin?: string,
): Promise<APIResponseV3WithTime<{ rows: CoinInfoV5[] }>> {
return this.getPrivate(
'/v5/asset/coin/query-info',
coin ? { coin } : undefined,
);
}
/**
* Query the sub UIDs under a main UID
*
* CAUTION: Can query by the master UID's api key only
*/
getSubUID(): Promise<
APIResponseV3WithTime<{
subMemberIds: string[];
transferableSubMemberIds: string[];
}>
> {
return this.getPrivate('/v5/asset/transfer/query-sub-member-list');
}
/**
* Query asset information.
*
@@ -1284,6 +1311,15 @@ export class RestClientV5 extends BaseRestClient {
);
}
/**
* Query withdrawable amount.
*/
getWithdrawableAmount(params: {
coin: string;
}): Promise<APIResponseV3<{ rows: WithdrawableAmountV5[] }>> {
return this.getPrivate('/v5/asset/withdraw/withdrawable-amount', params);
}
/**
* Query the transferable coin list between each account type.
*/
@@ -1309,7 +1345,7 @@ export class RestClientV5 extends BaseRestClient {
amount: string,
fromAccountType: AccountTypeV5,
toAccountType: AccountTypeV5,
): Promise<APIResponseV3WithTime<{ transferId: string }>> {
): Promise<APIResponseV3WithTime<{ transferId: string; status: string }>> {
return this.postPrivate('/v5/asset/transfer/inter-transfer', {
transferId,
coin,
@@ -1331,20 +1367,6 @@ export class RestClientV5 extends BaseRestClient {
);
}
/**
* Query the sub UIDs under a main UID
*
* CAUTION: Can query by the master UID's api key only
*/
getSubUID(): Promise<
APIResponseV3WithTime<{
subMemberIds: string[];
transferableSubMemberIds: string[];
}>
> {
return this.getPrivate('/v5/asset/transfer/query-sub-member-list');
}
/**
* Enable Universal Transfer for Sub UID
*
@@ -1369,7 +1391,7 @@ export class RestClientV5 extends BaseRestClient {
*/
createUniversalTransfer(
params: UniversalTransferParamsV5,
): Promise<APIResponseV3WithTime<{ transferId: string }>> {
): Promise<APIResponseV3WithTime<{ transferId: string; status: string }>> {
return this.postPrivate('/v5/asset/transfer/universal-transfer', params);
}
@@ -1400,7 +1422,7 @@ export class RestClientV5 extends BaseRestClient {
nextPageCursor: string;
}>
> {
return this.get('/v5/asset/deposit/query-allowed-list', params);
return this.getPrivate('/v5/asset/deposit/query-allowed-list', params);
}
/**
@@ -1491,6 +1513,7 @@ export class RestClientV5 extends BaseRestClient {
}
/**
* @deprecated - duplicate function, use getSubDepositAddress() instead
* Query the deposit address information of SUB account.
*
* CAUTION
@@ -1508,18 +1531,6 @@ export class RestClientV5 extends BaseRestClient {
});
}
/**
* Query coin information, including chain information, withdraw and deposit status.
*/
getCoinInfo(
coin?: string,
): Promise<APIResponseV3WithTime<{ rows: CoinInfoV5[] }>> {
return this.getPrivate(
'/v5/asset/coin/query-info',
coin ? { coin } : undefined,
);
}
/**
* Query withdrawal records.
*/
@@ -1529,15 +1540,6 @@ export class RestClientV5 extends BaseRestClient {
return this.getPrivate('/v5/asset/withdraw/query-record', params);
}
/**
* Query withdrawable amount.
*/
getWithdrawableAmount(params: {
coin: string;
}): Promise<APIResponseV3<{ rows: WithdrawalRecordV5[] }>> {
return this.getPrivate('/v5/asset/withdraw/withdrawable-amount', params);
}
/**
* Get Exchange Entity List.
*
@@ -1609,7 +1611,7 @@ export class RestClientV5 extends BaseRestClient {
* Query the exchange result by sending quoteTxId.
*/
getConvertStatus(params: {
quoteTxId?: string;
quoteTxId: string;
accountType:
| 'eb_convert_funding'
| 'eb_convert_uta'