bitget-api
Version:
Complete Node.js & JavaScript SDK for Bitget V1-V3 REST APIs & WebSockets, with TypeScript & end-to-end tests.
2,416 lines (2,388 loc) • 373 kB
Plain Text
This file is a merged representation of a subset of the codebase, containing files not matching ignore patterns, combined into a single document by Repomix.
The content has been processed where content has been compressed (code blocks are separated by ⋮---- delimiter).
================================================================
File Summary
================================================================
Purpose:
--------
This file contains a packed representation of a subset of the repository's contents that is considered the most important context.
It is designed to be easily consumable by AI systems for analysis, code review,
or other automated processes.
File Format:
------------
The content is organized as follows:
1. This summary section
2. Repository information
3. Directory structure
4. Repository files (if enabled)
5. Multiple file entries, each consisting of:
a. A separator line (================)
b. The file path (File: path/to/file)
c. Another separator line
d. The full contents of the file
e. A blank line
Usage Guidelines:
-----------------
- This file should be treated as read-only. Any changes should be made to the
original repository files, not this packed version.
- When processing this file, use the file path to distinguish
between different files in the repository.
- Be aware that this file may contain sensitive information. Handle it with
the same level of security as you would the original repository.
Notes:
------
- Some files may have been excluded based on .gitignore rules and Repomix's configuration
- Binary files are not included in this packed representation. Please refer to the Repository Structure section for a complete list of file paths, including binary files
- Files matching these patterns are excluded: .github/, examples/apidoc/, docs/images/, docs/endpointFunctionList.md, test/, src/util/
- Files matching patterns in .gitignore are excluded
- Files matching default ignore patterns are excluded
- Content has been compressed - code blocks are separated by ⋮---- delimiter
- Files are sorted by Git change count (files with more changes are at the bottom)
================================================================
Directory Structure
================================================================
examples/
auth/
fasterHmacSign.ts
rest-private-rsa.md
rest-private-rsa.ts
deprecated-V1-REST/
README.md
rest-private-futures.ts
rest-private-spot.ts
rest-public-futures.ts
rest-public-spot.ts
rest-trade-futures.ts
rest-trade-spot.ts
deprecated-V1-Websockets/
ws-private.ts
ws-public.ts
V2/
rest-private-futures.ts
rest-private-spot.ts
rest-public-futures.ts
rest-public-spot.ts
rest-trade-futures.ts
rest-trade-spot.ts
ws-demo-trading.ts
ws-private.ts
ws-public.ts
V3/
rest-private.ts
rest-public-UTA-futures.ts
rest-public-UTA-spot.ts
rest-trade-UTA-futures.ts
rest-trade-UTA-spot.ts
ws-api-client-trade.ts
ws-api-trade-raw.ts
ws-private.ts
ws-public.ts
README.md
src/
constants/
enum.ts
types/
request/
v1/
brokerV1.ts
futuresV1.ts
spotV1.ts
v2/
broker.ts
common.ts
copytrading.ts
earn.ts
futures.ts
margin.ts
spot.ts
v3/
account.ts
loan.ts
public.ts
strategy.ts
trade.ts
shared.ts
response/
v1/
futures.ts
shared.ts
spot.ts
v2/
broker.ts
common.ts
copy-trading.ts
earn.ts
futures.ts
margin.ts
spot.ts
v3/
account.ts
loan.ts
public.ts
strategy.ts
trade.ts
websockets/
ws-api-request.ts
ws-api-response.ts
ws-api.ts
ws-events.ts
ws-general.ts
shared.ts
broker-client.ts
futures-client.ts
index.ts
rest-client-v2.ts
rest-client-v3.ts
spot-client.ts
websocket-api-client.ts
websocket-client-legacy-v1.ts
websocket-client-v2.ts
websocket-client-v3.ts
webpack/
webpack.config.js
.eslintrc.cjs
.gitignore
.jshintrc
.nvmrc
.prettierrc
jest.config.ts
LICENSE.md
package.json
postBuild.sh
README.md
tea.yaml
tsconfig.cjs.json
tsconfig.esm.json
tsconfig.json
tsconfig.linting.json
================================================================
Files
================================================================
================
File: examples/deprecated-V1-REST/README.md
================
# Deprecated V1 REST API Examples
These examples are for Bitget's V1 APIs, the previous generation of their API offering.
If you're building new functionality, you should look at using the V2 APIs via the RestClientV2 class in this SDK. This covers all the newer functionality offered by Bitget's APIs - with significant upgrades on all aspects of their APIs:
https://www.bitget.com/api-doc/common/release-note
The V1 REST clients will remain function until Bitget formally deprecates their V1 API.
================
File: examples/deprecated-V1-REST/rest-public-spot.ts
================
import { SpotClient } from '../../src/index';
⋮----
// or
// import { SpotClient } from 'bitget-api';
================
File: src/types/request/v1/brokerV1.ts
================
export type BrokerProductType =
| 'umcbl'
| 'usdt'
| 'swap'
| 'dmcbl'
| 'mix'
| 'swap';
⋮----
export interface BrokerSubListRequest {
pageSize?: string;
lastEndId?: number;
status?: string;
}
⋮----
export interface BrokerSubWithdrawalRequest {
subUid: string;
coin: string;
address: string;
chain: string;
tag?: string;
amount: string;
remark?: string;
clientOid?: string;
}
⋮----
export interface BrokerSubAPIKeyModifyRequest {
subUid: string;
apikey: string;
remark?: string;
ip?: string;
perm?: string;
}
================
File: src/types/request/v2/copytrading.ts
================
/**
*
*
* Copy Trading | Future copy trading | Trader Api
*
*
*/
⋮----
export type CopyTradingProductTypeV2 =
| 'USDT-FUTURES'
| 'COIN-FUTURES'
| 'USDC-FUTURES';
⋮----
export interface GetFuturesTraderCurrentOrdersRequestV2 {
symbol?: string;
productType: CopyTradingProductTypeV2;
startTime?: string;
endTime?: string;
limit?: string;
idGreaterThan?: string;
idLessThan?: string;
}
⋮----
export interface GetFuturesTraderHistoryOrdersRequestV2 {
idLessThan?: string;
idGreaterThan?: string;
startTime?: string;
endTime?: string;
limit?: string;
order?: 'asc' | 'desc';
symbol?: string;
productType: CopyTradingProductTypeV2;
}
⋮----
export interface ModifyFuturesTraderOrderTPSLRequestV2 {
trackingNo: string;
productType: CopyTradingProductTypeV2;
stopSurplusPrice?: string;
stopLossPrice?: string;
}
⋮----
export interface GetFuturesTraderProfitShareDetailRequestV2 {
coin?: string;
idLessThan?: string;
idGreaterThan?: string;
startTime?: string;
endTime?: string;
limit?: string;
}
⋮----
export interface FuturesTraderSymbolSettingRequestV2 {
symbol: string;
productType: CopyTradingProductTypeV2;
settingType: 'ADD' | 'DELETE' | 'UPDATE';
stopSurplusRatio?: string;
stopLossRatio?: string;
}
⋮----
export interface GetFuturesTraderFollowersRequestV2 {
pageNo?: string;
pageSize?: string;
startTime?: string;
endTime?: string;
}
⋮----
/**
*
*
* Copy Trading | Future copy trading | Follower Api
*
*
*/
⋮----
export interface GetFollowerFuturesCurrentTrackingOrdersRequestV2 {
idLessThan?: string;
idGreaterThan?: string;
startTime?: string;
endTime?: string;
limit?: string;
symbol?: string;
productType: CopyTradingProductTypeV2;
traderId?: string;
}
⋮----
export interface GetFollowerFuturesHistoryTrackingOrdersRequestV2 {
idLessThan?: string;
idGreaterThan?: string;
startTime?: string;
endTime?: string;
limit?: string;
symbol?: string;
productType: CopyTradingProductTypeV2;
traderId?: string;
}
⋮----
export interface UpdateFuturesFollowerTPSLRequestV2 {
trackingNo: string;
symbol?: string;
productType: CopyTradingProductTypeV2;
stopSurplusPrice?: string;
stopLossPrice?: string;
}
⋮----
export type AutoCopyOption = 'on' | 'off';
export type FollowMode = 'basic' | 'advanced';
export type LeverageType = 'position' | 'specify' | 'trader';
export type TraceType = 'percent' | 'amount' | 'count';
⋮----
export interface FollowerCopyTradeSettingRequestV2 {
symbol: string;
productType: CopyTradingProductTypeV2;
marginType: 'trader' | 'specify';
marginCoin?: string;
leverType: LeverageType;
longLeverage?: string;
shortLeverage?: string;
traceType: TraceType;
traceValue: string;
maxHoldSize?: string;
stopSurplusRatio?: string;
stopLossRatio?: string;
}
⋮----
export interface UpdateFuturesFollowerSettingsRequestV2 {
traderId: string;
autoCopy?: AutoCopyOption;
mode?: FollowMode;
settings: FollowerCopyTradeSettingRequestV2[];
}
export interface CloseFuturesFollowerPositionsRequestV2 {
productType: CopyTradingProductTypeV2;
trackingNo?: string;
symbol?: string;
marginCoin?: string;
marginMode?: 'isolated' | 'cross';
holdSide?: 'long' | 'short';
}
⋮----
export interface GetFuturesFollowerTradersRequestV2 {
startTime?: string;
endTime?: string;
pageNo?: string;
pageSize?: string;
}
⋮----
/**
*
*
* Copy Trading | Spot copy trading | Trader api
*
*
*/
⋮----
export interface GetSpotTraderHistoryProfitRequestV2 {
idLessThan?: string;
idGreaterThan?: string;
startTime?: string;
endTime?: string;
limit?: string;
coin?: string;
}
⋮----
export interface GetSpotTraderHistoryOrdersRequestV2 {
idLessThan?: string;
idGreaterThan?: string;
startTime?: string;
endTime?: string;
limit?: string;
symbol?: string;
}
⋮----
export interface GetSpotTraderCurrentOrdersRequestV2 {
symbol?: string;
idLessThan?: string;
idGreaterThan?: string;
startTime?: string;
endTime?: string;
limit?: string;
}
⋮----
export interface GetSpotTraderFollowersRequestV2 {
pageNo?: string;
pageSize?: string;
startTime?: string;
endTime?: string;
}
⋮----
/**
*
*
* Copy Trading | Spot copy trading | Follower api
*
*
*/
⋮----
export interface SpotFollowerCopyTradeSettingV2 {
symbol: string;
traceType: 'percent' | 'amount' | 'count';
maxHoldSize: string;
traceValue: string;
stopLossRatio?: string;
stopSurplusRatio?: string;
}
⋮----
export interface GetSpotFollowerHistoryOrdersRequestV2 {
symbol?: string;
traderId?: string;
idLessThan?: string;
idGreaterThan?: string;
startTime?: string;
endTime?: string;
limit?: string;
}
⋮----
export interface GetSpotFollowerOpenOrdersRequestV2 {
symbol?: string;
traderId?: string;
idLessThan?: string;
idGreaterThan?: string;
startTime?: string;
endTime?: string;
limit?: string;
}
================
File: src/types/request/v2/earn.ts
================
/**
*
*
* Earn | Savings
*
*
*/
⋮----
export interface GetEarnSavingsAssetsRequestV2 {
periodType: string;
startTime?: string;
endTime?: string;
limit?: string;
idLessThan?: string;
}
⋮----
export interface GetEarnSavingsRecordsRequestV2 {
coin?: string;
periodType: string;
orderType?: string;
startTime?: string;
endTime?: string;
limit?: string;
idLessThan?: string;
}
⋮----
export interface RedeemSavingsRequestV2 {
productId: string;
orderId?: string;
periodType: string;
amount: string;
}
⋮----
/**
*
*
* Earn | Shark Fin
*
*
*/
⋮----
export interface GetSharkfinAssetsRequestV2 {
status: string;
startTime?: string;
endTime?: string;
limit?: string;
idLessThan?: string;
}
⋮----
export interface GetSharkfinRecordsRequestV2 {
coin?: string;
type: string;
startTime?: string;
endTime?: string;
limit?: string;
idLessThan?: string;
}
⋮----
/**
*
*
* Earn | Loan
*
*
*/
⋮----
export interface GetLoanEstInterestAndBorrowableRequestV2 {
loanCoin: string;
pledgeCoin: string;
daily: 'SEVEN' | 'THIRTY';
pledgeAmount?: string;
}
⋮----
export interface BorrowLoanRequestV2 {
loanCoin: string;
pledgeCoin: string;
daily: 'SEVEN' | 'THIRTY';
pledgeAmount?: string;
loanAmount?: string;
}
⋮----
export interface RepayLoanRequestV2 {
orderId: string;
amount?: string;
repayUnlock?: string;
repayAll: string;
}
⋮----
export interface GetLoanRepayHistoryRequestV2 {
orderId?: string;
loanCoin?: string;
pledgeCoin?: string;
startTime: string;
endTime: string;
pageNo?: string;
pageSize?: string;
}
⋮----
export interface ModifyLoanPledgeRateRequestV2 {
orderId: string;
amount: string;
pledgeCoin: string;
reviseType: string;
}
⋮----
export interface GetLoanPledgeRateHistoryRequestV2 {
orderId?: string;
reviseSide?: string;
pledgeCoin?: string;
startTime: string;
endTime: string;
pageNo?: string;
pageSize?: string;
}
⋮----
export interface GetLoanHistoryRequestV2 {
orderId?: string;
loanCoin?: string;
pledgeCoin?: string;
status?: string;
startTime: string;
endTime: string;
pageNo?: string;
pageSize?: string;
}
⋮----
export interface GetLiquidationRecordsRequestV2 {
orderId?: string;
loanCoin?: string;
pledgeCoin?: string;
status?: string;
startTime: string;
endTime: string;
pageNo?: string;
pageSize?: string;
}
================
File: src/types/request/v2/margin.ts
================
/**
*
* * Margin | Cross/Isolated | Order Record
*
*/
⋮----
export interface GetBorrowHistoryRequestV2 {
loanId?: string;
coin?: string;
startTime: string;
endTime?: string;
limit?: string;
idLessThan?: string;
}
⋮----
export interface GetRepayHistoryRequestV2 {
repayId?: string;
coin?: string;
startTime: string;
endTime?: string;
limit?: string;
idLessThan?: string;
}
⋮----
export interface GetInterestHistoryRequestV2 {
coin?: string;
startTime: string;
endTime?: string;
limit?: string;
idLessThan?: string;
}
⋮----
export interface GetLiquidationHistoryRequestV2 {
startTime: string;
endTime?: string;
limit?: string;
idLessThan?: string;
}
⋮----
export interface GetFinancialHistoryRequestV2 {
marginType?: string;
coin?: string;
startTime: string;
endTime?: string;
limit?: string;
idLessThan?: string;
}
⋮----
/**
*
* * Margin | Cross/Isolated | Account
*
*/
⋮----
/**
*
* * Margin | Cross/Isolated | Trade
*
*/
⋮----
export type MarginOrderTypeV2 = 'limit' | 'market';
⋮----
export type MarginLoanTypeV2 =
| 'normal'
| 'autoLoan'
| 'autoRepay'
| 'autoLoanAndRepay';
⋮----
export type MarginTimeInForceV2 = 'gtc' | 'post_only' | 'fok' | 'ioc';
⋮----
export type MarginOrderSideV2 = 'buy' | 'sell';
⋮----
export type MarginSTPModeV2 =
| 'none'
| 'cancel_taker'
| 'cancel_maker'
| 'cancel_both';
⋮----
export interface MarginPlaceOrderRequestV2 {
symbol: string;
orderType: MarginOrderTypeV2;
price?: string;
loanType: MarginLoanTypeV2;
force: MarginTimeInForceV2;
baseSize?: string;
quoteSize?: string;
clientOid?: string;
side: MarginOrderSideV2;
stpMode?: MarginSTPModeV2;
}
⋮----
export interface MarginBatchOrderEntry {
orderType: MarginOrderTypeV2;
price?: string;
loanType: MarginLoanTypeV2;
force: MarginTimeInForceV2;
baseSize?: string;
quoteSize?: string;
clientOid?: string;
side: MarginOrderSideV2;
stpMode?: MarginSTPModeV2;
}
⋮----
export interface MarginBatchOrdersRequestV2 {
symbol: string;
orderList: MarginBatchOrderEntry[];
}
⋮----
export interface GetMarginCurrentOrdersRequestV2 {
symbol: string;
orderId?: string;
clientOid?: string;
startTime: string;
endTime?: string;
limit?: string;
idLessThan?: string;
}
⋮----
export interface GetHistoryOrdersRequestV2 {
symbol: string;
orderId?: string;
enterPointSource?: string;
clientOid?: string;
startTime: string;
endTime?: string;
limit?: string;
idLessThan?: string;
}
⋮----
export interface GetMarginOrderFillsRequestV2 {
symbol: string;
orderId?: string;
idLessThan?: string;
startTime: string;
endTime?: string;
limit?: string;
}
⋮----
export interface GetMarginLiquidationOrdersRequestV2 {
type?: 'swap' | 'place_order';
symbol?: string;
fromCoin?: string;
toCoin?: string;
startTime?: string;
endTime?: string;
limit?: string;
idLessThan?: string;
}
================
File: src/types/request/v2/spot.ts
================
type SpotKlineIntervalV2 =
| '1min'
| '5min'
| '15min'
| '30min'
| '1h'
| '4h'
| '6h'
| '12h'
| '1day'
| '3day'
| '1week'
| '1M'
| '6Hutc'
| '12Hutc'
| '1Dutc'
| '3Dutc'
| '1Wutc'
| '1Mutc';
⋮----
export interface SpotCandlesRequestV2 {
symbol: string;
granularity: SpotKlineIntervalV2;
startTime?: string;
endTime?: string;
limit?: string;
}
⋮----
export interface SpotHistoricCandlesRequestV2 {
symbol: string;
granularity: SpotKlineIntervalV2;
endTime?: string;
limit?: string;
}
⋮----
export interface SpotHistoricTradesRequestV2 {
symbol: string;
limit?: string;
idLessThan?: string;
startTime?: string;
endTime?: string;
}
⋮----
/**
*
* * Spot | Trade
*
*/
⋮----
export type SpotOrderSideV2 = 'buy' | 'sell';
⋮----
export type SpotOrderTypeV2 = 'limit' | 'market';
⋮----
export type SpotOrderForceV2 = 'gtc' | 'post_only' | 'fok' | 'ioc';
⋮----
export type SpotTPSLTypeV2 = 'normal' | 'tpsl';
⋮----
export type SpotSTPModeV2 =
| 'none'
| 'cancel_taker'
| 'cancel_maker'
| 'cancel_both';
⋮----
export type SpotBatchModeV2 = 'single' | 'multiple';
⋮----
export interface SpotOrderRequestV2 {
symbol: string;
side: SpotOrderSideV2;
orderType: SpotOrderTypeV2;
force: SpotOrderForceV2;
price?: string;
size: string;
clientOid?: string;
triggerPrice?: string;
tpslType?: SpotTPSLTypeV2;
requestTime?: string;
receiveWindow?: string;
stpMode?: SpotSTPModeV2;
presetTakeProfitPrice?: string;
executeTakeProfitPrice?: string;
presetStopLossPrice?: string;
executeStopLossPrice?: string;
}
⋮----
export interface SpotCancelandSubmitOrderRequestV2 {
symbol: string;
price: string;
size: string;
orderId?: string;
clientOid?: string;
newClientOid?: string;
presetTakeProfitPrice?: string;
executeTakeProfitPrice?: string;
presetStopLossPrice?: string;
executeStopLossPrice?: string;
}
⋮----
export interface SpotCancelOrderRequestV2 {
symbol: string;
tpslType?: SpotTPSLTypeV2;
orderId?: string;
clientOid?: string;
}
⋮----
export interface SpotBatchOrderRequestItemV2 {
symbol?: string;
side: SpotOrderSideV2;
orderType: SpotOrderTypeV2;
force: SpotOrderForceV2;
price?: string;
size: string;
clientOid?: string;
stpMode?: SpotSTPModeV2;
presetTakeProfitPrice?: string;
executeTakeProfitPrice?: string;
presetStopLossPrice?: string;
executeStopLossPrice?: string;
}
⋮----
export interface SpotBatchOrderRequestV2 {
symbol?: string;
batchMode?: SpotBatchModeV2;
orderList: SpotBatchOrderRequestItemV2[];
}
⋮----
export interface SpotBatchCancelOrderRequestV2 {
symbol?: string;
batchMode?: SpotBatchModeV2;
orderList: {
symbol?: string;
orderId?: string;
clientOid?: string;
}[];
}
⋮----
export interface GetSpotOrderInfoRequestV2 {
orderId?: string;
clientOid?: string;
requestTime?: string;
receiveWindow?: string;
}
⋮----
export interface GetSpotOpenOrdersRequestV2 {
symbol?: string;
startTime?: string;
endTime?: string;
idLessThan?: string;
limit?: string;
orderId?: string;
tpslType?: SpotTPSLTypeV2;
requestTime?: string;
receiveWindow?: string;
}
⋮----
export interface GetSpotHistoryOrdersRequestV2 {
symbol?: string;
startTime?: string;
endTime?: string;
idLessThan?: string;
limit?: string;
orderId?: string;
tpslType?: SpotTPSLTypeV2;
requestTime?: string;
receiveWindow?: string;
}
⋮----
export interface GetSpotFillsRequestV2 {
symbol: string;
orderId?: string;
startTime?: string;
endTime?: string;
limit?: string;
idLessThan?: string;
}
⋮----
/**
*
* * Spot | Trigger Orders
*
*/
⋮----
export type SpotPlanTypeV2 = 'amount' | 'total';
⋮----
export type SpotTriggerTypeV2 = 'fill_price' | 'mark_price';
⋮----
export interface SpotPlanOrderRequestV2 {
symbol: string;
side: SpotOrderSideV2;
triggerPrice: string;
orderType: SpotOrderTypeV2;
executePrice?: string;
planType?: SpotPlanTypeV2;
size: string;
triggerType: SpotTriggerTypeV2;
clientOid?: string;
force?: SpotOrderForceV2;
stpMode?: SpotSTPModeV2;
}
⋮----
export interface SpotModifyPlanOrderRequestV2 {
orderId?: string;
clientOid?: string;
triggerPrice: string;
orderType: SpotOrderTypeV2;
executePrice?: string;
size: string;
}
⋮----
export interface GetSpotCurrentPlanOrdersRequestV2 {
symbol: string;
limit?: string;
idLessThan?: string;
startTime?: string;
endTime?: string;
}
⋮----
export interface GetSpotHistoryPlanOrdersRequestV2 {
symbol: string;
startTime: string;
endTime: string;
limit?: string;
}
⋮----
/**
*
* * Spot | Account
*
*/
⋮----
export type SpotBillGroupTypeV2 =
| 'deposit'
| 'withdraw'
| 'transaction'
| 'transfer'
| 'other';
⋮----
export type SpotBusinessTypeV2 =
| 'deposit'
| 'withdraw'
| 'buy'
| 'sell'
| 'deduction of handling fee'
| 'transfer-in'
| 'transfer-out'
| 'rebate rewards'
| 'airdrop rewards'
| 'USDT contract rewards'
| 'mix contract rewards'
| 'system lock'
| 'user lock';
⋮----
export type SpotAccountTypeV2 =
| 'spot'
| 'p2p'
| 'coin_futures'
| 'usdt_futures'
| 'usdc_futures'
| 'crossed_margin'
| 'isolated_margin';
⋮----
export interface GetSpotAccountBillsRequestV2 {
coin?: string;
groupType?: SpotBillGroupTypeV2;
businessType?: SpotBusinessTypeV2;
startTime?: string;
endTime?: string;
limit?: string;
idLessThan?: string;
}
⋮----
export interface SpotTransferRequestV2 {
fromType: SpotAccountTypeV2;
toType: SpotAccountTypeV2;
amount: string;
coin: string;
symbol: string;
clientOid?: string;
}
⋮----
export interface SpotSubAccountTransferRequestV2 {
fromType: SpotAccountTypeV2;
toType: SpotAccountTypeV2;
amount: string;
coin: string;
symbol?: string;
clientOid?: string;
fromUserId: string;
toUserId: string;
}
⋮----
export interface SpotWithdrawalRequestV2 {
coin: string;
transferType: 'on_chain' | 'internal_transfer';
address: string;
chain?: string;
innerToType?: 'email' | 'mobile' | 'uid';
areaCode?: string;
tag?: string;
size: string;
remark?: string;
clientOid?: string;
}
⋮----
export interface SpotMainSubTransferRecordRequestV2 {
coin?: string;
role?: 'initiator' | 'receiver';
subUid?: string;
startTime?: string;
endTime?: string;
clientOid?: string;
limit?: string;
idLessThan?: string;
}
⋮----
export interface GetSpotTransferRecordRequestV2 {
coin: string;
fromType: SpotAccountTypeV2;
startTime?: string;
endTime?: string;
clientOid?: string;
limit?: string;
idLessThan?: string;
}
⋮----
export interface GetSpotSubAccountDepositRecordRequestV2 {
subUid: string;
coin?: string;
startTime?: string;
endTime?: string;
idLessThan?: string;
limit?: string;
}
⋮----
export interface GetSpotWithdrawalRecordRequestV2 {
coin?: string;
clientOid?: string;
startTime: string;
endTime: string;
idLessThan?: string;
orderId?: string;
limit?: string;
}
⋮----
export interface GetSpotDepositRecordRequestV2 {
coin?: string;
orderId?: string;
startTime: string;
endTime: string;
idLessThan?: string;
limit?: string;
}
================
File: src/types/request/v3/loan.ts
================
export interface GetTransferedRequestV3 {
userId?: string;
coin: string;
}
⋮----
export interface GetSymbolsRequestV3 {
productId: string;
}
⋮----
export interface GetRepaidHistoryRequestV3 {
startTime?: string;
endTime?: string;
limit?: string;
}
⋮----
export interface GetProductInfosRequestV3 {
productId: string;
}
⋮----
export interface GetLoanOrderRequestV3 {
orderId?: string;
startTime?: string;
endTime?: string;
}
⋮----
export interface GetEnsureCoinsRequestV3 {
productId: string;
}
⋮----
export interface BindUidRequestV3 {
riskUnitId?: string;
uid: string;
operate: 'bind' | 'unbind';
}
⋮----
export interface GetLTVConvertRequestV3 {
riskUnitId?: string;
}
================
File: src/types/request/v3/public.ts
================
export interface GetPublicFillsRequestV3 {
category:
| 'SPOT'
| 'MARGIN'
| 'USDT-FUTURES'
| 'COIN-FUTURES'
| 'USDC-FUTURES';
symbol?: string;
limit?: string;
}
⋮----
export interface GetCandlesRequestV3 {
category: 'SPOT' | 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
symbol: string;
interval:
| '1m'
| '3m'
| '5m'
| '15m'
| '30m'
| '1H'
| '4H'
| '6H'
| '12H'
| '1D';
startTime?: string;
endTime?: string;
type?: 'MARKET' | 'MARK' | 'INDEX';
limit?: string;
}
⋮----
export interface GetHistoryCandlesRequestV3 {
category: 'SPOT' | 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
symbol: string;
interval:
| '1m'
| '3m'
| '5m'
| '15m'
| '30m'
| '1H'
| '4H'
| '6H'
| '12H'
| '1D';
startTime?: string;
endTime?: string;
type?: 'MARKET' | 'MARK' | 'INDEX';
limit?: string;
}
⋮----
export interface GetContractsOiRequestV3 {
symbol?: string;
category: 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
}
⋮----
export interface GetCurrentFundingRateRequestV3 {
symbol: string;
}
⋮----
export interface GetHistoryFundingRateRequestV3 {
category: 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
symbol: string;
cursor?: string;
limit?: string;
}
⋮----
export interface GetMarginLoansRequestV3 {
coin: string;
}
⋮----
export interface GetOpenInterestRequestV3 {
category: 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
symbol?: string;
}
⋮----
export interface GetPositionTierRequestV3 {
category: 'MARGIN' | 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
symbol?: string;
coin?: string;
}
⋮----
export interface GetRiskReserveRequestV3 {
category: 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
symbol: string;
}
⋮----
export interface GetInstrumentsRequestV3 {
category:
| 'SPOT'
| 'MARGIN'
| 'USDT-FUTURES'
| 'COIN-FUTURES'
| 'USDC-FUTURES';
symbol?: string;
}
⋮----
export interface GetOrderBookRequestV3 {
category: 'SPOT' | 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
symbol: string;
limit?: string;
}
⋮----
export interface GetTickersRequestV3 {
category: 'SPOT' | 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
symbol?: string;
}
================
File: src/types/request/v3/strategy.ts
================
export interface PlaceStrategyOrderRequestV3 {
category: 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
symbol: string;
clientOid?: string;
type?: 'tpsl';
tpslMode?: 'full' | 'partial';
qty: string;
posSide: 'long' | 'short';
tpTriggerBy?: 'market' | 'mark';
slTriggerBy?: 'market' | 'mark';
takeProfit?: string;
stopLoss?: string;
tpOrderType?: 'limit' | 'market';
slOrderType?: 'limit' | 'market';
tpLimitPrice?: string;
slLimitPrice?: string;
}
⋮----
export interface ModifyStrategyOrderRequestV3 {
orderId?: string;
clientOid?: string;
qty: string;
tpTriggerBy?: 'market' | 'mark';
slTriggerBy?: 'market' | 'mark';
takeProfit?: string;
stopLoss?: string;
tpOrderType?: 'limit' | 'market';
slOrderType?: 'limit' | 'market';
tpLimitPrice?: string;
slLimitPrice?: string;
}
⋮----
export interface CancelStrategyOrderRequestV3 {
orderId?: string;
clientOid?: string;
}
⋮----
export interface GetUnfilledStrategyOrdersRequestV3 {
category: 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
type?: 'tpsl';
}
⋮----
export interface GetHistoryStrategyOrdersRequestV3 {
category: 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
type?: 'tpsl';
startTime?: string;
endTime?: string;
limit?: string;
cursor?: string;
}
================
File: src/types/request/v3/trade.ts
================
export interface BatchModifyOrderRequestV3 {
orderId?: string;
clientOid?: string;
qty?: string;
price?: string;
autoCancel?: 'yes' | 'no';
}
⋮----
export interface CancelAllOrdersRequestV3 {
category:
| 'SPOT'
| 'MARGIN'
| 'USDT-FUTURES'
| 'COIN-FUTURES'
| 'USDC-FUTURES';
symbol?: string;
}
⋮----
export interface CancelBatchOrdersRequestV3 {
orderId?: string;
clientOid?: string;
category:
| 'SPOT'
| 'MARGIN'
| 'USDT-FUTURES'
| 'COIN-FUTURES'
| 'USDC-FUTURES';
symbol: string;
}
⋮----
export interface CloseAllPositionsRequestV3 {
category: 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
symbol?: string;
posSide?: 'long' | 'short';
}
⋮----
export interface CancelOrderRequestV3 {
orderId?: string;
clientOid?: string;
}
⋮----
export interface GetMaxOpenAvailableRequestV3 {
category:
| 'SPOT'
| 'MARGIN'
| 'USDT-FUTURES'
| 'COIN-FUTURES'
| 'USDC-FUTURES';
symbol: string;
orderType: 'limit' | 'market';
side: 'buy' | 'sell';
price?: string;
size?: string;
}
⋮----
export interface GetOrderInfoRequestV3 {
orderId?: string;
clientOid?: string;
}
⋮----
export interface GetFillsRequestV3 {
orderId?: string;
startTime?: string;
endTime?: string;
limit?: string;
cursor?: string;
}
⋮----
export interface GetUnfilledOrdersRequestV3 {
category?:
| 'SPOT'
| 'MARGIN'
| 'USDT-FUTURES'
| 'COIN-FUTURES'
| 'USDC-FUTURES';
symbol?: string;
startTime?: string;
endTime?: string;
limit?: string;
cursor?: string;
}
⋮----
export interface GetHistoryOrdersRequestV3 {
category:
| 'SPOT'
| 'MARGIN'
| 'USDT-FUTURES'
| 'COIN-FUTURES'
| 'USDC-FUTURES';
startTime?: string;
endTime?: string;
limit?: string;
cursor?: string;
}
⋮----
export interface GetPositionHistoryRequestV3 {
category: 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
symbol?: string;
startTime?: string;
endTime?: string;
limit?: string;
cursor?: string;
}
⋮----
export interface GetCurrentPositionRequestV3 {
category: 'USDT-FUTURES' | 'COIN-FUTURES' | 'USDC-FUTURES';
symbol?: string;
posSide?: 'long' | 'short';
}
⋮----
export interface ModifyOrderRequestV3 {
orderId?: string;
clientOid?: string;
qty?: string;
price?: string;
autoCancel?: 'yes' | 'no';
}
⋮----
export interface PlaceBatchOrdersRequestV3 {
category:
| 'SPOT'
| 'MARGIN'
| 'USDT-FUTURES'
| 'COIN-FUTURES'
| 'USDC-FUTURES';
symbol: string;
qty: string;
price?: string;
side: 'buy' | 'sell';
orderType: 'limit' | 'market';
timeInForce?: 'ioc' | 'fok' | 'gtc' | 'post_only';
posSide?: 'long' | 'short';
clientOid?: string;
reduceOnly?: 'yes' | 'no';
}
⋮----
export interface PlaceOrderRequestV3 {
category:
| 'SPOT'
| 'MARGIN'
| 'USDT-FUTURES'
| 'COIN-FUTURES'
| 'USDC-FUTURES';
symbol: string;
qty: string;
price?: string;
side: 'buy' | 'sell';
orderType: 'limit' | 'market';
timeInForce?: 'ioc' | 'fok' | 'gtc' | 'post_only';
posSide?: 'long' | 'short';
clientOid?: string;
reduceOnly?: 'yes' | 'no';
stpMode?: 'none' | 'cancel_taker' | 'cancel_maker' | 'cancel_both';
takeProfitPrice?: string;
stopLossPrice?: string;
takeProfitTriggerType?: 'mark_price' | 'last_price';
stopLossTriggerType?: 'mark_price' | 'last_price';
}
⋮----
export interface CountdownCancelAllRequestV3 {
countdown: string; // seconds until auto-cancel (5-60, or 0 to disable)
}
⋮----
countdown: string; // seconds until auto-cancel (5-60, or 0 to disable)
================
File: src/types/request/shared.ts
================
/** Pagination */
export interface Pagination {
/** Time after */
after?: string;
/** Time before */
before?: string;
/** Elements per page */
limit?: string;
}
⋮----
/** Time after */
⋮----
/** Time before */
⋮----
/** Elements per page */
⋮----
export type OrderTimeInForce = 'normal' | 'post_only' | 'fok' | 'ioc';
⋮----
export interface GetHistoricTradesParams {
symbol: string;
limit?: string;
tradeId?: string;
startTime?: string;
endTime?: string;
}
⋮----
/**
* The margin type, used directly in building the endpoint URL
*/
export type MarginType = 'crossed' | 'isolated';
⋮----
export type FuturesProductTypeV2 =
| 'USDT-FUTURES'
| 'COIN-FUTURES'
| 'USDC-FUTURES'
| 'SUSDT-FUTURES'
| 'SCOIN-FUTURES'
| 'SUSDC-FUTURES';
⋮----
export type FuturesPlanTypeV2 =
| 'profit_plan'
| 'loss_plan'
| 'moving_plan'
| 'pos_profit'
| 'pos_loss';
================
File: src/types/response/v1/shared.ts
================
export interface APIResponse<T> {
code: string;
requestTime: number;
msg: 'success' | string;
data: T;
}
⋮----
export interface VIPFeeRate {
level: number;
dealAmount: string;
assetAmount: string;
takerFeeRate?: string;
makerFeeRate?: number;
withdrawAmount: string;
withdrawAmountUSDT: string;
}
================
File: src/types/response/v1/spot.ts
================
export interface CoinBalance {
coinId: number;
coinName: string;
available: string;
frozen: string;
lock: string;
uTime: string;
}
⋮----
export interface SymbolRules {
symbol: string;
symbolName: string;
baseCoin: string;
quoteCoin: string;
minTradeAmount: string;
maxTradeAmount: string;
takerFeeRate: string;
makerFeeRate: string;
priceScale: string;
quantityScale: string;
status: string;
}
export interface SpotOrderResult {
orderId: string;
clientOrderId: string;
}
⋮----
export interface SpotPlanOrder {
orderId: string;
clientOid: string;
symbol: string;
size: string;
executePrice: string;
triggerPrice: string;
status: string;
orderType: string;
side: string;
triggerType: string;
enterPointSource: string;
cTime: number;
}
⋮----
export interface SpotMarketTrade {
symbol: string;
tradeId: string;
side: 'buy' | 'sell';
fillPrice: string;
fillQuantity: string;
fillTime: string;
}
⋮----
export interface SpotAccountAsset {
coin: string;
available: string;
frozen: string;
locked: string;
limitAvailable: string;
uTime: string;
}
⋮----
export interface SpotAccountBill {
cTime: string;
coino: string;
groupType: string;
businessType:
| 'SMALL_EXCHANGE_USER_IN'
| 'SMALL_EXCHANGE_USER_OUT'
| 'AIRDROP_REWARD'
| 'WITHDRAW'
| string; // TODO: complete list of possible values here?
size: string;
balance: string;
fees: string;
billd: string;
}
⋮----
| string; // TODO: complete list of possible values here?
================
File: src/types/response/v2/common.ts
================
/**
*
* * Common | Notice
*
*/
⋮----
export interface AnnouncementV2 {
annId: string;
annTitle: string;
annDesc: string;
cTime: string;
language: string;
annUrl: string;
}
⋮----
/**
*
* * Common | Public
*
*/
⋮----
/**
*
* * Common | Tax
*
*/
⋮----
export interface SpotTransactionRecordV2 {
id: string;
coin: string;
spotTaxType: string;
amount: string;
fee: string;
balance: string;
ts: string;
}
⋮----
export interface FuturesTransactionRecordV2 {
id: string;
symbol: string;
marginCoin: string;
futureTaxType: string;
amount: string;
fee: string;
ts: string;
}
⋮----
export interface MarginTransactionRecordV2 {
id: string;
coin: string;
marginTaxType: string;
amount: string;
fee: string;
total: string;
symbol: string;
ts: string;
}
⋮----
export interface P2PMerchantOrdersV2 {
id: string;
coin: string;
p2pTaxType: string;
total: string;
ts: string;
}
⋮----
/**
*
* * Common | P2P
*
*/
⋮----
export interface P2PMerchantV2 {
registerTime: string;
nickName: string;
isOnline: string;
avgPaymentTime: string;
avgReleaseTime: string;
totalTrades: string;
totalBuy: string;
totalSell: string;
totalCompletionRate: string;
trades30d: string;
sell30d: string;
buy30d: string;
completionRate30d: string;
}
⋮----
export interface P2PMerchantInfoV2 {
registerTime: string;
nickName: string;
merchantId: string;
avgPaymentTime: string;
avgReleaseTime: string;
totalTrades: string;
totalBuy: string;
totalSell: string;
totalCompletionRate: string;
trades30d: string;
sell30d: string;
buy30d: string;
completionRate30d: string;
kycStatus: boolean;
emailBindStatus: boolean;
mobileBindStatus: boolean;
email: string;
mobile: string;
}
⋮----
export interface P2PMerchantOrderV2 {
orderId: string;
orderNo: string;
advNo: string;
side: string;
count: string;
coin: string;
price: string;
fiat: string;
withdrawTime: string;
representTime: string;
releaseTime: string;
paymentTime: string;
amount: string;
status: string;
buyerRealName: string;
sellerRealName: string;
ctime: string;
utime: string;
paymentInfo: {
paymethodName: string;
paymethodId: string;
paymethodInfo: {
name: string;
required: string;
type: string;
value: string;
}[];
};
}
⋮----
export interface P2PMerchantAdvertismentV2 {
advId: string;
advNo: string;
side: string;
advSize: string;
size: string;
coin: string;
price: string;
coinPrecision: string;
fiat: string;
fiatPrecision: string;
fiatSymbol: string;
status: string;
hide: string;
maxTradeAmount: string;
minTradeAmount: string;
payDuration: string;
turnoverNum: string;
turnoverRate: string;
label: string | null;
userLimitList: {
minCompleteNum: string;
maxCompleteNum: string;
placeOrderNum: string;
allowMerchantPlace: string;
completeRate30d: string;
country: string;
};
paymentMethodList: {
paymentMethod: string;
paymentId: string;
paymentInfo: {
name: string;
required: boolean;
type: string;
}[];
}[];
merchantCertifiedList: {
imageUrl: string;
desc: string;
}[];
utime: string;
ctime: string;
}
⋮----
/**
*
* * Common | Trading insights
*
*/
⋮----
export interface SpotWhaleNetFlowV2 {
volume: string;
date: string;
}
⋮----
export interface FuturesActiveBuySellVolumeV2 {
buyVolume: string;
sellVolume: string;
ts: string;
}
⋮----
export interface FuturesActiveLongShortPositionV2 {
longPositionRatio: string;
shortPositionRatio: string;
longShortPositionRatio: string;
ts: string;
}
⋮----
export interface LeveragedLongShortRatioV2 {
ts: string;
longShortRatio: string;
}
⋮----
export interface MarginLoanGrowthRateV2 {
ts: string;
growthRate: string;
}
⋮----
export interface IsolatedMarginBorrowingRatioV2 {
ts: string;
borrowRate: string;
}
⋮----
export interface FuturesLongShortRatioV2 {
longRatio: string;
shortRatio: string;
longShortRatio: string;
ts: string;
}
⋮----
export interface SpotFundFlowV2 {
whaleBuyVolume: string;
dolphinBuyVolume: string;
fishBuyVolume: string;
whaleSellVolume: string;
dolphinSellVolume: string;
fishSellVolume: string;
whaleBuyRatio: string;
dolphinBuyRatio: string;
fishBuyRatio: string;
whaleSellRatio: string;
dolphinSellRatio: string;
fishSellRatio: string;
}
⋮----
export interface FuturesActiveLongShortAccountV2 {
longAccountRatio: string;
shortAccountRatio: string;
longShortAccountRatio: string;
ts: string;
}
⋮----
/**
*
* * Common | Virtual Subaccount
*
*/
⋮----
export interface CreateVirtualSubAccountV2 {
failureList: {
subaAccountName: string;
}[];
successList: {
subaAccountUid: string;
subaAccountName: string;
status: string;
label: string;
permList: string[];
cTime: string;
uTime: string;
}[];
}
⋮----
export interface CreateVirtualSubAccountAndApiKeyV2 {
subAccountUid: string;
subAccountName: string;
label: string;
subAccountApiKey: string;
secretKey: string;
permList: string[];
ipList: string[];
}
⋮----
export interface VirtualSubAccountV2 {
subAccountUid: string;
subAccountName: string;
status: string;
permList: string[];
label: string;
accountType: string;
bindingTime: string;
cTime: string;
uTime: string;
}
⋮----
export interface CreateVirtualSubAccountApiKeyV2 {
subAccountUid: string;
label: string;
subAccountApiKey: string;
secretKey: string;
permList: string[];
ipList: string[];
}
⋮----
export interface ModifyVirtualSubAccountApiKeyV2 {
subAccountUid: string;
label: string;
subAccountApiKey: string;
secretKey: string;
permList: string[];
ipList: string[];
}
⋮----
export interface SubAccountApiKeyItemV2 {
subAccountUid: string;
label: string;
subAccountApiKey: string;
permList: string[];
ipList: string[];
}
⋮----
/**
*
* * Common | Assets
*
*/
⋮----
export interface FundingAssetV2 {
coin: string;
available: string;
frozen: string;
usdtValue: string;
}
⋮----
export interface BotAssetV2 {
coin: string;
available: string;
equity: string;
bonus: string;
frozen: string;
usdtValue: string;
}
⋮----
/**
*
* * Common | Convert
*
*/
⋮----
export interface ConvertCurrencyV2 {
coin: string;
available: string;
maxAmount: string;
minAmount: string;
}
⋮----
export interface ConvertQuotedPriceV2 {
fee: string;
fromCoinSize: string;
fromCoin: string;
cnvtPrice: string;
toCoinSize: string;
toCoin: string;
traceId: string;
}
⋮----
export interface ConvertTradeResponseV2 {
ts: string;
cnvtPrice: string;
toCoinSize: string;
toCoin: string;
}
⋮----
export interface ConvertRecordV2 {
id: string;
ts: string;
cnvtPrice: string;
fee: string;
fromCoinSize: string;
fromCoin: string;
toCoinSize: string;
toCoin: string;
}
⋮----
/**
*
* * Common | BGB Convert
*
*/
⋮----
export interface BGBConvertCoinV2 {
coin: string;
available: string;
bgbEstAmount: string;
precision: string;
feeDetail: {
feeRate: string;
fee: string;
}[];
cTime: string;
}
⋮----
export interface ConvertBGBResponseV2 {
orderList: {
coin: string;
orderId: string;
}[];
}
⋮----
export interface BGBConvertHistoryV2 {
orderId: string;
fromCoin: string;
fromAmount: string;
fromCoinPrice: string;
toCoin: string;
toAmount: string;
toCoinPrice: string;
feeDetail: {
feeCoin: string;
fee: string;
}[];
status: string;
ctime: string;
}
================
File: src/types/response/v2/copy-trading.ts
================
/**
*
*
* Copy Trading | Future copy trading | Trader Api
*
*
*/
⋮----
export interface CTFuturesTraderCurrentOrderV2 {
trackingNo: string;
openOrderId: string;
symbol: string;
posSide: string;
openLeverage: string;
openPriceAvg: string;
openTime: string;
openSize: string;
presetStopSurplusPrice: string;
presetStopLossPrice: string;
openFee: string;
followCount: string;
}
⋮----
export interface CTFuturesTraderCurrentOrdersV2 {
trackingList: CTFuturesTraderCurrentOrderV2[];
endId: string;
}
⋮----
export interface CTFuturesTraderHistoryOrderV2 {
trackingNo: string;
symbol: string;
openOrderId: string;
closeOrderId: string;
productType: string;
posSide: string;
openLeverage: string;
openPriceAvg: string;
openTime: string;
openSize: string;
closeSize: string;
closeTime: string;
closePriceAvg: string;
stopType: string;
achievedPL: string;
openFee: string;
closeFee: string;
cTime: string;
}
⋮----
export interface CTFuturesTraderHistoryOrderV2 {
trackingList: CTFuturesTraderHistoryOrderV2[];
endId: string;
}
⋮----
export interface CTRateCTimeV2 {
rate: string;
ctime: string;
}
⋮----
export interface CTAmountCTimeV2 {
amount: string;
ctime: string;
}
⋮----
export interface CTFuturesTraderTotalOrderSummaryV2 {
roi: string;
tradingOrderNum: string;
totalFollowerNum: string;
currentFollowerNum: string;
totalpl: string;
gainNum: string;
lossNum: string;
winRate: string;
tradingPairsAvailableList: string[];
lastWeekRoiList: CTRateCTimeV2[];
lastWeekProfitList: CTAmountCTimeV2[];
lastMonthRoiList: CTRateCTimeV2[];
lastMonthProfitList: CTAmountCTimeV2[];
totalEquity: string;
}
⋮----
export interface CTFuturesTraderProfitHistoryItemV2 {
coin: string;
profitCount: string;
lastProfitTime: string;
}
⋮----
export interface CTFuturesTraderHistoryProfitSummaryV2 {
profitSummary: {
yesterdayProfit: string;
sumProfit: string;
waitProfit: string;
yesterdayTime: string;
};
profitHistoryList: CTFuturesTraderProfitHistoryItemV2[];
}
⋮----
export interface CTFuturesTraderProfitShare {
profitId: string;
coin: string;
profit: string;
nickName: string;
profitTime: string;
}
⋮----
export interface CTFuturesTraderProfitShareHistoryV2 {
profitList: CTFuturesTraderProfitShare[];
endId: string;
}
⋮----
export interface CTFuturesTraderSymbolSettingsV2 {
symbol: string;
openTrader: string;
minOpenCount: string;
maxLeverage: string;
stopSurplusRatio: string;
stopLossRatio: string;
}
⋮----
export interface CTFuturesTraderMyFollowersV2 {
accountEquity: string;
isRemove: string;
followerHeadPic: string;
followerName: string;
followerUid: string;
followerTime: string;
}
⋮----
/**
*
*
* Copy Trading | Future copy trading | Follower Api
*
*
*/
⋮----
export interface CTFuturesFollowerCurrentOrdersV2 {
trackingNo: string;
traderName: string;
openOrderId: string;
closeOrderId: string;
traderId: string;
symbol: string;
posSide: string;
openLeverage: string;
openAvgPrice: string;
openTime: string;
openSize: string;
closeAvgPrice: string;
closeSize: string;
openMarginSz: string;
closeTime: string;
}
⋮----
export interface CTFuturesFollowerHistoryOrderV2 {
trackingNo: string;
posSide: string;
openLeverage: string;
openSize: string;
closeSize: string;
openPriceAvg: string;
closePriceAvg: string;
achievedPL: string;
openFee: string;
closeFee: string;
symbol: string;
profitRate: string;
netProfit: string;
openOrderId: string;
closeOrderId: string;
openTime: string;
closeTime: string;
traderId: string;
productType: string;
}
⋮----
export interface CTFuturesFollowerHistoryOrdersV2 {
trackingList: CTFuturesFollowerHistoryOrderV2[];
endId: string;
}
⋮----
export interface CTFuturesFollowerSettingV2 {
symbol: string;
productType: string;
marginType: string;
marginCoin: string;
leverType: string;
longLeverage: string;
shortLeverage: string;
traceType: string;
}
⋮----
export interface CTFuturesFollowerSettingsV2 {
followerEnable: string;
detailList: CTFuturesFollowerSettingV2[];
}
⋮----
export interface CTFuturesFollowerMyTradersV2 {
certificationType: string;
traderId: string;
traderName: string;
maxFollowLimit: string;
followCount: string;
traceTotalMarginAmount: string;
traceTotalNetProfit: string;
traceTotalProfit: string;
currentTradingPairs: string[];
followerTime: string;
bgbMaxFollowLimit: string;
bgbFollowCount: string;
}
⋮----
/**
*
*
* Copy Trading | Spot copy trading | Trader api
*
*
*/
⋮----
export interface CTSpotTraderProfitSummaryV2 {
profitSummarys: {
yesterdayProfit: string;
yesterdayTime: string;
sumProfit: string;
waitProfit: string;
};
profitHistoryList: {
coin: string;
profitCount: string;
lastProfitTime: string;
historysByDateList: {
profit: string;
profitTime: string;
}[];
}[];
}
⋮----
export interface CTSpotTraderHistoryProfitShareItemV2 {
profitId: string;
coin: string;
distributeRatio: string;
profit: string;
followerName: string;
profitTime: string;
}
⋮----
export interface CTSpotTraderHistoryProfitSharingV2 {
endId: string;
profitList: CTSpotTraderHistoryProfitShareItemV2[];
}
⋮----
export interface CTSpotTraderUnrealizedProfitV2 {
distributeRatio: string;
coin: string;
profit: string;
followerName: string;
}
⋮----
export interface CTSpotTraderTotalOrderDetailV2 {
totalFollowerNum: string;
currentFollowerNum: string;
maxFollowerNum: string;
tradingOrderNum: string;
totalpl: string;
gainNum: string;
lossNum: string;
totalEquity: string;
winRate: string;
lastWeekRoiList: CTAmountCTimeV2[];
lastMonthRoiList: CTRateCTimeV2[];
lastWeekProfitList: CTAmountCTimeV2[];
lastMonthProfitList: CTAmountCTimeV2[];
}
⋮----
export interface CTSpotTraderHistoryOrderV2 {
trackingNo: string;
fillSize: string;
buyPrice: string;
sellPrice: string;
achievedPL: string;
buyTime: string;
sellTime: string;
buyFee: string;
sellFee: string;
achievedPLR: string;
symbol: string;
netProfit: string;
followCount: string;
}
export interface CTSpotTraderHistoryOrdersV2 {
endId: string;
trackingList: CTSpotTraderHistoryOrderV2[];
}
⋮----
export interface CTSpotTraderCurrentTrackingOrderV2 {
trackingNo: string;
orderId: string;
buyFillSize: string;
buyDelegateSize: string;
buyPrice: string;
unrealizedPL: string;
buyTime: string;
buyFee: string;
unrealizedPLR: string;
symbol: string;
stopLossPrice: string | null;
stopSurplusPrice: string | null;
followCount: string;
}
⋮----
export interface CTSpotTraderCurrentTrackingOrdersV2 {
endId: string;
trackingList: CTSpotTraderCurrentTrackingOrderV2[];
}
⋮----
export interface CTSpotTraderFollowerListV2 {
accountEquity: string;
isRemove: string;
followerHeadPic: string | null;
followerName: string;
followerUid: string;
followerTime: string;
}
⋮----
/**
*
*
* Copy Trading | Spot copy trading | Follower api
*
*
*/
⋮----
export interface CTSpotFollowerMyTraderV2 {
certificationType: string;
traceTotalAmount: string;
traceTotalNetProfit: string;
traceTotalProfit: string;
traderName: string;
traderId: string;
maxFollowLimit: string;
bgbMaxFollowLimit: string;
followCount: string;
bgbFollowCount: string;
followerTime: string;
}
⋮----
export interface CTSpotFollowerMyTradersV2 {
resultList: CTSpotFollowerMyTraderV2[];
}
⋮----
export interface CTSpotFollowerTradeSettingV2 {
maxTraceAmount: string;
stopLossRation: string;
stopSurplusRation: string;
symbol: string;
traceType: string;
}
⋮----