v3.4.0: feat(#219) add support for account asset v3 REST endpoints

This commit is contained in:
tiagosiebler
2023-02-13 17:20:03 +00:00
parent 0c0900e608
commit 6fa204e8bd
11 changed files with 870 additions and 49 deletions

View File

@@ -19,6 +19,24 @@ export interface InternalTransferRequest {
to_account_type: TransferAccountType;
}
export interface InternalTransferRequestV3 {
transferId: string;
coin: string;
amount: string;
fromAccountType: string;
toAccountType: string;
}
export interface QueryInternalTransfersRequestV3 {
transferId?: string;
coin: string;
status?: string;
startTime?: number;
endTime?: number;
limit?: number;
cursor?: string;
}
export interface SubAccountTransferRequest {
transfer_id: string;
coin: string;
@@ -27,6 +45,16 @@ export interface SubAccountTransferRequest {
type: TransferType;
}
export interface SubAccountTransferRequestV3 {
transferId?: string;
coin?: string;
status?: string;
startTime?: number;
endTime?: number;
limit?: number;
cursor?: string;
}
export interface TransferQueryRequest {
transfer_id?: string;
coin?: string;
@@ -52,7 +80,6 @@ export interface UniversalTransferRequest {
from_account_type: TransferAccountType;
to_account_type: TransferAccountType;
}
export interface SupportedDepositListRequest {
coin?: string;
chain?: string;
@@ -92,3 +119,140 @@ export interface WithdrawalRequest {
chain: string;
tag?: string;
}
export interface UniversalTransferRequestV3 {
transferId: string;
coin: string;
amount: string;
fromMemberId: string;
toMemberId: string;
fromAccountType: TransferAccountType;
toAccountType: TransferAccountType;
}
export interface UniversalTransferListRequestV3 {
transferId?: string;
coin: string;
status?: string;
startTime?: number;
endTime?: number;
limit?: number;
cursor?: string;
}
export interface TransferCoinListRequestV3 {
fromAccountType: TransferAccountType;
toAccountType: TransferAccountType;
}
export interface SingleAccountCoinBalanceRequestV3 {
memberId?: string;
accountType: TransferAccountType;
coin: string;
withBonus?: '0' | '1';
}
export interface AccountCoinBalancesRequestV3 {
memberId?: string;
accountType: TransferAccountType;
coin?: string;
withBonus?: '0' | '1';
}
export interface AssetInfoRequestV3 {
accountType?: TransferAccountType;
coin?: string;
}
export interface SupportedDepositListRequestV3 {
coin?: string;
chain?: string;
cursor?: string;
limit?: number;
}
export interface DepositRecordQueryRequestV3 {
startTime?: number;
endTime?: number;
coin?: string;
cursor?: string;
limit?: number;
}
export interface SubDepositRecordQueryRequestV3 {
subMemberId: number;
startTime?: number;
endTime?: number;
coin?: string;
cursor?: string;
limit?: number;
}
export interface WithdrawRecordQueryRequestV3 {
withdrawID?: number;
startTime?: number;
endTime?: number;
coin?: string;
withdrawType?: string;
cursor?: string;
limit?: number;
}
export interface WithdrawCreateRequestV3 {
coin: string;
chain: string;
address: string;
tag?: string;
amount: string;
timestamp: number;
forceChain?: 0 | 1;
}
export interface QueryDepositAddressRequestV3 {
coin?: string;
chainType?: string;
}
export interface QuerySubAccountDepositAddressRequestV3 {
coin?: string;
chainType?: string;
subMemberId: string;
}
export interface CreateSubMemberRequestV3 {
username: string;
memberType: 1 | 6;
switch?: 0 | 1;
note?: string;
}
export interface CreateSubAPIKeyRequestV3 {
subuid: string;
note?: string;
readOnly: 0 | 1;
ips?: string[];
permissions: {
ContractTrade?: [];
Spot?: string[];
Wallet?: string[];
Options?: string[];
Derivatives?: string[];
Exchange?: string[];
};
}
export interface ModifyAPIKeyRequestV3 {
readOnly: number;
ips?: string[];
permissions: {
ContractTrade?: string[];
Spot?: string[];
Wallet?: string[];
Options?: string[];
Derivatives?: string[];
CopyTrading?: string[];
BlockTrade?: string[];
Exchange?: string[];
NFT?: string[];
};
}

View File

@@ -0,0 +1,236 @@
export interface UniversalTransferCreateResponse {
transferId: string;
}
export interface UniversalTransferListResponseV3 {
list: {
transferId: string;
coin: string;
amount: string;
timestamp: string;
status: string;
fromAccountType: string;
toAccountType: string;
fromMemberId: string;
toMemberId: string;
}[];
nextPageCursor: string;
}
export interface QueryInternalTransferSResponseV3 {
list: {
transferId: string;
coin: string;
amount: string;
fromAccountType: string;
toAccountType: string;
timestamp: string;
status: string;
}[];
nextPageCursor: string;
}
export interface SubAccountTransferResponseV3 {
list: {
transferId: string;
coin: string;
amount: string;
memberId: number;
subMemberId: number;
timestamp: string;
status: string;
type: 'IN' | 'OUT';
}[];
nextPageCursor: string;
}
export interface AccountCoinBalanceResponseV3 {
accountType: string;
bizType: number;
accountId: string;
memberId: string;
balance: {
coin: string;
walletBalance: string;
transferBalance: string;
bonus: string;
};
}
export interface AccountCoinBalancesResponseV3 {
accountType: string;
memberId: string;
balance: {
coin: string;
walletBalance: string;
transferBalance: string;
bonus: string;
}[];
}
export interface AssetInfoResponseV3 {
spot: {
status: 'ACCOUNT_STATUS_NORMAL' | 'ACCOUNT_STATUS_UNSPECIFIED';
assets: {
coin: string;
frozen: string;
free: string;
withdraw: string;
}[];
};
}
export interface SupportedDepositListResponseV3 {
configList: SupportedDepositV3[];
nextPageCursor: string;
}
interface SupportedDepositV3 {
coin: string;
chain: string;
coinShowName: string;
chainType: string;
blockConfirmNumber: number;
minDepositAmount: string;
}
export interface DepositRecordQueryResponseV3 {
rows: DepositRecordV3[];
nextPageCursor: string;
}
interface DepositRecordV3 {
coin: string;
chain: string;
amount: string;
txID: string;
status: number;
toAddress: string;
tag: string;
depositFee: string;
successAt: string;
confirmations: string;
txIndex: string;
blockHash: string;
}
export interface WithdrawRecordsQueryResponseV3 {
rows: {
coin: string;
chain: string;
amount: string;
txID: string;
status: number;
toAddress: string;
tag: string;
withdrawFee: string;
createTime: string;
updateTime: string;
withdrawId: string;
withdrawType: number;
}[];
nextPageCursor: string;
}
export interface CoinInfoV3 {
name: string;
coin: string;
remainAmount: string;
chains: {
chainType: string;
confirmation: string;
withdrawFee: string;
depositMin: string;
withdrawMin: string;
chain: string;
chainDeposit: string;
chainWithdraw: string;
minAccuracy: string;
}[];
}
export interface CoinInfoQueryResponseV3 {
rows: CoinInfoV3[];
}
export interface DepositAddressChainV3 {
chainType: string;
addressDeposit: string;
tagDeposit: string;
chain: string;
}
export interface DepositAddressResponseV3 {
coin: string;
chains: DepositAddressChainV3[];
}
export interface CreateSubMemberResponseV3 {
uid: number;
username: string;
memberType: 1 | 6;
switch: 0 | 1;
note: string;
}
export interface CreateSubAPIKeyResponseV3 {
id: string;
note: string;
apiKey: string;
readOnly: string;
secret: string;
permissions: {
ContractTrade: string[];
Spot: string[];
Wallet: string[];
Options: string[];
Derivatives: string[];
CopyTrading: string[];
BlockTrade: string[];
Exchange: string[];
NFT: string[];
};
}
export interface SubMemberV3 {
uid: string;
username: string;
memberType: 1 | 6;
status: 1 | 2 | 4;
remark: string;
}
export interface SubMemberResponseV3 {
subMembers: SubMemberV3[];
}
export interface APIKeyInfoV3 {
id: string;
note: string;
apiKey: string;
readOnly: string;
secret: string;
permissions: {
ContractTrade: string[];
Spot: string[];
Wallet: string[];
Options: string[];
Derivatives: string[];
CopyTrading: string[];
BlockTrade: string[];
Exchange: string[];
NFT: string[];
};
ips: string[];
type: number;
deadlineDay: number;
expiredAt: string;
createdAt: string;
unified: number;
uta: number;
userID: number;
inviterID: number;
vipLevel: string;
mktMakerLevel: string;
affiliateID: number;
}

View File

@@ -1,3 +1,4 @@
export * from './account-asset';
export * from './contract';
export * from './shared';
export * from './spot';

View File

@@ -65,6 +65,13 @@ export interface APIResponseV3<T> {
result: T;
}
export interface APIResponseV3WithTime<T> {
retCode: number;
retMsg: 'OK' | string;
result: T;
time: number;
}
export interface APIResponseWithTime<T = {}> extends APIResponse<T> {
/** UTC timestamp */
time_now: numberInString;