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, VipCollateralCoinsV5,
WalletBalanceV5, WalletBalanceV5,
WithdrawParamsV5, WithdrawParamsV5,
WithdrawableAmountV5,
WithdrawalRecordV5, WithdrawalRecordV5,
} from './types'; } 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. * 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); 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. * 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. * Query the transferable coin list between each account type.
*/ */
@@ -1309,7 +1345,7 @@ export class RestClientV5 extends BaseRestClient {
amount: string, amount: string,
fromAccountType: AccountTypeV5, fromAccountType: AccountTypeV5,
toAccountType: AccountTypeV5, toAccountType: AccountTypeV5,
): Promise<APIResponseV3WithTime<{ transferId: string }>> { ): Promise<APIResponseV3WithTime<{ transferId: string; status: string }>> {
return this.postPrivate('/v5/asset/transfer/inter-transfer', { return this.postPrivate('/v5/asset/transfer/inter-transfer', {
transferId, transferId,
coin, 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 * Enable Universal Transfer for Sub UID
* *
@@ -1369,7 +1391,7 @@ export class RestClientV5 extends BaseRestClient {
*/ */
createUniversalTransfer( createUniversalTransfer(
params: UniversalTransferParamsV5, params: UniversalTransferParamsV5,
): Promise<APIResponseV3WithTime<{ transferId: string }>> { ): Promise<APIResponseV3WithTime<{ transferId: string; status: string }>> {
return this.postPrivate('/v5/asset/transfer/universal-transfer', params); return this.postPrivate('/v5/asset/transfer/universal-transfer', params);
} }
@@ -1400,7 +1422,7 @@ export class RestClientV5 extends BaseRestClient {
nextPageCursor: string; 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. * Query the deposit address information of SUB account.
* *
* CAUTION * 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. * Query withdrawal records.
*/ */
@@ -1529,15 +1540,6 @@ export class RestClientV5 extends BaseRestClient {
return this.getPrivate('/v5/asset/withdraw/query-record', params); 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. * Get Exchange Entity List.
* *
@@ -1609,7 +1611,7 @@ export class RestClientV5 extends BaseRestClient {
* Query the exchange result by sending quoteTxId. * Query the exchange result by sending quoteTxId.
*/ */
getConvertStatus(params: { getConvertStatus(params: {
quoteTxId?: string; quoteTxId: string;
accountType: accountType:
| 'eb_convert_funding' | 'eb_convert_funding'
| 'eb_convert_uta' | 'eb_convert_uta'

View File

@@ -18,6 +18,8 @@ export interface GetDeliveryRecordParamsV5 {
export interface GetSettlementRecordParamsV5 { export interface GetSettlementRecordParamsV5 {
category: CategoryV5; category: CategoryV5;
symbol?: string; symbol?: string;
startTime?: number;
endTime?: number;
limit?: number; limit?: number;
cursor?: string; cursor?: string;
} }
@@ -100,6 +102,7 @@ export interface GetSubAccountDepositRecordParamsV5 {
} }
export interface GetInternalDepositRecordParamsV5 { export interface GetInternalDepositRecordParamsV5 {
txID?: string;
startTime?: number; startTime?: number;
endTime?: number; endTime?: number;
coin?: string; coin?: string;
@@ -109,6 +112,7 @@ export interface GetInternalDepositRecordParamsV5 {
export interface GetWithdrawalRecordsParamsV5 { export interface GetWithdrawalRecordsParamsV5 {
withdrawID?: string; withdrawID?: string;
txID?: string;
coin?: string; coin?: string;
withdrawType?: number; withdrawType?: number;
startTime?: number; startTime?: number;
@@ -129,7 +133,7 @@ export interface WithdrawParamsV5 {
feeType?: 0 | 1; feeType?: 0 | 1;
requestId?: string; requestId?: string;
beneficiary?: { beneficiary?: {
vaspEntityId: string; vaspEntityId?: string;
beneficiaryName?: string; beneficiaryName?: string;
}; };
} }

View File

@@ -66,6 +66,8 @@ export interface AccountCoinBalanceV5 {
walletBalance: string; walletBalance: string;
transferBalance: string; transferBalance: string;
bonus: string; bonus: string;
transferSafeAmount: string;
ltvTransferSafeAmount: string;
}; };
} }
@@ -113,6 +115,9 @@ export interface DepositRecordV5 {
confirmations: string; confirmations: string;
txIndex: string; txIndex: string;
blockHash: string; blockHash: string;
batchReleaseLimit: string;
depositType: string;
fromAddress: string;
} }
export interface InternalDepositRecordV5 { export interface InternalDepositRecordV5 {
@@ -123,6 +128,7 @@ export interface InternalDepositRecordV5 {
status: 1 | 2 | 3; status: 1 | 2 | 3;
address: string; address: string;
createdTime: string; createdTime: string;
txID: string;
} }
export interface DepositAddressChainV5 { export interface DepositAddressChainV5 {
@@ -130,6 +136,8 @@ export interface DepositAddressChainV5 {
addressDeposit: string; addressDeposit: string;
tagDeposit: string; tagDeposit: string;
chain: string; chain: string;
batchReleaseLimit: string;
contractAddress: string;
} }
export interface DepositAddressResultV5 { export interface DepositAddressResultV5 {
@@ -151,6 +159,8 @@ export interface CoinInfoV5 {
minAccuracy: string; minAccuracy: string;
chainDeposit: string; chainDeposit: string;
chainWithdraw: string; chainWithdraw: string;
withdrawPercentageFee: string;
contractAddress: string;
}[]; }[];
} }
@@ -169,6 +179,22 @@ export interface WithdrawalRecordV5 {
updateTime: string; updateTime: string;
} }
export interface WithdrawableAmountV5 {
limitAmountUsd: string;
withdrawableAmount: {
SPOT: {
coin: string;
withdrawableAmount: string;
availableBalance: string;
};
FUND: {
coin: string;
withdrawableAmount: string;
availableBalance: string;
};
};
}
export interface VaspEntityV5 { export interface VaspEntityV5 {
vaspEntityId: string; vaspEntityId: string;
vaspName: string; vaspName: string;
@@ -220,7 +246,7 @@ export interface ConvertStatusV5 {
fromAmount: string; fromAmount: string;
toAmount: string; toAmount: string;
exchangeStatus: 'init' | 'processing' | 'success' | 'failure'; exchangeStatus: 'init' | 'processing' | 'success' | 'failure';
extInfo: object; extInfo: { paramType: string; paramValue: string };
convertRate: string; convertRate: string;
createdAt: string; createdAt: string;
} }
@@ -236,7 +262,7 @@ export interface ConvertHistoryRecordV5 {
fromAmount: string; fromAmount: string;
toAmount: string; toAmount: string;
exchangeStatus: 'init' | 'processing' | 'success' | 'failure'; exchangeStatus: 'init' | 'processing' | 'success' | 'failure';
extInfo: object; extInfo: { paramType: string; paramValue: string };
convertRate: string; convertRate: string;
createdAt: string; createdAt: string;
} }