UNPKG

bitget-api

Version:

Complete Node.js & JavaScript SDK for Bitget V1-V3 REST APIs & WebSockets, with TypeScript & end-to-end tests.

2,292 lines (2,243 loc) 358 kB
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/, dist/, lib/ - 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 V2 - Classic/ Rest/ rest-private-futures.ts rest-private-spot.ts rest-public-futures.ts rest-public-spot.ts rest-trade-futures.ts rest-trade-spot.ts Websocket/ ws-demo-trading.ts ws-private.ts ws-public.ts V3 - UTA/ Rest/ rest-private.ts rest-public-UTA-futures.ts rest-public-UTA-spot.ts rest-trade-UTA-futures.ts rest-trade-UTA-spot.ts Websocket/ ws-private.ts ws-public.ts WS-API/ ws-api-client-trade.ts ws-api-trade-raw.ts README.md src/ constants/ enum.ts types/ request/ v2/ broker.ts common.ts copytrading.ts earn.ts futures.ts margin.ts spot.ts v3/ account.ts broker.ts earn.ts loan.ts public.ts strategy.ts trade.ts shared.ts response/ v2/ broker.ts common.ts copy-trading.ts earn.ts futures.ts margin.ts spot.ts v3/ account.ts broker.ts copytrading.ts earn.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 index.ts rest-client-v2.ts rest-client-v3.ts websocket-api-client.ts websocket-client-v2.ts websocket-client-v3.ts webpack/ webpack.config.cjs .eslintrc.cjs .gitignore .jshintrc .nvmrc .prettierrc jest.config.ts LICENSE.md package.json postBuild.sh README.md tsconfig.cjs.json tsconfig.esm.json tsconfig.json tsconfig.linting.json ================================================================ Files ================================================================ ================ File: examples/Auth/fasterHmacSign.ts ================ import { createHmac } from 'crypto'; ⋮---- import { DefaultLogger, RestClientV3, WebsocketClientV3, } from '../../src/index.js'; ⋮---- // or // import { createHmac } from 'crypto'; // import { DefaultLogger, RestClientV3, WebsocketClientV3 } from 'bitget-api'; ⋮---- /** * Injecting a custom signMessage function. * * As of version 3.0.0 of the bitget-api Node.js/TypeScript/JavaScript * SDK for Bitget, the SDK uses the Web Crypto API for signing requests. * While it is compatible with Node and Browser environments, it is * slightly slower than using Node's native crypto module (only * available in backend Node environments). * * For latency sensitive users, you can inject the previous node crypto sign * method (or your own even faster implementation), if this change affects you. * * This example demonstrates how to inject a custom sign function, to achieve * the same peformance as seen before the Web Crypto API was introduced. * * For context on standard usage, the "signMessage" function is used: * - During every single API call * - After opening a new private WebSocket connection */ ⋮---- /** * Set this to true to enable demo trading: */ ⋮---- /** * Overkill in almost every case, but if you need any optimisation available, * you can inject a faster sign mechanism such as node's native createHmac: */ ⋮---- // Optional, uncomment the "trace" override to log a lot more info about what the WS client is doing ⋮---- // trace: (...params) => console.log('trace', ...params), ⋮---- /** * Set this to true to enable demo trading for the private account data WS * Topics: order,execution,position,wallet,greeks */ ⋮---- /** * Overkill in almost every case, but if you need any optimisation available, * you can inject a faster sign mechanism such as node's native createHmac: */ ⋮---- function setWsClientEventListeners( websocketClient: WebsocketClientV3, accountRef: string, ): Promise<void> ⋮---- // console.log('raw message received ', JSON.stringify(data, null, 2)); ⋮---- // Simple promise to ensure we're subscribed before trying anything else ⋮---- // Start trading ================ File: examples/Auth/rest-private-rsa.md ================ # RSA Authentication with Bitget APIs in Node.js, JavaScript & TypeScript ## Creating RSA Keys Officially, Bitget recommends downloading and running a key generator from their repo. Guidance for this can be found on the Bitget's website when trying to add a new RSA API key. However, openssl can be used to create the public & private key files using the following steps: ```bash # Generate a private key with either 2048 or 4096 bit length openssl genrsa -out rsa-private-key.pem 4096 # Generate a corresponding public key openssl rsa -in rsa-private-key.pem -pubout -out rsa-public-key.pem ``` ## Using the RSA public key to get an API key from Bitget Once created, keep your **private key** completely secret! The **public** key needs to be provided to Bitget when creating new API credentials with the "Self-generated" option. Your public key should look something like this: ```pem -----BEGIN PUBLIC KEY----- MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA1uWxxOXZUaX6AeZszf4x rBsU6axA5ipwxG7VPihVgssphDrrSOD0hZqnBmtF2bvT9ee1U0XOfMn+H+J5SH+1 jgUpfioqH0L+KXl6wmLoPsadgfJz0SiQlFnKTkDXvMmecr6cdMHi2qNEx4CMc68C obvQ4Voz5qqpDwbohGtJh0p10PB//0Ejcoz0UwrTDq8BGeFmWa9pL/7h2vHtw+QU UxlnGmt98M8KkKqqvVicMK+IVtng/QlDw9ofG2kQcbBkPRaTjNI+8ULtCDH0sOkZ nT8PtGm4sEwmWH/dRWtUTWkMnUwCzuo/rWPb7WMprW2pKDTrLjUAr9M161t3Xa6W JO03K3NOxupy7ilululLY8d/WKWYDOZMvS5bPiPRUoZqlJneC0CT/2q1W6GfWzsT DCDTpgq/Ao7jTtnME9iadpwvFn0nMtNgJSrFDWPq8vKY9pRcEp/Na5qvIEOQIFnp /kIDPuMf+LZwO8lGFO3jnndY+62835rm7t6ZNM3NLoNCarvUCEasobgDJHw7x7c1 fW/OxYtLrWGdMpsP0MewgGJZXcT7mvlBjQ+JWLoyIc5rYMIDw9RLWUPnrlRCxvPp sD9kDX7eaipdoik5yLyMaRvd16Vt9Bck/9pbSHazm41m/nd4KCZeGdsvrAA2beww zFWQQV9EX6/VLBgbnGTsMe0CAwEAAQ== -----END PUBLIC KEY----- ``` Submit this in the "Upload public key" form, shown when creating a new API key on Bitget and choosing the "self-generated"/RSA option. Note: the "-----BEGIN PUBLIC KEY-----" and "-----END PUBLIC KEY-----" header & footer can be included. After using the public key to create a new API key, you will be given an API Key such as the following: ``` SIHqWcDeRoj6gkOjLjQh1dnV1CD7IgwQTfL4LVa8wu04zNTYVSmJBIHsjQjgwWqt ``` This is the first piece, used as the "apiKey" in the [rest-private-rsa.ts](./rest-private-rsa.ts) example. ## Using the RSA private key for RSA authentication with Bitget APIs in Node.js Your private key, if generated with the above steps, should look something like this (but with much more text): ```pem -----BEGIN RSA PRIVATE KEY----- uayyi6wFTaNeG1/WCqhrowj2kCx8eB6NDZYl+OS9ZI9WC q/44iFERNuP0TXvQx8tgvSZXyu4/G618QzKh0Ii1uAATt2upa8dp1uGl2U7EqBE8 p5y4pPzJuwvB3j6LQON20u2Wpbg8PQZACMfKym7lYDO+9MloK/gAQpyeYJzbw92C YE/ymq4JVjCMCQKCAQEA4/X0I9TO8vT0D0l83o693QA3C09uSZ6j9Obx5UrtDnA9 sMkkRoe+R/vvIpVDzukMEEOmCuxbcdPoniVUKlTooK0Llo6JJ1l8CdFzQsOR97Pe csB6pxkLLH2qHx05xPBy4PyoB -----END RSA PRIVATE KEY----- ``` This is your secret, you should never share this with anyone, not even Bitget! Treat this like a password. As part of this authentication process, your private key is used to generate a signature (using `RSA-SHA256`). This SDK handles this process automatically for you. RSA authentication is automatically detected if the "api_secret" parameter contains the words "PRIVATE KEY", such as the header shown in the example above. From here, simply use the key provided by Bitget as the `api_key` parameter and your private key (with the header) as the `api_secret` parameter. Based on the above example, the following would prepare the main REST client using the above credentials: ```typescript // Received after creating a new API key with a self-generated RSA public key on Bitget const API_KEY = 'bg_0866563123123123123f567e83e52fd'; // The self-generated RSA private key, this is never directly given to Bitget, but used to generate a signature // Note: this MUST include the "BEGIN PRIVATE KEY" header so that the SDK understands this is RSA auth const rsaPrivateKey = ` -----BEGIN PRIVATE KEY----- MIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQC4kNgO71O0xkuH FjHnr5pimpEeiGPAtDTAeJoS55+kVrh3ThHsm0ARf36zimU gwrCWAnKqPlbqzWzs9mH9JvZWrEaOgWy 8wMSJ21vtz1rRJhfaUUsOC1KLoWyvzqWW44zKaxoKSqCUMJqDbxIq7RjGlmc8KGJ scFWRSdfGEEpvqLlpTLoEtWHZP0pUUamSWrH/IgieFFhKaOPvmED24DJAlqSeEFw z7TW4dfWPRgjCRu4AAfgCtjb+3/7ONeQfx5XFvKFM7VNi/9sRh+alRqpzKrlI 79bM1p/egrC4c8KUqrNk2s5c3HIU......THISISANEXAMPLE -----END PRIVATE KEY----- `; // This is set by you when registering your RSA API key in Bitget's website. const API_PASS = 'TestingRSA'; const client = new RestClientV2({ apiKey: API_KEY, apiSecret: rsaPrivateKey, apiPass: API_PASS, }); const clientV3 = new RestClientV3({ apiKey: API_KEY, apiSecret: rsaPrivateKey, apiPass: API_PASS, }); ``` For a complete example, refer to the [rest-private-rsa.ts](./rest-private-rsa.ts) file on GitHub. ================ File: examples/Auth/rest-private-rsa.ts ================ import { RestClientV2, RestClientV3 } from '../../src/index.js'; ⋮---- // Import frmo NPM: // import { RestClientV2, RestClientV3 } from 'bitget-api'; // or if you prefer require: // const { RestClientV2, RestClientV3 } = require('bitget-api'); ⋮---- // Received after creating a new API key with a self-generated RSA public key on Bitget ⋮---- // The self-generated RSA private key, this is never directly given to Bitget, but used to generate a signature // Note: this MUST include the "BEGIN PRIVATE KEY" header so that the SDK understands this is RSA auth ⋮---- // This is set by you when registering your RSA API key in Bitget's website. ⋮---- // const wsClient = new WebsocketClientV2({ // apiKey: API_KEY, // apiSecret: rsaPrivateKey, // apiPass: API_PASS, // }); ================ File: src/types/request/v2/common.ts ================ import { FuturesProductTypeV2, MarginType } from '../shared.js'; ⋮---- /** * * * Common | Notice * */ ⋮---- export interface GetAnnouncementsRequestV2 { annType?: string; startTime?: string; endTime?: string; language: string; } ⋮---- /** * * * Common | Public * */ ⋮---- export interface GetTradeRateRequestV2 { symbol: string; businessType: string; } ⋮---- /** * * * Common | Tax * */ ⋮---- export interface GetSpotTransactionsRequestV2 { coin?: string; startTime: string; endTime: string; limit?: string; idLessThan?: string; } ⋮---- export interface GetFuturesTransactionsRequestV2 { productType?: FuturesProductTypeV2; marginCoin?: string; startTime: string; endTime: string; limit?: string; idLessThan?: string; } ⋮---- export interface GetMarginTransactionsRequestV2 { marginType?: MarginType; coin?: string; startTime: string; endTime: string; limit?: string; idLessThan?: string; } ⋮---- export interface GetP2PTransactionsRequestV2 { coin?: string; startTime: string; endTime: string; limit?: string; idLessThan?: string; } ⋮---- /** * * * Common | P2P * */ ⋮---- export interface GetP2PMerchantsRequestV2 { online?: 'yes' | 'no'; idLessThan?: string; limit?: string; } ⋮---- export interface GetMerchantP2POrdersRequestV2 { startTime: string; endTime?: string; idLessThan?: string; limit?: string; status?: string; advNo: string; side?: string; coin?: string; language: string; fiat?: string; orderNo?: string; } ⋮---- export interface GetMerchantAdvertisementsRequestV2 { startTime: string; endTime?: string; idLessThan?: string; limit?: string; status: string; advNo?: string; side: string; coin: string; language?: string; fiat: string; orderBy?: string; payMethodId?: string; sourceType?: string; } ⋮---- /** * * * Common | Virtual Subaccount * */ ⋮---- export interface ModifyVirtualSubRequestV2 { subAccountUid: string; permList: string[]; status: string; } ⋮---- export interface CreateVirtualSubRequestV2 { subAccountName: string; passphrase: string; label: string; ipList?: string[]; permList?: string[]; } ⋮---- export interface CreateVirtualSubApiKeyRequestV2 { subAccountUid: string; passphrase: string; label: string; ipList?: string[]; permList?: string[]; } ⋮---- export interface ModifyVirtualSubApiKeyRequestV2 { subAccountUid: string; subAccountApiKey: string; passphrase: string; label: string; ipList?: string[]; permList?: string[]; } ⋮---- /** * * * Common | Convert * */ ⋮---- export interface ConvertQuoteRequestV2 { fromCoin: string; fromCoinSize?: string; toCoin: string; toCoinSize?: string; } ⋮---- export interface ConvertRequestV2 { fromCoin: string; fromCoinSize: string; cnvtPrice: string; toCoin: string; toCoinSize: string; traceId: string; } ⋮---- export interface GetConvertHistoryRequestV2 { startTime: string; endTime: string; limit?: string; idLessThan?: string; } ⋮---- /** * * * Common | BGB Convert * */ ⋮---- export interface GetConvertBGBHistoryRequestV2 { orderId?: string; startTime: string; endTime: string; limit?: string; idLessThan?: 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; } ⋮---- /** * * * Earn | On-Chain Elite * * */ ⋮---- export interface GetEarnEliteRecordsRequestV2 { type: 'subscribe' | 'redeem' | 'interest'; startTime?: string; endTime?: string; limit?: string; cursor?: string; } ⋮---- export interface GetEarnEliteSubscribeInfoRequestV2 { productId: string; } ⋮---- export interface EarnEliteSubscribeRequestV2 { productSubId: string; amount: string; coin?: string; paymentAccount?: 'spot' | 'unified'; } ⋮---- export interface GetEarnEliteSubscribeResultRequestV2 { orderId: string; } ⋮---- export interface GetEarnEliteRedeemInfoRequestV2 { productId: string; } ⋮---- export interface RedeemEarnEliteRequestV2 { productId: string; productSubId: string; redeemType: 'fast' | 'standard'; amount: string; receiveAccount: 'spot' | 'unified'; advancedSettle?: 'yes' | 'no'; coin?: 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/earn.ts ================ /** * * * Earn | On-Chain Elite (UTA) * * */ ⋮---- export interface GetEarnEliteRecordsRequestV3 { type: 'subscribe' | 'redeem' | 'interest'; startTime?: string; endTime?: string; limit?: string; cursor?: string; } ⋮---- export interface GetEarnEliteSubscribeInfoRequestV3 { productId: string; } ⋮---- export interface EarnEliteSubscribeRequestV3 { productSubId: string; amount: string; coin?: string; paymentAccount?: 'spot' | 'unified'; } ⋮---- export interface GetEarnEliteSubscribeResultRequestV3 { orderId: string; } ⋮---- export interface GetEarnEliteRedeemInfoRequestV3 { productId: string; } ⋮---- export interface RedeemEarnEliteRequestV3 { productId: string; productSubId: string; redeemType: 'fast' | 'standard'; amount: string; receiveAccount: 'spot' | 'unified'; advancedSettle?: 'yes' | 'no'; coin?: 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/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; gainN